Changes required by latest AW code.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2021-10-17 09:05:32 +01:00
parent 56779456b5
commit 6acc688800
16 changed files with 129 additions and 24 deletions

View file

@ -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")

View file

@ -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

View file

@ -1,6 +1,6 @@
#pragma once
#include "RgbMonitor.h"
#include "RGBMonitor.h"
#include "Harddisk.h"
#include "Disk.h"
#include "Common.h"

View file

@ -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"

View file

@ -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))

View file

@ -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;

View file

@ -91,7 +91,7 @@ namespace common2
switch (tfe_enabled)
{
case 1:
tfe_init();
tfe_init(true);
break;
case 2:
registerUthernet2();

View file

@ -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);
}
}

View file

@ -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);
}

View file

@ -0,0 +1,4 @@
#include "StdAfx.h"
#include "CmdLine.h"
CmdLine g_cmdLine;

View file

@ -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;
}

View file

@ -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;

View file

@ -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)
{
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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;
}