Difference between revisions of "Set move/act based on skillset"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
  00075314: afbf0018 sw r31,0x0018(r29)
 
  00075314: afbf0018 sw r31,0x0018(r29)
 
  00075318: afb10014 sw r17,0x0014(r29)
 
  00075318: afb10014 sw r17,0x0014(r29)
  0007531c: 0c01d2eb jal 0x00074bac
+
  0007531c: 0c01d2eb jal 0x00074bac             {{f/jal|Free Cursor Controller Input|Free Cursor Controller Input}}
 
  00075320: afb00010 sw r16,0x0010(r29)
 
  00075320: afb00010 sw r16,0x0010(r29)
  00075324: 0c011298 jal 0x00044a60  
+
  00075324: 0c011298 jal 0x00044a60             {{f/jal|00044a60_-_00044a78|Something with 0x8011a2d4 to set r2}}
 
  00075328: 00000000 nop
 
  00075328: 00000000 nop
 
  0007532c: 3c058004 lui r5,0x8004
 
  0007532c: 3c058004 lui r5,0x8004
 
  00075330: 8ca55944 lw r5,0x5944(r5)
 
  00075330: 8ca55944 lw r5,0x5944(r5)
  00075334: 0c04fd48 jal 0x0013f520
+
  00075334: 0c04fd48 jal 0x0013f520             {{f/jal|Data_setting_from_menu_selections|Data setting from menu selections}}
 
  00075338: 00402021 addu r4,r2,r0
 
  00075338: 00402021 addu r4,r2,r0
  0007533c: 0c01e886 jal 0x0007a218 get misc unit data
+
  0007533c: 0c01e886 jal 0x0007a218       {{f/jal|Get_Casting_units_Misc_Data|get misc unit data}}
 
  00075340: 00000000 nop
 
  00075340: 00000000 nop
 
  00075344: 00408021 addu r16,r2,r0
 
  00075344: 00408021 addu r16,r2,r0
  00075348: 96020008 lhu r2,0x0008(r16)
+
  00075348: 96020008 lhu r2,0x0008(r16) Load Frame Data
 
  0007534c: 00000000 nop
 
  0007534c: 00000000 nop
 
  00075350: 2c42001f sltiu r2,r2,0x001f
 
  00075350: 2c42001f sltiu r2,r2,0x001f
Line 21: Line 21:
 
  0007535c: 920201b4 lbu r2,0x01b4(r16)
 
  0007535c: 920201b4 lbu r2,0x01b4(r16)
 
  00075360: 00000000 nop
 
  00075360: 00000000 nop
  00075364: 14400017 bne r2,r0,0x000753c4
+
  00075364: 14400017 bne r2,r0,0x000753c4 Branch if player control?
 +
 
 +
AI Decision
 
  00075368: 34020002 ori r2,r0,0x0002
 
  00075368: 34020002 ori r2,r0,0x0002
  0007536c: 8e030134 lw r3,0x0134(r16) get unit data
+
  0007536c: 8e030134 lw r3,0x0134(r16) get unit data
 
  00075370: 3c018004 lui r1,0x8004
 
  00075370: 3c018004 lui r1,0x8004
 
  00075374: ac225980 sw r2,0x5980(r1)
 
  00075374: ac225980 sw r2,0x5980(r1)
  00075378: 9064018a lbu r4,0x018a(r3) load unit ID
+
  00075378: 9064018a lbu r4,0x018a(r3) load unit ID
  0007537c: 0c064f94 jal 0x00193e50 AI Ability/Movement Decision
+
  0007537c: 0c064f94 jal 0x00193e50 {{f/jal|Main AI action setup|Main AI action setup}}
  00075380: 26050158 addiu r5,r16,0x0158 r5 = 0x158 in misc. data
+
  00075380: 26050158 addiu r5,r16,0x0158 r5 = 0x158 in misc. data
  00075384: 1440000f bne r2,r0,0x000753c4
+
  00075384: 1440000f bne r2,r0,0x000753c4 Branch if a decision could not be reached
 
  00075388: 34110001 ori r17,r0,0x0001
 
  00075388: 34110001 ori r17,r0,0x0001
 
  0007538c: 8e020158 lw r2,0x0158(r16)          load AI progression?
 
  0007538c: 8e020158 lw r2,0x0158(r16)          load AI progression?
Line 39: Line 41:
 
  000753a4: 9042018a lbu r2,0x018a(r2)          load unit ID
 
  000753a4: 9042018a lbu r2,0x018a(r2)          load unit ID
 
  000753a8: 2604015c addiu r4,r16,0x015c        r4 = AI move data
 
  000753a8: 2604015c addiu r4,r16,0x015c        r4 = AI move data
  000753ac: 0c05f0ee jal 0x0017c3b8 call attack preparation (ability selected)
+
  000753ac: 0c05f0ee jal 0x0017c3b8 {{f/jal|Call_Attack_Preparation_(ability_selected)|call attack preparation (ability selected)}}
  000753b0: a202015c sb r2,0x015c(r16) store Target ID?
+
  000753b0: a202015c sb r2,0x015c(r16) store Target ID?
 
  000753b4: 34020001 ori r2,r0,0x0001
 
  000753b4: 34020001 ori r2,r0,0x0001
  000753b8: a20201b4 sb r2,0x01b4(r16) store move has been selected?
