void GBAslotDialog(HWND hwnd)
{
	temp_type = (u8)slot2_GetCurrentType();
	last_type = temp_type;
	strcpy(tmp_cflash_filename, win32_CFlash_cfgFileName.c_str());
	strcpy(tmp_cflash_path, win32_CFlash_cfgDirectory.c_str());
	strcpy(tmp_gbagame_filename, win32_GBA_cfgRomPath.c_str());
	memcpy(&tmp_Guitar, &Guitar, sizeof(Guitar));
	memcpy(&tmp_Piano, &Piano, sizeof(Piano));
	memcpy(&tmp_Paddle, &Paddle, sizeof(Paddle));
	tmp_CFlashMode = CFlash_Mode;
	_OKbutton = false;
	
	u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_GBASLOT), hwnd, (DLGPROC) GbaSlotBox_Proc);
	if (res)
	{
		switch (temp_type)
		{
			case NDS_SLOT2_NONE:
			break;

			case NDS_SLOT2_AUTO:
			break;

			case NDS_SLOT2_CFLASH:
				//save current values for win32 configuration
				win32_CFlash_cfgMode = tmp_CFlashMode;
				win32_CFlash_cfgDirectory = tmp_cflash_path;
				win32_CFlash_cfgFileName = tmp_cflash_filename;
				WritePrivateProfileInt("Slot2.CFlash","fileMode",tmp_CFlashMode,IniName);
				WritePrivateProfileString("Slot2.CFlash","path",tmp_cflash_path,IniName);
				WritePrivateProfileString("Slot2.CFlash","filename",tmp_cflash_filename,IniName);

				WIN_InstallCFlash();
				break;
			case NDS_SLOT2_RUMBLEPAK:
				break;
			case NDS_SLOT2_PADDLE:
				memcpy(&Paddle, &tmp_Paddle, sizeof(tmp_Paddle));
				WritePrivateProfileInt("Slot2.Paddle","DEC",Paddle.DEC,IniName);
				WritePrivateProfileInt("Slot2.Paddle","INC",Paddle.INC,IniName);
				break;
			case NDS_SLOT2_GBACART:
				win32_GBA_cfgRomPath = tmp_gbagame_filename;
				WritePrivateProfileString("Slot2.GBAgame", "filename", tmp_gbagame_filename, IniName);
				WIN_InstallGBACartridge();
				break;
			case NDS_SLOT2_GUITARGRIP:
				memcpy(&Guitar, &tmp_Guitar, sizeof(tmp_Guitar));
				WritePrivateProfileInt("Slot2.GuitarGrip","green",Guitar.GREEN,IniName);
				WritePrivateProfileInt("Slot2.GuitarGrip","red",Guitar.RED,IniName);
				WritePrivateProfileInt("Slot2.GuitarGrip","yellow",Guitar.YELLOW,IniName);
				WritePrivateProfileInt("Slot2.GuitarGrip","blue",Guitar.BLUE,IniName);
				break;
			case NDS_SLOT2_EASYPIANO:
				memcpy(&Piano, &tmp_Piano, sizeof(tmp_Piano));
				WritePrivateProfileInt("Slot2.Piano","C",Piano.C,IniName);
				WritePrivateProfileInt("Slot2.Piano","CS",Piano.CS,IniName);
				WritePrivateProfileInt("Slot2.Piano","D",Piano.D,IniName);
				WritePrivateProfileInt("Slot2.Piano","DS",Piano.DS,IniName);
				WritePrivateProfileInt("Slot2.Piano","E",Piano.E,IniName);
				WritePrivateProfileInt("Slot2.Piano","F",Piano.F,IniName);
				WritePrivateProfileInt("Slot2.Piano","FS",Piano.FS,IniName);
				WritePrivateProfileInt("Slot2.Piano","G",Piano.G,IniName);
				WritePrivateProfileInt("Slot2.Piano","GS",Piano.GS,IniName);
				WritePrivateProfileInt("Slot2.Piano","A",Piano.A,IniName);
				WritePrivateProfileInt("Slot2.Piano","AS",Piano.AS,IniName);
				WritePrivateProfileInt("Slot2.Piano","B",Piano.B,IniName);
				WritePrivateProfileInt("Slot2.Piano","HIC",Piano.HIC,IniName);
				break;
			case NDS_SLOT2_EXPMEMORY:
				break;
			case NDS_SLOT2_PASSME:
				break;
			default:
				return;
		}

		slot2_Change((NDS_SLOT2_TYPE)temp_type);

		WritePrivateProfileInt("Slot2", "id", slot2_List[(u8)slot2_GetCurrentType()]->info()->id(), IniName);

		Guitar.Enabled	= (slot2_GetCurrentType() == NDS_SLOT2_GUITARGRIP)?true:false;
		Piano.Enabled	= (slot2_GetCurrentType() == NDS_SLOT2_EASYPIANO)?true:false;
		Paddle.Enabled	= (slot2_GetCurrentType() == NDS_SLOT2_PADDLE)?true:false;
	}
}
Example #2
0
void GBAslotDialog(HWND hwnd)
{
	temp_type = addon_type;
	last_type = temp_type;
	strcpy(tmp_cflash_filename, win32_CFlash_cfgFileName.c_str());
	strcpy(tmp_cflash_path, win32_CFlash_cfgDirectory.c_str());
	strcpy(tmp_gbagame_filename, GBAgameName);
	memcpy(&tmp_Guitar, &Guitar, sizeof(Guitar));
	memcpy(&tmp_Piano, &Piano, sizeof(Piano));
	tmp_CFlashMode = CFlash_Mode;
	_OKbutton = false;
	needReset = true;
	u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_GBASLOT), hwnd, (DLGPROC) GbaSlotBox_Proc);
	if (res)
	{
		switch (temp_type)
		{
			case NDS_ADDON_NONE:
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_CFLASH:
				//save current values for win32 configuration
				win32_CFlash_cfgMode = tmp_CFlashMode;
				win32_CFlash_cfgDirectory = tmp_cflash_path;
				win32_CFlash_cfgFileName = tmp_cflash_filename;
				WritePrivateProfileInt("GBAslot.CFlash","fileMode",tmp_CFlashMode,IniName);
				WritePrivateProfileString("GBAslot.CFlash","path",tmp_cflash_path,IniName);
				WritePrivateProfileString("GBAslot.CFlash","filename",tmp_cflash_filename,IniName);

				WIN_InstallCFlash();

				needReset = true;
				break;
			case NDS_ADDON_RUMBLEPAK:
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_PADDLE:
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_GBAGAME:
				strcpy(GBAgameName, tmp_gbagame_filename);
				WritePrivateProfileString("GBAslot.GBAgame","filename",GBAgameName,IniName);
				needReset = true;
				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);
				WritePrivateProfileInt("GBAslot.GuitarGrip","blue",Guitar.BLUE,IniName);
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_PIANO:
				memcpy(&Piano, &tmp_Piano, sizeof(tmp_Piano));
				Piano.Enabled = true;
				WritePrivateProfileInt("GBAslot.Piano","C",Piano.C,IniName);
				WritePrivateProfileInt("GBAslot.Piano","CS",Piano.CS,IniName);
				WritePrivateProfileInt("GBAslot.Piano","D",Piano.D,IniName);
				WritePrivateProfileInt("GBAslot.Piano","DS",Piano.DS,IniName);
				WritePrivateProfileInt("GBAslot.Piano","E",Piano.E,IniName);
				WritePrivateProfileInt("GBAslot.Piano","F",Piano.F,IniName);
				WritePrivateProfileInt("GBAslot.Piano","FS",Piano.FS,IniName);
				WritePrivateProfileInt("GBAslot.Piano","G",Piano.G,IniName);
				WritePrivateProfileInt("GBAslot.Piano","GS",Piano.GS,IniName);
				WritePrivateProfileInt("GBAslot.Piano","A",Piano.A,IniName);
				WritePrivateProfileInt("GBAslot.Piano","AS",Piano.AS,IniName);
				WritePrivateProfileInt("GBAslot.Piano","B",Piano.B,IniName);
				WritePrivateProfileInt("GBAslot.Piano","HIC",Piano.HIC,IniName);
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_EXPMEMORY:
				break;
			default:
				return;
		}
		if (temp_type!=NDS_ADDON_GUITARGRIP) 
			Guitar.Enabled = false;
		WritePrivateProfileInt("GBAslot","type",temp_type,IniName);

		addon_type = (NDS_ADDON_TYPE)temp_type;
		addonsChangePak(addon_type);
		if (romloaded && needReset)
			NDS_Reset();
		return;
	}
}
Example #3
0
void GBAslotDialog(HWND hwnd)
{
	temp_type = addon_type;
	last_type = temp_type;
	strcpy(tmp_cflash_filename, win32_CFlash_cfgFileName.c_str());
	strcpy(tmp_cflash_path, win32_CFlash_cfgDirectory.c_str());
	strcpy(tmp_gbagame_filename, GBAgameName);
	memcpy(&tmp_Guitar, &Guitar, sizeof(Guitar));
	tmp_CFlashMode = CFlash_Mode;
	_OKbutton = false;
	needReset = true;
	u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_GBASLOT), hwnd, (DLGPROC) GbaSlotBox_Proc);
	if (res)
	{
		switch (temp_type)
		{
			case NDS_ADDON_NONE:
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_CFLASH:
				//save current values for win32 configuration
				//(no tmp for mode, a little weird but thats just how it evolved)
				win32_CFlash_cfgMode = CFlash_Mode;
				win32_CFlash_cfgDirectory = tmp_cflash_path;
				win32_CFlash_cfgFileName = tmp_cflash_filename;
				WritePrivateProfileInt("GBAslot.CFlash","fileMode",CFlash_Mode,IniName);
				WritePrivateProfileString("GBAslot.CFlash","path",tmp_cflash_path,IniName);
				WritePrivateProfileString("GBAslot.CFlash","filename",tmp_cflash_filename,IniName);

				WIN_InstallCFlash();

				needReset = true;
				break;
			case NDS_ADDON_RUMBLEPAK:
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_GBAGAME:
				strcpy(GBAgameName, tmp_gbagame_filename);
				WritePrivateProfileString("GBAslot.GBAgame","filename",GBAgameName,IniName);
				needReset = true;
				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);
				WritePrivateProfileInt("GBAslot.GuitarGrip","blue",Guitar.BLUE,IniName);
				if (temp_type != addon_type)
					needReset = true;
				else
					needReset = false;
				break;
			case NDS_ADDON_EXPMEMORY:
				break;
			default:
				return;
		}
		if (temp_type!=NDS_ADDON_GUITARGRIP) 
			Guitar.Enabled = false;
		WritePrivateProfileInt("GBAslot","type",temp_type,IniName);

		addon_type = temp_type;
		addonsChangePak(addon_type);
		if (romloaded && needReset)
			NDS_Reset();
		return;
	}
}