mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-08 13:31:00 +00:00
HDD: Fixed not being able to enable HDDs - regression introduced at 506a52f359
This commit is contained in:
parent
826dc6625e
commit
31b78aa09a
@ -676,7 +676,7 @@ void LoadConfiguration(void)
|
||||
g_bPrinterAppend = dwTmp ? true : false;
|
||||
|
||||
|
||||
if(REGLOAD(TEXT(REGVALUE_HDD_ENABLED), &dwTmp))
|
||||
if(REGLOAD(TEXT(REGVALUE_HDD_ENABLED), &dwTmp)) // TODO: Change to REGVALUE_SLOT7
|
||||
HD_SetEnabled(dwTmp ? true : false);
|
||||
|
||||
if(REGLOAD(TEXT(REGVALUE_PDL_XTRIM), &dwTmp))
|
||||
|
@ -21,6 +21,7 @@ public:
|
||||
m_SlotAux = CT_Empty;
|
||||
m_Slot[4] = g_Slot[4];
|
||||
m_Slot[5] = g_Slot[5];
|
||||
m_Slot[7] = g_Slot[7];
|
||||
}
|
||||
|
||||
const CConfigNeedingRestart& operator= (const CConfigNeedingRestart& other)
|
||||
|
@ -118,16 +118,28 @@ void CPropertySheetHelper::SaveCpuType(eCpuType NewCpuType)
|
||||
REGSAVE(TEXT(REGVALUE_CPU_TYPE), NewCpuType);
|
||||
}
|
||||
|
||||
void CPropertySheetHelper::SetSlot4(SS_CARDTYPE NewCardType)
|
||||
void CPropertySheetHelper::SetSlot(UINT slot, SS_CARDTYPE newCardType)
|
||||
{
|
||||
g_Slot[4] = NewCardType;
|
||||
REGSAVE(TEXT(REGVALUE_SLOT4), (DWORD)g_Slot[4]);
|
||||
}
|
||||
_ASSERT(slot < NUM_SLOTS);
|
||||
if (slot >= NUM_SLOTS)
|
||||
return;
|
||||
|
||||
void CPropertySheetHelper::SetSlot5(SS_CARDTYPE NewCardType)
|
||||
{
|
||||
g_Slot[5] = NewCardType;
|
||||
REGSAVE(TEXT(REGVALUE_SLOT5), (DWORD)g_Slot[5]);
|
||||
g_Slot[slot] = newCardType;
|
||||
|
||||
std::string slotText;
|
||||
switch (slot)
|
||||
{
|
||||
case 0: slotText = REGVALUE_SLOT0; break;
|
||||
case 1: slotText = REGVALUE_SLOT1; break;
|
||||
case 2: slotText = REGVALUE_SLOT2; break;
|
||||
case 3: slotText = REGVALUE_SLOT3; break;
|
||||
case 4: slotText = REGVALUE_SLOT4; break;
|
||||
case 5: slotText = REGVALUE_SLOT5; break;
|
||||
case 6: slotText = REGVALUE_SLOT6; break;
|
||||
case 7: slotText = REGVALUE_SLOT7; break;
|
||||
}
|
||||
|
||||
REGSAVE(slotText.c_str(), (DWORD)g_Slot[slot]);
|
||||
}
|
||||
|
||||
// Looks like a (bad) C&P from SaveStateSelectImage()
|
||||
@ -395,15 +407,21 @@ void CPropertySheetHelper::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew
|
||||
SaveCpuType(ConfigNew.m_CpuType);
|
||||
}
|
||||
|
||||
if (CONFIG_CHANGED_LOCAL(m_Slot[4]))
|
||||
SetSlot4(ConfigNew.m_Slot[4]);
|
||||
UINT slot = 4;
|
||||
if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
|
||||
SetSlot(slot, ConfigNew.m_Slot[slot]);
|
||||
|
||||
if (CONFIG_CHANGED_LOCAL(m_Slot[5]))
|
||||
SetSlot5(ConfigNew.m_Slot[5]);
|
||||
slot = 5;
|
||||
if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
|
||||
SetSlot(slot, ConfigNew.m_Slot[slot]);
|
||||
|
||||
// slot = 7;
|
||||
// if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
|
||||
// SetSlot(slot, ConfigNew.m_Slot[slot]);
|
||||
|
||||
if (CONFIG_CHANGED_LOCAL(m_bEnableHDD))
|
||||
{
|
||||
REGSAVE(TEXT(REGVALUE_HDD_ENABLED), ConfigNew.m_bEnableHDD ? 1 : 0);
|
||||
REGSAVE(TEXT(REGVALUE_HDD_ENABLED), ConfigNew.m_bEnableHDD ? 1 : 0); // TODO: Change to REGVALUE_SLOT7
|
||||
}
|
||||
|
||||
if (CONFIG_CHANGED_LOCAL(m_bEnableTheFreezesF8Rom))
|
||||
|
@ -14,8 +14,7 @@ public:
|
||||
virtual ~CPropertySheetHelper(){}
|
||||
|
||||
void FillComboBox(HWND window, int controlid, LPCTSTR choices, int currentchoice);
|
||||
void SetSlot4(SS_CARDTYPE NewCardType);
|
||||
void SetSlot5(SS_CARDTYPE NewCardType);
|
||||
void SetSlot(UINT slot, SS_CARDTYPE newCardType);
|
||||
std::string BrowseToFile(HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE,TCHAR* FILEMASKS);
|
||||
void SaveStateUpdate();
|
||||
int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave);
|
||||
|
@ -147,7 +147,7 @@ struct HDD
|
||||
ImageInfo* imagehandle; // Init'd by HD_Insert() -> ImageOpen()
|
||||
bool bWriteProtected; // Needed for ImageOpen() [otherwise not used]
|
||||
//
|
||||
BYTE hd_error;
|
||||
BYTE hd_error; // NB. Firmware requires that b0=0 (OK) or b0=1 (Error)
|
||||
WORD hd_memblock;
|
||||
UINT hd_diskblock;
|
||||
WORD hd_buf_ptr;
|
||||
@ -275,6 +275,7 @@ void HD_SetEnabled(const bool bEnabled)
|
||||
return;
|
||||
|
||||
g_bHD_Enabled = bEnabled;
|
||||
g_Slot[7] = bEnabled ? CT_GenericHDD : CT_Empty;
|
||||
|
||||
#if 0
|
||||
// FIXME: For LoadConfiguration(), g_uSlot=7 (see definition at start of file)
|
||||
@ -595,6 +596,12 @@ static BYTE __stdcall HD_IO_EMUL(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG
|
||||
#if HD_LED
|
||||
pHDD->hd_status_next = DISK_STATUS_OFF; // TODO: FIXME: ??? YELLOW ??? WARNING
|
||||
#endif
|
||||
if (pHDD->hd_error)
|
||||
{
|
||||
_ASSERT(pHDD->hd_error & 1);
|
||||
pHDD->hd_error |= 1; // Firmware requires that b0=1 for an error
|
||||
}
|
||||
|
||||
r = pHDD->hd_error;
|
||||
break;
|
||||
case 0xF2:
|
||||
|
Loading…
Reference in New Issue
Block a user