+
  000753b8: a20201b4 sb r2,0x01b4(r16) store move has been selected?
 
  000753bc: 3c018004 lui r1,0x8004
 
  000753bc: 3c018004 lui r1,0x8004
 
  000753c0: ac315980 sw r17,0x5980(r1)
 
  000753c0: ac315980 sw r17,0x5980(r1)
  000753c4: 96020008 lhu r2,0x0008(r16)
+
 
 +
  000753c4: 96020008 lhu r2,0x0008(r16) Load Frame Data?
 
  000753c8: 00000000 nop
 
  000753c8: 00000000 nop
 
  000753cc: 24430001 addiu r3,r2,0x0001
 
  000753cc: 24430001 addiu r3,r2,0x0001
 
  000753d0: 2c42001f sltiu r2,r2,0x001f
 
  000753d0: 2c42001f sltiu r2,r2,0x001f
 
  000753d4: 14400083 bne r2,r0,0x 000755e4      pauses for 0x1f cycles
 
  000753d4: 14400083 bne r2,r0,0x 000755e4      pauses for 0x1f cycles
  000753d8: a6030008 sh r3,0x0008(r16) increment 0x08 in misc data
+
  000753d8: a6030008 sh r3,0x0008(r16) Frame + 1
 
  000753dc: 920201b4 lbu r2,0x01b4(r16)
 
  000753dc: 920201b4 lbu r2,0x01b4(r16)
 
  000753e0: 00000000 nop
 
  000753e0: 00000000 nop
 
  000753e4: 1040007f beq r2,r0,0x 000755e4
 
  000753e4: 1040007f beq r2,r0,0x 000755e4
 +
 
  000753e8: 34020001 ori r2,r0,0x0001
 
  000753e8: 34020001 ori r2,r0,0x0001
 
  000753ec: 8e030158 lw r3,0x0158(r16)          load move selected byte
 
  000753ec: 8e030158 lw r3,0x0158(r16)          load move selected byte
 
  000753f0: 00000000 nop
 
  000753f0: 00000000 nop
  000753f4: 10620020 beq r3,r2,0x 00075478      
+
  000753f4: 10620020 beq r3,r2,0x 00075478     <Ability Being Used> if True
 +
 
  000753f8: 28620002 slti r2,r3,0x0002
 
  000753f8: 28620002 slti r2,r3,0x0002
  000753fc: 10400005 beq r2,r0,0x 00075414
+
  000753fc: 10400005 beq r2,r0,0x 00075414 <Move or End Turn> if 0x0158 > 1
 
  00075400: 00000000 nop
 
  00075400: 00000000 nop
  00075404: 1060000a beq r3,r0,0x 00075430
+
  00075404: 1060000a beq r3,r0,0x 00075430 <Get Target Data> if 0
 
  00075408: 00000000 nop
 
  00075408: 00000000 nop
  0007540c: 0801d579 j 0x 000755e4 jump to end
+
  0007540c: 0801d579 j 0x 000755e4 Exit if -1
 
  00075410: 00000000 nop
 
  00075410: 00000000 nop
 +
 +
<Move or End Turn>
 
  00075414: 34020002 ori r2,r0,0x0002
 
  00075414: 34020002 ori r2,r0,0x0002
  00075418: 10620069 beq r3,r2,0x 000755c0
+
  00075418: 10620069 beq r3,r2,0x 000755c0 <End Turn> if 2
 
  0007541c: 34020019 ori r2,r0,0x0019
 
  0007541c: 34020019 ori r2,r0,0x0019
  00075420: 1062000d beq r3,r2,0x 00075458
+
  00075420: 1062000d beq r3,r2,0x 00075458 <Movement being Made> if 0x0158 = 0x19(?)
 
  00075424: 00000000 nop
 
  00075424: 00000000 nop
 
  00075428: 0801d579 j 0x 000755e4 jump to end
 
  00075428: 0801d579 j 0x 000755e4 jump to end
 
  0007542c: 00000000 nop
 
  0007542c: 00000000 nop
 +
 +
<Get Target Data>
 
  00075430: 92020130 lbu r2,0x0130(r16)
 
  00075430: 92020130 lbu r2,0x0130(r16)
 
  00075434: 00000000 nop
 
  00075434: 00000000 nop
Line 77: Line 86:
 
  0007543c: 00000000 nop
 
  0007543c: 00000000 nop
 
  00075440: 92040131 lbu r4,0x0131(r16) load ID?
 
  00075440: 92040131 lbu r4,0x0131(r16) load ID?
  00075444: 0c01e9b9 jal 0x0007a6e4 find current unit misc data
+
  00075444: 0c01e9b9 jal 0x0007a6e4 {{f/jal|Find_Current_Misc_Unit_Data_Pointer_(external_ID)%3F|Find Current Misc Unit Data Pointer}}
 
  00075448: 00000000 nop
 
  00075448: 00000000 nop
 
  0007544c: 90420004 lbu r2,0x0004(r2) load misc ID?
 
  0007544c: 90420004 lbu r2,0x0004(r2) load misc ID?
 
  00075450: 0801d518 j 0x 00075460
 
  00075450: 0801d518 j 0x 00075460
 
  00075454: 00000000 nop
 
  00075454: 00000000 nop
  Movement Being Made
