all repos — mgba @ c6fb561465046bd9eafc8bccf11cd2f1c8bb34ab

mGBA Game Boy Advance Emulator

Vita: Clean this up properly
Vicki Pfau vi@endrift.com
Mon, 03 Aug 2020 16:06:07 -0700
commit

c6fb561465046bd9eafc8bccf11cd2f1c8bb34ab

parent

12aa775316589df17edf1685e5448aa2c1160b0e

1 files changed, 13 insertions(+), 6 deletions(-)

jump to
M src/platform/psp2/psp2-context.csrc/platform/psp2/psp2-context.c

@@ -585,12 +585,19 @@ }

void mPSP2Swap(struct mGUIRunner* runner) { bool frameAvailable = true; - if (runner->core->platform(runner->core) == PLATFORM_GBA) { - struct GBA* gba = runner->core->board; - frameAvailable = gba->video.frameskipCounter <= 0; - } else if (runner->core->platform(runner->core) == PLATFORM_GB) { - struct GB* gb = runner->core->board; - frameAvailable = gb->video.frameskipCounter <= 0; + switch (runner->core->platform(runner->core)) { +#ifdef M_CORE_GBA + case PLATFORM_GBA: + frameAvailable = ((struct GBA*) runner->core->board)->video.frameskipCounter <= 0; + break; +#endif +#ifdef M_CORE_GB + case PLATFORM_GB: + frameAvailable = ((struct GB*) runner->core->board)->video.frameskipCounter <= 0; + break; +#endif + default: + break; } if (frameAvailable) { currentTex = !currentTex;