Difference between revisions of "Word Nulling"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Word Nulling 0019ab78: 27bdfff8 addiu r29,r29,0xfff8 0019ab7c: 04a10002 bgez r5,0x 0019ab88 Branch if Preset Limit >= 0 0019ab80: 00a01021 addu r2,r5,r0 r2 = Preset Limi...")
 
m
 
Line 1: Line 1:
  Word Nulling
+
  Parameters : {{f/adr|r4 is Pointer to 1st word}}
  0019ab78: 27bdfff8 addiu r29,r29,0xfff8
+
              r5 = Nb of byte to nullify
  0019ab7c: 04a10002 bgez r5,0x 0019ab88 Branch if Preset Limit >= 0
+
----------------------------------------------------------------------------------------
  0019ab80: 00a01021 addu r2,r5,r0 r2 = Preset Limit (in bytes)
+
  0019ab78: 27bdfff8 addiu r29,r29,-0x0008   
  0019ab84: 24a20003 addiu r2,r5,0x0003 r2 = Preset Limit + 3
+
  0019ab7c: 04a10002 bgez r5,0x0019ab88      {{f/Cond|If Nb of Byte is < 0}}
  0019ab88: 00022883 sra r5,r2,0x02 PL / 4 (in words)
+
  0019ab80: 00a01021 addu r2,r5,r0           |{{f/std|<nowiki>r2 = Preset Limit (in bytes)</nowiki>}}
  0019ab8c: 18a00006 blez r5,0x 0019aba8 Branch if PL <= 0
+
  0019ab84: 24a20003 addiu r2,r5,0x0003           |{{f/std|<nowiki>r2 = Preset Limit + 3</nowiki>}}
  0019ab90: 00001821 addu r3,r0,r0 Counter = 0
+
  0019ab88: 00022883 sra r5,r2,0x02           |{{f/std|Nb of word to nullify}}
  0019ab94: ac800000 sw r0,0x0000(r4) Store Data = 0
+
  0019ab8c: 18a00006 blez r5,0x0019aba8      {{f/Cond|Exit if Nb of word to nullify < 0}}
  0019ab98: 24630001 addiu r3,r3,0x0001 Counter += 1
+
  0019ab90: 00001821 addu r3,r0,r0               |{{f/std|<nowiki>Counter = 0</nowiki>}}
  0019ab9c: 0065102a slt r2,r3,r5
+
                                                {{f/bloop|Loop}}
  0019aba0: 1440fffc bne r2,r0,0x 0019ab94 Branch if Counter < Limit
+
  0019ab94: ac800000 sw r0,0x0000(r4)                 |{{f/store|<nowiki>Store Data = 0</nowiki>}}
  0019aba4: 24840004 addiu r4,r4,0x0004 Pointer += 4
+
  0019ab98: 24630001 addiu r3,r3,0x0001               |{{f/std|<nowiki>Counter += 1</nowiki>}}
  0019aba8: 27bd0008 addiu r29,r29,0x0008
+
  0019ab9c: 0065102a slt r2,r3,r5                     |{{f/std|check limit}}
  0019abac: 03e00008 jr r31
+
  0019aba0: 1440fffc bne r2,r0,0x0019ab94        {{f/eloop|Branch if Counter < Limit}}
 +
  0019aba4: 24840004 addiu r4,r4,0x0004               |{{f/std|<nowiki>Pointer += 4</nowiki>}}
 +
  0019aba8: 27bd0008 addiu r29,r29,0x0008     END
 +
  0019abac: 03e00008 jr r31                  
 
  0019abb0: 00000000 nop
 
  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]]

Latest revision as of 20:07, 12 April 2023

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