Add debug cmd line: '-alt-cpu-emu'

This commit is contained in:
tomcw
2025-04-04 22:16:18 +01:00
parent 839c493b67
commit c3fb55d376
5 changed files with 17 additions and 0 deletions
+4
View File
@@ -712,6 +712,10 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
{
g_cmdLine.useHdcFirmwareV2 = true;
}
else if (strcmp(lpCmdLine, "-alt-cpu-emu") == 0) // debug
{
g_cmdLine.useAltCpuEmulation = true;
}
else // unsupported
{
LogFileOutput("Unsupported arg: %s\n", lpCmdLine);
+1
View File
@@ -91,6 +91,7 @@ struct CmdLine
bool noDisk2StepperDefer; // debug
bool useHdcFirmwareV1; // debug
bool useHdcFirmwareV2;
bool useAltCpuEmulation; // debug
SS_CARDTYPE slotInsert[NUM_SLOTS];
SlotInfo slotInfo[NUM_SLOTS];
LPCSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
+8
View File
@@ -275,6 +275,7 @@ static FILE * g_hMemTempFile = NULL;
BYTE __stdcall IO_Annunciator(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCycles);
static void FreeMemImage(void);
static bool g_isMemCacheValid = true; // flag for is 'mem' valid - set in UpdatePaging() and valid for regular (not alternate) CPU emulation
static bool g_forceAltCpuEmulation = false; // set by cmd line
//=============================================================================
@@ -528,6 +529,11 @@ bool IsZeroPageFloatingBus(void)
return memreadPageType[0x0000 >> 8] == MEM_FloatingBus;
}
void ForceAltCpuEmulation(void)
{
g_forceAltCpuEmulation = true;
}
//=============================================================================
static BYTE __stdcall IORead_C00x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
@@ -1305,6 +1311,8 @@ static void UpdatePaging(BOOL initialize)
// . MemReset() -> ResetPaging(TRUE)
// . MemInitializeFromSnapshot() -> MemUpdatePaging(TRUE);
g_isMemCacheValid = !(IsAppleIIe(GetApple2Type()) && (GetCardMgr().QueryAux() == CT_Empty || GetCardMgr().QueryAux() == CT_80Col));
if (g_forceAltCpuEmulation)
g_isMemCacheValid = false;
}
modechanging = 0;
+1
View File
@@ -119,3 +119,4 @@ uint16_t ReadWordFromMemory(uint16_t addr);
void WriteByteToMemory(uint16_t addr, uint8_t data);
void CopyBytesFromMemoryPage(uint8_t* pDst, uint16_t srcAddr, size_t size);
bool IsZeroPageFloatingBus(void);
void ForceAltCpuEmulation(void);
+3
View File
@@ -918,6 +918,9 @@ static void RepeatInitialization(void)
if (g_cmdLine.noDisk2StepperDefer)
GetCardMgr().GetDisk2CardMgr().SetStepperDefer(false);
if (g_cmdLine.useAltCpuEmulation)
ForceAltCpuEmulation();
// Call DebugInitialize() after SetCurrentImageDir()
DebugInitialize();
LogFileOutput("Main: DebugInitialize()\n");