reset preferences now resets control mappings

This commit is contained in:
dborth 2008-12-19 22:01:15 +00:00
parent e03dd275f7
commit eceb311962
3 changed files with 79 additions and 41 deletions

View File

@ -37,48 +37,83 @@
#define VBA_SPEED 1024 #define VBA_SPEED 1024
#define VBA_CAPTURE 2048 #define VBA_CAPTURE 2048
unsigned int vbapadmap[10]; // VBA controller buttons
unsigned int gcpadmap[10]; // Gamecube controller Padmap
unsigned int wmpadmap[10]; // Wiimote Padmap
unsigned int ccpadmap[10]; // Classic Controller Padmap
unsigned int ncpadmap[10]; // Nunchuk + wiimote Padmap
void ResetControls()
{
int i = 0;
// VBA controller buttons // VBA controller buttons
// All other pads are mapped to this // All other pads are mapped to this
unsigned int vbapadmap[] = { i=0;
VBA_BUTTON_B, VBA_BUTTON_A, vbapadmap[i++] = VBA_BUTTON_B;
VBA_BUTTON_SELECT, VBA_BUTTON_START, vbapadmap[i++] = VBA_BUTTON_A;
VBA_UP, VBA_DOWN, vbapadmap[i++] = VBA_BUTTON_SELECT;
VBA_LEFT, VBA_RIGHT, vbapadmap[i++] = VBA_BUTTON_START;
VBA_BUTTON_L, VBA_BUTTON_R vbapadmap[i++] = VBA_UP;
}; vbapadmap[i++] = VBA_DOWN;
vbapadmap[i++] = VBA_LEFT;
vbapadmap[i++] = VBA_RIGHT;
vbapadmap[i++] = VBA_BUTTON_L;
vbapadmap[i++] = VBA_BUTTON_R;
/*** Gamecube controller Padmap ***/ /*** Gamecube controller Padmap ***/
unsigned int gcpadmap[] = { i=0;
PAD_BUTTON_B, PAD_BUTTON_A, gcpadmap[i++] = PAD_BUTTON_B;
PAD_TRIGGER_Z, PAD_BUTTON_START, gcpadmap[i++] = PAD_BUTTON_A;
PAD_BUTTON_UP, PAD_BUTTON_DOWN, gcpadmap[i++] = PAD_TRIGGER_Z;
PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT, gcpadmap[i++] = PAD_BUTTON_START;
PAD_TRIGGER_L, PAD_TRIGGER_R gcpadmap[i++] = PAD_BUTTON_UP;
}; gcpadmap[i++] = PAD_BUTTON_DOWN;
gcpadmap[i++] = PAD_BUTTON_LEFT;
gcpadmap[i++] = PAD_BUTTON_RIGHT;
gcpadmap[i++] = PAD_TRIGGER_L;
gcpadmap[i++] = PAD_TRIGGER_R;
/*** Wiimote Padmap ***/ /*** Wiimote Padmap ***/
unsigned int wmpadmap[] = { i=0;
WPAD_BUTTON_1, WPAD_BUTTON_2, wmpadmap[i++] = WPAD_BUTTON_1;
WPAD_BUTTON_MINUS, WPAD_BUTTON_PLUS, wmpadmap[i++] = WPAD_BUTTON_2;
WPAD_BUTTON_RIGHT, WPAD_BUTTON_LEFT, wmpadmap[i++] = WPAD_BUTTON_MINUS;
WPAD_BUTTON_UP, WPAD_BUTTON_DOWN, wmpadmap[i++] = WPAD_BUTTON_PLUS;
WPAD_BUTTON_B, WPAD_BUTTON_A wmpadmap[i++] = WPAD_BUTTON_RIGHT;
}; wmpadmap[i++] = WPAD_BUTTON_LEFT;
wmpadmap[i++] = WPAD_BUTTON_UP;
wmpadmap[i++] = WPAD_BUTTON_DOWN;
wmpadmap[i++] = WPAD_BUTTON_B;
wmpadmap[i++] = WPAD_BUTTON_A;
/*** Classic Controller Padmap ***/ /*** Classic Controller Padmap ***/
unsigned int ccpadmap[] = { i=0;
WPAD_CLASSIC_BUTTON_Y, WPAD_CLASSIC_BUTTON_B, ccpadmap[i++] = WPAD_CLASSIC_BUTTON_Y;
WPAD_CLASSIC_BUTTON_MINUS, WPAD_CLASSIC_BUTTON_PLUS, ccpadmap[i++] = WPAD_CLASSIC_BUTTON_B;
WPAD_CLASSIC_BUTTON_UP, WPAD_CLASSIC_BUTTON_DOWN, ccpadmap[i++] = WPAD_CLASSIC_BUTTON_MINUS;
WPAD_CLASSIC_BUTTON_LEFT, WPAD_CLASSIC_BUTTON_RIGHT, ccpadmap[i++] = WPAD_CLASSIC_BUTTON_PLUS;
WPAD_CLASSIC_BUTTON_FULL_L, WPAD_CLASSIC_BUTTON_FULL_R ccpadmap[i++] = WPAD_CLASSIC_BUTTON_UP;
}; ccpadmap[i++] = WPAD_CLASSIC_BUTTON_DOWN;
ccpadmap[i++] = WPAD_CLASSIC_BUTTON_LEFT;
ccpadmap[i++] = WPAD_CLASSIC_BUTTON_RIGHT;
ccpadmap[i++] = WPAD_CLASSIC_BUTTON_FULL_L;
ccpadmap[i++] = WPAD_CLASSIC_BUTTON_FULL_R;
/*** Nunchuk + wiimote Padmap ***/ /*** Nunchuk + wiimote Padmap ***/
unsigned int ncpadmap[] = { i=0;
WPAD_NUNCHUK_BUTTON_C, WPAD_NUNCHUK_BUTTON_Z, ncpadmap[i++] = WPAD_NUNCHUK_BUTTON_C;
WPAD_BUTTON_MINUS, WPAD_BUTTON_PLUS, ncpadmap[i++] = WPAD_NUNCHUK_BUTTON_Z;
WPAD_BUTTON_UP, WPAD_BUTTON_DOWN, ncpadmap[i++] = WPAD_BUTTON_MINUS;
WPAD_BUTTON_LEFT, WPAD_BUTTON_RIGHT, ncpadmap[i++] = WPAD_BUTTON_PLUS;
WPAD_BUTTON_2, WPAD_BUTTON_1 ncpadmap[i++] = WPAD_BUTTON_UP;
}; ncpadmap[i++] = WPAD_BUTTON_DOWN;
ncpadmap[i++] = WPAD_BUTTON_LEFT;
ncpadmap[i++] = WPAD_BUTTON_RIGHT;
ncpadmap[i++] = WPAD_BUTTON_2;
ncpadmap[i++] = WPAD_BUTTON_1;
}
/**************************************************************************** /****************************************************************************
* WPAD_Stick * WPAD_Stick

View File

@ -22,6 +22,7 @@ extern unsigned int wmpadmap[];
extern unsigned int ccpadmap[]; extern unsigned int ccpadmap[];
extern unsigned int ncpadmap[]; extern unsigned int ncpadmap[];
void ResetControls();
s8 WPAD_Stick(u8 chan,u8 right, int axis); s8 WPAD_Stick(u8 chan,u8 right, int axis);
u32 GetJoy(int which); u32 GetJoy(int which);

View File

@ -19,6 +19,8 @@ void
DefaultSettings () DefaultSettings ()
{ {
/************** GameCube/Wii Settings *********************/ /************** GameCube/Wii Settings *********************/
ResetControls(); // controller button mappings
GCSettings.LoadMethod = METHOD_AUTO; // Auto, SD, DVD, USB, Network (SMB) GCSettings.LoadMethod = METHOD_AUTO; // Auto, SD, DVD, USB, Network (SMB)
GCSettings.SaveMethod = METHOD_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB) GCSettings.SaveMethod = METHOD_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB)
sprintf (GCSettings.LoadFolder,"vbagx/roms"); // Path to game files sprintf (GCSettings.LoadFolder,"vbagx/roms"); // Path to game files