Effect Stage Processing
Jump to navigation
Jump to search
801a18d8: 3c04801b lui r4,0x801b 801a18dc: 8c8463e8 lw r4,0x63e8(r4) # effect running state 801a18e0: 27bdffe0 addiu r29,r29,-0x0020 801a18e4: afb00010 sw r16,0x0010(r29) 801a18e8: 3c10801c lui r16,0x801c 801a18ec: 8610bf90 lh r16,-0x4070(r16) # blockID = *0x801bbf90 801a18f0: afbf001c sw r31,0x001c(r29) 801a18f4: afb20018 sw r18,0x0018(r29) 801a18f8: 2c820007 sltiu r2,r4,0x0007 801a18fc: 104000c8 beq r2,r0,0x801a1c20 # if (*0x801b63e8 >= 7) return an unpredictable value (uninitialized GPR $v1) 801a1900: afb10014 sw r17,0x0014(r29) 801a1904: 00041080 sll r2,r4,0x02 # *0x801b63e8 * 4 801a1908: 3c01801a lui r1,0x801a 801a190c: 00220821 addu r1,r1,r2 801a1910: 8c220dc4 lw r2,0x0dc4(r1) # [Code pointer] = *0x801a0dc4 + (*0x801b63e8 * 4) 801a1914: 00000000 nop 801a1918: 00400008 jr r2 # Jump to [Code pointer] - see switch statement below 801a191c: 00000000 nop # [*0x801b63e8] [RAM Address] [Code pointer] # 0 801a0dc4 801a1bb8 Effect not running # 1 801a0dc8 801a195c Effect To be initialised # 2 801a0dcc 801a1920 Initialisation step 1 # 3 801a0dd0 801a1964 Initialisation step 2 # 4 801a0dd4 801a1ab0 playing effect # 5 801a0dd8 801a1c20 error case # 6 801a0ddc 801a1bc0 Finishing effect # if (*0x801b63e8 == 5) return an unpredictable value (uninitialized GPR $v1) # switch (*0x801b63e8) {
Initialisation step 1
801a1920: 0c024c46 jal 0x80093118 # 0x93118 (); 801a1924: 00000000 nop 801a1928: 0c04d0ef jal 0x801343bc # 0x1343bc (); 801a192c: 00000000 nop 801a1930: 3c04801c lui r4,0x801c 801a1934: 848424d0 lh r4,0x24d0(r4) # effectID = *0x801c24d0 801a1938: 0c0683a0 jal 0x801a0e80 # Effect Palette Setup (effectID); // Sets palette pointer 801a193c: 00000000 nop 801a1940: 34020003 ori r2,r0,0x0003 # 3 801a1944: 3c01801b lui r1,0x801b 801a1948: ac2263e8 sw r2,0x63e8(r1) # *0x801b63e8 = 3 801a194c: 3c01801c lui r1,0x801c 801a1950: a420f000 sh r0,-0x1000(r1) # *0x801bf000 = 0 801a1954: 0c0237a4 jal 0x8008de90 # 0x8de90 (); 801a1958: 00000000 nop
Effect to be initialised
801a195c: 08068708 j 0x801a1c20 # return 1; 801a1960: 34030001 ori r3,r0,0x0001
Initialise palette data?
801a1964: 3c04801c lui r4,0x801c 801a1968: 8c84bf80 lw r4,-0x4080(r4) # *0x801bbf80 801a196c: 3c058001 lui r5,0x8001 801a1970: 8ca5000c lw r5,0x000c(r5) # *0x8001000c 801a1974: 0c069367 jal 0x801a4d9c # 0x14ad9c (*0x801bbf80, *0x8001000c - *0x801bbf80); 801a1978: 00a42823 subu r5,r5,r4 # *0x8001000c - *0x801bbf80 801a197c: 0c06aa3a jal 0x801aa8e8 # 0x1aa8e8 (); 801a1980: 00000000 nop 801a1984: 0c06aa48 jal 0x801aa920 # 0x1aa920 (); 801a1988: 00000000 nop 801a198c: 0c0238d2 jal 0x8008e348 # 0x8e348 (); 801a1990: 00000000 nop 801a1994: 3c04801c lui r4,0x801c 801a1998: 848424d0 lh r4,0x24d0(r4) # effectID = *0x801c24d0 801a199c: 0c0683e8 jal 0x801a0fa0 # Set Effect Frame Data Pointer (effectID); 801a19a0: 00000000 nop 801a19a4: 3c04801c lui r4,0x801c 801a19a8: 848424d0 lh r4,0x24d0(r4) # effectID 801a19ac: 0c0683f6 jal 0x801a0fd8 # 0x1a0fd8 (effectID); 801a19b0: 00000000 nop 801a19b4: 3c04801c lui r4,0x801c 801a19b8: 848424d0 lh r4,0x24d0(r4) # effectID 801a19bc: 0c068404 jal 0x801a1010 # Store Effect Script Pointer (effectID); 801a19c0: 00000000 nop 801a19c4: 3c04801c lui r4,0x801c 801a19c8: 848424d0 lh r4,0x24d0(r4) # effectID 801a19cc: 0c068411 jal 0x801a1044 # 0x1a1044 (effectID); 801a19d0: 00000000 nop 801a19d4: 3c04801c lui r4,0x801c 801a19d8: 848424d0 lh r4,0x24d0(r4) # effectID 801a19dc: 0c06841e jal 0x801a1078 # 0x1a1078 (effectID); 801a19e0: 00000000 nop 801a19e4: 3c04801c lui r4,0x801c 801a19e8: 848424d0 lh r4,0x24d0(r4) # effectID 801a19ec: 0c06842b jal 0x801a10ac # 0x1a10ac (effectID); 801a19f0: 00000000 nop 801a19f4: 3c04801c lui r4,0x801c 801a19f8: 848424d0 lh r4,0x24d0(r4) # effectID 801a19fc: 0c06843b jal 0x801a10ec # 0x1a10ec (effectID); 801a1a00: 00000000 nop 801a1a04: 3c04801c lui r4,0x801c 801a1a08: 848424d0 lh r4,0x24d0(r4) # effectID 801a1a0c: 0c068466 jal 0x801a1198 # 0x1a1198 (effectID); 801a1a10: 00000000 nop 801a1a14: 3c04801c lui r4,0x801c 801a1a18: 848424d0 lh r4,0x24d0(r4) # effectID 801a1a1c: 0c068473 jal 0x801a11cc # 0x1a11cc (effectID); 801a1a20: 00000000 nop 801a1a24: 3c02801c lui r2,0x801c 801a1a28: 9042ad0f lbu r2,-0x52f1(r2) # *0x801bad0f 801a1a2c: 00000000 nop 801a1a30: 10400012 beq r2,r0,0x801a1a7c 801a1a34: 00002821 addu r5,r0,r0 # 0 # if (*0x801bad0f != 0) { 801a1a38: 3c04801c lui r4,0x801c 801a1a3c: 8c84acc8 lw r4,-0x5338(r4) # *0x801bacc8 801a1a40: 00000000 nop 801a1a44: 90820004 lbu r2,0x0004(r4) # *(*0x801bacc8 + 4) 801a1a48: 00000000 nop 801a1a4c: 10400006 beq r2,r0,0x801a1a68 801a1a50: 34020064 ori r2,r0,0x0064 # 100 # if (*(*0x801bacc8 + 4) != 0) { 801a1a54: 3c03801c lui r3,0x801c 801a1a58: 8c63c0c8 lw r3,-0x3f38(r3) # *0x801bc0c8 801a1a5c: 90820004 lbu r2,0x0004(r4) # *(*0x801bacc8 + 4) 801a1a60: 0806869f j 0x801a1a7c 801a1a64: a4620006 sh r2,0x0006(r3) # *(*0x801bc0c8 + 6) = *(*0x801bacc8 + 4) # } else { 801a1a68: 3c03801c lui r3,0x801c 801a1a6c: 8c63c0c8 lw r3,-0x3f38(r3) # *0x801bc0c8 801a1a70: 00000000 nop 801a1a74: a4620006 sh r2,0x0006(r3) # *(*0x801bc0c8 + 6) = 100 801a1a78: 00002821 addu r5,r0,r0 # 0 # } # } 801a1a7c: 3c04801c lui r4,0x801c 801a1a80: 8c84c094 lw r4,-0x3f6c(r4) # ptr. to current effect's code scripts 801a1a84: 0c06883a jal 0x801a20e8 # result_0x1a20e8 = Effect Related (0x1a20e8) (*0x801bc094, 0, 0); // initialises some temporary effect data? 801a1a88: 00003021 addu r6,r0,r0 # 0 801a1a8c: 3c01801c lui r1,0x801c 801a1a90: a42224d4 sh r2,0x24d4(r1) # *0x801c24d4 = result_0x1a20e8 801a1a94: 34020004 ori r2,r0,0x0004 # 4 801a1a98: 3c01801b lui r1,0x801b 801a1a9c: ac2263e8 sw r2,0x63e8(r1) # Increment effect phase to 4 801a1aa0: 0c03bda8 jal 0x800ef6a0 # 0xef6a0 (0x88); 801a1aa4: 34040088 ori r4,r0,0x0088 # 0x88 801a1aa8: 08068708 j 0x801a1c20 # return 1; 801a1aac: 34030001 ori r3,r0,0x0001
Playing effect
801a1ab0: 0c011298 jal 0x80044a60 # result_0x44a60 = 0x44a60 (); 801a1ab4: 00000000 nop 801a1ab8: 3c01801c lui r1,0x801c 801a1abc: ac22c088 sw r2,-0x3f78(r1) # *0x801bc088 = result_0x44a60 801a1ac0: 0c0694bc jal 0x801a52f0 # 0x1a52f0 (); 801a1ac4: 00000000 nop 801a1ac8: 12000019 beq r16,r0,0x801a1b30 801a1acc: 00101140 sll r2,r16,0x05 # blockID * 32 # if (blockID != 0) { 801a1ad0: 3c12801c lui r18,0x801c 801a1ad4: 2652f02c addiu r18,r18,-0x0fd4 # 0x801bf02c # do { 801a1ad8: 00501023 subu r2,r2,r16 # blockID * 31 801a1adc: 000210c0 sll r2,r2,0x03 # blockID * 248 801a1ae0: 02002021 addu r4,r16,r0 # blockID 801a1ae4: 3c01801c lui r1,0x801c 801a1ae8: 00220821 addu r1,r1,r2 801a1aec: 9423f04c lhu r3,-0x0fb4(r1) # *(0x801bf04c + (blockID * 248)) 801a1af0: 3c01801c lui r1,0x801c 801a1af4: 00220821 addu r1,r1,r2 801a1af8: 8431f02c lh r17,-0x0fd4(r1) # *(0x801bf02c + (blockID * 248)) 801a1afc: 00521021 addu r2,r2,r18 # (blockID * 248) + 0x801bf02c 801a1b00: 3c01801c lui r1,0x801c 801a1b04: a430f004 sh r16,-0x0ffc(r1) # *0x801bf004 = blockID 801a1b08: 24630001 addiu r3,r3,0x0001 # *(0x801bf04c + (blockID * 248)) + 1 801a1b0c: 0c06933c jal 0x801a4cf0 # execute_result = Run Effect Block (blockID); 801a1b10: a4430020 sh r3,0x0020(r2) # *((blockID * 248) + 0x801bf02c + 32) = *(0x801bf04c + (blockID * 248)) + 1 801a1b14: 14400003 bne r2,r0,0x801a1b24 # if (execute_result == 0) { 801a1b18: 00000000 nop 801a1b1c: 0c068767 jal 0x801a1d9c # Effect Related (0x1a1d9c) (blockID); // (Resolve effect command / command block?) (Effect doesn't resolve properly if removed) 801a1b20: 02002021 addu r4,r16,r0 # blockID # } 801a1b24: 02208021 addu r16,r17,r0 # blockID = *(0x801bf02c + (blockID * 248)) 801a1b28: 1600ffeb bne r16,r0,0x801a1ad8 801a1b2c: 00101140 sll r2,r16,0x05 # blockID * 32 # } while (blockID != 0); # } 801a1b30: 3c02801c lui r2,0x801c 801a1b34: 8442bf90 lh r2,-0x4070(r2) # is effect playing? 801a1b38: 00000000 nop 801a1b3c: 14400038 bne r2,r0,0x801a1c20 # branch if effect is running 801a1b40: 34030001 ori r3,r0,0x0001 # return 1
Effect playing; effect not running
801a1b44: 3c02801c lui r2,0x801c 801a1b48: 8c42acc8 lw r2,-0x5338(r2) # *0x801bacc8 801a1b4c: 00000000 nop 801a1b50: 8c420000 lw r2,0x0000(r2) # *(*0x801bacc8) 801a1b54: 00000000 nop 801a1b58: 30420010 andi r2,r2,0x0010 # *(*0x801bacc8) & 0x10 801a1b5c: 10400003 beq r2,r0,0x801a1b6c # if ((*(*0x801bacc8) & 0x10) != 0) { 801a1b60: 00000000 nop 801a1b64: 0c010ee8 jal 0x80043ba0 # 0x43ba0 (0x78); 801a1b68: 34040078 ori r4,r0,0x0078 # } 801a1b6c: 3c04801c lui r4,0x801c 801a1b70: 8c84bf74 lw r4,-0x408c(r4) # *0x801bbf74 801a1b74: 00000000 nop 801a1b78: 10800005 beq r4,r0,0x801a1b90 # if (*0x801bbf74 != 0) { 801a1b7c: 00000000 nop 801a1b80: 0c005fae jal 0x80017eb8 # 0x17eb8 (); 801a1b84: 00000000 nop 801a1b88: 3c01801c lui r1,0x801c 801a1b8c: ac20bf74 sw r0,-0x408c(r1) # *0x801bbf74 = 0 # } 801a1b90: 0c03bda8 jal 0x800ef6a0 # 0xef6a0 (0x87); 801a1b94: 34040087 ori r4,r0,0x0087 801a1b98: 0c024c51 jal 0x80093144 # 0x93144 (); 801a1b9c: 00000000 nop 801a1ba0: 0c04d0f4 jal 0x801343d0 # 0x1343d0 (); 801a1ba4: 00000000 nop 801a1ba8: 0c0238d2 jal 0x8008e348 # 0x8e348 (); 801a1bac: 00000000 nop 801a1bb0: 3c01801b lui r1,0x801b 801a1bb4: ac2063e8 sw r0,0x63e8(r1) # effect phase = no effect playing?
No Effect playing
801a1bb8: 08068708 j 0x801a1c20 # return 0; 801a1bbc: 00001821 addu r3,r0,r0
Finishing Effect
801a1bc0: 3c04801c lui r4,0x801c 801a1bc4: 8c84bf80 lw r4,-0x4080(r4) # *0x801bbf80 801a1bc8: 3c058001 lui r5,0x8001 801a1bcc: 8ca5000c lw r5,0x000c(r5) # *0x8001000c 801a1bd0: 0c069367 jal 0x801a4d9c # 0x1a4d9c (*0x801bbf80, *0x8001000c - *0x801bbf80); 801a1bd4: 00a42823 subu r5,r5,r4 # *0x8001000c - *0x801bbf80 801a1bd8: 0c06aa3a jal 0x801aa8e8 # 0x1aa8e8 (); 801a1bdc: 00000000 nop 801a1be0: 0c0683dc jal 0x801a0f70 # 0x1a0f70 (); 801a1be4: 00000000 nop 801a1be8: 0c0683e2 jal 0x801a0f88 # 0x1a0f88 (); 801a1bec: 00000000 nop 801a1bf0: 00002821 addu r5,r0,r0 # 0 801a1bf4: 3c04801c lui r4,0x801c 801a1bf8: 8c84c094 lw r4,-0x3f6c(r4) # *0x801bc094 801a1bfc: 0c06883a jal 0x801a20e8 # result_1a20e8 = 0x1a20e8 (*0x801bc094, 0, 0); // clears effect data? 801a1c00: 00003021 addu r6,r0,r0 # 0 801a1c04: 3c01801c lui r1,0x801c 801a1c08: a42224d4 sh r2,0x24d4(r1) # stores old 'is effect running?' flag? 801a1c0c: 34030004 ori r3,r0,0x0004 # 4 801a1c10: 3c01801b lui r1,0x801b 801a1c14: ac2363e8 sw r3,0x63e8(r1) # Effect phase = playing (swaps between playing and finishing> 801a1c18: 08068709 j 0x801a1c24 # return 1; 801a1c1c: 34020001 ori r2,r0,0x0001 # } 801a1c20: 00601021 addu r2,r3,r0 801a1c24: 8fbf001c lw r31,0x001c(r29) 801a1c28: 8fb20018 lw r18,0x0018(r29) 801a1c2c: 8fb10014 lw r17,0x0014(r29) 801a1c30: 8fb00010 lw r16,0x0010(r29) 801a1c34: 27bd0020 addiu r29,r29,0x0020 801a1c38: 03e00008 jr r31 801a1c3c: 00000000 nop