Sprite changing stuff
Jump to navigation
Jump to search
00083570: 27bdffd8 addiu r29,r29,0xffd8 00083574: afb00010 sw r16,0x0010(r29) 00083578: 00808021 addu r16,r4,r0 0008357c: afbf0020 sw r31,0x0020(r29) 00083580: afb3001c sw r19,0x001c(r29) 00083584: afb20018 sw r18,0x0018(r29) 00083588: afb10014 sw r17,0x0014(r29) 0008358c: 8e030144 lw r3,0x0144(r16) 00083590: 00000000 nop 00083594: 3062000f andi r2,r3,0x000f 00083598: 10400039 beq r2,r0,0x00083680 branch if not changing sprite 0008359c: 00a09821 addu r19,r5,r0 000835a0: 30620001 andi r2,r3,0x0001 000835a4: 10400008 beq r2,r0,0x000835c8 branch if not crystalising 000835a8: 34040009 ori r4,r0,0x0009 000835ac: 3412009b ori r18,r0,0x009b 000835b0: 02003021 addu r6,r16,r0 000835b4: 86050070 lh r5,0x0070(r16) load facing 000835b8: 34020060 ori r2,r0,0x0060 000835bc: a602007a sh r2,0x007a(r16) If crystalising, set graphic Y offset to 0x60 pixels 000835c0: 08020d7a j 0x000835e8 000835c4: 34020001 ori r2,r0,0x0001 set only crystal status 000835c8: 30620008 andi r2,r3,0x0008 000835cc: 1040000b beq r2,r0,0x000835fc branch if not treasurizing 000835d0: 34040015 ori r4,r0,0x0015 000835d4: 3412009e ori r18,r0,0x009e 000835d8: 02003021 addu r6,r16,r0 000835dc: 86050070 lh r5,0x0070(r16) 000835e0: 34020008 ori r2,r0,0x0008 000835e4: a600007a sh r0,0x007a(r16) If treasurising, don't set any graphic offset (unique pair of animations; not required) 000835e8: ae020144 sw r2,0x0144(r16) 000835ec: 0c02065e jal 0x00081978 000835f0: ae000140 sw r0,0x0140(r16) 000835f4: 08020d89 j 0x00083624 000835f8: 00000000 nop 000835fc: 30620002 andi r2,r3,0x0002 00083600: 10400004 beq r2,r0,0x00083614 branch if not chicken/crystal removal 00083604: 30620004 andi r2,r3,0x0004 00083608: 3412009c ori r18,r0,0x009c 0008360c: 08020d89 j 0x00083624 00083610: a600007a sh r0,0x007a(r16) If removing chicken/crystal/frog, remove graphic Y offset 00083614: 10400003 beq r2,r0,0x00083624 branch if not frog 00083618: 34020030 ori r2,r0,0x0030 0008361c: 3412009d ori r18,r0,0x009d 00083620: a602007a sh r2,0x007a(r16) if being frogged, set graphic offset to 0x30 pixels. 00083624: 92020006 lbu r2,0x0006(r16) 00083628: 3251ffff andi r17,r18,0xffff 0008362c: 10510042 beq r2,r17,0x00083738 jump to end if spritesheet ID = -1 (invalid) 00083630: 2c42009b sltiu r2,r2,0x009b 00083634: 10400005 beq r2,r0,0x0008364c branch if spritesheet ID is less than crystal (any legal spritesheet) 00083638: 00000000 nop 0008363c: 8e0201f4 lw r2,0x01f4(r16) 00083640: 8e0301f8 lw r3,0x01f8(r16) 00083644: ae0201fc sw r2,0x01fc(r16) 00083648: ae030200 sw r3,0x0200(r16) Else, store the unit's current spritesheet's SHP/SEQ pointer here and here. 0008364c: 0c02066a jal 0x000819a8 Get some Spritesheet data address 00083650: 02202021 addu r4,r17,r0 00083654: 02202021 addu r4,r17,r0 00083658: 0c020682 jal 0x00081a08 00081a08 - 00081a54 0008365c: ae0201f4 sw r2,0x01f4(r16) 00083660: 02002021 addu r4,r16,r0 00083664: 02602821 addu r5,r19,r0 00083668: 34060001 ori r6,r0,0x0001 0008366c: ae0201f8 sw r2,0x01f8(r16) 00083670: 0c020755 jal 0x00081d54 Weather/time of day/tile palette modification 00083674: a2120006 sb r18,0x0006(r16) 00083678: 08020dc7 j 0x0008371c 0008367c: 00000000 nop 00083680: 92030005 lbu r3,0x0005(r16) 00083684: 92040006 lbu r4,0x0006(r16) load spritesheet ID 00083688: 00031100 sll r2,r3,0x04 0008368c: 00431023 subu r2,r2,r3 00083690: 00021100 sll r2,r2,0x04 00083694: 00431021 addu r2,r2,r3 00083698: 00021880 sll r3,r2,0x02 0008369c: 00621823 subu r3,r3,r2 000836a0: 000310c0 sll r2,r3,0x03 000836a4: 00621821 addu r3,r3,r2 000836a8: 00031840 sll r3,r3,0x01 000836ac: 3c01800c lui r1,0x800c 000836b0: 00230821 addu r1,r1,r3 000836b4: 90227ce9 lbu r2,0x7ce9(r1) load current status' spritesheet ID 000836b8: 00000000 nop 000836bc: 1082001e beq r4,r2,0x00083738 if not changing status, end. 000836c0: 02002021 addu r4,r16,r0 000836c4: 92030005 lbu r3,0x0005(r16) load ?? 000836c8: 02602821 addu r5,r19,r0 000836cc: a600007a sh r0,0x007a(r16) remove graphic Y offset if changing spritesheet. 000836d0: 00031100 sll r2,r3,0x04 000836d4: 00431023 subu r2,r2,r3 000836d8: 00021100 sll r2,r2,0x04 000836dc: 00431021 addu r2,r2,r3 000836e0: 00021880 sll r3,r2,0x02 000836e4: 00621823 subu r3,r3,r2 000836e8: 000310c0 sll r2,r3,0x03 000836ec: 00621821 addu r3,r3,r2 000836f0: 00031840 sll r3,r3,0x01 000836f4: 3c01800c lui r1,0x800c 000836f8: 00230821 addu r1,r1,r3 000836fc: 90277ce9 lbu r7,0x7ce9(r1) current status' spritesheet IDs (for crystal/chicken/frog/treasure) 00083700: 8e0201fc lw r2,0x01fc(r16) 00083704: 8e030200 lw r3,0x0200(r16) 00083708: 34060001 ori r6,r0,0x0001 0008370c: ae0201f4 sw r2,0x01f4(r16) 00083710: ae0301f8 sw r3,0x01f8(r16) 00083714: 0c02091a jal 0x00082468 00082468 - 00082504 00083718: a2070006 sb r7,0x0006(r16) store spritesheet ID 0008371c: 0c020bbb jal 0x00082eec Set Animation Based On Unit Status 00083720: 02002021 addu r4,r16,r0 00083724: 02002021 addu r4,r16,r0 00083728: 948601e0 lhu r6,0x01e0(r4) 0008372c: 948701dc lhu r7,0x01dc(r4) 00083730: 0c021085 jal 0x00084214 Trap & Unit graphic information loading 00083734: 248501d8 addiu r5,r4,0x01d8 00083738: 8fbf0020 lw r31,0x0020(r29) 0008373c: 8fb3001c lw r19,0x001c(r29) 00083740: 8fb20018 lw r18,0x0018(r29) 00083744: 8fb10014 lw r17,0x0014(r29) 00083748: 8fb00010 lw r16,0x0010(r29) 0008374c: 27bd0028 addiu r29,r29,0x0028 00083750: 03e00008 jr r31 00083754: 00000000 nop