mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-10 13:29:56 +00:00
46274d4d1c
Support for #408: * added slot-0 LC and Saturn 128K for Apple II and II+ * added save-state support - for slot-0 LC/Saturn, save the LC state in the slot-0 card, not the //e MMU; and switch to a new Apple2 unit ver2 * added g_Slot0, g_SlotAux * added new LanguageCard.cpp/h to project and moved Saturn code into these new files. * updated VS2013,2015,2017 projects
84 lines
2.3 KiB
C++
84 lines
2.3 KiB
C++
#pragma once
|
|
|
|
//
|
|
// Language Card (base unit) for Apple //e and above
|
|
//
|
|
|
|
class LanguageCardUnit
|
|
{
|
|
public:
|
|
LanguageCardUnit(void);
|
|
virtual ~LanguageCardUnit(void) {}
|
|
|
|
virtual DWORD SetPaging(WORD address, DWORD memmode, BOOL& modechanging, bool write);
|
|
virtual void SetMemorySize(UINT banks) {} // No-op for //e and slot-0 16K LC
|
|
virtual UINT GetActiveBank(void) { return 0; } // Always 0 as only 1x 16K bank
|
|
virtual void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper) { _ASSERT(0); } // Not used for //e
|
|
virtual bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version) { _ASSERT(0); return false; } // Not used for //e
|
|
|
|
BOOL GetLastRamWrite(void) { return m_uLastRamWrite; }
|
|
void SetLastRamWrite(BOOL count) { m_uLastRamWrite = count; }
|
|
SS_CARDTYPE GetMemoryType(void) { return m_type; }
|
|
|
|
static const UINT kMemModeInitialState;
|
|
|
|
protected:
|
|
SS_CARDTYPE m_type;
|
|
|
|
private:
|
|
UINT m_uLastRamWrite;
|
|
};
|
|
|
|
//
|
|
// Language Card (slot-0) for Apple II or II+
|
|
//
|
|
|
|
class LanguageCardSlot0 : public LanguageCardUnit
|
|
{
|
|
public:
|
|
LanguageCardSlot0(void);
|
|
virtual ~LanguageCardSlot0(void);
|
|
|
|
virtual void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
|
|
virtual bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version);
|
|
|
|
static const UINT kMemBankSize = 16*1024;
|
|
static std::string GetSnapshotCardName(void);
|
|
|
|
protected:
|
|
void SaveLCState(class YamlSaveHelper& yamlSaveHelper);
|
|
void LoadLCState(class YamlLoadHelper& yamlLoadHelper);
|
|
|
|
private:
|
|
std::string GetSnapshotMemStructName(void);
|
|
|
|
LPBYTE m_pMemory;
|
|
};
|
|
|
|
//
|
|
// Saturn 128K
|
|
//
|
|
|
|
class Saturn128K : public LanguageCardSlot0
|
|
{
|
|
public:
|
|
Saturn128K(UINT banks);
|
|
virtual ~Saturn128K(void);
|
|
|
|
virtual DWORD SetPaging(WORD address, DWORD memmode, BOOL& modechanging, bool write);
|
|
virtual void SetMemorySize(UINT banks);
|
|
virtual UINT GetActiveBank(void);
|
|
virtual void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
|
|
virtual bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version);
|
|
|
|
static const UINT kMaxSaturnBanks = 8; // 8 * 16K = 128K
|
|
static std::string GetSnapshotCardName(void);
|
|
|
|
private:
|
|
std::string GetSnapshotMemStructName(void);
|
|
|
|
UINT m_uSaturnTotalBanks; // Will be > 0 if Saturn card is installed
|
|
UINT m_uSaturnActiveBank; // Saturn 128K Language Card Bank 0 .. 7
|
|
LPBYTE m_aSaturnBanks[kMaxSaturnBanks];
|
|
};
|