all repos — mgba @ 888841fe8f2b206f1f6cb47b96e0c8ded9c6291c

mGBA Game Boy Advance Emulator

GBA Core: Add forceGbp option for always-GBP mode
Vicki Pfau vi@endrift.com
Wed, 14 Oct 2020 21:01:49 -0700
commit

888841fe8f2b206f1f6cb47b96e0c8ded9c6291c

parent

7f5102e26ca8e43f2fa203eaa8f37c3bb26c0052

1 files changed, 12 insertions(+), 1 deletions(-)

jump to
M src/gba/core.csrc/gba/core.c

@@ -296,6 +296,7 @@ gba->allowOpposingDirections = fakeBool;

mCoreConfigCopyValue(&core->config, config, "allowOpposingDirections"); mCoreConfigCopyValue(&core->config, config, "gba.bios"); + mCoreConfigCopyValue(&core->config, config, "gba.forceGbp"); mCoreConfigCopyValue(&core->config, config, "gba.audioHle"); #ifndef DISABLE_THREADING

@@ -551,6 +552,7 @@

static void _GBACoreReset(struct mCore* core) { struct GBACore* gbacore = (struct GBACore*) core; struct GBA* gba = (struct GBA*) core->board; + int fakeBool; if (gbacore->renderer.outputBuffer #if defined(BUILD_GLES2) || defined(BUILD_GLES3) || gbacore->glRenderer.outputTex != (unsigned) -1

@@ -560,7 +562,6 @@ struct GBAVideoRenderer* renderer = NULL;

if (gbacore->renderer.outputBuffer) { renderer = &gbacore->renderer.d; } - int fakeBool ATTRIBUTE_UNUSED; #if defined(BUILD_GLES2) || defined(BUILD_GLES3) if (gbacore->glRenderer.outputTex != (unsigned) -1 && mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) { mCoreConfigGetIntValue(&core->config, "videoScale", &gbacore->glRenderer.scale);

@@ -598,7 +599,17 @@ ARMHotplugAttach(core->cpu, CPU_COMPONENT_AUDIO_MIXER);

} #endif + bool forceGbp = false; + if (mCoreConfigGetIntValue(&core->config, "gba.forceGbp", &fakeBool)) { + forceGbp = fakeBool; + } + if (!forceGbp) { + gba->memory.hw.devices &= ~HW_GB_PLAYER_DETECTION; + } GBAOverrideApplyDefaults(gba, gbacore->overrides); + if (forceGbp) { + gba->memory.hw.devices |= HW_GB_PLAYER_DETECTION; + } #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 if (!gba->biosVf && core->opts.useBios) {