mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-22 09:30:15 +00:00
WM_CREATE: call CpuCreateCriticalSection() instead of CpuInitialize()
This commit is contained in:
parent
3fe06faf65
commit
b519031de4
@ -636,6 +636,7 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
|
||||
// Called by:
|
||||
// . CpuInitialize()
|
||||
// . SY6522.Reset()
|
||||
// . FrameCreateWindow() -> WM_CREATE
|
||||
void CpuCreateCriticalSection(void)
|
||||
{
|
||||
if (!g_bCritSectionValid)
|
||||
@ -648,16 +649,13 @@ void CpuCreateCriticalSection(void)
|
||||
//===========================================================================
|
||||
|
||||
// Called from RepeatInitialization():
|
||||
// 1) FrameCreateWindow() -> WM_CREATE
|
||||
// - done to init g_CriticalSection
|
||||
// - but can't call CpuReset() as mem == NULL
|
||||
// 2) MemInitialize() -> MemReset()
|
||||
void CpuInitialize(bool reset)
|
||||
// . MemInitialize() -> MemReset()
|
||||
void CpuInitialize(void)
|
||||
{
|
||||
regs.a = regs.x = regs.y = 0xFF;
|
||||
regs.sp = 0x01FF;
|
||||
if (reset)
|
||||
CpuReset();
|
||||
|
||||
CpuReset();
|
||||
|
||||
CpuCreateCriticalSection();
|
||||
|
||||
@ -683,6 +681,8 @@ void CpuDestroy()
|
||||
|
||||
void CpuReset()
|
||||
{
|
||||
_ASSERT(mem != NULL);
|
||||
|
||||
// 7 cycles
|
||||
regs.ps = (regs.ps | AF_INTERRUPT) & ~AF_DECIMAL;
|
||||
regs.pc = *(WORD*)(mem + 0xFFFC);
|
||||
|
@ -33,7 +33,7 @@ void CpuCalcCycles(ULONG nExecutedCycles);
|
||||
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate);
|
||||
ULONG CpuGetCyclesThisVideoFrame(ULONG nExecutedCycles);
|
||||
void CpuCreateCriticalSection(void);
|
||||
void CpuInitialize(bool reset);
|
||||
void CpuInitialize(void);
|
||||
void CpuSetupBenchmark ();
|
||||
void CpuIrqReset();
|
||||
void CpuIrqAssert(eIRQSRC Device);
|
||||
|
@ -1926,7 +1926,7 @@ void MemReset()
|
||||
|
||||
// INITIALIZE & RESET THE CPU
|
||||
// . Do this after ROM has been copied back to mem[], so that PC is correctly init'ed from 6502's reset vector
|
||||
CpuInitialize(true);
|
||||
CpuInitialize();
|
||||
//Sets Caps Lock = false (Pravets 8A/C only)
|
||||
|
||||
z80_reset(); // NB. Also called above in CpuInitialize()
|
||||
|
@ -1001,8 +1001,8 @@ LRESULT Win32Frame::WndProc(
|
||||
DIMouse::DirectInputInit(window);
|
||||
LogFileOutput("WM_CREATE: DIMouse::DirectInputInit()\n");
|
||||
|
||||
CpuInitialize(false); // NB. Creates CriticalSection that's needed by MB_Initialize()
|
||||
LogFileOutput("WM_CREATE: CpuInitialize()\n");
|
||||
CpuCreateCriticalSection(); // NB. Creates CriticalSection that's needed by MB_Initialize() -- required on a VM restart
|
||||
LogFileOutput("WM_CREATE: CpuCreateCriticalSection()\n");
|
||||
|
||||
MB_Initialize();
|
||||
LogFileOutput("WM_CREATE: MB_Initialize()\n");
|
||||
|
Loading…
Reference in New Issue
Block a user