diff --git a/configure.py b/configure.py index a98cbe20..305a3ab0 100755 --- a/configure.py +++ b/configure.py @@ -1048,7 +1048,7 @@ LIBS = [ "host": False, "objects": [ ["Dolphin/GBA/GBA", True], - ["Dolphin/GBA/GBAGetProcessStatus", False], + ["Dolphin/GBA/GBAGetProcessStatus", True], ["Dolphin/GBA/GBAJoyBoot", True], ["Dolphin/GBA/GBARead", True], ["Dolphin/GBA/GBAWrite", True], diff --git a/src/Dolphin/GBA/GBAGetProcessStatus.c b/src/Dolphin/GBA/GBAGetProcessStatus.c index 6b8f98b4..f9a89ceb 100644 --- a/src/Dolphin/GBA/GBAGetProcessStatus.c +++ b/src/Dolphin/GBA/GBAGetProcessStatus.c @@ -59,23 +59,24 @@ */ s32 GBAGetProcessStatus(s32 chan, u8* percentp) { - BOOL enabled; - s32 ret; // r29 - GBAControl* gba = &__GBA[chan]; // r25 - GBABootInfo* bootInfo; // r31 - u8 percent; // r30 - OSTime t; // r27 + BOOL enabled; // r26 + s32 ret; // r29 + GBAControl* gba; // r25 + GBABootInfo* bootInfo; // r31 + u8 percent; // r30 + OSTime t; // r27 - bootInfo = &gba->bootInfo; + gba = &__GBA[chan]; + bootInfo = &__GBA[chan].bootInfo; enabled = OSDisableInterrupts(); if (bootInfo->callback != NULL) { ret = 2; percent = (bootInfo->curOffset * 100) / bootInfo->realLength; if (bootInfo->begin != 0) { - t = OSGetTime(); - if (OSTicksToMilliseconds(t - bootInfo->begin) < (5500)) { - percent = ((t - bootInfo->begin) * percent) / OSMillisecondsToTicks((OSTime)5500); + t = OSGetTime() - bootInfo->begin; + if (OSTicksToMilliseconds(t) < 5500) { + percent = (percent * t) / OSMillisecondsToTicks(5500ll); } if (percent >= 100) {