mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-13 02:29:40 +00:00
MB: Moved MB_StartOfCpuExecute() to Snapshot_LoadState_v2(), since it's only needed there
This commit is contained in:
parent
e03b68b7f0
commit
960af9bda0
|
@ -556,7 +556,9 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
|
||||||
{
|
{
|
||||||
g_nCyclesExecuted = 0;
|
g_nCyclesExecuted = 0;
|
||||||
|
|
||||||
MB_StartOfCpuExecute();
|
#ifdef _DEBUG
|
||||||
|
MB_CheckCumulativeCycles();
|
||||||
|
#endif
|
||||||
|
|
||||||
// uCycles:
|
// uCycles:
|
||||||
// =0 : Do single step
|
// =0 : Do single step
|
||||||
|
|
|
@ -1494,7 +1494,7 @@ void MB_Destroy()
|
||||||
static void ResetState()
|
static void ResetState()
|
||||||
{
|
{
|
||||||
g_nMBTimerDevice = kTIMERDEVICE_INVALID;
|
g_nMBTimerDevice = kTIMERDEVICE_INVALID;
|
||||||
g_uLastCumulativeCycles = 0;
|
MB_SetCumulativeCycles();
|
||||||
|
|
||||||
g_nSSI263Device = 0;
|
g_nSSI263Device = 0;
|
||||||
g_nCurrentActivePhoneme = -1;
|
g_nCurrentActivePhoneme = -1;
|
||||||
|
@ -1761,8 +1761,19 @@ void MB_Demute()
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Called by CpuExecute() before doing CPU emulation
|
#ifdef _DEBUG
|
||||||
void MB_StartOfCpuExecute()
|
void MB_CheckCumulativeCycles()
|
||||||
|
{
|
||||||
|
if (g_SoundcardType == CT_Empty)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_ASSERT(g_uLastCumulativeCycles == g_nCumulativeCycles);
|
||||||
|
g_uLastCumulativeCycles = g_nCumulativeCycles;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Called by: ResetState() and Snapshot_LoadState_v2()
|
||||||
|
void MB_SetCumulativeCycles()
|
||||||
{
|
{
|
||||||
g_uLastCumulativeCycles = g_nCumulativeCycles;
|
g_uLastCumulativeCycles = g_nCumulativeCycles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,10 @@ void MB_InitializeForLoadingSnapshot(void);
|
||||||
void MB_InitializeIO(LPBYTE pCxRomPeripheral, UINT uSlot4, UINT uSlot5);
|
void MB_InitializeIO(LPBYTE pCxRomPeripheral, UINT uSlot4, UINT uSlot5);
|
||||||
void MB_Mute();
|
void MB_Mute();
|
||||||
void MB_Demute();
|
void MB_Demute();
|
||||||
void MB_StartOfCpuExecute();
|
#ifdef _DEBUG
|
||||||
|
void MB_CheckCumulativeCycles(); // DEBUG
|
||||||
|
#endif
|
||||||
|
void MB_SetCumulativeCycles();
|
||||||
void MB_PeriodicUpdate(UINT executedCycles);
|
void MB_PeriodicUpdate(UINT executedCycles);
|
||||||
void MB_CheckIRQ();
|
void MB_CheckIRQ();
|
||||||
bool MB_UpdateCycles(ULONG uExecutedCycles);
|
bool MB_UpdateCycles(ULONG uExecutedCycles);
|
||||||
|
|
|
@ -437,6 +437,7 @@ static void Snapshot_LoadState_v2(void)
|
||||||
throw std::string("Unknown top-level scalar: " + scalar);
|
throw std::string("Unknown top-level scalar: " + scalar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MB_SetCumulativeCycles();
|
||||||
SetLoadedSaveStateFlag(true);
|
SetLoadedSaveStateFlag(true);
|
||||||
|
|
||||||
// NB. The following disparity should be resolved:
|
// NB. The following disparity should be resolved:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user