+
 
 +
  <Movement Being Made>
 
  00075458: 3c028009 lui r2,0x8009
 
  00075458: 3c028009 lui r2,0x8009
 
  0007545c: 8c426118 lw r2,0x6118(r2) load misc ID?
 
  0007545c: 8c426118 lw r2,0x6118(r2) load misc ID?
 
  00075460: 3c018009 lui r1,0x8009
 
  00075460: 3c018009 lui r1,0x8009
 
  00075464: ac22611c sw r2,0x611c(r1) store misc ID
 
  00075464: ac22611c sw r2,0x611c(r1) store misc ID
  00075468: 0c01c5f3 jal 0x000717cc Movement being made?
+
  00075468: 0c01c5f3 jal 0x000717cc {{f/jal|000717cc_-_00071820|movement being made?}}
 
  0007546c: 00000000 nop
 
  0007546c: 00000000 nop
 
  00075470: 0801d579 j 0x 000755e4 jump to end
 
  00075470: 0801d579 j 0x 000755e4 jump to end
 
  00075474: 00000000 nop
 
  00075474: 00000000 nop
 +
 
  Ability Being Used
 
  Ability Being Used
 
  00075478: 9202015d lbu r2,0x015d(r16) load skillset used?
 
  00075478: 9202015d lbu r2,0x015d(r16) load skillset used?
 
  0007547c: 00000000 nop
 
  0007547c: 00000000 nop
 
  00075480: 2443ffff addiu r3,r2,0xffff
 
  00075480: 2443ffff addiu r3,r2,0xffff
  00075484: 2c620018 sltiu r2,r3,0x0018 set if not special skillset
+
  00075484: 2c620018 sltiu r2,r3,0x0018
  00075488: 10400033 beq r2,r0,0x 00075558 branch if IS special skillset
+
  00075488: 10400033 beq r2,r0,0x 00075558 <Normal Skillset> if Special Skillset
 
  0007548c: 00031080 sll r2,r3,0x02
 
  0007548c: 00031080 sll r2,r3,0x02
 
  00075490: 3c018006 lui r1,0x8006
 
  00075490: 3c018006 lui r1,0x8006
 
  00075494: 00220821 addu r1,r1,r2
 
  00075494: 00220821 addu r1,r1,r2
  00075498: 8c2275f0 lw r2,0x75f0(r1)
+
  00075498: 8c2275f0 lw r2,0x75f0(r1) Load Jump Address
 
  0007549c: 00000000 nop
 
  0007549c: 00000000 nop
 
  000754a0: 00400008 jr r2
 
  000754a0: 00400008 jr r2
   
+
  000754a4: 00000000 nop
+
 
 +
 
 
  000675f0: 80075558 lb r7,0x5558(r0) attack
 
  000675f0: 80075558 lb r7,0x5558(r0) attack
 
  000675f4: 800754a8 lb r7,0x54a8(r0) defend
 
  000675f4: 800754a8 lb r7,0x54a8(r0) defend
 
  000675f8: 800754ec lb r7,0x54ec(r0) equip change
 
  000675f8: 800754ec lb r7,0x54ec(r0) equip change
  000675fc: 8007553c lb r7,0x553c(r0)
+
  000675fc: 8007553c lb r7,0x553c(r0) ? (goes to Mimic)
 
  00067600: 80075558 lb r7,0x5558(r0) basic skill
 
  00067600: 80075558 lb r7,0x5558(r0) basic skill
 
  00067604: 80075558 lb r7,0x5558(r0) item
 
  00067604: 80075558 lb r7,0x5558(r0) item
 
  00067608: 80075558 lb r7,0x5558(r0) battle skill
 
  00067608: 80075558 lb r7,0x5558(r0) battle skill
  0006760c: 80075558 lb r7,0x5558(r0)
+
  0006760c: 80075558 lb r7,0x5558(r0) Charge
  00067610: 80075558 lb r7,0x5558(r0)
+
  00067610: 80075558 lb r7,0x5558(r0) Punch Art
  00067614: 80075558 lb r7,0x5558(r0)
+
  00067614: 80075558 lb r7,0x5558(r0) White Magic
  00067618: 80075558 lb r7,0x5558(r0)
+
  00067618: 80075558 lb r7,0x5558(r0) Black Magic
  0006761c: 80075558 lb r7,0x5558(r0)
+
  0006761c: 80075558 lb r7,0x5558(r0) Time Magic
  00067620: 80075558 lb r7,0x5558(r0)
+
  00067620: 80075558 lb r7,0x5558(r0) Summon Magic
  00067624: 80075558 lb r7,0x5558(r0)
+
  00067624: 80075558 lb r7,0x5558(r0) Steal
  00067628: 80075558 lb r7,0x5558(r0)
+
  00067628: 80075558 lb r7,0x5558(r0) Talk Skill
  0006762c: 80075558 lb r7,0x5558(r0)
+
  0006762c: 80075558 lb r7,0x5558(r0) Ying Yang Magic
  00067630: 80075558 lb r7,0x5558(r0)
+
  00067630: 80075558 lb r7,0x5558(r0) Elemental
  00067634: 80075558 lb r7,0x5558(r0)
+
  00067634: 80075558 lb r7,0x5558(r0) Jump
  00067638: 80075558 lb r7,0x5558(r0)
