1 #include "../PicoInt.h"
6 picohw_state PicoPicohw;
8 static int prev_line_cnt_irq3 = 0, prev_line_cnt_irq5 = 0;
10 static void PicoLineHookPico(int count)
13 PicoPicohw.line_counter += count;
14 if ((PicoPicohw.line_counter & 0xf) == 0 || count > 10)
16 if (PicoPicohw.fifo_bytes > 0)
17 PicoPicohw.fifo_bytes--;
21 if (PicoPicohw.line_counter - prev_line_cnt_irq3 > 200) {
22 prev_line_cnt_irq3 = PicoPicohw.line_counter;
23 // just a guess/hack, allows 101 Dalmantians to boot
24 elprintf(EL_ANOMALY, "irq3");
30 if (PicoPicohw.line_counter - prev_line_cnt_irq5 > 512) {
31 prev_line_cnt_irq5 = PicoPicohw.line_counter;
32 elprintf(EL_ANOMALY, "irq5");
38 PICO_INTERNAL int PicoInitPico(void)
40 elprintf(EL_STATUS, "Pico detected");
41 PicoLineHook = PicoLineHookPico;
44 memset(&PicoPicohw, 0, sizeof(PicoPicohw));
45 PicoPicohw.pen_pos[0] = 0x03c + 352/2;
46 PicoPicohw.pen_pos[1] = 0x200 + 252/2;
47 prev_line_cnt_irq3 = 0, prev_line_cnt_irq5 = 0;