{\r
unsigned char sram_reg=Pico.m.sram_reg; // must be preserved\r
\r
+ Pico.m.frame_count = 0;\r
+\r
// clear all memory of the emulated machine\r
memset(&Pico.ram,0,(unsigned int)&Pico.rom-(unsigned int)&Pico.ram);\r
\r
\r
Pico.m.dirtyPal = 1;\r
\r
+ Pico.m.z80_bank68k = 0;\r
+ memset(Pico.zram, 0, sizeof(Pico.zram)); // ??\r
+\r
PicoDetectRegion();\r
Pico.video.status = 0x3428 | Pico.m.pal; // 'always set' bits | vblank | collision | pal\r
\r
PicoResetMCD();\r
return 0;\r
}\r
+ else {\r
+ // reinit, so that checksum checks pass\r
+ SekFinishIdleDet();\r
+ if (!(PicoOpt & POPT_DIS_IDLE_DET))\r
+ SekInitIdleDet();\r
+ }\r
\r
// reset sram state; enable sram access by default if it doesn't overlap with ROM\r
Pico.m.sram_reg=sram_reg&0x14;\r
// same for Outrunners (92-121, when active is set to 24)\r
// 96 is VR hack\r
static const int dma_timings[] = {\r
-96, 167, 166, 83, // vblank: 32cell: dma2vram dma2[vs|c]ram vram_fill vram_copy\r
-102, 205, 204, 102, // vblank: 40cell:\r
-16, 16, 15, 8, // active: 32cell:\r
-24, 18, 17, 9 // ...\r
+ 96, 167, 166, 83, // vblank: 32cell: dma2vram dma2[vs|c]ram vram_fill vram_copy\r
+ 102, 205, 204, 102, // vblank: 40cell:\r
+ 16, 16, 15, 8, // active: 32cell:\r
+ 24, 18, 17, 9 // ...\r
};\r
\r
static const int dma_bsycles[] = {\r
-(488<<8)/96, (488<<8)/167, (488<<8)/166, (488<<8)/83,\r
-(488<<8)/102, (488<<8)/205, (488<<8)/204, (488<<8)/102,\r
-(488<<8)/16, (488<<8)/16, (488<<8)/15, (488<<8)/8,\r
-(488<<8)/24, (488<<8)/18, (488<<8)/17, (488<<8)/9\r
+ (488<<8)/96, (488<<8)/167, (488<<8)/166, (488<<8)/83,\r
+ (488<<8)/102, (488<<8)/205, (488<<8)/204, (488<<8)/102,\r
+ (488<<8)/16, (488<<8)/16, (488<<8)/15, (488<<8)/8,\r
+ (488<<8)/24, (488<<8)/18, (488<<8)/17, (488<<8)/9\r
};\r
\r
PICO_INTERNAL int CheckDMA(void)\r
{\r
int cyc_do;\r
SekCycleAim+=cyc;\r
- if((cyc_do=SekCycleAim-SekCycleCnt) <= 0) return;\r
+ if ((cyc_do=SekCycleAim-SekCycleCnt) <= 0) return;\r
#if defined(EMU_CORE_DEBUG)\r
// this means we do run-compare\r
SekCycleCnt+=CM_compareRun(cyc_do, 0);\r
\r
SekCyclesReset();\r
z80_resetCycles();\r
- timers_cycle();\r
\r
// 6 button pad: let's just say it timed out now\r
Pico.m.padTHPhase[0]=Pico.m.padTHPhase[1]=0;\r
if (!(PicoOpt&POPT_ALT_RENDERER))\r
{\r
// Draw the screen\r
+#if 0\r
#if CAN_HANDLE_240_LINES\r
if (pv->reg[1]&8) {\r
for (y=0;y<240;y++) PicoLine(y);\r
}\r
#else\r
for (y=0;y<224;y++) PicoLine(y);\r
+#endif\r
#endif\r
}\r
else PicoFrameFull();\r
if (PsndOut && ym2612.dacen && PsndDacLine <= line_last)\r
PsndDoDAC(line_last);\r
\r
+ timers_cycle();\r
+\r
return 0;\r
}\r
\r
+int idle_hit_counter = 0;\r
+\r
int PicoFrame(void)\r
{\r
int acc;\r
\r
+ if ((Pico.m.frame_count&0x3f) == 0) {\r
+ elprintf(EL_STATUS, "ihits: %i", idle_hit_counter);\r
+ idle_hit_counter = 0;\r
+ }\r
+\r
Pico.m.frame_count++;\r
\r
if (PicoAHW & PAHW_MCD) {\r