- PicoRunZ80Simple(line, lines);\r
- if (PicoLineHook) PicoLineHook(lines_step);\r
- line=lines;\r
- }\r
-\r
- // run Z80 for remaining sections\r
- if(sects) {\r
- int c = sects*cycles_68k_block;\r
-\r
- // this "run" is for approriate line counter, etc\r
- SekCycleCnt += c;\r
- SekCycleAim += c;\r
-\r
- lines += sects*lines_step;\r
- PicoRunZ80Simple(line, lines);\r
- if (PicoLineHook) PicoLineHook(sects*lines_step);\r
- }\r
-\r
- // another hack for VR (it needs hints to work)\r
- if (PicoAHW & PAHW_SVP) {\r
- Pico.ram[0xd864^1] = 1;\r
- pv->pending_ints|=0x10;\r
- if (pv->reg[0]&0x10) SekInterrupt(4);\r
- SekRunM68k(160);\r
- }\r
-\r
- // render screen\r
- if (!PicoSkipFrame)\r
- {\r
- if (!(PicoOpt&POPT_ALT_RENDERER))\r
- {\r
- // Draw the screen\r
-#if CAN_HANDLE_240_LINES\r
- if (pv->reg[1]&8) {\r
- for (y=0;y<240;y++) PicoLine(y);\r
- } else {\r
- for (y=0;y<224;y++) PicoLine(y);\r
- }\r
-#else\r
- for (y=0;y<224;y++) PicoLine(y);\r
-#endif\r
- }\r
- else PicoFrameFull();\r
-#ifdef DRAW_FINISH_FUNC\r
- DRAW_FINISH_FUNC();\r
-#endif\r
- }\r
-\r
- // here we render sound if ym2612 is disabled\r
- if (!(PicoOpt&POPT_EN_FM) && PsndOut) {\r
- int len = PsndRender(0, PsndLen);\r
- if (PicoWriteSound) PicoWriteSound(len);\r
- // clear sound buffer\r
- PsndClear();\r
- }\r
-\r
- // a gap between flags set and vint\r
- pv->pending_ints|=0x20;\r
- pv->status|=8; // go into vblank\r
- SekRunM68k(68+4);\r
-\r
- // ---- V-Blanking period ----\r
- // fix line counts\r
- if(Pico.m.pal) {\r
- if(pv->reg[1]&8) { // 240 lines\r
- lines = line = 240;\r
- sects = 3;\r
- lines_step = 24;\r
- } else {\r
- lines = line = 224;\r
- sects = 4;\r
- lines_step = 22;\r
- }\r
- } else {\r
- lines = line = 224;\r
- sects = 2;\r
- lines_step = 19;\r
- }\r
-\r
- if (pv->reg[1]&0x20) SekInterrupt(6); // Set IRQ\r
- if (Pico.m.z80Run && (PicoOpt&POPT_EN_Z80))\r
- z80_int();\r
-\r
- while (sects)\r
- {\r
- lines += lines_step;\r
-\r
- SekRunM68k(cycles_68k_vblock);\r
-\r
- PicoRunZ80Simple(line, lines);\r
- if (PicoLineHook) PicoLineHook(lines_step);\r
- line=lines;\r
-\r
- sects--;\r
- if (sects && CheckIdle()) break;\r
- }\r
-\r
- // run Z80 for remaining sections\r
- if (sects) {\r
- lines += sects*lines_step;\r
- PicoRunZ80Simple(line, lines);\r
- if (PicoLineHook) PicoLineHook(sects*lines_step);\r
- }\r
-\r
- return 0;\r