-}\r
-\r
-\r
-#if 1*0\r
-int vint_delay = 205/*68*/, as_delay = 18/*148*/;\r
-\r
-// Accurate but slower frame which does hints\r
-static int PicoFrameHints(void)\r
-{\r
- struct PicoVideo *pv=&Pico.video;\r
- int total_z80=0,lines,y,lines_vis = 224,z80CycleAim = 0,line_sample;\r
- const int cycles_68k=488,cycles_z80=228; // both PAL and NTSC compile to same values\r
- int skip=PicoSkipFrame || (PicoOpt&0x10);\r
- int hint; // Hint counter\r
-\r
- if(Pico.m.pal) { //\r
- //cycles_68k = (int) ((double) OSC_PAL / 7 / 50 / 312 + 0.4); // should compile to a constant (488)\r
- //cycles_z80 = (int) ((double) OSC_PAL / 15 / 50 / 312 + 0.4); // 228\r
- lines = 312; // Steve Snake says there are 313 lines, but this seems to also work well\r
- line_sample = 68;\r
- if(pv->reg[1]&8) lines_vis = 240;\r
- } else {\r
- //cycles_68k = (int) ((double) OSC_NTSC / 7 / 60 / 262 + 0.4); // 488\r
- //cycles_z80 = (int) ((double) OSC_NTSC / 15 / 60 / 262 + 0.4); // 228\r
- lines = 262;\r
- line_sample = 93;\r
- }\r
-\r
- SekCyclesReset();\r
- //z80ExtraCycles = 0;\r
-\r
- if(PicoOpt&4)\r
- z80CycleAim = 0;\r
-// z80_resetCycles();\r
-\r
- pv->status&=~0x88; // clear V-Int, come out of vblank\r
-\r
- hint=pv->reg[10]; // Load H-Int counter\r
- //dprintf("-hint: %i", hint);\r
-\r
- //SekRun(as_delay);\r
- SekRun(148);\r
-\r
- for (y=0;y<lines;y++)\r
- {\r
- Pico.m.scanline=(short)y;\r
-\r
- // VDP FIFO\r
- pv->lwrite_cnt -= 12;\r
- if (pv->lwrite_cnt < 0) pv->lwrite_cnt=0;\r
- if (pv->lwrite_cnt == 0)\r
- Pico.video.status|=0x200;\r
-\r
- // pad delay (for 6 button pads)\r
- if(PicoOpt&0x20) {\r
- if(Pico.m.padDelay[0]++ > 25) Pico.m.padTHPhase[0]=0;\r
- if(Pico.m.padDelay[1]++ > 25) Pico.m.padTHPhase[1]=0;\r
- }\r
-\r
- // H-Interrupts:\r
- if(y <= lines_vis && --hint < 0) // y <= lines_vis: Comix Zone, Golden Axe\r
- {\r
- //dprintf("rhint:old @ %06x", SekPc);\r
- hint=pv->reg[10]; // Reload H-Int counter\r
- pv->pending_ints|=0x10;\r
- if (pv->reg[0]&0x10) {\r
- elprintf(EL_INTS, "hint: @ %06x [%i]", SekPc, SekCycleCnt);\r
- SekInterrupt(4);\r
- }\r
- //dprintf("hint_routine: %x", (*(unsigned short*)(Pico.ram+0x0B84)<<16)|*(unsigned short*)(Pico.ram+0x0B86));\r
- }\r
-\r
- // V-Interrupt:\r
- if (y == lines_vis)\r
- {\r
- pv->status|=0x08; // go into vblank\r
- //pv->status|=0x80; // V-Int happened\r
- //if(!Pico.m.dma_bytes||(Pico.video.reg[0x17]&0x80)) {\r
- // there must be a gap between H and V ints, also after vblank bit set (Mazin Saga, Bram Stoker's Dracula)\r
- SekRun(68); SekCycleAim-=68; // 128; ?\r
- SekCycleAim-=148;\r
-// SekRun(vint_delay); SekCycleAim-=vint_delay; // 128; ?\r
-// SekCycleAim-=as_delay;\r
- //}\r
- pv->pending_ints|=0x20;\r
- if(pv->reg[1]&0x20) {\r
- elprintf(EL_INTS, "vint: @ %06x [%i]", SekPc, SekCycleCnt);\r
- SekInterrupt(6);\r
- }\r
- if(Pico.m.z80Run && (PicoOpt&4)) // ?\r
- z80_int();\r
- //dprintf("zint: [%i|%i] zPC=%04x", Pico.m.scanline, SekCyclesDone(), mz80GetRegisterValue(NULL, 0));\r
- }\r
-\r
- // decide if we draw this line\r
-#if CAN_HANDLE_240_LINES\r
- if(!skip && ((!(pv->reg[1]&8) && y<224) || ((pv->reg[1]&8) && y<240)) )\r
-#else\r
- if(!skip && y<224)\r