diff --git a/source/Disk.cpp b/source/Disk.cpp index 8c7cef97..357e9ee2 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -1216,7 +1216,7 @@ static void DiskSaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit) if (g_aFloppyDisk[unit].trackimage) { YamlSaveHelper::Label image(yamlSaveHelper, "%s:\n", SS_YAML_KEY_TRACK_IMAGE); - yamlSaveHelper.SaveMapValueMemory(g_aFloppyDisk[unit].trackimage, NIBBLES_PER_TRACK); + yamlSaveHelper.SaveMemory(g_aFloppyDisk[unit].trackimage, NIBBLES_PER_TRACK); } } diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index feffa5f7..6e4eeaf3 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -700,7 +700,7 @@ static void HD_SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, UINT unit) // New label { YamlSaveHelper::Label buffer(yamlSaveHelper, "%s:\n", SS_YAML_KEY_BUF); - yamlSaveHelper.SaveMapValueMemory(g_HardDisk[unit].hd_buf, HD_BLOCK_SIZE); + yamlSaveHelper.SaveMemory(g_HardDisk[unit].hd_buf, HD_BLOCK_SIZE); } } diff --git a/source/Memory.cpp b/source/Memory.cpp index 271a9a6b..f66a0855 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1731,12 +1731,12 @@ static void MemSaveSnapshotMemory(YamlSaveHelper& yamlSaveHelper, bool bIsMainMe if (bIsMainMem) { YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", MemGetSnapshotMainMemStructName().c_str()); - yamlSaveHelper.SaveMapValueMemory(pMemBase, 64*1024); + yamlSaveHelper.SaveMemory(pMemBase, 64*1024); } else { YamlSaveHelper::Label state(yamlSaveHelper, "%s%02X:\n", MemGetSnapshotAuxMemStructName().c_str(), bank-1); - yamlSaveHelper.SaveMapValueMemory(pMemBase, 64*1024); + yamlSaveHelper.SaveMemory(pMemBase, 64*1024); } } diff --git a/source/MouseInterface.cpp b/source/MouseInterface.cpp index 009f8494..b94bd73f 100644 --- a/source/MouseInterface.cpp +++ b/source/MouseInterface.cpp @@ -673,7 +673,7 @@ void CMouseInterface::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper) // New label { YamlSaveHelper::Label buffer(yamlSaveHelper, "%s:\n", SS_YAML_KEY_BUFF); - yamlSaveHelper.SaveMapValueMemory(m_byBuff, sizeof(m_byBuff)); + yamlSaveHelper.SaveMemory(m_byBuff, sizeof(m_byBuff)); } yamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_BUFFPOS, m_nBuffPos); diff --git a/source/YamlHelper.cpp b/source/YamlHelper.cpp index 5679d44d..4a415f3b 100644 --- a/source/YamlHelper.cpp +++ b/source/YamlHelper.cpp @@ -401,23 +401,7 @@ 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; - 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; - SaveString(SS_YAML_KEY_TYPE, type.c_str()); - SaveInt(SS_YAML_KEY_VERSION, version); -} - -void YamlSaveHelper::SaveMapValueMemory(const LPBYTE pMemBase, const UINT uMemSize) +void YamlSaveHelper::SaveMemory(const LPBYTE pMemBase, const UINT uMemSize) { const UINT kIndent = m_indent; @@ -469,3 +453,19 @@ void YamlSaveHelper::SaveMapValueMemory(const LPBYTE pMemBase, const UINT uMemSi delete [] pLine; } + +void YamlSaveHelper::FileHdr(UINT version) +{ + fprintf(m_hFile, "%s:\n", SS_YAML_KEY_FILEHDR); + m_indent = 2; + 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; + SaveString(SS_YAML_KEY_TYPE, type.c_str()); + SaveInt(SS_YAML_KEY_VERSION, version); +} diff --git a/source/YamlHelper.h b/source/YamlHelper.h index 463c1608..6cdb0fb2 100644 --- a/source/YamlHelper.h +++ b/source/YamlHelper.h @@ -213,6 +213,7 @@ public: void SaveHex64(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); class Label { @@ -255,7 +256,6 @@ public: void FileHdr(UINT version); void UnitHdr(std::string type, UINT version); - void SaveMapValueMemory(const LPBYTE pMemBase, const UINT uMemSize); private: FILE* m_hFile;