Difference between revisions of "Randomly Transfer Data"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Dokurider moved page 001970bc - 001971b4 to Randomly Transfer Data: Renaming and adding new documentation)
Line 1: Line 1:
<font face='Courier New'>
+
001970bc: 27bdffd0 addiu r29,r29,0xffd0
   
+
001970c0: afb3001c sw r19,0x001c(r29)
  00196fc4: 27bdffd8 addiu r29,r29,0xffd8
+
  001970c4: 00009821 addu r19,r0,r0
  00196fc8: afb40020 sw r20,0x0020(r29)
+
  001970c8: afb00010 sw r16,0x0010(r29)
  00196fcc: 3c14801a lui r20,0x801a
+
001970cc: 00008021 addu r16,r0,r0 r16 = ? Counter
  00196fd0: 2694f3c4 addiu r20,r20,0xf3c4
+
001970d0: afb60028 sw r22,0x0028(r29)
  00196fd4: 26840050 addiu r4,r20,0x0050
+
001970d4: 3c1651eb lui r22,0x51eb
  00196fd8: 26850170 addiu r5,r20,0x0170
+
  001970d8: 36d6851f ori r22,r22,0x851f
  00196fdc: afbf0024 sw r31,0x0024(r29)
+
001970dc: afb40020 sw r20,0x0020(r29)
  00196fe0: afb3001c sw r19,0x001c(r29)
+
  001970e0: 3c14801a lui r20,0x801a
00196fe4: afb20018 sw r18,0x0018(r29)
+
  001970e4: 2694f3c4 addiu r20,r20,0xf3c4
  00196fe8: afb10014 sw r17,0x0014(r29)
+
  001970e8: afb20018 sw r18,0x0018(r29)
  00196fec: 0c065b6c jal 0x00196db0 [[00196db0 - 00196e1c]]
+
  001970ec: 02809021 addu r18,r20,r0
  00196ff0: afb00010 sw r16,0x0010(r29)
+
  001970f0: afbf002c sw r31,0x002c(r29)
  00196ff4: 34030002 ori r3,r0,0x0002
+
  001970f4: afb50024 sw r21,0x0024(r29)
  00196ff8: 14430025 bne r2,r3,0x00197090
+
  001970f8: afb10014 sw r17,0x0014(r29)
  00196ffc: 26840034 addiu r4,r20,0x0034
+
 
  00197000: 0c065b88 jal 0x00196e20 [[00196e20 - 00196ef0]]
+
  <RNG Loop>
  00197004: 26850134 addiu r5,r20,0x0134
+
  001970fc: 92510071 lbu r17,0x0071(r18)
  00197008: 10400021 beq r2,r0,0x00197090
+
  00197100: 00000000 nop
  0019700c: 34100054 ori r16,r0,0x0054
+
00197104: 12200002 beq r17,r0,0x00197110 Branch to RNG if false
  00197010: 00009821 addu r19,r0,r0
+
  00197108: 0010a940 sll r21,r16,0x05
  00197014: 26840034 addiu r4,r20,0x0034
+
  0019710c: 34130001 ori r19,r0,0x0001 r19 = True
  00197018: 0c065b88 jal 0x00196e20 [[00196e20 - 00196ef0]]
+
 
  0019701c: 02902821 addu r5,r20,r16
+
  00197110: 0c0088c3 jal 0x0002230c Load RNG
  00197020: 14400006 bne r2,r0,0x0019703c
+
  00197114: 00000000 nop
  00197024: 34020008 ori r2,r0,0x0008
+
  00197118: 00560018 mult r2,r22 RNG * 0x51eb851f
  00197028: 26730001 addiu r19,r19,0x0001
+
  0019711c: 00021fc3 sra r3,r2,0x1f RNG / 0x1f
  0019702c: 2a620008 slti r2,r19,0x0008
+
  00197120: 00002010 mfhi r4 r4 = Upper bits (Get positive value?)
  00197030: 1440fff8 bne r2,r0,0x00197014
+
  00197124: 00042143 sra r4,r4,0x05
  00197034: 26100020 addiu r16,r16,0x0020
+
  00197128: 00832023 subu r4,r4,r3
  00197038: 34020008 ori r2,r0,0x0008
+
  0019712c: 00041840 sll r3,r4,0x01
  0019703c: 12620014 beq r19,r2,0x00197090
