mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-20 15:17:50 +00:00
Support these new cards in slots 3, 4 or 5; based on code from Lukazi. - extend Configuration's Input prop sheet page. - add save/load snapshot for both cards. - add command line switch for alt controller type (for SNES MAX card). Change to using Registry's 'Configuration\Slot 3' for slot 3 cards (Uthernet, 4Play & SNES MAX). Update help doc.
This commit is contained in:
+35
-12
@@ -256,6 +256,12 @@ void LoadConfiguration(void)
|
||||
if(REGLOAD(TEXT(REGVALUE_MOUSE_RESTRICT_TO_WINDOW), &dwTmp))
|
||||
GetPropertySheet().SetMouseRestrictToWindow(dwTmp);
|
||||
|
||||
//
|
||||
|
||||
TCHAR szFilename[MAX_PATH];
|
||||
|
||||
//
|
||||
|
||||
for (UINT slot = SLOT0; slot <= SLOT7; slot++)
|
||||
{
|
||||
std::string& regSection = RegGetConfigSlotSection(slot);
|
||||
@@ -263,10 +269,38 @@ void LoadConfiguration(void)
|
||||
if (RegLoadValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, &dwTmp))
|
||||
{
|
||||
GetCardMgr().Insert(slot, (SS_CARDTYPE)dwTmp);
|
||||
|
||||
if (slot == SLOT3)
|
||||
{
|
||||
if ((SS_CARDTYPE)dwTmp == CT_Uthernet) // TODO: move this to when UthernetCard object is instantiated
|
||||
{
|
||||
tfe_enabled = 1;
|
||||
|
||||
std::string& regSection = RegGetConfigSlotSection(slot);
|
||||
if (RegLoadString(regSection.c_str(), REGVALUE_UTHERNET_INTERFACE, TRUE, szFilename, MAX_PATH, TEXT("")))
|
||||
update_tfe_interface(szFilename);
|
||||
}
|
||||
else
|
||||
{
|
||||
tfe_enabled = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // legacy (AppleWin 1.30.3 or earlier)
|
||||
{
|
||||
if (slot == SLOT4 && REGLOAD(TEXT(REGVALUE_SLOT4), &dwTmp))
|
||||
if (slot == SLOT3)
|
||||
{
|
||||
DWORD tfeEnabled;
|
||||
REGLOAD_DEFAULT(TEXT(REGVALUE_UTHERNET_ACTIVE), &tfeEnabled, 0);
|
||||
tfe_enabled = tfeEnabled ? 1 : 0;
|
||||
|
||||
GetCardMgr().Insert(SLOT3, get_tfe_enabled() ? CT_Uthernet : CT_Empty);
|
||||
|
||||
// TODO: move this to when UthernetCard object is instantiated
|
||||
RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_UTHERNET_INTERFACE), 1, szFilename, MAX_PATH, TEXT(""));
|
||||
update_tfe_interface(szFilename);
|
||||
}
|
||||
else if (slot == SLOT4 && REGLOAD(TEXT(REGVALUE_SLOT4), &dwTmp))
|
||||
GetCardMgr().Insert(SLOT4, (SS_CARDTYPE)dwTmp);
|
||||
else if (slot == SLOT5 && REGLOAD(TEXT(REGVALUE_SLOT5), &dwTmp))
|
||||
GetCardMgr().Insert(SLOT5, (SS_CARDTYPE)dwTmp);
|
||||
@@ -277,8 +311,6 @@ void LoadConfiguration(void)
|
||||
|
||||
//
|
||||
|
||||
TCHAR szFilename[MAX_PATH];
|
||||
|
||||
// Load save-state pathname *before* inserting any harddisk/disk images (for both init & reinit cases)
|
||||
// NB. inserting harddisk/disk can change snapshot pathname
|
||||
RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_SAVESTATE_FILENAME), 1, szFilename, MAX_PATH, TEXT("")); // Can be pathname or just filename
|
||||
@@ -306,15 +338,6 @@ void LoadConfiguration(void)
|
||||
|
||||
//
|
||||
|
||||
DWORD dwTfeEnabled;
|
||||
REGLOAD_DEFAULT(TEXT(REGVALUE_UTHERNET_ACTIVE), &dwTfeEnabled, 0);
|
||||
tfe_enabled = dwTfeEnabled ? 1 : 0;
|
||||
|
||||
RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_UTHERNET_INTERFACE), 1, szFilename, MAX_PATH, TEXT(""));
|
||||
update_tfe_interface(szFilename);
|
||||
|
||||
//
|
||||
|
||||
RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_PRINTER_FILENAME), 1, szFilename, MAX_PATH, TEXT(""));
|
||||
Printer_SetFilename(szFilename); // If not in Registry than default will be used
|
||||
|
||||
|
||||
Reference in New Issue
Block a user