This commit is contained in:
radius 2017-04-24 21:02:04 -05:00
parent 65e6e5f30b
commit 3dffa3a0ca

View File

@ -78,8 +78,6 @@ static void replace_extension(const char *src, size_t length, char *dest, const
static void GB_update_keys_status(GB_gameboy_t *gb)
{
int i;
input_poll_cb();
@ -94,41 +92,6 @@ static void GB_update_keys_status(GB_gameboy_t *gb)
GB_set_turbo_mode(gb, input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X),false );
static bool ctrl = false;
static bool shift = false;
ctrl = input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0,RETROK_RCTRL) ||input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0,RETROK_RCTRL);
shift = input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0,RETROK_RSHIFT) ||input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0,RETROK_LSHIFT);
if(input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0,RETROK_c))
if(ctrl){
ctrl=false;
GB_debugger_break(gb);
}
for(i=0;i<10;i++)
if(input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0,RETROK_0+i)){
if(ctrl){
char save_path[strlen(retro_game_path) + 4];
char save_extension[] =".s0";
save_extension[2] += i;
replace_extension(retro_game_path, strlen(retro_game_path), save_path, save_extension);
if (shift) {
GB_load_state(gb, save_path);
}
else {
GB_save_state(gb, save_path);
}
}
}
}
@ -144,7 +107,6 @@ static void vblank(GB_gameboy_t *gb)
GB_update_keys_status(gb);
GB_set_pixels_output(gb, frame_buf);
audio_callback(gb);
RLOOP=0;
}
static uint32_t rgb_encode(GB_gameboy_t *gb, uint8_t r, uint8_t g, uint8_t b)
@ -307,7 +269,7 @@ bool retro_load_game(const struct retro_game_info *info)
char buf[256];
int err = 0;
if (strstr(info->path, "gbc"))
if (!strstr(info->path, "gbc"))
{
GB_init(&gb);
snprintf(buf, sizeof(buf), "%s%cdmg_boot.bin", retro_base_directory, slash);
@ -335,8 +297,6 @@ bool retro_load_game(const struct retro_game_info *info)
exit(1);
}
signal(SIGINT, debugger_interrupt);
GB_set_vblank_callback(&gb, (GB_vblank_callback_t) vblank);
GB_set_user_data(&gb, (void*)NULL);
GB_set_pixels_output(&gb,(unsigned char *) frame_buf);