Final Fantasy IX/ROM map/CD3: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{rommap|game=Final Fantasy IX}}
{{rommap|game=Final Fantasy IX}}
==Tetra Master==
===Duel PRNG subroutine===
000a8a20: 24040001 addiu r4,r0,0x0001
000a8a24: 0c00d58f jal 0x0003563c
000a8a28: 00000000 nop
000a8a2c: 0c00d524 jal 0x00035490
000a8a30: 00000000 nop
000a8a34: 8fa202f8 lw r2,0x02f8(r29)
000a8a38: 8fa30490 lw r3,0x0490(r29)
000a8a3c: 24420001 addiu r2,r2,0x0001
000a8a40: 24630001 addiu r3,r3,0x0001
000a8a44: afa202f8 sw r2,0x02f8(r29)
000a8a48: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000a8a4c: afa30490 sw r3,0x0490(r29)
000a8a50: 0c02a2f1 jal 0x000a8bc4
000a8a54: 27a40010 addiu r4,r29,0x0010
000a8a58: 8fa30010 lw r3,0x0010(r29)
000a8a5c: 2402000c addiu r2,r0,0x000c
000a8a60: 1462fd04 bne r3,r2,0x000a7e74
000a8a64: 00000000 nop
000a8a68: 00002021 addu r4,r0,r0
000a8a6c: 93a60568 lbu r6,0x0568(r29)
000a8a70: 0c00b1d0 jal 0x0002c740
000a8a74: 00802821 addu r5,r4,r0
000a8a78: 00002021 addu r4,r0,r0
000a8a7c: 93a60569 lbu r6,0x0569(r29)
000a8a80: 0c00b1d0 jal 0x0002c740
000a8a84: 24050001 addiu r5,r0,0x0001
000a8a88: 00002021 addu r4,r0,r0
000a8a8c: 93a6056a lbu r6,0x056a(r29)
000a8a90: 0c00b1d0 jal 0x0002c740
000a8a94: 24050002 addiu r5,r0,0x0002
000a8a98: 00002021 addu r4,r0,r0
000a8a9c: 93a6056b lbu r6,0x056b(r29)
000a8aa0: 0c00b1d0 jal 0x0002c740
000a8aa4: 24050003 addiu r5,r0,0x0003
000a8aa8: 00002021 addu r4,r0,r0
000a8aac: 93a6056c lbu r6,0x056c(r29)
000a8ab0: 0c00b1d0 jal 0x0002c740
000a8ab4: 24050008 addiu r5,r0,0x0008
000a8ab8: 00002021 addu r4,r0,r0
000a8abc: 93a6056e lbu r6,0x056e(r29)
000a8ac0: 0c00b1d0 jal 0x0002c740
000a8ac4: 2405000a addiu r5,r0,0x000a
000a8ac8: 00002021 addu r4,r0,r0
000a8acc: 93a6056d lbu r6,0x056d(r29)
000a8ad0: 0c00b1d0 jal 0x0002c740
000a8ad4: 24050009 addiu r5,r0,0x0009
000a8ad8: 00002021 addu r4,r0,r0
000a8adc: 93a6056f lbu r6,0x056f(r29)
000a8ae0: 0c00b1d0 jal 0x0002c740
000a8ae4: 2405000b addiu r5,r0,0x000b
000a8ae8: 00002021 addu r4,r0,r0
000a8aec: 93a60570 lbu r6,0x0570(r29)
000a8af0: 0c00b1d0 jal 0x0002c740
000a8af4: 24050004 addiu r5,r0,0x0004
000a8af8: 00002021 addu r4,r0,r0
000a8afc: 93a60571 lbu r6,0x0571(r29)
000a8b00: 0c00b1d0 jal 0x0002c740
000a8b04: 24050005 addiu r5,r0,0x0005
000a8b08: 00002021 addu r4,r0,r0
000a8b0c: 93a60572 lbu r6,0x0572(r29)
000a8b10: 0c00b1d0 jal 0x0002c740
000a8b14: 24050006 addiu r5,r0,0x0006
000a8b18: 00002021 addu r4,r0,r0
000a8b1c: 93a60573 lbu r6,0x0573(r29)
000a8b20: 0c00b1d0 jal 0x0002c740
000a8b24: 24050007 addiu r5,r0,0x0007
000a8b28: 0c004c29 jal 0x000130a4
000a8b2c: 00002021 addu r4,r0,r0
000a8b30: 3c028006 lui r2,0x8006
000a8b34: 8c42794c lw r2,0x794c(r2)
000a8b38: 00000000 nop
000a8b3c: 90440009 lbu r4,0x0009(r2)
000a8b40: 0c005716 jal 0x00015c58
000a8b44: 00000000 nop
000a8b48: 0c004c03 jal 0x0001300c
000a8b4c: 00002021 addu r4,r0,r0
000a8b50: 0c00d59d jal 0x00035674
000a8b54: 24040001 addiu r4,r0,0x0001
000a8b58: 0c00d55b jal 0x0003556c
000a8b5c: 00002021 addu r4,r0,r0
000a8b60: 0c00d58f jal 0x0003563c
000a8b64: 00002021 addu r4,r0,r0
000a8b68: 8fbf05ec lw r31,0x05ec(r29)
000a8b6c: 8fb205e8 lw r18,0x05e8(r29)
000a8b70: 8fb105e4 lw r17,0x05e4(r29)
000a8b74: 8fb005e0 lw r16,0x05e0(r29)
000a8b78: 03e00008 jr r31
000a8b7c: 27bd05f0 addiu r29,r29,0x05f0
===Card selection before battle===
000aab7c: 02021024 and r2,r16,r2
000aab80: 104000c6 beq r2,r0,0x000aae9c
000aab84: 00000000 nop
000aab88: 8e220438 lw r2,0x0438(r17)
000aab8c: 00000000 nop
000aab90: 10400044 beq r2,r0,0x000aaca4
000aab94: 00000000 nop
000aab98: 0c0189c9 jal 0x00062724
000aab9c: 3c106666 lui r16,0x6666
000aaba0: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aaba4: 36106667 ori r16,r16,0x6667
000aaba8: 00500018 mult r2,r16
000aabac: 00021fc3 sra r3,r2,0x1f
000aabb0: 00004810 mfhi r9
000aabb4: 00092083 sra r4,r9,0x02
000aabb8: 00832023 subu r4,r4,r3
000aabbc: 00041880 sll r3,r4,0x02
000aabc0: 00641821 addu r3,r3,r4
000aabc4: 00031840 sll r3,r3,0x01
000aabc8: 00431023 subu r2,r2,r3
000aabcc: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aabd0: ae220474 sw r2,0x0474(r17)
000aabd4: 00500018 mult r2,r16
000aabd8: 02202021 addu r4,r17,r0
000aabdc: 00021fc3 sra r3,r2,0x1f
000aabe0: ae2004b4 sw r0,0x04b4(r17)
000aabe4: 00004810 mfhi r9
000aabe8: 00092883 sra r5,r9,0x02
000aabec: 00a32823 subu r5,r5,r3
000aabf0: 00051880 sll r3,r5,0x02
000aabf4: 00651821 addu r3,r3,r5
000aabf8: 00031840 sll r3,r3,0x01
000aabfc: 00431023 subu r2,r2,r3
000aac00: 0c02bc9a jal 0x000af268
000aac04: ae220478 sw r2,0x0478(r17)
000aac08: 0c018958 jal 0x00062560
000aac0c: 00402021 addu r4,r2,r0
000aac10: 14400024 bne r2,r0,0x000aaca4
000aac14: 00000000 nop
000aac18: 0c02bc9a jal 0x000af268
000aac1c: 02202021 addu r4,r17,r0
000aac20: 02202021 addu r4,r17,r0
000aac24: 0c02bc7d jal 0x000af1f4
000aac28: 00402821 addu r5,r2,r0
000aac2c: 0c02bc9a jal 0x000af268
000aac30: 02202021 addu r4,r17,r0
000aac34: 02202021 addu r4,r17,r0
000aac38: 0c02bc7d jal 0x000af1f4
000aac3c: 00402821 addu r5,r2,r0
000aac40: 0c02bc9a jal 0x000af268
000aac44: 02202021 addu r4,r17,r0
000aac48: 02202021 addu r4,r17,r0
000aac4c: 0c02bc7d jal 0x000af1f4
000aac50: 00402821 addu r5,r2,r0
000aac54: 0c02bc9a jal 0x000af268
000aac58: 02202021 addu r4,r17,r0
000aac5c: 02202021 addu r4,r17,r0
000aac60: 0c02bc7d jal 0x000af1f4
000aac64: 00402821 addu r5,r2,r0
000aac68: 0c02bc9a jal 0x000af268
000aac6c: 02202021 addu r4,r17,r0
000aac70: 02202021 addu r4,r17,r0
000aac74: 0c02bc7d jal 0x000af1f4
000aac78: 00402821 addu r5,r2,r0
000aac7c: 0c02bc9a jal 0x000af268
000aac80: 02202021 addu r4,r17,r0
000aac84: 02202021 addu r4,r17,r0
000aac88: 0c02bc7d jal 0x000af1f4
000aac8c: 00402821 addu r5,r2,r0
000aac90: 0c02bc9a jal 0x000af268
000aac94: 02202021 addu r4,r17,r0
000aac98: 02202021 addu r4,r17,r0
000aac9c: 0c02bc7d jal 0x000af1f4
000aaca0: 00402821 addu r5,r2,r0
000aaca4: 0c02bc9a jal 0x000af268
000aaca8: 02202021 addu r4,r17,r0
000aacac: 8e2504b4 lw r5,0x04b4(r17)
000aacb0: 0c018968 jal 0x000625a0
000aacb4: 00402021 addu r4,r2,r0
000aacb8: 00402021 addu r4,r2,r0
000aacbc: 2402ffff addiu r2,r0,0xffff
000aacc0: 10820076 beq r4,r2,0x000aae9c
000aacc4: 00000000 nop
000aacc8: 8e23047c lw r3,0x047c(r17)
000aaccc: 00000000 nop
000aacd0: 00031100 sll r2,r3,0x04
000aacd4: 00431023 subu r2,r2,r3
000aacd8: 00021080 sll r2,r2,0x02
000aacdc: 24420010 addiu r2,r2,0x0010
000aace0: 90830000 lbu r3,0x0000(r4) ;r3 = Card ID
000aace4: 02224021 addu r8,r17,r2 ;r8 = r17 + r2
000aace8: a1030000 sb r3,0x0000(r8) ;store Card ID in 0x801FF9F0 + offset
000aacec: 90820002 lbu r2,0x0002(r4) ;r2 = Card Attack
000aacf0: 00000000 nop
000aacf4: a1020002 sb r2,0x0002(r8)
000aacf8: 90820003 lbu r2,0x0003(r4)
000aacfc: 00000000 nop
000aad00: a1020003 sb r2,0x0003(r8)
000aad04: 90820004 lbu r2,0x0004(r4)
000aad08: 00000000 nop
000aad0c: a1020004 sb r2,0x0004(r8)
000aad10: 90820005 lbu r2,0x0005(r4)
000aad14: 00000000 nop
000aad18: a1020005 sb r2,0x0005(r8)
000aad1c: 90820001 lbu r2,0x0001(r4)
000aad20: 02202021 addu r4,r17,r0
000aad24: 0c02bc9a jal 0x000af268
000aad28: a1020001 sb r2,0x0001(r8)
000aad2c: 8e2504b4 lw r5,0x04b4(r17)
000aad30: 0c0189b4 jal 0x000626d0
000aad34: 00402021 addu r4,r2,r0
000aad38: 24040005 addiu r4,r0,0x0005
000aad3c: 0c02c07a jal 0x000b01e8
000aad40: ae2004b4 sw r0,0x04b4(r17)
000aad44: 8e22047c lw r2,0x047c(r17)
000aad48: 24030005 addiu r3,r0,0x0005
000aad4c: 24420001 addiu r2,r2,0x0001
000aad50: 14430052 bne r2,r3,0x000aae9c
000aad54: ae22047c sw r2,0x047c(r17)
000aad58: 24040006 addiu r4,r0,0x0006
000aad5c: 3c028007 lui r2,0x8007
000aad60: 0c00d5dd jal 0x00035774
000aad64: ac407df0 sw r0,0x7df0(r2)
000aad68: 0c00ae9a jal 0x0002ba68
000aad6c: 00402021 addu r4,r2,r0
000aad70: 27a40018 addiu r4,r29,0x0018
000aad74: 24050006 addiu r5,r0,0x0006
000aad78: 24060002 addiu r6,r0,0x0002
000aad7c: 24420012 addiu r2,r2,0x0012
000aad80: a7a2001c sh r2,0x001c(r29)
000aad84: 00021400 sll r2,r2,0x10
000aad88: 00021c03 sra r3,r2,0x10
000aad8c: 000217c2 srl r2,r2,0x1f
000aad90: 00621821 addu r3,r3,r2
000aad94: 00031843 sra r3,r3,0x01
000aad98: 240200a0 addiu r2,r0,0x00a0
000aad9c: 00431023 subu r2,r2,r3
000aada0: a7a20018 sh r2,0x0018(r29)
000aada4: 24020053 addiu r2,r0,0x0053
000aada8: a7a2001a sh r2,0x001a(r29)
000aadac: 2402003a addiu r2,r0,0x003a
000aadb0: 0c00b715 jal 0x0002dc54
000aadb4: a7a2001e sh r2,0x001e(r29)
000aadb8: 00402021 addu r4,r2,r0
000aadbc: 3c05800b lui r5,0x800b
000aadc0: 24a5b060 addiu r5,r5,0xb060
000aadc4: 0c00b8bb jal 0x0002e2ec
000aadc8: ae240458 sw r4,0x0458(r17)
000aadcc: 8e240458 lw r4,0x0458(r17)
000aadd0: 0c00b8c7 jal 0x0002e31c
000aadd4: 24050001 addiu r5,r0,0x0001
000aadd8: 8e240458 lw r4,0x0458(r17)
000aaddc: 0c02ae27 jal 0x000ab89c
000aade0: 00000000 nop
000aade4: 24020013 addiu r2,r0,0x0013
000aade8: 0802aba6 j 0x000aae98
000aadec: ae200004 sw r0,0x0004(r17)
===Generate enemy cards ?===
000aea24: 27bdffd0 addiu r29,r29,0xffd0 ;r29 -= 0x30
000aea28: afb60028 sw r22,0x0028(r29) ;store r22 in (r29+0x28)
000aea2c: 3c168010 lui r22,0x8010
000aea30: 36d63800 ori r22,r22,0x3800 ;r22 = 0x80103800 (Base Stats)
000aea34: afb10014 sw r17,0x0014(r29) ;store r17 in (r29+0x14)
000aea38: 00008821 addu r17,r0,r0 ;r17 = 0
000aea3c: afb40020 sw r20,0x0020(r29) ;store r20 in (r29+0x20)
000aea40: 24140002 addiu r20,r0,0x0002 ;r20 = 2
000aea44: afb3001c sw r19,0x001c(r29) ;store r19 in (r29+0x1c)
000aea48: 24130003 addiu r19,r0,0x0003 ;r19 = 3
000aea4c: afb50024 sw r21,0x0024(r29) ;store r21 in (r29+0x24)
000aea50: 24950010 addiu r21,r4,0x0010 ;r21 = r4 + 0x10
000aea54: afb00010 sw r16,0x0010(r29) ;store r16 in (r29+0x10)
000aea58: 02a08021 addu r16,r21,r0 ;r16 = r21
000aea5c: afb20018 sw r18,0x0018(r29) ;store r18 in (r29+0x18)
000aea60: 02209021 addu r18,r17,r0 ;r18 = r17
000aea64: afbf002c sw r31,0x002c(r29) ;store r31 in (r29+0x2c)
000aea68: 240200dc addiu r2,r0,0x00dc ;r2 = 0xdc (start of loop from 0x000aeb68)
000aea6c: ae02000c sw r2,0x000c(r16) ;store r2 in (r16+0xc)
000aea70: 24020028 addiu r2,r0,0x0028 ;r2 = 0x28
000aea74: ae120010 sw r18,0x0010(r16) ;store r18 in (r16+0x10)
000aea78: ae000014 sw r0,0x0014(r16) ;store 0 in (r16+0x14)
000aea7c: ae000018 sw r0,0x0018(r16) ;store 0 in (r16+0x18)
000aea80: ae000008 sw r0,0x0008(r16) ;store 0 in (r16+0x8)
000aea84: ae020030 sw r2,0x0030(r16) ;store r2 in (r16+0x30)
000aea88: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aea8c: a2000000 sb r0,0x0000(r16) ;store 0 in Card ID
000aea90: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aea94: a2020001 sb r2,0x0001(r16) ;store PRN[0;0xFF] in Arrows
000aea98: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aea9c: a2020002 sb r2,0x0002(r16) ;store PRN[0;0xFF] in Attack
000aeaa0: 30430003 andi r3,r2,0x0003
000aeaa4: 24020001 addiu r2,r0,0x0001
000aeaa8: 1062000f beq r3,r2,0x000aeae8 ;if((r2 & 3) == 1), branch to 0x000aeae8
000aeaac: 28620002 slti r2,r3,0x0002
000aeab0: 10400005 beq r2,r0,0x000aeac8 ;if((r2 & 3) ≥ 2), branch to 0x000aeac8
000aeab4: 00000000 nop
000aeab8: 10600009 beq r3,r0,0x000aeae0 ;if((r2 & 3) == 0), branch to 0x000aeae0
000aeabc: 00000000 nop
000aeac0: 0802babf j 0x000aeafc ;'''error trap''', jump to 0x000aeafc
000aeac4: 00000000 nop
000aeac8: 10740009 beq r3,r20,0x000aeaf0 ;if((r2 & 3) == 2), branch to 0x000aeaf0
000aeacc: 00000000 nop
000aead0: 10730009 beq r3,r19,0x000aeaf8 ;if((r2 & 3) == 3), branch to 0x000aeaf8
000aead4: 00000000 nop
000aead8: 0802babf j 0x000aeafc ;'''error trap''', jump to 0x000aeafc
000aeadc: 00000000 nop
000aeae0: 0802babf j 0x000aeafc ;jump to 0x000aeafc
000aeae4: a2000003 sb r0,0x0003(r16) ;Type = P
000aeae8: 0802babf j 0x000aeafc ;jump to 0x000aeafc
000aeaec: a2030003 sb r3,0x0003(r16) ;store r3 in Type (Type = M)
000aeaf0: 0802babf j 0x000aeafc ;jump to 0x000aeafc
000aeaf4: a2130003 sb r19,0x0003(r16) ;store r19 in Type
000aeaf8: a2140003 sb r20,0x0003(r16) ;store r20 in Type
000aeafc: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aeb00: 2652001e addiu r18,r18,0x001e ;r18 += 0x1e
000aeb04: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aeb08: a2020004 sb r2,0x0004(r16) ;store PRN[0;0xFF] in Physical Defense
000aeb0c: a2020005 sb r2,0x0005(r16) ;store PRN[0;0xFF] in Magical Defense
000aeb10: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000aeb14: a2110000 sb r17,0x0000(r16) ;store r17 in (r16)
000aeb18: a2020001 sb r2,0x0001(r16) ;store PRN[0;0xFF] in Arrows
000aeb1c: 02201021 addu r2,r17,r0 ;r2 = r17
000aeb20: 304200ff andi r2,r2,0x00ff ;r2 &= 0xFF
000aeb24: 00021880 sll r3,r2,0x02
000aeb28: 00621821 addu r3,r3,r2
000aeb2c: 00761821 addu r3,r3,r22 ;r3 = r22 + (r2 * 5)
000aeb30: 90620000 lbu r2,0x0000(r3) ;r2 = Base Attack
000aeb34: 00000000 nop
000aeb38: a2020002 sb r2,0x0002(r16) ;store r2 in (r16+0x2)
000aeb3c: 90620001 lbu r2,0x0001(r3) ;r2 = Base Type
000aeb40: 00000000 nop
000aeb44: a2020003 sb r2,0x0003(r16) ;store r2 in (r16+0x3)
000aeb48: 90620002 lbu r2,0x0002(r3) ;r2 = Base Physical Defense
000aeb4c: 00000000 nop
000aeb50: a2020004 sb r2,0x0004(r16) ;store r2 in (r16+0x4)
000aeb54: 90620003 lbu r2,0x0003(r3) ;r2 = Base Magical Defense
000aeb58: 26310001 addiu r17,r17,0x0001 ;r17++
000aeb5c: ae000034 sw r0,0x0034(r16) ;store 0 in (r16+0x34)
000aeb60: a2020005 sb r2,0x0005(r16) ;store r2 in (r16+0x5)
000aeb64: 2a22000a slti r2,r17,0x000a
000aeb68: 1440ffbf bne r2,r0,0x000aea68 ;if(r17<10), loop to 0x000aea68
000aeb6c: 2610003c addiu r16,r16,0x003c ;r16 += 60
000aeb70: 24110005 addiu r17,r0,0x0005 ;r17 = 5
000aeb74: 26a4012c addiu r4,r21,0x012c ;r4 = r21 + 300
000aeb78: ac800034 sw r0,0x0034(r4) ;store r0 in (r4+0x34)
000aeb7c: 26310001 addiu r17,r17,0x0001 ;r17++
000aeb80: 2a22000a slti r2,r17,0x000a
000aeb84: 1440fffc bne r2,r0,0x000aeb78 ;if(r17<10), loop to 0x000aeb78
000aeb88: 2484003c addiu r4,r4,0x003c ;r4 += 60
000aeb8c: 8fbf002c lw r31,0x002c(r29) ;r31 = (r29+0x2c)
000aeb90: 8fb60028 lw r22,0x0028(r29) ;r22 = (r29+0x28)
000aeb94: 8fb50024 lw r21,0x0024(r29) ;r21 = (r29+0x24)
000aeb98: 8fb40020 lw r20,0x0020(r29) ;r20 = (r29+0x20)
000aeb9c: 8fb3001c lw r19,0x001c(r29) ;r19 = (r29+0x1c)
000aeba0: 8fb20018 lw r18,0x0018(r29) ;r18 = (r29+0x18)
000aeba4: 8fb10014 lw r17,0x0014(r29) ;r17 = (r29+0x14)
000aeba8: 8fb00010 lw r16,0x0010(r29) ;r16 = (r29+0x10)
000aebac: 03e00008 jr r31 ;jump to r31
000aebb0: 27bd0030 addiu r29,r29,0x0030 ;r29 += 0x30
==0x000b050c==
000b050c: a242ffff sb r2,-0x0001(r18)
000b0510: 24020064 addiu r2,r0,0x0064
000b0514: a2420003 sb r2,0x0003(r18)
000b0518: 8ee30000 lw r3,0x0000(r23)
000b051c: 24020015 addiu r2,r0,0x0015
000b0520: 14620002 bne r3,r2,0x000b052c
000b0524: 24020066 addiu r2,r0,0x0066
000b0528: a2420003 sb r2,0x0003(r18)
000b052c: 96620004 lhu r2,0x0004(r19)
000b0530: 00000000 nop
000b0534: a6420004 sh r2,0x0004(r18)
000b0538: 96620008 lhu r2,0x0008(r19)
000b053c: a2550000 sb r21,0x0000(r18)
000b0540: a2550001 sb r21,0x0001(r18)
000b0544: a2550002 sb r21,0x0002(r18)
000b0548: a6420006 sh r2,0x0006(r18)
000b054c: 8e62000c lw r2,0x000c(r19)
000b0550: 00000000 nop
000b0554: 14400002 bne r2,r0,0x000b0560
000b0558: 24020098 addiu r2,r0,0x0098
000b055c: 24020068 addiu r2,r0,0x0068
000b0560: a2420008 sb r2,0x0008(r18)
000b0564: a25e0009 sb r30,0x0009(r18)
000b0568: 02802821 addu r5,r20,r0
000b056c: 8fa40014 lw r4,0x0014(r29)
000b0570: 24023a80 addiu r2,r0,0x3a80
000b0574: a642000a sh r2,0x000a(r18)
000b0578: 2402002a addiu r2,r0,0x002a
000b057c: a642000c sh r2,0x000c(r18)
000b0580: 24020033 addiu r2,r0,0x0033
000b0584: 0c018e9d jal 0x00063a74
000b0588: a642000e sh r2,0x000e(r18)
000b058c: 26520014 addiu r18,r18,0x0014
000b0590: 26940014 addiu r20,r20,0x0014
000b0594: 24040001 addiu r4,r0,0x0001
000b0598: 00802821 addu r5,r4,r0
000b059c: 00801021 addu r2,r4,r0
000b05a0: 24060300 addiu r6,r0,0x0300
000b05a4: 24070100 addiu r7,r0,0x0100
000b05a8: 0c01433e jal 0x00050cf8
000b05ac: a242ffff sb r2,-0x0001(r18)
000b05b0: 02802821 addu r5,r20,r0
000b05b4: 304209ff andi r2,r2,0x09ff
000b05b8: 3c03e100 lui r3,0xe100
000b05bc: 8fa40014 lw r4,0x0014(r29)
000b05c0: 00431025 or r2,r2,r3
000b05c4: 0c018e9d jal 0x00063a74
000b05c8: ae420000 sw r2,0x0000(r18)
000b05cc: 26520008 addiu r18,r18,0x0008
000b05d0: 26940008 addiu r20,r20,0x0008
000b05d4: 26d60001 addiu r22,r22,0x0001
000b05d8: 2ac20006 slti r2,r22,0x0006
000b05dc: 1440ff6a bne r2,r0,0x000b0388
000b05e0: 26730010 addiu r19,r19,0x0010
000b05e4: 02801021 addu r2,r20,r0
000b05e8: 8fbf003c lw r31,0x003c(r29)
000b05ec: 8fbe0038 lw r30,0x0038(r29)
000b05f0: 8fb70034 lw r23,0x0034(r29)
000b05f4: 8fb60030 lw r22,0x0030(r29)
000b05f8: 8fb5002c lw r21,0x002c(r29)
000b05fc: 8fb40028 lw r20,0x0028(r29)
000b0600: 8fb30024 lw r19,0x0024(r29)
000b0604: 8fb20020 lw r18,0x0020(r29)
000b0608: 8fb1001c lw r17,0x001c(r29)
000b060c: 8fb00018 lw r16,0x0018(r29)
000b0610: 03e00008 jr r31
000b0614: 27bd0040 addiu r29,r29,0x0040
==Tetra Masters - Board blocks==
===Blocks amount===
0 blocks: 3%
1 blocks: 4%
2 blocks: 5%
3 blocks: 5%
4 blocks: 10%
5 blocks: 70%
6 blocks: 3%<br>
000b0618: 27bdffd0 addiu r29,r29,0xffd0 ;r29 -= 0x20
000b061c: afb60028 sw r22,0x0028(r29) ;store r22 in (r29+0x28)
000b0620: 0080b021 addu r22,r4,r0 ;r22 = r4
000b0624: afb3001c sw r19,0x001c(r29) ;store r19 in (r19+0x1c)
000b0628: 00009821 addu r19,r0,r0 ;r19 = 0
000b062c: 24040001 addiu r4,r0,0x0001 ;r4 = 1
000b0630: afb00010 sw r16,0x0010(r29) ;store r16 in (r29+0x10)
000b0634: 26d002f0 addiu r16,r22,0x02f0 ;r16 = r22 + 0x2f0
000b0638: 02001821 addu r3,r16,r0 ;r3 = r16
000b063c: afbf002c sw r31,0x002c(r29) ;store r31 in (r29+0x2c)
000b0640: afb50024 sw r21,0x0024(r29) ;store r21 in (r29+0x24)
000b0644: afb40020 sw r20,0x0020(r29) ;store r20 in (r29+0x20)
000b0648: afb20018 sw r18,0x0018(r29) ;store r18 in (r29+0x18)
000b064c: afb10014 sw r17,0x0014(r29) ;store r17 in (r29+0x14)
000b0650: ac640000 sw r4,0x0000(r3) ;store r4 to (r3)
000b0654: ac600004 sw r0,0x0004(r3) ;store 0 to (r3+0x4)
000b0658: 26730001 addiu r19,r19,0x0001 ;r19++
000b065c: 2a620006 slti r2,r19,0x0006
000b0660: 1440fffb bne r2,r0,0x000b0650 ;if(r19 < 6), loop to 0x000b0650
000b0664: 24630010 addiu r3,r3,0x0010
000b0668: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000b066c: 00000000 nop
000b0670: 3c0351eb lui r3,0x51eb
000b0674: 3463851f ori r3,r3,0x851f
000b0678: 00430018 mult r2,r3
000b067c: 00021fc3 sra r3,r2,0x1f
000b0680: 00003810 mfhi r7 ;r7 = (PRN × 0x51eb851f) >> 32
000b0684: 00072143 sra r4,r7,0x05 ;r4 = r7 >> 5
000b0688: 00832023 subu r4,r4,r3
000b068c: 00041840 sll r3,r4,0x01
000b0690: 00641821 addu r3,r3,r4
000b0694: 000318c0 sll r3,r3,0x03
000b0698: 00641821 addu r3,r3,r4
000b069c: 00031880 sll r3,r3,0x02 ;r3 = r4 × 100
000b06a0: 00432023 subu r4,r2,r3 ;r4 = PRN[0;0x7FFF] - r3
000b06a4: 2c820003 sltiu r2,r4,0x0003
000b06a8: 14400016 bne r2,r0,0x000b0704 ;if(r4 < 3), branch to 0x000b0704
000b06ac: 0000a021 addu r20,r0,r0 ;r20 = 0
000b06b0: 2482fffd addiu r2,r4,0xfffd ;r2 = r4 - 3
000b06b4: 2c420004 sltiu r2,r2,0x0004
000b06b8: 14400012 bne r2,r0,0x000b0704 ;if((r4 - 3) < 4), branch to 0x000b0704
000b06bc: 24140001 addiu r20,r0,0x0001 ;r20 = 1
000b06c0: 2482fff9 addiu r2,r4,0xfff9 ;r2 = r4 - 7
000b06c4: 2c420005 sltiu r2,r2,0x0005
000b06c8: 1440000e bne r2,r0,0x000b0704 ;if((r4 - 7) < 5), branch to 0x000b0704
000b06cc: 24140002 addiu r20,r0,0x0002 ;r20 = 2
000b06d0: 2482fff4 addiu r2,r4,0xfff4 ;r2 = r4 - 12
000b06d4: 2c420005 sltiu r2,r2,0x0005
000b06d8: 1440000a bne r2,r0,0x000b0704 ;if((r4 - 12) < 5), branch to 0x000b0704
000b06dc: 24140003 addiu r20,r0,0x0003 ;r20 = 3
000b06e0: 2482ffef addiu r2,r4,0xffef ;r2 = r4 - 17
000b06e4: 2c42000a sltiu r2,r2,0x000a
000b06e8: 14400006 bne r2,r0,0x000b0704 ;if((r4 - 17) < 10), branch to 0x000b0704
000b06ec: 24140004 addiu r20,r0,0x0004 ;r20 = 4
000b06f0: 2482ffe5 addiu r2,r4,0xffe5 ;r2 = r4 - 27
000b06f4: 2c420046 sltiu r2,r2,0x0046
000b06f8: 10400002 beq r2,r0,0x000b0704 ;if((r4 - 27) ≥ 70), branch to 0x000b0704
000b06fc: 24140006 addiu r20,r0,0x0006 ;r20 = 6
000b0700: 24140005 addiu r20,r0,0x0005 ;r20 = 5
000b0704: 00009821 addu r19,r0,r0 ;r19 = 0
000b0708: aed40570 sw r20,0x0570(r22) ;store r20 in (r22+0x570)
===Blocks placement===
000b070c: 12800029 beq r20,r0,0x000b07b4 ;if(no blocks), branch to 0x000b07b4
000b0710: aec0056c sw r0,0x056c(r22) ;store 0 to (r22+0x056c)
000b0714: 24150001 addiu r21,r0,0x0001 ;r21 = 1
000b0718: 02009021 addu r18,r16,r0 ;r18 = r16
000b071c: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000b0720: 00000000 nop
000b0724: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000b0728: 30500003 andi r16,r2,0x0003 ;r16 = PRN1[0;0x7FFF] & 3
000b072c: 30510003 andi r17,r2,0x0003 ;r17 = PRN2[0;0x7FFF] & 3
000b0730: 02c02021 addu r4,r22,r0 ;r4 = r22
000b0734: 02002821 addu r5,r16,r0 ;r5 = r16
000b0738: 0c02c675 jal 0x000b19d4 ;[[#Checks_row_and_column|Checks row and column]]
000b073c: 02203021 addu r6,r17,r0 ;r6 = r17
000b0740: 00401821 addu r3,r2,r0 ;r3 = r2
000b0744: 8c620000 lw r2,0x0000(r3) ;r2 = (r3)
000b0748: 00000000 nop
000b074c: 1455fff3 bne r2,r21,0x000b071c ;if there's already a block there, loop to 0x000b071c
000b0750: 24020002 addiu r2,r0,0x0002 ;r2 = 2
000b0754: ac620000 sw r2,0x0000(r3) ;store r2 in (r3)
000b0758: 00101040 sll r2,r16,0x01
000b075c: 00501021 addu r2,r2,r16
000b0760: 00021080 sll r2,r2,0x02
000b0764: 00501023 subu r2,r2,r16
000b0768: 00021080 sll r2,r2,0x02
000b076c: 00501023 subu r2,r2,r16
000b0770: 24420048 addiu r2,r2,0x0048 ;r2 = r16 × 43 + 72
000b0774: ae420004 sw r2,0x0004(r18) ;store r2 in (r18+0x4)
000b0778: 00111040 sll r2,r17,0x01
000b077c: 00511021 addu r2,r2,r17
000b0780: 00021080 sll r2,r2,0x02
000b0784: 00511021 addu r2,r2,r17
000b0788: 00021080 sll r2,r2,0x02
000b078c: 24420008 addiu r2,r2,0x0008 ;r2 = r17 × 52 + 8
000b0790: ae550000 sw r21,0x0000(r18) ;store r21 in (r18)
000b0794: 0c018acf jal 0x00062b3c ;[[#Tetra_Master_PRNG|PRNG call]]
000b0798: ae420008 sw r2,0x0008(r18) ;store r2 in (r18+0x8)
000b079c: 30420001 andi r2,r2,0x0001 ;r2 &= 1
000b07a0: ae42000c sw r2,0x000c(r18) ;store r2 in (r18+0xc)
000b07a4: 26730001 addiu r19,r19,0x0001 ;r19++
000b07a8: 0274102a slt r2,r19,r20
000b07ac: 1440ffdb bne r2,r0,0x000b071c ;if(r19 < blocks_amount), loop to 0x000b071c
000b07b0: 26520010 addiu r18,r18,0x0010 ;r18 += 0x10
000b07b4: 8fbf002c lw r31,0x002c(r29) ;r31 = (r29+0x2c)
000b07b8: 8fb60028 lw r22,0x0028(r29) ;r22 = (r29+0x28)
000b07bc: 8fb50024 lw r21,0x0024(r29) ;r21 = (r29+0x24)
000b07c0: 8fb40020 lw r20,0x0020(r29) ;r20 = (r29+0x20)
000b07c4: 8fb3001c lw r19,0x001c(r29) ;r19 = (r29+0x1c)
000b07c8: 8fb20018 lw r18,0x0018(r29) ;r18 = (r29+0x18)
000b07cc: 8fb10014 lw r17,0x0014(r29) ;r17 = (r29+0x14)
000b07d0: 8fb00010 lw r16,0x0010(r29) ;r16 = (r29+0x10)
000b07d4: 03e00008 jr r31 ;jump to (r31)
000b07d8: 27bd0030 addiu r29,r29,0x0030 ;r29 += 0x30
===Checks row and column===
000b19d4: 04a10004 bgez r5,0x000b19e8 ;if(PRN1[0;3] > 0), branch to 0x000b19e8
000b19d8: 24840268 addiu r4,r4,0x0268 ;r4 += 0x268
000b19dc: 3c02800b lui r2,0x800b
000b19e0: 03e00008 jr r31
000b19e4: 24423ce8 addiu r2,r2,0x3ce8 ;r2 = 0x800b3ce8
000b19e8: 28a20004 slti r2,r5,0x0004
000b19ec: 1040fffc beq r2,r0,0x000b19e0 ;'''error trap''', branch to 0x000b19e0 if column is out of bounds
000b19f0: 3c02800b lui r2,0x800b
000b19f4: 04c0fffa bltz r6,0x000b19e0 ;'''error trap''', branch to 0x000b19e0 if row is negative
000b19f8: 00000000 nop
000b19fc: 28c20004 slti r2,r6,0x0004
000b1a00: 10400005 beq r2,r0,0x000b1a18 ;'''error trap''', branch to 0x000b1a18 if row is out of bounds
000b1a04: 000518c0 sll r3,r5,0x03 ;r3 = column << 3
000b1a08: 00061140 sll r2,r6,0x05 ;r2 = row << 5
000b1a0c: 00821021 addu r2,r4,r2 ;r2 += offset
000b1a10: 03e00008 jr r31
000b1a14: 00431021 addu r2,r2,r3 ;r2 = 0x800b3ce8 + column << 3 + row << 5
000b1a18: 3c02800b lui r2,0x800b
000b1a1c: 03e00008 jr r31
000b1a20: 24423ce8 addiu r2,r2,0x3ce8 ;r2 = 0x800b3ce8 (if row is out of bounds)


==Tetra Master PRNG call when entering the World Map, and ?==
==Tetra Master PRNG call when entering the World Map, and ?==
<tt>0xc4a5c-0xc4dd4</tt> - Calls Tetra Masters PRNG 30 times when loading the World Map, and ?
  000c4a5c: 27bdffd0 addiu r29,r29,0xffd0
  000c4a5c: 27bdffd0 addiu r29,r29,0xffd0
  000c4a60: afb10014 sw r17,0x0014(r29) ;store r17 in (r29+0x14)
  000c4a60: afb10014 sw r17,0x0014(r29) ;store r17 in (r29+0x14)
Line 227: Line 796:


==Tetra Master PRNG==
==Tetra Master PRNG==
  seed × 0x41C64E6D + 0x3039
  seed × 0x41C64E6D + 0x3039<br>
 
  07c02200: 3c03a001 lui r3,0xa001
  07c02200: 3c03a001 lui r3,0xa001
  07c02204: 8c639010 lw r3,-0x6ff0(r3)
  07c02204: 8c639010 lw r3,-0x6ff0(r3)
Line 246: Line 814:
  07c02234: 03e00008 jr r31
  07c02234: 03e00008 jr r31
  07c02238: ac249010 sw r4,-0x6ff0(r1)
  07c02238: ac249010 sw r4,-0x6ff0(r1)
{{Internal Data|game=Final Fantasy IX}}

Latest revision as of 10:09, 3 February 2024

Chip tiny.png The following article is a ROM map for Final Fantasy IX/ROM map.

Tetra Master

Duel PRNG subroutine

000a8a20: 24040001 addiu r4,r0,0x0001
000a8a24: 0c00d58f jal 0x0003563c
000a8a28: 00000000 nop
000a8a2c: 0c00d524 jal 0x00035490
000a8a30: 00000000 nop
000a8a34: 8fa202f8 lw r2,0x02f8(r29)
000a8a38: 8fa30490 lw r3,0x0490(r29)
000a8a3c: 24420001 addiu r2,r2,0x0001
000a8a40: 24630001 addiu r3,r3,0x0001
000a8a44: afa202f8 sw r2,0x02f8(r29)
000a8a48: 0c018acf jal 0x00062b3c		;PRNG call
000a8a4c: afa30490 sw r3,0x0490(r29)
000a8a50: 0c02a2f1 jal 0x000a8bc4
000a8a54: 27a40010 addiu r4,r29,0x0010
000a8a58: 8fa30010 lw r3,0x0010(r29)
000a8a5c: 2402000c addiu r2,r0,0x000c
000a8a60: 1462fd04 bne r3,r2,0x000a7e74
000a8a64: 00000000 nop
000a8a68: 00002021 addu r4,r0,r0
000a8a6c: 93a60568 lbu r6,0x0568(r29)
000a8a70: 0c00b1d0 jal 0x0002c740
000a8a74: 00802821 addu r5,r4,r0
000a8a78: 00002021 addu r4,r0,r0
000a8a7c: 93a60569 lbu r6,0x0569(r29)
000a8a80: 0c00b1d0 jal 0x0002c740
000a8a84: 24050001 addiu r5,r0,0x0001
000a8a88: 00002021 addu r4,r0,r0
000a8a8c: 93a6056a lbu r6,0x056a(r29)
000a8a90: 0c00b1d0 jal 0x0002c740
000a8a94: 24050002 addiu r5,r0,0x0002
000a8a98: 00002021 addu r4,r0,r0
000a8a9c: 93a6056b lbu r6,0x056b(r29)
000a8aa0: 0c00b1d0 jal 0x0002c740
000a8aa4: 24050003 addiu r5,r0,0x0003
000a8aa8: 00002021 addu r4,r0,r0
000a8aac: 93a6056c lbu r6,0x056c(r29)
000a8ab0: 0c00b1d0 jal 0x0002c740
000a8ab4: 24050008 addiu r5,r0,0x0008
000a8ab8: 00002021 addu r4,r0,r0
000a8abc: 93a6056e lbu r6,0x056e(r29)
000a8ac0: 0c00b1d0 jal 0x0002c740
000a8ac4: 2405000a addiu r5,r0,0x000a
000a8ac8: 00002021 addu r4,r0,r0
000a8acc: 93a6056d lbu r6,0x056d(r29)
000a8ad0: 0c00b1d0 jal 0x0002c740
000a8ad4: 24050009 addiu r5,r0,0x0009
000a8ad8: 00002021 addu r4,r0,r0
000a8adc: 93a6056f lbu r6,0x056f(r29)
000a8ae0: 0c00b1d0 jal 0x0002c740
000a8ae4: 2405000b addiu r5,r0,0x000b
000a8ae8: 00002021 addu r4,r0,r0
000a8aec: 93a60570 lbu r6,0x0570(r29)
000a8af0: 0c00b1d0 jal 0x0002c740
000a8af4: 24050004 addiu r5,r0,0x0004
000a8af8: 00002021 addu r4,r0,r0
000a8afc: 93a60571 lbu r6,0x0571(r29)
000a8b00: 0c00b1d0 jal 0x0002c740
000a8b04: 24050005 addiu r5,r0,0x0005
000a8b08: 00002021 addu r4,r0,r0
000a8b0c: 93a60572 lbu r6,0x0572(r29)
000a8b10: 0c00b1d0 jal 0x0002c740
000a8b14: 24050006 addiu r5,r0,0x0006
000a8b18: 00002021 addu r4,r0,r0
000a8b1c: 93a60573 lbu r6,0x0573(r29)
000a8b20: 0c00b1d0 jal 0x0002c740
000a8b24: 24050007 addiu r5,r0,0x0007
000a8b28: 0c004c29 jal 0x000130a4
000a8b2c: 00002021 addu r4,r0,r0
000a8b30: 3c028006 lui r2,0x8006
000a8b34: 8c42794c lw r2,0x794c(r2)
000a8b38: 00000000 nop
000a8b3c: 90440009 lbu r4,0x0009(r2)
000a8b40: 0c005716 jal 0x00015c58
000a8b44: 00000000 nop
000a8b48: 0c004c03 jal 0x0001300c
000a8b4c: 00002021 addu r4,r0,r0
000a8b50: 0c00d59d jal 0x00035674
000a8b54: 24040001 addiu r4,r0,0x0001
000a8b58: 0c00d55b jal 0x0003556c
000a8b5c: 00002021 addu r4,r0,r0
000a8b60: 0c00d58f jal 0x0003563c
000a8b64: 00002021 addu r4,r0,r0
000a8b68: 8fbf05ec lw r31,0x05ec(r29)
000a8b6c: 8fb205e8 lw r18,0x05e8(r29)
000a8b70: 8fb105e4 lw r17,0x05e4(r29)
000a8b74: 8fb005e0 lw r16,0x05e0(r29)
000a8b78: 03e00008 jr r31
000a8b7c: 27bd05f0 addiu r29,r29,0x05f0

Card selection before battle

000aab7c: 02021024 and r2,r16,r2
000aab80: 104000c6 beq r2,r0,0x000aae9c
000aab84: 00000000 nop
000aab88: 8e220438 lw r2,0x0438(r17)
000aab8c: 00000000 nop
000aab90: 10400044 beq r2,r0,0x000aaca4
000aab94: 00000000 nop
000aab98: 0c0189c9 jal 0x00062724
000aab9c: 3c106666 lui r16,0x6666
000aaba0: 0c018acf jal 0x00062b3c		;PRNG call
000aaba4: 36106667 ori r16,r16,0x6667
000aaba8: 00500018 mult r2,r16
000aabac: 00021fc3 sra r3,r2,0x1f
000aabb0: 00004810 mfhi r9
000aabb4: 00092083 sra r4,r9,0x02
000aabb8: 00832023 subu r4,r4,r3
000aabbc: 00041880 sll r3,r4,0x02
000aabc0: 00641821 addu r3,r3,r4
000aabc4: 00031840 sll r3,r3,0x01
000aabc8: 00431023 subu r2,r2,r3
000aabcc: 0c018acf jal 0x00062b3c		;PRNG call
000aabd0: ae220474 sw r2,0x0474(r17)
000aabd4: 00500018 mult r2,r16
000aabd8: 02202021 addu r4,r17,r0
000aabdc: 00021fc3 sra r3,r2,0x1f
000aabe0: ae2004b4 sw r0,0x04b4(r17)
000aabe4: 00004810 mfhi r9
000aabe8: 00092883 sra r5,r9,0x02
000aabec: 00a32823 subu r5,r5,r3
000aabf0: 00051880 sll r3,r5,0x02
000aabf4: 00651821 addu r3,r3,r5
000aabf8: 00031840 sll r3,r3,0x01
000aabfc: 00431023 subu r2,r2,r3
000aac00: 0c02bc9a jal 0x000af268
000aac04: ae220478 sw r2,0x0478(r17)
000aac08: 0c018958 jal 0x00062560
000aac0c: 00402021 addu r4,r2,r0
000aac10: 14400024 bne r2,r0,0x000aaca4
000aac14: 00000000 nop
000aac18: 0c02bc9a jal 0x000af268
000aac1c: 02202021 addu r4,r17,r0
000aac20: 02202021 addu r4,r17,r0
000aac24: 0c02bc7d jal 0x000af1f4
000aac28: 00402821 addu r5,r2,r0
000aac2c: 0c02bc9a jal 0x000af268
000aac30: 02202021 addu r4,r17,r0
000aac34: 02202021 addu r4,r17,r0
000aac38: 0c02bc7d jal 0x000af1f4
000aac3c: 00402821 addu r5,r2,r0
000aac40: 0c02bc9a jal 0x000af268
000aac44: 02202021 addu r4,r17,r0
000aac48: 02202021 addu r4,r17,r0
000aac4c: 0c02bc7d jal 0x000af1f4
000aac50: 00402821 addu r5,r2,r0
000aac54: 0c02bc9a jal 0x000af268
000aac58: 02202021 addu r4,r17,r0
000aac5c: 02202021 addu r4,r17,r0
000aac60: 0c02bc7d jal 0x000af1f4
000aac64: 00402821 addu r5,r2,r0
000aac68: 0c02bc9a jal 0x000af268
000aac6c: 02202021 addu r4,r17,r0
000aac70: 02202021 addu r4,r17,r0
000aac74: 0c02bc7d jal 0x000af1f4
000aac78: 00402821 addu r5,r2,r0
000aac7c: 0c02bc9a jal 0x000af268
000aac80: 02202021 addu r4,r17,r0
000aac84: 02202021 addu r4,r17,r0
000aac88: 0c02bc7d jal 0x000af1f4
000aac8c: 00402821 addu r5,r2,r0
000aac90: 0c02bc9a jal 0x000af268
000aac94: 02202021 addu r4,r17,r0
000aac98: 02202021 addu r4,r17,r0
000aac9c: 0c02bc7d jal 0x000af1f4
000aaca0: 00402821 addu r5,r2,r0
000aaca4: 0c02bc9a jal 0x000af268
000aaca8: 02202021 addu r4,r17,r0
000aacac: 8e2504b4 lw r5,0x04b4(r17)
000aacb0: 0c018968 jal 0x000625a0
000aacb4: 00402021 addu r4,r2,r0
000aacb8: 00402021 addu r4,r2,r0
000aacbc: 2402ffff addiu r2,r0,0xffff
000aacc0: 10820076 beq r4,r2,0x000aae9c
000aacc4: 00000000 nop
000aacc8: 8e23047c lw r3,0x047c(r17)
000aaccc: 00000000 nop
000aacd0: 00031100 sll r2,r3,0x04
000aacd4: 00431023 subu r2,r2,r3
000aacd8: 00021080 sll r2,r2,0x02
000aacdc: 24420010 addiu r2,r2,0x0010
000aace0: 90830000 lbu r3,0x0000(r4)		;r3 = Card ID
000aace4: 02224021 addu r8,r17,r2		;r8 = r17 + r2
000aace8: a1030000 sb r3,0x0000(r8)		;store Card ID in 0x801FF9F0 + offset
000aacec: 90820002 lbu r2,0x0002(r4)		;r2 = Card Attack
000aacf0: 00000000 nop
000aacf4: a1020002 sb r2,0x0002(r8)
000aacf8: 90820003 lbu r2,0x0003(r4)
000aacfc: 00000000 nop
000aad00: a1020003 sb r2,0x0003(r8)
000aad04: 90820004 lbu r2,0x0004(r4)
000aad08: 00000000 nop
000aad0c: a1020004 sb r2,0x0004(r8)
000aad10: 90820005 lbu r2,0x0005(r4)
000aad14: 00000000 nop
000aad18: a1020005 sb r2,0x0005(r8)
000aad1c: 90820001 lbu r2,0x0001(r4)
000aad20: 02202021 addu r4,r17,r0
000aad24: 0c02bc9a jal 0x000af268
000aad28: a1020001 sb r2,0x0001(r8)
000aad2c: 8e2504b4 lw r5,0x04b4(r17)
000aad30: 0c0189b4 jal 0x000626d0
000aad34: 00402021 addu r4,r2,r0
000aad38: 24040005 addiu r4,r0,0x0005
000aad3c: 0c02c07a jal 0x000b01e8
000aad40: ae2004b4 sw r0,0x04b4(r17)
000aad44: 8e22047c lw r2,0x047c(r17)
000aad48: 24030005 addiu r3,r0,0x0005
000aad4c: 24420001 addiu r2,r2,0x0001
000aad50: 14430052 bne r2,r3,0x000aae9c
000aad54: ae22047c sw r2,0x047c(r17)
000aad58: 24040006 addiu r4,r0,0x0006
000aad5c: 3c028007 lui r2,0x8007
000aad60: 0c00d5dd jal 0x00035774
000aad64: ac407df0 sw r0,0x7df0(r2)
000aad68: 0c00ae9a jal 0x0002ba68
000aad6c: 00402021 addu r4,r2,r0
000aad70: 27a40018 addiu r4,r29,0x0018
000aad74: 24050006 addiu r5,r0,0x0006
000aad78: 24060002 addiu r6,r0,0x0002
000aad7c: 24420012 addiu r2,r2,0x0012
000aad80: a7a2001c sh r2,0x001c(r29)
000aad84: 00021400 sll r2,r2,0x10
000aad88: 00021c03 sra r3,r2,0x10
000aad8c: 000217c2 srl r2,r2,0x1f
000aad90: 00621821 addu r3,r3,r2
000aad94: 00031843 sra r3,r3,0x01
000aad98: 240200a0 addiu r2,r0,0x00a0
000aad9c: 00431023 subu r2,r2,r3
000aada0: a7a20018 sh r2,0x0018(r29)
000aada4: 24020053 addiu r2,r0,0x0053
000aada8: a7a2001a sh r2,0x001a(r29)
000aadac: 2402003a addiu r2,r0,0x003a
000aadb0: 0c00b715 jal 0x0002dc54
000aadb4: a7a2001e sh r2,0x001e(r29)
000aadb8: 00402021 addu r4,r2,r0
000aadbc: 3c05800b lui r5,0x800b
000aadc0: 24a5b060 addiu r5,r5,0xb060
000aadc4: 0c00b8bb jal 0x0002e2ec
000aadc8: ae240458 sw r4,0x0458(r17)
000aadcc: 8e240458 lw r4,0x0458(r17)
000aadd0: 0c00b8c7 jal 0x0002e31c
000aadd4: 24050001 addiu r5,r0,0x0001
000aadd8: 8e240458 lw r4,0x0458(r17)
000aaddc: 0c02ae27 jal 0x000ab89c
000aade0: 00000000 nop
000aade4: 24020013 addiu r2,r0,0x0013
000aade8: 0802aba6 j 0x000aae98
000aadec: ae200004 sw r0,0x0004(r17)

Generate enemy cards ?

000aea24: 27bdffd0 addiu r29,r29,0xffd0		;r29 -= 0x30
000aea28: afb60028 sw r22,0x0028(r29)		;store r22 in (r29+0x28)
000aea2c: 3c168010 lui r22,0x8010
000aea30: 36d63800 ori r22,r22,0x3800		;r22 = 0x80103800 (Base Stats)
000aea34: afb10014 sw r17,0x0014(r29)		;store r17 in (r29+0x14)
000aea38: 00008821 addu r17,r0,r0		;r17 = 0
000aea3c: afb40020 sw r20,0x0020(r29)		;store r20 in (r29+0x20)
000aea40: 24140002 addiu r20,r0,0x0002		;r20 = 2
000aea44: afb3001c sw r19,0x001c(r29)		;store r19 in (r29+0x1c)
000aea48: 24130003 addiu r19,r0,0x0003		;r19 = 3
000aea4c: afb50024 sw r21,0x0024(r29)		;store r21 in (r29+0x24)
000aea50: 24950010 addiu r21,r4,0x0010		;r21 = r4 + 0x10
000aea54: afb00010 sw r16,0x0010(r29)		;store r16 in (r29+0x10)
000aea58: 02a08021 addu r16,r21,r0		;r16 = r21
000aea5c: afb20018 sw r18,0x0018(r29)		;store r18 in (r29+0x18)
000aea60: 02209021 addu r18,r17,r0		;r18 = r17
000aea64: afbf002c sw r31,0x002c(r29)		;store r31 in (r29+0x2c)
000aea68: 240200dc addiu r2,r0,0x00dc		;r2 = 0xdc (start of loop from 0x000aeb68)
000aea6c: ae02000c sw r2,0x000c(r16)		;store r2 in (r16+0xc)
000aea70: 24020028 addiu r2,r0,0x0028		;r2 = 0x28
000aea74: ae120010 sw r18,0x0010(r16)		;store r18 in (r16+0x10)
000aea78: ae000014 sw r0,0x0014(r16)		;store 0 in (r16+0x14)
000aea7c: ae000018 sw r0,0x0018(r16)		;store 0 in (r16+0x18)
000aea80: ae000008 sw r0,0x0008(r16)		;store 0 in (r16+0x8)
000aea84: ae020030 sw r2,0x0030(r16)		;store r2 in (r16+0x30)
000aea88: 0c018acf jal 0x00062b3c		;PRNG call
000aea8c: a2000000 sb r0,0x0000(r16)		;store 0 in Card ID
000aea90: 0c018acf jal 0x00062b3c		;PRNG call
000aea94: a2020001 sb r2,0x0001(r16)		;store PRN[0;0xFF] in Arrows
000aea98: 0c018acf jal 0x00062b3c		;PRNG call
000aea9c: a2020002 sb r2,0x0002(r16)		;store PRN[0;0xFF] in Attack
000aeaa0: 30430003 andi r3,r2,0x0003
000aeaa4: 24020001 addiu r2,r0,0x0001
000aeaa8: 1062000f beq r3,r2,0x000aeae8		;if((r2 & 3) == 1), branch to 0x000aeae8
000aeaac: 28620002 slti r2,r3,0x0002
000aeab0: 10400005 beq r2,r0,0x000aeac8		;if((r2 & 3) ≥ 2), branch to 0x000aeac8
000aeab4: 00000000 nop
000aeab8: 10600009 beq r3,r0,0x000aeae0		;if((r2 & 3) == 0), branch to 0x000aeae0
000aeabc: 00000000 nop
000aeac0: 0802babf j 0x000aeafc			;error trap, jump to 0x000aeafc
000aeac4: 00000000 nop
000aeac8: 10740009 beq r3,r20,0x000aeaf0	;if((r2 & 3) == 2), branch to 0x000aeaf0
000aeacc: 00000000 nop
000aead0: 10730009 beq r3,r19,0x000aeaf8	;if((r2 & 3) == 3), branch to 0x000aeaf8
000aead4: 00000000 nop
000aead8: 0802babf j 0x000aeafc			;error trap, jump to 0x000aeafc
000aeadc: 00000000 nop
000aeae0: 0802babf j 0x000aeafc			;jump to 0x000aeafc
000aeae4: a2000003 sb r0,0x0003(r16)		;Type = P
000aeae8: 0802babf j 0x000aeafc			;jump to 0x000aeafc
000aeaec: a2030003 sb r3,0x0003(r16)		;store r3 in Type (Type = M)
000aeaf0: 0802babf j 0x000aeafc			;jump to 0x000aeafc
000aeaf4: a2130003 sb r19,0x0003(r16)		;store r19 in Type
000aeaf8: a2140003 sb r20,0x0003(r16)		;store r20 in Type
000aeafc: 0c018acf jal 0x00062b3c		;PRNG call
000aeb00: 2652001e addiu r18,r18,0x001e		;r18 += 0x1e
000aeb04: 0c018acf jal 0x00062b3c		;PRNG call
000aeb08: a2020004 sb r2,0x0004(r16)		;store PRN[0;0xFF] in Physical Defense
000aeb0c: a2020005 sb r2,0x0005(r16)		;store PRN[0;0xFF] in Magical Defense
000aeb10: 0c018acf jal 0x00062b3c		;PRNG call
000aeb14: a2110000 sb r17,0x0000(r16)		;store r17 in (r16)
000aeb18: a2020001 sb r2,0x0001(r16)		;store PRN[0;0xFF] in Arrows
000aeb1c: 02201021 addu r2,r17,r0		;r2 = r17
000aeb20: 304200ff andi r2,r2,0x00ff		;r2 &= 0xFF
000aeb24: 00021880 sll r3,r2,0x02
000aeb28: 00621821 addu r3,r3,r2
000aeb2c: 00761821 addu r3,r3,r22		;r3 = r22 + (r2 * 5)
000aeb30: 90620000 lbu r2,0x0000(r3)		;r2 = Base Attack
000aeb34: 00000000 nop
000aeb38: a2020002 sb r2,0x0002(r16)		;store r2 in (r16+0x2)
000aeb3c: 90620001 lbu r2,0x0001(r3)		;r2 = Base Type
000aeb40: 00000000 nop
000aeb44: a2020003 sb r2,0x0003(r16)		;store r2 in (r16+0x3)
000aeb48: 90620002 lbu r2,0x0002(r3)		;r2 = Base Physical Defense
000aeb4c: 00000000 nop
000aeb50: a2020004 sb r2,0x0004(r16)		;store r2 in (r16+0x4)
000aeb54: 90620003 lbu r2,0x0003(r3)		;r2 = Base Magical Defense
000aeb58: 26310001 addiu r17,r17,0x0001		;r17++
000aeb5c: ae000034 sw r0,0x0034(r16)		;store 0 in (r16+0x34)
000aeb60: a2020005 sb r2,0x0005(r16)		;store r2 in (r16+0x5)
000aeb64: 2a22000a slti r2,r17,0x000a
000aeb68: 1440ffbf bne r2,r0,0x000aea68		;if(r17<10), loop to 0x000aea68
000aeb6c: 2610003c addiu r16,r16,0x003c		;r16 += 60
000aeb70: 24110005 addiu r17,r0,0x0005		;r17 = 5
000aeb74: 26a4012c addiu r4,r21,0x012c		;r4 = r21 + 300
000aeb78: ac800034 sw r0,0x0034(r4)		;store r0 in (r4+0x34)
000aeb7c: 26310001 addiu r17,r17,0x0001		;r17++
000aeb80: 2a22000a slti r2,r17,0x000a
000aeb84: 1440fffc bne r2,r0,0x000aeb78		;if(r17<10), loop to 0x000aeb78
000aeb88: 2484003c addiu r4,r4,0x003c		;r4 += 60
000aeb8c: 8fbf002c lw r31,0x002c(r29)		;r31 = (r29+0x2c)
000aeb90: 8fb60028 lw r22,0x0028(r29)		;r22 = (r29+0x28)
000aeb94: 8fb50024 lw r21,0x0024(r29)		;r21 = (r29+0x24)
000aeb98: 8fb40020 lw r20,0x0020(r29)		;r20 = (r29+0x20)
000aeb9c: 8fb3001c lw r19,0x001c(r29)		;r19 = (r29+0x1c)
000aeba0: 8fb20018 lw r18,0x0018(r29)		;r18 = (r29+0x18)
000aeba4: 8fb10014 lw r17,0x0014(r29)		;r17 = (r29+0x14)
000aeba8: 8fb00010 lw r16,0x0010(r29)		;r16 = (r29+0x10)
000aebac: 03e00008 jr r31			;jump to r31
000aebb0: 27bd0030 addiu r29,r29,0x0030		;r29 += 0x30

0x000b050c

000b050c: a242ffff sb r2,-0x0001(r18)
000b0510: 24020064 addiu r2,r0,0x0064
000b0514: a2420003 sb r2,0x0003(r18)
000b0518: 8ee30000 lw r3,0x0000(r23)
000b051c: 24020015 addiu r2,r0,0x0015
000b0520: 14620002 bne r3,r2,0x000b052c
000b0524: 24020066 addiu r2,r0,0x0066
000b0528: a2420003 sb r2,0x0003(r18)
000b052c: 96620004 lhu r2,0x0004(r19)
000b0530: 00000000 nop
000b0534: a6420004 sh r2,0x0004(r18)
000b0538: 96620008 lhu r2,0x0008(r19)
000b053c: a2550000 sb r21,0x0000(r18)
000b0540: a2550001 sb r21,0x0001(r18)
000b0544: a2550002 sb r21,0x0002(r18)
000b0548: a6420006 sh r2,0x0006(r18)
000b054c: 8e62000c lw r2,0x000c(r19)
000b0550: 00000000 nop
000b0554: 14400002 bne r2,r0,0x000b0560
000b0558: 24020098 addiu r2,r0,0x0098
000b055c: 24020068 addiu r2,r0,0x0068
000b0560: a2420008 sb r2,0x0008(r18)
000b0564: a25e0009 sb r30,0x0009(r18)
000b0568: 02802821 addu r5,r20,r0
000b056c: 8fa40014 lw r4,0x0014(r29)
000b0570: 24023a80 addiu r2,r0,0x3a80
000b0574: a642000a sh r2,0x000a(r18)
000b0578: 2402002a addiu r2,r0,0x002a
000b057c: a642000c sh r2,0x000c(r18)
000b0580: 24020033 addiu r2,r0,0x0033
000b0584: 0c018e9d jal 0x00063a74
000b0588: a642000e sh r2,0x000e(r18)
000b058c: 26520014 addiu r18,r18,0x0014
000b0590: 26940014 addiu r20,r20,0x0014
000b0594: 24040001 addiu r4,r0,0x0001
000b0598: 00802821 addu r5,r4,r0
000b059c: 00801021 addu r2,r4,r0
000b05a0: 24060300 addiu r6,r0,0x0300
000b05a4: 24070100 addiu r7,r0,0x0100
000b05a8: 0c01433e jal 0x00050cf8
000b05ac: a242ffff sb r2,-0x0001(r18)
000b05b0: 02802821 addu r5,r20,r0
000b05b4: 304209ff andi r2,r2,0x09ff
000b05b8: 3c03e100 lui r3,0xe100
000b05bc: 8fa40014 lw r4,0x0014(r29)
000b05c0: 00431025 or r2,r2,r3
000b05c4: 0c018e9d jal 0x00063a74
000b05c8: ae420000 sw r2,0x0000(r18)
000b05cc: 26520008 addiu r18,r18,0x0008
000b05d0: 26940008 addiu r20,r20,0x0008
000b05d4: 26d60001 addiu r22,r22,0x0001
000b05d8: 2ac20006 slti r2,r22,0x0006
000b05dc: 1440ff6a bne r2,r0,0x000b0388
000b05e0: 26730010 addiu r19,r19,0x0010
000b05e4: 02801021 addu r2,r20,r0
000b05e8: 8fbf003c lw r31,0x003c(r29)
000b05ec: 8fbe0038 lw r30,0x0038(r29)
000b05f0: 8fb70034 lw r23,0x0034(r29)
000b05f4: 8fb60030 lw r22,0x0030(r29)
000b05f8: 8fb5002c lw r21,0x002c(r29)
000b05fc: 8fb40028 lw r20,0x0028(r29)
000b0600: 8fb30024 lw r19,0x0024(r29)
000b0604: 8fb20020 lw r18,0x0020(r29)
000b0608: 8fb1001c lw r17,0x001c(r29)
000b060c: 8fb00018 lw r16,0x0018(r29)
000b0610: 03e00008 jr r31
000b0614: 27bd0040 addiu r29,r29,0x0040

Tetra Masters - Board blocks

Blocks amount

0 blocks: 3%
1 blocks: 4%
2 blocks: 5%
3 blocks: 5%
4 blocks: 10%
5 blocks: 70%
6 blocks: 3%
000b0618: 27bdffd0 addiu r29,r29,0xffd0 ;r29 -= 0x20 000b061c: afb60028 sw r22,0x0028(r29) ;store r22 in (r29+0x28) 000b0620: 0080b021 addu r22,r4,r0 ;r22 = r4 000b0624: afb3001c sw r19,0x001c(r29) ;store r19 in (r19+0x1c) 000b0628: 00009821 addu r19,r0,r0 ;r19 = 0 000b062c: 24040001 addiu r4,r0,0x0001 ;r4 = 1 000b0630: afb00010 sw r16,0x0010(r29) ;store r16 in (r29+0x10) 000b0634: 26d002f0 addiu r16,r22,0x02f0 ;r16 = r22 + 0x2f0 000b0638: 02001821 addu r3,r16,r0 ;r3 = r16 000b063c: afbf002c sw r31,0x002c(r29) ;store r31 in (r29+0x2c) 000b0640: afb50024 sw r21,0x0024(r29) ;store r21 in (r29+0x24) 000b0644: afb40020 sw r20,0x0020(r29) ;store r20 in (r29+0x20) 000b0648: afb20018 sw r18,0x0018(r29) ;store r18 in (r29+0x18) 000b064c: afb10014 sw r17,0x0014(r29) ;store r17 in (r29+0x14) 000b0650: ac640000 sw r4,0x0000(r3) ;store r4 to (r3) 000b0654: ac600004 sw r0,0x0004(r3) ;store 0 to (r3+0x4) 000b0658: 26730001 addiu r19,r19,0x0001 ;r19++ 000b065c: 2a620006 slti r2,r19,0x0006 000b0660: 1440fffb bne r2,r0,0x000b0650 ;if(r19 < 6), loop to 0x000b0650 000b0664: 24630010 addiu r3,r3,0x0010 000b0668: 0c018acf jal 0x00062b3c ;PRNG call 000b066c: 00000000 nop 000b0670: 3c0351eb lui r3,0x51eb 000b0674: 3463851f ori r3,r3,0x851f 000b0678: 00430018 mult r2,r3 000b067c: 00021fc3 sra r3,r2,0x1f 000b0680: 00003810 mfhi r7 ;r7 = (PRN × 0x51eb851f) >> 32 000b0684: 00072143 sra r4,r7,0x05 ;r4 = r7 >> 5 000b0688: 00832023 subu r4,r4,r3 000b068c: 00041840 sll r3,r4,0x01 000b0690: 00641821 addu r3,r3,r4 000b0694: 000318c0 sll r3,r3,0x03 000b0698: 00641821 addu r3,r3,r4 000b069c: 00031880 sll r3,r3,0x02 ;r3 = r4 × 100 000b06a0: 00432023 subu r4,r2,r3 ;r4 = PRN[0;0x7FFF] - r3 000b06a4: 2c820003 sltiu r2,r4,0x0003 000b06a8: 14400016 bne r2,r0,0x000b0704 ;if(r4 < 3), branch to 0x000b0704 000b06ac: 0000a021 addu r20,r0,r0 ;r20 = 0 000b06b0: 2482fffd addiu r2,r4,0xfffd ;r2 = r4 - 3 000b06b4: 2c420004 sltiu r2,r2,0x0004 000b06b8: 14400012 bne r2,r0,0x000b0704 ;if((r4 - 3) < 4), branch to 0x000b0704 000b06bc: 24140001 addiu r20,r0,0x0001 ;r20 = 1 000b06c0: 2482fff9 addiu r2,r4,0xfff9 ;r2 = r4 - 7 000b06c4: 2c420005 sltiu r2,r2,0x0005 000b06c8: 1440000e bne r2,r0,0x000b0704 ;if((r4 - 7) < 5), branch to 0x000b0704 000b06cc: 24140002 addiu r20,r0,0x0002 ;r20 = 2 000b06d0: 2482fff4 addiu r2,r4,0xfff4 ;r2 = r4 - 12 000b06d4: 2c420005 sltiu r2,r2,0x0005 000b06d8: 1440000a bne r2,r0,0x000b0704 ;if((r4 - 12) < 5), branch to 0x000b0704 000b06dc: 24140003 addiu r20,r0,0x0003 ;r20 = 3 000b06e0: 2482ffef addiu r2,r4,0xffef ;r2 = r4 - 17 000b06e4: 2c42000a sltiu r2,r2,0x000a 000b06e8: 14400006 bne r2,r0,0x000b0704 ;if((r4 - 17) < 10), branch to 0x000b0704 000b06ec: 24140004 addiu r20,r0,0x0004 ;r20 = 4 000b06f0: 2482ffe5 addiu r2,r4,0xffe5 ;r2 = r4 - 27 000b06f4: 2c420046 sltiu r2,r2,0x0046 000b06f8: 10400002 beq r2,r0,0x000b0704 ;if((r4 - 27) ≥ 70), branch to 0x000b0704 000b06fc: 24140006 addiu r20,r0,0x0006 ;r20 = 6 000b0700: 24140005 addiu r20,r0,0x0005 ;r20 = 5 000b0704: 00009821 addu r19,r0,r0 ;r19 = 0 000b0708: aed40570 sw r20,0x0570(r22) ;store r20 in (r22+0x570)

Blocks placement

000b070c: 12800029 beq r20,r0,0x000b07b4	;if(no blocks), branch to 0x000b07b4
000b0710: aec0056c sw r0,0x056c(r22)		;store 0 to (r22+0x056c)
000b0714: 24150001 addiu r21,r0,0x0001		;r21 = 1
000b0718: 02009021 addu r18,r16,r0		;r18 = r16
000b071c: 0c018acf jal 0x00062b3c		;PRNG call
000b0720: 00000000 nop
000b0724: 0c018acf jal 0x00062b3c		;PRNG call
000b0728: 30500003 andi r16,r2,0x0003		;r16 = PRN1[0;0x7FFF] & 3
000b072c: 30510003 andi r17,r2,0x0003		;r17 = PRN2[0;0x7FFF] & 3
000b0730: 02c02021 addu r4,r22,r0		;r4 = r22
000b0734: 02002821 addu r5,r16,r0		;r5 = r16
000b0738: 0c02c675 jal 0x000b19d4		;Checks row and column
000b073c: 02203021 addu r6,r17,r0		;r6 = r17
000b0740: 00401821 addu r3,r2,r0		;r3 = r2
000b0744: 8c620000 lw r2,0x0000(r3)		;r2 = (r3)
000b0748: 00000000 nop
000b074c: 1455fff3 bne r2,r21,0x000b071c	;if there's already a block there, loop to 0x000b071c
000b0750: 24020002 addiu r2,r0,0x0002		;r2 = 2
000b0754: ac620000 sw r2,0x0000(r3)		;store r2 in (r3)
000b0758: 00101040 sll r2,r16,0x01
000b075c: 00501021 addu r2,r2,r16
000b0760: 00021080 sll r2,r2,0x02
000b0764: 00501023 subu r2,r2,r16
000b0768: 00021080 sll r2,r2,0x02
000b076c: 00501023 subu r2,r2,r16
000b0770: 24420048 addiu r2,r2,0x0048		;r2 = r16 × 43 + 72
000b0774: ae420004 sw r2,0x0004(r18)		;store r2 in (r18+0x4)
000b0778: 00111040 sll r2,r17,0x01
000b077c: 00511021 addu r2,r2,r17
000b0780: 00021080 sll r2,r2,0x02
000b0784: 00511021 addu r2,r2,r17
000b0788: 00021080 sll r2,r2,0x02
000b078c: 24420008 addiu r2,r2,0x0008		;r2 = r17 × 52 + 8
000b0790: ae550000 sw r21,0x0000(r18)		;store r21 in (r18)
000b0794: 0c018acf jal 0x00062b3c		;PRNG call
000b0798: ae420008 sw r2,0x0008(r18)		;store r2 in (r18+0x8)
000b079c: 30420001 andi r2,r2,0x0001		;r2 &= 1
000b07a0: ae42000c sw r2,0x000c(r18)		;store r2 in (r18+0xc)
000b07a4: 26730001 addiu r19,r19,0x0001		;r19++
000b07a8: 0274102a slt r2,r19,r20
000b07ac: 1440ffdb bne r2,r0,0x000b071c		;if(r19 < blocks_amount), loop to 0x000b071c
000b07b0: 26520010 addiu r18,r18,0x0010		;r18 += 0x10
000b07b4: 8fbf002c lw r31,0x002c(r29)		;r31 = (r29+0x2c)
000b07b8: 8fb60028 lw r22,0x0028(r29)		;r22 = (r29+0x28)
000b07bc: 8fb50024 lw r21,0x0024(r29)		;r21 = (r29+0x24)
000b07c0: 8fb40020 lw r20,0x0020(r29)		;r20 = (r29+0x20)
000b07c4: 8fb3001c lw r19,0x001c(r29)		;r19 = (r29+0x1c)
000b07c8: 8fb20018 lw r18,0x0018(r29)		;r18 = (r29+0x18)
000b07cc: 8fb10014 lw r17,0x0014(r29)		;r17 = (r29+0x14)
000b07d0: 8fb00010 lw r16,0x0010(r29)		;r16 = (r29+0x10)
000b07d4: 03e00008 jr r31			;jump to (r31)
000b07d8: 27bd0030 addiu r29,r29,0x0030		;r29 += 0x30

Checks row and column

000b19d4: 04a10004 bgez r5,0x000b19e8		;if(PRN1[0;3] > 0), branch to 0x000b19e8
000b19d8: 24840268 addiu r4,r4,0x0268		;r4 += 0x268
000b19dc: 3c02800b lui r2,0x800b
000b19e0: 03e00008 jr r31
000b19e4: 24423ce8 addiu r2,r2,0x3ce8		;r2 = 0x800b3ce8
000b19e8: 28a20004 slti r2,r5,0x0004
000b19ec: 1040fffc beq r2,r0,0x000b19e0		;error trap, branch to 0x000b19e0 if column is out of bounds
000b19f0: 3c02800b lui r2,0x800b
000b19f4: 04c0fffa bltz r6,0x000b19e0		;error trap, branch to 0x000b19e0 if row is negative
000b19f8: 00000000 nop
000b19fc: 28c20004 slti r2,r6,0x0004
000b1a00: 10400005 beq r2,r0,0x000b1a18		;error trap, branch to 0x000b1a18 if row is out of bounds
000b1a04: 000518c0 sll r3,r5,0x03		;r3 = column << 3
000b1a08: 00061140 sll r2,r6,0x05		;r2 = row << 5
000b1a0c: 00821021 addu r2,r4,r2		;r2 += offset
000b1a10: 03e00008 jr r31
000b1a14: 00431021 addu r2,r2,r3		;r2 = 0x800b3ce8 + column << 3 + row << 5
000b1a18: 3c02800b lui r2,0x800b
000b1a1c: 03e00008 jr r31
000b1a20: 24423ce8 addiu r2,r2,0x3ce8		;r2 = 0x800b3ce8 (if row is out of bounds)

Tetra Master PRNG call when entering the World Map, and ?

0xc4a5c-0xc4dd4 - Calls Tetra Masters PRNG 30 times when loading the World Map, and ?

000c4a5c: 27bdffd0 addiu r29,r29,0xffd0
000c4a60: afb10014 sw r17,0x0014(r29)		;store r17 in (r29+0x14)
000c4a64: 00008821 addu r17,r0,r0		;r17 = 0
000c4a68: 3c02800d lui r2,0x800d
000c4a6c: afb50024 sw r21,0x0024(r29)
000c4a70: 245548f8 addiu r21,r2,0x48f8
000c4a74: 3c02800d lui r2,0x800d
000c4a78: afb40020 sw r20,0x0020(r29)
000c4a7c: 24544830 addiu r20,r2,0x4830
000c4a80: afb3001c sw r19,0x001c(r29)
000c4a84: 24130200 addiu r19,r0,0x0200
000c4a88: 3c02800d lui r2,0x800d
000c4a8c: afb20018 sw r18,0x0018(r29)
000c4a90: 24524870 addiu r18,r2,0x4870
000c4a94: afbf0028 sw r31,0x0028(r29)
000c4a98: afb00010 sw r16,0x0010(r29)
000c4a9c: 001111c0 sll r2,r17,0x07		;r2 = r17 << 7
000c4aa0: 0c018acf jal 0x00062b3c		;PRNG call
000c4aa4: a6420000 sh r2,0x0000(r18)		;store r2 in (r18)
000c4aa8: 00401821 addu r3,r2,r0		;r3 = prn[0;0x7FFF]
000c4aac: 04610002 bgez r3,0x000c4ab8		;if(r3 ≥ 0), branch to 0x000c4ab8
000c4ab0: 001180c0 sll r16,r17,0x03		;r16 = r17 << 3
000c4ab4: 24620fff addiu r2,r3,0x0fff		;r2 = r3 + 0xFFF
000c4ab8: 00021303 sra r2,r2,0x0c
000c4abc: 00021300 sll r2,r2,0x0c		;r2 &= 0xFFFFF000
000c4ac0: 00621023 subu r2,r3,r2		;r2 = r3 - r2
000c4ac4: a6420002 sh r2,0x0002(r18)		;store r2 in (r18+0x2)
000c4ac8: 24020800 addiu r2,r0,0x0800		;r2 = 0x800
000c4acc: a6400004 sh r0,0x0004(r18)		;store 0 in (r18+0x4)
000c4ad0: a6930000 sh r19,0x0000(r20)		;store r19 in (r20)
000c4ad4: a6a20000 sh r2,0x0000(r21)		;store r2 in (r21)
000c4ad8: 3c02800d lui r2,0x800d
000c4adc: 244248e8 addiu r2,r2,0x48e8
000c4ae0: 02221021 addu r2,r17,r2		;r2 = 0x800d48e8 + r17
000c4ae4: 0c018acf jal 0x00062b3c		;PRNG call
000c4ae8: a0400000 sb r0,0x0000(r2)		;store 0 in (r2)
000c4aec: 00401821 addu r3,r2,r0		;r3 = prn[0;0x7FFF]
000c4af0: 00602021 addu r4,r3,r0		;r4 = r3
000c4af4: 3c02800d lui r2,0x800d
000c4af8: 24424910 addiu r2,r2,0x4910		;r2 = 0x800dc4b08
000c4afc: 04610002 bgez r3,0x000c4b08		;if(r3 ≥ 0), branch to 0x000c4b08
000c4b00: 02028021 addu r16,r16,r2		;r16 += r2
000c4b04: 24640fff addiu r4,r3,0x0fff		;r4 = r3 + 0xFFF
000c4b08: 00041303 sra r2,r4,0x0c
000c4b0c: 00021300 sll r2,r2,0x0c		;r2 = r4 & 0xFFFFF000
000c4b10: 00621023 subu r2,r3,r2		;r2 &= r3 - r2
000c4b14: 0c018acf jal 0x00062b3c		;PRNG call
000c4b18: a6020000 sh r2,0x0000(r16)		;store r2 in (r16)
000c4b1c: 00401821 addu r3,r2,r0		;r3 = prn[0;0x7FFF]
000c4b20: 04610002 bgez r3,0x000c4b2c		;if(r3 ≥ 0), branch to 0x000c4b2c
000c4b24: 00000000 nop
000c4b28: 24620fff addiu r2,r3,0x0fff		;r2 = r3 + 0xFFF
000c4b2c: 26b50002 addiu r21,r21,0x0002		;r21 += 2
000c4b30: 26940002 addiu r20,r20,0x0002		;r20 += 2
000c4b34: 26730014 addiu r19,r19,0x0014		;r19 += 20
000c4b38: 26520008 addiu r18,r18,0x0008		;r18 += 8
000c4b3c: 26310001 addiu r17,r17,0x0001		;r17++
000c4b40: 00021303 sra r2,r2,0x0c
000c4b44: 00021300 sll r2,r2,0x0c		;r2 &= 0xFFFFF000
000c4b48: 00621023 subu r2,r3,r2		;r2 = r3 - r2
000c4b4c: a6020002 sh r2,0x0002(r16)		;store r2 in (r16+0x2)
000c4b50: 2a22000a slti r2,r17,0x000a
000c4b54: 1440ffd1 bne r2,r0,0x000c4a9c		;if(r17 < 10), loop to 0x000c4a9c
000c4b58: a6000004 sh r0,0x0004(r16)		;store 0 in (r16+0x4)
000c4b5c: 00008821 addu r17,r0,r0		;r17 = 0
000c4b60: 3c02800d lui r2,0x800d
000c4b64: 244449f0 addiu r4,r2,0x49f0		;r4 = 0x800d49f0
000c4b68: 3c02800d lui r2,0x800d
000c4b6c: 24434960 addiu r3,r2,0x4960		;r3 = 0x800d4960
000c4b70: ac600000 sw r0,0x0000(r3)		;store 0 to (0x800d4960)
000c4b74: ac600004 sw r0,0x0004(r3)		;store 0 to (0x800d4964)
000c4b78: ac600008 sw r0,0x0008(r3)		;store 0 to (0x800d4968)
000c4b7c: a4800000 sh r0,0x0000(r4)		;store 0 to (0x800d49f0)
000c4b80: a4800002 sh r0,0x0002(r4)		;store 0 to (0x800d49f2)
000c4b84: a4800004 sh r0,0x0004(r4)		;store 0 to (0x800d49f4)
000c4b88: 24840008 addiu r4,r4,0x0008		;r4 += 8
000c4b8c: 26310001 addiu r17,r17,0x0001		;r17++
000c4b90: 2a220009 slti r2,r17,0x0009
000c4b94: 1440fff6 bne r2,r0,0x000c4b70		;if(r17 < 10), loop to 0x000c4b70
000c4b98: 24630010 addiu r3,r3,0x0010		;r3 += 0x10
000c4b9c: 3c030004 lui r3,0x0004
000c4ba0: 3463464c ori r3,r3,0x464c		;r3 = 0x4464c
000c4ba4: 3c05fffc lui r5,0xfffc
000c4ba8: 34a5d97f ori r5,r5,0xd97f
000c4bac: 3c040003 lui r4,0x0003
000c4bb0: 3484805b ori r4,r4,0x805b
000c4bb4: 3c07fffc lui r7,0xfffc
000c4bb8: 34e7f7b9 ori r7,r7,0xf7b9
000c4bbc: 3c060002 lui r6,0x0002
000c4bc0: 34c6fffa ori r6,r6,0xfffa
000c4bc4: 3c08fffe lui r8,0xfffe
000c4bc8: 3508bfae ori r8,r8,0xbfae
000c4bcc: 24110001 addiu r17,r0,0x0001		;r17 = 1
000c4bd0: 3c02800d lui r2,0x800d
000c4bd4: 24424a40 addiu r2,r2,0x4a40
000c4bd8: 244b0050 addiu r11,r2,0x0050
000c4bdc: 00404821 addu r9,r2,r0
000c4be0: 25220028 addiu r2,r9,0x0028
000c4be4: 00405021 addu r10,r2,r0
000c4be8: 3c02800d lui r2,0x800d
000c4bec: ac434960 sw r3,0x4960(r2)
000c4bf0: 24424960 addiu r2,r2,0x4960
000c4bf4: 2403e198 addiu r3,r0,0xe198
000c4bf8: ac440010 sw r4,0x0010(r2)
000c4bfc: 24440010 addiu r4,r2,0x0010
000c4c00: ac430004 sw r3,0x0004(r2)
000c4c04: 240301f4 addiu r3,r0,0x01f4
000c4c08: ac450008 sw r5,0x0008(r2)
000c4c0c: ac830004 sw r3,0x0004(r4)
000c4c10: ac870008 sw r7,0x0008(r4)
000c4c14: 24440060 addiu r4,r2,0x0060
000c4c18: 2403d57e addiu r3,r0,0xd57e
000c4c1c: ac460060 sw r6,0x0060(r2)
000c4c20: ac830004 sw r3,0x0004(r4)
000c4c24: ac880008 sw r8,0x0008(r4)
000c4c28: 8c4c0010 lw r12,0x0010(r2)
000c4c2c: 8c4d0014 lw r13,0x0014(r2)
000c4c30: 8c4e0018 lw r14,0x0018(r2)
000c4c34: 8c4f001c lw r15,0x001c(r2)
000c4c38: ac4c0020 sw r12,0x0020(r2)
000c4c3c: ac4d0024 sw r13,0x0024(r2)
000c4c40: ac4e0028 sw r14,0x0028(r2)
000c4c44: ac4f002c sw r15,0x002c(r2)
000c4c48: 8c4c0010 lw r12,0x0010(r2)
000c4c4c: 8c4d0014 lw r13,0x0014(r2)
000c4c50: 8c4e0018 lw r14,0x0018(r2)
000c4c54: 8c4f001c lw r15,0x001c(r2)
000c4c58: ac4c0030 sw r12,0x0030(r2)
000c4c5c: ac4d0034 sw r13,0x0034(r2)
000c4c60: ac4e0038 sw r14,0x0038(r2)
000c4c64: ac4f003c sw r15,0x003c(r2)
000c4c68: 8c4c0010 lw r12,0x0010(r2)
000c4c6c: 8c4d0014 lw r13,0x0014(r2)
000c4c70: 8c4e0018 lw r14,0x0018(r2)
000c4c74: 8c4f001c lw r15,0x001c(r2)
000c4c78: ac4c0040 sw r12,0x0040(r2)
000c4c7c: ac4d0044 sw r13,0x0044(r2)
000c4c80: ac4e0048 sw r14,0x0048(r2)
000c4c84: ac4f004c sw r15,0x004c(r2)
000c4c88: 8c4c0010 lw r12,0x0010(r2)
000c4c8c: 8c4d0014 lw r13,0x0014(r2)
000c4c90: 8c4e0018 lw r14,0x0018(r2)
000c4c94: 8c4f001c lw r15,0x001c(r2)
000c4c98: ac4c0050 sw r12,0x0050(r2)
000c4c9c: ac4d0054 sw r13,0x0054(r2)
000c4ca0: ac4e0058 sw r14,0x0058(r2)
000c4ca4: ac4f005c sw r15,0x005c(r2)
000c4ca8: 8c4c0060 lw r12,0x0060(r2)
000c4cac: 8c4d0064 lw r13,0x0064(r2)
000c4cb0: 8c4e0068 lw r14,0x0068(r2)
000c4cb4: 8c4f006c lw r15,0x006c(r2)
000c4cb8: ac4c0070 sw r12,0x0070(r2)
000c4cbc: ac4d0074 sw r13,0x0074(r2)
000c4cc0: ac4e0078 sw r14,0x0078(r2)
000c4cc4: ac4f007c sw r15,0x007c(r2)
000c4cc8: 8c4c0060 lw r12,0x0060(r2)
000c4ccc: 8c4d0064 lw r13,0x0064(r2)
000c4cd0: 8c4e0068 lw r14,0x0068(r2)
000c4cd4: 8c4f006c lw r15,0x006c(r2)
000c4cd8: ac4c0080 sw r12,0x0080(r2)
000c4cdc: ac4d0084 sw r13,0x0084(r2)
000c4ce0: ac4e0088 sw r14,0x0088(r2)
000c4ce4: ac4f008c sw r15,0x008c(r2)
000c4ce8: 3c02800d lui r2,0x800d
000c4cec: 24424848 addiu r2,r2,0x4848
000c4cf0: ac400004 sw r0,0x0004(r2)
000c4cf4: ac490008 sw r9,0x0008(r2)
000c4cf8: ad220004 sw r2,0x0004(r9)
000c4cfc: ad2a0008 sw r10,0x0008(r9)
000c4d00: ad4b0008 sw r11,0x0008(r10)
000c4d04: 256b0028 addiu r11,r11,0x0028
000c4d08: ad490004 sw r9,0x0004(r10)
000c4d0c: 25290028 addiu r9,r9,0x0028
000c4d10: 26310001 addiu r17,r17,0x0001		;r17++
000c4d14: 2a22003b slti r2,r17,0x003b
000c4d18: 1440fff9 bne r2,r0,0x000c4d00
000c4d1c: 254a0028 addiu r10,r10,0x0028
000c4d20: 3c03800d lui r3,0x800d
000c4d24: 24634a40 addiu r3,r3,0x4a40
000c4d28: 00111080 sll r2,r17,0x02		;r2 = r17 << 2
000c4d2c: 00511021 addu r2,r2,r17		;r2 += r17
000c4d30: 000210c0 sll r2,r2,0x03		;r2 = r2 << 3
000c4d34: 00432021 addu r4,r2,r3
000c4d38: 2463ffd8 addiu r3,r3,0xffd8
000c4d3c: 00431021 addu r2,r2,r3
000c4d40: ac820004 sw r2,0x0004(r4)
000c4d44: 3c02800d lui r2,0x800d
000c4d48: 244253e8 addiu r2,r2,0x53e8
000c4d4c: 3c03800d lui r3,0x800d
000c4d50: 246353a0 addiu r3,r3,0x53a0
000c4d54: ac820008 sw r2,0x0008(r4)
000c4d58: ac440004 sw r4,0x0004(r2)
000c4d5c: ac400008 sw r0,0x0008(r2)
000c4d60: 3c02800d lui r2,0x800d
000c4d64: 244248c0 addiu r2,r2,0x48c0
000c4d68: ac600004 sw r0,0x0004(r3)
000c4d6c: ac620008 sw r2,0x0008(r3)
000c4d70: ac430004 sw r3,0x0004(r2)
000c4d74: ac400008 sw r0,0x0008(r2)
000c4d78: 3c02800d lui r2,0x800d
000c4d7c: a440df82 sh r0,-0x207e(r2)
000c4d80: 3c02800d lui r2,0x800d
000c4d84: a440df8a sh r0,-0x2076(r2)
000c4d88: 3c02800d lui r2,0x800d
000c4d8c: a440df92 sh r0,-0x206e(r2)
000c4d90: 3c02800d lui r2,0x800d
000c4d94: 2442dfa0 addiu r2,r2,0xdfa0
000c4d98: a4400002 sh r0,0x0002(r2)
000c4d9c: a440000a sh r0,0x000a(r2)
000c4da0: a4400012 sh r0,0x0012(r2)
000c4da4: 8fbf0028 lw r31,0x0028(r29)
000c4da8: 8fb50024 lw r21,0x0024(r29)
000c4dac: 8fb40020 lw r20,0x0020(r29)
000c4db0: 8fb3001c lw r19,0x001c(r29)
000c4db4: 8fb20018 lw r18,0x0018(r29)
000c4db8: 8fb10014 lw r17,0x0014(r29)
000c4dbc: 8fb00010 lw r16,0x0010(r29)
000c4dc0: 3c02800d lui r2,0x800d
000c4dc4: ac404a38 sw r0,0x4a38(r2)
000c4dc8: 3c02800d lui r2,0x800d
000c4dcc: ac4053cc sw r0,0x53cc(r2)
000c4dd0: 03e00008 jr r31
000c4dd4: 27bd0030 addiu r29,r29,0x0030

Tetra Master PRNG

seed × 0x41C64E6D + 0x3039
07c02200: 3c03a001 lui r3,0xa001 07c02204: 8c639010 lw r3,-0x6ff0(r3) 07c02208: 3c0141c6 lui r1,0x41c6 07c0220c: 34214e6d ori r1,r1,0x4e6d 07c02210: 00610019 multu r3,r1 07c02214: 3c01a001 lui r1,0xa001 07c02218: 00001812 mflo r3 07c0221c: 24633039 addiu r3,r3,0x3039 07c02220: 00031402 srl r2,r3,0x10 07c02224: 30427fff andi r2,r2,0x7fff 07c02228: 03e00008 jr r31 07c0222c: ac239010 sw r3,-0x6ff0(r1)

0x07c02230

07c02230: 3c01a001 lui r1,0xa001
07c02234: 03e00008 jr r31
07c02238: ac249010 sw r4,-0x6ff0(r1)