     mode_switch.poll();
     select_switch.poll();
 
-    switch(demo_mode) {
-    case 0:
+    // Update status bits
+    setMX7219Reg(MX7219_DIGIT_0 + 6, status_bits);
+
+    // Update triggers
+    mode_trigger.update(mode_switch.state() == HIGH);
+    select_trigger.update(select_switch.state() == HIGH);
+
+    if(mode_trigger.triggered()) {
+        halted = !halted;
+        mode_trigger.clear();
+    }
+
+    if(halted) {
         // Update address bus
         setMX7219Reg(MX7219_DIGIT_0 + 0, MX7219_FONT[address_bus & 0xF]);
         setMX7219Reg(MX7219_DIGIT_0 + 1, MX7219_FONT[(address_bus>>4) & 0xF]);


// Showing display test
byte showing_dt;
const int DPY_TST_DURATION = 500; // milliseconds

// Display strings
byte displayWords[][6] = {
    { 0x15, 0x18, 0x12, 0x1A, 0x1A, 0x1A }, // "run   "
    { 0x16, 0x17, 0x0A, 0x15, 0x17, 0x1A }, // "StArt "
    { 0x10, 0x0A, 0x11, 0x17, 0x1A, 0x1A }, // "HALt  "

    // Display test
    showing_dt = 1;

    halted = false;

    next_demo_loop_at = millis() + DEMO_LOOP_PERIOD;
    demo_loop_count = 0;
}

void loop() {
