mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-13 17:29:34 +00:00
Improved fix for 80eb330
. During init: only need to call IoHandlerCardsOut() when loading save-state . MemInitialize() -> MemReset() -> ResetPaging() which always inits memmode
This commit is contained in:
parent
6d85c1b6bd
commit
f491bb19cd
|
@ -1499,12 +1499,6 @@ void MemInitialize()
|
||||||
|
|
||||||
CreateLanguageCard();
|
CreateLanguageCard();
|
||||||
|
|
||||||
// Reinit memmode on a restart (eg. h/w config changes)
|
|
||||||
if (IsApple2PlusOrClone(GetApple2Type()) && g_CardMgr.QuerySlot(SLOT0) == CT_Empty)
|
|
||||||
SetMemMode(0);
|
|
||||||
else
|
|
||||||
SetMemMode(LanguageCardUnit::kMemModeInitialState);
|
|
||||||
|
|
||||||
MemInitializeROM();
|
MemInitializeROM();
|
||||||
MemInitializeCustomROM();
|
MemInitializeCustomROM();
|
||||||
MemInitializeCustomF8ROM();
|
MemInitializeCustomF8ROM();
|
||||||
|
@ -1769,19 +1763,17 @@ void MemInitializeIO(void)
|
||||||
|
|
||||||
if (g_CardMgr.QuerySlot(SLOT7) == CT_GenericHDD)
|
if (g_CardMgr.QuerySlot(SLOT7) == CT_GenericHDD)
|
||||||
HD_Load_Rom(pCxRomPeripheral, SLOT7); // $C700 : HDD f/w
|
HD_Load_Rom(pCxRomPeripheral, SLOT7); // $C700 : HDD f/w
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
// Finally remove the cards' ROMs at $Csnn if internal ROM is enabled
|
|
||||||
// . required when restoring saved-state
|
|
||||||
if (IsAppleIIeOrAbove(GetApple2Type()) && SW_INTCXROM)
|
|
||||||
IoHandlerCardsOut();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by:
|
// Called by:
|
||||||
// . Snapshot_LoadState_v2()
|
// . Snapshot_LoadState_v2()
|
||||||
void MemInitializeCardExpansionRomFromSnapshot(void)
|
void MemInitializeCardSlotAndExpansionRomFromSnapshot(void)
|
||||||
{
|
{
|
||||||
|
// Remove all the cards' ROMs at $Csnn if internal ROM is enabled
|
||||||
|
if (IsAppleIIeOrAbove(GetApple2Type()) && SW_INTCXROM)
|
||||||
|
IoHandlerCardsOut();
|
||||||
|
|
||||||
|
// Potentially init a card's expansion ROM
|
||||||
const UINT uSlot = g_uPeripheralRomSlot;
|
const UINT uSlot = g_uPeripheralRomSlot;
|
||||||
|
|
||||||
if (ExpansionRom[uSlot] == NULL)
|
if (ExpansionRom[uSlot] == NULL)
|
||||||
|
@ -1948,7 +1940,7 @@ void MemReset()
|
||||||
mem = memimage;
|
mem = memimage;
|
||||||
|
|
||||||
// INITIALIZE PAGING, FILLING IN THE 64K MEMORY IMAGE
|
// INITIALIZE PAGING, FILLING IN THE 64K MEMORY IMAGE
|
||||||
ResetPaging(1); // Initialize=1
|
ResetPaging(TRUE); // Initialize=1, init memmode
|
||||||
|
|
||||||
// INITIALIZE & RESET THE CPU
|
// 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
|
// . Do this after ROM has been copied back to mem[], so that PC is correctly init'ed from 6502's reset vector
|
||||||
|
|
|
@ -74,7 +74,7 @@ void MemInitializeROM(void);
|
||||||
void MemInitializeCustomROM(void);
|
void MemInitializeCustomROM(void);
|
||||||
void MemInitializeCustomF8ROM(void);
|
void MemInitializeCustomF8ROM(void);
|
||||||
void MemInitializeIO(void);
|
void MemInitializeIO(void);
|
||||||
void MemInitializeCardExpansionRomFromSnapshot(void);
|
void MemInitializeCardSlotAndExpansionRomFromSnapshot(void);
|
||||||
BYTE MemReadFloatingBus(const ULONG uExecutedCycles);
|
BYTE MemReadFloatingBus(const ULONG uExecutedCycles);
|
||||||
BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles);
|
BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles);
|
||||||
void MemReset ();
|
void MemReset ();
|
||||||
|
|
|
@ -400,7 +400,7 @@ static void Snapshot_LoadState_v2(void)
|
||||||
m_ConfigNew.m_bEnableHDD = false;
|
m_ConfigNew.m_bEnableHDD = false;
|
||||||
//m_ConfigNew.m_bEnableTheFreezesF8Rom = ?; // todo: when support saving config
|
//m_ConfigNew.m_bEnableTheFreezesF8Rom = ?; // todo: when support saving config
|
||||||
|
|
||||||
MemReset(); // Also calls CpuInitialize()
|
MemReset(); // Also calls CpuInitialize(), CNoSlotClock.Reset()
|
||||||
PravetsReset();
|
PravetsReset();
|
||||||
|
|
||||||
if (g_CardMgr.IsSSCInstalled())
|
if (g_CardMgr.IsSSCInstalled())
|
||||||
|
@ -455,7 +455,7 @@ static void Snapshot_LoadState_v2(void)
|
||||||
MemInitializeCustomROM();
|
MemInitializeCustomROM();
|
||||||
MemInitializeCustomF8ROM();
|
MemInitializeCustomF8ROM();
|
||||||
MemInitializeIO();
|
MemInitializeIO();
|
||||||
MemInitializeCardExpansionRomFromSnapshot();
|
MemInitializeCardSlotAndExpansionRomFromSnapshot();
|
||||||
|
|
||||||
MemUpdatePaging(TRUE);
|
MemUpdatePaging(TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user