Difference between revisions of "Transparent removal routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Transparent removal routine 0018d868: 27bdffe8 addiu r29,r29,0xffe8 0018d86c: afb00010 sw r16,0x0010(r29) 0018d870: afbf0014 sw r31,0x0014(r29) 0018d874...")
 
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
  Transparent removal routine
+
  '''BATTLE.BIN''' :  - Transparent removal routine
  0018d868: 27bdffe8 addiu r29,r29,0xffe8     
+
------------------------------------------------------------
  0018d86c: afb00010 sw r16,0x0010(r29)    
+
Parameter : r4 - Unit Data Pointer
  0018d870: afbf0014 sw r31,0x0014(r29)    
+
Return : r2 - 0x00 if Unit is dead, crystal, petrified, treasure or jumping
  0018d874: 0c063691 jal 0x0018da44     Check for Crystal, Dead, Jump, Petrify, or  Treasure
+
          r2 - Unit Current Action Attack type 
  0018d878: 00808021 addu r16,r4,r0     r16 = Unit Data
+
------------------------------------------------------------
  0018d87c: 1440001f bne r2,r0,0x0018d8fc      Branch if Crystal, Dead, Jump,  Petrify, or Treasure
+
  0018d868: 27bdffe8 addiu r29,r29,-0x0018
  0018d880: 00001021 addu r2,r0,r0     r2 = 0
+
  0018d86c: afb00010 sw r16,0x0010(r29)  
  0018d884: 0c063681 jal 0x0018da04     Store Unit Data
+
  0018d870: afbf0014 sw r31,0x0014(r29)       |
  0018d888: 02002021 addu r4,r16,r0     r4 = Unit Data
+
  0018d874: 0c063691 jal 0x0018da44           |{{f/jal|Crystal, Dead, Jump, Petrify, Treasure check|Crystal, Dead, Jump, Petrify, Treasure check}} {{f/std|*returns r2}}
  0018d88c: 92020188 lbu r2,0x0188(r16)     Load Unit Action Taken?
+
  0018d878: 00808021 addu r16,r4,r0           |{{f/std|Preserves and send Unit ID}}
  0018d890: 00000000 nop        
+
  0018d87c: 1440001f bne r2,r0,0x0018d8fc      {{f/Cond|Exit if Crystal, Dead, Jump,  Petrify, or Treasure}}
  0018d894: 10400015 beq r2,r0,0x0018d8ec      Branch if No Action Taken
+
  0018d880: 00001021 addu r2,r0,r0                 |{{f/store|<nowiki>r2 = 0</nowiki>}}
  0018d898: 00000000 nop          
+
  0018d884: 0c063681 jal 0x0018da04           |{{f/jal|Set Action Target Variables|Set Action Target Variables}} {{f/std|*Set 0x80192d90, 0x80192d98 and 0x801938c1, reset Current action data}}
  0018d89c: 3c038019 lui r3,0x8019    
+
  0018d888: 02002021 addu r4,r16,r0           |{{f/std|Send Unit ID}}
  0018d8a0: 8c632d98 lw r3,0x2d98(r3)     Load Defender's Stats
+
  0018d88c: 92020188 lbu r2,0x0188(r16)       |{{f/load|Load Unit Action Taken?}}
  0018d8a4: 00000000 nop          
+
  0018d890: 00000000 nop                       |
  0018d8a8: 906201bd lbu r2,0x01bd(r3)     Load Inflicted Status List 3
+
  0018d894: 10400015 beq r2,r0,0x0018d8ec      {{f/Cond|If Action Taken}}
  0018d8ac: 00000000 nop          
+
  0018d898: 00000000 nop                           |
  0018d8b0: 30420010 andi r2,r2,0x0010    
+
  0018d89c: 3c038019 lui r3,0x8019                 |
  0018d8b4: 1040000d beq r2,r0,0x0018d8ec     Branch if Unit is not Transparent
+
  0018d8a0: 8c632d98 lw r3,0x2d98(r3)             |{{f/adr|Load Defender's Stats}}
  0018d8b8: 00000000 nop          
+
  0018d8a4: 00000000 nop                           |
  0018d8bc: 90620027 lbu r2,0x0027(r3)     Load... Unit's Turn?
+
  0018d8a8: 906201bd lbu r2,0x01bd(r3)             |{{f/load|Load Inflicted Status List 3}}
  0018d8c0: 00000000 nop          
+
  0018d8ac: 00000000 nop                           |
  0018d8c4: 10400009 beq r2,r0,0x0018d8ec     Branch if /not/ Unit's Turn
+
  0018d8b0: 30420010 andi r2,r2,0x0010             |
  0018d8c8: 34020010 ori r2,r0,0x0010     r2 = 0x10
+
  0018d8b4: 1040000d beq r2,r0,0x0018d8ec         {{f/Cond|If Unit is Transparent}}
  0018d8cc: 3c038019 lui r3,0x8019    
+
  0018d8b8: 00000000 nop                               |
  0018d8d0: 8c632d90 lw r3,0x2d90(r3)     Load Current Action Data Pointer
+
  0018d8bc: 90620027 lbu r2,0x0027(r3)                 |{{f/load|Load... Unit's Turn?}}
  0018d8d4: 00000000 nop          
+
  0018d8c0: 00000000 nop                               |
  0018d8d8: a0620022 sb r2,0x0022(r3)     Store Transparent Removal
+
  0018d8c4: 10400009 beq r2,r0,0x0018d8ec             {{f/Cond|If Unit 0x27 is not null (Unit turn ?)}}
  0018d8dc: 3c038019 lui r3,0x8019    
+
  0018d8c8: 34020010 ori r2,r0,0x0010                     |{{f/store|<nowiki>r2 = 0x10</nowiki>}}
  0018d8e0: 8c632d90 lw r3,0x2d90(r3)     Load Current Action Data Pointer
+
  0018d8cc: 3c038019 lui r3,0x8019                         |
  0018d8e4: 34020008 ori r2,r0,0x0008    
+
  0018d8d0: 8c632d90 lw r3,0x2d90(r3)                     |{{f/adr|Load Current Action Data Pointer}}
  0018d8e8: a0620025 sb r2,0x0025(r3)     Store Attack-Type as Status Change
+
  0018d8d4: 00000000 nop                                   |
  0018d8ec: 3c028019 lui r2,0x8019    
+
  0018d8d8: a0620022 sb r2,0x0022(r3)                     |{{f/store|Store Transparent Removal}}
  0018d8f0: 8c422d90 lw r2,0x2d90(r2)     Load Current Action Data Pointer
+
  0018d8dc: 3c038019 lui r3,0x8019                         |
  0018d8f4: 00000000 nop          
+
  0018d8e0: 8c632d90 lw r3,0x2d90(r3)                     |{{f/adr|Load Current Action Data Pointer}}
  0018d8f8: 90420025 lbu r2,0x0025(r2)     Load Current Action Data Pointer
+
  0018d8e4: 34020008 ori r2,r0,0x0008                     |
  0018d8fc: 8fbf0014 lw r31,0x0014(r29)    
+
  0018d8e8: a0620025 sb r2,0x0025(r3)                     |{{f/store|Store Attack-Type as Status Change}}
  0018d900: 8fb00010 lw r16,0x0010(r29)    
+
  0018d8ec: 3c028019 lui r2,0x8019             |
  0018d904: 27bd0018 addiu r29,r29,0x0018    
+
  0018d8f0: 8c422d90 lw r2,0x2d90(r2)         |{{f/adr|Load Current Action Data Pointer}}
  0018d908: 03e00008 jr r31        
+
  0018d8f4: 00000000 nop                       |
 +
  0018d8f8: 90420025 lbu r2,0x0025(r2)         |{{f/load|Load Current Action Attack type}}
 +
  0018d8fc: 8fbf0014 lw r31,0x0014(r29)
 +
  0018d900: 8fb00010 lw r16,0x0010(r29)
 +
  0018d904: 27bd0018 addiu r29,r29,0x0018
 +
  0018d908: 03e00008 jr r31
 
  0018d90c: 00000000 nop
 
  0018d90c: 00000000 nop
 +
===Return locations===
 +
'''BATTLE.BIN'''
 +
00182f1c: [[In_between_turn_control_routine]]

Latest revision as of 14:22, 14 January 2024

BATTLE.BIN :  - Transparent removal routine
------------------------------------------------------------
Parameter : r4 - Unit Data Pointer 
Return : r2 - 0x00 if Unit is dead, crystal, petrified, treasure or jumping
         r2 - Unit Current Action Attack type  
------------------------------------------------------------
0018d868: 27bdffe8 addiu r29,r29,-0x0018 
0018d86c: afb00010 sw r16,0x0010(r29) 
0018d870: afbf0014 sw r31,0x0014(r29)        |
0018d874: 0c063691 jal 0x0018da44            |-->Crystal, Dead, Jump, Petrify, Treasure check *returns r2
0018d878: 00808021 addu r16,r4,r0            |Preserves and send Unit ID
0018d87c: 1440001f bne r2,r0,0x0018d8fc      #Exit if Crystal, Dead, Jump,  Petrify, or Treasure
0018d880: 00001021 addu r2,r0,r0                 |r2 = 0
0018d884: 0c063681 jal 0x0018da04            |-->Set Action Target Variables *Set 0x80192d90, 0x80192d98 and 0x801938c1, reset Current action data
0018d888: 02002021 addu r4,r16,r0            |Send Unit ID
0018d88c: 92020188 lbu r2,0x0188(r16)        |Load Unit Action Taken?
0018d890: 00000000 nop                       |
0018d894: 10400015 beq r2,r0,0x0018d8ec      #If Action Taken
0018d898: 00000000 nop                           |
0018d89c: 3c038019 lui r3,0x8019                 |
0018d8a0: 8c632d98 lw r3,0x2d98(r3)              |Load Defender's Stats
0018d8a4: 00000000 nop                           |
0018d8a8: 906201bd lbu r2,0x01bd(r3)             |Load Inflicted Status List 3
0018d8ac: 00000000 nop                           |
0018d8b0: 30420010 andi r2,r2,0x0010             |
0018d8b4: 1040000d beq r2,r0,0x0018d8ec          #If Unit is Transparent
0018d8b8: 00000000 nop                               |
0018d8bc: 90620027 lbu r2,0x0027(r3)                 |Load... Unit's Turn?
0018d8c0: 00000000 nop                               |
0018d8c4: 10400009 beq r2,r0,0x0018d8ec              #If Unit 0x27 is not null (Unit turn ?)
0018d8c8: 34020010 ori r2,r0,0x0010                      |r2 = 0x10
0018d8cc: 3c038019 lui r3,0x8019                         |
0018d8d0: 8c632d90 lw r3,0x2d90(r3)                      |Load Current Action Data Pointer
0018d8d4: 00000000 nop                                   |
0018d8d8: a0620022 sb r2,0x0022(r3)                      |Store Transparent Removal
0018d8dc: 3c038019 lui r3,0x8019                         |
0018d8e0: 8c632d90 lw r3,0x2d90(r3)                      |Load Current Action Data Pointer
0018d8e4: 34020008 ori r2,r0,0x0008                      |
0018d8e8: a0620025 sb r2,0x0025(r3)                      |Store Attack-Type as Status Change
0018d8ec: 3c028019 lui r2,0x8019             |
0018d8f0: 8c422d90 lw r2,0x2d90(r2)          |Load Current Action Data Pointer
0018d8f4: 00000000 nop                       |
0018d8f8: 90420025 lbu r2,0x0025(r2)         |Load Current Action Attack type
0018d8fc: 8fbf0014 lw r31,0x0014(r29)
0018d900: 8fb00010 lw r16,0x0010(r29)
0018d904: 27bd0018 addiu r29,r29,0x0018
0018d908: 03e00008 jr r31
0018d90c: 00000000 nop

Return locations

BATTLE.BIN
00182f1c: In_between_turn_control_routine