2009-02-16 19:19:03 +00:00
|
|
|
#pragma once
|
|
|
|
|
2014-08-14 16:48:38 +00:00
|
|
|
#include "DiskDefs.h"
|
2015-02-13 22:40:53 +00:00
|
|
|
#include "SaveState_Structs_common.h"
|
2010-01-03 18:43:08 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
// Structs used by save-state file v1
|
2006-05-02 21:56:28 +00:00
|
|
|
|
|
|
|
// *** DON'T CHANGE ANY STRUCT WITHOUT CONSIDERING BACKWARDS COMPATIBILITY WITH .AWS FORMAT ***
|
2006-02-25 20:50:29 +00:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_CPU6502
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
BYTE A;
|
|
|
|
BYTE X;
|
|
|
|
BYTE Y;
|
|
|
|
BYTE P;
|
|
|
|
BYTE S;
|
|
|
|
USHORT PC;
|
2015-02-13 22:40:53 +00:00
|
|
|
unsigned __int64 nCumulativeCycles;
|
2006-02-25 20:50:29 +00:00
|
|
|
// IRQ = OR-sum of all interrupt sources
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2006-05-02 21:56:28 +00:00
|
|
|
const UINT uRecvBufferSize = 9;
|
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_IO_Comms
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
DWORD baudrate;
|
|
|
|
BYTE bytesize;
|
|
|
|
BYTE commandbyte;
|
|
|
|
DWORD comminactivity; // If non-zero then COM port open
|
|
|
|
BYTE controlbyte;
|
|
|
|
BYTE parity;
|
2006-05-02 21:56:28 +00:00
|
|
|
BYTE recvbuffer[uRecvBufferSize];
|
2006-02-25 20:50:29 +00:00
|
|
|
DWORD recvbytes;
|
|
|
|
BYTE stopbits;
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_IO_Joystick
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
2015-02-13 22:40:53 +00:00
|
|
|
unsigned __int64 nJoyCntrResetCycle;
|
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_IO_Keyboard
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
DWORD keyboardqueries;
|
|
|
|
BYTE nLastKey;
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_IO_Speaker
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
2015-02-13 22:40:53 +00:00
|
|
|
unsigned __int64 nSpkrLastCycle;
|
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_IO_Video
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
bool bAltCharSet; // charoffs
|
|
|
|
DWORD dwVidMode;
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_BaseMemory
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
DWORD dwMemMode;
|
|
|
|
BOOL bLastWriteRam;
|
|
|
|
BYTE nMemMain[nMemMainSize];
|
|
|
|
BYTE nMemAux[nMemAuxSize];
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_APPLE2_Unit
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
SS_UNIT_HDR UnitHdr;
|
|
|
|
SS_CPU6502 CPU6502;
|
|
|
|
SS_IO_Comms Comms;
|
|
|
|
SS_IO_Joystick Joystick;
|
|
|
|
SS_IO_Keyboard Keyboard;
|
|
|
|
SS_IO_Speaker Speaker;
|
|
|
|
SS_IO_Video Video;
|
|
|
|
SS_BaseMemory Memory;
|
|
|
|
};
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct DISK2_Unit
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
char szFileName[MAX_PATH];
|
|
|
|
int track;
|
|
|
|
int phase;
|
|
|
|
int byte;
|
|
|
|
BOOL writeprotected;
|
|
|
|
BOOL trackimagedata;
|
|
|
|
BOOL trackimagedirty;
|
|
|
|
DWORD spinning;
|
|
|
|
DWORD writelight;
|
|
|
|
int nibbles;
|
2019-07-05 22:01:19 +00:00
|
|
|
BYTE nTrack[NIBBLES_PER_TRACK_NIB];
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct SS_CARD_DISK2
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
SS_CARD_HDR Hdr;
|
|
|
|
DISK2_Unit Unit[2];
|
2007-03-23 22:26:35 +00:00
|
|
|
WORD phases;
|
|
|
|
WORD currdrive;
|
2006-02-25 20:50:29 +00:00
|
|
|
BOOL diskaccessed;
|
|
|
|
BOOL enhancedisk;
|
|
|
|
BYTE floppylatch;
|
|
|
|
BOOL floppymotoron;
|
|
|
|
BOOL floppywritemode;
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-04-11 21:24:54 +00:00
|
|
|
struct MB_Unit_v1
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
SY6522 RegsSY6522;
|
|
|
|
BYTE RegsAY8910[16];
|
|
|
|
SSI263A RegsSSI263;
|
|
|
|
BYTE nAYCurrentRegister;
|
|
|
|
bool bTimer1IrqPending;
|
|
|
|
bool bTimer2IrqPending;
|
|
|
|
bool bSpeechIrqPending;
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-04-11 21:24:54 +00:00
|
|
|
const UINT MB_UNITS_PER_CARD_v1 = 2;
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-04-11 21:24:54 +00:00
|
|
|
struct SS_CARD_MOCKINGBOARD_v1
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
SS_CARD_HDR Hdr;
|
2015-04-11 21:24:54 +00:00
|
|
|
MB_Unit_v1 Unit[MB_UNITS_PER_CARD_v1];
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-02-13 22:40:53 +00:00
|
|
|
struct APPLEWIN_SNAPSHOT_v1
|
2006-02-25 20:50:29 +00:00
|
|
|
{
|
|
|
|
SS_FILE_HDR Hdr;
|
|
|
|
SS_APPLE2_Unit Apple2Unit;
|
2015-04-11 21:24:54 +00:00
|
|
|
SS_CARD_EMPTY Empty1; // Slot1
|
|
|
|
SS_CARD_EMPTY Empty2; // Slot2
|
|
|
|
SS_CARD_EMPTY Empty3; // Slot3
|
|
|
|
SS_CARD_MOCKINGBOARD_v1 Mockingboard1; // Slot4
|
|
|
|
SS_CARD_MOCKINGBOARD_v1 Mockingboard2; // Slot5
|
|
|
|
SS_CARD_DISK2 Disk2; // Slot6
|
|
|
|
SS_CARD_EMPTY Empty7; // Slot7
|
2015-02-13 22:40:53 +00:00
|
|
|
};
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2015-04-11 21:24:54 +00:00
|
|
|
const UINT kSnapshotSize_v1 = 145400; // Const size for v1
|