+
  00067638: 80075558 lb r7,0x5558(r0) Draw Out
  0006763c: 80075558 lb r7,0x5558(r0)
+
  0006763c: 80075558 lb r7,0x5558(r0) Throw
  00067640: 80075558 lb r7,0x5558(r0)
+
  00067640: 80075558 lb r7,0x5558(r0) Math Skill
  00067644: 80075558 lb r7,0x5558(r0)  
+
  00067644: 80075558 lb r7,0x5558(r0) Sing
  00067648: 80075558 lb r7,0x5558(r0)
+
  00067648: 80075558 lb r7,0x5558(r0) Dance
  0006764c: 8007553c lb r7,0x553c(r0) mimic
+
  0006764c: 8007553c lb r7,0x553c(r0) Mimic
+
 
000754a4: 00000000 nop
+
 
 
  Defend
 
  Defend
 
  000754a8: 8e020134 lw r2,0x0134(r16)
 
  000754a8: 8e020134 lw r2,0x0134(r16)
 
  000754ac: 00000000 nop
 
  000754ac: 00000000 nop
 
  000754b0: 9044018a lbu r4,0x018a(r2)
 
  000754b0: 9044018a lbu r4,0x018a(r2)
  000754b4: 0c060f80 jal 0x00183e00 enable Defend status
+
  000754b4: 0c060f80 jal 0x00183e00 {{f/jal|Another_intermediate_routine|set Defend for AI calculation}}
 
  000754b8: 00000000 nop
 
  000754b8: 00000000 nop
 
  000754bc: 9202013c lbu r2,0x013c(r16) load ??
 
  000754bc: 9202013c lbu r2,0x013c(r16) load ??
 
  000754c0: 92040004 lbu r4,0x0004(r16) load misc ID
 
  000754c0: 92040004 lbu r4,0x0004(r16) load misc ID
 
  000754c4: 34420002 ori r2,r2,0x0002 set 0x02 flag
 
  000754c4: 34420002 ori r2,r2,0x0002 set 0x02 flag
  000754c8: 0c01a38c jal 0x00068e30
+
  000754c8: 0c01a38c jal 0x00068e30                       {{f/jal|Update Status/Sprite/Animation Display By Unit Misc ID|Set Defend Sprite in Misc Data}}
 
  000754cc: a202013c sb r2,0x013c(r16) store new flags
 
  000754cc: a202013c sb r2,0x013c(r16) store new flags
 
  000754d0: 8e020134 lw r2,0x0134(r16) load unit data
 
  000754d0: 8e020134 lw r2,0x0134(r16) load unit data
 
  000754d4: 00000000 nop
 
  000754d4: 00000000 nop
 
  000754d8: 9044018a lbu r4,0x018a(r2) load unit ID
 
  000754d8: 9044018a lbu r4,0x018a(r2) load unit ID
  000754dc: 0c060eea jal 0x00183ba8 move/act setting
+
  000754dc: 0c060eea jal 0x00183ba8 {{f/jal|Set Only Action Taken|Set Only Action Taken}}
 
  000754e0: 00000000 nop
 
  000754e0: 00000000 nop
 
  000754e4: 0801d577 j 0x 000755dc
 
  000754e4: 0801d577 j 0x 000755dc
 
  000754e8: 00000000 nop
 
  000754e8: 00000000 nop
 +
 
  Equip Change
 
  Equip Change
 
  000754ec: 9202013c lbu r2,0x013c(r16)
 
  000754ec: 9202013c lbu r2,0x013c(r16)
 
  000754f0: 8e040134 lw r4,0x0134(r16)
 
  000754f0: 8e040134 lw r4,0x0134(r16)
 
  000754f4: 34420002 ori r2,r2,0x0002
 
  000754f4: 34420002 ori r2,r2,0x0002
  000754f8: 0c060f78 jal 0x00183de0 status enable/disabling
+
  000754f8: 0c060f78 jal 0x00183de0 {{f/jal|Enable/disable acting status|Enable/disable acting status}}
 
  000754fc: a202013c sb r2,0x013c(r16)
 
  000754fc: a202013c sb r2,0x013c(r16)
 
  00075500: 8e020134 lw r2,0x0134(r16)
 
  00075500: 8e020134 lw r2,0x0134(r16)
 
  00075504: 00000000 nop
 
  00075504: 00000000 nop
 
  00075508: 9044018a lbu r4,0x018a(r2)
 
  00075508: 9044018a lbu r4,0x018a(r2)
  0007550c: 0c0667b2 jal 0x00199ec8 usable ability/ENTD calculations
+
  0007550c: 0c0667b2 jal 0x00199ec8 {{f/jal|Usable Ability Setting/ENTD AI Calculations|usable ability/ENTD calculations}}
 
  00075510: 00000000 nop
 
  00075510: 00000000 nop
 
  00075514: 92040004 lbu r4,0x0004(r16)
 
  00075514: 92040004 lbu r4,0x0004(r16)
  00075518: 0c01a38c jal 0x00068e30
+
  00075518: 0c01a38c jal 0x00068e30         {{f/jal|Update Status/Sprite/Animation Display By Unit Misc ID|Update Sprite in Misc Data}}
 
  0007551c: 00000000 nop
 
  0007551c: 00000000 nop
 
  00075520: 8e020134 lw r2,0x0134(r16)
 
  00075520: 8e020134 lw r2,0x0134(r16)
 
  00075524: 00000000 nop
 
  00075524: 00000000 nop
 
  00075528: 9044018a lbu r4,0x018a(r2)
 
  00075528: 9044018a lbu r4,0x018a(r2)
  0007552c: 0c060eea jal 0x00183ba8 move/act setting
