m68000, fix SekTotalCycles outside of SekRun, add note, clear some stuff on init for safety

This commit is contained in:
dinkc64 2019-06-26 00:25:51 -04:00
parent 139fa2a6ee
commit de26a6b3e6
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,7 @@
// 680x0 (Sixty Eight K) Interface
// todo: (I think!) if SekRunEnd() is called while running, wrong cycles get returned by SekRun() for m68k -dink
#include "burnint.h"
#include "m68000_intf.h"
#include "m68000_debug.h"
@ -949,6 +952,7 @@ void SekNewFrame()
nSekCycles[i] = 0;
}
nSekCyclesToDo = m68k_ICount = 0;
nSekCyclesTotal = 0;
}
@ -1436,7 +1440,7 @@ INT32 SekRun(const INT32 nCycles)
nSekCyclesSegment = m68k_execute(nCycles);
nSekCyclesTotal += nSekCyclesSegment;
nSekCyclesToDo = m68k_ICount = -1;
nSekCyclesToDo = m68k_ICount = 0; // was -1; changed june26, 2019 -dink
return nSekCyclesSegment;
#else

View File

@ -985,7 +985,9 @@ void m68k_init(void)
/* The first call to this function initializes the opcode handler jump table */
if(!emulation_initialized)
{
{
memset(&m68ki_cpu, 0, sizeof(m68ki_cpu));
memset(&m68ki_cycles, 0, 0x10000 * 4);
m68ki_build_opcode_table();
emulation_initialized = 1;
}