mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-09 05:32:05 +00:00
Save-state: Added save-type functions to YamlSaveHelper & use wherever saving state. Also added new cmd-line option: -load-state.
This commit is contained in:
parent
8524f91495
commit
6b07fd665f
@ -997,44 +997,44 @@ void CAY8910::SaveSnapshot(YamlSaveHelper& yamlSaveHelper, std::string& suffix)
|
||||
std::string unit = std::string(SS_YAML_KEY_AY8910) + suffix;
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", unit.c_str());
|
||||
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE0_TICK, ay_tone_tick[0]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE1_TICK, ay_tone_tick[1]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE2_TICK, ay_tone_tick[2]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE0_HIGH, ay_tone_high[0]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE1_HIGH, ay_tone_high[1]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE2_HIGH, ay_tone_high[2]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_NOISE_TICK, ay_noise_tick);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE_SUBCYCLES, ay_tone_subcycles);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENV_SUBCYCLES, ay_env_subcycles);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENV_INTERNAL_TICK, ay_env_internal_tick);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENV_TICK, ay_env_tick);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TICK_INCR, ay_tick_incr);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE0_PERIOD, ay_tone_period[0]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE1_PERIOD, ay_tone_period[1]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TONE2_PERIOD, ay_tone_period[2]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_NOISE_PERIOD, ay_noise_period);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_RNG, rng);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_NOISE_TOGGLE, noise_toggle);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENV_FIRST, env_first);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENV_REV, env_rev);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENV_COUNTER, env_counter);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE0_TICK, ay_tone_tick[0]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE1_TICK, ay_tone_tick[1]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE2_TICK, ay_tone_tick[2]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE0_HIGH, ay_tone_high[0]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE1_HIGH, ay_tone_high[1]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE2_HIGH, ay_tone_high[2]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_NOISE_TICK, ay_noise_tick);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE_SUBCYCLES, ay_tone_subcycles);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENV_SUBCYCLES, ay_env_subcycles);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENV_INTERNAL_TICK, ay_env_internal_tick);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENV_TICK, ay_env_tick);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TICK_INCR, ay_tick_incr);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE0_PERIOD, ay_tone_period[0]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE1_PERIOD, ay_tone_period[1]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TONE2_PERIOD, ay_tone_period[2]);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_NOISE_PERIOD, ay_noise_period);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_RNG, rng);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_NOISE_TOGGLE, noise_toggle);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENV_FIRST, env_first);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENV_REV, env_rev);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENV_COUNTER, env_counter);
|
||||
|
||||
// New label
|
||||
{
|
||||
YamlSaveHelper::Label registers(yamlSaveHelper, "%s:\n", SS_YAML_KEY_REGISTERS);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%03X\n", SS_YAML_KEY_REG_TONE0_PERIOD, (UINT)(sound_ay_registers[1]<<8) | sound_ay_registers[0]);
|
||||
yamlSaveHelper.Save("%s: 0x%03X\n", SS_YAML_KEY_REG_TONE1_PERIOD, (UINT)(sound_ay_registers[3]<<8) | sound_ay_registers[2]);
|
||||
yamlSaveHelper.Save("%s: 0x%03X\n", SS_YAML_KEY_REG_TONE2_PERIOD, (UINT)(sound_ay_registers[5]<<8) | sound_ay_registers[4]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_NOISE_PERIOD, sound_ay_registers[6]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_MIXER, sound_ay_registers[7]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_VOL0, sound_ay_registers[8]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_VOL1, sound_ay_registers[9]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_VOL2, sound_ay_registers[10]);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_REG_ENV_PERIOD, (UINT)(sound_ay_registers[12]<<8) | sound_ay_registers[11]);
|
||||
yamlSaveHelper.Save("%s: 0x%01X\n", SS_YAML_KEY_REG_ENV_SHAPE, sound_ay_registers[13]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_PORTA, sound_ay_registers[14]);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REG_PORTB, sound_ay_registers[15]);
|
||||
yamlSaveHelper.SaveHex12(SS_YAML_KEY_REG_TONE0_PERIOD, (UINT)(sound_ay_registers[1]<<8) | sound_ay_registers[0]);
|
||||
yamlSaveHelper.SaveHex12(SS_YAML_KEY_REG_TONE1_PERIOD, (UINT)(sound_ay_registers[3]<<8) | sound_ay_registers[2]);
|
||||
yamlSaveHelper.SaveHex12(SS_YAML_KEY_REG_TONE2_PERIOD, (UINT)(sound_ay_registers[5]<<8) | sound_ay_registers[4]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_NOISE_PERIOD, sound_ay_registers[6]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_MIXER, sound_ay_registers[7]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_VOL0, sound_ay_registers[8]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_VOL1, sound_ay_registers[9]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_VOL2, sound_ay_registers[10]);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_REG_ENV_PERIOD, (UINT)(sound_ay_registers[12]<<8) | sound_ay_registers[11]);
|
||||
yamlSaveHelper.SaveHex4(SS_YAML_KEY_REG_ENV_SHAPE, sound_ay_registers[13]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_PORTA, sound_ay_registers[14]);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REG_PORTB, sound_ay_registers[15]);
|
||||
}
|
||||
|
||||
// New label
|
||||
|
@ -784,6 +784,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
||||
bool bBoot = false;
|
||||
LPSTR szImageName_drive1 = NULL;
|
||||
LPSTR szImageName_drive2 = NULL;
|
||||
LPSTR szSnapshotName = NULL;
|
||||
const std::string strCmdLine(lpCmdLine); // Keep a copy for log ouput
|
||||
|
||||
while (*lpCmdLine)
|
||||
@ -815,6 +816,12 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
||||
lpNextArg = GetNextArg(lpNextArg);
|
||||
szImageName_drive2 = lpCmdLine;
|
||||
}
|
||||
else if (strcmp(lpCmdLine, "-load-state") == 0)
|
||||
{
|
||||
lpCmdLine = GetCurrArg(lpNextArg);
|
||||
lpNextArg = GetNextArg(lpNextArg);
|
||||
szSnapshotName = lpCmdLine;
|
||||
}
|
||||
else if (strcmp(lpCmdLine, "-f") == 0)
|
||||
{
|
||||
bSetFullScreen = true;
|
||||
@ -1075,8 +1082,25 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
||||
tfe_init();
|
||||
LogFileOutput("Main: tfe_init()\n");
|
||||
|
||||
if (szSnapshotName)
|
||||
{
|
||||
// Override value just loaded from Registry by LoadConfiguration()
|
||||
// . NB. Registry value is not updated with this cmd-line value
|
||||
Snapshot_SetFilename(szSnapshotName);
|
||||
Snapshot_LoadState();
|
||||
bBoot = true;
|
||||
#if _DEBUG && 0 // Debug/test: Save a duplicate of the save-state file in tmp folder
|
||||
std::string saveName = std::string("tmp\\") + std::string(szSnapshotName);
|
||||
Snapshot_SetFilename(saveName);
|
||||
g_bSaveStateOnExit = true;
|
||||
bShutdown = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
Snapshot_Startup(); // Do this after everything has been init'ed
|
||||
LogFileOutput("Main: Snapshot_Startup()\n");
|
||||
}
|
||||
|
||||
if (bShutdown)
|
||||
{
|
||||
|
@ -729,14 +729,14 @@ void CpuSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
regs.ps |= (AF_RESERVED | AF_BREAK);
|
||||
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", CpuGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.Save("%s: %s\n", SS_YAML_KEY_CPU_TYPE, GetMainCpu() == CPU_6502 ? SS_YAML_VALUE_6502 : SS_YAML_VALUE_65C02);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGA, regs.a);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGX, regs.x);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGY, regs.y);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGP, regs.ps);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGS, (BYTE) regs.sp);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_REGPC, regs.pc);
|
||||
yamlSaveHelper.Save("%s: 0x%016llX\n", SS_YAML_KEY_CUMULATIVECYCLES, g_nCumulativeCycles);
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_CPU_TYPE, GetMainCpu() == CPU_6502 ? SS_YAML_VALUE_6502 : SS_YAML_VALUE_65C02);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGA, regs.a);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGX, regs.x);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGY, regs.y);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGP, regs.ps);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGS, (BYTE) regs.sp);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_REGPC, regs.pc);
|
||||
yamlSaveHelper.SaveHex64(SS_YAML_KEY_CUMULATIVECYCLES, g_nCumulativeCycles);
|
||||
}
|
||||
|
||||
void CpuLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
|
@ -1202,16 +1202,16 @@ std::string DiskGetSnapshotCardName(void)
|
||||
static void DiskSaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit)
|
||||
{
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s%d:\n", SS_YAML_KEY_DISK2UNIT, unit);
|
||||
yamlSaveHelper.Save("%s: %s\n", SS_YAML_KEY_FILENAME, yamlSaveHelper.GetSaveString(g_aFloppyDisk[unit].fullname).c_str());
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TRACK, g_aFloppyDisk[unit].track);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PHASE, g_aFloppyDisk[unit].phase);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_BYTE, g_aFloppyDisk[unit].byte);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_WRITE_PROTECTED, g_aFloppyDisk[unit].bWriteProtected);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_SPINNING, g_aFloppyDisk[unit].spinning);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_WRITE_LIGHT, g_aFloppyDisk[unit].writelight);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_NIBBLES, g_aFloppyDisk[unit].nibbles);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TRACK_IMAGE_DATA, g_aFloppyDisk[unit].trackimagedata);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TRACK_IMAGE_DIRTY, g_aFloppyDisk[unit].trackimagedirty);
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_FILENAME, g_aFloppyDisk[unit].fullname);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TRACK, g_aFloppyDisk[unit].track);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PHASE, g_aFloppyDisk[unit].phase);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_BYTE, g_aFloppyDisk[unit].byte);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_WRITE_PROTECTED, g_aFloppyDisk[unit].bWriteProtected);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_SPINNING, g_aFloppyDisk[unit].spinning);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_WRITE_LIGHT, g_aFloppyDisk[unit].writelight);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_NIBBLES, g_aFloppyDisk[unit].nibbles);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TRACK_IMAGE_DATA, g_aFloppyDisk[unit].trackimagedata);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_TRACK_IMAGE_DIRTY, g_aFloppyDisk[unit].trackimagedirty);
|
||||
|
||||
if (g_aFloppyDisk[unit].trackimage)
|
||||
{
|
||||
@ -1225,13 +1225,13 @@ void DiskSaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
YamlSaveHelper::Slot slot(yamlSaveHelper, DiskGetSnapshotCardName(), g_uSlot, 1);
|
||||
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
yamlSaveHelper.Save("%s: 0x%1X\n", SS_YAML_KEY_PHASES, phases);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_CURRENT_DRIVE, currdrive);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_DISK_ACCESSED, diskaccessed);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENHANCE_DISK, enhancedisk);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_FLOPPY_LATCH, floppylatch);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_FLOPPY_MOTOR_ON, floppymotoron);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_FLOPPY_WRITE_MODE, floppywritemode);
|
||||
yamlSaveHelper.SaveHex4(SS_YAML_KEY_PHASES, phases);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_CURRENT_DRIVE, currdrive);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_DISK_ACCESSED, diskaccessed);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ENHANCE_DISK, enhancedisk);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_FLOPPY_LATCH, floppylatch);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_FLOPPY_MOTOR_ON, floppymotoron);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_FLOPPY_WRITE_MODE, floppywritemode);
|
||||
|
||||
DiskSaveSnapshotDisk2Unit(yamlSaveHelper, DRIVE_1);
|
||||
DiskSaveSnapshotDisk2Unit(yamlSaveHelper, DRIVE_2);
|
||||
@ -1245,6 +1245,10 @@ static void DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
|
||||
|
||||
bool bImageError = false;
|
||||
|
||||
g_aFloppyDisk[unit].fullname[0] = 0;
|
||||
g_aFloppyDisk[unit].imagename[0] = 0;
|
||||
g_aFloppyDisk[unit].bWriteProtected = false; // Default to false (until image is successfully loaded below)
|
||||
|
||||
std::string filename = yamlLoadHelper.GetMapValueSTRING(SS_YAML_KEY_FILENAME).c_str();
|
||||
if (!filename.empty())
|
||||
{
|
||||
|
@ -688,14 +688,14 @@ std::string HD_GetSnapshotCardName(void)
|
||||
static void HD_SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, UINT unit)
|
||||
{
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s%d:\n", SS_YAML_KEY_HDDUNIT, unit);
|
||||
yamlSaveHelper.Save("%s: %s\n", SS_YAML_KEY_FILENAME, yamlSaveHelper.GetSaveString(g_HardDisk[unit].fullname).c_str());
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_ERROR, g_HardDisk[unit].hd_error);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_MEMBLOCK, g_HardDisk[unit].hd_memblock);
|
||||
yamlSaveHelper.Save("%s: 0x%08X\n", SS_YAML_KEY_DISKBLOCK, g_HardDisk[unit].hd_diskblock);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IMAGELOADED, g_HardDisk[unit].hd_imageloaded);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_STATUS_NEXT, g_HardDisk[unit].hd_status_next);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_STATUS_PREV, g_HardDisk[unit].hd_status_prev);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_BUF_PTR, g_HardDisk[unit].hd_buf_ptr);
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_FILENAME, g_HardDisk[unit].fullname);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_ERROR, g_HardDisk[unit].hd_error);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_MEMBLOCK, g_HardDisk[unit].hd_memblock);
|
||||
yamlSaveHelper.SaveHex32(SS_YAML_KEY_DISKBLOCK, g_HardDisk[unit].hd_diskblock);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IMAGELOADED, g_HardDisk[unit].hd_imageloaded);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_STATUS_NEXT, g_HardDisk[unit].hd_status_next);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_STATUS_PREV, g_HardDisk[unit].hd_status_prev);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_BUF_PTR, g_HardDisk[unit].hd_buf_ptr);
|
||||
|
||||
// New label
|
||||
{
|
||||
@ -713,7 +713,7 @@ void HD_SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
yamlSaveHelper.Save("%s: %d # b7=unit\n", SS_YAML_KEY_CURRENT_UNIT, g_nHD_UnitNum);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_COMMAND, g_nHD_Command);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_COMMAND, g_nHD_Command);
|
||||
|
||||
HD_SaveSnapshotHDDUnit(yamlSaveHelper, HARDDISK_1);
|
||||
HD_SaveSnapshotHDDUnit(yamlSaveHelper, HARDDISK_2);
|
||||
@ -725,16 +725,19 @@ static bool HD_LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
|
||||
if (!yamlLoadHelper.GetSubMap(hddUnitName))
|
||||
throw std::string("Card: Expected key: ") + hddUnitName;
|
||||
|
||||
std::string filename = yamlLoadHelper.GetMapValueSTRING(SS_YAML_KEY_FILENAME).c_str();
|
||||
g_HardDisk[unit].fullname[0] = 0;
|
||||
g_HardDisk[unit].imagename[0] = 0;
|
||||
g_HardDisk[unit].hd_imageloaded = false; // Default to false (until image is successfully loaded below)
|
||||
g_HardDisk[unit].hd_status_next = DISK_STATUS_OFF;
|
||||
g_HardDisk[unit].hd_status_prev = DISK_STATUS_OFF;
|
||||
|
||||
std::string filename = yamlLoadHelper.GetMapValueSTRING(SS_YAML_KEY_FILENAME).c_str();
|
||||
g_HardDisk[unit].hd_error = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_ERROR);
|
||||
g_HardDisk[unit].hd_memblock = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_MEMBLOCK);
|
||||
g_HardDisk[unit].hd_diskblock = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_DISKBLOCK);
|
||||
yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_IMAGELOADED); // Consume
|
||||
g_HardDisk[unit].hd_imageloaded = false; // Default to false (until image is successfully loaded below)
|
||||
g_HardDisk[unit].hd_status_next = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_NEXT);
|
||||
g_HardDisk[unit].hd_status_prev = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_PREV);
|
||||
Disk_Status_e diskStatusNext = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_NEXT);
|
||||
Disk_Status_e diskStatusPrev = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_PREV);
|
||||
g_HardDisk[unit].hd_buf_ptr = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_BUF_PTR);
|
||||
|
||||
if (!yamlLoadHelper.GetSubMap(SS_YAML_KEY_BUF))
|
||||
@ -769,6 +772,11 @@ static bool HD_LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
|
||||
// . imagename
|
||||
// . fullname
|
||||
// . hd_imageloaded
|
||||
// . hd_status_next = DISK_STATUS_OFF
|
||||
// . hd_status_prev = DISK_STATUS_OFF
|
||||
|
||||
g_HardDisk[unit].hd_status_next = diskStatusNext;
|
||||
g_HardDisk[unit].hd_status_prev = diskStatusPrev;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -871,9 +871,9 @@ static std::string JoyGetSnapshotStructName(void)
|
||||
void JoySaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", JoyGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.Save("%s: 0x%016llX\n", SS_YAML_KEY_COUNTERRESETCYCLE, g_nJoyCntrResetCycle);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_JOY0TRIMX, JoyGetTrim(true));
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_JOY0TRIMY, JoyGetTrim(false));
|
||||
yamlSaveHelper.SaveHex64(SS_YAML_KEY_COUNTERRESETCYCLE, g_nJoyCntrResetCycle);
|
||||
yamlSaveHelper.SaveInt(SS_YAML_KEY_JOY0TRIMX, JoyGetTrim(true));
|
||||
yamlSaveHelper.SaveInt(SS_YAML_KEY_JOY0TRIMY, JoyGetTrim(false));
|
||||
yamlSaveHelper.Save("%s: %d # not implemented yet\n", SS_YAML_KEY_JOY1TRIMX, 0); // not implemented yet
|
||||
yamlSaveHelper.Save("%s: %d # not implemented yet\n", SS_YAML_KEY_JOY1TRIMY, 0); // not implemented yet
|
||||
}
|
||||
@ -884,10 +884,10 @@ void JoyLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
return;
|
||||
|
||||
g_nJoyCntrResetCycle = yamlLoadHelper.GetMapValueUINT64(SS_YAML_KEY_COUNTERRESETCYCLE);
|
||||
JoySetTrim(yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_JOY0TRIMX), true);
|
||||
JoySetTrim(yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_JOY0TRIMY), false);
|
||||
yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_JOY1TRIMX); // dump value
|
||||
yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_JOY1TRIMY); // dump value
|
||||
JoySetTrim(yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_JOY0TRIMX), true);
|
||||
JoySetTrim(yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_JOY0TRIMY), false);
|
||||
yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_JOY1TRIMX); // dump value
|
||||
yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_JOY1TRIMY); // dump value
|
||||
|
||||
yamlLoadHelper.PopMap();
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ static std::string KeybGetSnapshotStructName(void)
|
||||
void KeybSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", KeybGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_LASTKEY, g_nLastKey);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_LASTKEY, g_nLastKey);
|
||||
}
|
||||
|
||||
void KeybLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
|
@ -1745,12 +1745,12 @@ void MemSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
// Scope so that "Memory" & "Main Memory" are at same indent level
|
||||
{
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", MemGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.Save("%s: 0x%08X\n", SS_YAML_KEY_MEMORYMODE, memmode);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_LASTRAMWRITE, lastwriteram ? 1 : 0);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_IOSELECT, IO_SELECT);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_IOSELECT_INT, IO_SELECT_InternalROM);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_EXPANSIONROMTYPE, (UINT) g_eExpansionRomType);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PERIPHERALROMSLOT, g_uPeripheralRomSlot);
|
||||
yamlSaveHelper.SaveHex32(SS_YAML_KEY_MEMORYMODE, memmode);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_LASTRAMWRITE, lastwriteram ? 1 : 0);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_IOSELECT, IO_SELECT);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_IOSELECT_INT, IO_SELECT_InternalROM);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_EXPANSIONROMTYPE, (UINT) g_eExpansionRomType);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PERIPHERALROMSLOT, g_uPeripheralRomSlot);
|
||||
}
|
||||
|
||||
MemSaveSnapshotMemory(yamlSaveHelper, true);
|
||||
@ -1762,7 +1762,7 @@ bool MemLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
return false;
|
||||
|
||||
SetMemMode( yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_MEMORYMODE) );
|
||||
lastwriteram = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_LASTRAMWRITE) ? 1 : 0;
|
||||
lastwriteram = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_LASTRAMWRITE) ? TRUE : FALSE;
|
||||
IO_SELECT = (BYTE) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_IOSELECT);
|
||||
IO_SELECT_InternalROM = (BYTE) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_IOSELECT_INT);
|
||||
g_eExpansionRomType = (eExpansionRomType) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_EXPANSIONROMTYPE);
|
||||
@ -1807,7 +1807,7 @@ void MemSaveSnapshotAux(YamlSaveHelper& yamlSaveHelper)
|
||||
std::string card = g_uMaxExPages == 0 ? SS_YAML_VALUE_CARD_80COL : // todo: support empty slot
|
||||
g_uMaxExPages == 1 ? SS_YAML_VALUE_CARD_EXTENDED80COL :
|
||||
SS_YAML_VALUE_CARD_RAMWORKSIII;
|
||||
yamlSaveHelper.Save("%s: %s\n", SS_YAML_KEY_CARD, card.c_str());
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_CARD, card.c_str());
|
||||
yamlSaveHelper.Save("%s: %02X # [0,1..7F] 0=no aux mem, 1=128K system, etc\n", SS_YAML_KEY_NUMAUXBANKS, g_uMaxExPages);
|
||||
yamlSaveHelper.Save("%s: %02X # [ 0..7E] 0=memaux\n", SS_YAML_KEY_ACTIVEAUXBANK, g_uActiveBank);
|
||||
|
||||
|
@ -1940,19 +1940,19 @@ static void SaveSnapshotSY6522(YamlSaveHelper& yamlSaveHelper, SY6522& sy6522)
|
||||
{
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", SS_YAML_KEY_SY6522);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_ORB, sy6522.ORB);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_ORA, sy6522.ORA);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_DDRB, sy6522.DDRB);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_DDRA, sy6522.DDRA);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_SY6522_REG_T1_COUNTER, sy6522.TIMER1_COUNTER);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_SY6522_REG_T1_LATCH, sy6522.TIMER1_LATCH);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_SY6522_REG_T2_COUNTER, sy6522.TIMER2_COUNTER);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_SY6522_REG_T2_LATCH, sy6522.TIMER2_LATCH);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_SERIAL_SHIFT, sy6522.SERIAL_SHIFT);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_ACR, sy6522.ACR);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_PCR, sy6522.PCR);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_IFR, sy6522.IFR);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SY6522_REG_IER, sy6522.IER);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_ORB, sy6522.ORB);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_ORA, sy6522.ORA);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_DDRB, sy6522.DDRB);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_DDRA, sy6522.DDRA);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_SY6522_REG_T1_COUNTER, sy6522.TIMER1_COUNTER.w);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_SY6522_REG_T1_LATCH, sy6522.TIMER1_LATCH.w);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_SY6522_REG_T2_COUNTER, sy6522.TIMER2_COUNTER.w);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_SY6522_REG_T2_LATCH, sy6522.TIMER2_LATCH.w);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_SERIAL_SHIFT, sy6522.SERIAL_SHIFT);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_ACR, sy6522.ACR);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_PCR, sy6522.PCR);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_IFR, sy6522.IFR);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SY6522_REG_IER, sy6522.IER);
|
||||
// NB. No need to write ORA_NO_HS, since same data as ORA, just without handshake
|
||||
}
|
||||
|
||||
@ -1960,12 +1960,12 @@ static void SaveSnapshotSSI263(YamlSaveHelper& yamlSaveHelper, SSI263A& ssi263)
|
||||
{
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", SS_YAML_KEY_SSI263);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SSI263_REG_DUR_PHON, ssi263.DurationPhoneme);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SSI263_REG_INF, ssi263.Inflection);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SSI263_REG_RATE_INF, ssi263.RateInflection);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SSI263_REG_CTRL_ART_AMP, ssi263.CtrlArtAmp);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SSI263_REG_FILTER_FREQ, ssi263.FilterFreq);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_SSI263_REG_CURRENT_MODE, ssi263.CurrentMode);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SSI263_REG_DUR_PHON, ssi263.DurationPhoneme);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SSI263_REG_INF, ssi263.Inflection);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SSI263_REG_RATE_INF, ssi263.RateInflection);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SSI263_REG_CTRL_ART_AMP, ssi263.CtrlArtAmp);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SSI263_REG_FILTER_FREQ, ssi263.FilterFreq);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_SSI263_REG_CURRENT_MODE, ssi263.CurrentMode);
|
||||
}
|
||||
|
||||
void MB_SaveSnapshot(YamlSaveHelper& yamlSaveHelper, const UINT uSlot)
|
||||
@ -1986,7 +1986,7 @@ void MB_SaveSnapshot(YamlSaveHelper& yamlSaveHelper, const UINT uSlot)
|
||||
AY8910_SaveSnapshot(yamlSaveHelper, nDeviceNum, std::string(""));
|
||||
SaveSnapshotSSI263(yamlSaveHelper, pMB->SpeechChip);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%1X\n", SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister);
|
||||
yamlSaveHelper.SaveHex4(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister);
|
||||
yamlSaveHelper.Save("%s: %d # Not supported\n", SS_YAML_KEY_TIMER1_IRQ, 0);
|
||||
yamlSaveHelper.Save("%s: %d # Not supported\n", SS_YAML_KEY_TIMER2_IRQ, 0);
|
||||
yamlSaveHelper.Save("%s: %d # Not supported\n", SS_YAML_KEY_SPEECH_IRQ, 0);
|
||||
@ -2114,8 +2114,8 @@ void Phasor_SaveSnapshot(YamlSaveHelper& yamlSaveHelper, const UINT uSlot)
|
||||
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PHASOR_CLOCK_SCALE_FACTOR, g_PhasorClockScaleFactor);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PHASOR_MODE, g_nPhasorMode);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PHASOR_CLOCK_SCALE_FACTOR, g_PhasorClockScaleFactor);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PHASOR_MODE, g_nPhasorMode);
|
||||
|
||||
for(UINT i=0; i<NUM_PHASOR_UNITS; i++)
|
||||
{
|
||||
@ -2126,7 +2126,7 @@ void Phasor_SaveSnapshot(YamlSaveHelper& yamlSaveHelper, const UINT uSlot)
|
||||
AY8910_SaveSnapshot(yamlSaveHelper, nDeviceNum+1, std::string("-B"));
|
||||
SaveSnapshotSSI263(yamlSaveHelper, pMB->SpeechChip);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%1X\n", SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister);
|
||||
yamlSaveHelper.SaveHex4(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister);
|
||||
yamlSaveHelper.Save("%s: %d # Not supported\n", SS_YAML_KEY_TIMER1_IRQ, 0);
|
||||
yamlSaveHelper.Save("%s: %d # Not supported\n", SS_YAML_KEY_TIMER2_IRQ, 0);
|
||||
yamlSaveHelper.Save("%s: %d # Not supported\n", SS_YAML_KEY_SPEECH_IRQ, 0);
|
||||
|
@ -629,7 +629,6 @@ void CMouseInterface::SetButton(eBUTTON Button, eBUTTONSTATE State)
|
||||
#define SS_YAML_KEY_IMAXY "iMaxY"
|
||||
#define SS_YAML_KEY_BUTTON0 "Button0"
|
||||
#define SS_YAML_KEY_BUTTON1 "Button1"
|
||||
#define SS_YAML_KEY_ACTIVE "Active"
|
||||
#define SS_YAML_KEY_ENABLED "Enabled"
|
||||
|
||||
std::string CMouseInterface::GetSnapshotCardName(void)
|
||||
@ -647,14 +646,14 @@ void CMouseInterface::SaveSnapshotMC6821(YamlSaveHelper& yamlSaveHelper, std::st
|
||||
m_6821.Get6821(mc6821, byIA, byIB);
|
||||
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", key.c_str());
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PRA, mc6821.pra);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_DDRA, mc6821.ddra);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_CRA, mc6821.cra);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PRB, mc6821.prb);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_DDRB, mc6821.ddrb);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_CRB, mc6821.crb);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IA, byIA);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IB, byIB);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PRA, mc6821.pra);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_DDRA, mc6821.ddra);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_CRA, mc6821.cra);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PRB, mc6821.prb);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_DDRB, mc6821.ddrb);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_CRB, mc6821.crb);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IA, byIA);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IB, byIB);
|
||||
}
|
||||
|
||||
void CMouseInterface::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
@ -667,9 +666,9 @@ void CMouseInterface::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
SaveSnapshotMC6821(yamlSaveHelper, SS_YAML_KEY_MC6821);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_DATALEN, m_nDataLen);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_MODE, m_byMode);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_6821B, m_by6821B);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_6821A, m_by6821A);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_MODE, m_byMode);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_6821B, m_by6821B);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_6821A, m_by6821A);
|
||||
|
||||
// New label
|
||||
{
|
||||
@ -678,22 +677,21 @@ void CMouseInterface::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
}
|
||||
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BUFFPOS, m_nBuffPos);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_MOUSESTATE, m_byState);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_X, m_nX);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_Y, m_nY);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BTN0, m_bBtn0);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BTN1, m_bBtn1);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_VBL, m_bVBL ? 1 : 0);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IX, m_iX);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IMINX, m_iMinX);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IMAXX, m_iMaxX);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IY, m_iY);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IMINY, m_iMinY);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IMAXY, m_iMaxY);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BUTTON0, m_bButtons[0]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BUTTON1, m_bButtons[1]);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ACTIVE, m_bActive ? 1 : 0);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ENABLED, m_bEnabled ? 1 : 0);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_MOUSESTATE, m_byState);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_X, m_nX);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_Y, m_nY);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_BTN0, m_bBtn0);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_BTN1, m_bBtn1);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_VBL, m_bVBL);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IX, m_iX);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IMINX, m_iMinX);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IMAXX, m_iMaxX);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IY, m_iY);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IMINY, m_iMinY);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IMAXY, m_iMaxY);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_BUTTON0, m_bButtons[0]);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_BUTTON1, m_bButtons[1]);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_ENABLED, m_bEnabled);
|
||||
}
|
||||
|
||||
void CMouseInterface::LoadSnapshotMC6821(YamlLoadHelper& yamlLoadHelper, std::string key)
|
||||
@ -752,8 +750,7 @@ bool CMouseInterface::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT sl
|
||||
m_iMaxY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMAXY);
|
||||
m_bButtons[0] = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_BUTTON0);
|
||||
m_bButtons[1] = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_BUTTON1);
|
||||
m_bActive = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ACTIVE);
|
||||
m_bEnabled = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ENABLED);
|
||||
m_bEnabled = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ENABLED); // MemInitializeIO() calls Initialize() which sets true
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ public:
|
||||
void SetPositionRel(long dx, long dy, int* pOutOfBoundsX, int* pOutOfBoundsY);
|
||||
void SetButton(eBUTTON Button, eBUTTONSTATE State);
|
||||
bool IsActive() { return m_bActive; }
|
||||
bool IsEnabled() { return m_bEnabled; }
|
||||
bool IsActiveAndEnabled() { return IsActive() && IsEnabled(); }
|
||||
bool IsEnabled() { return m_bEnabled; } // NB. m_bEnabled == true implies that m_bActive == true
|
||||
bool IsActiveAndEnabled() { return IsActive() && IsEnabled(); } // todo: just use IsEnabled()
|
||||
void SetEnabled(bool bEnabled) { m_bEnabled = bEnabled; }
|
||||
void SetVBlank(bool bVBL);
|
||||
void GetXY(int& iX, int& iMinX, int& iMaxX, int& iY, int& iMinY, int& iMaxY)
|
||||
@ -93,8 +93,10 @@ protected:
|
||||
|
||||
//
|
||||
|
||||
// todo: remove m_bActive:
|
||||
// - instantiate CMouseInterface object when active (and delete when inactive)
|
||||
bool m_bActive; // Mouse h/w is active within the Apple][ VM
|
||||
bool m_bEnabled; // Windows' mouse events get passed to Apple]['s mouse h/w
|
||||
bool m_bEnabled; // Windows' mouse events get passed to Apple]['s mouse h/w (m_bEnabled == true implies that m_bActive == true)
|
||||
LPBYTE m_pSlotRom;
|
||||
UINT m_uSlot;
|
||||
};
|
||||
|
@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "..\resource\resource.h"
|
||||
|
||||
static DWORD inactivity = 0;
|
||||
static int g_iPrinterIdleLimit = 10;
|
||||
static unsigned int g_PrinterIdleLimit = 10;
|
||||
static FILE* file = NULL;
|
||||
DWORD const PRINTDRVR_SIZE = APPLE_SLOT_SIZE;
|
||||
#define DEFAULT_PRINT_FILENAME "Printer.txt"
|
||||
@ -246,12 +246,12 @@ void Printer_SetFilename(char* prtFilename)
|
||||
|
||||
unsigned int Printer_GetIdleLimit()
|
||||
{
|
||||
return g_iPrinterIdleLimit;
|
||||
return g_PrinterIdleLimit;
|
||||
}
|
||||
|
||||
void Printer_SetIdleLimit(unsigned int Duration)
|
||||
{
|
||||
g_iPrinterIdleLimit = Duration;
|
||||
g_PrinterIdleLimit = Duration;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@ -279,15 +279,15 @@ void Printer_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
YamlSaveHelper::Slot slot(yamlSaveHelper, Printer_GetSnapshotCardName(), g_uSlot, 1);
|
||||
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_INACTIVITY, inactivity);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_IDLELIMIT, g_iPrinterIdleLimit);
|
||||
yamlSaveHelper.Save("%s: %s\n", SS_YAML_KEY_FILENAME, yamlSaveHelper.GetSaveString(g_szPrintFilename).c_str());
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_FILEOPEN, (file != NULL) ? 1 : 0);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_DUMPTOPRINTER, g_bDumpToPrinter);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_CONVERTENCODING, g_bConvertEncoding);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_FILTERUNPRINTABLE, g_bFilterUnprintable);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_APPEND, g_bPrinterAppend);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_DUMPTOREALPRINTER, g_bEnableDumpToRealPrinter);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_INACTIVITY, inactivity);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_IDLELIMIT, g_PrinterIdleLimit);
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_FILENAME, g_szPrintFilename);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_FILEOPEN, (file != NULL) ? 1 : 0);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_DUMPTOPRINTER, g_bDumpToPrinter);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_CONVERTENCODING, g_bConvertEncoding);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_FILTERUNPRINTABLE, g_bFilterUnprintable);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_APPEND, g_bPrinterAppend);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_DUMPTOREALPRINTER, g_bEnableDumpToRealPrinter);
|
||||
}
|
||||
|
||||
bool Printer_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version)
|
||||
@ -299,7 +299,7 @@ bool Printer_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT
|
||||
throw std::string("Card: wrong version");
|
||||
|
||||
inactivity = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_INACTIVITY);
|
||||
g_iPrinterIdleLimit = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_IDLELIMIT);
|
||||
g_PrinterIdleLimit = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_IDLELIMIT);
|
||||
strncpy(g_szPrintFilename, yamlLoadHelper.GetMapValueSTRING(SS_YAML_KEY_FILENAME).c_str(), sizeof(g_szPrintFilename));
|
||||
|
||||
if (yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_FILEOPEN))
|
||||
|
@ -1349,13 +1349,13 @@ std::string CSuperSerialCard::GetSnapshotCardName(void)
|
||||
void CSuperSerialCard::SaveSnapshotDIPSW(YamlSaveHelper& yamlSaveHelper, std::string key, SSC_DIPSW& dipsw)
|
||||
{
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", key.c_str());
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BAUDRATE, dipsw.uBaudRate);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_FWMODE, dipsw.eFirmwareMode);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_STOPBITS, dipsw.uStopBits);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BYTESIZE, dipsw.uByteSize);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PARITY, dipsw.uParity);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_LINEFEED, dipsw.bLinefeed);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_INTERRUPTS, dipsw.bInterrupts);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_BAUDRATE, dipsw.uBaudRate);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_FWMODE, dipsw.eFirmwareMode);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_STOPBITS, dipsw.uStopBits);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_BYTESIZE, dipsw.uByteSize);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PARITY, dipsw.uParity);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_LINEFEED, dipsw.bLinefeed);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_INTERRUPTS, dipsw.bInterrupts);
|
||||
}
|
||||
|
||||
void CSuperSerialCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
@ -1365,19 +1365,19 @@ void CSuperSerialCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
YamlSaveHelper::Label unit(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
SaveSnapshotDIPSW(yamlSaveHelper, SS_YAML_KEY_DIPSWDEFAULT, m_DIPSWDefault);
|
||||
SaveSnapshotDIPSW(yamlSaveHelper, SS_YAML_KEY_DIPSWCURRENT, m_DIPSWCurrent);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BAUDRATE, m_uBaudRate);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_STOPBITS, m_uStopBits);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BYTESIZE, m_uByteSize);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_PARITY, m_uParity);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_CONTROL, m_uControlByte);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_COMMAND, m_uCommandByte);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_INACTIVITY, m_dwCommInactivity);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TXIRQENABLED, m_bTxIrqEnabled);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_RXIRQENABLED, m_bRxIrqEnabled);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_TXIRQPENDING, m_vbTxIrqPending);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_RXIRQPENDING, m_vbRxIrqPending);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_WRITTENTX, m_bWrittenTx);
|
||||
yamlSaveHelper.Save("%s: %s\n", SS_YAML_KEY_SERIALPORTNAME, yamlSaveHelper.GetSaveString(GetSerialPortName()).c_str());
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_BAUDRATE, m_uBaudRate);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_STOPBITS, m_uStopBits);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_BYTESIZE, m_uByteSize);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_PARITY, m_uParity);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_CONTROL, m_uControlByte);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_COMMAND, m_uCommandByte);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_INACTIVITY, m_dwCommInactivity);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_TXIRQENABLED, m_bTxIrqEnabled);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_RXIRQENABLED, m_bRxIrqEnabled);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_TXIRQPENDING, m_vbTxIrqPending);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_RXIRQPENDING, m_vbRxIrqPending);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_WRITTENTX, m_bWrittenTx);
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_SERIALPORTNAME, GetSerialPortName());
|
||||
}
|
||||
|
||||
void CSuperSerialCard::LoadSnapshotDIPSW(YamlLoadHelper& yamlLoadHelper, std::string key, SSC_DIPSW& dipsw)
|
||||
|
@ -1111,7 +1111,7 @@ static std::string SpkrGetSnapshotStructName(void)
|
||||
void SpkrSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SpkrGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.Save("%s: 0x%016llX\n", SS_YAML_KEY_LASTCYCLE, g_nSpkrLastCycle);
|
||||
yamlSaveHelper.SaveHex64(SS_YAML_KEY_LASTCYCLE, g_nSpkrLastCycle);
|
||||
}
|
||||
|
||||
void SpkrLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
|
@ -2963,9 +2963,9 @@ static std::string VideoGetSnapshotStructName(void)
|
||||
void VideoSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", VideoGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ALTCHARSET, g_nAltCharSetOffset ? 1 : 0);
|
||||
yamlSaveHelper.Save("%s: 0x%08X\n", SS_YAML_KEY_VIDEOMODE, g_uVideoMode);
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_CYCLESTHISFRAME, g_dwCyclesThisFrame);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_ALTCHARSET, g_nAltCharSetOffset ? 1 : 0);
|
||||
yamlSaveHelper.SaveHex32(SS_YAML_KEY_VIDEOMODE, g_uVideoMode);
|
||||
yamlSaveHelper.SaveUint(SS_YAML_KEY_CYCLESTHISFRAME, g_dwCyclesThisFrame);
|
||||
}
|
||||
|
||||
void VideoLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
|
@ -285,20 +285,70 @@ void YamlSaveHelper::Save(const char* format, ...)
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveInt(const char* key, int value)
|
||||
{
|
||||
Save("%s: %d\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveUint(const char* key, UINT value)
|
||||
{
|
||||
Save("%s: %u\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveHex4(const char* key, UINT value)
|
||||
{
|
||||
Save("%s: 0x%01X\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveHex8(const char* key, UINT value)
|
||||
{
|
||||
Save("%s: 0x%02X\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveHex12(const char* key, UINT value)
|
||||
{
|
||||
Save("%s: 0x%03X\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveHex16(const char* key, UINT value)
|
||||
{
|
||||
Save("%s: 0x%04X\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveHex32(const char* key, UINT value)
|
||||
{
|
||||
Save("%s: 0x%08X\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveHex64(const char* key, UINT64 value)
|
||||
{
|
||||
Save("%s: 0x%016llX\n", key, value);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveBool(const char* key, bool value)
|
||||
{
|
||||
SaveUint(key, value ? 1 : 0);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveString(const char* key, const char* value)
|
||||
{
|
||||
Save("%s: %s\n", key, (value[0] != 0) ? value : "\"\"");
|
||||
}
|
||||
|
||||
void YamlSaveHelper::FileHdr(UINT version)
|
||||
{
|
||||
fprintf(m_hFile, "%s:\n", SS_YAML_KEY_FILEHDR);
|
||||
m_indent = 2;
|
||||
Save("%s: %s\n", SS_YAML_KEY_TAG, SS_YAML_VALUE_AWSS);
|
||||
Save("%s: %d\n", SS_YAML_KEY_VERSION, version);
|
||||
SaveString(SS_YAML_KEY_TAG, SS_YAML_VALUE_AWSS);
|
||||
SaveInt(SS_YAML_KEY_VERSION, version);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::UnitHdr(std::string type, UINT version)
|
||||
{
|
||||
fprintf(m_hFile, "\n%s:\n", SS_YAML_KEY_UNIT);
|
||||
m_indent = 2;
|
||||
Save("%s: %s\n", SS_YAML_KEY_TYPE, type.c_str());
|
||||
Save("%s: %d\n", SS_YAML_KEY_VERSION, version);
|
||||
SaveString(SS_YAML_KEY_TYPE, type.c_str());
|
||||
SaveInt(SS_YAML_KEY_VERSION, version);
|
||||
}
|
||||
|
||||
void YamlSaveHelper::SaveMapValueMemory(const LPBYTE pMemBase, const UINT uMemSize)
|
||||
@ -353,8 +403,3 @@ void YamlSaveHelper::SaveMapValueMemory(const LPBYTE pMemBase, const UINT uMemSi
|
||||
|
||||
delete [] pLine;
|
||||
}
|
||||
|
||||
std::string YamlSaveHelper::GetSaveString(const char* pValue)
|
||||
{
|
||||
return (pValue[0] != 0) ? pValue : "\"\"";
|
||||
}
|
||||
|
@ -259,6 +259,17 @@ public:
|
||||
|
||||
void Save(const char* format, ...);
|
||||
|
||||
void SaveInt(const char* key, int value);
|
||||
void SaveUint(const char* key, UINT value);
|
||||
void SaveHex4(const char* key, UINT value);
|
||||
void SaveHex8(const char* key, UINT value);
|
||||
void SaveHex12(const char* key, UINT value);
|
||||
void SaveHex16(const char* key, UINT value);
|
||||
void SaveHex32(const char* key, UINT value);
|
||||
void SaveHex64(const char* key, UINT64 value);
|
||||
void SaveBool(const char* key, bool value);
|
||||
void SaveString(const char* key, const char* value);
|
||||
|
||||
class Label
|
||||
{
|
||||
public:
|
||||
@ -301,7 +312,6 @@ public:
|
||||
void FileHdr(UINT version);
|
||||
void UnitHdr(std::string type, UINT version);
|
||||
void SaveMapValueMemory(const LPBYTE pMemBase, const UINT uMemSize);
|
||||
std::string GetSaveString(const char* pValue);
|
||||
|
||||
private:
|
||||
FILE* m_hFile;
|
||||
|
@ -6491,33 +6491,33 @@ void Z80_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper, const UINT uSlot)
|
||||
|
||||
yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_ACTIVE, GetActiveCpu() == CPU_Z80 ? 1 : 0);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGA, reg_a);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGB, reg_b);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGC, reg_c);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGD, reg_d);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGE, reg_e);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGF, reg_f);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGH, reg_h);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGL, reg_l);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_REGIX, ((USHORT)reg_ixh<<8)|(USHORT)reg_ixl);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_REGIY, ((USHORT)reg_iyh<<8)|(USHORT)reg_iyl);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_REGSP, reg_sp);
|
||||
yamlSaveHelper.Save("%s: 0x%04X\n", SS_YAML_KEY_REGPC, (USHORT)z80_reg_pc);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGI, reg_i);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGR, reg_r);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGA, reg_a);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGB, reg_b);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGC, reg_c);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGD, reg_d);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGE, reg_e);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGF, reg_f);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGH, reg_h);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGL, reg_l);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_REGIX, ((USHORT)reg_ixh<<8)|(USHORT)reg_ixl);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_REGIY, ((USHORT)reg_iyh<<8)|(USHORT)reg_iyl);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_REGSP, reg_sp);
|
||||
yamlSaveHelper.SaveHex16(SS_YAML_KEY_REGPC, (USHORT)z80_reg_pc);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGI, reg_i);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGR, reg_r);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_IFF1, iff1);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_IFF2, iff2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_IM_MODE, im_mode);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_IFF1, iff1);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_IFF2, iff2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_IM_MODE, im_mode);
|
||||
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGA2, reg_a2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGB2, reg_b2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGC2, reg_c2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGD2, reg_d2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGE2, reg_e2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGF2, reg_f2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGH2, reg_h2);
|
||||
yamlSaveHelper.Save("%s: 0x%02X\n", SS_YAML_KEY_REGL2, reg_l2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGA2, reg_a2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGB2, reg_b2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGC2, reg_c2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGD2, reg_d2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGE2, reg_e2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGF2, reg_f2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGH2, reg_h2);
|
||||
yamlSaveHelper.SaveHex8(SS_YAML_KEY_REGL2, reg_l2);
|
||||
}
|
||||
|
||||
bool Z80_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT uSlot, UINT version)
|
||||
|
Loading…
Reference in New Issue
Block a user