+
  0007552c: 0c060eea jal 0x00183ba8 {{f/jal|Set Only Action Taken|Set Only Action Taken}}
 
  00075530: 00000000 nop
 
  00075530: 00000000 nop
 
  00075534: 0801d577 j 0x 000755dc
 
  00075534: 0801d577 j 0x 000755dc
 
  00075538: 00000000 nop
 
  00075538: 00000000 nop
 +
 
  Mimic, Blank
 
  Mimic, Blank
 
  0007553c: 8e020134 lw r2,0x0134(r16)
 
  0007553c: 8e020134 lw r2,0x0134(r16)
 
  00075540: 00000000 nop
 
  00075540: 00000000 nop
 
  00075544: 9044018a lbu r4,0x018a(r2)
 
  00075544: 9044018a lbu r4,0x018a(r2)
  00075548: 0c060eea jal 0x00183ba8 move/act setting
+
  00075548: 0c060eea jal 0x00183ba8 {{f/jal|Set Only Action Taken|Set Only Action Taken}}
 
  0007554c: 00000000 nop
 
  0007554c: 00000000 nop
 
  00075550: 0801d577 j 0x 000755dc
 
  00075550: 0801d577 j 0x 000755dc
Line 182: Line 196:
 
  00075558: 9602015e lhu r2,0x015e(r16) load used ability
 
  00075558: 9602015e lhu r2,0x015e(r16) load used ability
 
  0007555c: 2604015c addiu r4,r16,0x015c
 
  0007555c: 2604015c addiu r4,r16,0x015c
  00075560: 0c05ea30 jal 0x0017a8c0 calculate ability range
+
  00075560: 0c05ea30 jal 0x0017a8c0 {{f/jal|Calculate Target Panels|calculate ability range}}
 
  00075564: a6020138 sh r2,0x0138(r16) store used ability
 
  00075564: a6020138 sh r2,0x0138(r16) store used ability
  00075568: 00401821 addu r3,r2,r0
