.gba .open "MFO.gba","mfspaceball.gba",0x8000000 .definelabel SamusData,0x03001244 .definelabel SamusDataCopy,0x03001270 .definelabel ShinesparkTimer,0x030012D8 .org 0x08009ECC ldr r0,=SpaceBall mov r15,r0 .pool .org 0x0879ED00 SpaceBall: push r1,r2 ldr r2,=0300131Ch ldrb r0,[r2] mov r1,4h and r0,r1 cmp r0,0h beq @@notready ;If Spacejump enabled ldr r2,=03001346h ldrb r0,[r2] cmp r0,0h beq @@notunderwater ; if not underwater ldr r2,=0300131Ch ldrb r0,[r2] mov r1,20h and r0,r1 cmp r0,0h beq @@notready ;If GravitySuit enabled @@notunderwater: ldr r2,=3001244h ldrb r0,[r2,1h] cmp r0,10h bne @@notready ldrh r0,[r2,1Ch] lsl r0,r0,10h asr r0,r0,10h ldr r1,=0FFFFFFA0h cmp r0,r1 bgt @@notready nop ldr r0,=030011ECh ldrh r0,[r0] mov r1,1h and r0,r1 cmp r0,0h beq @@notready mov r1,68h lsl r1,r1,1h strh r1,[r2,1Ch] mov r0,r3 pop r1,r2 b @@return @@notready: pop r1,r2 mov r0,0DCh neg r0,r0 cmp r1,r0 ble @@return ldrh r0,[r5,2h] sub r0,r4,r0 strh r0,[r3,01Ch] @@return: ldr r0,=08009EEEh mov r15,r0 .pool .close