diff --git a/trunk/src/drivers/win/mapinput.cpp b/trunk/src/drivers/win/mapinput.cpp index ed4bff7d..c65e0389 100644 --- a/trunk/src/drivers/win/mapinput.cpp +++ b/trunk/src/drivers/win/mapinput.cpp @@ -424,9 +424,9 @@ void PopulateConflictTable(int* conflictTable) { // Check whether there are conflicts between the // selected hotkeys. - for(unsigned i = 0; i < EMUCMD_MAX - 1; ++i) + for(unsigned i = 0; i < EMUCMD_NUM - 1; ++i) { - for(unsigned int j = i + 1; j < EMUCMD_MAX; ++j) + for(unsigned int j = i + 1; j < EMUCMD_NUM; ++j) { if(!GetCommandKeyCombo((EMUCMD)i).isEmpty() && GetCommandKeyCombo((EMUCMD)i).get() == GetCommandKeyCombo((EMUCMD)j).get() && @@ -463,8 +463,8 @@ void PopulateMappingDisplay(HWND hwndDlg) if (filter == EMUCMDTYPE_MAX + 3) { // Set up the conflict table. - conflictTable = (int*)malloc(sizeof(int)*EMUCMD_MAX); - memset(conflictTable, 0, sizeof(int)*EMUCMD_MAX); + conflictTable = (int*)malloc(sizeof(int)*EMUCMD_NUM); + memset(conflictTable, 0, sizeof(int)*EMUCMD_NUM); PopulateConflictTable(conflictTable); } @@ -475,7 +475,7 @@ void PopulateMappingDisplay(HWND hwndDlg) int newItemCount = 0; // Populate display. - for(int i = 0, idx = 0; i < EMUCMD_MAX; ++i) + for(int i = 0, idx = 0; i < EMUCMD_NUM; ++i) { // Check if the current key should be displayed // according to the current filter. @@ -638,7 +638,7 @@ void AskForHotkey(HWND hwndListView) **/ void ApplyDefaultCommandMapping() { - for(unsigned int i = 0; i < EMUCMD_MAX; ++i) { + for(unsigned int i = 0; i < EMUCMD_NUM; ++i) { SetCommandKeyCombo((EMUCMD)i, KeyCombo(0)); } @@ -748,14 +748,14 @@ BOOL CALLBACK MapInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM void MapInput(void) { // Make a backup of the current mappings, in case the user changes their mind. - int backupmapping[EMUCMD_MAX]; - for(unsigned int i = 0; i < EMUCMD_MAX; ++i) { + int backupmapping[EMUCMD_NUM]; + for(unsigned int i = 0; i < EMUCMD_NUM; ++i) { backupmapping[i] = GetCommandKeyCombo((EMUCMD)i).get(); } if(!DialogBox(fceu_hInstance, "MAPINPUT", hAppWnd, MapInputDialogProc)) { - for(unsigned int i = 0; i < EMUCMD_MAX; ++i) { + for(unsigned int i = 0; i < EMUCMD_NUM; ++i) { SetCommandKeyCombo((EMUCMD)i, KeyCombo(backupmapping[i])); } } diff --git a/trunk/src/input.cpp b/trunk/src/input.cpp index b3cdb26a..02a1a546 100644 --- a/trunk/src/input.cpp +++ b/trunk/src/input.cpp @@ -88,7 +88,7 @@ extern bool frameAdvanceLagSkip; extern bool movieSubtitles; //------------- -static int CommandMapping[EMUCMD_MAX]; +static int CommandMapping[EMUCMD_NUM]; static uint8 joy_readbit[2]; uint8 joy[4]={0,0,0,0}; //HACK - should be static but movie needs it diff --git a/trunk/src/input.h b/trunk/src/input.h index bf47cbc2..1b66c2c7 100644 --- a/trunk/src/input.h +++ b/trunk/src/input.h @@ -109,8 +109,8 @@ void FCEU_DoSimpleCommand(int cmd); enum EMUCMD { - EMUCMD_NONE=0, - EMUCMD_POWER, + EMUCMD_NONE=-1, + EMUCMD_POWER=0, EMUCMD_RESET, EMUCMD_PAUSE, EMUCMD_FRAME_ADVANCE, @@ -244,8 +244,7 @@ enum EMUCMD //----------------------------- //keep adding these in order of newness or else the hotkey binding configs will get messed up... EMUCMD_FPS_DISPLAY_TOGGLE, - //first element is NONE, so elements in this enum more than emucommands by 1, the last one isn't a count of commands - EMUCMD_MAX = EMUCMD_FPS_DISPLAY_TOGGLE + EMUCMD_NUM, }; enum EMUCMDTYPE