+
  00075568: 00401821 addu r3,r2,r0 -1 (Unit doesn't exist), 1 (Ability = Follow Target), 0 , 3 (no panels hittable)
 
  0007556c: 34020002 ori r2,r0,0x0002
 
  0007556c: 34020002 ori r2,r0,0x0002
  00075570: 1062000f beq r3,r2,0x 000755b0 branch if range = 2
+
  00075570: 1062000f beq r3,r2,0x 000755b0 <Range Error> if routine returned 2 (it's suppose to, but it can't)
  00075574: ae030174 sw r3,0x0174(r16) store range?
+
  00075574: ae030174 sw r3,0x0174(r16) Save Range Result
 
  00075578: 28620003 slti r2,r3,0x0003
 
  00075578: 28620003 slti r2,r3,0x0003
  0007557c: 10400005 beq r2,r0,0x00075594 branch if range > 2
+
  0007557c: 10400005 beq r2,r0,0x00075594 <Can't Generate Range?> if Ability wasn't able to generate panels
 
  00075580: 00000000 nop
 
  00075580: 00000000 nop
  00075584: 0460000a bltz r3,0x000755b0 branch if range = 0xff
+
  00075584: 0460000a bltz r3,0x000755b0 <Range Error> if unit doesn't exist
 
  00075588: 00000000 nop
 
  00075588: 00000000 nop
  0007558c: 0801d568 j 0x000755a0
+
  0007558c: 0801d568 j 0x000755a0 <Normal Range>
 
  00075590: 00000000 nop
 
  00075590: 00000000 nop
  
Range > 2
+
<Can't generate Range?>
 
  00075594: 34020003 ori r2,r0,0x0003
 
  00075594: 34020003 ori r2,r0,0x0003
  00075598: 14620005 bne r3,r2,0x 000755b0 branch if range isn't 3
+
  00075598: 14620005 bne r3,r2,0x 000755b0 <Range Error> if = 3
 
  0007559c: 00000000 nop
 
  0007559c: 00000000 nop
  000755a0: 0c01cad4 jal 0x00072b50
+
 
 +
<Normal Range> (Returned 0, 1 or >3)
 +
  000755a0: 0c01cad4 jal 0x00072b50 {{f/jal|Range 1 Ability Used|Execute Action}}
 
  000755a4: 00000000 nop
 
  000755a4: 00000000 nop
  000755a8: 0801d579 j 0x 000755e4
+
  000755a8: 0801d579 j 0x 000755e4 <Exit>
 
  000755ac: 00000000 nop
 
  000755ac: 00000000 nop
  
  Range = 2, or (range > 2, but not 3)
+
  <Range Error> (Returned 3, 2, -1)
  000755b0: 0c01d0c2 jal 0x00074308
+
  000755b0: 0c01d0c2 jal 0x00074308 {{f/jal|Select Target Tile|Execute Action (don't animate anything?)}}
 
  000755b4: 00000000 nop
 
  000755b4: 00000000 nop
  000755b8: 0801d579 j 0x 000755e4
+
  000755b8: 0801d579 j 0x 000755e4 <Exit>
 
  000755bc: 00000000 nop
 
  000755bc: 00000000 nop
 +
 +
<End Turn>
 
  000755c0: 9202013c lbu r2,0x013c(r16)
 
  000755c0: 9202013c lbu r2,0x013c(r16)
 
  000755c4: 8e030134 lw r3,0x0134(r16)
 
  000755c4: 8e030134 lw r3,0x0134(r16)
Line 215: Line 233:
 
  000755cc: a202013c sb r2,0x013c(r16) set 0x03 flag
 
  000755cc: a202013c sb r2,0x013c(r16) set 0x03 flag
 
  000755d0: 9064018a lbu r4,0x018a(r3)
 
  000755d0: 9064018a lbu r4,0x018a(r3)
  000755d4: 0c060f1b jal 0x00183c6c end of turn routine
+
  000755d4: 0c060f1b jal 0x00183c6c {{f/jal|End of Turn|end of turn routine for AI processing}}
 
  000755d8: 00000000 nop
 
  000755d8: 00000000 nop
  000755dc: 0c01c723 jal 0x00071c8c
+
  000755dc: 0c01c723 jal 0x00071c8c {{f/jal|00071c8c - 00071ce8|Execute Action?}}
 
  000755e0: 00000000 nop
 
  000755e0: 00000000 nop
 +
 +
<Exit>
 
  000755e4: 8fbf0018 lw r31,0x0018(r29)
 
  000755e4: 8fbf0018 lw r31,0x0018(r29)
 
  000755e8: 8fb10014 lw r17,0x0014(r29)
 
  000755e8: 8fb10014 lw r17,0x0014(r29)
Line 225: Line 245:
 
  000755f4: 03e00008 jr r31
 
  000755f4: 03e00008 jr r31
 
  000755f8: 00000000 nop
 
  000755f8: 00000000 nop
 +
=== Return Location ===
 +
'''Battle.bin '''
 +
  00079c74: [[Game_Flow_Control_routine|Game Flow Control Routine (Main BATTLE.BIN Loop)]]

Latest revision as of 10:06, 23 January 2024

00075310: 27bdffe0 addiu r29,r29,0xffe0
00075314: afbf0018 sw r31,0x0018(r29)
00075318: afb10014 sw r17,0x0014(r29)
0007531c: 0c01d2eb jal 0x00074bac             -->Free Cursor Controller Input
00075320: afb00010 sw r16,0x0010(r29)
00075324: 0c011298 jal 0x00044a60             -->Something with 0x8011a2d4 to set r2
00075328: 00000000 nop
0007532c: 3c058004 lui r5,0x8004
00075330: 8ca55944 lw r5,0x5944(r5)
00075334: 0c04fd48 jal 0x0013f520             -->Data setting from menu selections
00075338: 00402021 addu r4,r2,r0
0007533c: 0c01e886 jal 0x0007a218	      -->get misc unit data
00075340: 00000000 nop
00075344: 00408021 addu r16,r2,r0				
00075348: 96020008 lhu r2,0x0008(r16)			Load Frame Data
0007534c: 00000000 nop
00075350: 2c42001f sltiu r2,r2,0x001f
00075354: 1440001b bne r2,r0,0x000753c4        pauses for 0x1f cycles
00075358: 00000000 nop
0007535c: 920201b4 lbu r2,0x01b4(r16)		
00075360: 00000000 nop
00075364: 14400017 bne r2,r0,0x000753c4			Branch if player control?
AI Decision
00075368: 34020002 ori r2,r0,0x0002
0007536c: 8e030134 lw r3,0x0134(r16)			get unit data
00075370: 3c018004 lui r1,0x8004
00075374: ac225980 sw r2,0x5980(r1)
00075378: 9064018a lbu r4,0x018a(r3)			load unit ID
0007537c: 0c064f94 jal 0x00193e50			-->Main AI action setup
00075380: 26050158 addiu r5,r16,0x0158			r5 = 0x158 in misc. data
00075384: 1440000f bne r2,r0,0x000753c4			Branch if a decision could not be reached
00075388: 34110001 ori r17,r0,0x0001
0007538c: 8e020158 lw r2,0x0158(r16)           load AI progression?
00075390: 00000000 nop
00075394: 14510008 bne r2,r17,0x000753b8       branch if not 1
00075398: 34020001 ori r2,r0,0x0001
0007539c: 8e020134 lw r2,0x0134(r16)           load unit data
000753a0: 00000000 nop
000753a4: 9042018a lbu r2,0x018a(r2)           load unit ID
000753a8: 2604015c addiu r4,r16,0x015c         r4 = AI move data
000753ac: 0c05f0ee jal 0x0017c3b8			-->call attack preparation (ability selected)
000753b0: a202015c sb r2,0x015c(r16)			store Target ID?
000753b4: 34020001 ori r2,r0,0x0001
000753b8: a20201b4 sb r2,0x01b4(r16)			store move has been selected?
000753bc: 3c018004 lui r1,0x8004
000753c0: ac315980 sw r17,0x5980(r1)
000753c4: 96020008 lhu r2,0x0008(r16)			Load Frame Data?	
000753c8: 00000000 nop
000753cc: 24430001 addiu r3,r2,0x0001
000753d0: 2c42001f sltiu r2,r2,0x001f
000753d4: 14400083 bne r2,r0,0x 000755e4       pauses for 0x1f cycles
000753d8: a6030008 sh r3,0x0008(r16)			Frame + 1
000753dc: 920201b4 lbu r2,0x01b4(r16)		
000753e0: 00000000 nop
000753e4: 1040007f beq r2,r0,0x 000755e4
000753e8: 34020001 ori r2,r0,0x0001
000753ec: 8e030158 lw r3,0x0158(r16)           load move selected byte
000753f0: 00000000 nop
000753f4: 10620020 beq r3,r2,0x 00075478     	<Ability Being Used> if True

000753f8: 28620002 slti r2,r3,0x0002
000753fc: 10400005 beq r2,r0,0x 00075414		<Move or End Turn> if 0x0158 > 1
00075400: 00000000 nop
00075404: 1060000a beq r3,r0,0x 00075430		<Get Target Data> if 0
00075408: 00000000 nop
0007540c: 0801d579 j 0x 000755e4				Exit if -1
00075410: 00000000 nop
<Move or End Turn>
00075414: 34020002 ori r2,r0,0x0002
00075418: 10620069 beq r3,r2,0x 000755c0		<End Turn> if 2
0007541c: 34020019 ori r2,r0,0x0019
00075420: 1062000d beq r3,r2,0x 00075458		<Movement being Made> if 0x0158 = 0x19(?)
00075424: 00000000 nop
00075428: 0801d579 j 0x 000755e4				jump to end
0007542c: 00000000 nop
<Get Target Data>
00075430: 92020130 lbu r2,0x0130(r16)
00075434: 00000000 nop
00075438: 10400007 beq r2,r0,0x 00075458
0007543c: 00000000 nop
00075440: 92040131 lbu r4,0x0131(r16)		load ID?
00075444: 0c01e9b9 jal 0x0007a6e4			-->Find Current Misc Unit Data Pointer
00075448: 00000000 nop
0007544c: 90420004 lbu r2,0x0004(r2)		load misc ID?
00075450: 0801d518 j 0x 00075460
00075454: 00000000 nop
<Movement Being Made>
00075458: 3c028009 lui r2,0x8009
0007545c: 8c426118 lw r2,0x6118(r2)			load misc ID?
00075460: 3c018009 lui r1,0x8009
00075464: ac22611c sw r2,0x611c(r1)			store misc ID
00075468: 0c01c5f3 jal 0x000717cc			-->movement being made?
0007546c: 00000000 nop
00075470: 0801d579 j 0x 000755e4				jump to end
00075474: 00000000 nop
Ability Being Used
00075478: 9202015d lbu r2,0x015d(r16)		load skillset used?
0007547c: 00000000 nop
00075480: 2443ffff addiu r3,r2,0xffff
00075484: 2c620018 sltiu r2,r3,0x0018		
00075488: 10400033 beq r2,r0,0x 00075558	<Normal Skillset> if Special Skillset
0007548c: 00031080 sll r2,r3,0x02
00075490: 3c018006 lui r1,0x8006
00075494: 00220821 addu r1,r1,r2
00075498: 8c2275f0 lw r2,0x75f0(r1)			Load Jump Address
0007549c: 00000000 nop
000754a0: 00400008 jr r2
000754a4: 00000000 nop


						000675f0: 80075558 lb r7,0x5558(r0)		attack
						000675f4: 800754a8 lb r7,0x54a8(r0)		defend
						000675f8: 800754ec lb r7,0x54ec(r0)		equip change
						000675fc: 8007553c lb r7,0x553c(r0)		? (goes to Mimic)	
						00067600: 80075558 lb r7,0x5558(r0)		basic skill
						00067604: 80075558 lb r7,0x5558(r0)		item
						00067608: 80075558 lb r7,0x5558(r0)		battle skill
						0006760c: 80075558 lb r7,0x5558(r0)		Charge
						00067610: 80075558 lb r7,0x5558(r0)		Punch Art
						00067614: 80075558 lb r7,0x5558(r0)		White Magic
						00067618: 80075558 lb r7,0x5558(r0)		Black Magic
						0006761c: 80075558 lb r7,0x5558(r0)		Time Magic
						00067620: 80075558 lb r7,0x5558(r0)		Summon Magic
						00067624: 80075558 lb r7,0x5558(r0)		Steal
						00067628: 80075558 lb r7,0x5558(r0)		Talk Skill
						0006762c: 80075558 lb r7,0x5558(r0)		Ying Yang Magic
						00067630: 80075558 lb r7,0x5558(r0)		Elemental
						00067634: 80075558 lb r7,0x5558(r0)		Jump
						00067638: 80075558 lb r7,0x5558(r0)		Draw Out
						0006763c: 80075558 lb r7,0x5558(r0)		Throw
						00067640: 80075558 lb r7,0x5558(r0)		Math Skill
						00067644: 80075558 lb r7,0x5558(r0) 	Sing
						00067648: 80075558 lb r7,0x5558(r0)		Dance
						0006764c: 8007553c lb r7,0x553c(r0)		Mimic


Defend
000754a8: 8e020134 lw r2,0x0134(r16)
000754ac: 00000000 nop
000754b0: 9044018a lbu r4,0x018a(r2)
000754b4: 0c060f80 jal 0x00183e00			-->set Defend for AI calculation
000754b8: 00000000 nop
000754bc: 9202013c lbu r2,0x013c(r16)			load ??
000754c0: 92040004 lbu r4,0x0004(r16)			load misc ID
000754c4: 34420002 ori r2,r2,0x0002				set 0x02 flag
000754c8: 0c01a38c jal 0x00068e30                       -->Set Defend Sprite in Misc Data
000754cc: a202013c sb r2,0x013c(r16)			store new flags
000754d0: 8e020134 lw r2,0x0134(r16)			load unit data
000754d4: 00000000 nop
000754d8: 9044018a lbu r4,0x018a(r2)			load unit ID
000754dc: 0c060eea jal 0x00183ba8			-->Set Only Action Taken
000754e0: 00000000 nop
000754e4: 0801d577 j 0x 000755dc
000754e8: 00000000 nop
Equip Change
000754ec: 9202013c lbu r2,0x013c(r16)
000754f0: 8e040134 lw r4,0x0134(r16)
000754f4: 34420002 ori r2,r2,0x0002
000754f8: 0c060f78 jal 0x00183de0				-->Enable/disable acting status
000754fc: a202013c sb r2,0x013c(r16)
00075500: 8e020134 lw r2,0x0134(r16)
00075504: 00000000 nop
00075508: 9044018a lbu r4,0x018a(r2)
0007550c: 0c0667b2 jal 0x00199ec8				-->usable ability/ENTD calculations
00075510: 00000000 nop
00075514: 92040004 lbu r4,0x0004(r16)
00075518: 0c01a38c jal 0x00068e30			        -->Update Sprite in Misc Data
0007551c: 00000000 nop
00075520: 8e020134 lw r2,0x0134(r16)
00075524: 00000000 nop
00075528: 9044018a lbu r4,0x018a(r2)
0007552c: 0c060eea jal 0x00183ba8				-->Set Only Action Taken
00075530: 00000000 nop
00075534: 0801d577 j 0x 000755dc
00075538: 00000000 nop
Mimic, Blank
0007553c: 8e020134 lw r2,0x0134(r16)
00075540: 00000000 nop
00075544: 9044018a lbu r4,0x018a(r2)
00075548: 0c060eea jal 0x00183ba8				-->Set Only Action Taken
0007554c: 00000000 nop
00075550: 0801d577 j 0x 000755dc
00075554: 00000000 nop
anything but defend/equip change
00075558: 9602015e lhu r2,0x015e(r16)			load used ability
0007555c: 2604015c addiu r4,r16,0x015c
00075560: 0c05ea30 jal 0x0017a8c0				-->calculate ability range
00075564: a6020138 sh r2,0x0138(r16)			store used ability
00075568: 00401821 addu r3,r2,r0				-1 (Unit doesn't exist), 1 (Ability = Follow Target), 0 , 3 (no panels hittable)
0007556c: 34020002 ori r2,r0,0x0002
00075570: 1062000f beq r3,r2,0x 000755b0		<Range Error> if routine returned 2 (it's suppose to, but it can't)
00075574: ae030174 sw r3,0x0174(r16)			Save Range Result
00075578: 28620003 slti r2,r3,0x0003
0007557c: 10400005 beq r2,r0,0x00075594			<Can't Generate Range?> if Ability wasn't able to generate panels
00075580: 00000000 nop
00075584: 0460000a bltz r3,0x000755b0			<Range Error> if unit doesn't exist
00075588: 00000000 nop
0007558c: 0801d568 j 0x000755a0					<Normal Range>		
00075590: 00000000 nop
<Can't generate Range?>
00075594: 34020003 ori r2,r0,0x0003
00075598: 14620005 bne r3,r2,0x 000755b0		<Range Error> if = 3
0007559c: 00000000 nop
<Normal Range> (Returned 0, 1 or >3)
000755a0: 0c01cad4 jal 0x00072b50				-->Execute Action
000755a4: 00000000 nop
000755a8: 0801d579 j 0x 000755e4				<Exit>
000755ac: 00000000 nop
<Range Error> (Returned 3, 2, -1)
000755b0: 0c01d0c2 jal 0x00074308				-->Execute Action (don't animate anything?)
000755b4: 00000000 nop
000755b8: 0801d579 j 0x 000755e4				<Exit>
000755bc: 00000000 nop
<End Turn>
000755c0: 9202013c lbu r2,0x013c(r16)
000755c4: 8e030134 lw r3,0x0134(r16)
000755c8: 34420003 ori r2,r2,0x0003
000755cc: a202013c sb r2,0x013c(r16)			set 0x03 flag
000755d0: 9064018a lbu r4,0x018a(r3)
000755d4: 0c060f1b jal 0x00183c6c				-->end of turn routine for AI processing
000755d8: 00000000 nop
000755dc: 0c01c723 jal 0x00071c8c				-->Execute Action?
000755e0: 00000000 nop
<Exit>
000755e4: 8fbf0018 lw r31,0x0018(r29)
000755e8: 8fb10014 lw r17,0x0014(r29)
000755ec: 8fb00010 lw r16,0x0010(r29)
000755f0: 27bd0020 addiu r29,r29,0x0020
000755f4: 03e00008 jr r31
000755f8: 00000000 nop

Return Location

Battle.bin 
 00079c74: Game Flow Control Routine (Main BATTLE.BIN Loop)