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,
|
"host": False,
|
||||||
"objects": [
|
"objects": [
|
||||||
["Dolphin/GBA/GBA", True],
|
["Dolphin/GBA/GBA", True],
|
||||||
["Dolphin/GBA/GBAGetProcessStatus", False],
|
["Dolphin/GBA/GBAGetProcessStatus", True],
|
||||||
["Dolphin/GBA/GBAJoyBoot", True],
|
["Dolphin/GBA/GBAJoyBoot", True],
|
||||||
["Dolphin/GBA/GBARead", True],
|
["Dolphin/GBA/GBARead", True],
|
||||||
["Dolphin/GBA/GBAWrite", True],
|
["Dolphin/GBA/GBAWrite", True],
|
||||||
|
|
|
@ -59,23 +59,24 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
s32 GBAGetProcessStatus(s32 chan, u8* percentp) {
|
s32 GBAGetProcessStatus(s32 chan, u8* percentp) {
|
||||||
BOOL enabled;
|
BOOL enabled; // r26
|
||||||
s32 ret; // r29
|
s32 ret; // r29
|
||||||
GBAControl* gba = &__GBA[chan]; // r25
|
GBAControl* gba; // r25
|
||||||
GBABootInfo* bootInfo; // r31
|
GBABootInfo* bootInfo; // r31
|
||||||
u8 percent; // r30
|
u8 percent; // r30
|
||||||
OSTime t; // r27
|
OSTime t; // r27
|
||||||
|
|
||||||
bootInfo = &gba->bootInfo;
|
gba = &__GBA[chan];
|
||||||
|
bootInfo = &__GBA[chan].bootInfo;
|
||||||
enabled = OSDisableInterrupts();
|
enabled = OSDisableInterrupts();
|
||||||
|
|
||||||
if (bootInfo->callback != NULL) {
|
if (bootInfo->callback != NULL) {
|
||||||
ret = 2;
|
ret = 2;
|
||||||
percent = (bootInfo->curOffset * 100) / bootInfo->realLength;
|
percent = (bootInfo->curOffset * 100) / bootInfo->realLength;
|
||||||
if (bootInfo->begin != 0) {
|
if (bootInfo->begin != 0) {
|
||||||
t = OSGetTime();
|
t = OSGetTime() - bootInfo->begin;
|
||||||
if (OSTicksToMilliseconds(t - bootInfo->begin) < (5500)) {
|
if (OSTicksToMilliseconds(t) < 5500) {
|
||||||
percent = ((t - bootInfo->begin) * percent) / OSMillisecondsToTicks((OSTime)5500);
|
percent = (percent * t) / OSMillisecondsToTicks(5500ll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (percent >= 100) {
|
if (percent >= 100) {
|
||||||
|
|
Loading…
Reference in New Issue