.include "macros.inc"
.section .text, "ax"
.global __GXDefaultTexRegionCallback
__GXDefaultTexRegionCallback:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
bl GXGetTexObjFmt
cmpwi r3, 8
beq lbl_800A4F30
cmpwi r3, 9
beq lbl_800A4F30
cmpwi r3, 0xa
beq lbl_800A4F30
lwz r5, gx@sda21(r13)
lwz r3, 0x2c8(r5)
clrlwi r0, r3, 0x1d
addi r4, r3, 1
slwi r3, r0, 4
stw r4, 0x2c8(r5)
addi r3, r3, 0x208
add r3, r5, r3
b lbl_800A4F50
lbl_800A4F30:
lwz r5, gx@sda21(r13)
lwz r3, 0x2cc(r5)
clrlwi r0, r3, 0x1e
addi r4, r3, 1
slwi r3, r0, 4
stw r4, 0x2cc(r5)
addi r3, r3, 0x288
add r3, r5, r3
lbl_800A4F50:
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global __GXDefaultTlutRegionCallback
__GXDefaultTlutRegionCallback:
cmplwi r3, 0x14
blt lbl_800A4F70
li r3, 0
b lbl_800A4F80
lbl_800A4F70:
slwi r3, r3, 4
lwz r0, gx@sda21(r13)
addi r3, r3, 0x2d0
add r3, r0, r3
lbl_800A4F80:
blr
.global GXInit
GXInit:
mflr r0
stw r0, 4(r1)
stwu r1, -0x48(r1)
stmw r26, 0x30(r1)
mr r27, r3
mr r26, r4
lwz r3, gx@sda21(r13)
li r31, 0
lis r4, gxData@ha
stb r31, 0x4f0(r3)
li r0, 1
addi r30, r4, gxData@l
lwz r5, gx@sda21(r13)
li r3, 1
li r4, 0
stb r0, 0x4f1(r5)
lwz r5, gx@sda21(r13)
stw r31, 0x4dc(r5)
lwz r5, gx@sda21(r13)
stw r31, 0x4e0(r5)
bl GXSetMisc
lis r4, 0xCC003000@ha
addi r5, r4, 0xCC003000@l
stw r4, __cpReg@sda21(r13)
addi r3, r4, 0x1000
addi r0, r4, 0x4000
stw r5, __piReg@sda21(r13)
stw r3, __peReg@sda21(r13)
stw r0, __memReg@sda21(r13)
bl __GXFifoInit
mr r4, r27
mr r5, r26
addi r3, r30, 0x4f8
bl GXInitFifoBase
addi r3, r30, 0x4f8
bl GXSetCPUFifo
addi r3, r30, 0x4f8
bl GXSetGPFifo
bl __GXPEInit
bl PPCMfhid2
lis r4, 0x0C008000@ha
mr r26, r3
addi r3, r4, 0x0C008000@l
bl PPCMtwpar
oris r3, r26, 0x4000
bl PPCMthid2
lwz r3, gx@sda21(r13)
li r0, 0xff
li r7, 0
stw r31, 0x204(r3)
li r3, 0xc0
li r4, 0xc1
lwz r5, gx@sda21(r13)
addi r6, r5, 0x204
lwz r5, 0(r6)
clrlwi r5, r5, 8
stw r5, 0(r6)
lwz r5, gx@sda21(r13)
stw r0, 0x124(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x124
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0xf00
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
stw r31, 0x7c(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x7c
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0x2200
stw r0, 0(r5)
b lbl_800A50AC
lbl_800A50AC:
li r0, 0x10
mtctr r0
b lbl_800A50B8
lbl_800A50B8:
b lbl_800A50BC
lbl_800A50BC:
lwz r6, gx@sda21(r13)
srwi r8, r7, 1
addi r26, r31, 0x130
li r5, 0
stwx r5, r6, r26
slwi r28, r8, 2
slwi r11, r3, 0x18
lwz r6, gx@sda21(r13)
addi r27, r31, 0x170
addi r12, r31, 0x49c
stwx r5, r6, r27
slwi r10, r4, 0x18
addi r9, r8, 0xf6
lwz r6, gx@sda21(r13)
addi r0, r28, 0x100
addi r8, r8, 0x28
stwx r5, r6, r0
li r29, 0xff
addi r6, r28, 0x1b0
lwz r28, gx@sda21(r13)
slwi r9, r9, 0x18
slwi r8, r8, 0x18
stwx r29, r28, r12
addi r31, r31, 4
addi r3, r3, 2
lwz r12, gx@sda21(r13)
addi r4, r4, 2
addi r7, r7, 1
add r26, r12, r26
lwz r12, 0(r26)
clrlwi r12, r12, 8
or r11, r12, r11
stw r11, 0(r26)
lwz r11, gx@sda21(r13)
add r12, r11, r27
lwz r11, 0(r12)
clrlwi r11, r11, 8
or r10, r11, r10
stw r10, 0(r12)
lwz r10, gx@sda21(r13)
add r6, r10, r6
lwz r10, 0(r6)
clrlwi r10, r10, 8
or r9, r10, r9
stw r9, 0(r6)
lwz r6, gx@sda21(r13)
add r6, r6, r0
lwz r0, 0(r6)
clrlwi r0, r0, 8
or r0, r0, r8
stw r0, 0(r6)
bdnz lbl_800A50BC
lwz r3, gx@sda21(r13)
li r8, 0x30
li r9, 0x31
stw r5, 0x120(r3)
lwz r3, gx@sda21(r13)
addi r3, r3, 0x120
lwz r0, 0(r3)
clrlwi r0, r0, 8
oris r0, r0, 0x2700
stw r0, 0(r3)
b lbl_800A51B8
lbl_800A51B8:
li r0, 4
mtctr r0
b lbl_800A51C4
lbl_800A51C4:
b lbl_800A51C8
lbl_800A51C8:
lwz r3, gx@sda21(r13)
slwi r4, r8, 0x18
addi r7, r5, 0xb8
li r29, 0
stwx r29, r3, r7
addi r6, r5, 0xd8
slwi r0, r9, 0x18
lwz r3, gx@sda21(r13)
addi r5, r5, 4
addi r8, r8, 2
stwx r29, r3, r6
addi r9, r9, 2
lwz r3, gx@sda21(r13)
add r10, r3, r7
lwz r3, 0(r10)
addi r7, r5, 0xb8
clrlwi r3, r3, 8
or r3, r3, r4
stw r3, 0(r10)
slwi r4, r8, 0x18
addi r8, r8, 2
lwz r3, gx@sda21(r13)
add r10, r3, r6
lwz r3, 0(r10)
addi r6, r5, 0xd8
addi r5, r5, 4
clrlwi r3, r3, 8
or r0, r3, r0
stw r0, 0(r10)
slwi r0, r9, 0x18
addi r9, r9, 2
lwz r3, gx@sda21(r13)
stwx r29, r3, r7
lwz r3, gx@sda21(r13)
stwx r29, r3, r6
lwz r3, gx@sda21(r13)
add r10, r3, r7
lwz r3, 0(r10)
clrlwi r3, r3, 8
or r3, r3, r4
stw r3, 0(r10)
lwz r3, gx@sda21(r13)
add r10, r3, r6
lwz r3, 0(r10)
clrlwi r3, r3, 8
or r0, r3, r0
stw r0, 0(r10)
bdnz lbl_800A51C8
lwz r5, gx@sda21(r13)
lis r3, 0x10624DD3@ha
lis r4, 0x800000F8@ha
addi r5, r5, 0xf8
lwz r0, 0(r5)
addi r3, r3, 0x10624DD3@l
clrlwi r0, r0, 8
oris r0, r0, 0x2000
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0xfc
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0x2100
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x1d0
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0x4100
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x1d4
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0x4200
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x1d8
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0x4000
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x1dc
lwz r0, 0(r5)
clrlwi r0, r0, 8
oris r0, r0, 0x4300
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
addi r5, r5, 0x1fc
lwz r0, 0(r5)
rlwinm r0, r0, 0, 0x19, 0x16
stw r0, 0(r5)
lwz r5, gx@sda21(r13)
stw r29, 0x4f4(r5)
lwz r5, gx@sda21(r13)
stb r29, 0x4f2(r5)
lwz r0, 0x800000F8@l(r4)
mulhwu r0, r3, r0
srwi r26, r0, 5
bl __GXFlushTextureState
srwi r0, r26, 0xb
oris r0, r0, 0x6900
li r28, 0x61
lis r31, 0xCC008000@ha
stb r28, 0xCC008000@l(r31)
ori r0, r0, 0x400
stw r0, -0x8000(r31)
bl __GXFlushTextureState
lis r3, 0x3E0F83E1@ha
stb r28, -0x8000(r31)
addi r0, r3, 0x3E0F83E1@l
mulhwu r0, r0, r26
srwi r0, r0, 0xa
oris r0, r0, 0x4600
ori r0, r0, 0x200
stw r0, -0x8000(r31)
mr r7, r29
b lbl_800A53A0
lbl_800A53A0:
li r0, 2
mtctr r0
b lbl_800A53AC
lbl_800A53AC:
b lbl_800A53B0
lbl_800A53B0:
lwz r0, gx@sda21(r13)
addi r8, r7, 0x1c
ori r5, r29, 0x80
add r8, r0, r8
lwz r0, 0(r8)
addi r9, r7, 0x3c
addi r3, r7, 0x3c
rlwinm r0, r0, 0, 2, 0
oris r0, r0, 0x4000
stw r0, 0(r8)
addi r7, r7, 4
li r6, 8
lwz r0, gx@sda21(r13)
addi r8, r7, 0x1c
addi r29, r29, 1
add r9, r0, r9
lwz r0, 0(r9)
clrlwi r0, r0, 1
oris r0, r0, 0x8000
stw r0, 0(r9)
addi r9, r7, 0x3c
stb r6, -0x8000(r31)
lwz r4, gx@sda21(r13)
stb r5, -0x8000(r31)
ori r5, r29, 0x80
add r8, r4, r8
lwzx r0, r4, r3
addi r3, r7, 0x3c
addi r7, r7, 4
stw r0, -0x8000(r31)
addi r29, r29, 1
lwz r0, 0(r8)
rlwinm r0, r0, 0, 2, 0
oris r0, r0, 0x4000
stw r0, 0(r8)
addi r8, r7, 0x1c
lwz r0, gx@sda21(r13)
add r9, r0, r9
lwz r0, 0(r9)
clrlwi r0, r0, 1
oris r0, r0, 0x8000
stw r0, 0(r9)
addi r9, r7, 0x3c
stb r6, -0x8000(r31)
lwz r4, gx@sda21(r13)
stb r5, -0x8000(r31)
ori r5, r29, 0x80
add r8, r4, r8
lwzx r0, r4, r3
addi r3, r7, 0x3c
addi r7, r7, 4
stw r0, -0x8000(r31)
addi r29, r29, 1
lwz r0, 0(r8)
rlwinm r0, r0, 0, 2, 0
oris r0, r0, 0x4000
stw r0, 0(r8)
addi r8, r7, 0x1c
lwz r0, gx@sda21(r13)
add r9, r0, r9
lwz r0, 0(r9)
clrlwi r0, r0, 1
oris r0, r0, 0x8000
stw r0, 0(r9)
addi r9, r7, 0x3c
stb r6, -0x8000(r31)
lwz r4, gx@sda21(r13)
stb r5, -0x8000(r31)
ori r5, r29, 0x80
add r8, r4, r8
lwzx r0, r4, r3
addi r3, r7, 0x3c
addi r7, r7, 4
stw r0, -0x8000(r31)
addi r29, r29, 1
lwz r0, 0(r8)
rlwinm r0, r0, 0, 2, 0
oris r0, r0, 0x4000
stw r0, 0(r8)
lwz r0, gx@sda21(r13)
add r9, r0, r9
lwz r0, 0(r9)
clrlwi r0, r0, 1
oris r0, r0, 0x8000
stw r0, 0(r9)
stb r6, -0x8000(r31)
lwz r4, gx@sda21(r13)
stb r5, -0x8000(r31)
lwzx r0, r4, r3
stw r0, -0x8000(r31)
bdnz lbl_800A53B0
li r4, 0x10
lis r6, 0xCC008000@ha
stb r4, 0xCC008000@l(r6)
li r0, 0x1000
li r29, 0
stw r0, -0x8000(r6)
li r0, 0x3f
slwi r28, r29, 0xf
stw r0, -0x8000(r6)
li r0, 0x1012
li r5, 1
stb r4, -0x8000(r6)
li r4, 0x61
lis r3, 0x5800000F@ha
stw r0, -0x8000(r6)
addi r0, r3, 0x5800000F@l
addis r26, r28, 8
stw r5, -0x8000(r6)
slwi r27, r29, 4
stb r4, -0x8000(r6)
stw r0, -0x8000(r6)
b lbl_800A5574
lbl_800A5574:
b lbl_800A5578
lbl_800A5578:
b lbl_800A557C
lbl_800A557C:
lwz r0, gx@sda21(r13)
addi r3, r27, 0x208
mr r5, r28
mr r7, r26
add r3, r0, r3
li r4, 0
li r6, 0
li r8, 0
bl GXInitTexCacheRegion
addis r26, r26, 1
addis r28, r28, 1
addi r26, r26, -32768
addi r28, r28, -32768
addi r27, r27, 0x10
addi r29, r29, 1
cmplwi r29, 8
blt lbl_800A557C
li r29, 0
slwi r3, r29, 1
addi r26, r3, 9
addi r27, r3, 8
slwi r28, r29, 4
b lbl_800A55D8
lbl_800A55D8:
b lbl_800A55DC
lbl_800A55DC:
b lbl_800A55E0
lbl_800A55E0:
lwz r0, gx@sda21(r13)
addi r3, r28, 0x288
slwi r5, r27, 0xf
add r3, r0, r3
slwi r7, r26, 0xf
li r4, 0
li r6, 0
li r8, 0
bl GXInitTexCacheRegion
addi r26, r26, 2
addi r27, r27, 2
addi r28, r28, 0x10
addi r29, r29, 1
cmplwi r29, 4
blt lbl_800A55E0
li r28, 0
slwi r3, r28, 0xd
addis r26, r3, 0xc
slwi r27, r28, 4
b lbl_800A5630
lbl_800A5630:
b lbl_800A5634
lbl_800A5634:
b lbl_800A5638
lbl_800A5638:
lwz r0, gx@sda21(r13)
addi r3, r27, 0x2d0
mr r4, r26
add r3, r0, r3
li r5, 0x10
bl GXInitTlutRegion
addi r26, r26, 0x2000
addi r27, r27, 0x10
addi r28, r28, 1
cmplwi r28, 0x10
blt lbl_800A5638
li r27, 0
slwi r3, r27, 0xf
addis r26, r3, 0xe
b lbl_800A5674
lbl_800A5674:
b lbl_800A5678
lbl_800A5678:
b lbl_800A567C
lbl_800A567C:
addi r0, r27, 0x10
lwz r5, gx@sda21(r13)
slwi r3, r0, 4
addi r3, r3, 0x2d0
mr r4, r26
add r3, r5, r3
li r5, 0x40
bl GXInitTlutRegion
addis r26, r26, 1
addi r26, r26, -32768
addi r27, r27, 1
cmplwi r27, 4
blt lbl_800A567C
lwz r4, __cpReg@sda21(r13)
li r12, 0
li r3, 8
sth r12, 6(r4)
lis r11, 0xCC008000@ha
li r10, 0x20
lwz r4, gx@sda21(r13)
li r8, 0x10
li r7, 0x1006
addi r4, r4, 0x4ec
lwz r0, 0(r4)
li r6, 0x61
lis r5, 0x2300
rlwinm r0, r0, 0, 0x1c, 0x17
stw r0, 0(r4)
lis r4, 0x2400
lis r0, 0x6700
stb r3, 0xCC008000@l(r11)
li r3, 0
lwz r9, gx@sda21(r13)
stb r10, -0x8000(r11)
lwz r9, 0x4ec(r9)
stw r9, -0x8000(r11)
stb r8, -0x8000(r11)
stw r7, -0x8000(r11)
stw r12, -0x8000(r11)
stb r6, -0x8000(r11)
stw r5, -0x8000(r11)
stb r6, -0x8000(r11)
stw r4, -0x8000(r11)
stb r6, -0x8000(r11)
stw r0, -0x8000(r11)
bl __GXSetTmemConfig
bl __GXInitGX
addi r3, r30, 0x4f8
lmw r26, 0x30(r1)
lwz r0, 0x4c(r1)
addi r1, r1, 0x48
mtlr r0
blr
.global __GXInitGX
__GXInitGX:
mflr r0
stw r0, 4(r1)
stwu r1, -0x78(r1)
stw r31, 0x74(r1)
stw r30, 0x70(r1)
lwz r4, "@121"@sda21(r2)
lwz r3, "@122"@sda21(r2)
lwz r0, "@123"@sda21(r2)
stw r4, 0x28(r1)
stw r3, 0x24(r1)
stw r0, 0x20(r1)
bl VIGetTvFormat
cmpwi r3, 2
beq lbl_800A57D8
bge lbl_800A579C
cmpwi r3, 0
beq lbl_800A57A8
bge lbl_800A57B8
b lbl_800A57E8
lbl_800A579C:
cmpwi r3, 5
beq lbl_800A57C8
b lbl_800A57E8
lbl_800A57A8:
lis r3, GXNtsc480IntDf@ha
addi r0, r3, GXNtsc480IntDf@l
mr r31, r0
b lbl_800A57F4
lbl_800A57B8:
lis r3, GXPal528IntDf@ha
addi r0, r3, GXPal528IntDf@l
mr r31, r0
b lbl_800A57F4
lbl_800A57C8:
lis r3, GXEurgb60Hz480IntDf@ha
addi r0, r3, GXEurgb60Hz480IntDf@l
mr r31, r0
b lbl_800A57F4
lbl_800A57D8:
lis r3, GXMpal480IntDf@ha
addi r0, r3, GXMpal480IntDf@l
mr r31, r0
b lbl_800A57F4
lbl_800A57E8:
lis r3, GXNtsc480IntDf@ha
addi r0, r3, GXNtsc480IntDf@l
mr r31, r0
lbl_800A57F4:
lwz r0, 0x28(r1)
lis r4, 0x00FFFFFF@ha
addi r3, r1, 0x1c
stw r0, 0x1c(r1)
addi r4, r4, 0x00FFFFFF@l
bl GXSetCopyClear
li r3, 0
li r4, 1
li r5, 4
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 1
li r4, 1
li r5, 5
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 2
li r4, 1
li r5, 6
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 3
li r4, 1
li r5, 7
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 4
li r4, 1
li r5, 8
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 5
li r4, 1
li r5, 9
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 6
li r4, 1
li r5, 0xa
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 7
li r4, 1
li r5, 0xb
li r6, 0x3c
li r7, 0
li r8, 0x7d
bl GXSetTexCoordGen2
li r3, 1
bl GXSetNumTexGens
bl GXClearVtxDesc
bl GXInvalidateVtxCache
li r30, 9
b lbl_800A5904
lbl_800A5904:
b lbl_800A5908
lbl_800A5908:
b lbl_800A590C
lbl_800A590C:
lwz r4, gx@sda21(r13)
mr r3, r30
li r5, 0
bl GXSetArray
addi r30, r30, 1
cmplwi r30, 0x18
ble lbl_800A590C
li r3, 6
li r4, 0
bl GXSetLineWidth
li r3, 6
li r4, 0
bl GXSetPointSize
li r3, 0
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 1
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 2
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 3
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 4
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 5
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 6
li r4, 0
li r5, 0
bl GXEnableTexOffsets
li r3, 7
li r4, 0
li r5, 0
bl GXEnableTexOffsets
lfs f1, "@177"@sda21(r2)
addi r3, r1, 0x2c
lfs f0, "@178"@sda21(r2)
li r4, 0
stfs f1, 0x2c(r1)
stfs f0, 0x30(r1)
stfs f0, 0x34(r1)
stfs f0, 0x38(r1)
stfs f0, 0x3c(r1)
stfs f1, 0x40(r1)
stfs f0, 0x44(r1)
stfs f0, 0x48(r1)
stfs f0, 0x4c(r1)
stfs f0, 0x50(r1)
stfs f1, 0x54(r1)
stfs f0, 0x58(r1)
bl GXLoadPosMtxImm
addi r3, r1, 0x2c
li r4, 0
bl GXLoadNrmMtxImm
li r3, 0
bl GXSetCurrentMtx
addi r3, r1, 0x2c
li r4, 0x3c
li r5, 0
bl GXLoadTexMtxImm
addi r3, r1, 0x2c
li r4, 0x7d
li r5, 0
bl GXLoadTexMtxImm
lhz r4, 4(r31)
lis r3, 0x4330
lhz r0, 8(r31)
stw r4, 0x6c(r1)
lfs f1, "@178"@sda21(r2)
stw r0, 0x64(r1)
lfd f4, "@181"@sda21(r2)
fmr f2, f1
stw r3, 0x68(r1)
fmr f5, f1
lfs f6, "@177"@sda21(r2)
stw r3, 0x60(r1)
lfd f3, 0x68(r1)
lfd f0, 0x60(r1)
fsubs f3, f3, f4
fsubs f4, f0, f4
bl GXSetViewport
li r3, 0
bl GXSetCoPlanar
li r3, 2
bl GXSetCullMode
li r3, 0
bl GXSetClipMode
lhz r5, 4(r31)
li r3, 0
lhz r6, 6(r31)
li r4, 0
bl GXSetScissor
li r3, 0
li r4, 0
bl GXSetScissorBoxOffset
li r3, 0
bl GXSetNumChans
li r3, 4
li r4, 0
li r5, 0
li r6, 1
li r7, 0
li r8, 0
li r9, 2
bl GXSetChanCtrl
lwz r0, 0x24(r1)
addi r4, r1, 0x18
li r3, 4
stw r0, 0x18(r1)
bl GXSetChanAmbColor
lwz r0, 0x20(r1)
addi r4, r1, 0x14
li r3, 4
stw r0, 0x14(r1)
bl GXSetChanMatColor
li r3, 5
li r4, 0
li r5, 0
li r6, 1
li r7, 0
li r8, 0
li r9, 2
bl GXSetChanCtrl
lwz r0, 0x24(r1)
addi r4, r1, 0x10
li r3, 5
stw r0, 0x10(r1)
bl GXSetChanAmbColor
lwz r0, 0x20(r1)
addi r4, r1, 0xc
li r3, 5
stw r0, 0xc(r1)
bl GXSetChanMatColor
bl GXInvalidateTexAll
lwz r4, gx@sda21(r13)
li r30, 0
lis r3, __GXDefaultTexRegionCallback@ha
stw r30, 0x2c8(r4)
addi r3, r3, __GXDefaultTexRegionCallback@l
lwz r4, gx@sda21(r13)
stw r30, 0x2cc(r4)
bl GXSetTexRegionCallback
lis r3, __GXDefaultTlutRegionCallback@ha
addi r3, r3, __GXDefaultTlutRegionCallback@l
bl GXSetTlutRegionCallback
li r3, 0
li r4, 0
li r5, 0
li r6, 4
bl GXSetTevOrder
li r3, 1
li r4, 1
li r5, 1
li r6, 4
bl GXSetTevOrder
li r3, 2
li r4, 2
li r5, 2
li r6, 4
bl GXSetTevOrder
li r3, 3
li r4, 3
li r5, 3
li r6, 4
bl GXSetTevOrder
li r3, 4
li r4, 4
li r5, 4
li r6, 4
bl GXSetTevOrder
li r3, 5
li r4, 5
li r5, 5
li r6, 4
bl GXSetTevOrder
li r3, 6
li r4, 6
li r5, 6
li r6, 4
bl GXSetTevOrder
li r3, 7
li r4, 7
li r5, 7
li r6, 4
bl GXSetTevOrder
li r3, 8
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 9
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 0xa
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 0xb
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 0xc
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 0xd
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 0xe
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 0xf
li r4, 0xff
li r5, 0xff
li r6, 0xff
bl GXSetTevOrder
li r3, 1
bl GXSetNumTevStages
li r3, 0
li r4, 3
bl GXSetTevOp
li r3, 7
li r4, 0
li r5, 0
li r6, 7
li r7, 0
bl GXSetAlphaCompare
li r3, 0
li r4, 0x11
li r5, 0
bl GXSetZTexture
b lbl_800A5CFC
lbl_800A5CFC:
b lbl_800A5D00
lbl_800A5D00:
b lbl_800A5D04
lbl_800A5D04:
mr r3, r30
li r4, 6
bl GXSetTevKColorSel
mr r3, r30
li r4, 0
bl GXSetTevKAlphaSel
mr r3, r30
li r4, 0
li r5, 0
bl GXSetTevSwapMode
addi r30, r30, 1
cmplwi r30, 0x10
blt lbl_800A5D04
li r3, 0
li r4, 0
li r5, 1
li r6, 2
li r7, 3
bl GXSetTevSwapModeTable
li r3, 1
li r4, 0
li r5, 0
li r6, 0
li r7, 3
bl GXSetTevSwapModeTable
li r3, 2
li r4, 1
li r5, 1
li r6, 1
li r7, 3
bl GXSetTevSwapModeTable
li r3, 3
li r4, 2
li r5, 2
li r6, 2
li r7, 3
bl GXSetTevSwapModeTable
li r30, 0
b lbl_800A5DA0
lbl_800A5DA0:
b lbl_800A5DA4
lbl_800A5DA4:
b lbl_800A5DA8
lbl_800A5DA8:
mr r3, r30
bl GXSetTevDirect
addi r30, r30, 1
cmplwi r30, 0x10
blt lbl_800A5DA8
li r3, 0
bl GXSetNumIndStages
li r3, 0
li r4, 0
li r5, 0
bl GXSetIndTexCoordScale
li r3, 1
li r4, 0
li r5, 0
bl GXSetIndTexCoordScale
li r3, 2
li r4, 0
li r5, 0
bl GXSetIndTexCoordScale
li r3, 3
li r4, 0
li r5, 0
bl GXSetIndTexCoordScale
lfs f2, "@177"@sda21(r2)
addi r4, r1, 8
lwz r0, 0x24(r1)
li r3, 0
fmr f4, f2
stw r0, 8(r1)
lfs f1, "@178"@sda21(r2)
lfs f3, "@179"@sda21(r2)
bl GXSetFog
li r3, 0
li r4, 0
li r5, 0
bl GXSetFogRangeAdj
li r3, 0
li r4, 4
li r5, 5
li r6, 0
bl GXSetBlendMode
li r3, 1
bl GXSetColorUpdate
li r3, 1
bl GXSetAlphaUpdate
li r3, 1
li r4, 3
li r5, 1
bl GXSetZMode
li r3, 1
bl GXSetZCompLoc
li r3, 1
bl GXSetDither
li r3, 0
li r4, 0
bl GXSetDstAlpha
li r3, 0
li r4, 0
bl GXSetPixelFmt
li r3, 1
li r4, 1
bl GXSetFieldMask
lhz r0, 8(r31)
lhz r3, 0x10(r31)
slwi r0, r0, 1
cmpw r3, r0
bne lbl_800A5EBC
li r4, 1
b lbl_800A5EC0
lbl_800A5EBC:
li r4, 0
lbl_800A5EC0:
lbz r3, 0x18(r31)
bl GXSetFieldMode
lhz r5, 4(r31)
li r3, 0
lhz r6, 6(r31)
li r4, 0
bl GXSetDispCopySrc
lhz r3, 4(r31)
lhz r4, 6(r31)
bl GXSetDispCopyDst
lhz r4, 8(r31)
lis r3, 0x4330
lhz r0, 6(r31)
stw r4, 0x64(r1)
lfd f2, "@181"@sda21(r2)
stw r0, 0x6c(r1)
stw r3, 0x60(r1)
stw r3, 0x68(r1)
lfd f1, 0x60(r1)
lfd f0, 0x68(r1)
fsubs f1, f1, f2
fsubs f0, f0, f2
fdivs f1, f1, f0
bl GXSetDispCopyYScale
li r3, 3
bl GXSetCopyClamp
lbz r3, 0x19(r31)
addi r4, r31, 0x1a
addi r6, r31, 0x32
li r5, 1
bl GXSetCopyFilter
li r3, 0
bl GXSetDispCopyGamma
li r3, 0
bl GXSetDispCopyFrame2Field
bl GXClearBoundingBox
li r3, 1
bl GXPokeColorUpdate
li r3, 1
bl GXPokeAlphaUpdate
li r3, 0
bl GXPokeDither
li r3, 0
li r4, 0
li r5, 1
li r6, 0xf
bl GXPokeBlendMode
li r3, 7
li r4, 0
bl GXPokeAlphaMode
li r3, 1
bl GXPokeAlphaRead
li r3, 0
li r4, 0
bl GXPokeDstAlpha
li r3, 1
li r4, 7
li r5, 1
bl GXPokeZMode
li r3, 0x23
li r4, 0x16
bl GXSetGPMetric
bl GXClearGPMetric
lwz r0, 0x7c(r1)
lwz r31, 0x74(r1)
lwz r30, 0x70(r1)
addi r1, r1, 0x78
mtlr r0
blr
.section .sdata, "wa"
.global gx
gx:
.4byte gxData
.4byte 0
.section .sdata2, "a"
.balign 8
"@121":
.4byte 0x404040FF
"@122":
.4byte 0
"@123":
.4byte -1
"@177":
.4byte 0x3F800000
"@178":
.4byte 0
"@179":
.4byte 0x3DCCCCCD
"@181":
.4byte 0x43300000
.4byte 0
.section .bss, "wa"
gxData:
.skip 0x4F8
FifoObj:
.skip 0x80
.section .sbss, "wa"
.global __piReg
__piReg:
.skip 0x4
.global __cpReg
__cpReg:
.skip 0x4
.global __peReg
__peReg:
.skip 0x4
__memReg:
.skip 0x4