.include "macros.inc"
.section .text, "ax"
.global GXGetTexBufferSize
GXGetTexBufferSize:
stwu r1, -0x28(r1)
cmplwi r5, 0x3c
stw r31, 0x24(r1)
bgt lbl_800AA220
lis r8, "@92"@ha
addi r8, r8, "@92"@l
slwi r0, r5, 2
lwzx r0, r8, r0
mtctr r0
bctr
lbl_800AA1FC:
li r0, 3
li r8, 3
b lbl_800AA228
lbl_800AA208:
li r0, 3
li r8, 2
b lbl_800AA228
lbl_800AA214:
li r0, 2
li r8, 2
b lbl_800AA228
lbl_800AA220:
li r8, 0
li r0, 0
lbl_800AA228:
cmplwi r5, 6
beq lbl_800AA238
cmplwi r5, 0x16
bne lbl_800AA240
lbl_800AA238:
li r5, 0x40
b lbl_800AA244
lbl_800AA240:
li r5, 0x20
lbl_800AA244:
clrlwi r6, r6, 0x18
cmplwi r6, 1
bne lbl_800AA2EC
clrlwi r9, r7, 0x18
li r6, 1
mtctr r9
slw r7, r6, r8
slw r6, r6, r0
cmplwi r9, 0
addi r10, r6, -1
addi r7, r7, -1
li r31, 0
ble lbl_800AA320
lbl_800AA278:
clrlwi r11, r3, 0x10
add r6, r11, r10
clrlwi r12, r4, 0x10
sraw r9, r6, r0
add r6, r12, r7
sraw r6, r6, r8
mullw r6, r9, r6
mullw r6, r5, r6
cmplwi r11, 1
add r31, r31, r6
bne lbl_800AA2AC
cmplwi r12, 1
beq lbl_800AA320
lbl_800AA2AC:
clrlwi r3, r3, 0x10
cmplwi r3, 1
ble lbl_800AA2C0
srawi r6, r11, 1
b lbl_800AA2C4
lbl_800AA2C0:
li r6, 1
lbl_800AA2C4:
clrlwi r3, r4, 0x10
cmplwi r3, 1
clrlwi r3, r6, 0x10
ble lbl_800AA2DC
srawi r4, r12, 1
b lbl_800AA2E0
lbl_800AA2DC:
li r4, 1
lbl_800AA2E0:
clrlwi r4, r4, 0x10
bdnz lbl_800AA278
b lbl_800AA320
lbl_800AA2EC:
li r6, 1
slw r7, r6, r0
slw r6, r6, r8
clrlwi r9, r3, 0x10
addi r3, r7, -1
add r7, r9, r3
clrlwi r4, r4, 0x10
addi r3, r6, -1
sraw r6, r7, r0
add r0, r4, r3
sraw r0, r0, r8
mullw r0, r6, r0
mullw r31, r5, r0
lbl_800AA320:
mr r3, r31
lwz r31, 0x24(r1)
addi r1, r1, 0x28
blr
.global __GetImageTileCount
__GetImageTileCount:
cmplwi r3, 0x3c
bgt lbl_800AA374
lis r9, "@133"@ha
addi r9, r9, "@133"@l
slwi r0, r3, 2
lwzx r0, r9, r0
mtctr r0
bctr
lbl_800AA350:
li r11, 3
li r12, 3
b lbl_800AA37C
lbl_800AA35C:
li r11, 3
li r12, 2
b lbl_800AA37C
lbl_800AA368:
li r11, 2
li r12, 2
b lbl_800AA37C
lbl_800AA374:
li r12, 0
li r11, 0
lbl_800AA37C:
clrlwi. r0, r4, 0x10
bne lbl_800AA388
li r4, 1
lbl_800AA388:
clrlwi. r0, r5, 0x10
bne lbl_800AA394
li r5, 1
lbl_800AA394:
li r10, 1
slw r9, r10, r11
clrlwi r4, r4, 0x10
addi r0, r9, -1
add r0, r4, r0
sraw r0, r0, r11
slw r4, r10, r12
stw r0, 0(r6)
clrlwi r5, r5, 0x10
addi r0, r4, -1
add r0, r5, r0
sraw r0, r0, r12
cmpwi r3, 6
stw r0, 0(r7)
beq lbl_800AA3DC
cmpwi r3, 0x16
beq lbl_800AA3DC
li r10, 0
lbl_800AA3DC:
cmpwi r10, 0
beq lbl_800AA3EC
li r0, 2
b lbl_800AA3F0
lbl_800AA3EC:
li r0, 1
lbl_800AA3F0:
stw r0, 0(r8)
blr
.global GXInitTexObj
GXInitTexObj:
mflr r0
stw r0, 4(r1)
stwu r1, -0x60(r1)
stmw r24, 0x40(r1)
addi r27, r4, 0
addi r28, r5, 0
addi r31, r3, 0
addi r29, r6, 0
addi r30, r7, 0
addi r24, r8, 0
addi r25, r9, 0
addi r26, r10, 0
li r4, 0
li r5, 0x20
bl memset
lwz r4, 0(r31)
clrlwi. r0, r26, 0x18
slwi r3, r25, 2
rlwinm r4, r4, 0, 0, 0x1d
or r4, r4, r24
stw r4, 0(r31)
lwz r0, 0(r31)
rlwinm r0, r0, 0, 0x1e, 0x1b
or r0, r0, r3
stw r0, 0(r31)
lwz r0, 0(r31)
rlwinm r0, r0, 0, 0x1c, 0x1a
ori r0, r0, 0x10
stw r0, 0(r31)
beq lbl_800AA510
lbz r3, 0x1f(r31)
addi r0, r30, -8
cmplwi r0, 2
ori r0, r3, 1
stb r0, 0x1f(r31)
bgt lbl_800AA49C
lwz r0, 0(r31)
rlwinm r0, r0, 0, 0x1b, 0x17
ori r0, r0, 0xa0
stw r0, 0(r31)
b lbl_800AA4AC
lbl_800AA49C:
lwz r0, 0(r31)
rlwinm r0, r0, 0, 0x1b, 0x17
ori r0, r0, 0xc0
stw r0, 0(r31)
lbl_800AA4AC:
clrlwi r3, r28, 0x10
clrlwi r0, r29, 0x10
cmplw r3, r0
ble lbl_800AA4C8
cntlzw r0, r3
subfic r0, r0, 0x1f
b lbl_800AA4D0
lbl_800AA4C8:
cntlzw r0, r0
subfic r0, r0, 0x1f
lbl_800AA4D0:
stw r0, 0x3c(r1)
lis r0, 0x4330
lwz r3, 4(r31)
stw r0, 0x38(r1)
lfd f1, "@166"@sda21(r2)
rlwinm r3, r3, 0, 0x18, 0xf
lfd f0, 0x38(r1)
lfs f2, "@164"@sda21(r2)
fsubs f0, f0, f1
fmuls f0, f2, f0
fctiwz f0, f0
stfd f0, 0x30(r1)
lwz r0, 0x34(r1)
rlwimi r3, r0, 8, 0x10, 0x17
stw r3, 4(r31)
b lbl_800AA520
lbl_800AA510:
lwz r0, 0(r31)
rlwinm r0, r0, 0, 0x1b, 0x17
ori r0, r0, 0x80
stw r0, 0(r31)
lbl_800AA520:
stw r30, 0x14(r31)
clrlwi r3, r29, 0x10
clrlwi r7, r30, 0x1c
lwz r5, 8(r31)
clrlwi r4, r28, 0x10
addi r0, r3, -1
rlwinm r6, r5, 0, 0, 0x15
addi r5, r4, -1
or r5, r6, r5
stw r5, 8(r31)
slwi r5, r0, 0xa
rlwinm r0, r27, 0x1b, 7, 0x1f
lwz r6, 8(r31)
cmplwi r7, 0xe
rlwinm r6, r6, 0, 0x16, 0xb
or r5, r6, r5
stw r5, 8(r31)
lwz r5, 8(r31)
rlwinm r5, r5, 0, 0xc, 7
rlwimi r5, r30, 0x14, 8, 0xb
stw r5, 8(r31)
lwz r5, 0xc(r31)
rlwinm r5, r5, 0, 0, 0xa
or r0, r5, r0
stw r0, 0xc(r31)
bgt lbl_800AA604
lis r5, "@168"@ha
addi r5, r5, "@168"@l
slwi r0, r7, 2
lwzx r0, r5, r0
mtctr r0
bctr
lbl_800AA5A0:
li r0, 1
stb r0, 0x1e(r31)
li r0, 3
li r7, 3
b lbl_800AA614
lbl_800AA5B4:
li r0, 2
stb r0, 0x1e(r31)
li r0, 3
li r7, 2
b lbl_800AA614
lbl_800AA5C8:
li r0, 2
stb r0, 0x1e(r31)
li r0, 2
li r7, 2
b lbl_800AA614
lbl_800AA5DC:
li r0, 3
stb r0, 0x1e(r31)
li r0, 2
li r7, 2
b lbl_800AA614
lbl_800AA5F0:
li r0, 0
stb r0, 0x1e(r31)
li r0, 3
li r7, 3
b lbl_800AA614
lbl_800AA604:
li r0, 2
stb r0, 0x1e(r31)
li r0, 2
li r7, 2
lbl_800AA614:
clrlwi r8, r0, 0x10
li r6, 1
slw r5, r6, r8
clrlwi r7, r7, 0x10
addi r0, r5, -1
slw r5, r6, r7
add r4, r4, r0
addi r0, r5, -1
sraw r4, r4, r8
add r0, r3, r0
sraw r0, r0, r7
mullw r0, r4, r0
clrlwi r0, r0, 0x11
sth r0, 0x1c(r31)
lbz r0, 0x1f(r31)
ori r0, r0, 2
stb r0, 0x1f(r31)
lwz r0, 0x64(r1)
lmw r24, 0x40(r1)
addi r1, r1, 0x60
mtlr r0
blr
.global GXInitTexObjCI
GXInitTexObjCI:
mflr r0
stw r0, 4(r1)
stwu r1, -0x30(r1)
stw r31, 0x2c(r1)
lwz r31, 0x38(r1)
stw r30, 0x28(r1)
mr r30, r3
bl GXInitTexObj
lbz r0, 0x1f(r30)
rlwinm r0, r0, 0, 0x1f, 0x1d
stb r0, 0x1f(r30)
stw r31, 0x18(r30)
lwz r0, 0x34(r1)
lwz r31, 0x2c(r1)
lwz r30, 0x28(r1)
addi r1, r1, 0x30
mtlr r0
blr
.global GXInitTexObjLOD
GXInitTexObjLOD:
stwu r1, -0x38(r1)
lfs f0, "@192"@sda21(r2)
fcmpo cr0, f3, f0
bge lbl_800AA6CC
fmr f3, f0
b lbl_800AA6E0
lbl_800AA6CC:
lfs f0, "@193"@sda21(r2)
fcmpo cr0, f3, f0
cror 2, 1, 2
bne lbl_800AA6E0
lfs f3, "@194"@sda21(r2)
lbl_800AA6E0:
lfs f0, "@195"@sda21(r2)
cmpwi r5, 1
lwz r0, 0(r3)
fmuls f0, f0, f3
rlwinm r5, r0, 0, 0x17, 0xe
fctiwz f0, f0
stfd f0, 0x30(r1)
lwz r0, 0x34(r1)
rlwimi r5, r0, 9, 0xf, 0x16
stw r5, 0(r3)
bne lbl_800AA714
li r5, 1
b lbl_800AA718
lbl_800AA714:
li r5, 0
lbl_800AA718:
lwz r9, 0(r3)
clrlwi. r0, r7, 0x18
slwi r5, r5, 4
rlwinm r7, r9, 0, 0x1c, 0x1a
or r5, r7, r5
stw r5, 0(r3)
addi r5, r13, GX2HWFiltConv@sda21
lbzx r0, r5, r4
lwz r7, 0(r3)
slwi r0, r0, 5
rlwinm r4, r7, 0, 0x1b, 0x17
or r0, r4, r0
stw r0, 0(r3)
beq lbl_800AA758
li r0, 0
b lbl_800AA75C
lbl_800AA758:
li r0, 1
lbl_800AA75C:
lwz r4, 0(r3)
slwi r0, r0, 8
rlwinm r4, r4, 0, 0x18, 0x16
or r0, r4, r0
stw r0, 0(r3)
slwi r4, r8, 0x13
rlwinm r0, r6, 0x15, 3, 0xa
lwz r5, 0(r3)
rlwinm r5, r5, 0, 0xf, 0xd
stw r5, 0(r3)
lwz r5, 0(r3)
rlwinm r5, r5, 0, 0xe, 0xc
stw r5, 0(r3)
lwz r5, 0(r3)
rlwinm r5, r5, 0, 0xd, 0xa
or r4, r5, r4
stw r4, 0(r3)
lwz r4, 0(r3)
rlwinm r4, r4, 0, 0xb, 9
or r0, r4, r0
stw r0, 0(r3)
lfs f0, "@196"@sda21(r2)
fcmpo cr0, f1, f0
bge lbl_800AA7C4
fmr f1, f0
b lbl_800AA7D4
lbl_800AA7C4:
lfs f0, "@197"@sda21(r2)
fcmpo cr0, f1, f0
ble lbl_800AA7D4
fmr f1, f0
lbl_800AA7D4:
lfs f3, "@164"@sda21(r2)
lfs f0, "@196"@sda21(r2)
fmuls f1, f3, f1
fcmpo cr0, f2, f0
fctiwz f1, f1
stfd f1, 0x30(r1)
lwz r4, 0x34(r1)
bge lbl_800AA7FC
fmr f2, f0
b lbl_800AA80C
lbl_800AA7FC:
lfs f0, "@197"@sda21(r2)
fcmpo cr0, f2, f0
ble lbl_800AA80C
fmr f2, f0
lbl_800AA80C:
lwz r0, 4(r3)
rlwinm r0, r0, 0, 0, 0x17
rlwimi r0, r4, 0, 0x18, 0x1f
stw r0, 4(r3)
lfs f0, "@164"@sda21(r2)
lwz r0, 4(r3)
fmuls f0, f0, f2
rlwinm r4, r0, 0, 0x18, 0xf
fctiwz f0, f0
stfd f0, 0x30(r1)
lwz r0, 0x34(r1)
rlwimi r4, r0, 8, 0x10, 0x17
stw r4, 4(r3)
addi r1, r1, 0x38
blr
.global GXGetTexObjAll
GXGetTexObjAll:
lwz r0, 0xc(r3)
rlwinm r0, r0, 5, 6, 0x1a
stw r0, 0(r4)
lwz r0, 8(r3)
clrlwi r4, r0, 0x16
addi r0, r4, 1
sth r0, 0(r5)
lwz r0, 8(r3)
rlwinm r4, r0, 0x16, 0x16, 0x1f
addi r0, r4, 1
sth r0, 0(r6)
lwz r0, 0x14(r3)
stw r0, 0(r7)
lwz r0, 0(r3)
clrlwi r0, r0, 0x1e
stw r0, 0(r8)
lwz r0, 0(r3)
rlwinm r0, r0, 0x1e, 0x1e, 0x1f
stw r0, 0(r9)
lbz r0, 0x1f(r3)
clrlwi r3, r0, 0x1f
addi r0, r3, -1
cntlzw r0, r0
rlwinm r0, r0, 0x1b, 0x18, 0x1f
stb r0, 0(r10)
blr
.global GXGetTexObjWidth
GXGetTexObjWidth:
lwz r0, 8(r3)
clrlwi r3, r0, 0x16
addi r3, r3, 1
blr
.global GXGetTexObjHeight
GXGetTexObjHeight:
lwz r0, 8(r3)
rlwinm r3, r0, 0x16, 0x16, 0x1f
addi r3, r3, 1
blr
.global GXGetTexObjFmt
GXGetTexObjFmt:
lwz r3, 0x14(r3)
blr
.global GXLoadTexObjPreLoaded
GXLoadTexObjPreLoaded:
mflr r0
addi r7, r13, GXTexImage0Ids@sda21
stw r0, 4(r1)
stwu r1, -0x28(r1)
stw r31, 0x24(r1)
lis r31, 0xCC008000@ha
stw r30, 0x20(r1)
li r30, 0x61
stw r29, 0x1c(r1)
addi r29, r5, 0
addi r5, r13, GXTexImage2Ids@sda21
stw r28, 0x18(r1)
mr r28, r3
lwz r6, 0(r3)
addi r3, r13, GXTexMode0Ids@sda21
lbzx r0, r3, r29
addi r3, r13, GXTexMode1Ids@sda21
slwi r0, r0, 0x18
rlwimi r0, r6, 0, 8, 0x1f
stw r0, 0(r28)
addi r6, r13, GXTexImage1Ids@sda21
lbzx r0, r3, r29
addi r3, r13, GXTexImage3Ids@sda21
lwz r8, 4(r28)
slwi r0, r0, 0x18
rlwimi r0, r8, 0, 8, 0x1f
stw r0, 4(r28)
lbzx r0, r7, r29
lwz r8, 8(r28)
slwi r0, r0, 0x18
rlwimi r0, r8, 0, 8, 0x1f
stw r0, 8(r28)
lbzx r0, r6, r29
lwz r7, 0(r4)
slwi r0, r0, 0x18
rlwimi r0, r7, 0, 8, 0x1f
stw r0, 0(r4)
lbzx r0, r5, r29
lwz r6, 4(r4)
slwi r0, r0, 0x18
rlwimi r0, r6, 0, 8, 0x1f
stw r0, 4(r4)
lbzx r0, r3, r29
lwz r5, 0xc(r28)
slwi r0, r0, 0x18
rlwimi r0, r5, 0, 8, 0x1f
stw r0, 0xc(r28)
stb r30, 0xCC008000@l(r31)
lwz r0, 0(r28)
stw r0, -0x8000(r31)
stb r30, -0x8000(r31)
lwz r0, 4(r28)
stw r0, -0x8000(r31)
stb r30, -0x8000(r31)
lwz r0, 8(r28)
stw r0, -0x8000(r31)
stb r30, -0x8000(r31)
lwz r0, 0(r4)
stw r0, -0x8000(r31)
stb r30, -0x8000(r31)
lwz r0, 4(r4)
stw r0, -0x8000(r31)
stb r30, -0x8000(r31)
lwz r0, 0xc(r28)
stw r0, -0x8000(r31)
lbz r0, 0x1f(r28)
rlwinm. r0, r0, 0, 0x1e, 0x1e
bne lbl_800AAA20
lwz r4, gx@sda21(r13)
lwz r3, 0x18(r28)
lwz r12, 0x414(r4)
mtlr r12
blrl
addi r4, r13, GXTexTlutIds@sda21
lwz r5, 4(r3)
lbzx r0, r4, r29
slwi r0, r0, 0x18
rlwimi r0, r5, 0, 8, 0x1f
stw r0, 4(r3)
stb r30, -0x8000(r31)
lwz r0, 4(r3)
stw r0, -0x8000(r31)
lbl_800AAA20:
lwz r3, gx@sda21(r13)
slwi r5, r29, 2
lwz r4, 8(r28)
li r0, 0
add r3, r3, r5
stw r4, 0x45c(r3)
lwz r3, gx@sda21(r13)
lwz r4, 0(r28)
add r3, r3, r5
stw r4, 0x47c(r3)
lwz r4, gx@sda21(r13)
lwz r3, 0x4f4(r4)
ori r3, r3, 1
stw r3, 0x4f4(r4)
lwz r3, gx@sda21(r13)
sth r0, 2(r3)
lwz r0, 0x2c(r1)
lwz r31, 0x24(r1)
lwz r30, 0x20(r1)
lwz r29, 0x1c(r1)
lwz r28, 0x18(r1)
addi r1, r1, 0x28
mtlr r0
blr
.global GXLoadTexObj
GXLoadTexObj:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
addi r31, r4, 0
stw r30, 0x10(r1)
addi r30, r3, 0
lwz r5, gx@sda21(r13)
lwz r12, 0x410(r5)
mtlr r12
blrl
addi r4, r3, 0
addi r3, r30, 0
addi r5, r31, 0
bl GXLoadTexObjPreLoaded
lwz r0, 0x1c(r1)
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
addi r1, r1, 0x18
mtlr r0
blr
.global GXInitTlutObj
GXInitTlutObj:
li r0, 0
stw r0, 0(r3)
slwi r5, r5, 0xa
rlwinm r0, r4, 0x1b, 7, 0x1f
lwz r7, 0(r3)
rlwinm r4, r7, 0, 0x16, 0x13
or r4, r4, r5
stw r4, 0(r3)
lwz r4, 4(r3)
rlwinm r4, r4, 0, 0, 0xa
or r0, r4, r0
stw r0, 4(r3)
lwz r0, 4(r3)
clrlwi r0, r0, 8
oris r0, r0, 0x6400
stw r0, 4(r3)
sth r6, 8(r3)
blr
.global GXLoadTlut
GXLoadTlut:
mflr r0
stw r0, 4(r1)
stwu r1, -0x20(r1)
stw r31, 0x1c(r1)
stw r30, 0x18(r1)
mr r30, r3
addi r3, r4, 0
lwz r5, gx@sda21(r13)
lwz r12, 0x414(r5)
mtlr r12
blrl
mr r31, r3
bl __GXFlushTextureState
li r4, 0x61
lis r3, 0xCC008000@ha
stb r4, 0xCC008000@l(r3)
lwz r0, 4(r30)
stw r0, -0x8000(r3)
stb r4, -0x8000(r3)
lwz r0, 0(r31)
stw r0, -0x8000(r3)
bl __GXFlushTextureState
lwz r0, 0(r31)
lwz r3, 0(r30)
clrlwi r0, r0, 0x16
rlwimi r0, r3, 0, 0, 0x15
stw r0, 0(r30)
lwz r3, 0(r30)
lwz r0, 4(r30)
stw r3, 4(r31)
stw r0, 8(r31)
lwz r0, 8(r30)
stw r0, 0xc(r31)
lwz r0, 0x24(r1)
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
addi r1, r1, 0x20
mtlr r0
blr
.global GXInitTexCacheRegion
GXInitTexCacheRegion:
cmpwi r6, 1
beq lbl_800AABE4
bge lbl_800AABD0
cmpwi r6, 0
bge lbl_800AABDC
b lbl_800AABF0
lbl_800AABD0:
cmpwi r6, 3
bge lbl_800AABF0
b lbl_800AABEC
lbl_800AABDC:
li r10, 3
b lbl_800AABF0
lbl_800AABE4:
li r10, 4
b lbl_800AABF0
lbl_800AABEC:
li r10, 5
lbl_800AABF0:
li r0, 0
stw r0, 0(r3)
srwi r6, r5, 5
slwi r5, r10, 0xf
lwz r9, 0(r3)
slwi r0, r10, 0x12
cmpwi r8, 2
rlwinm r9, r9, 0, 0, 0x10
or r6, r9, r6
stw r6, 0(r3)
lwz r6, 0(r3)
rlwinm r6, r6, 0, 0x11, 0xd
or r5, r6, r5
stw r5, 0(r3)
lwz r5, 0(r3)
rlwinm r5, r5, 0, 0xe, 0xa
or r0, r5, r0
stw r0, 0(r3)
lwz r0, 0(r3)
rlwinm r0, r0, 0, 0xb, 9
stw r0, 0(r3)
beq lbl_800AAC78
bge lbl_800AAC5C
cmpwi r8, 0
beq lbl_800AAC68
bge lbl_800AAC70
b lbl_800AAC84
lbl_800AAC5C:
cmpwi r8, 4
bge lbl_800AAC84
b lbl_800AAC80
lbl_800AAC68:
li r10, 3
b lbl_800AAC84
lbl_800AAC70:
li r10, 4
b lbl_800AAC84
lbl_800AAC78:
li r10, 5
b lbl_800AAC84
lbl_800AAC80:
li r10, 0
lbl_800AAC84:
li r0, 0
stw r0, 4(r3)
srwi r7, r7, 5
slwi r6, r10, 0xf
lwz r8, 4(r3)
slwi r5, r10, 0x12
li r0, 1
rlwinm r8, r8, 0, 0, 0x10
or r7, r8, r7
stw r7, 4(r3)
lwz r7, 4(r3)
rlwinm r7, r7, 0, 0x11, 0xd
or r6, r7, r6
stw r6, 4(r3)
lwz r6, 4(r3)
rlwinm r6, r6, 0, 0xe, 0xa
or r5, r6, r5
stw r5, 4(r3)
stb r4, 0xc(r3)
stb r0, 0xd(r3)
blr
.global GXInitTlutRegion
GXInitTlutRegion:
li r0, 0
stw r0, 0(r3)
addis r0, r4, 0xfff8
srwi r4, r0, 9
lwz r6, 0(r3)
slwi r0, r5, 0xa
rlwinm r5, r6, 0, 0, 0x15
or r4, r5, r4
stw r4, 0(r3)
lwz r4, 0(r3)
rlwinm r4, r4, 0, 0x16, 0xa
or r0, r4, r0
stw r0, 0(r3)
lwz r0, 0(r3)
clrlwi r0, r0, 8
oris r0, r0, 0x6500
stw r0, 0(r3)
blr
.global GXInvalidateTexAll
GXInvalidateTexAll:
mflr r0
stw r0, 4(r1)
stwu r1, -8(r1)
bl __GXFlushTextureState
li r6, 0x61
lis r3, 0x66001000@ha
lis r5, 0xCC008000@ha
stb r6, 0xCC008000@l(r5)
addi r4, r3, 0x66001000@l
addi r0, r3, 0x1100
stw r4, -0x8000(r5)
stb r6, -0x8000(r5)
stw r0, -0x8000(r5)
bl __GXFlushTextureState
lwz r0, 0xc(r1)
addi r1, r1, 8
mtlr r0
blr
.global GXSetTexRegionCallback
GXSetTexRegionCallback:
lwz r4, gx@sda21(r13)
lwzu r0, 0x410(r4)
stw r3, 0(r4)
mr r3, r0
blr
.global GXSetTlutRegionCallback
GXSetTlutRegionCallback:
lwz r4, gx@sda21(r13)
lwzu r0, 0x414(r4)
stw r3, 0(r4)
mr r3, r0
blr
.global GXSetTexCoordScaleManually
GXSetTexCoordScaleManually:
lwz r7, gx@sda21(r13)
li r0, 1
clrlwi. r4, r4, 0x18
addi r8, r7, 0x4dc
lwz r7, 0x4dc(r7)
slw r0, r0, r3
andc r7, r7, r0
slw r0, r4, r3
or r0, r7, r0
stw r0, 0(r8)
beqlr
lwz r4, gx@sda21(r13)
slwi r8, r3, 2
addi r0, r5, -1
add r5, r4, r8
lwz r4, 0xb8(r5)
addi r3, r6, -1
li r7, 0x61
rlwinm r4, r4, 0, 0, 0xf
rlwimi r4, r0, 0, 0x10, 0x1f
stw r4, 0xb8(r5)
lis r6, 0xCC008000@ha
li r0, 0
lwz r4, gx@sda21(r13)
add r5, r4, r8
lwz r4, 0xd8(r5)
rlwinm r4, r4, 0, 0, 0xf
rlwimi r4, r3, 0, 0x10, 0x1f
stw r4, 0xd8(r5)
lwz r5, gx@sda21(r13)
stb r7, 0xCC008000@l(r6)
add r4, r5, r8
lwz r3, 0xb8(r4)
stw r3, -0x8000(r6)
stb r7, -0x8000(r6)
lwz r3, 0xd8(r4)
stw r3, -0x8000(r6)
sth r0, 2(r5)
blr
.global GXSetTexCoordCylWrap
GXSetTexCoordCylWrap:
lwz r0, gx@sda21(r13)
slwi r8, r3, 2
rlwinm r4, r4, 0x11, 7, 0xe
add r7, r0, r8
lwz r6, 0xb8(r7)
li r0, 1
slw r0, r0, r3
rlwinm r6, r6, 0, 0xf, 0xd
or r4, r6, r4
stw r4, 0xb8(r7)
rlwinm r4, r5, 0x11, 7, 0xe
lwz r3, gx@sda21(r13)
add r5, r3, r8
lwz r3, 0xd8(r5)
rlwinm r3, r3, 0, 0xf, 0xd
or r3, r3, r4
stw r3, 0xd8(r5)
lwz r7, gx@sda21(r13)
lwz r3, 0x4dc(r7)
and. r0, r3, r0
beqlr
li r6, 0x61
lis r5, 0xCC008000@ha
stb r6, 0xCC008000@l(r5)
add r4, r7, r8
li r0, 0
lwz r3, 0xb8(r4)
stw r3, -0x8000(r5)
stb r6, -0x8000(r5)
lwz r3, 0xd8(r4)
stw r3, -0x8000(r5)
sth r0, 2(r7)
blr
.global __SetSURegs
__SetSURegs:
lwz r5, gx@sda21(r13)
slwi r0, r4, 2
slwi r9, r3, 2
add r4, r5, r0
add r3, r5, r9
lwz r5, 0x45c(r3)
li r7, 0x61
lwz r3, 0xb8(r4)
lis r6, 0xCC008000@ha
rlwinm r3, r3, 0, 0, 0xf
rlwimi r3, r5, 0, 0x16, 0x1f
stw r3, 0xb8(r4)
li r3, 0
lwz r4, gx@sda21(r13)
add r8, r4, r0
lwz r4, 0xd8(r8)
rlwinm r4, r4, 0, 0, 0xf
rlwimi r4, r5, 0x16, 0x16, 0x1f
stw r4, 0xd8(r8)
lwz r5, gx@sda21(r13)
add r4, r5, r9
lwz r9, 0x47c(r4)
add r10, r5, r0
lwz r5, 0xb8(r10)
rlwinm r4, r9, 0x1e, 0x1e, 0x1f
subfic r8, r4, 1
clrlwi r4, r9, 0x1e
subfic r4, r4, 1
cntlzw r4, r4
rlwinm r5, r5, 0, 0x10, 0xe
rlwinm r4, r4, 0xb, 8, 0xf
or r4, r5, r4
stw r4, 0xb8(r10)
cntlzw r4, r8
rlwinm r4, r4, 0xb, 8, 0xf
lwz r5, gx@sda21(r13)
add r8, r5, r0
lwz r5, 0xd8(r8)
rlwinm r5, r5, 0, 0x10, 0xe
or r4, r5, r4
stw r4, 0xd8(r8)
lwz r5, gx@sda21(r13)
stb r7, 0xCC008000@l(r6)
add r4, r5, r0
lwz r0, 0xb8(r4)
stw r0, -0x8000(r6)
stb r7, -0x8000(r6)
lwz r0, 0xd8(r4)
stw r0, -0x8000(r6)
sth r3, 2(r5)
blr
.global __GXSetSUTexRegs
__GXSetSUTexRegs:
mflr r0
stw r0, 4(r1)
stwu r1, -0x28(r1)
stmw r27, 0x14(r1)
lwz r3, gx@sda21(r13)
lwz r0, 0x4dc(r3)
cmplwi r0, 0xff
beq lbl_800AB0E4
lwz r0, 0x204(r3)
li r31, 0
rlwinm r3, r0, 0x16, 0x1c, 0x1f
addi r30, r3, 1
rlwinm r27, r0, 0x10, 0x1d, 0x1f
b lbl_800AB050
lbl_800AAFB4:
cmpwi r31, 2
beq lbl_800AB004
bge lbl_800AAFD0
cmpwi r31, 0
beq lbl_800AAFDC
bge lbl_800AAFF0
b lbl_800AB028
lbl_800AAFD0:
cmpwi r31, 4
bge lbl_800AB028
b lbl_800AB018
lbl_800AAFDC:
lwz r3, gx@sda21(r13)
lwz r0, 0x120(r3)
clrlwi r29, r0, 0x1d
rlwinm r28, r0, 0x1d, 0x1d, 0x1f
b lbl_800AB028
lbl_800AAFF0:
lwz r3, gx@sda21(r13)
lwz r0, 0x120(r3)
rlwinm r29, r0, 0x1a, 0x1d, 0x1f
rlwinm r28, r0, 0x17, 0x1d, 0x1f
b lbl_800AB028
lbl_800AB004:
lwz r3, gx@sda21(r13)
lwz r0, 0x120(r3)
rlwinm r29, r0, 0x14, 0x1d, 0x1f
rlwinm r28, r0, 0x11, 0x1d, 0x1f
b lbl_800AB028
lbl_800AB018:
lwz r3, gx@sda21(r13)
lwz r0, 0x120(r3)
rlwinm r29, r0, 0xe, 0x1d, 0x1f
rlwinm r28, r0, 0xb, 0x1d, 0x1f
lbl_800AB028:
lwz r3, gx@sda21(r13)
li r0, 1
slw r0, r0, r28
lwz r3, 0x4dc(r3)
and. r0, r3, r0
bne lbl_800AB04C
addi r3, r29, 0
addi r4, r28, 0
bl __SetSURegs
lbl_800AB04C:
addi r31, r31, 1
lbl_800AB050:
cmplw r31, r27
blt lbl_800AAFB4
li r31, 0
addi r27, r31, 0
b lbl_800AB0DC
lbl_800AB064:
lwz r5, gx@sda21(r13)
addi r3, r27, 0x49c
rlwinm r4, r31, 1, 0, 0x1d
lwzx r3, r5, r3
clrlwi. r0, r31, 0x1f
addi r4, r4, 0x100
add r4, r5, r4
rlwinm r29, r3, 0, 0x18, 0x16
beq lbl_800AB094
lwz r0, 0(r4)
rlwinm r28, r0, 0x11, 0x1d, 0x1f
b lbl_800AB09C
lbl_800AB094:
lwz r0, 0(r4)
rlwinm r28, r0, 0x1d, 0x1d, 0x1f
lbl_800AB09C:
cmplwi r29, 0xff
beq lbl_800AB0D4
li r4, 1
lwz r3, 0x4dc(r5)
slw r0, r4, r28
and. r0, r3, r0
bne lbl_800AB0D4
lwz r3, 0x4e0(r5)
slw r0, r4, r31
and. r0, r3, r0
beq lbl_800AB0D4
addi r3, r29, 0
addi r4, r28, 0
bl __SetSURegs
lbl_800AB0D4:
addi r27, r27, 4
addi r31, r31, 1
lbl_800AB0DC:
cmplw r31, r30
blt lbl_800AB064
lbl_800AB0E4:
lmw r27, 0x14(r1)
lwz r0, 0x2c(r1)
addi r1, r1, 0x28
mtlr r0
blr
.global __GXSetTmemConfig
__GXSetTmemConfig:
stwu r1, -0x18(r1)
cmpwi r3, 1
stw r31, 0x14(r1)
stw r30, 0x10(r1)
beq lbl_800AB114
bge lbl_800AB220
b lbl_800AB220
lbl_800AB114:
li r0, 0x61
lis r3, 0xCC008000@ha
lis r4, 0x8C0D8000@ha
stb r0, 0xCC008000@l(r3)
addi r4, r4, 0x8C0D8000@l
stw r4, -0x8000(r3)
lis r4, 0x900DC000@ha
lis r7, 0x8D0D8800@ha
stb r0, -0x8000(r3)
addi r4, r4, 0x900DC000@l
lis r6, 0x910DC800@ha
stw r4, -0x8000(r3)
lis r5, 0x8E0D9000@ha
lis r4, 0x920DD000@ha
stb r0, -0x8000(r3)
addi r7, r7, 0x8D0D8800@l
lis r30, 0x8F0D9800@ha
stw r7, -0x8000(r3)
lis r12, 0x930DD800@ha
lis r11, 0xAC0DA000@ha
stb r0, -0x8000(r3)
addi r6, r6, 0x910DC800@l
lis r10, 0xB00DE000@ha
stw r6, -0x8000(r3)
lis r9, 0xAD0DA800@ha
lis r8, 0xB10DE800@ha
stb r0, -0x8000(r3)
addi r5, r5, 0x8E0D9000@l
lis r7, 0xAE0DB000@ha
stw r5, -0x8000(r3)
lis r6, 0xB20DF000@ha
lis r5, 0xAF0DB800@ha
stb r0, -0x8000(r3)
addi r31, r4, 0x920DD000@l
lis r4, 0xB30DF800@ha
stw r31, -0x8000(r3)
addi r30, r30, 0x8F0D9800@l
addi r12, r12, 0x930DD800@l
stb r0, -0x8000(r3)
addi r11, r11, 0xAC0DA000@l
addi r10, r10, 0xB00DE000@l
stw r30, -0x8000(r3)
addi r9, r9, 0xAD0DA800@l
addi r8, r8, 0xB10DE800@l
stb r0, -0x8000(r3)
addi r7, r7, 0xAE0DB000@l
addi r6, r6, 0xB20DF000@l
stw r12, -0x8000(r3)
addi r5, r5, 0xAF0DB800@l
addi r4, r4, 0xB30DF800@l
stb r0, -0x8000(r3)
stw r11, -0x8000(r3)
stb r0, -0x8000(r3)
stw r10, -0x8000(r3)
stb r0, -0x8000(r3)
stw r9, -0x8000(r3)
stb r0, -0x8000(r3)
stw r8, -0x8000(r3)
stb r0, -0x8000(r3)
stw r7, -0x8000(r3)
stb r0, -0x8000(r3)
stw r6, -0x8000(r3)
stb r0, -0x8000(r3)
stw r5, -0x8000(r3)
stb r0, -0x8000(r3)
stw r4, -0x8000(r3)
b lbl_800AB328
lbl_800AB220:
li r0, 0x61
lis r3, 0xCC008000@ha
lis r4, 0x8C0D8000@ha
stb r0, 0xCC008000@l(r3)
addi r4, r4, 0x8C0D8000@l
stw r4, -0x8000(r3)
lis r4, 0x900DC000@ha
lis r7, 0x8D0D8400@ha
stb r0, -0x8000(r3)
addi r4, r4, 0x900DC000@l
lis r6, 0x910DC400@ha
stw r4, -0x8000(r3)
lis r5, 0x8E0D8800@ha
lis r4, 0x920DC800@ha
stb r0, -0x8000(r3)
addi r7, r7, 0x8D0D8400@l
lis r31, 0x8F0D8C00@ha
stw r7, -0x8000(r3)
lis r12, 0x930DCC00@ha
lis r11, 0xAC0D9000@ha
stb r0, -0x8000(r3)
addi r6, r6, 0x910DC400@l
lis r10, 0xB00DD000@ha
stw r6, -0x8000(r3)
lis r9, 0xAD0D9400@ha
lis r8, 0xB10DD400@ha
stb r0, -0x8000(r3)
addi r5, r5, 0x8E0D8800@l
lis r7, 0xAE0D9800@ha
stw r5, -0x8000(r3)
lis r6, 0xB20DD800@ha
lis r5, 0xAF0D9C00@ha
stb r0, -0x8000(r3)
addi r30, r4, 0x920DC800@l
lis r4, 0xB30DDC00@ha
stw r30, -0x8000(r3)
addi r31, r31, 0x8F0D8C00@l
addi r12, r12, 0x930DCC00@l
stb r0, -0x8000(r3)
addi r11, r11, 0xAC0D9000@l
addi r10, r10, 0xB00DD000@l
stw r31, -0x8000(r3)
addi r9, r9, 0xAD0D9400@l
addi r8, r8, 0xB10DD400@l
stb r0, -0x8000(r3)
addi r7, r7, 0xAE0D9800@l
addi r6, r6, 0xB20DD800@l
stw r12, -0x8000(r3)
addi r5, r5, 0xAF0D9C00@l
addi r4, r4, 0xB30DDC00@l
stb r0, -0x8000(r3)
stw r11, -0x8000(r3)
stb r0, -0x8000(r3)
stw r10, -0x8000(r3)
stb r0, -0x8000(r3)
stw r9, -0x8000(r3)
stb r0, -0x8000(r3)
stw r8, -0x8000(r3)
stb r0, -0x8000(r3)
stw r7, -0x8000(r3)
stb r0, -0x8000(r3)
stw r6, -0x8000(r3)
stb r0, -0x8000(r3)
stw r5, -0x8000(r3)
stb r0, -0x8000(r3)
stw r4, -0x8000(r3)
lbl_800AB328:
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
addi r1, r1, 0x18
blr
.section .data, "wa"
"@92":
.4byte lbl_800AA1FC
.4byte lbl_800AA208
.4byte lbl_800AA208
.4byte lbl_800AA214
.4byte lbl_800AA214
.4byte lbl_800AA214
.4byte lbl_800AA214
.4byte lbl_800AA220
.4byte lbl_800AA1FC
.4byte lbl_800AA208
.4byte lbl_800AA214
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA1FC
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA208
.4byte lbl_800AA220
.4byte lbl_800AA214
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA214
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA1FC
.4byte lbl_800AA220
.4byte lbl_800AA208
.4byte lbl_800AA214
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA208
.4byte lbl_800AA208
.4byte lbl_800AA208
.4byte lbl_800AA208
.4byte lbl_800AA214
.4byte lbl_800AA214
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA1FC
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA220
.4byte lbl_800AA208
.4byte lbl_800AA208
.4byte lbl_800AA220
.4byte lbl_800AA214
"@133":
.4byte lbl_800AA350
.4byte lbl_800AA35C
.4byte lbl_800AA35C
.4byte lbl_800AA368
.4byte lbl_800AA368
.4byte lbl_800AA368
.4byte lbl_800AA368
.4byte lbl_800AA374
.4byte lbl_800AA350
.4byte lbl_800AA35C
.4byte lbl_800AA368
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA350
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA35C
.4byte lbl_800AA374
.4byte lbl_800AA368
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA368
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA350
.4byte lbl_800AA374
.4byte lbl_800AA35C
.4byte lbl_800AA368
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA35C
.4byte lbl_800AA35C
.4byte lbl_800AA35C
.4byte lbl_800AA35C
.4byte lbl_800AA368
.4byte lbl_800AA368
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA350
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA374
.4byte lbl_800AA35C
.4byte lbl_800AA35C
.4byte lbl_800AA374
.4byte lbl_800AA368
"@168":
.4byte lbl_800AA5A0
.4byte lbl_800AA5B4
.4byte lbl_800AA5B4
.4byte lbl_800AA5C8
.4byte lbl_800AA5C8
.4byte lbl_800AA5C8
.4byte lbl_800AA5DC
.4byte lbl_800AA604
.4byte lbl_800AA5A0
.4byte lbl_800AA5B4
.4byte lbl_800AA5C8
.4byte lbl_800AA604
.4byte lbl_800AA604
.4byte lbl_800AA604
.4byte lbl_800AA5F0
.section .sdata, "wa"
GX2HWFiltConv:
.4byte 0x00040105
.4byte 0x02060000
.section .sdata2, "a"
.balign 8
"@164":
.4byte 0x41800000
.4byte 0
"@166":
.4byte 0x43300000
.4byte 0
"@192":
.4byte 0xC0800000
"@193":
.4byte 0x40800000
"@194":
.4byte 0x407F5C29
"@195":
.4byte 0x42000000
"@196":
.4byte 0
"@197":
.4byte 0x41200000