From d0243c71d7f3a7deaf73e754063c332e2809dc53 Mon Sep 17 00:00:00 2001 From: tomcw Date: Fri, 4 Mar 2016 21:26:14 +0000 Subject: [PATCH] Save-state: rename SaveHex{4|8|12|16...64} to SaveHexUint{4|8|12|16...64} --- source/AY8910.cpp | 24 +++++++++---------- source/Applewin.cpp | 2 +- source/CPU.cpp | 14 +++++------ source/Disk.cpp | 8 +++---- source/Harddisk.cpp | 10 ++++---- source/Joystick.cpp | 2 +- source/Keyboard.cpp | 2 +- source/Memory.cpp | 6 ++--- source/Mockingboard.cpp | 42 ++++++++++++++++---------------- source/MouseInterface.cpp | 8 +++---- source/SerialComms.cpp | 4 ++-- source/Speaker.cpp | 2 +- source/Video.cpp | 2 +- source/YamlHelper.cpp | 12 +++++----- source/YamlHelper.h | 12 +++++----- source/Z80VICE/z80.cpp | 50 +++++++++++++++++++-------------------- 16 files changed, 100 insertions(+), 100 deletions(-) diff --git a/source/AY8910.cpp b/source/AY8910.cpp index bc41cfe5..e742e407 100644 --- a/source/AY8910.cpp +++ b/source/AY8910.cpp @@ -1023,18 +1023,18 @@ void CAY8910::SaveSnapshot(YamlSaveHelper& yamlSaveHelper, std::string& suffix) { YamlSaveHelper::Label registers(yamlSaveHelper, "%s:\n", SS_YAML_KEY_REGISTERS); - 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]); + yamlSaveHelper.SaveHexUint12(SS_YAML_KEY_REG_TONE0_PERIOD, (UINT)(sound_ay_registers[1]<<8) | sound_ay_registers[0]); + yamlSaveHelper.SaveHexUint12(SS_YAML_KEY_REG_TONE1_PERIOD, (UINT)(sound_ay_registers[3]<<8) | sound_ay_registers[2]); + yamlSaveHelper.SaveHexUint12(SS_YAML_KEY_REG_TONE2_PERIOD, (UINT)(sound_ay_registers[5]<<8) | sound_ay_registers[4]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_NOISE_PERIOD, sound_ay_registers[6]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_MIXER, sound_ay_registers[7]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_VOL0, sound_ay_registers[8]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_VOL1, sound_ay_registers[9]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_VOL2, sound_ay_registers[10]); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_REG_ENV_PERIOD, (UINT)(sound_ay_registers[12]<<8) | sound_ay_registers[11]); + yamlSaveHelper.SaveHexUint4(SS_YAML_KEY_REG_ENV_SHAPE, sound_ay_registers[13]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_PORTA, sound_ay_registers[14]); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REG_PORTB, sound_ay_registers[15]); } // New label diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 4d3a8ee0..76eb67a6 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -1089,7 +1089,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) Snapshot_SetFilename(szSnapshotName); Snapshot_LoadState(); bBoot = true; -#if _DEBUG && 0 // Debug/test: Save a duplicate of the save-state file in tmp folder +#if _DEBUG && 1 // 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; diff --git a/source/CPU.cpp b/source/CPU.cpp index c0cfed32..3c998c14 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -730,13 +730,13 @@ void CpuSaveSnapshot(YamlSaveHelper& yamlSaveHelper) YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", CpuGetSnapshotStructName().c_str()); 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); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGA, regs.a); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGX, regs.x); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGY, regs.y); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGP, regs.ps); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGS, (BYTE) regs.sp); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_REGPC, regs.pc); + yamlSaveHelper.SaveHexUint64(SS_YAML_KEY_CUMULATIVECYCLES, g_nCumulativeCycles); } void CpuLoadSnapshot(YamlLoadHelper& yamlLoadHelper) diff --git a/source/Disk.cpp b/source/Disk.cpp index 96a029a7..a239e1c8 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -1205,11 +1205,11 @@ static void DiskSaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit) 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.SaveHexUint16(SS_YAML_KEY_BYTE, g_aFloppyDisk[unit].byte); yamlSaveHelper.SaveBool(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.SaveHexUint16(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); @@ -1225,11 +1225,11 @@ void DiskSaveSnapshot(class YamlSaveHelper& yamlSaveHelper) YamlSaveHelper::Slot slot(yamlSaveHelper, DiskGetSnapshotCardName(), g_uSlot, 1); YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE); - yamlSaveHelper.SaveHex4(SS_YAML_KEY_PHASES, phases); + yamlSaveHelper.SaveHexUint4(SS_YAML_KEY_PHASES, phases); yamlSaveHelper.SaveUint(SS_YAML_KEY_CURRENT_DRIVE, currdrive); yamlSaveHelper.SaveBool(SS_YAML_KEY_DISK_ACCESSED, diskaccessed == TRUE); yamlSaveHelper.SaveBool(SS_YAML_KEY_ENHANCE_DISK, enhancedisk == TRUE); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_FLOPPY_LATCH, floppylatch); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_FLOPPY_LATCH, floppylatch); yamlSaveHelper.SaveBool(SS_YAML_KEY_FLOPPY_MOTOR_ON, floppymotoron == TRUE); yamlSaveHelper.SaveBool(SS_YAML_KEY_FLOPPY_WRITE_MODE, floppywritemode == TRUE); diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index 83c0b953..90b3a0bc 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -689,13 +689,13 @@ static void HD_SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, UINT unit) { YamlSaveHelper::Label label(yamlSaveHelper, "%s%d:\n", SS_YAML_KEY_HDDUNIT, unit); 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.SaveHexUint8(SS_YAML_KEY_ERROR, g_HardDisk[unit].hd_error); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_MEMBLOCK, g_HardDisk[unit].hd_memblock); + yamlSaveHelper.SaveHexUint32(SS_YAML_KEY_DISKBLOCK, g_HardDisk[unit].hd_diskblock); yamlSaveHelper.SaveBool(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); + yamlSaveHelper.SaveHexUint16(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.SaveHex8(SS_YAML_KEY_COMMAND, g_nHD_Command); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_COMMAND, g_nHD_Command); HD_SaveSnapshotHDDUnit(yamlSaveHelper, HARDDISK_1); HD_SaveSnapshotHDDUnit(yamlSaveHelper, HARDDISK_2); diff --git a/source/Joystick.cpp b/source/Joystick.cpp index f1357cd1..79c14764 100644 --- a/source/Joystick.cpp +++ b/source/Joystick.cpp @@ -871,7 +871,7 @@ static std::string JoyGetSnapshotStructName(void) void JoySaveSnapshot(YamlSaveHelper& yamlSaveHelper) { YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", JoyGetSnapshotStructName().c_str()); - yamlSaveHelper.SaveHex64(SS_YAML_KEY_COUNTERRESETCYCLE, g_nJoyCntrResetCycle); + yamlSaveHelper.SaveHexUint64(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 diff --git a/source/Keyboard.cpp b/source/Keyboard.cpp index 00c9f6d0..936eb63b 100644 --- a/source/Keyboard.cpp +++ b/source/Keyboard.cpp @@ -519,7 +519,7 @@ static std::string KeybGetSnapshotStructName(void) void KeybSaveSnapshot(YamlSaveHelper& yamlSaveHelper) { YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", KeybGetSnapshotStructName().c_str()); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_LASTKEY, g_nLastKey); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_LASTKEY, g_nLastKey); } void KeybLoadSnapshot(YamlLoadHelper& yamlLoadHelper) diff --git a/source/Memory.cpp b/source/Memory.cpp index f66a0855..4cf056cf 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1745,10 +1745,10 @@ 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.SaveHex32(SS_YAML_KEY_MEMORYMODE, memmode); + yamlSaveHelper.SaveHexUint32(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.SaveHexUint8(SS_YAML_KEY_IOSELECT, IO_SELECT); + yamlSaveHelper.SaveHexUint8(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); } diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 0451dc65..0143f8e9 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -1940,19 +1940,19 @@ static void SaveSnapshotSY6522(YamlSaveHelper& yamlSaveHelper, SY6522& sy6522) { YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", SS_YAML_KEY_SY6522); - 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); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_ORB, sy6522.ORB); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_ORA, sy6522.ORA); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_DDRB, sy6522.DDRB); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_DDRA, sy6522.DDRA); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T1_COUNTER, sy6522.TIMER1_COUNTER.w); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T1_LATCH, sy6522.TIMER1_LATCH.w); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T2_COUNTER, sy6522.TIMER2_COUNTER.w); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T2_LATCH, sy6522.TIMER2_LATCH.w); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_SERIAL_SHIFT, sy6522.SERIAL_SHIFT); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_ACR, sy6522.ACR); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_PCR, sy6522.PCR); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_IFR, sy6522.IFR); + yamlSaveHelper.SaveHexUint8(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.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); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SSI263_REG_DUR_PHON, ssi263.DurationPhoneme); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SSI263_REG_INF, ssi263.Inflection); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SSI263_REG_RATE_INF, ssi263.RateInflection); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SSI263_REG_CTRL_ART_AMP, ssi263.CtrlArtAmp); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SSI263_REG_FILTER_FREQ, ssi263.FilterFreq); + yamlSaveHelper.SaveHexUint8(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.SaveHex4(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister); + yamlSaveHelper.SaveHexUint4(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister); yamlSaveHelper.Save("%s: %s # Not supported\n", SS_YAML_KEY_TIMER1_IRQ, "false"); yamlSaveHelper.Save("%s: %s # Not supported\n", SS_YAML_KEY_TIMER2_IRQ, "false"); yamlSaveHelper.Save("%s: %s # Not supported\n", SS_YAML_KEY_SPEECH_IRQ, "false"); @@ -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.SaveHex4(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister); + yamlSaveHelper.SaveHexUint4(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister); yamlSaveHelper.Save("%s: %s # Not supported\n", SS_YAML_KEY_TIMER1_IRQ, "false"); yamlSaveHelper.Save("%s: %s # Not supported\n", SS_YAML_KEY_TIMER2_IRQ, "false"); yamlSaveHelper.Save("%s: %s # Not supported\n", SS_YAML_KEY_SPEECH_IRQ, "false"); diff --git a/source/MouseInterface.cpp b/source/MouseInterface.cpp index b94bd73f..34b25788 100644 --- a/source/MouseInterface.cpp +++ b/source/MouseInterface.cpp @@ -666,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.SaveHex8(SS_YAML_KEY_MODE, m_byMode); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_6821B, m_by6821B); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_6821A, m_by6821A); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_MODE, m_byMode); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_6821B, m_by6821B); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_6821A, m_by6821A); // New label { @@ -677,7 +677,7 @@ void CMouseInterface::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper) } yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BUFFPOS, m_nBuffPos); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_MOUSESTATE, m_byState); + yamlSaveHelper.SaveHexUint8(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); diff --git a/source/SerialComms.cpp b/source/SerialComms.cpp index 83660262..5aa1f209 100644 --- a/source/SerialComms.cpp +++ b/source/SerialComms.cpp @@ -1369,8 +1369,8 @@ void CSuperSerialCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper) 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.SaveHexUint8(SS_YAML_KEY_CONTROL, m_uControlByte); + yamlSaveHelper.SaveHexUint8(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); diff --git a/source/Speaker.cpp b/source/Speaker.cpp index 0a90f963..fcf1dd9f 100644 --- a/source/Speaker.cpp +++ b/source/Speaker.cpp @@ -1111,7 +1111,7 @@ static std::string SpkrGetSnapshotStructName(void) void SpkrSaveSnapshot(YamlSaveHelper& yamlSaveHelper) { YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SpkrGetSnapshotStructName().c_str()); - yamlSaveHelper.SaveHex64(SS_YAML_KEY_LASTCYCLE, g_nSpkrLastCycle); + yamlSaveHelper.SaveHexUint64(SS_YAML_KEY_LASTCYCLE, g_nSpkrLastCycle); } void SpkrLoadSnapshot(YamlLoadHelper& yamlLoadHelper) diff --git a/source/Video.cpp b/source/Video.cpp index 02d3720e..6b82c5ff 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -2964,7 +2964,7 @@ void VideoSaveSnapshot(YamlSaveHelper& yamlSaveHelper) { YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", VideoGetSnapshotStructName().c_str()); yamlSaveHelper.SaveBool(SS_YAML_KEY_ALTCHARSET, g_nAltCharSetOffset ? true : false); - yamlSaveHelper.SaveHex32(SS_YAML_KEY_VIDEOMODE, g_uVideoMode); + yamlSaveHelper.SaveHexUint32(SS_YAML_KEY_VIDEOMODE, g_uVideoMode); yamlSaveHelper.SaveUint(SS_YAML_KEY_CYCLESTHISFRAME, g_dwCyclesThisFrame); } diff --git a/source/YamlHelper.cpp b/source/YamlHelper.cpp index bc304b6d..883e5982 100644 --- a/source/YamlHelper.cpp +++ b/source/YamlHelper.cpp @@ -368,32 +368,32 @@ void YamlSaveHelper::SaveUint(const char* key, UINT value) Save("%s: %u\n", key, value); } -void YamlSaveHelper::SaveHex4(const char* key, UINT value) +void YamlSaveHelper::SaveHexUint4(const char* key, UINT value) { Save("%s: 0x%01X\n", key, value); } -void YamlSaveHelper::SaveHex8(const char* key, UINT value) +void YamlSaveHelper::SaveHexUint8(const char* key, UINT value) { Save("%s: 0x%02X\n", key, value); } -void YamlSaveHelper::SaveHex12(const char* key, UINT value) +void YamlSaveHelper::SaveHexUint12(const char* key, UINT value) { Save("%s: 0x%03X\n", key, value); } -void YamlSaveHelper::SaveHex16(const char* key, UINT value) +void YamlSaveHelper::SaveHexUint16(const char* key, UINT value) { Save("%s: 0x%04X\n", key, value); } -void YamlSaveHelper::SaveHex32(const char* key, UINT value) +void YamlSaveHelper::SaveHexUint32(const char* key, UINT value) { Save("%s: 0x%08X\n", key, value); } -void YamlSaveHelper::SaveHex64(const char* key, UINT64 value) +void YamlSaveHelper::SaveHexUint64(const char* key, UINT64 value) { Save("%s: 0x%016llX\n", key, value); } diff --git a/source/YamlHelper.h b/source/YamlHelper.h index 6cdb0fb2..31e871ca 100644 --- a/source/YamlHelper.h +++ b/source/YamlHelper.h @@ -205,12 +205,12 @@ public: 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 SaveHexUint4(const char* key, UINT value); + void SaveHexUint8(const char* key, UINT value); + void SaveHexUint12(const char* key, UINT value); + void SaveHexUint16(const char* key, UINT value); + void SaveHexUint32(const char* key, UINT value); + void SaveHexUint64(const char* key, UINT64 value); void SaveBool(const char* key, bool value); void SaveString(const char* key, const char* value); void SaveMemory(const LPBYTE pMemBase, const UINT uMemSize); diff --git a/source/Z80VICE/z80.cpp b/source/Z80VICE/z80.cpp index c84d51e0..7738cb40 100644 --- a/source/Z80VICE/z80.cpp +++ b/source/Z80VICE/z80.cpp @@ -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.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.SaveHexUint8(SS_YAML_KEY_REGA, reg_a); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGB, reg_b); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGC, reg_c); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGD, reg_d); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGE, reg_e); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGF, reg_f); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGH, reg_h); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGL, reg_l); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_REGIX, ((USHORT)reg_ixh<<8)|(USHORT)reg_ixl); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_REGIY, ((USHORT)reg_iyh<<8)|(USHORT)reg_iyl); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_REGSP, reg_sp); + yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_REGPC, (USHORT)z80_reg_pc); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGI, reg_i); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGR, reg_r); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_IFF1, iff1); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_IFF2, iff2); - yamlSaveHelper.SaveHex8(SS_YAML_KEY_IM_MODE, im_mode); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_IFF1, iff1); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_IFF2, iff2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_IM_MODE, im_mode); - 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); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGA2, reg_a2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGB2, reg_b2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGC2, reg_c2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGD2, reg_d2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGE2, reg_e2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGF2, reg_f2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGH2, reg_h2); + yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_REGL2, reg_l2); } bool Z80_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT uSlot, UINT version)