Fixed a bug where the SDL and libretro frontend would not update the border when loading a new ROM

This commit is contained in:
Lior Halphon 2020-12-26 23:52:41 +02:00
parent 3dbd2eac91
commit 47ebc31733

View File

@ -305,6 +305,7 @@ int GB_load_rom(GB_gameboy_t *gb, const char *path)
fread(gb->rom, 1, gb->rom_size, f); fread(gb->rom, 1, gb->rom_size, f);
fclose(f); fclose(f);
GB_configure_cart(gb); GB_configure_cart(gb);
gb->tried_loading_sgb_border = false;
return 0; return 0;
} }
@ -537,6 +538,7 @@ error:
gb->rom_size = old_size; gb->rom_size = old_size;
} }
fclose(f); fclose(f);
gb->tried_loading_sgb_border = false;
return -1; return -1;
} }
@ -557,6 +559,7 @@ void GB_load_rom_from_buffer(GB_gameboy_t *gb, const uint8_t *buffer, size_t siz
memset(gb->rom, 0xff, gb->rom_size); memset(gb->rom, 0xff, gb->rom_size);
memcpy(gb->rom, buffer, size); memcpy(gb->rom, buffer, size);
GB_configure_cart(gb); GB_configure_cart(gb);
gb->tried_loading_sgb_border = false;
} }
typedef struct { typedef struct {