| @@ -68,6 +68,9 @@ static const int sdl_keycodes[nes_controller_num_buttons] = { | |||||
| SDLK_RIGHT, | SDLK_RIGHT, | ||||
| }; | }; | ||||
| static const int sdl_save_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; | |||||
| static const int sdl_load_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; | |||||
| static const int sdl_buttons[nes_controller_num_buttons] = { | static const int sdl_buttons[nes_controller_num_buttons] = { | ||||
| SDL_CONTROLLER_BUTTON_A, | SDL_CONTROLLER_BUTTON_A, | ||||
| SDL_CONTROLLER_BUTTON_B, | SDL_CONTROLLER_BUTTON_B, | ||||
| @@ -138,6 +141,20 @@ static int sdl_input_update(nes_Input_Reader* reader, | |||||
| } else { | } else { | ||||
| input->controllers[0].buttons &= ~mask; | input->controllers[0].buttons &= ~mask; | ||||
| } | } | ||||
| } else if (sdl_save_button == event.cbutton.button) { | |||||
| if (SDL_CONTROLLERBUTTONDOWN == event.type) { | |||||
| status = input_Result_Save; | |||||
| } else { | |||||
| status = input_Result_Cancel; | |||||
| } | |||||
| } else if (sdl_load_button == event.cbutton.button) { | |||||
| if (SDL_CONTROLLERBUTTONDOWN == event.type) { | |||||
| status = input_Result_Load; | |||||
| } else { | |||||
| status = input_Result_Cancel; | |||||
| } | |||||
| } | } | ||||
| } else if (SDL_CONTROLLERAXISMOTION == event.type) { | } else if (SDL_CONTROLLERAXISMOTION == event.type) { | ||||