2006-02-25 20:50:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2008-09-04 16:30:34 +00:00
|
|
|
enum
|
|
|
|
{
|
2009-01-09 23:27:29 +00:00
|
|
|
// Note: All are in bytes!
|
2008-09-04 16:30:34 +00:00
|
|
|
APPLE_SLOT_SIZE = 0x0100, // 1 page = $Cx00 .. $CxFF (slot 1 .. 7)
|
|
|
|
APPLE_SLOT_BEGIN = 0xC100, // each slot has 1 page reserved for it
|
|
|
|
APPLE_SLOT_END = 0xC7FF, //
|
|
|
|
|
|
|
|
FIRMWARE_EXPANSION_SIZE = 0x0800, // 8 pages = $C800 .. $CFFF
|
|
|
|
FIRMWARE_EXPANSION_BEGIN = 0xC800, // [C800,CFFF)
|
|
|
|
FIRMWARE_EXPANSION_END = 0xCFFF //
|
|
|
|
};
|
|
|
|
|
2006-03-09 21:10:40 +00:00
|
|
|
enum MemoryInitPattern_e
|
|
|
|
{
|
|
|
|
MIP_ZERO
|
2014-07-18 03:18:59 +00:00
|
|
|
, MIP_RANDOM
|
2006-03-09 21:10:40 +00:00
|
|
|
, MIP_FF_FF_00_00
|
2014-07-18 03:18:59 +00:00
|
|
|
, MIP_FF_00_FULL_PAGE
|
|
|
|
, MIP_00_FF_HALF_PAGE
|
|
|
|
, MIP_FF_00_HALF_PAGE
|
2014-07-18 03:42:19 +00:00
|
|
|
, MIP_PAGE_ADDRESS_LOW
|
|
|
|
, MIP_PAGE_ADDRESS_HIGH
|
2006-03-09 21:10:40 +00:00
|
|
|
, NUM_MIP
|
|
|
|
};
|
|
|
|
|
2007-05-28 11:16:42 +00:00
|
|
|
extern iofunction IORead[256];
|
|
|
|
extern iofunction IOWrite[256];
|
|
|
|
extern LPBYTE memwrite[0x100];
|
2006-02-25 20:50:29 +00:00
|
|
|
extern LPBYTE mem;
|
|
|
|
extern LPBYTE memdirty;
|
|
|
|
|
|
|
|
#ifdef RAMWORKS
|
2016-03-21 23:48:02 +00:00
|
|
|
const UINT kMaxExMemoryBanks = 127; // 127 * aux mem(64K) + main mem(64K) = 8MB
|
2006-02-25 20:50:29 +00:00
|
|
|
extern UINT g_uMaxExPages; // user requested ram pages (from cmd line)
|
|
|
|
#endif
|
|
|
|
|
2007-05-28 11:16:42 +00:00
|
|
|
void RegisterIoHandler(UINT uSlot, iofunction IOReadC0, iofunction IOWriteC0, iofunction IOReadCx, iofunction IOWriteCx, LPVOID lpSlotParameter, BYTE* pExpansionRom);
|
|
|
|
|
2006-02-25 20:50:29 +00:00
|
|
|
void MemDestroy ();
|
2007-05-28 11:16:42 +00:00
|
|
|
bool MemCheckSLOTCXROM();
|
2013-07-11 21:21:58 +00:00
|
|
|
LPBYTE MemGetAuxPtr(const WORD);
|
|
|
|
LPBYTE MemGetMainPtr(const WORD);
|
2013-04-26 21:55:45 +00:00
|
|
|
LPBYTE MemGetBankPtr(const UINT nBank);
|
2007-08-06 21:38:35 +00:00
|
|
|
LPBYTE MemGetCxRomPeripheral();
|
2006-02-25 20:50:29 +00:00
|
|
|
void MemInitialize ();
|
2016-03-21 23:48:02 +00:00
|
|
|
void MemInitializeROM(void);
|
|
|
|
void MemInitializeCustomF8ROM(void);
|
|
|
|
void MemInitializeIO(void);
|
2007-08-06 21:38:35 +00:00
|
|
|
BYTE MemReadFloatingBus(const ULONG uExecutedCycles);
|
|
|
|
BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles);
|
2006-02-25 20:50:29 +00:00
|
|
|
void MemReset ();
|
|
|
|
void MemResetPaging ();
|
2013-09-14 21:46:39 +00:00
|
|
|
void MemUpdatePaging(BOOL initialize);
|
2007-05-28 11:16:42 +00:00
|
|
|
LPVOID MemGetSlotParameters (UINT uSlot);
|
2016-03-21 23:48:02 +00:00
|
|
|
void MemSetSnapshot_v1(const DWORD MemMode, const BOOL LastWriteRam, const BYTE* const pMemMain, const BYTE* const pMemAux);
|
|
|
|
std::string MemGetSnapshotUnitAuxSlotName(void);
|
|
|
|
void MemSaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
|
|
|
|
bool MemLoadSnapshot(class YamlLoadHelper& yamlLoadHelper);
|
|
|
|
void MemSaveSnapshotAux(class YamlSaveHelper& yamlSaveHelper);
|
|
|
|
bool MemLoadSnapshotAux(class YamlLoadHelper& yamlLoadHelper, UINT version);
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2007-05-28 11:16:42 +00:00
|
|
|
BYTE __stdcall IO_Null(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCycles);
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2007-05-28 11:16:42 +00:00
|
|
|
BYTE __stdcall MemCheckPaging (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
|
|
|
|
BYTE __stdcall MemSetPaging(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
|