Word Nulling

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Parameters : r4 is Pointer to 1st word
             r5 = Nb of byte to nullify
----------------------------------------------------------------------------------------
0019ab78: 27bdfff8 addiu r29,r29,-0x0008    
0019ab7c: 04a10002 bgez r5,0x0019ab88       #If Nb of Byte is < 0
0019ab80: 00a01021 addu r2,r5,r0            |r2 = Preset Limit (in bytes)
0019ab84: 24a20003 addiu r2,r5,0x0003           |r2 = Preset Limit + 3
0019ab88: 00022883 sra r5,r2,0x02           |Nb of word to nullify
0019ab8c: 18a00006 blez r5,0x0019aba8       #Exit if Nb of word to nullify < 0
0019ab90: 00001821 addu r3,r0,r0                |Counter = 0
                                                @Loop
0019ab94: ac800000 sw r0,0x0000(r4)                 |Store Data = 0
0019ab98: 24630001 addiu r3,r3,0x0001               |Counter += 1
0019ab9c: 0065102a slt r2,r3,r5                     |check limit
0019aba0: 1440fffc bne r2,r0,0x0019ab94         Λ Branch if Counter < Limit
0019aba4: 24840004 addiu r4,r4,0x0004               |Pointer += 4
0019aba8: 27bd0008 addiu r29,r29,0x0008     END
0019abac: 03e00008 jr r31                   
0019abb0: 00000000 nop

Return locations

Battle.bin
001949c4: AI_movement/panel_data_setting
001958b8: AI_Ability_Data_Setting
001958c4: AI_Ability_Data_Setting
00196438: Map_movement_decision/data_setting
0019724c: Set_chosen_ability/target_for_AI_status
00198350: 001982d8_-_001984e8