all repos — mgba @ a5cf3ca1540e9e0551161a4254175b3d02fec087

mGBA Game Boy Advance Emulator

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

a5cf3ca1540e9e0551161a4254175b3d02fec087

parent

11035f5a778d92bdbbc07c1302fde03353f2b7ee

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;