+
  00197130: 00641821 addu r3,r3,r4
  00197040: 2a620007 slti r2,r19,0x0007
+
  00197134: 000318c0 sll r3,r3,0x03
  00197044: 1040000c beq r2,r0,0x00197078
+
  00197138: 00641821 addu r3,r3,r4
  00197048: 34100007 ori r16,r0,0x0007
+
  0019713c: 00031880 sll r3,r3,0x02
  0019704c: 34120114 ori r18,r0,0x0114
+
  00197140: 00431023 subu r2,r2,r3
  00197050: 34110134 ori r17,r0,0x0134
+
 
  00197054: 02912021 addu r4,r20,r17
+
  00197144: 0051102a slt r2,r2,r17
  00197058: 02922821 addu r5,r20,r18
+
  00197148: 14400008 bne r2,r0,0x0019716c Transfer if RNG is greater than r17
0019705c: 0c066ac2 jal 0x0019ab08 [[Transfer Halfword Values]]
+
  0019714c: 26100001 addiu r16,r16,0x0001 r16++
  00197060: 34060020 ori r6,r0,0x0020
+
  00197150: 2a020008 slti r2,r16,0x0008
00197064: 2652ffe0 addiu r18,r18,0xffe0
+
  00197154: 1440ffe9 bne r2,r0,0x001970fc loop 20 times or RNG breaks out
  00197068: 2610ffff addiu r16,r16,0xffff
+
  00197158: 26520020 addiu r18,r18,0x0020
0019706c: 0270102a slt r2,r19,r16
+
  </RNG Loop>
  00197070: 1440fff8 bne r2,r0,0x00197054
+
 
00197074: 2631ffe0 addiu r17,r17,0xffe0
+
  0019715c: 1260000a beq r19,r0,0x00197188 Exit and return 0 if 0x71 = true
00197078: 00102140 sll r4,r16,0x05
+
  00197160: 268417fc addiu r4,r20,0x17fc
  0019707c: 24840054 addiu r4,r4,0x0054
+
  00197164: 08065c5e j 0x00197178 Jump to Transfer
  00197080: 02842021 addu r4,r20,r4
+
  00197168: 26850054 addiu r5,r20,0x0054
00197084: 26850034 addiu r5,r20,0x0034
+
  <Tranfer ?>
  00197088: 0c066ac2 jal 0x0019ab08 [[Transfer Halfword Values]]
+
  0019716c: 268417fc addiu r4,r20,0x17fc
  0019708c: 34060020 ori r6,r0,0x0020
+
  00197170: 26a50054 addiu r5,r21,0x0054
  00197090: 0c0657db jal 0x00195f6c [[Initialize some AI Data (mount, base hit %)]]
+
  00197174: 02852821 addu r5,r20,r5
  00197094: 26840034 addiu r4,r20,0x0034
+
  00197178: 0c066ac2 jal 0x0019ab08 Transfer Halfword Values
  00197098: 8fbf0024 lw r31,0x0024(r29)
+
  0019717c: 34060020 ori r6,r0,0x0020
  0019709c: 8fb40020 lw r20,0x0020(r29)
+
  00197180: 08065c63 j 0x0019718c Exit and Return 1
  001970a0: 8fb3001c lw r19,0x001c(r29)
+
00197184: 34020001 ori r2,r0,0x0001
  001970a4: 8fb20018 lw r18,0x0018(r29)
+
 
  001970a8: 8fb10014 lw r17,0x0014(r29)
+
  00197188: 00001021 addu r2,r0,r0
  001970ac: 8fb00010 lw r16,0x0010(r29)
+
  0019718c: 8fbf002c lw r31,0x002c(r29)
  001970b0: 27bd0028 addiu r29,r29,0x0028
+
00197190: 8fb60028 lw r22,0x0028(r29)
  001970b4: 03e00008 jr r31
+
00197194: 8fb50024 lw r21,0x0024(r29)
  001970b8: 00000000 nop
+
  00197198: 8fb40020 lw r20,0x0020(r29)
