mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-18 06:31:57 +00:00
Load save-state:
. fix for II/II+ when VidHD's SHR is being updated (init memVidHD ptr). . refactor to consolidate all Mem* related initialisation.
This commit is contained in:
parent
0f2d4b1878
commit
a727db7cc5
@ -1731,8 +1731,17 @@ void MemInitializeIO(void)
|
||||
|
||||
// Called by:
|
||||
// . Snapshot_LoadState_v2()
|
||||
void MemInitializeCardSlotAndExpansionRomFromSnapshot(void)
|
||||
void MemInitializeFromSnapshot(void)
|
||||
{
|
||||
MemInitializeROM();
|
||||
MemInitializeCustomROM();
|
||||
MemInitializeCustomF8ROM();
|
||||
MemInitializeIO();
|
||||
|
||||
//
|
||||
// Card and Expansion ROM
|
||||
//
|
||||
|
||||
// Remove all the cards' ROMs at $Csnn if internal ROM is enabled
|
||||
if (IsAppleIIeOrAbove(GetApple2Type()) && SW_INTCXROM)
|
||||
IoHandlerCardsOut();
|
||||
@ -1740,13 +1749,27 @@ void MemInitializeCardSlotAndExpansionRomFromSnapshot(void)
|
||||
// Potentially init a card's expansion ROM
|
||||
const UINT uSlot = g_uPeripheralRomSlot;
|
||||
|
||||
if (ExpansionRom[uSlot] == NULL)
|
||||
return;
|
||||
|
||||
if (ExpansionRom[uSlot] != NULL)
|
||||
{
|
||||
_ASSERT(g_eExpansionRomType == eExpRomPeripheral);
|
||||
|
||||
memcpy(pCxRomPeripheral+0x800, ExpansionRom[uSlot], FIRMWARE_EXPANSION_SIZE);
|
||||
memcpy(pCxRomPeripheral + 0x800, ExpansionRom[uSlot], FIRMWARE_EXPANSION_SIZE);
|
||||
// NB. Copied to /mem/ by UpdatePaging(TRUE)
|
||||
}
|
||||
|
||||
MemUpdatePaging(TRUE);
|
||||
|
||||
//
|
||||
// VidHD
|
||||
//
|
||||
|
||||
memVidHD = NULL;
|
||||
|
||||
if (IsApple2PlusOrClone(GetApple2Type()) && (GetCardMgr().QuerySlot(SLOT3) == CT_VidHD))
|
||||
{
|
||||
VidHDCard* vidHD = dynamic_cast<VidHDCard*>(GetCardMgr().GetObj(SLOT3));
|
||||
memVidHD = vidHD->IsWriteAux() ? memaux : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline DWORD getRandomTime()
|
||||
@ -1778,6 +1801,8 @@ void MemReset()
|
||||
|
||||
memset(memdirty, 0, 0x100);
|
||||
|
||||
memVidHD = NULL;
|
||||
|
||||
//
|
||||
|
||||
int iByte;
|
||||
|
@ -84,7 +84,7 @@ void MemInitializeROM(void);
|
||||
void MemInitializeCustomROM(void);
|
||||
void MemInitializeCustomF8ROM(void);
|
||||
void MemInitializeIO(void);
|
||||
void MemInitializeCardSlotAndExpansionRomFromSnapshot(void);
|
||||
void MemInitializeFromSnapshot(void);
|
||||
BYTE MemReadFloatingBus(const ULONG uExecutedCycles);
|
||||
BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles);
|
||||
void MemReset ();
|
||||
|
@ -499,13 +499,7 @@ static void Snapshot_LoadState_v2(void)
|
||||
const CConfigNeedingRestart configNew = CConfigNeedingRestart::Create();
|
||||
GetPropertySheet().ApplyNewConfigFromSnapshot(configNew); // Saves new state to Registry (not slot/cards though)
|
||||
|
||||
MemInitializeROM();
|
||||
MemInitializeCustomROM();
|
||||
MemInitializeCustomF8ROM();
|
||||
MemInitializeIO();
|
||||
MemInitializeCardSlotAndExpansionRomFromSnapshot();
|
||||
|
||||
MemUpdatePaging(TRUE);
|
||||
MemInitializeFromSnapshot();
|
||||
|
||||
DebugReset();
|
||||
if (g_nAppMode == MODE_DEBUG)
|
||||
|
Loading…
x
Reference in New Issue
Block a user