mirror of https://github.com/mgba-emu/mgba.git
GB: Fix loading model overrides
This commit is contained in:
parent
49b12139ec
commit
b8b494eea6
1
CHANGES
1
CHANGES
|
@ -82,6 +82,7 @@ Other fixes:
|
|||
- FFmpeg: Fix some small memory leaks
|
||||
- FFmpeg: Fix encoding of time base
|
||||
- GB: Fix crash when changing ROM while in banked address space
|
||||
- GB: Fix loading model overrides
|
||||
- GB Video: Fix SGB video logs
|
||||
- GBA: Fix loading multiboot ELF files (fixes mgba.io/i/1949)
|
||||
- GBA: Fix loading subsequent save files (fixes mgba.io/i/2067)
|
||||
|
|
|
@ -443,10 +443,10 @@ static void _GBCoreReset(struct mCore* core) {
|
|||
struct GBCartridgeOverride override;
|
||||
const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100];
|
||||
override.headerCrc32 = doCrc32(cart, sizeof(*cart));
|
||||
if (GBOverrideFind(gbcore->overrides, &override) || (doColorOverride && GBOverrideColorFind(&override))) {
|
||||
bool modelOverride = GBOverrideFind(gbcore->overrides, &override) || (doColorOverride && GBOverrideColorFind(&override));
|
||||
if (modelOverride) {
|
||||
GBOverrideApply(gb, &override);
|
||||
}
|
||||
|
||||
} else {
|
||||
const char* modelGB = mCoreConfigGetValue(&core->config, "gb.model");
|
||||
const char* modelSGB = mCoreConfigGetValue(&core->config, "sgb.model");
|
||||
const char* modelCGB = mCoreConfigGetValue(&core->config, "cgb.model");
|
||||
|
@ -484,6 +484,7 @@ static void _GBCoreReset(struct mCore* core) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
||||
if (!gb->biosVf && core->opts.useBios) {
|
||||
|
|
|
@ -638,6 +638,8 @@ void GBOverrideSave(struct Configuration* config, const struct GBCartridgeOverri
|
|||
void GBOverrideApply(struct GB* gb, const struct GBCartridgeOverride* override) {
|
||||
if (override->model != GB_MODEL_AUTODETECT) {
|
||||
gb->model = override->model;
|
||||
gb->video.renderer->deinit(gb->video.renderer);
|
||||
gb->video.renderer->init(gb->video.renderer, gb->model, gb->video.sgbBorders);
|
||||
}
|
||||
|
||||
if (override->mbc != GB_MBC_AUTODETECT) {
|
||||
|
|
Loading…
Reference in New Issue