</font>
+
  0019719c: 8fb3001c lw r19,0x001c(r29)
 +
  001971a0: 8fb20018 lw r18,0x0018(r29)
 +
  001971a4: 8fb10014 lw r17,0x0014(r29)
 +
  001971a8: 8fb00010 lw r16,0x0010(r29)
 +
  001971ac: 27bd0030 addiu r29,r29,0x0030
 +
  001971b0: 03e00008 jr r31
 +
  001971b4: 00000000 nop

Revision as of 23:20, 8 March 2017

001970bc: 27bdffd0 addiu r29,r29,0xffd0
001970c0: afb3001c sw r19,0x001c(r29)
001970c4: 00009821 addu r19,r0,r0
001970c8: afb00010 sw r16,0x0010(r29)
001970cc: 00008021 addu r16,r0,r0				r16 = ? Counter
001970d0: afb60028 sw r22,0x0028(r29)
001970d4: 3c1651eb lui r22,0x51eb
001970d8: 36d6851f ori r22,r22,0x851f
001970dc: afb40020 sw r20,0x0020(r29)
001970e0: 3c14801a lui r20,0x801a
001970e4: 2694f3c4 addiu r20,r20,0xf3c4
001970e8: afb20018 sw r18,0x0018(r29)
001970ec: 02809021 addu r18,r20,r0
001970f0: afbf002c sw r31,0x002c(r29)
001970f4: afb50024 sw r21,0x0024(r29)
001970f8: afb10014 sw r17,0x0014(r29)
<RNG Loop>
001970fc: 92510071 lbu r17,0x0071(r18)
00197100: 00000000 nop
00197104: 12200002 beq r17,r0,0x00197110		Branch to RNG if false
00197108: 0010a940 sll r21,r16,0x05
0019710c: 34130001 ori r19,r0,0x0001			r19 = True
00197110: 0c0088c3 jal 0x0002230c				Load RNG
00197114: 00000000 nop
00197118: 00560018 mult r2,r22					RNG * 0x51eb851f
0019711c: 00021fc3 sra r3,r2,0x1f				RNG / 0x1f
00197120: 00002010 mfhi r4						r4 = Upper bits (Get positive value?)
00197124: 00042143 sra r4,r4,0x05
00197128: 00832023 subu r4,r4,r3
0019712c: 00041840 sll r3,r4,0x01
00197130: 00641821 addu r3,r3,r4
00197134: 000318c0 sll r3,r3,0x03
00197138: 00641821 addu r3,r3,r4
0019713c: 00031880 sll r3,r3,0x02
00197140: 00431023 subu r2,r2,r3
00197144: 0051102a slt r2,r2,r17
00197148: 14400008 bne r2,r0,0x0019716c			Transfer if RNG is greater than r17
0019714c: 26100001 addiu r16,r16,0x0001			r16++
00197150: 2a020008 slti r2,r16,0x0008
00197154: 1440ffe9 bne r2,r0,0x001970fc			loop 20 times or RNG breaks out
00197158: 26520020 addiu r18,r18,0x0020
</RNG Loop>
0019715c: 1260000a beq r19,r0,0x00197188		Exit and return 0 if 0x71 = true
00197160: 268417fc addiu r4,r20,0x17fc
00197164: 08065c5e j 0x00197178					Jump to Transfer
00197168: 26850054 addiu r5,r20,0x0054
<Tranfer ?>
0019716c: 268417fc addiu r4,r20,0x17fc
00197170: 26a50054 addiu r5,r21,0x0054
00197174: 02852821 addu r5,r20,r5
00197178: 0c066ac2 jal 0x0019ab08				Transfer Halfword Values
0019717c: 34060020 ori r6,r0,0x0020				
00197180: 08065c63 j 0x0019718c					Exit and Return 1
00197184: 34020001 ori r2,r0,0x0001
00197188: 00001021 addu r2,r0,r0
0019718c: 8fbf002c lw r31,0x002c(r29)
00197190: 8fb60028 lw r22,0x0028(r29)
00197194: 8fb50024 lw r21,0x0024(r29)
00197198: 8fb40020 lw r20,0x0020(r29)
0019719c: 8fb3001c lw r19,0x001c(r29)
001971a0: 8fb20018 lw r18,0x0018(r29)
001971a4: 8fb10014 lw r17,0x0014(r29)
001971a8: 8fb00010 lw r16,0x0010(r29)
001971ac: 27bd0030 addiu r29,r29,0x0030
001971b0: 03e00008 jr r31
001971b4: 00000000 nop