diff --git a/CMakeLists.txt b/CMakeLists.txt index 276c1f20..66c79025 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ add_subdirectory(source/frontends/libretro) add_subdirectory(test/TestCPU6502) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) -set(CPACK_PACKAGE_VERSION "1.30.3.0") +set(CPACK_PACKAGE_VERSION "1.30.5.0") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libyaml-0-2,libminizip1,libqt5gui5,libqt5widgets5,libqt5multimedia5,libqt5gamepad5,libncursesw6,libevdev2,libsdl2-image-2.0-0,libsdl2-2.0-0,libgles2,libpcap0.8,libslirp0,libboost-program-options1.74.0") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andrea Odetti") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/audetto/AppleWin") diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 54bc1a32..35f74eee 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -114,6 +114,10 @@ set(SOURCE_FILES linux/duplicates/Joystick.cpp linux/duplicates/SerialComms.cpp linux/duplicates/PropertySheet.cpp + linux/duplicates/Registry.cpp + linux/duplicates/FourPlay.cpp + linux/duplicates/SNESMAX.cpp + linux/duplicates/CmdLine.cpp Z80VICE/z80.cpp Z80VICE/z80mem.cpp @@ -157,6 +161,8 @@ set(HEADER_FILES Core.h Utilities.h FrameBase.h + FourPlay.h + SNESMAX.h Common.h DiskDefs.h diff --git a/source/CmdLine.h b/source/CmdLine.h index 6fe0c632..2e1034cd 100644 --- a/source/CmdLine.h +++ b/source/CmdLine.h @@ -1,6 +1,6 @@ #pragma once -#include "RgbMonitor.h" +#include "RGBMonitor.h" #include "Harddisk.h" #include "Disk.h" #include "Common.h" diff --git a/source/Memory.cpp b/source/Memory.cpp index 681cbf27..b3c71683 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SerialComms.h" #include "Speaker.h" #include "Tape.h" -#include "tfe/tfe.h" +#include "Tfe/tfe.h" #include "RGBMonitor.h" #include "z80emu.h" diff --git a/source/Registry.h b/source/Registry.h index c4d2da12..9d3da777 100644 --- a/source/Registry.h +++ b/source/Registry.h @@ -1,4 +1,5 @@ #pragma once +#include "Card.h" #define REGLOAD(a, b) RegLoadValue(TEXT(REG_CONFIG), (a), TRUE, (b)) #define REGLOAD_DEFAULT(a, b, c) RegLoadValue(TEXT(REG_CONFIG), (a), TRUE, (b), (c)) diff --git a/source/Tfe/tfe.cpp b/source/Tfe/tfe.cpp index 17513d68..840296e0 100644 --- a/source/Tfe/tfe.cpp +++ b/source/Tfe/tfe.cpp @@ -1516,7 +1516,7 @@ bool tfe_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT vers throw std::string("Card: wrong version"); tfe_enabled = yamlLoadHelper.LoadBool(SS_YAML_KEY_ENABLED) ? true : false; - set_tfe_interface(yamlLoadHelper.LoadStringA(SS_YAML_KEY_NETWORK_INTERFACE)); + set_tfe_interface(yamlLoadHelper.LoadString(SS_YAML_KEY_NETWORK_INTERFACE)); tfe_started_tx = yamlLoadHelper.LoadBool(SS_YAML_KEY_STARTED_TX) ? true : false; tfe_cannot_use = yamlLoadHelper.LoadBool(SS_YAML_KEY_CANNOT_USE) ? true : false; diff --git a/source/frontends/common2/utils.cpp b/source/frontends/common2/utils.cpp index bbdf98da..452db110 100644 --- a/source/frontends/common2/utils.cpp +++ b/source/frontends/common2/utils.cpp @@ -91,7 +91,7 @@ namespace common2 switch (tfe_enabled) { case 1: - tfe_init(); + tfe_init(true); break; case 2: registerUthernet2(); diff --git a/source/frontends/qt/options.cpp b/source/frontends/qt/options.cpp index fb8f6090..827c8f9b 100644 --- a/source/frontends/qt/options.cpp +++ b/source/frontends/qt/options.cpp @@ -90,20 +90,8 @@ namespace if (cardManager.QuerySlot(slot) != newCardType) cardManager.Insert(slot, newCardType); - std::string slotText; - switch (slot) - { - case 0: slotText = REGVALUE_SLOT0; break; - case 1: slotText = REGVALUE_SLOT1; break; - case 2: slotText = REGVALUE_SLOT2; break; - case 3: slotText = REGVALUE_SLOT3; break; - case 4: slotText = REGVALUE_SLOT4; break; - case 5: slotText = REGVALUE_SLOT5; break; - case 6: slotText = REGVALUE_SLOT6; break; - case 7: slotText = REGVALUE_SLOT7; break; - } - - REGSAVE(slotText.c_str(), (DWORD)newCardType); + std::string& regSection = RegGetConfigSlotSection(slot); + RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, CT_Disk2); } } diff --git a/source/frontends/sdl/imgui/settingshelper.cpp b/source/frontends/sdl/imgui/settingshelper.cpp index 7d1b0007..c37b5969 100644 --- a/source/frontends/sdl/imgui/settingshelper.cpp +++ b/source/frontends/sdl/imgui/settingshelper.cpp @@ -107,11 +107,10 @@ namespace void internalInsertCard(const size_t slot, const SS_CARDTYPE card) { - CardManager & cardManager = GetCardMgr(); + std::string& regSection = RegGetConfigSlotSection(slot); + RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, CT_Disk2); - // we do not use REGVALUE_SLOT5 as they are not "runtime friendly" - const std::string label = "Slot " + std::to_string(slot); - REGSAVE(label.c_str(), (DWORD)card); + CardManager & cardManager = GetCardMgr(); cardManager.Insert(slot, card); } diff --git a/source/linux/duplicates/CmdLine.cpp b/source/linux/duplicates/CmdLine.cpp new file mode 100644 index 00000000..dbc0767f --- /dev/null +++ b/source/linux/duplicates/CmdLine.cpp @@ -0,0 +1,4 @@ +#include "StdAfx.h" +#include "CmdLine.h" + +CmdLine g_cmdLine; diff --git a/source/linux/duplicates/FourPlay.cpp b/source/linux/duplicates/FourPlay.cpp new file mode 100644 index 00000000..13e082b2 --- /dev/null +++ b/source/linux/duplicates/FourPlay.cpp @@ -0,0 +1,28 @@ +#include "StdAfx.h" +#include "FourPlay.h" + +void FourPlayCard::InitializeIO(LPBYTE pCxRomPeripheral, UINT slot) +{ +} + +//=========================================================================== + +static const UINT kUNIT_VERSION = 1; + +std::string FourPlayCard::GetSnapshotCardName(void) +{ + static const std::string name("4Play"); + return name; +} + +void FourPlayCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper) +{ +} + +bool FourPlayCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version) +{ + if (version < 1 || version > kUNIT_VERSION) + throw std::string("Card: wrong version"); + + return true; +} diff --git a/source/linux/duplicates/Joystick.cpp b/source/linux/duplicates/Joystick.cpp index 6bfd4e79..e2c24e03 100644 --- a/source/linux/duplicates/Joystick.cpp +++ b/source/linux/duplicates/Joystick.cpp @@ -35,7 +35,7 @@ static std::string JoyGetSnapshotStructName(void) return name; } -void JoyLoadSnapshot(YamlLoadHelper& yamlLoadHelper) +void JoyLoadSnapshot(YamlLoadHelper& yamlLoadHelper, unsigned int) { if (!yamlLoadHelper.GetSubMap(JoyGetSnapshotStructName())) return; diff --git a/source/linux/duplicates/PropertySheet.cpp b/source/linux/duplicates/PropertySheet.cpp index a627963a..a9a92b18 100644 --- a/source/linux/duplicates/PropertySheet.cpp +++ b/source/linux/duplicates/PropertySheet.cpp @@ -21,6 +21,11 @@ void CPropertySheet::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, cons m_PropertySheetHelper.ApplyNewConfig(ConfigNew, ConfigOld); } +void CPropertySheet::ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew) +{ + m_PropertySheetHelper.ApplyNewConfigFromSnapshot(ConfigNew); +} + void CPropertySheet::ConfigSaveApple2Type(eApple2Type apple2Type) { } diff --git a/source/linux/duplicates/PropertySheet.h b/source/linux/duplicates/PropertySheet.h index cf71dc6b..9b24b30a 100644 --- a/source/linux/duplicates/PropertySheet.h +++ b/source/linux/duplicates/PropertySheet.h @@ -13,6 +13,7 @@ public: DWORD GetVolumeMax(void) override; bool SaveStateSelectImage(HWND hWindow, bool bSave) override; void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) override; + void ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew) override; void ConfigSaveApple2Type(eApple2Type apple2Type) override; UINT GetScrollLockToggle(void) override; void SetScrollLockToggle(UINT uValue) override; diff --git a/source/linux/duplicates/Registry.cpp b/source/linux/duplicates/Registry.cpp new file mode 100644 index 00000000..e8c43da4 --- /dev/null +++ b/source/linux/duplicates/Registry.cpp @@ -0,0 +1,43 @@ +#include "StdAfx.h" +#include "Registry.h" +#include "CmdLine.h" + + + +//=========================================================================== +static std::string& RegGetSlotSection(UINT slot) +{ + static std::string section; + if (slot == SLOT_AUX) + { + section = REG_CONFIG_SLOT_AUX; + } + else + { + section = REG_CONFIG_SLOT; + section += (char)('0' + slot); + } + return section; +} + +std::string& RegGetConfigSlotSection(UINT slot) +{ + static std::string section; + section = REG_CONFIG "\\"; + section += RegGetSlotSection(slot); + return section; +} + +void RegDeleteConfigSlotSection(UINT slot) +{ +} + +void RegSetConfigSlotNewCardType(UINT slot, SS_CARDTYPE type) +{ + RegDeleteConfigSlotSection(slot); + + std::string regSection; + regSection = RegGetConfigSlotSection(slot); + + RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, type); +} diff --git a/source/linux/duplicates/SNESMAX.cpp b/source/linux/duplicates/SNESMAX.cpp new file mode 100644 index 00000000..fd1c276d --- /dev/null +++ b/source/linux/duplicates/SNESMAX.cpp @@ -0,0 +1,30 @@ +#include "StdAfx.h" +#include "SNESMAX.h" + +void SNESMAXCard::InitializeIO(LPBYTE pCxRomPeripheral, UINT slot) +{ +} + +//=========================================================================== + +static const UINT kUNIT_VERSION = 1; + +#define SS_YAML_KEY_BUTTON_INDEX "Button Index" + +std::string SNESMAXCard::GetSnapshotCardName(void) +{ + static const std::string name("SNES MAX"); + return name; +} + +void SNESMAXCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper) +{ +} + +bool SNESMAXCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version) +{ + if (version < 1 || version > kUNIT_VERSION) + throw std::string("Card: wrong version"); + + return true; +}