.include "macros.inc"
.section .text, "ax"
.global GDInitGDLObj
GDInitGDLObj:
stw r4, 0(r3)
add r0, r4, r5
stw r4, 8(r3)
stw r0, 0xc(r3)
stw r5, 4(r3)
blr
.global GDFlushCurrToMem
GDFlushCurrToMem:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 0(r4)
lwz r4, 4(r4)
bl DCFlushRange
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global GDPadCurr32
GDPadCurr32:
lwz r3, __GDCurrentDL@sda21(r13)
lwz r0, 8(r3)
clrlwi. r0, r0, 0x1b
beqlr
cmplwi r0, 0x20
subfic r3, r0, 0x20
li r6, 0
bgelr
rlwinm. r0, r3, 0x1d, 3, 0x1f
mtctr r0
beq lbl_800AF134
lbl_800AF088:
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
bdnz lbl_800AF088
andi. r3, r3, 7
beqlr
lbl_800AF134:
mtctr r3
lbl_800AF138:
lwz r5, __GDCurrentDL@sda21(r13)
lwz r4, 8(r5)
addi r0, r4, 1
stw r0, 8(r5)
stb r6, 0(r4)
bdnz lbl_800AF138
blr
.global GDOverflowed
GDOverflowed:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
lwz r12, overflowcb@sda21(r13)
cmplwi r12, 0
beq lbl_800AF174
mtlr r12
blrl
lbl_800AF174:
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global GDSetOverflowCallback
GDSetOverflowCallback:
stw r3, overflowcb@sda21(r13)
blr
.section .sbss, "wa"
.global __GDCurrentDL
__GDCurrentDL:
.skip 0x4
overflowcb:
.skip 0x4