.include "macros.inc"
.section .text, "ax"
.global GDSetLightAttn
GDSetLightAttn:
mflr r0
stw r0, 4(r1)
cntlzw r0, r3
subfic r4, r0, 0x1f
stwu r1, -0x90(r1)
clrlwi r0, r4, 0x10
cmplwi r0, 7
stfd f31, 0x88(r1)
fmr f31, f6
stfd f30, 0x80(r1)
fmr f30, f5
stfd f29, 0x78(r1)
fmr f29, f4
stfd f28, 0x70(r1)
fmr f28, f3
stfd f27, 0x68(r1)
fmr f27, f2
stfd f26, 0x60(r1)
fmr f26, f1
stw r31, 0x5c(r1)
ble lbl_800B07DC
li r4, 0
lbl_800B07DC:
lwz r5, __GDCurrentDL@sda21(r13)
rlwinm r4, r4, 4, 0x10, 0x1b
addi r31, r4, 0x604
lwz r3, 8(r5)
lwz r0, 0xc(r5)
addi r3, r3, 1
cmplw r3, r0
ble lbl_800B0800
bl GDOverflowed
lbl_800B0800:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B0834
bl GDOverflowed
lbl_800B0834:
lwz r4, __GDCurrentDL@sda21(r13)
li r6, 0
li r5, 5
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B0880
bl GDOverflowed
lbl_800B0880:
lwz r4, __GDCurrentDL@sda21(r13)
rlwinm r5, r31, 0x18, 0x18, 0x1f
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r31, 0(r3)
stfs f26, 0x54(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B08CC
bl GDOverflowed
lbl_800B08CC:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x54(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x54(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x54(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x54(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f27, 0x50(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0958
bl GDOverflowed
lbl_800B0958:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x50(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x50(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x50(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x50(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f28, 0x4c(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B09E4
bl GDOverflowed
lbl_800B09E4:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x4c(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x4c(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x4c(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x4c(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f29, 0x48(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0A70
bl GDOverflowed
lbl_800B0A70:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x48(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x48(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x48(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x48(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f30, 0x44(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0AFC
bl GDOverflowed
lbl_800B0AFC:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x44(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x44(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x44(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x44(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f31, 0x40(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0B88
bl GDOverflowed
lbl_800B0B88:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x40(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x40(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x40(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x40(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r0, 0x94(r1)
lfd f31, 0x88(r1)
lfd f30, 0x80(r1)
lfd f29, 0x78(r1)
lfd f28, 0x70(r1)
lfd f27, 0x68(r1)
lfd f26, 0x60(r1)
lwz r31, 0x5c(r1)
addi r1, r1, 0x90
mtlr r0
blr
.global GDSetLightColor
GDSetLightColor:
mflr r0
stw r0, 4(r1)
cntlzw r0, r3
subfic r7, r0, 0x1f
stwu r1, -0x20(r1)
clrlwi r0, r7, 0x10
cmplwi r0, 7
stw r31, 0x1c(r1)
stw r30, 0x18(r1)
lbz r3, 1(r4)
lbz r5, 0(r4)
lbz r6, 2(r4)
slwi r3, r3, 0x10
rlwimi r3, r5, 0x18, 0, 7
lbz r4, 3(r4)
rlwimi r3, r6, 8, 0x10, 0x17
or r30, r4, r3
ble lbl_800B0C6C
li r7, 0
lbl_800B0C6C:
lwz r5, __GDCurrentDL@sda21(r13)
rlwinm r4, r7, 4, 0x10, 0x1b
addi r31, r4, 0x603
lwz r3, 8(r5)
lwz r0, 0xc(r5)
addi r3, r3, 1
cmplw r3, r0
ble lbl_800B0C90
bl GDOverflowed
lbl_800B0C90:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B0CC4
bl GDOverflowed
lbl_800B0CC4:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B0D0C
bl GDOverflowed
lbl_800B0D0C:
lwz r4, __GDCurrentDL@sda21(r13)
rlwinm r5, r31, 0x18, 0x18, 0x1f
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r31, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0D54
bl GDOverflowed
lbl_800B0D54:
lwz r4, __GDCurrentDL@sda21(r13)
srwi r7, r30, 0x18
rlwinm r6, r30, 0x10, 0x18, 0x1f
lwz r3, 8(r4)
rlwinm r5, r30, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r7, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r30, 0(r3)
lwz r0, 0x24(r1)
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
addi r1, r1, 0x20
mtlr r0
blr
.global GDSetLightPos
GDSetLightPos:
mflr r0
stw r0, 4(r1)
cntlzw r0, r3
subfic r4, r0, 0x1f
stwu r1, -0x58(r1)
clrlwi r0, r4, 0x10
cmplwi r0, 7
stfd f31, 0x50(r1)
fmr f31, f3
stfd f30, 0x48(r1)
fmr f30, f2
stfd f29, 0x40(r1)
fmr f29, f1
stw r31, 0x3c(r1)
ble lbl_800B0E08
li r4, 0
lbl_800B0E08:
lwz r5, __GDCurrentDL@sda21(r13)
rlwinm r4, r4, 4, 0x10, 0x1b
addi r31, r4, 0x60a
lwz r3, 8(r5)
lwz r0, 0xc(r5)
addi r3, r3, 1
cmplw r3, r0
ble lbl_800B0E2C
bl GDOverflowed
lbl_800B0E2C:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B0E60
bl GDOverflowed
lbl_800B0E60:
lwz r4, __GDCurrentDL@sda21(r13)
li r6, 0
li r5, 2
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B0EAC
bl GDOverflowed
lbl_800B0EAC:
lwz r4, __GDCurrentDL@sda21(r13)
rlwinm r5, r31, 0x18, 0x18, 0x1f
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r31, 0(r3)
stfs f29, 0x30(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0EF8
bl GDOverflowed
lbl_800B0EF8:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x30(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x30(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x30(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x30(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f30, 0x2c(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B0F84
bl GDOverflowed
lbl_800B0F84:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x2c(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x2c(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x2c(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x2c(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f31, 0x28(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B1010
bl GDOverflowed
lbl_800B1010:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x28(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x28(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x28(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x28(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r0, 0x5c(r1)
lfd f31, 0x50(r1)
lfd f30, 0x48(r1)
lfd f29, 0x40(r1)
lwz r31, 0x3c(r1)
addi r1, r1, 0x58
mtlr r0
blr
.global GDSetLightDir
GDSetLightDir:
mflr r0
stw r0, 4(r1)
cntlzw r0, r3
subfic r4, r0, 0x1f
stwu r1, -0x58(r1)
clrlwi r0, r4, 0x10
cmplwi r0, 7
stfd f31, 0x50(r1)
fmr f31, f3
stfd f30, 0x48(r1)
fmr f30, f2
stfd f29, 0x40(r1)
fmr f29, f1
stw r31, 0x3c(r1)
ble lbl_800B10DC
li r4, 0
lbl_800B10DC:
lwz r5, __GDCurrentDL@sda21(r13)
rlwinm r4, r4, 4, 0x10, 0x1b
addi r31, r4, 0x60d
lwz r3, 8(r5)
lwz r0, 0xc(r5)
addi r3, r3, 1
cmplw r3, r0
ble lbl_800B1100
bl GDOverflowed
lbl_800B1100:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B1134
bl GDOverflowed
lbl_800B1134:
lwz r4, __GDCurrentDL@sda21(r13)
li r6, 0
li r5, 2
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B1180
bl GDOverflowed
lbl_800B1180:
lwz r4, __GDCurrentDL@sda21(r13)
rlwinm r5, r31, 0x18, 0x18, 0x1f
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r31, 0(r3)
stfs f29, 0x30(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B11CC
bl GDOverflowed
lbl_800B11CC:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x30(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x30(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x30(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x30(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f30, 0x2c(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B1258
bl GDOverflowed
lbl_800B1258:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x2c(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x2c(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x2c(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x2c(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
stfs f31, 0x28(r1)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B12E4
bl GDOverflowed
lbl_800B12E4:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x28(r1)
lwz r3, 8(r4)
srwi r5, r0, 0x18
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x28(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x10, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r0, 0x28(r1)
lwz r3, 8(r4)
rlwinm r5, r0, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r5, 0x28(r1)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r0, 0x5c(r1)
lfd f31, 0x50(r1)
lfd f30, 0x48(r1)
lfd f29, 0x40(r1)
lwz r31, 0x3c(r1)
addi r1, r1, 0x58
mtlr r0
blr
.global GDSetChanMatColor
GDSetChanMatColor:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
stw r30, 0x10(r1)
mr r30, r3
lwz r8, __GDCurrentDL@sda21(r13)
lbz r0, 1(r4)
lwz r3, 8(r8)
slwi r5, r0, 0x10
lwz r0, 0xc(r8)
lbz r6, 0(r4)
addi r3, r3, 1
lbz r7, 2(r4)
cmplw r3, r0
rlwimi r5, r6, 0x18, 0, 7
lbz r4, 3(r4)
rlwimi r5, r7, 8, 0x10, 0x17
or r31, r4, r5
ble lbl_800B13C4
bl GDOverflowed
lbl_800B13C4:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B13F8
bl GDOverflowed
lbl_800B13F8:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B1440
bl GDOverflowed
lbl_800B1440:
lwz r4, __GDCurrentDL@sda21(r13)
clrlwi r3, r30, 0x1f
addi r6, r3, 0x100c
lwz r3, 8(r4)
clrlwi r6, r6, 0x10
srawi r5, r6, 8
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B1494
bl GDOverflowed
lbl_800B1494:
lwz r4, __GDCurrentDL@sda21(r13)
srwi r7, r31, 0x18
rlwinm r6, r31, 0x10, 0x18, 0x1f
lwz r3, 8(r4)
rlwinm r5, r31, 0x18, 0x18, 0x1f
addi r0, r3, 1
stw r0, 8(r4)
stb r7, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r31, 0(r3)
lwz r0, 0x1c(r1)
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
addi r1, r1, 0x18
mtlr r0
blr
.global GDSetChanCtrl
GDSetChanCtrl:
mflr r0
cmpwi r9, 0
stw r0, 4(r1)
stwu r1, -0x40(r1)
stmw r26, 0x28(r1)
addi r26, r3, 0
bne lbl_800B1528
li r8, 0
lbl_800B1528:
neg r3, r9
lwz r10, __GDCurrentDL@sda21(r13)
addic r0, r3, -1
subfe r11, r0, r3
lwz r3, 8(r10)
lwz r0, 0xc(r10)
subfic r10, r9, 2
rlwinm r4, r4, 1, 0x17, 0x1e
addic r9, r10, -1
subfe r10, r9, r10
or r4, r6, r4
rlwinm r9, r7, 2, 0x1a, 0x1d
addi r3, r3, 1
cmplw r3, r0
slwi r5, r5, 6
or r4, r9, r4
or r5, r5, r4
slwi r4, r8, 7
slwi r6, r10, 9
or r4, r5, r4
or r0, r6, r4
slwi r3, r11, 0xa
rlwinm r4, r7, 7, 0x11, 0x14
or r0, r3, r0
or r27, r4, r0
ble lbl_800B1594
bl GDOverflowed
lbl_800B1594:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B15C8
bl GDOverflowed
lbl_800B15C8:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B1610
bl GDOverflowed
lbl_800B1610:
lwz r4, __GDCurrentDL@sda21(r13)
clrlwi r3, r26, 0x1e
addi r6, r3, 0x100e
lwz r3, 8(r4)
clrlwi r6, r6, 0x10
srawi r5, r6, 8
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B1664
bl GDOverflowed
lbl_800B1664:
lwz r5, __GDCurrentDL@sda21(r13)
addi r0, r26, -4
srwi r31, r27, 0x18
lwz r4, 8(r5)
rlwinm r30, r27, 0x10, 0x18, 0x1f
rlwinm r29, r27, 0x18, 0x18, 0x1f
addi r3, r4, 1
stw r3, 8(r5)
cmplwi r0, 1
clrlwi r28, r27, 0x18
stb r31, 0(r4)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r30, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r29, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r27, 0(r3)
bgt lbl_800B1808
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 1
cmplw r3, r0
ble lbl_800B16EC
bl GDOverflowed
lbl_800B16EC:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0x10
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B1720
bl GDOverflowed
lbl_800B1720:
lwz r4, __GDCurrentDL@sda21(r13)
li r5, 0
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 2
cmplw r3, r0
ble lbl_800B1768
bl GDOverflowed
lbl_800B1768:
lwz r4, __GDCurrentDL@sda21(r13)
addi r6, r26, 0x100c
clrlwi r6, r6, 0x10
lwz r3, 8(r4)
srawi r5, r6, 8
addi r0, r3, 1
stw r0, 8(r4)
stb r5, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r6, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
lwz r0, 0xc(r4)
addi r3, r3, 4
cmplw r3, r0
ble lbl_800B17B8
bl GDOverflowed
lbl_800B17B8:
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r31, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r30, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r29, 0(r3)
lwz r4, __GDCurrentDL@sda21(r13)
lwz r3, 8(r4)
addi r0, r3, 1
stw r0, 8(r4)
stb r28, 0(r3)
lbl_800B1808:
lmw r26, 0x28(r1)
lwz r0, 0x44(r1)
addi r1, r1, 0x40
mtlr r0
blr