Process Secondary Effect Data
Revision as of 06:13, 29 November 2022 by Talcall (talk | contribs) (Talcall moved page Effect Related (0x1b47e0) to Process Secondary Effect Data)
801b47e0: 27bdffe0 addiu r29,r29,-0x0020 801b47e4: afbf001c sw r31,0x001c(r29) 801b47e8: afb20018 sw r18,0x0018(r29) 801b47ec: afb10014 sw r17,0x0014(r29) 801b47f0: 0c011298 jal 0x80044a60 # Find Address for Polygons by Depth (); 801b47f4: afb00010 sw r16,0x0010(r29) 801b47f8: 3c01801c lui r1,0x801c 801b47fc: ac22c0cc sw r2,-0x3f34(r1) # *0x801bc0cc = result_0x44a60 //returns pointer to addresses for polygons; organized by camera depth to render in order. 801b4800: 34020001 ori r2,r0,0x0001 # 1 801b4804: 3c03801c lui r3,0x801c 801b4808: 8c63c090 lw r3,-0x3f70(r3) # *0x801bc090 //Effect related? 801b480c: 3c04801c lui r4,0x801c 801b4810: 94849130 lhu r4,-0x6ed0(r4) # *0x801b9130 //load previous effect target ID 801b4814: 00431023 subu r2,r2,r3 # 1 - *0x801bc090 // 801b4818: 3c01801c lui r1,0x801c 801b481c: ac22c090 sw r2,-0x3f70(r1) # *0x801bc090 = 1 - *0x801bc090 //decrement counter? 801b4820: 3c01801c lui r1,0x801c 801b4824: ac249138 sw r4,-0x6ec8(r1) # *0x801b9138 = *0x801b9130 //copy paste 801b4828: 10800022 beq r4,r0,0x801b48b4 # if (*0x801b9130 == 0) //End? return failed? finished? 801b482c: 00001021 addu r2,r0,r0 # return 0; 801b4830: 3c12801c lui r18,0x801c 801b4834: 26528b9c addiu r18,r18,-0x7464 # 0x801b8b9c //start of effect data per unit (0x54 per effect target ID) 801b4838: 3c11801c lui r17,0x801c 801b483c: 26318900 addiu r17,r17,-0x7700 # 0x801b8900 //secondary effect data pointer? # do { 801b4840: 3c02801c lui r2,0x801c 801b4844: 8c429138 lw r2,-0x6ec8(r2) # *0x801b9138 //load current effect target ID 801b4848: 00000000 nop 801b484c: 00021880 sll r3,r2,0x02 # *0x801b9138 * 4 801b4850: 00621821 addu r3,r3,r2 # *0x801b9138 * 5 801b4854: 00031880 sll r3,r3,0x02 # *0x801b9138 * 20 801b4858: 00621821 addu r3,r3,r2 # *0x801b9138 * 21 801b485c: 00031880 sll r3,r3,0x02 # *0x801b9138 * 84 801b4860: 00721821 addu r3,r3,r18 # (*0x801b9138 * 84) + 0x801b8b9c //0x54 801b4864: 3c01801c lui r1,0x801c 801b4868: ac23c098 sw r3,-0x3f68(r1) # *0x801bc098 = (*0x801b9138 * 84) + 0x801b8b9c //store pointer for later convenience 801b486c: 90620003 lbu r2,0x0003(r3) # *(*0x801bc098 + 3) //secondary effect's function byte 801b4870: 00000000 nop 801b4874: 00021080 sll r2,r2,0x02 # *(*0x801bc098 + 3) * 4 801b4878: 00511021 addu r2,r2,r17 # (*(*0x801bc098 + 3) * 4) + 0x801b8900 801b487c: 8c420000 lw r2,0x0000(r2) # funcPtr = *((*(*0x801bc098 + 3) * 4) + 0x801b8900) //load secondary effect's call address 801b4880: 90700000 lbu r16,0x0000(r3) # *0x801bc098 //load current effect data's previous effect target ID 801b4884: 0040f809 jalr r2,r31 # result = callFunction(funcPtr); 0x00 Nothing : 801b0fec - only contains a jr r31; addu r2, r0, r0 0x01 Arrow Arc : 801b0ffc - Bow Arrow Secondary Effect - Calculates arrow trajectory. cannot load other models. 0x02 Glowing Tar: 801b153c - 001b153c - 001b1ae8 0x03 Golem : 801b1aec - 001b1aec - 001b1c00 0x04 Spell chrg : 801b1c04 - 001b1c04 - 001b27d8 0x05 Unsure : 801b27dc - 001b27dc - 001b2848 - erroneous secondary animation. seems to queue if there's an error and otherwise the effect couldn't end. 0x06 Red Orbs : 801b284c - 001b284c - 001b2964 0x07 Not Called : 801b2968 - that however, is nothing. does not clear r2. 0x08 Falling Tar: 801b2970 - 001b2970 - 001b2a84 0x09 Splash : 801b2a88 - 001b2a88 - 001b2bf8 0x0a Not Called : 801b2bfc - No routine on wiki, only contains a jr r31. does not clear r2. 0x0b Not Called : 801b2c04 - Similarly, no routine. jr r31, does not clear r2. 0x0c Venom Trap : 801b2c0c - 001b2c0c - 001b2d24 0x0d Level Up : 801b2d28 - 001b2d28 - 001b2e5c 0x0e Not Called : 801b2e60 - No routine. jr r31. does not clear r2. 0x0f Death Poof : 801b2e68 - 001b2e68 - 001b3114 0x10 Not Called : 801b3118 - No routine. jr r31; nop 0x11 Zodiac Poof: 801b3120 - 001b3120 - 001b33d0 0x12 Reflect : 801b33d4 - 001b33d4 - 001b381c 0x13 teleport : 801b3820 - 001b3820 - 001b3934 0x14 Lin. Proj. : 801b3938 - Linear Projectile secondary effect - loads arrow, stone, shuriken models, or ITEM.BIN graphic and moves them linearly on the screen. 0x15 Equip Break: 801b40f8 - 001b40f8 - 001b4230 0x16 Smn chrg : 801b4234 - 001b4234 - 001b47dc 801b4888: 00000000 nop 801b488c: 14400005 bne r2,r0,0x801b48a4 # if (result == 0) { // if effect is finalized and ending properly. 801b4890: 00000000 nop 801b4894: 3c04801c lui r4,0x801c 801b4898: 90849138 lbu r4,-0x6ec8(r4) # *0x801b9138 // load current/previous(?) effect target's ID 801b489c: 0c06b651 jal 0x801ad944 # 001ad944 - 001adadc (*0x801b9138); 801b48a0: 00000000 nop # } 801b48a4: 3c01801c lui r1,0x801c 801b48a8: ac309138 sw r16,-0x6ec8(r1) # *0x801b9138 = *0x801bc098 // store current effect target's ID 801b48ac: 1600ffe4 bne r16,r0,0x801b4840 # } while (*0x801b9138 != 0); // Loop until all targets of effect are animated for 801b48b0: 34020001 ori r2,r0,0x0001 # return 1; 801b48b4: 8fbf001c lw r31,0x001c(r29) 801b48b8: 8fb20018 lw r18,0x0018(r29) 801b48bc: 8fb10014 lw r17,0x0014(r29) 801b48c0: 8fb00010 lw r16,0x0010(r29) 801b48c4: 27bd0020 addiu r29,r29,0x0020 801b48c8: 03e00008 jr r31 801b48cc: 00000000 nop