mirror of https://github.com/PrimeDecomp/prime.git
Match and link GBAGetProcess.c
This commit is contained in:
parent
20502fb6dd
commit
d1bf059e8a
|
@ -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],
|
||||
|
|
|
@ -59,23 +59,24 @@
|
|||
|
||||
*/
|
||||
s32 GBAGetProcessStatus(s32 chan, u8* percentp) {
|
||||
BOOL enabled;
|
||||
BOOL enabled; // r26
|
||||
s32 ret; // r29
|
||||
GBAControl* gba = &__GBA[chan]; // r25
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue