Get Item Graphic Data
Jump to navigation
Jump to search
00136b10: 27bdffe8 addiu r29,r29,0xffe8 00136b14: afb00010 sw r16,0x0010(r29) 00136b18: 00808021 addu r16,r4,r0 r16 = r4 00136b1c: afbf0014 sw r31,0x0014(r29) 00136b20: 0c016a21 jal 0x0005a884 Get Item Data Pointer 00136b24: 00a02021 addu r4,r5,r0 r4 = Item ID 00136b28: 3c038888 lui r3,0x8888 00136b2c: 90440001 lbu r4,0x0001(r2) Load Item Sprite ID 00136b30: 34638889 ori r3,r3,0x8889 (or, y'know ID * 0x11111111. save a few steps) 00136b34: 00830018 mult r4,r3 ID * -0.53333333 00136b38: 90460000 lbu r6,0x0000(r2) Load Palette 00136b3c: 00041fc3 sra r3,r4,0x1f 00136b40: 00001010 mfhi r2 r2 = ID * -0.53333333 00136b44: 00441021 addu r2,r2,r4 ID * 0.53333333 (ID * 8/15) 00136b48: 000210c3 sra r2,r2,0x03 (ID * 0.53333333) / 8 or ID / 15 00136b4c: 00431023 subu r2,r2,r3 00136b50: 00401821 addu r3,r2,r0 r3 = ID / 15 00136b54: 00031100 sll r2,r3,0x04 ID / 15 * 16 00136b58: 00431023 subu r2,r2,r3 ID / 15 * 15 00136b5c: 00821023 subu r2,r4,r2 r2 = ID MOD 15 00136b60: 00021100 sll r2,r2,0x04 (ID MOD 15) * 16 00136b64: 00031900 sll r3,r3,0x04 ID / 15 * 16 00136b68: 24630020 addiu r3,r3,0x0020 ID / 15 * 16 + 0x20 00136b6c: a202000c sb r2,0x000c(r16) Store Item Graphic X Load Location = (ID MOD 15) * 16 00136b70: a203000d sb r3,0x000d(r16) Store Item Graphic Y Load Location = ID / 15 * 16 + 0x20 00136b74: 3c048016 lui r4,0x8016 00136b78: 84845eb4 lh r4,0x5eb4(r4) Load ? 00136b7c: 04c10002 bgez r6,0x00136b88 Branch if Palette >= 0 00136b80: 00c02821 addu r5,r6,r0 r5 = Palette 00136b84: 24c50007 addiu r5,r6,0x0007 00136b88: 000518c3 sra r3,r5,0x03 Palette / 8 00136b8c: 000310c0 sll r2,r3,0x03 Palette / 8 * 8 00136b90: 00c21023 subu r2,r6,r2 Palette MOD 8 00136b94: 00021100 sll r2,r2,0x04 Palette Mod = (Palette MOD 8) * 16 00136b98: 00822021 addu r4,r4,r2 ? + Palette Mod 00136b9c: 3c058016 lui r5,0x8016 00136ba0: 84a55eb6 lh r5,0x5eb6(r5) Load ?2 00136ba4: 0c008e95 jal 0x00023a54 00023a54 - 00023a68 ((r5 * 64) OR ((r4 / 16) AND 0x3f)) 00136ba8: 00a32821 addu r5,r5,r3 r5 = ?2 + Palette / 8 00136bac: a602000e sh r2,0x000e(r16) Store ? 00136bb0: 34020010 ori r2,r0,0x0010 00136bb4: a6020010 sh r2,0x0010(r16) Store Graphic Width = 0x10 00136bb8: a6020012 sh r2,0x0012(r16) Store Graphic Height = 0x10 00136bbc: 8fbf0014 lw r31,0x0014(r29) 00136bc0: 8fb00010 lw r16,0x0010(r29) 00136bc4: 27bd0018 addiu r29,r29,0x0018 00136bc8: 03e00008 jr r31 00136bcc: 00000000 nop