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

View File

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

View File

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