2019-12-19 19:42:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
enum SS_CARDTYPE
|
|
|
|
{
|
|
|
|
CT_Empty = 0,
|
|
|
|
CT_Disk2, // Apple Disk][
|
|
|
|
CT_SSC, // Apple Super Serial Card
|
|
|
|
CT_MockingboardC, // Soundcard
|
|
|
|
CT_GenericPrinter,
|
|
|
|
CT_GenericHDD, // Hard disk
|
|
|
|
CT_GenericClock,
|
|
|
|
CT_MouseInterface,
|
|
|
|
CT_Z80,
|
|
|
|
CT_Phasor, // Soundcard
|
|
|
|
CT_Echo, // Soundcard
|
|
|
|
CT_SAM, // Soundcard: Software Automated Mouth
|
|
|
|
CT_80Col, // 80 column card (1K)
|
|
|
|
CT_Extended80Col, // Extended 80-col card (64K)
|
|
|
|
CT_RamWorksIII, // RamWorksIII (up to 8MB)
|
|
|
|
CT_Uthernet,
|
|
|
|
CT_LanguageCard, // Apple][ or ][+ in slot-0
|
|
|
|
CT_LanguageCardIIe, // Apple//e LC instance (not a card)
|
|
|
|
CT_Saturn128K, // Saturn 128K (but may be populated with less RAM, in multiples of 16K)
|
2021-09-10 12:57:55 +00:00
|
|
|
CT_FourPlay, // 4 port Atari 2600 style digital joystick card
|
|
|
|
CT_SNESMAX, // 2 port Nintendo NES/SNES controller serial interface card
|
2021-11-30 21:41:02 +00:00
|
|
|
CT_VidHD,
|
2022-02-27 17:26:48 +00:00
|
|
|
CT_Uthernet2,
|
2019-12-19 19:42:30 +00:00
|
|
|
};
|
|
|
|
|
2021-09-17 19:43:10 +00:00
|
|
|
enum SLOTS { SLOT0=0, SLOT1, SLOT2, SLOT3, SLOT4, SLOT5, SLOT6, SLOT7, NUM_SLOTS, SLOT_AUX };
|
2019-12-19 19:42:30 +00:00
|
|
|
|
2021-11-25 20:23:21 +00:00
|
|
|
class YamlSaveHelper;
|
|
|
|
class YamlLoadHelper;
|
|
|
|
|
2019-12-19 19:42:30 +00:00
|
|
|
class Card
|
|
|
|
{
|
|
|
|
public:
|
2021-11-01 21:01:28 +00:00
|
|
|
Card(SS_CARDTYPE type, UINT slot) : m_type(type), m_slot(slot) {}
|
2019-12-19 19:42:30 +00:00
|
|
|
virtual ~Card(void) {}
|
|
|
|
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral) = 0;
|
2022-03-11 22:17:03 +00:00
|
|
|
virtual void Destroy() = 0;
|
2019-12-19 19:42:30 +00:00
|
|
|
virtual void Reset(const bool powerCycle) = 0;
|
2021-11-13 18:13:01 +00:00
|
|
|
virtual void Update(const ULONG nExecutedCycles) = 0;
|
2021-11-25 20:23:21 +00:00
|
|
|
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) = 0;
|
|
|
|
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) = 0;
|
|
|
|
|
2019-12-19 19:42:30 +00:00
|
|
|
SS_CARDTYPE QueryType(void) { return m_type; }
|
|
|
|
|
2022-01-30 21:25:40 +00:00
|
|
|
std::string GetCardName(void);
|
|
|
|
static std::string GetCardName(const SS_CARDTYPE cardType);
|
|
|
|
static SS_CARDTYPE GetCardType(const std::string & card);
|
|
|
|
|
|
|
|
// static versions for non-Card cards
|
|
|
|
static void ThrowErrorInvalidSlot(SS_CARDTYPE type, UINT slot);
|
|
|
|
static void ThrowErrorInvalidVersion(SS_CARDTYPE type, UINT version);
|
|
|
|
|
2021-11-01 21:01:28 +00:00
|
|
|
protected:
|
|
|
|
UINT m_slot;
|
|
|
|
|
2022-01-30 21:25:40 +00:00
|
|
|
void ThrowErrorInvalidSlot();
|
|
|
|
void ThrowErrorInvalidVersion(UINT version);
|
|
|
|
|
2019-12-19 19:42:30 +00:00
|
|
|
private:
|
|
|
|
SS_CARDTYPE m_type;
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
class EmptyCard : public Card
|
|
|
|
{
|
|
|
|
public:
|
2021-11-11 21:45:55 +00:00
|
|
|
EmptyCard(UINT slot) : Card(CT_Empty, slot) {}
|
2019-12-19 19:42:30 +00:00
|
|
|
virtual ~EmptyCard(void) {}
|
|
|
|
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral) {}
|
2022-03-11 22:17:03 +00:00
|
|
|
virtual void Destroy() {}
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void Reset(const bool powerCycle) {}
|
2021-11-13 18:13:01 +00:00
|
|
|
virtual void Update(const ULONG nExecutedCycles) {}
|
2021-11-25 20:23:21 +00:00
|
|
|
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) {}
|
|
|
|
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) { _ASSERT(0); return false; }
|
2019-12-19 19:42:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
class DummyCard : public Card // For cards that currently can't be instantiated (ie. don't exist as a class)
|
|
|
|
{
|
|
|
|
public:
|
2021-11-01 21:01:28 +00:00
|
|
|
DummyCard(SS_CARDTYPE type, UINT slot) : Card(type, slot) {}
|
2019-12-19 19:42:30 +00:00
|
|
|
virtual ~DummyCard(void) {}
|
|
|
|
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
2022-03-11 22:17:03 +00:00
|
|
|
virtual void Destroy() {}
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void Reset(const bool powerCycle) {}
|
2021-11-13 18:13:01 +00:00
|
|
|
virtual void Update(const ULONG nExecutedCycles);
|
2021-11-25 20:23:21 +00:00
|
|
|
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper);
|
|
|
|
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version);
|
2019-12-19 19:42:30 +00:00
|
|
|
};
|