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