-int PicoPicoPenPos[2] = { 0x3c, 0x200 };
-int PicoPicoPage = 0; // 0-6
+picohw_state PicoPicohw;
+
+static int prev_line_cnt_irq3 = 0, prev_line_cnt_irq5 = 0;
+
+static void PicoLineHookPico(int count)
+{
+
+ PicoPicohw.line_counter += count;
+ if ((PicoPicohw.line_counter & 0xf) == 0 || count > 10)
+ {
+ if (PicoPicohw.fifo_bytes > 0)
+ PicoPicohw.fifo_bytes--;
+ }
+
+#if 0
+ if (PicoPicohw.line_counter - prev_line_cnt_irq3 > 200) {
+ prev_line_cnt_irq3 = PicoPicohw.line_counter;
+ // just a guess/hack, allows 101 Dalmantians to boot
+ elprintf(EL_ANOMALY, "irq3");
+ SekInterrupt(3);
+ }
+#endif
+
+#if 0
+ if (PicoPicohw.line_counter - prev_line_cnt_irq5 > 512) {
+ prev_line_cnt_irq5 = PicoPicohw.line_counter;
+ elprintf(EL_ANOMALY, "irq5");
+ SekInterrupt(5);
+ }
+#endif
+}