From 94e92dae58ce18124aae670f547814a4b706e113 Mon Sep 17 00:00:00 2001 From: tomcw Date: Tue, 13 Oct 2020 21:33:58 +0100 Subject: [PATCH] Switch back to the old Fuse AY_DO_TONE() macro --- source/AY8910.cpp | 10 +++++----- source/AY8910.h | 4 ++-- source/Mockingboard.cpp | 8 +++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/source/AY8910.cpp b/source/AY8910.cpp index c3952d3a..e902a7be 100644 --- a/source/AY8910.cpp +++ b/source/AY8910.cpp @@ -405,7 +405,7 @@ sound_write_buf_pstereo( libspectrum_signed_word * out, int c ) #endif -#define USE_OLD_AY_DO_TONE 0 +#define USE_OLD_AY_DO_TONE 1 #if USE_OLD_AY_DO_TONE /* not great having this as a macro to inline it, but it's only * a fairly short routine, and it saves messing about. @@ -1022,7 +1022,7 @@ sound_beeper( int is_tape, int on ) #define SS_YAML_KEY_TONE1_PERIOD "Tone1 Period" #define SS_YAML_KEY_TONE2_PERIOD "Tone2 Period" #define SS_YAML_KEY_NOISE_PERIOD "Noise Period" -#define SS_YAML_KEY_ENV_PERIOD "Env Period" +#define SS_YAML_KEY_ENV_PERIOD "Env Period" // unused #define SS_YAML_KEY_RNG "RNG" #define SS_YAML_KEY_NOISE_TOGGLE "Noise Toggle" #define SS_YAML_KEY_ENV_FIRST "Env First" @@ -1101,7 +1101,7 @@ void CAY8910::SaveSnapshot(YamlSaveHelper& yamlSaveHelper, std::string& suffix) } } -bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, std::string& suffix) +bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, std::string& suffix, UINT version) { std::string unit = std::string(SS_YAML_KEY_AY8910) + suffix; if (!yamlLoadHelper.GetSubMap(unit)) @@ -1265,10 +1265,10 @@ UINT AY8910_SaveSnapshot(YamlSaveHelper& yamlSaveHelper, UINT uChip, std::string return 1; } -UINT AY8910_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT uChip, std::string& suffix) +UINT AY8910_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT uChip, std::string& suffix, UINT version) { if (uChip >= MAX_8910) return 0; - return g_AY8910[uChip].LoadSnapshot(yamlLoadHelper, suffix) ? 1 : 0; + return g_AY8910[uChip].LoadSnapshot(yamlLoadHelper, suffix, version) ? 1 : 0; } diff --git a/source/AY8910.h b/source/AY8910.h index 46b73944..94400dba 100644 --- a/source/AY8910.h +++ b/source/AY8910.h @@ -18,7 +18,7 @@ BYTE* AY8910_GetRegsPtr(UINT uChip); void AY8910UpdateSetCycles(); UINT AY8910_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper, UINT uChip, std::string& suffix); -UINT AY8910_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT uChip, std::string& suffix); +UINT AY8910_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT uChip, std::string& suffix, UINT version); //------------------------------------- // FUSE stuff @@ -47,7 +47,7 @@ public: BYTE* GetAYRegsPtr( void ) { return &sound_ay_registers[0]; } static void SetCLK( double CLK ) { m_fCurrentCLK_AY8910 = CLK; } void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper, std::string& suffix); - bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, std::string& suffix); + bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, std::string& suffix, UINT version); private: void init( void ); diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 8ce2b4e6..755ed4cd 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -1996,6 +1996,8 @@ void MB_GetSnapshot_v1(SS_CARD_MOCKINGBOARD_v1* const pSS, const DWORD dwSlot) // 4: Added: 6522 timerIrqDelay - GH#652 // 5: Added: Unit state-B (Phasor only) - GH#659 const UINT kUNIT_VERSION = 5; +// 6: Change AY8910 to FUSE v1.5.7 (2016) +//const UINT kUNIT_VERSION = 6; const UINT NUM_MB_UNITS = 2; const UINT NUM_PHASOR_UNITS = 2; @@ -2186,7 +2188,7 @@ bool MB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version) LoadSnapshotSY6522(yamlLoadHelper, pMB->sy6522, version); UpdateIFR(pMB, 0, pMB->sy6522.IFR); // Assert any pending IRQs (GH#677) - AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum, std::string("")); + AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum, std::string(""), version); LoadSnapshotSSI263(yamlLoadHelper, pMB->SpeechChip); pMB->nAYCurrentRegister = yamlLoadHelper.LoadUint(SS_YAML_KEY_AY_CURR_REG); @@ -2311,8 +2313,8 @@ bool Phasor_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version LoadSnapshotSY6522(yamlLoadHelper, pMB->sy6522, version); UpdateIFR(pMB, 0, pMB->sy6522.IFR); // Assert any pending IRQs (GH#677) - AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+0, std::string("-A")); - AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+1, std::string("-B")); + AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+0, std::string("-A"), version); + AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+1, std::string("-B"), version); LoadSnapshotSSI263(yamlLoadHelper, pMB->SpeechChip); pMB->nAYCurrentRegister = yamlLoadHelper.LoadUint(SS_YAML_KEY_AY_CURR_REG);