Rework default hwirq handler so there is no confusion on which pic to eoi.

Introduce two default handlers (hwpic1 and hwpic2) and register them
    accordingly.  This ensures the proper pic always gets an eoi.
Also, use DEBUG_ISR_hwpic1/2 to determine debugging level.
diff --git a/src/config.h b/src/config.h
index 7a875df..35c7e3e 100644
--- a/src/config.h
+++ b/src/config.h
@@ -142,6 +142,7 @@
 #define DEBUG_ISR_74 9
 #define DEBUG_ISR_75 1
 #define DEBUG_ISR_76 10
-#define DEBUG_ISR_hwirq 30
+#define DEBUG_ISR_hwpic1 1
+#define DEBUG_ISR_hwpic2 1
 
 #endif // config.h
diff --git a/src/pic.c b/src/pic.c
index e350d28..7ffdcb4 100644
--- a/src/pic.c
+++ b/src/pic.c
@@ -32,25 +32,22 @@
 
 // Handler for otherwise unused hardware irqs.
 void VISIBLE16
-handle_hwirq(struct bregs *regs)
+handle_hwpic1(struct bregs *regs)
 {
-    debug_isr(DEBUG_ISR_hwirq);
+    u8 isr = get_pic1_isr();
+    dprintf(DEBUG_ISR_hwpic1, "Got noisy pic1 irq %x\n", isr);
+    isr &= ~PIC1_IRQ2; // don't ever mask the cascaded irq
+    if (isr)
+        mask_pic1(isr);
+    eoi_pic1();
+}
 
-    u8 isr1 = get_pic1_isr();
-    if (! isr1) {
-        dprintf(1, "Got hwirq with no ISR\n");
-        return;
-    }
-
-    u8 isr2 = get_pic2_isr();
-    u16 isr = isr2<<8 | isr1;
-    dprintf(1, "Masking noisy irq %x\n", isr);
-    if (isr2) {
-        mask_pic2(isr2);
-        eoi_pic2();
-    } else {
-        if (! (isr1 & PIC1_IRQ2)) // don't ever mask the cascaded irq
-            mask_pic1(isr1);
-        eoi_pic1();
-    }
+void VISIBLE16
+handle_hwpic2(struct bregs *regs)
+{
+    u8 isr = get_pic2_isr();
+    dprintf(DEBUG_ISR_hwpic2, "Got noisy pic2 irq %x\n", isr);
+    if (isr)
+        mask_pic2(isr);
+    eoi_pic2();
 }
diff --git a/src/post.c b/src/post.c
index 77c7797..b286826 100644
--- a/src/post.c
+++ b/src/post.c
@@ -48,9 +48,9 @@
 
     // Initialize all hw vectors to a default hw handler.
     for (i=0x08; i<=0x0f; i++)
-        set_irq(i, entry_hwirq);
+        set_irq(i, entry_hwpic1);
     for (i=0x70; i<=0x77; i++)
-        set_irq(i, entry_hwirq);
+        set_irq(i, entry_hwpic2);
 
     // Initialize software handlers.
     set_irq(0x10, entry_10);
diff --git a/src/romlayout.S b/src/romlayout.S
index 1391a81..52449b5 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -580,7 +580,8 @@
         IRQ_ENTRY 70
         IRQ_ENTRY 74
         IRQ_ENTRY 75
-        IRQ_ENTRY hwirq
+        IRQ_ENTRY hwpic1
+        IRQ_ENTRY hwpic2
 
         // int 18/19 are special - they reset the stack and do not return.
 entry_19: