fix bugs in slot-1 init that made non-default choices fail to init at emulator boot-up time
This commit is contained in:
parent
e6216b978a
commit
02882f9483
|
@ -40,7 +40,7 @@ SLOT1INTERFACE slot1List[NDS_SLOT1_COUNT] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SLOT1INTERFACE slot1_device = slot1Retail; //default for frontends that dont even configure this
|
SLOT1INTERFACE slot1_device = slot1Retail; //default for frontends that dont even configure this
|
||||||
u8 slot1_device_type = NDS_SLOT1_RETAIL;
|
NDS_SLOT1_TYPE slot1_device_type = NDS_SLOT1_RETAIL;
|
||||||
|
|
||||||
static void scanDir()
|
static void scanDir()
|
||||||
{
|
{
|
||||||
|
@ -113,3 +113,8 @@ EMUFILE* slot1GetFatImage()
|
||||||
{
|
{
|
||||||
return fatImage;
|
return fatImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NDS_SLOT1_TYPE slot1GetCurrentType()
|
||||||
|
{
|
||||||
|
return slot1_device_type;
|
||||||
|
}
|
|
@ -67,7 +67,6 @@ enum NDS_SLOT1_TYPE
|
||||||
|
|
||||||
extern SLOT1INTERFACE slot1_device; // current slot1 device
|
extern SLOT1INTERFACE slot1_device; // current slot1 device
|
||||||
extern SLOT1INTERFACE slot1List[NDS_SLOT1_COUNT];
|
extern SLOT1INTERFACE slot1List[NDS_SLOT1_COUNT];
|
||||||
extern u8 slot1_device_type;
|
|
||||||
|
|
||||||
BOOL slot1Init();
|
BOOL slot1Init();
|
||||||
void slot1Close();
|
void slot1Close();
|
||||||
|
@ -75,5 +74,6 @@ void slot1Reset();
|
||||||
BOOL slot1Change(NDS_SLOT1_TYPE type); // change current adddon
|
BOOL slot1Change(NDS_SLOT1_TYPE type); // change current adddon
|
||||||
void slot1SetFatDir(const std::string& dir);
|
void slot1SetFatDir(const std::string& dir);
|
||||||
std::string slot1GetFatDir();
|
std::string slot1GetFatDir();
|
||||||
|
NDS_SLOT1_TYPE slot1GetCurrentType();
|
||||||
EMUFILE* slot1GetFatImage();
|
EMUFILE* slot1GetFatImage();
|
||||||
#endif //__SLOT1_H__
|
#endif //__SLOT1_H__
|
||||||
|
|
|
@ -2761,7 +2761,7 @@ int _main()
|
||||||
ViewLights = new TOOLSCLASS(hAppInst, IDD_LIGHT_VIEWER, (DLGPROC) ViewLightsProc);
|
ViewLights = new TOOLSCLASS(hAppInst, IDD_LIGHT_VIEWER, (DLGPROC) ViewLightsProc);
|
||||||
|
|
||||||
// Slot 1 / Slot 2 (GBA slot)
|
// Slot 1 / Slot 2 (GBA slot)
|
||||||
slot1_device_type = (NDS_SLOT1_TYPE)GetPrivateProfileInt("Slot1", "type", NDS_SLOT1_RETAIL, IniName);
|
int slot1_device_type = (NDS_SLOT1_TYPE)GetPrivateProfileInt("Slot1", "type", NDS_SLOT1_RETAIL, IniName);
|
||||||
cmdline.slot1_fat_dir = GetPrivateProfileStdString("Slot1", "fat_path", "");
|
cmdline.slot1_fat_dir = GetPrivateProfileStdString("Slot1", "fat_path", "");
|
||||||
|
|
||||||
addon_type = (NDS_ADDON_TYPE)GetPrivateProfileInt("GBAslot", "type", NDS_ADDON_NONE, IniName);
|
addon_type = (NDS_ADDON_TYPE)GetPrivateProfileInt("GBAslot", "type", NDS_ADDON_NONE, IniName);
|
||||||
|
@ -2773,18 +2773,6 @@ int _main()
|
||||||
cmdline.process_addonCommands();
|
cmdline.process_addonCommands();
|
||||||
WIN_InstallCFlash();
|
WIN_InstallCFlash();
|
||||||
|
|
||||||
switch (slot1_device_type)
|
|
||||||
{
|
|
||||||
case NDS_SLOT1_NONE:
|
|
||||||
case NDS_SLOT1_RETAIL:
|
|
||||||
case NDS_SLOT1_R4:
|
|
||||||
case NDS_SLOT1_RETAIL_NAND:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
slot1_device_type = NDS_SLOT1_RETAIL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(cmdline.is_cflash_configured)
|
if(cmdline.is_cflash_configured)
|
||||||
{
|
{
|
||||||
addon_type = NDS_ADDON_CFLASH;
|
addon_type = NDS_ADDON_CFLASH;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
HWND wndConfigSlot1 = NULL;
|
HWND wndConfigSlot1 = NULL;
|
||||||
u8 temp_type_slot1 = 0;
|
NDS_SLOT1_TYPE temp_type_slot1 = NDS_SLOT1_NONE;
|
||||||
u8 last_type_slot1 = 0;
|
u8 last_type_slot1 = 0;
|
||||||
char tmp_fat_path[MAX_PATH] = {0};
|
char tmp_fat_path[MAX_PATH] = {0};
|
||||||
HWND OKbutton_slot1 = NULL;
|
HWND OKbutton_slot1 = NULL;
|
||||||
|
@ -162,7 +162,7 @@ BOOL CALLBACK Slot1Box_Proc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
|
||||||
case IDC_ADDONS_LIST:
|
case IDC_ADDONS_LIST:
|
||||||
if (HIWORD(wparam) == CBN_SELENDOK)
|
if (HIWORD(wparam) == CBN_SELENDOK)
|
||||||
{
|
{
|
||||||
temp_type_slot1 = ComboBox_GetCurSel(GetDlgItem(dialog, IDC_ADDONS_LIST));
|
temp_type_slot1 = (NDS_SLOT1_TYPE)ComboBox_GetCurSel(GetDlgItem(dialog, IDC_ADDONS_LIST));
|
||||||
if (temp_type_slot1 != last_type_slot1)
|
if (temp_type_slot1 != last_type_slot1)
|
||||||
{
|
{
|
||||||
if (wndConfigSlot1) DestroyWindow(wndConfigSlot1);
|
if (wndConfigSlot1) DestroyWindow(wndConfigSlot1);
|
||||||
|
@ -191,7 +191,7 @@ BOOL CALLBACK Slot1Box_Proc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
|
||||||
void slot1Dialog(HWND hwnd)
|
void slot1Dialog(HWND hwnd)
|
||||||
{
|
{
|
||||||
strcpy(tmp_fat_path, slot1GetFatDir().c_str());
|
strcpy(tmp_fat_path, slot1GetFatDir().c_str());
|
||||||
temp_type_slot1 = slot1_device_type;
|
temp_type_slot1 = slot1GetCurrentType();
|
||||||
last_type_slot1 = temp_type_slot1;
|
last_type_slot1 = temp_type_slot1;
|
||||||
_OKbutton_slot1 = false;
|
_OKbutton_slot1 = false;
|
||||||
needReset_slot1 = true;
|
needReset_slot1 = true;
|
||||||
|
@ -201,7 +201,7 @@ void slot1Dialog(HWND hwnd)
|
||||||
switch (temp_type_slot1)
|
switch (temp_type_slot1)
|
||||||
{
|
{
|
||||||
case NDS_SLOT1_NONE:
|
case NDS_SLOT1_NONE:
|
||||||
if (temp_type_slot1 != slot1_device_type)
|
if (temp_type_slot1 != slot1GetCurrentType())
|
||||||
needReset_slot1 = true;
|
needReset_slot1 = true;
|
||||||
else
|
else
|
||||||
needReset_slot1 = false;
|
needReset_slot1 = false;
|
||||||
|
|
Loading…
Reference in New Issue