P00 GetTpage
Jump to navigation
Jump to search
# ROUTINE: P00 GetTpage # Parameters: # r4 = VRAM Texture mode # 0x00: 4 bit compressed # 0x01: 8 bit compressed # 0x02: 16 bit (uncompressed) # r5 = Semi Transparency rate # 0x00: 0.5 back + 0x5 forward # 0x01: 1 back + 1 forward # 0x02: 1 back - 1 forward # 0x03: 1 back + 0.25 forward # r6 = texture page address (x) (must be multiple of 0x040) # r7 = texture page address (y) (must be multiple of 0x100) # Returns: # r2 = Tpage ID # if (([? Accessor Result] = 1) or ([? Accessor Result] = 2)) # 0x000f: x pos of tpage # 0x0060: y pos of tpage # 0x0180: semi transparency mode # 0x0600: texture mode # else # 0x000f: x pos of tpage # 0x0010: y pos of tpage (mod 2) # 0x0060: semi transparency mode # 0x0180: texture mode # 0x0800: y pos of tpage (div 2)
0002398c: 27bdffd8 addiu r29,r29,-0x0028 00023990: afb00010 sw r16,0x0010(r29) 00023994: 00808021 addu r16,r4,r0 00023998: afb20018 sw r18,0x0018(r29) 0002399c: 00a09021 addu r18,r5,r0 000239a0: afb3001c sw r19,0x001c(r29) 000239a4: 00c09821 addu r19,r6,r0 000239a8: afb10014 sw r17,0x0014(r29) 000239ac: afbf0020 sw r31,0x0020(r29) 000239b0: 0c00916f jal 0x000245bc # ROUTINE: ? Accessor (0x245bc) 000239b4: 00e08821 addu r17,r7,r0 000239b8: 34030001 ori r3,r0,0x0001 000239bc: 10430006 beq r2,r3,0x000239d8 000239c0: 32030003 andi r3,r16,0x0003 # Texture mode mod 4 # if (([? Accessor Result] != 1) 000239c4: 0c00916f jal 0x000245bc # ROUTINE: ? Accessor (0x245bc) (Call #2) 000239c8: 00000000 nop 000239cc: 34030002 ori r3,r0,0x0002 000239d0: 1443000b bne r2,r3,0x00023a00 # AND ([? Accessor Result (#2)] == 2)) 000239d4: 32030003 andi r3,r16,0x0003 # (texture mode) # { 000239d8: 00031a40 sll r3,r3,0x09 # texture mode << 9 000239dc: 32420003 andi r2,r18,0x0003 # semi transparency 000239e0: 000211c0 sll r2,r2,0x07 # semi transparency << 7 000239e4: 00621825 or r3,r3,r2 # (texture mode << 9) | (semi transparency << 7) 000239e8: 32220300 andi r2,r17,0x0300 # tpage y & 0x0300 // for a multiple of 0x100, this limits it to 3 values 000239ec: 000210c3 sra r2,r2,0x03 # tpage y >> 3 // absolute y value << 5 000239f0: 00621825 or r3,r3,r2 # leftValue = (tmode << 9) | (ABEMode << 7)) | (AbsY << 5) 000239f4: 326203ff andi r2,r19,0x03ff # tpage x 000239f8: 08008e8c j 0x00023a30 000239fc: 00021183 sra r2,r2,0x06 # rightValue = (tpage x) >> 6 // absolute x value << 0 # } else { 00023a00: 000319c0 sll r3,r3,0x07 # texture mode << 7 00023a04: 32420003 andi r2,r18,0x0003 # semi transparency 00023a08: 00021140 sll r2,r2,0x05 # ABE mode << 5 00023a0c: 00621825 or r3,r3,r2 # (Tmode << 7) | (ABEMode << 5) 00023a10: 32220100 andi r2,r17,0x0100 # tpage y & 0x100 // limited to a very small VRAM size here. 00023a14: 00021103 sra r2,r2,0x04 # tpage y >> 4 // absy << 4 00023a18: 00621825 or r3,r3,r2 # (tmode << 7) | (ABEmode << 5) | (absy << 4) 00023a1c: 326203ff andi r2,r19,0x03ff # tpage x 00023a20: 00021183 sra r2,r2,0x06 # tpage x >> 6 // absx << 0 00023a24: 00621825 or r3,r3,r2 # leftValue = (tmode << 7) | (ABEmode << 5) | (absy << 4) | (absx) 00023a28: 32220200 andi r2,r17,0x0200 # tpage y & 0x200 00023a2c: 00021080 sll r2,r2,0x02 # rightValue = tpage y << 2 # } 00023a30: 00621025 or r2,r3,r2 # RETURN halfword (Tpage ID) 00023a34: 8fbf0020 lw r31,0x0020(r29) 00023a38: 8fb3001c lw r19,0x001c(r29) 00023a3c: 8fb20018 lw r18,0x0018(r29) 00023a40: 8fb10014 lw r17,0x0014(r29) 00023a44: 8fb00010 lw r16,0x0010(r29) 00023a48: 27bd0028 addiu r29,r29,0x0028 00023a4c: 03e00008 jr r31 00023a50: 00000000 nop
Return Atlas
Requests Frame.bin (Tpage 0x1f, x = 0x3c0, y = 0x100) 0x001170f8: 001170b4 - 00117128 (0, 2, 0x3c0, 0x100) 0x00117114: 001170b4 - 00117128 (0, 1, 0x3c0, 0x100) 0x001c79b8: 001c7944 - 001c7a04 (0, 2, 0x3c0, 0x100) 0x001c767c: 001c755c - 001c771c (0, 2, 0x3c0, 0x100) 0x001c769c: 001c755c - 001c771c (0, 1, 0x3c0, 0x100) 0x0012e43c: 0012e348 - 0012e598 (0, 2, 0x3c0, 0x100) 0x0012e518: 0012e348 - 0012e598 (0, 0, 0x3c0, 0x100) 0x000e263c: 000e2548 - 000e2798 (0, 2, 0x3c0, 0x100) 0x000e2718: 000e2548 - 000e2798 (0, 0, 0x3c0, 0x100) 0x001181ec: 0011814c - 00118228 (0, 2, 0x3c0, 0x100) 0x000ef6fc: 000ef680 - 000ef784 (0, 1, 0x3c0, 0x100) 0x0013bae4: 0013ba68 - 0013bb6c (0, 1, 0x3c0, 0x100) 0x0012f2b4: 0012f10c - 0012f35c (0, 0, 0x3c0, 0x100) 0x0012f2e8: 0012f10c - 0012f35c (0, 2, 0x3c0, 0x100) 0x000e3500: 000e3358 - 000e35a8 (0, 0, 0x3c0, 0x100) 0x000e3534: 000e3358 - 000e35a8 (0, 2, 0x3c0, 0x100) 0x000e902c: 000e8fb8 - 000e90e0 (0, 2, 0x3c0, 0x100)
Requests current event portrait (8) (Tpage = 0x1e, x = 0x380, y = 0x100) 0x00136c4c: 00136bd0 - 00136d30 (0, 0, 0x380, 0x100) Requests Item.bin (Tpage = 0x1e, x = 0x380, y = 0x120) 0x00136c94: 00136bd0 - 00136d30 (0, 0, 0x380, 0x120) 0x001128c8: 00112878 - 001128dc (0, 0, 0x380, 0x120) 0x001c3be8: 001c3b98 - 001c3bfc (0, 0, 0x380, 0x120) 0x001c2294: 001c2244 - 001c22a8 (0, 0, 0x380, 0x120) 0x001c1f08: 001c1eb8 - 001c1f1c (0, 0, 0x380, 0x120) 0x001c23f4: DEBUGCHR.OUT/001c23a4 - 001cd408 (0, 0, 0x380, 0x120) 0x0014a774: 0014a6e4 - 0014a7a4 (0, 0, 0x380, 0x120) 0x000fdc30: 000fdba0 - 000fdc60 (0. 0, 0x380, 0x120) Requests current event portraits (0-7) (Tpage = 0x1d, x = 0x340, y = 0x100) 0x00136cb8: 00136bd0 - 00136d30 (0, 0, 0x340, 0x100) Requests wldfce.bin (3) (Tpage 0x1d, x = 0x340, y = 0x100) 0x0012e530: 0012e348 - 0012e598 (0, 0, 0x340, 0x100) (could request current event portaits... unsure condition for trigger) 0x000e2730: 000e2548 - 000e2798 (0, 0, 0x240, 0x100) Requests Unit.bin (2) (Tpage 0x5, x = 0x140, y=0x000) 0x001c7998: 001c7944 - 001c7a04 (0, 0, 0x140, 0x000) Requests Unit.bin (1) (Tpage 0x4, x = 0x100, y = 0x000) 0x00127b60: 00127b3c - 00127ba0 (0, var, 0x100, 0x000) 0x0012d540: 0012d4c0 - 0012d5b8 (0, 2, 0x100, 0x000) 0x001c8ca0: 001c8c08 - 001c8cec (0, 0, 0x100, 0x000) 0x0012d650: 0012d5bc - 0012d6c8 (0, 2, 0x100, 0x000) 0x001c535c: 001c52c4 - 001c53a8 (0, 0, 0x100, 0x000) Requests Constructed Text/Menu box (2) (Tpage 0x7, x = 0x100, y = 0x000) 0x000e2424: 000e2390 - 000e2440 (0, 0, 0x1c0, 0x000) 0x0012e224: 0012e190 - 0012e240 (0, 0, 0x1c0, 0x000) Request ambiguous (tpage unknown) 0x00127afc: 00127ad0 - 00127b20 (var, var, var, var) 0x000fdca4: 000fdc64 - 000fdcd4 (0, 0, var, var) 0x0014a7e8: 0014a7a8 - 0014a818 (0, 0, var, var) 0x00022cec: E00 LoadTpage (var, var, var, var)