From f2aa8898fd86bbd25a5849f9da5a56373d09e18e Mon Sep 17 00:00:00 2001 From: tomch Date: Sat, 15 Dec 2007 23:04:01 +0000 Subject: [PATCH] Fix: HDD wasn't booting ($C0Fx I/O wasn't registered) --- AppleWin/source/Harddisk.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AppleWin/source/Harddisk.cpp b/AppleWin/source/Harddisk.cpp index a0ee19f6..c679fd60 100644 --- a/AppleWin/source/Harddisk.cpp +++ b/AppleWin/source/Harddisk.cpp @@ -223,6 +223,9 @@ bool HD_CardIsEnabled() return g_bHD_RomLoaded && g_bHD_Enabled; } +// Called by: +// . LoadConfiguration() - Done at each restart +// . DiskDlg_OK() - When HD is enabled/disabled on UI void HD_SetEnabled(bool bEnabled) { if(g_bHD_Enabled == bEnabled) @@ -230,16 +233,18 @@ void HD_SetEnabled(bool bEnabled) g_bHD_Enabled = bEnabled; + RegisterIoHandler(g_uSlot, HD_IO_EMUL, HD_IO_EMUL, NULL, NULL, NULL, NULL); + LPBYTE pCxRomPeripheral = MemGetCxRomPeripheral(); if(pCxRomPeripheral == NULL) // This will be NULL when called after loading value from Registry return; + // + if(g_bHD_Enabled) HD_Load_Rom(pCxRomPeripheral, g_uSlot); else memset(pCxRomPeripheral + g_uSlot*256, 0, HDDRVR_SIZE); - - RegisterIoHandler(g_uSlot, HD_IO_EMUL, HD_IO_EMUL, NULL, NULL, NULL, NULL); } LPCTSTR HD_GetFullName (int nDrive)