Next Generation Emulation banner

1 - 2 of 2 Posts

·
Registered
Joined
·
59 Posts
Discussion Starter · #1 · (Edited)
VBA main loop question: why VBA in main loop call emulator.emuMain twic in one cycle

My question is why VBA in main loop call emulator.emuMain (actually CPULoop) twice at on cycle?

BOOL VBA::OnIdle(LONG lCount)
{
if(emulating && debugger) {
.......
/* something need to handle first */
.......
} else if(emulating && active && !paused) {

for(int i = 0; i < 2; i++) {
emulator.emuMain(emulator.emuCount);

if(rewindSaveNeeded && rewindMemory && emulator.emuWriteMemState) {
rewindCount++;
if(rewindCount > 8)
rewindCount = 8;
if(emulator.emuWriteMemState(&rewindMemory[rewindPos*REWIND_SIZE],
REWIND_SIZE)) {
rewindPos = ++rewindPos & 7;
if(rewindCount == 8)
rewindTopPos = ++rewindTopPos & 7;
}
}

rewindSaveNeeded = false;
}

if(mouseCounter) {
if(--mouseCounter == 0) {
SetCursor(NULL);
}
}
return TRUE;
}
return FALSE;

// return CWinApp::OnIdle(lCount);
}
 

·
Premium Member
Joined
·
483 Posts
No real need other than to try to run more instructions before giving the GUI a change to process any pending messages. If this causes some problem, than it can certainly be simplified.
 
1 - 2 of 2 Posts
Top