- fix config load for Guitar Grip addon;
This commit is contained in:
mtabachenko 2009-07-10 10:46:16 +00:00
parent 275cf18417
commit 09c7e4bf2c
3 changed files with 8 additions and 6 deletions

View File

@ -456,7 +456,7 @@ void GBAslotDialog(HWND hwnd)
memcpy(&tmp_Guitar, &Guitar, sizeof(Guitar)); memcpy(&tmp_Guitar, &Guitar, sizeof(Guitar));
tmp_CFlashMode = CFlash_Mode; tmp_CFlashMode = CFlash_Mode;
_OKbutton = false; _OKbutton = false;
needReset == true; needReset = true;
u32 res=DialogBox(hAppInst, MAKEINTRESOURCE(IDD_GBASLOT), hwnd, (DLGPROC) GbaSlotBox_Proc); u32 res=DialogBox(hAppInst, MAKEINTRESOURCE(IDD_GBASLOT), hwnd, (DLGPROC) GbaSlotBox_Proc);
if (res) if (res)
{ {
@ -485,6 +485,7 @@ void GBAslotDialog(HWND hwnd)
break; break;
case NDS_ADDON_GUITARGRIP: case NDS_ADDON_GUITARGRIP:
memcpy(&Guitar, &tmp_Guitar, sizeof(tmp_Guitar)); memcpy(&Guitar, &tmp_Guitar, sizeof(tmp_Guitar));
Guitar.Enabled = true;
WritePrivateProfileInt("GBAslot.GuitarGrip","green",Guitar.GREEN,IniName); WritePrivateProfileInt("GBAslot.GuitarGrip","green",Guitar.GREEN,IniName);
WritePrivateProfileInt("GBAslot.GuitarGrip","red",Guitar.RED,IniName); WritePrivateProfileInt("GBAslot.GuitarGrip","red",Guitar.RED,IniName);
WritePrivateProfileInt("GBAslot.GuitarGrip","yellow",Guitar.YELLOW,IniName); WritePrivateProfileInt("GBAslot.GuitarGrip","yellow",Guitar.YELLOW,IniName);
@ -493,6 +494,8 @@ void GBAslotDialog(HWND hwnd)
default: default:
return; return;
} }
if (temp_type!=NDS_ADDON_GUITARGRIP)
Guitar.Enabled = false;
WritePrivateProfileInt("GBAslot","type",temp_type,IniName); WritePrivateProfileInt("GBAslot","type",temp_type,IniName);
addon_type = temp_type; addon_type = temp_type;

View File

@ -241,7 +241,7 @@ SJoypad DefaultJoypad[16] = {
SJoypad Joypad[16]; SJoypad Joypad[16];
SGuitar DefaultGuitar = { true, 'E', 'R', 'T', 'Y' }; SGuitar DefaultGuitar = { false, 'E', 'R', 'T', 'Y' };
SGuitar Guitar; SGuitar Guitar;
u8 guitarState = 0; u8 guitarState = 0;
@ -389,7 +389,7 @@ static void LoadGuitarConfig()
{ {
memcpy(&Guitar,&DefaultGuitar,sizeof(Guitar)); memcpy(&Guitar,&DefaultGuitar,sizeof(Guitar));
Guitar.Enabled = true; //Guitar.Enabled = true;
#define DO(X) ReadControl(#X,Guitar.X); #define DO(X) ReadControl(#X,Guitar.X);
DO(GREEN); DO(GREEN);
DO(RED); DO(RED);

View File

@ -1529,9 +1529,6 @@ int _main()
CFlash_Mode = ADDON_CFLASH_MODE_RomPath; CFlash_Mode = ADDON_CFLASH_MODE_RomPath;
} }
//init_configured_features( &my_config); //init_configured_features( &my_config);
/*if ( !fill_configured_features( &my_config, lpszArgument)) { /*if ( !fill_configured_features( &my_config, lpszArgument)) {
MessageBox(NULL,"Unable to parse command line arguments","Error",MB_OK); MessageBox(NULL,"Unable to parse command line arguments","Error",MB_OK);
@ -1646,6 +1643,8 @@ int _main()
void input_init(); void input_init();
input_init(); input_init();
if (addon_type == NDS_ADDON_GUITARGRIP) Guitar.Enabled = true;
LOG("Init NDS\n"); LOG("Init NDS\n");
GInfo_Init(); GInfo_Init();