- switch (a)\r
- {\r
- case 0: return VideoRead() >> 8;\r
- case 1: return VideoRead() & 0xff;\r
- case 4: // control port/status reg\r
- d = Pico.video.status >> 8;\r
- if (d&1) Pico.video.status&=~0x100; // FIFO no longer full\r
- Pico.video.pending = 0;\r
- elprintf(EL_SR, "SR read (h): %02x @ %06x", d, SekPc);\r
- return d;\r
- case 5:\r
- d = Pico.video.status & 0xff;\r
- //if (PicoOpt&POPT_ALT_RENDERER) d|=0x0020; // sprite collision (Shadow of the Beast)\r
- d |= ((Pico.video.reg[1]&0x40)^0x40) >> 3; // set V-Blank if display is disabled\r
- d |= (Pico.video.pending_ints&0x20)<<2; // V-int pending?\r
- if (SekCyclesLeft < 84+4) d |= 4; // H-Blank\r
- Pico.video.pending = 0;\r
- elprintf(EL_SR, "SR read (l): %02x @ %06x", d, SekPc);\r
- return d;\r
- case 8: // hv counter\r
- elprintf(EL_HVCNT, "vcounter: %02x (%i) @ %06x", Pico.video.v_counter, SekCyclesDone(), SekPc);\r
- return Pico.video.v_counter;\r
- case 9:\r
- d = (488-SekCyclesLeft)&0x1ff;\r
- if (Pico.video.reg[12]&1)\r
- d = hcounts_40[d];\r
- else d = hcounts_32[d];\r
- elprintf(EL_HVCNT, "hcounter: %02x (%i) @ %06x", d, SekCyclesDone(), SekPc);\r
- return d;\r
- }\r