Final Fantasy IX/ROM map/CD1

From Data Crystal
< Final Fantasy IX‎ | ROM map
Revision as of 10:09, 3 February 2024 by Hawk (talk | contribs) (Hawk moved page Final Fantasy IX (CD1)/ROM map to Final Fantasy IX/ROM map/CD1)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

rst $80

00000080: 3c1a0000 lui r26,0x0000
00000084: 275a0c80 addiu r26,r26,0x0c80		;r26 = 0x00000c80
00000088: 03400008 jr r26			;jump to r26
0000008c: 00000000 nop

rst $A0

000000a0: 3c080000 lui r8,0x0000
000000a4: 250805c4 addiu r8,r8,0x05c4		;r8 = 0x000005c4
000000a8: 01000008 jr r8			;jump to r8, which is a branch to the pointer at (0x200 + (r9 << 2))
000000ac: 00000000 nop

Pointer array for function 0x5C4

00000200: 00002958 
00000204: 00002a64 
00000208: 00002b28 
0000020c: 00002c94 
00000210: 00002e00 
00000214: 00002efc 
00000218: 00003000 
0000021c: 0000346c 
00000220: 00004024 
00000224: 00004134
00000228: bfc022c0
0000022c: bfc02590
00000230: bfc025b0
00000234: bfc02738
00000238: bfc02918
0000023c: bfc02934
00000240: bfc02950
00000244: bfc02af0
00000248: bfc02b10
0000024c: bfc02240
00000250: bfc0227c
00000254: bfc03190
00000258: bfc03200
0000025c: bfc03288
00000260: bfc03310
00000264: bfc033c8
00000268: bfc03418
0000026c: bfc03494
00000270: bfc034d0
00000274: bfc03514
00000278: bfc0357c
0000027c: bfc035c0
00000280: bfc03628
00000284: bfc03694
00000288: bfc036fc
0000028c: bfc03764
00000290: bfc03894
00000294: bfc02ea0
00000298: bfc02edc
0000029c: bfc01a90
000002a0: bfc01acc
000002a4: bfc01b08
000002a8: bfc02b50
000002ac: bfc02b8c
000002b0: bfc02bc8
000002b4: bfc02c50
000002b8: bfc02cc0
000002bc: bfc02200				;PlayStation BIOS PRNG
000002c0: bfc02230
000002c4: bfc03098
000002c8: bfc02324
000002cc: bfc01e5c
000002d0: bfc020f0
000002d4: bfc02d20
000002d8: bfc02dac
000002dc: bfc021a0
000002e0: bfc02104
000002e4: bfc01e24
000002e8: bfc0d8d0
000002ec: 00003ff0
000002f0: 0000406c
000002f4: 00004164
000002f8: 00004304

Branch to pointer (0x200 + (r9 << 2))

000005c4: 24080200 addiu r8,r0,0x0200
000005c8: 00094880 sll r9,r9,0x02
000005cc: 01094020 add r8,r8,r9			;pointer = 0x200 + (r9 << 2)
000005d0: 8d080000 lw r8,0x0000(r8)		;r8 = (r8)
000005d4: 00000000 nop
000005d8: 01000008 jr r8			;jump to r8
000005dc: 00000000 nop

Tetra Masters Arrows array

0x10C48 - Array used when generating Arrows for a new card

01 02 04 08 10 20 40 80

Tetra Masters base stats

0x10C50 - Base Stats for every card in the game (cards acquired on the field and battles)

0x577608 - Base Stats for every card in the game (cards played by non-playable characters)

byte 1 - Attack
byte 2 - Type
byte 3 - Physical Defense
byte 4 - Magical Defense
byte 5 - Points (for the 1st card of the kind)
Min Stat = Base Stat >> 1 Max Stat = Base Stat >> 1 + (RND % (Base Stat >> 1)) Max initial card stats
07 00 09 04 0A 09 00 0A 04 0A 0B 00 0C 0A 0A 0D 01 06 13 0A 0F 00 0D 0D 0A 11 00 0F 08 0A 13 01 13 0B 0A 15 01 0C 15 0A 17 00 17 0D 0A 19 00 12 04 0A 1B 01 06 1A 0A 1D 01 14 1B 0A 1F 01 09 21 0A 21 01 0F 27 0A 23 00 24 08 0A 25 00 25 11 0A 27 01 0C 26 0A 29 00 26 10 0A 2B 00 0B 22 0A 2D 00 28 13 0A 2F 01 1D 19 0A 31 00 2D 04 0A 33 00 30 1B 0A 35 00 C3 04 0A 37 01 21 1D 0A 39 01 22 1E 0A 3B 01 16 28 0A 3D 00 44 0C 0A 3F 00 25 12 0A 41 00 3E 22 0A 43 00 5B 12 0A 45 00 3B 3A 0A 47 01 20 60 0A 49 00 40 08 0A 4B 01 2B 27 0A 4D 00 41 47 0A 4F 01 2D 29 0A 51 01 0A 46 0A 53 00 50 1D 0A 55 01 24 4B 0A 57 01 32 32 0A 59 01 50 11 0A 5B 01 33 2F 0A 5D 01 34 30 0A 54 01 25 36 0A 29 00 36 32 0A 5A 01 1E 91 0A 62 01 48 1D 0A 56 01 39 63 0A 66 01 FA 08 0A 7D 01 69 2D 0A BD 00 47 6A 0A C5 00 6E 0C 0A EC 00 7D C2 0A DD 00 06 C7 0A FA 01 C8 14 0A 86 01 28 3F 0A BE 01 A2 02 0A D0 01 11 11 0A 53 01 06 5F 0A 64 01 96 11 0A 4A 01 1D 67 0A 42 01 64 64 0A CD 01 88 48 0A B7 01 64 16 0A C8 01 91 53 0A E2 01 60 5A 0A 8B 01 24 16 0A A2 01 16 64 0A E1 01 B7 56 0A FF 00 B4 06 0A F8 00 18 66 0A CA 00 B4 38 0A 64 01 64 64 0A C7 01 38 C3 0A 0C 01 C8 FF 0A 0C 00 05 13 0A 70 00 3C 0A 0A 0A 00 69 AF 0A 20 00 04 06 0A 8F 00 90 14 0A 62 00 3E 10 0A B9 01 91 C9 0A 2D 00 64 0A 0A 63 00 4B 02 0A 8F 00 14 90 0A 21 00 6A 13 0A E4 00 91 20 0A 03 00 05 0C 0A 19 00 1E 1E 0A 03 01 05 0C 0A 02 00 02 02 0A 28 00 21 06 0A 04 00 B2 64 0A 06 00 64 B2 0A 71 01 58 58 0A 2E 00 11 38 0A 7F 01 7F 7F 0A 80 00 7F 7F 0A 81 00 7F 7F 0A

0x10E44 : some menu text

WRIST
WEAPON
WARNING
TRASH
TIME & GIL
THROW
TARGET
GOOD STATUS
BAD STATUS
SELECTED
SAVE
QUANTITY
PRICE
PLAYER
PARTY
NUM
NOTICE
NORMAL
NO
NEW
NAME
MP
MP MAX
MOGNET
LOCATION
LOAD
ITEM
INFO
HP
HP MAX
HINT
HELP
HEAD
LEARNED
FILE
ERROR
EQUIPMENT
ENEMY
DEFENSE
CONFIG
COMMAND
CHOCOGRAPH
CHOCOBO ABILITY
CHECK
CARD
CARD INFO
ATTACK
ATB
ARMOR
ARRANGE
ACCESSORY
ABILITY
0123456789ABCDEF
0123456789abcdef

Battle PRNG seeding

0004be00: 27bdf7c0 addiu r29,r29,0xf7c0		;r29 += 0xf7c0
0004be04: afbf0838 sw r31,0x0838(r29)		;Store r31 to (r29+0x838)
0004be08: 00001821 addu r3,r0,r0		;r3 = 0
0004be0c: 00603021 addu r6,r3,r0		;r6 = r3
0004be10: 3c075d58 lui r7,0x5d58
0004be14: 34e78b65 ori r7,r7,0x8b65		;r7 = 0x5d588b65
0004be18: 3c088000 lui r8,0x8000		;r8 = 0x80000000
0004be1c: 2405001f addiu r5,r0,0x001f		;r5 = 0x1F
0004be20: 00870018 mult r4,r7
0004be24: 24a5ffff addiu r5,r5,0xffff		;r5--
0004be28: 00031842 srl r3,r3,0x01		;r3 >> 1
0004be2c: 00005812 mflo r11			;r11 = r4 × r7
0004be30: 25640001 addiu r4,r11,0x0001		;r4 = r11 + 1
0004be34: 00881024 and r2,r4,r8			;r2 = r4 & r8
0004be38: 04a1fff9 bgez r5,0x0004be20		;if(r5 > 0), loop to 0x4be20
0004be3c: 00621825 or r3,r3,r2			;r3 |= r2
0004be40: 00061080 sll r2,r6,0x02		;r2 = r6 << 2
0004be44: 27a50010 addiu r5,r29,0x0010		;r5 = r29 + 0x10
0004be48: 00a21021 addu r2,r5,r2		;r2 += r5
0004be4c: ac430000 sw r3,0x0000(r2)		;Store r3 in (r2)
0004be50: 24c60001 addiu r6,r6,0x0001		;r6++
0004be54: 28c20011 slti r2,r6,0x0011
0004be58: 1440fff0 bne r2,r0,0x0004be1c		;if(r6 < 0x11), loop to 0x4be1c
0004be5c: 00a05021 addu r10,r5,r0		;r10 = r5
0004be60: 24060011 addiu r6,r0,0x0011		;r6 = 0x11
0004be64: 27a90054 addiu r9,r29,0x0054		;r9 = r29 + 0x54
0004be68: 24080040 addiu r8,r0,0x0040		;r8 = 0x40
0004be6c: 24070004 addiu r7,r0,0x0004		;r7 = 4
0004be70: 00002821 addu r5,r0,r0		;r5 = 0
0004be74: 8fa20050 lw r2,0x0050(r29)		;r2 = (r29+0x50)
0004be78: 8fa30010 lw r3,0x0010(r29)		;r3 = (r29+0x10)
0004be7c: 8fa4004c lw r4,0x004c(r29)		;r4 = (r29+0x4c)
0004be80: 000215c0 sll r2,r2,0x17
0004be84: 00031a42 srl r3,r3,0x09		;r3 >> 9
0004be88: 00431026 xor r2,r2,r3			;r2 = r2 ⊕ r3
0004be8c: 00441026 xor r2,r2,r4			;r2 = r2 ⊕ r4
0004be90: afa20050 sw r2,0x0050(r29)
0004be94: 01482021 addu r4,r10,r8		;r4 = r8 + r10
0004be98: 25080004 addiu r8,r8,0x0004		;r8 += 4
0004be9c: 01471821 addu r3,r10,r7		;r3 = r10 + r7
0004bea0: 24e70004 addiu r7,r7,0x0004		;r7 += 4
0004bea4: 01451021 addu r2,r10,r5		;r2 = r5 + r10
0004bea8: 24a50004 addiu r5,r5,0x0004		;r5 += 4
0004beac: 24c60001 addiu r6,r6,0x0001		;r6++
0004beb0: 8c420000 lw r2,0x0000(r2)		;r2 = (r2)
0004beb4: 8c630000 lw r3,0x0000(r3)		;r3 = (r3)
0004beb8: 8c840000 lw r4,0x0000(r4)		;r4 = (r4)
0004bebc: 000215c0 sll r2,r2,0x17
0004bec0: 00031a42 srl r3,r3,0x09		;r3 >> 9
0004bec4: 00431026 xor r2,r2,r3			;r2 = r2 ⊕ r3
0004bec8: 00441026 xor r2,r2,r4			;r2 = r2 ⊕ r4
0004becc: ad220000 sw r2,0x0000(r9)		;Store r2 to (r9)
0004bed0: 28c20209 slti r2,r6,0x0209
0004bed4: 1440ffef bne r2,r0,0x0004be94		;if(r6 < 521), loop to 0x4be94
0004bed8: 25290004 addiu r9,r9,0x0004		;r9 += 4
0004bedc: 00003021 addu r6,r0,r0		;r6 = 0
0004bee0: 3c028008 lui r2,0x8008
0004bee4: 2445b724 addiu r5,r2,0xb724		;r5 = 0x8007b724
0004bee8: 27a40010 addiu r4,r29,0x0010		;r4 = r29 + 0x10
0004beec: 90830000 lbu r3,0x0000(r4)		;r3 = (r4)
0004bef0: 00c51021 addu r2,r6,r5		;r2 = r5 + r6
0004bef4: 24c60001 addiu r6,r6,0x0001		;r6++
0004bef8: a0430000 sb r3,0x0000(r2)		;Store PRNG seed to (r2), that is 0x8007B724 + offset
0004befc: 28c20209 slti r2,r6,0x0209
0004bf00: 1440fffa bne r2,r0,0x0004beec		;if(r6 < 521), loop to 0x4beec
0004bf04: 24840004 addiu r4,r4,0x0004		;r4 += 4
0004bf08: 0c012fc8 jal 0x0004bf20		;Jump to 0x4bf20 and link
0004bf0c: 00000000 nop
0004bf10: 8fbf0838 lw r31,0x0838(r29)
0004bf14: 00000000 nop
0004bf18: 03e00008 jr r31
0004bf1c: 27bd0840 addiu r29,r29,0x0840

0004bf20 (PRNG, PRN pointer and stuff)

0004bf20: 3c028008 lui r2,0x8008
0004bf24: 2442b724 addiu r2,r2,0xb724		;r2 = 0x8007b724 ; pointer to the first Pseudo-Random Number
0004bf28: 24430020 addiu r3,r2,0x0020		;r3 = r2 + 0x20
0004bf2c: ac42fffc sw r2,-0x0004(r2)		;Store pointer to (r2-0x4)
0004bf30: 80450000 lb r5,0x0000(r2)		;r5 = first byte of first PRN
0004bf34: 804401e9 lb r4,0x01e9(r2)		;r4 = first byte of (r2+0x1e9)
0004bf38: 24420001 addiu r2,r2,0x0001		;r2++
0004bf3c: 00a42826 xor r5,r5,r4			;r5 = r5 ⊕ r4
0004bf40: a045ffff sb r5,-0x0001(r2)		;Store r5 to (r2-0x1)
0004bf44: 1443fffa bne r2,r3,0x0004bf30		;if(r2 ≠ r3), loop to 0x4bf30
0004bf48: 00000000 nop
0004bf4c: 246301ec addiu r3,r3,0x01ec		;r3 += 0x1ec
0004bf50: 8c450000 lw r5,0x0000(r2)		;r5 = (r2)
0004bf54: 8c44ffe0 lw r4,-0x0020(r2)		;r4 = (r2 - 0x20)
0004bf58: 24420004 addiu r2,r2,0x0004		;r2 += 4
0004bf5c: 00a42826 xor r5,r5,r4			;r5 = r5 ⊕ r4
0004bf60: ac45fffc sw r5,-0x0004(r2)		;Store r5 to (r2-0x4)
0004bf64: 1443fffa bne r2,r3,0x0004bf50		;if(r2 ≠ r3), loop to 0x4bf30
0004bf68: 00000000 nop
0004bf6c: 03e00008 jr r31
0004bf70: 00000000 nop

Tetra Master

Stores card stats

0006241c: 27bd0018 addiu r29,r29,0x0018		;r29 += 24
00062420: 27bdffe8 addiu r29,r29,0xffe8		;r29 -=24 (sic)
00062424: 00004821 addu r9,r0,r0		;r9 = 0
00062428: 3c028008 lui r2,0x8008
0006242c: 93aa0028 lbu r10,0x0028(r29)		;r10 = (r29+0x28)
00062430: 93ab002c lbu r11,0x002c(r29)		;r11 = (r29+0x2C)
00062434: 24483248 addiu r8,r2,0x3248		;r8 = 0x80083248
00062438: afbf0010 sw r31,0x0010(r29)		;store r31 in (r29+0x10)
0006243c: 91030006 lbu r3,0x0006(r8)		;r3 = (r8+6)
00062440: 240200ff addiu r2,r0,0x00ff		;r2--
00062444: 1462000c bne r3,r2,0x00062478		;if(r2 ≠ r3), branch to 0x00062478
00062448: 25290001 addiu r9,r9,0x0001		;r9++
0006244c: a1040006 sb r4,0x0006(r8)		;store card ID in (r8+6)
00062450: 308400ff andi r4,r4,0x00ff		;r4 = card ID & 0xFF
00062454: a1050007 sb r5,0x0007(r8)		;store Arrows in (r8+7)
00062458: a1060008 sb r6,0x0008(r8)		;store Attack in (r8+8)
0006245c: a1070009 sb r7,0x0009(r8)		;store Type in (r8+9)
00062460: a10a000a sb r10,0x000a(r8)		;store Physical Defense in (r8+10)
00062464: 0c018958 jal 0x00062560
00062468: a10b000b sb r11,0x000b(r8)		;store Magical Defense in (r8+11)

0x0006246C

0006246c: 38420001 xori r2,r2,0x0001		;r2 = r2 ⊕ 1
00062470: 08018922 j 0x00062488
00062474: 2c420001 sltiu r2,r2,0x0001		;if(r2==0), r2 = 1
00062478: 29220069 slti r2,r9,0x0069
0006247c: 1440ffef bne r2,r0,0x0006243c		;if(r9 < 105), loop to 0x0006243c
00062480: 25080006 addiu r8,r8,0x0006		;r8 += 6
00062484: 2402ffff addiu r2,r0,0xffff
00062488: 8fbf0010 lw r31,0x0010(r29)		;r31 = (r29+0x10)
0006248c: 00000000 nop
00062490: 03e00008 jr r31
00062494: 27bd0018 addiu r29,r29,0x0018		;r29 += 0x18

0x00062560

00062560: 00003021 addu r6,r0,r0		;r6 = 0
00062564: 00c02821 addu r5,r6,r0		;r5 = 0
00062568: 308400ff andi r4,r4,0x00ff		;r4 &= 0xFF
0006256c: 3c028008 lui r2,0x8008
00062570: 24433248 addiu r3,r2,0x3248		;r3 = 0x80083248 + (iteration × 6)
00062574: 90620006 lbu r2,0x0006(r3)		;r2 = Card ID
00062578: 00000000 nop
0006257c: 14440002 bne r2,r4,0x00062588		;if(Card_ID ≠ r4), branch to 0x00062588
00062580: 00000000 nop
00062584: 24c60001 addiu r6,r6,0x0001		;r6++
00062588: 24a50001 addiu r5,r5,0x0001		;r5++
0006258c: 28a20069 slti r2,r5,0x0069
00062590: 1440fff8 bne r2,r0,0x00062574		;if(r5 < 105), loop to 0x00062574
00062594: 24630006 addiu r3,r3,0x0006		;r3 += 6
00062598: 03e00008 jr r31
0006259c: 00c01021 addu r2,r6,r0		;r2 = r6

0x000625a0

000625a0: 00004021 addu r8,r0,r0		;r8 = 0
000625a4: 01003821 addu r7,r8,r0		;r7 = r8
000625a8: 308400ff andi r4,r4,0x00ff		;r4 &= 0xFF
000625ac: 3c028008 lui r2,0x8008
000625b0: 24423248 addiu r2,r2,0x3248		;r3 = 0x80083248 + (iteration × 6)
000625b4: 24460006 addiu r6,r2,0x0006		;r6 = r2 + 6
000625b8: 00401821 addu r3,r2,r0		;r3 = r2
000625bc: 90620006 lbu r2,0x0006(r3)		;r2 = Card ID
000625c0: 00000000 nop
000625c4: 14440005 bne r2,r4,0x000625dc		;if(Card_ID ≠ r4), branch to 0x000625dc
000625c8: 00000000 nop
000625cc: 14a80003 bne r5,r8,0x000625dc		;if(r5 ≠ r8), branch to 0x000625dc
000625d0: 25080001 addiu r8,r8,0x0001
000625d4: 03e00008 jr r31
000625d8: 00c01021 addu r2,r6,r0		;r2 = r6
000625dc: 24c60006 addiu r6,r6,0x0006		;r6 += 6
000625e0: 24e70001 addiu r7,r7,0x0001		;r7++
000625e4: 28e20069 slti r2,r7,0x0069
000625e8: 1440fff4 bne r2,r0,0x000625bc		;if(r7 < 105), loop to 0x000625bc
000625ec: 24630006 addiu r3,r3,0x0006		;r3 += 6
000625f0: 03e00008 jr r31
000625f4: 2402ffff addiu r2,r0,0xffff

Read selected card ID

00062638: 27bdff98 addiu r29,r29,0xff98		;r29 -= 104
0006263c: 24040063 addiu r4,r0,0x0063		;r4 = 99
00062640: 03a41021 addu r2,r29,r4		;r2 = r29 + r4
00062644: a0400000 sb r0,0x0000(r2)		;store 0 in (r2)
00062648: 2484ffff addiu r4,r4,0xffff		;r4--
0006264c: 0481fffd bgez r4,0x00062644		;if(r4 ≥ 0), loop to 0x00062644
00062650: 2442ffff addiu r2,r2,0xffff		;r2--
00062654: 00002021 addu r4,r0,r0		;r4 = 0
00062658: 240600ff addiu r6,r0,0x00ff		;r6 = 0xFF
0006265c: 3c028008 lui r2,0x8008
00062660: 24453248 addiu r5,r2,0x3248		;r5 = 0x80083248 + (current iteration ×6)
00062664: 90a20006 lbu r2,0x0006(r5)		;r2 = card ID 
00062668: 00000000 nop
0006266c: 10460005 beq r2,r6,0x00062684		;if no card in current slot, jump to 0x00062684
00062670: 03a21821 addu r3,r29,r2		;r3 = r29 + r2
00062674: 90620000 lbu r2,0x0000(r3)		;r2 = r3
00062678: 00000000 nop
0006267c: 24420001 addiu r2,r2,0x0001		;r2++
00062680: a0620000 sb r2,0x0000(r3)		;store r2 in (r3)
00062684: 24840001 addiu r4,r4,0x0001		;r4++
00062688: 28820069 slti r2,r4,0x0069
0006268c: 1440fff5 bne r2,r0,0x00062664		;if(r4 < 105), loop to 0x00062664; 100 cards + 5 cards won after a duel, that is
00062690: 24a50006 addiu r5,r5,0x0006		;r5 += 6
00062694: 00001821 addu r3,r0,r0		;r3 = 0
00062698: 00602021 addu r4,r3,r0		;r4 = r3
0006269c: 03a41021 addu r2,r29,r4		;r2 = r29 + r4
000626a0: 90420000 lbu r2,0x0000(r2)
000626a4: 00000000 nop
000626a8: 10400002 beq r2,r0,0x000626b4		;if(r2==0), branch to 0x000626b4
000626ac: 00000000 nop
000626b0: 24630001 addiu r3,r3,0x0001		;r3++
000626b4: 24840001 addiu r4,r4,0x0001		;r4++
000626b8: 28820064 slti r2,r4,0x0064
000626bc: 1440fff8 bne r2,r0,0x000626a0		;if r4 < 100, loop to 0x000626a0
000626c0: 03a41021 addu r2,r29,r4		;r2 = r29 + r4
000626c4: 00601021 addu r2,r3,r0		;r2 = r3
000626c8: 03e00008 jr r31
000626cc: 27bd0068 addiu r29,r29,0x0068		;r29 += 104

Removes card from inventory

000626d0: 00003821 addu r7,r0,r0		;r7 = 0
000626d4: 00e03021 addu r6,r7,r0		;r6 = r7
000626d8: 308400ff andi r4,r4,0x00ff		;r4 &= 0xFF
000626dc: 240800ff addiu r8,r0,0x00ff		;r8 = 0xFF
000626e0: 3c028008 lui r2,0x8008
000626e4: 24433248 addiu r3,r2,0x3248		;r3 = 0x80083248
000626e8: 90620006 lbu r2,0x0006(r3)		;r2 = card ID + (current iteration ×6)
000626ec: 00000000 nop
000626f0: 14440006 bne r2,r4,0x0006270c		;if(r2 ≠ r4), branch to 0x0006270c
000626f4: 00000000 nop
000626f8: 14e50004 bne r7,r5,0x0006270c		;if(r7 ≠ r5), branch to 0x0006270c
000626fc: 24e70001 addiu r7,r7,0x0001		;r7++
00062700: a0680006 sb r8,0x0006(r3)		;remove card by storing 0xFF in Card ID
00062704: 03e00008 jr r31
00062708: 00001021 addu r2,r0,r0		;r2 = 0
0006270c: 24c60001 addiu r6,r6,0x0001		;r6++
00062710: 28c20069 slti r2,r6,0x0069
00062714: 1440fff4 bne r2,r0,0x000626e8		;if(r6 < 105), loop to 0x000626e8
00062718: 24630006 addiu r3,r3,0x0006		;r3 += 6
0006271c: 03e00008 jr r31
00062720: 2402ffff addiu r2,r0,0xffff

0x00062724

00062724: 240400ff addiu r4,r0,0x00ff
00062728: 24030068 addiu r3,r0,0x0068
0006272c: 3c028008 lui r2,0x8008
00062730: 24423248 addiu r2,r2,0x3248
00062734: 24420270 addiu r2,r2,0x0270
00062738: a0440006 sb r4,0x0006(r2)
0006273c: 2463ffff addiu r3,r3,0xffff
00062740: 0461fffd bgez r3,0x00062738
00062744: 2442fffa addiu r2,r2,0xfffa
00062748: 03e00008 jr r31
0006274c: 00000000 nop

0x00062750

00062750: 3c028008 lui r2,0x8008
00062754: 03e00008 jr r31
00062758: ac4434c8 sw r4,0x34c8(r2)

0x0006275c

0006275c: 3c028008 lui r2,0x8008
00062760: 8c4234c8 lw r2,0x34c8(r2)
00062764: 03e00008 jr r31
00062768: 00000000 nop

0x0006276c

0006276c: 27bdffe8 addiu r29,r29,0xffe8
00062770: 00802821 addu r5,r4,r0
00062774: 3c048007 lui r4,0x8007
00062778: afbf0010 sw r31,0x0010(r29)
0006277c: 0c00d5f0 jal 0x000357c0
00062780: 2484fd60 addiu r4,r4,0xfd60
00062784: 8fbf0010 lw r31,0x0010(r29)
00062788: 00000000 nop
0006278c: 03e00008 jr r31
00062790: 27bd0018 addiu r29,r29,0x0018

0x00062794

00062794: 27bdffe8 addiu r29,r29,0xffe8
00062798: afbf0010 sw r31,0x0010(r29)
0006279c: 0c0189db jal 0x0006276c
000627a0: 00000000 nop
000627a4: 0c00ae9a jal 0x0002ba68
000627a8: 00402021 addu r4,r2,r0
000627ac: 8fbf0010 lw r31,0x0010(r29)
000627b0: 00000000 nop
000627b4: 03e00008 jr r31
000627b8: 27bd0018 addiu r29,r29,0x0018

0x000627bc

000627bc: 28820038 slti r2,r4,0x0038
000627c0: 10400003 beq r2,r0,0x000627d0
000627c4: 28820046 slti r2,r4,0x0046
000627c8: 03e00008 jr r31
000627cc: 00001021 addu r2,r0,r0

0x000627d0

000627d0: 10400003 beq r2,r0,0x000627e0
000627d4: 28820050 slti r2,r4,0x0050
000627d8: 03e00008 jr r31
000627dc: 24020001 addiu r2,r0,0x0001

0x000627e0

000627e0: 10400003 beq r2,r0,0x000627f0
000627e4: 28820058 slti r2,r4,0x0058
000627e8: 03e00008 jr r31
000627ec: 24020002 addiu r2,r0,0x0002

0x000627f0

000627f0: 10400003 beq r2,r0,0x00062800		;if(r2 == 0), branch to 0x00062800
000627f4: 2882005d slti r2,r4,0x005d
000627f8: 03e00008 jr r31
000627fc: 24020003 addiu r2,r0,0x0003

0x00062800

00062800: 14400006 bne r2,r0,0x0006281c
00062804: 24020004 addiu r2,r0,0x0004
00062808: 2883005f slti r3,r4,0x005f
0006280c: 14600003 bne r3,r0,0x0006281c
00062810: 24020005 addiu r2,r0,0x0005
00062814: 03e00008 jr r31
00062818: 24020006 addiu r2,r0,0x0006

0x0006281c (jr r31, nop)

0006281c: 03e00008 jr r31
00062820: 00000000 nop

Generate Card

Generate initial Attack stat

Min Attack stat = Base Attack >> 1
Max Attack stat = Base Attack >> 1 + (RND % (Base Attack >> 1))
00062824: 3c028008 lui r2,0x8008 00062828: 03e00008 jr r31 0006282c: 24423248 addiu r2,r2,0x3248 ;r2 = 0x80083248 00062830: 27bdffc8 addiu r29,r29,0xffc8 ;r29 -= 0x38 00062834: afb40028 sw r20,0x0028(r29) ;r20 = (r29+0x28) 00062838: 0080a021 addu r20,r4,r0 ;r20 += r4 0006283c: 3c028001 lui r2,0x8001 00062840: afb5002c sw r21,0x002c(r29) ;store r21 in (r29+0x2C) 00062844: 00a0a821 addu r21,r5,r0 ;r21 = Card ID 00062848: afbf0034 sw r31,0x0034(r29) ;store r31 in (r29+0x34) 0006284c: afb60030 sw r22,0x0030(r29) ;store r22 in (r29+0x30) 00062850: afb30024 sw r19,0x0024(r29) ;store r19 in (r29+0x24) 00062854: afb20020 sw r18,0x0020(r29) ;store r18 in (r29+0x20) 00062858: afb1001c sw r17,0x001c(r29) ;store r17 in (r29+0x1C) 0006285c: afb00018 sw r16,0x0018(r29) ;store r16 in (r29+0x18) 00062860: 244921c0 addiu r9,r2,0x21c0 ;r9 = 0x800121c0 00062864: 89260003 lwl r6,0x0003(r9) ;r6 = (r9+0x3) 00062868: 99260000 lwr r6,0x0000(r9) ;r6 = (r9) 0006286c: 89270007 lwl r7,0x0007(r9) ;r7 = (r9+0x7) 00062870: 99270004 lwr r7,0x0004(r9) ;r7 = (r9+0x4) 00062874: aba60013 swl r6,0x0013(r29) ;store r6 in (r29+13) 00062878: bba60010 swr r6,0x0010(r29) ;store r6 in (r29+10) 0006287c: aba70017 swl r7,0x0017(r29) ;store r7 in (r29+17) 00062880: bba70014 swr r7,0x0014(r29) ;store r7 in (r29+14) 00062884: 3c028001 lui r2,0x8001 00062888: 245621c8 addiu r22,r2,0x21c8 ;r22 = 0x800121c8 0006288c: 32a300ff andi r3,r21,0x00ff ;r3 = Card ID & 0xFF 00062890: 00031080 sll r2,r3,0x02 00062894: 00431021 addu r2,r2,r3 00062898: 00561021 addu r2,r2,r22 ;r2 += 0x800121c8 + (card_ID × 5) 0006289c: a2850000 sb r5,0x0000(r20) ;store Card ID in (r20) 000628a0: 90420000 lbu r2,0x0000(r2) ;r2 = base Attack 000628a4: 00000000 nop 000628a8: 00028842 srl r17,r2,0x01 ;r17 = base_Attack >> 1 000628ac: 02208021 addu r16,r17,r0 ;r16 = r17 000628b0: 12000012 beq r16,r0,0x000628fc ;if(r16 = 0), branch to 0x000628fc 000628b4: 00000000 nop 000628b8: 0c018acf jal 0x00062b3c ;PRNG call 000628bc: 00000000 nop 000628c0: 0050001a div r2,r16 000628c4: 16000002 bne r16,r0,0x000628d0 ;break if attempting to divide by zero 000628c8: 00000000 nop 000628cc: 0007000d break 0x00001c00 000628d0: 2401ffff addiu r1,r0,0xffff 000628d4: 16010004 bne r16,r1,0x000628e8 000628d8: 3c018000 lui r1,0x8000 000628dc: 14410002 bne r2,r1,0x000628e8 ;break if negative or if PRN > 0x7FFF 000628e0: 00000000 nop 000628e4: 0006000d break 0x00001800 000628e8: 00001810 mfhi r3 000628ec: 00000000 nop 000628f0: 02231821 addu r3,r17,r3 ;Initial_Attack = (base_Attack >> 1) + (PRN[0;0x7FFF] % (base_Attack >> 1)) 000628f4: 08018a40 j 0x00062900 ;jump to 0x00062900 000628f8: a2830002 sb r3,0x0002(r20) ;store r3 in (r20+0x2) 000628fc: a2800002 sb r0,0x0002(r20) ;store 0 in (r20+0x2)

Generate initial Physical Defense

Min Physical Defense = Base P. Defense >> 1
Max Physical Defense = Base P. Defense >> 1 + (RND % (Base P. Defense >> 1))
00062900: 32a200ff andi r2,r21,0x00ff ;r2 = r21 & 0xFF 00062904: 00021880 sll r3,r2,0x02 00062908: 00621821 addu r3,r3,r2 ;r3 = r2 × 5 0006290c: 00761821 addu r3,r3,r22 ;r3 += r22 00062910: 90620002 lbu r2,0x0002(r3) ;r2 = (r3+0x2) 00062914: 00000000 nop 00062918: 00028842 srl r17,r2,0x01 ;r17 = r2 >> 1 0006291c: 02208021 addu r16,r17,r0 ;r16 = r17 00062920: 12000012 beq r16,r0,0x0006296c ;if(r16 == 0), branch to 0x0006296c 00062924: 00000000 nop 00062928: 0c018acf jal 0x00062b3c ;PRNG call 0006292c: 00000000 nop 00062930: 0050001a div r2,r16 00062934: 16000002 bne r16,r0,0x00062940 ;break if attempting to divide by zero 00062938: 00000000 nop 0006293c: 0007000d break 0x00001c00 00062940: 2401ffff addiu r1,r0,0xffff 00062944: 16010004 bne r16,r1,0x00062958 00062948: 3c018000 lui r1,0x8000 0006294c: 14410002 bne r2,r1,0x00062958 ;break if negative or if PRN > 0x7FFF 00062950: 00000000 nop 00062954: 0006000d break 0x00001800 00062958: 00001810 mfhi r3 0006295c: 00000000 nop 00062960: 02231821 addu r3,r17,r3 ;Initial_PDef = (base_PDef >> 1) + (PRN[0;0x7FFF] % (base_PDef >> 1)) 00062964: 08018a5c j 0x00062970 ;jump to 0x00062970 00062968: a2830004 sb r3,0x0004(r20) ;store r3 to (r20+0x04) 0006296c: a2800004 sb r0,0x0004(r20) ;store 0 in (r20+0x4)

Generate initial Magical Defense

Min Magical Defense = Base M. Defense >> 1
Max Magical Defense = Base M. Defense >> 1 + (RND % (Base M. Defense >> 1))
00062970: 32a200ff andi r2,r21,0x00ff ;r2 = r21 & 0xFF 00062974: 00021880 sll r3,r2,0x02 ;r3 = r2 << 2 00062978: 00621821 addu r3,r3,r2 ;r3 += r2 0006297c: 00761821 addu r3,r3,r22 ;r3 += r22 00062980: 90620003 lbu r2,0x0003(r3) ;r2 = (r3+0x3) 00062984: 00000000 nop 00062988: 00028842 srl r17,r2,0x01 ;r17 = r2 >> 1 0006298c: 02208021 addu r16,r17,r0 ;r16 = r17 00062990: 12000012 beq r16,r0,0x000629dc ;if(r16 == 0), branch to 0x000629dc 00062994: 00000000 nop 00062998: 0c018acf jal 0x00062b3c ;PRNG call 0006299c: 00000000 nop 000629a0: 0050001a div r2,r16 000629a4: 16000002 bne r16,r0,0x000629b0 ;break if attempting to divide by zero 000629a8: 00000000 nop 000629ac: 0007000d break 0x00001c00 000629b0: 2401ffff addiu r1,r0,0xffff 000629b4: 16010004 bne r16,r1,0x000629c8 000629b8: 3c018000 lui r1,0x8000 000629bc: 14410002 bne r2,r1,0x000629c8 ;break if negative or if PRN > 0x7FFF 000629c0: 00000000 nop 000629c4: 0006000d break 0x00001800 000629c8: 00001810 mfhi r3 000629cc: 00000000 nop 000629d0: 02231821 addu r3,r17,r3 ;Initial_MDef = (base_MDef >> 1) + (PRN[0;0x7FFF] % (base_MDef >> 1)) 000629d4: 08018a78 j 0x000629e0 ;jump to 0x000629e0 000629d8: a2830005 sb r3,0x0005(r20) ;store r3 in (r20+0x5) 000629dc: a2800005 sb r0,0x0005(r20) ;store 0 in (r20+0x5)

Generate initial amount of Arrows

0 arrows: 1%
1 arrows: 8%
2 arrows: 25%
3 arrows: 31%
4 arrows: 18%
5 arrows: 9%
6 arrows: 5%
7 arrows: 2%
8 arrows: 1%
000629e0: 0c018acf jal 0x00062b3c ;PRNG call 000629e4: 00000000 nop 000629e8: 3c0351eb lui r3,0x51eb 000629ec: 3463851f ori r3,r3,0x851f 000629f0: 00430018 mult r2,r3 000629f4: 00021fc3 sra r3,r2,0x1f 000629f8: 00003010 mfhi r6 ;r6 = (PRN × 0x51eb851f) >> 32 000629fc: 00062143 sra r4,r6,0x05 ;r4 = r6 >> 5 00062a00: 00832023 subu r4,r4,r3 ;r4 -= r3 00062a04: 00041840 sll r3,r4,0x01 ;r3 = r4 << 1 00062a08: 00641821 addu r3,r3,r4 ;r3 += r4 00062a0c: 000318c0 sll r3,r3,0x03 ;r3 = r3 << 3 00062a10: 00641821 addu r3,r3,r4 ;r3 += r4 00062a14: 00031880 sll r3,r3,0x02 ;r3 = r3 << 2 00062a18: 00432023 subu r4,r2,r3 ;r4 = r2 - r3 00062a1c: 1c800003 bgtz r4,0x00062a2c ;if(r4 > 0), branch to r4,0x00062a2c 00062a20: 28820009 slti r2,r4,0x0009 ;if(r4 < 9), r2 = 1 00062a24: 08018aa0 j 0x00062a80 ;jump to 0x00062a80 00062a28: 00009021 addu r18,r0,r0 ;r18 = 0 00062a2c: 14400014 bne r2,r0,0x00062a80 ;if(r4 < 9), branch to 0x00062a80 00062a30: 24120001 addiu r18,r0,0x0001 ;r18 = 1 00062a34: 28820022 slti r2,r4,0x0022 00062a38: 14400011 bne r2,r0,0x00062a80 ;if(r4 < 0x22), branch to 0x00062a80 00062a3c: 24120002 addiu r18,r0,0x0002 ;r18 = 2 00062a40: 28820041 slti r2,r4,0x0041 00062a44: 1440000e bne r2,r0,0x00062a80 ;if(r4 < 0x41), branch to 0x00062a80 00062a48: 24120003 addiu r18,r0,0x0003 ;r18 = 3 00062a4c: 28820053 slti r2,r4,0x0053 00062a50: 1440000b bne r2,r0,0x00062a80 ;if(r4 < 0x53), branch to 0x00062a80 00062a54: 24120004 addiu r18,r0,0x0004 ;r18 = 4 00062a58: 2882005c slti r2,r4,0x005c 00062a5c: 14400008 bne r2,r0,0x00062a80 ;if(r4 < 0x5C), branch to 0x00062a80 00062a60: 24120005 addiu r18,r0,0x0005 ;r18 = 5 00062a64: 28820061 slti r2,r4,0x0061 00062a68: 14400005 bne r2,r0,0x00062a80 ;if(r4 < 0x61), branch to 0x00062a80 00062a6c: 24120006 addiu r18,r0,0x0006 ;r18 = 6 00062a70: 28820063 slti r2,r4,0x0063 00062a74: 10400002 beq r2,r0,0x00062a80 ;if(r4 ≥ 0x63), branch to 0x00062a80 00062a78: 24120008 addiu r18,r0,0x0008 ;r18 = 8 00062a7c: 24120007 addiu r18,r0,0x0007 ;r18 = 7 00062a80: a2800001 sb r0,0x0001(r20) ;store 0 in (r20+0x1)

Generate initial Arrows

00062a84: 12400015 beq r18,r0,0x00062adc	;if(r18==0), branch to 0x00062adc
00062a88: 00008821 addu r17,r0,r0		;r17 = 0
00062a8c: 27b30010 addiu r19,r29,0x0010		;r19 = r29 + 0x10
00062a90: 00008021 addu r16,r0,r0		;r16 = 0
00062a94: 0c018acf jal 0x00062b3c		;PRNG call
00062a98: 00000000 nop
00062a9c: 30420007 andi r2,r2,0x0007		;r2 &= 0x7
00062aa0: 02621021 addu r2,r19,r2		;r2 += r19
00062aa4: 92840001 lbu r4,0x0001(r20)		;r4 = previous_Arrows
00062aa8: 90430000 lbu r3,0x0000(r2)		;r3 = value from Arrows array
00062aac: 00000000 nop
00062ab0: 00831024 and r2,r4,r3			;r2 = previous_Arrows & Arrows
00062ab4: 14400003 bne r2,r0,0x00062ac4		;if(no new Arrow), branch to 0x00062ac4
00062ab8: 00831025 or r2,r4,r3			;new_Arrows = Arrows | previous_Arrows
00062abc: a2820001 sb r2,0x0001(r20)		;store new_Arrows in (r20+0x1)
00062ac0: 24100001 addiu r16,r0,0x0001		;r16 = 1
00062ac4: 1200fff3 beq r16,r0,0x00062a94	;if(no new Arrow), loop to 0x00062a94, new PRNG call
00062ac8: 00000000 nop
00062acc: 26310001 addiu r17,r17,0x0001		;r17++
00062ad0: 0232102a slt r2,r17,r18
00062ad4: 1440ffef bne r2,r0,0x00062a94		;if(r17 < r18), loop to 0x00062a94, new PRNG call
00062ad8: 00008021 addu r16,r0,r0		;r16 = 0
00062adc: 32a300ff andi r3,r21,0x00ff		;r3 = r21 & 0xFF
00062ae0: 00031080 sll r2,r3,0x02		;r2 = r3 << 2
00062ae4: 00431021 addu r2,r2,r3		;r2 += r3
00062ae8: 00561021 addu r2,r2,r22		;r2 += r22
00062aec: 90420001 lbu r2,0x0001(r2)		;r2 = (r2+0x1)

Generate initial Type

00062af0: 0c018acf jal 0x00062b3c		;PRNG call
00062af4: a2820003 sb r2,0x0003(r20)		;store PRN in (r20+0x3)
00062af8: 3042007f andi r2,r2,0x007f		;r2 &= 0x7F, that is 1/128 chance
00062afc: 14400002 bne r2,r0,0x00062b08		;if(r2 ≠ 0), branch to 0x00062b08
00062b00: 24020002 addiu r2,r0,0x0002		;r2 = Type X
00062b04: a2820003 sb r2,0x0003(r20)		;store r2 in (r20+0x3)
00062b08: 8fbf0034 lw r31,0x0034(r29)		;r31 = (r29+0x34)
00062b0c: 8fb60030 lw r22,0x0030(r29)		;r22 = (r29+0x30)
00062b10: 8fb5002c lw r21,0x002c(r29)		;r21 = (r29+0x2c)
00062b14: 8fb40028 lw r20,0x0028(r29)		;r20 = (r29+0x28)
00062b18: 8fb30024 lw r19,0x0024(r29)		;r19 = (r29+0x24)
00062b1c: 8fb20020 lw r18,0x0020(r29)		;r18 = (r29+0x20)
00062b20: 8fb1001c lw r17,0x001c(r29)		;r17 = (r29+0x17)
00062b24: 8fb00018 lw r16,0x0018(r29)		;r16 = (r29+0x16)
00062b28: 03e00008 jr r31			;jump to r31
00062b2c: 27bd0038 addiu r29,r29,0x0038		;r29 += 0x28

0x00062b30

00062b30: 3c028001 lui r2,0x8001
00062b34: 03e00008 jr r31			;jump to r31
00062b38: 244221c8 addiu r2,r2,0x21c8		;r2 = 0x800121c8

PRNG call, result stored in r2

00062b3c: 240a00a0 addiu r10,r0,0x00a0		;r10 = 0xA0
00062b40: 01400008 jr r10			;jump to r10
00062b44: 2409002f addiu r9,r0,0x002f		;r9 = 0x2F

0x00063a74

00063a74: 3c0600ff lui r6,0x00ff
00063a78: 34c6ffff ori r6,r6,0xffff		;r6 = 0x00FFFFFF
00063a7c: 3c07ff00 lui r7,0xff00		;r7 = 0xFF000000
00063a80: 8ca30000 lw r3,0x0000(r5)		;r3 = (r5)
00063a84: 8c820000 lw r2,0x0000(r4)		;r2 = (r4)
00063a88: 00671824 and r3,r3,r7			;r3 &= 0xFF000000
00063a8c: 00461024 and r2,r2,r6			;r2 &= 0x00FFFFFF
00063a90: 00621825 or r3,r3,r2			;r3 |= r2
00063a94: aca30000 sw r3,0x0000(r5)		;store r3 in (r5)
00063a98: 8c820000 lw r2,0x0000(r4)		;r2 = (r4)
00063a9c: 00a62824 and r5,r5,r6			;r5 &= r6
00063aa0: 00471024 and r2,r2,r7			;r2 &= r7
00063aa4: 00451025 or r2,r2,r5			;r2 |= r5
00063aa8: 03e00008 jr r31
00063aac: ac820000 sw r2,0x0000(r4)		;store r2 in (r4)

0x00065898

00065898: 304200ff andi r2,r2,0x00ff
0006589c: 1040000b beq r2,r0,0x000658cc		;if(r2 && 0xFF == 0), branch to 0x000658cc
000658a0: 24020001 addiu r2,r0,0x0001
000658a4: 8e020004 lw r2,0x0004(r16)
000658a8: 00000000 nop
000658ac: 94420010 lhu r2,0x0010(r2)		;r2 = (r2+0x10)
000658b0: 00000000 nop
000658b4: 14400005 bne r2,r0,0x000658cc		;if(r2 ≠ 0)
000658b8: 24020001 addiu r2,r0,0x0001
000658bc: 92030010 lbu r3,0x0010(r16)
000658c0: 00001021 addu r2,r0,r0		;r2 = 0
000658c4: 34630001 ori r3,r3,0x0001
000658c8: a2030010 sb r3,0x0010(r16)
000658cc: 8fbf0014 lw r31,0x0014(r29)
000658d0: 8fb00010 lw r16,0x0010(r29)
000658d4: 03e00008 jr r31
000658d8: 27bd0018 addiu r29,r29,0x0018		;r29 += 18

Tetra Master battle mechanics

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

0x000a8bc4

000a8bc4: 27bdffe8 addiu r29,r29,0xffe8		;r29 += 0xFFE8
000a8bc8: 3c028007 lui r2,0x8007
000a8bcc: 8c427524 lw r2,0x7524(r2)		;r2 = (0x80077524)
000a8bd0: 24030f09 addiu r3,r0,0x0f09		;r3 = 0xF09
000a8bd4: afbf0014 sw r31,0x0014(r29)		;store r31 in (r29+0x14)
000a8bd8: 30420f09 andi r2,r2,0x0f09		;r2 &=0xF09
000a8bdc: 1443000a bne r2,r3,0x000a8c08		;if(r2 ≠ r3), branch to 0x000a8c08
000a8be0: afb00010 sw r16,0x0010(r29)		;store r16 in (r29+0x10)
000a8be4: 3c028006 lui r2,0x8006
000a8be8: 8c43794c lw r3,0x794c(r2)		;r3 = (0x8006794C)
000a8bec: 00000000 nop
000a8bf0: 8c620000 lw r2,0x0000(r3)		;r2 = (r3)
000a8bf4: 00000000 nop
000a8bf8: 34420001 ori r2,r2,0x0001		;r2 |= 1
000a8bfc: ac620000 sw r2,0x0000(r3)		;store r2 in (r3)
000a8c00: 2402000c addiu r2,r0,0x000c		;r2 = 0xC
000a8c04: ac820000 sw r2,0x0000(r4)		;store r2 in (r4)
000a8c08: 3c108006 lui r16,0x8006
000a8c0c: 8e04794c lw r4,0x794c(r16)		;r4 = (0x8006794C)
000a8c10: 00000000 nop
000a8c14: 8c82001c lw r2,0x001c(r4)		;r2 = (r4+0x1C)
000a8c18: 00000000 nop
000a8c1c: 90430008 lbu r3,0x0008(r2)		;r3 = (r2+0x8)
000a8c20: 00000000 nop
000a8c24: 00031040 sll r2,r3,0x01
000a8c28: 00431021 addu r2,r2,r3
000a8c2c: 000210c0 sll r2,r2,0x03
000a8c30: 00431023 subu r2,r2,r3		;r2 = r3 × 23
000a8c34: 8c830010 lw r3,0x0010(r4)		;r3 = (r4+0x10)
000a8c38: 00021080 sll r2,r2,0x02		;r2 = r2 << 2
000a8c3c: 00621821 addu r3,r3,r2		;r3 += r2
000a8c40: 24630017 addiu r3,r3,0x0017		;r3 += 0x17
000a8c44: 1060000a beq r3,r0,0x000a8c70		;if(r3 == 0), branch to 0x000a8c70
000a8c48: 00000000 nop
000a8c4c: 0c004c29 jal 0x000130a4		;jump to 0x000130a4 and link
000a8c50: 00002021 addu r4,r0,r0		;r4 = 0

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)

Type change after a battle

Read current Type, and branch

000ac414: ae20041c sw r0,0x041c(r17)		;store 0 in (r17+0x41c)
000ac418: 8e220424 lw r2,0x0424(r17)
000ac41c: 00000000 nop
000ac420: ae620004 sw r2,0x0004(r19)		;store r2 in (r19+0x4)
000ac424: 8e220428 lw r2,0x0428(r17)
000ac428: 02808021 addu r16,r20,r0
000ac42c: ae620008 sw r2,0x0008(r19)		;store r2 in (r19+0x8)
000ac430: 2402000a addiu r2,r0,0x000a		;r2 = 0xA
000ac434: ae220420 sw r2,0x0420(r17)
000ac438: 92030003 lbu r3,0x0003(r16)		;r3 = Type, from 0x801FF9F3 + (0x3C × card_slot)
000ac43c: 00000000 nop
000ac440: 04600014 bltz r3,0x000ac494		;if(r3 < 0), branch to 0x000ac494
000ac444: 28620002 slti r2,r3,0x0002
000ac448: 14400005 bne r2,r0,0x000ac460		;if(Type == P || Type == M), branch to 0x000ac460
000ac44c: 24020002 addiu r2,r0,0x0002
000ac450: 1062000a beq r3,r2,0x000ac47c		;if(Type == X), branch to 0x000ac47c
000ac454: 00000000 nop
000ac458: 0802b125 j 0x000ac494			;jump to 0x000ac494
000ac45c: 00000000 nop

Evolve from P/M to X

000ac460: 0c018acf jal 0x00062b3c		;PRNG call
000ac464: 00000000 nop
000ac468: 3042003f andi r2,r2,0x003f		;r2 &= 0x3F, that is 1/64 chance
000ac46c: 14400009 bne r2,r0,0x000ac494		;if(r2 ≠ 0), branch to 0x000ac494
000ac470: 24020002 addiu r2,r0,0x0002		;r2 = Type X
000ac474: 0802b125 j 0x000ac494			;jump to 0x000ac494
000ac478: a2020003 sb r2,0x0003(r16)		;store new Type in 0x801FF9F3 + (0x3C × card_slot)

Evolve from X to A

000ac47c: 0c018acf jal 0x00062b3c		;PRNG call
000ac480: 00000000 nop
000ac484: 3042007f andi r2,r2,0x007f		;r2 &= 0x7F, that is 1/128 chance
000ac488: 14400002 bne r2,r0,0x000ac494		;if(r2 ≠ 0), branch to 0x000ac494
000ac48c: 24020003 addiu r2,r0,0x0003		;r2 = Type A
000ac490: a2020003 sb r2,0x0003(r16)		;store new Type in 0x801FF9F3 + (0x3C × card_slot)
000ac494: 8e2205bc lw r2,0x05bc(r17)
000ac498: 8e2305c0 lw r3,0x05c0(r17)
000ac49c: ae220574 sw r2,0x0574(r17)
000ac4a0: ae230578 sw r3,0x0578(r17)
000ac4a4: 02401021 addu r2,r18,r0
000ac4a8: 8fbf002c lw r31,0x002c(r29)
000ac4ac: 8fb40028 lw r20,0x0028(r29)
000ac4b0: 8fb30024 lw r19,0x0024(r29)
000ac4b4: 8fb20020 lw r18,0x0020(r29)
000ac4b8: 8fb1001c lw r17,0x001c(r29)
000ac4bc: 8fb00018 lw r16,0x0018(r29)
000ac4c0: 03e00008 jr r31
000ac4c4: 27bd0030 addiu r29,r29,0x0030

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

Card Attack stat

Card value displayed

000af9b8: 2694fffe addiu r20,r20,0xfffe		;r2 -= 2
000af9bc: 02e02021 addu r4,r23,r0		;r4 = r23
000af9c0: 02002821 addu r5,r16,r0		;r5 = r16
000af9c4: 02a03021 addu r6,r21,r0		;r6 = r21
000af9c8: 26470009 addiu r7,r18,0x0009		;r7 = r18 + 9
000af9cc: 26910028 addiu r17,r20,0x0028		;r17 = r20 + 0x28
000af9d0: afb10010 sw r17,0x0010(r29)		;store r17 in (r29+0x10)
000af9d4: 92c20002 lbu r2,0x0002(r22)		;r2 = card Attack stat on the field
000af9d8: 33d300ff andi r19,r30,0x00ff		;r19 = r30 & 0xFF
000af9dc: afb30018 sw r19,0x0018(r29)		;store r19 in (r29 + 0x18)
000af9e0: 00021102 srl r2,r2,0x04		;r2 = Attack >> 4
000af9e4: 0c02bed8 jal 0x000afb60		;jump to 0x000afb60
000af9e8: afa20014 sw r2,0x0014(r29)		;store Attack higher nibble in (r29+0x14)

Card Type

Card type displayed

000af9ec: 00408021 addu r16,r2,r0
000af9f0: 92c30003 lbu r3,0x0003(r22)		;r3 = card type, that is P/M/X/A
000af9f4: 24020001 addiu r2,r0,0x0001		;r2 = 1
000af9f8: 10620012 beq r3,r2,0x000afa44		;if(type == M), branch to 0x000afa44
000af9fc: 28620002 slti r2,r3,0x0002
000afa00: 10400005 beq r2,r0,0x000afa18		;if(type == X || type == A), branch to 0x000afa18
000afa04: 24020002 addiu r2,r0,0x0002		;r2 = 2
000afa08: 10600009 beq r3,r0,0x000afa30		;if(type == P), branch to 0x000afa30
000afa0c: 02e02021 addu r4,r23,r0		;r4 = r23
000afa10: 0802bea8 j 0x000afaa0			;error trap
000afa14: 02002821 addu r5,r16,r0		;r5 = r16
000afa18: 10620010 beq r3,r2,0x000afa5c		;if(type == X), branch to 0x000afa5c
000afa1c: 24020003 addiu r2,r0,0x0003		;r2 = 3
000afa20: 10620014 beq r3,r2,0x000afa74		;if(type == A), branch to 0x000afa74
000afa24: 02e02021 addu r4,r23,r0		;r4 = r23
000afa28: 0802bea8 j 0x000afaa0			;error trap
000afa2c: 02002821 addu r5,r16,r0		;r5 = r16

Physical card

000afa30: 02002821 addu r5,r16,r0		;r5 = r16
000afa34: 02a03021 addu r6,r21,r0		;r6 = r21
000afa38: 2647000f addiu r7,r18,0x000f		;r7 = r18 + 0xF
000afa3c: 0802bea1 j 0x000afa84
000afa40: 24020010 addiu r2,r0,0x0010		;r2 = 0x10

Magic card

000afa44: 02e02021 addu r4,r23,r0		;r4 = r23
000afa48: 02002821 addu r5,r16,r0		;r5 = r16
000afa4c: 02a03021 addu r6,r21,r0		;r6 = r21
000afa50: 2647000f addiu r7,r18,0x000f		;r7 = r18 + 0xF
000afa54: 0802bea1 j 0x000afa84
000afa58: 24020011 addiu r2,r0,0x0011		;r2 = 0x11

X card

000afa5c: 02e02021 addu r4,r23,r0		;r4 = r23
000afa60: 02002821 addu r5,r16,r0		;r5 = r16
000afa64: 02a03021 addu r6,r21,r0		;r6 = r21
000afa68: 2647000f addiu r7,r18,0x000f		;r7 = r18 + 0xF
000afa6c: 0802bea1 j 0x000afa84
000afa70: 24020012 addiu r2,r0,0x0012		;r2 = 0x12

Advanced card

000afa74: 02002821 addu r5,r16,r0		;r5 = r16
000afa78: 02a03021 addu r6,r21,r0		;r6 = r21
000afa7c: 2647000f addiu r7,r18,0x000f		;r7 = r18 + 0xF
000afa80: 2402000a addiu r2,r0,0x000a		;r2 = 0xA
000afa84: afb10010 sw r17,0x0010(r29)		;PMX cards jump here, store r17 in (r29+0x10), probably Attack value after randomness
000afa88: afa20014 sw r2,0x0014(r29)		;store PMXA in (r29+0x14)
000afa8c: 0c02bed8 jal 0x000afb60		;jump to 0x000afb60
000afa90: afb30018 sw r19,0x0018(r29)		;store r19 in (r29+0x18)

0x000afa94

000afa94: 00408021 addu r16,r2,r0		;r16 = r2
000afa98: 02e02021 addu r4,r23,r0		;r4 = r23
000afa9c: 02002821 addu r5,r16,r0		;r5 = r16
000afaa0: 02a03021 addu r6,r21,r0		;r6 = r21
000afaa4: 26470015 addiu r7,r18,0x0015		;r7 = r18 + 0x15
000afaa8: 26900028 addiu r16,r20,0x0028		;r16 = r20+0x28
000afaac: afb00010 sw r16,0x0010(r29)		;store r16 in (r29+0x10)
000afab0: 92c20004 lbu r2,0x0004(r22)		;r2 = (r22+0x4)
000afab4: 33d100ff andi r17,r30,0x00ff		;r17 = r30 & 0xFF
000afab8: afb10018 sw r17,0x0018(r29)		;store r17 in (r29+0x18)
000afabc: 00021102 srl r2,r2,0x04		;r2 = r2 >> 4
000afac0: 0c02bed8 jal 0x000afb60		;jump to 0x000afb60
000afac4: afa20014 sw r2,0x0014(r29)		;store r2 in (r29+0x14)

0x000afac8

000afac8: 02e02021 addu r4,r23,r0		;r4 = r23
000afacc: 00402821 addu r5,r2,r0		;r5 = r2
000afad0: 02a03021 addu r6,r21,r0		;r6 = r21
000afad4: afb00010 sw r16,0x0010(r29)		;store r16 in (r29+0x10)
000afad8: 92c20005 lbu r2,0x0005(r22)		;r2 = (r22+0x5)
000afadc: 2647001b addiu r7,r18,0x001b		;r7 = r18 + 0x1B
000afae0: afb10018 sw r17,0x0018(r29)		;store r17 in (r29+0x18)
000afae4: 00021102 srl r2,r2,0x04		;r2 = r2 >> 4
000afae8: 0c02bed8 jal 0x000afb60		;jump to 0x000afb60
000afaec: afa20014 sw r2,0x0014(r29)		;store r2 in (r29+0x14)

0x000afb60

000afb60: 27bdffe8 addiu r29,r29,0xffe8		;r29 -= 24
000afb64: afb00010 sw r16,0x0010(r29)		;store r16 in (r29+0x10)
000afb68: 00a08021 addu r16,r5,r0		;r16 = r5
000afb6c: 8fa60028 lw r6,0x0028(r29)		;r6 = (r29+0x28)
000afb70: 8fa3002c lw r3,0x002c(r29)		;r3 = card Type or single Attack stat
000afb74: 8fa50030 lw r5,0x0030(r29)		;r5 = (r29+0x30)
000afb78: 24020004 addiu r2,r0,0x0004		;r2 = 4
000afb7c: afbf0014 sw r31,0x0014(r29)		;store r31 in (r29+0x14)
000afb80: a2020003 sb r2,0x0003(r16)		;store r2 to (r16+0x3)
000afb84: 24020064 addiu r2,r0,0x0064		;r2 = 100
000afb88: a2020007 sb r2,0x0007(r16)		;store r2 to (r16+0x7)
000afb8c: 240200c0 addiu r2,r0,0x00c0		;r2 = 192
000afb90: a202000d sb r2,0x000d(r16)		;store r2 to (r16+0xD)
000afb94: 24023ac0 addiu r2,r0,0x3ac0		;r2 = 0x3ac0
000afb98: a602000e sh r2,0x000e(r16)		;store r2 to (r16+0xE)
000afb9c: 24020008 addiu r2,r0,0x0008		;r2 = 8
000afba0: a6070008 sh r7,0x0008(r16)		;store r7 to (r16+0x8)
000afba4: a6020010 sh r2,0x0010(r16)		;store r2 to (r16+0x10)
000afba8: a6020012 sh r2,0x0012(r16)		;store r2 to (r16+0x12)
000afbac: 000318c0 sll r3,r3,0x03		;r3 = card Type << 3
000afbb0: 24630050 addiu r3,r3,0x0050		;r3 += 80
000afbb4: a2050004 sb r5,0x0004(r16)		;store r5 to (r16+0x4)
000afbb8: a2050005 sb r5,0x0005(r16)		;store r5 to (r16+0x5)
000afbbc: a2050006 sb r5,0x0006(r16)		;store r5 to (r16+0x6)
000afbc0: 02002821 addu r5,r16,r0		;r5 = r16
000afbc4: a606000a sh r6,0x000a(r16)		;store r6 to (r16+0xA)
000afbc8: 0c018e9d jal 0x00063a74		;jump to 0x00063a74
000afbcc: a203000c sb r3,0x000c(r16)		;store r3 to (r16+0xC)

0x000afbd0

000afbd0: 26020014 addiu r2,r16,0x0014		;r2 = r16 + 0x14
000afbd4: 8fbf0014 lw r31,0x0014(r29)		;r31 = (r29+0x14)
000afbd8: 8fb00010 lw r16,0x0010(r29)		;r16 = (r29+0x10)
000afbdc: 03e00008 jr r31
000afbe0: 27bd0018 addiu r29,r29,0x0018		;r29 += 0x18

0x000afbe4

000afbe4: 27bdffe0 addiu r29,r29,0xffe0		;r29 -= 0x20
000afbe8: afb00010 sw r16,0x0010(r29)		;store r16 in (r29+0x10)
000afbec: 00808021 addu r16,r4,r0		;r16 = r4
000afbf0: 00002821 addu r5,r0,r0		;r5 = 0
000afbf4: afbf001c sw r31,0x001c(r29)		;store r31 in (r29+0x1C)
000afbf8: afb20018 sw r18,0x0018(r29)		;store r18 in (r29+0x18)
000afbfc: 0c02ba0c jal 0x000ae830		;jump to 0x000ae830
000afc00: afb10014 sw r17,0x0014(r29)		;store r17 in (r29+0x14)

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

PlayStation BIOS

RAM initialization

07c00150: 3c091f80 lui r9,0x1f80
07c00154: 35291000 ori r9,r9,0x1000
07c00158: 3c080003 lui r8,0x0003
07c0015c: 35081125 ori r8,r8,0x1125
07c00160: ad280020 sw r8,0x0020(r9)
07c00164: 3c081f00 lui r8,0x1f00
07c00168: ad280000 sw r8,0x0000(r9)
07c0016c: 3c081f80 lui r8,0x1f80
07c00170: 35082000 ori r8,r8,0x2000
07c00174: ad280004 sw r8,0x0004(r9)
07c00178: 3c080013 lui r8,0x0013
07c0017c: 3508243f ori r8,r8,0x243f
07c00180: ad280008 sw r8,0x0008(r9)
07c00184: 3c082009 lui r8,0x2009
07c00188: 350831e1 ori r8,r8,0x31e1
07c0018c: ad280014 sw r8,0x0014(r9)
07c00190: 3c080002 lui r8,0x0002
07c00194: 35080843 ori r8,r8,0x0843
07c00198: ad280018 sw r8,0x0018(r9)
07c0019c: 24083022 addiu r8,r0,0x3022
07c001a0: ad28000c sw r8,0x000c(r9)
07c001a4: 3c080007 lui r8,0x0007
07c001a8: 35080777 ori r8,r8,0x0777
07c001ac: ad28001c sw r8,0x001c(r9)
07c001b0: 00000825 or r1,r0,r0			;r1 = 0
07c001b4: 00001025 or r2,r0,r0			;r2 = 0
07c001b8: 00001825 or r3,r0,r0			;r3 = 0
07c001bc: 00002025 or r4,r0,r0			;r4 = 0
07c001c0: 00002825 or r5,r0,r0			;r5 = 0
07c001c4: 00003025 or r6,r0,r0			;r6 = 0
07c001c8: 00003825 or r7,r0,r0			;r7 = 0
07c001cc: 00004025 or r8,r0,r0			;r8 = 0
07c001d0: 00004825 or r9,r0,r0			;r9 = 0
07c001d4: 00005025 or r10,r0,r0			;r10 = 0
07c001d8: 00005825 or r11,r0,r0			;r11 = 0
07c001dc: 00006025 or r12,r0,r0			;r12 = 0
07c001e0: 00006825 or r13,r0,r0			;r13 = 0
07c001e4: 00007025 or r14,r0,r0			;r14 = 0
07c001e8: 00007825 or r15,r0,r0			;r15 = 0
07c001ec: 00008025 or r16,r0,r0			;r16 = 0
07c001f0: 00008825 or r17,r0,r0			;r17 = 0
07c001f4: 00009025 or r18,r0,r0			;r18 = 0
07c001f8: 00009825 or r19,r0,r0			;r19 = 0
07c001fc: 0000a025 or r20,r0,r0			;r20 = 0
07c00200: 0000a825 or r21,r0,r0			;r21 = 0
07c00204: 0000b025 or r22,r0,r0			;r22 = 0
07c00208: 0000b825 or r23,r0,r0			;r23 = 0
07c0020c: 0000c025 or r24,r0,r0			;r24 = 0
07c00210: 0000c825 or r25,r0,r0			;r25 = 0
07c00214: 0000d025 or r26,r0,r0			;r26 = 0
07c00218: 0000d825 or r27,r0,r0			;r27 = 0
07c0021c: 0000e025 or r28,r0,r0			;r28 = 0
07c00220: 0000e825 or r29,r0,r0			;r29 = 0
07c00224: 0000f025 or r30,r0,r0			;r30 = 0
07c00228: 0000f825 or r31,r0,r0			;r31 = 0
07c0022c: 24090804 addiu r9,r0,0x0804
07c00230: 3c01fffe lui r1,0xfffe
07c00234: ac290130 sw r9,0x0130(r1)
07c00238: 3c0c0001 lui r12,0x0001
07c0023c: 408c6000 mtc0 r12,cop0cr12_sr
07c00240: 00000000 nop
07c00244: 00000000 nop
07c00248: 240a0000 addiu r10,r0,0x0000		;r10 = 0
07c0024c: 240b0f80 addiu r11,r0,0x0f80		;r11 = 0x0f80
07c00250: ad400000 sw r0,0x0000(r10)		;store 0x00000000 from (r10) to (r10+0x0ff0)
07c00254: ad400010 sw r0,0x0010(r10)
07c00258: ad400020 sw r0,0x0020(r10)
07c0025c: ad400030 sw r0,0x0030(r10)
07c00260: ad400040 sw r0,0x0040(r10)
07c00264: ad400050 sw r0,0x0050(r10)
07c00268: ad400060 sw r0,0x0060(r10)
07c0026c: ad400070 sw r0,0x0070(r10)
07c00270: 154bfff7 bne r10,r11,0x07c00250	;loop to 0x07c00250 while r10 ≠ r11
07c00274: 214a0080 addi r10,r10,0x0080		;r10 += 0x0080
07c00278: 40806000 mtc0 r0,cop0cr12_sr
07c0027c: 00000000 nop
07c00280: 24090800 addiu r9,r0,0x0800
07c00284: 3c01fffe lui r1,0xfffe
07c00288: ac290130 sw r9,0x0130(r1)
07c0028c: 408c6000 mtc0 r12,cop0cr12_sr
07c00290: 00000000 nop
07c00294: 00000000 nop
07c00298: 240a0000 addiu r10,r0,0x0000
07c0029c: 240b0f80 addiu r11,r0,0x0f80
07c002a0: ad400000 sw r0,0x0000(r10)		;00s (r10) to (r10+0x0ff0)
07c002a4: ad400004 sw r0,0x0004(r10)
07c002a8: ad400008 sw r0,0x0008(r10)
07c002ac: ad40000c sw r0,0x000c(r10)
07c002b0: ad400010 sw r0,0x0010(r10)
07c002b4: ad400014 sw r0,0x0014(r10)
07c002b8: ad400018 sw r0,0x0018(r10)
07c002bc: ad40001c sw r0,0x001c(r10)
07c002c0: ad400020 sw r0,0x0020(r10)
07c002c4: ad400024 sw r0,0x0024(r10)
07c002c8: ad400028 sw r0,0x0028(r10)
07c002cc: ad40002c sw r0,0x002c(r10)
07c002d0: ad400030 sw r0,0x0030(r10)
07c002d4: ad400034 sw r0,0x0034(r10)
07c002d8: ad400038 sw r0,0x0038(r10)
07c002dc: ad40003c sw r0,0x003c(r10)
07c002e0: ad400040 sw r0,0x0040(r10)
07c002e4: ad400044 sw r0,0x0044(r10)
07c002e8: ad400048 sw r0,0x0048(r10)
07c002ec: ad40004c sw r0,0x004c(r10)
07c002f0: ad400050 sw r0,0x0050(r10)
07c002f4: ad400054 sw r0,0x0054(r10)
07c002f8: ad400058 sw r0,0x0058(r10)
07c002fc: ad40005c sw r0,0x005c(r10)
07c00300: ad400060 sw r0,0x0060(r10)
07c00304: ad400064 sw r0,0x0064(r10)
07c00308: ad400068 sw r0,0x0068(r10)
07c0030c: ad40006c sw r0,0x006c(r10)
07c00310: ad400070 sw r0,0x0070(r10)
07c00314: ad400074 sw r0,0x0074(r10)
07c00318: ad400078 sw r0,0x0078(r10)
07c0031c: ad40007c sw r0,0x007c(r10)
07c00320: 154bffdf bne r10,r11,0x07c002a0	;loop to 0x07c002a0
07c00324: 214a0080 addi r10,r10,0x0080		;r10 += 0x80
07c00328: 40806000 mtc0 r0,cop0cr12_sr
07c0032c: 00000000 nop
07c00330: 3c08a000 lui r8,0xa000
07c00334: 8d090000 lw r9,0x0000(r8)
07c00338: 8d090000 lw r9,0x0000(r8)
07c0033c: 8d090000 lw r9,0x0000(r8)
07c00340: 8d090000 lw r9,0x0000(r8)
07c00344: 8d090000 lw r9,0x0000(r8)
07c00348: 8d090000 lw r9,0x0000(r8)
07c0034c: 8d090000 lw r9,0x0000(r8)
07c00350: 8d090000 lw r9,0x0000(r8)
07c00354: 00000000 nop
07c00358: 3c090001 lui r9,0x0001
07c0035c: 3529e988 ori r9,r9,0xe988
07c00360: 3c01fffe lui r1,0xfffe
07c00364: ac290130 sw r9,0x0130(r1)
07c00368: 40803800 mtc0 r0,cop0cr07_dcic
07c0036c: 00000000 nop
07c00370: 40801800 mtc0 r0,cop0cr03_bpc
07c00374: 00000000 nop
07c00378: 40802800 mtc0 r0,cop0cr05_bda
07c0037c: 00000000 nop
07c00380: 40803000 mtc0 r0,cop0cr06_pidmask
07c00384: 00000000 nop
07c00388: 40804800 mtc0 r0,cop0cr09_bdam
07c0038c: 00000000 nop
07c00390: 40805800 mtc0 r0,cop0cr11_bpcm
07c00394: 00000000 nop
07c00398: 40806000 mtc0 r0,cop0cr12_sr
07c0039c: 00000000 nop
07c003a0: 40806800 mtc0 r0,cop0cr13_cause
07c003a4: 00000000 nop
07c003a8: 3c02a001 lui r2,0xa001
07c003ac: 24429000 addiu r2,r2,0x9000
07c003b0: 3c03a001 lui r3,0xa001
07c003b4: 2463c160 addiu r3,r3,0xc160
07c003b8: ac400000 sw r0,0x0000(r2)
07c003bc: 20420004 addi r2,r2,0x0004
07c003c0: 0043082b sltu r1,r2,r3
07c003c4: 1420fffc bne r1,r0,0x07c003b8
07c003c8: 00000000 nop
07c003cc: 3c1d801f lui r29,0x801f
07c003d0: 37bdff00 ori r29,r29,0xff00
07c003d4: 3c1ca001 lui r28,0xa001
07c003d8: 279c0ff0 addiu r28,r28,0x0ff0
07c003dc: 03a0f021 addu r30,r29,r0
07c003e0: 24080b88 addiu r8,r0,0x0b88
07c003e4: 3c011f80 lui r1,0x1f80
07c003e8: ac281060 sw r8,0x1060(r1)
07c003ec: 24080002 addiu r8,r0,0x0002
07c003f0: ac080060 sw r8,0x0060(r0)
07c003f4: 24020000 addiu r2,r0,0x0000
07c003f8: ac020064 sw r2,0x0064(r0)
07c003fc: 240800ff addiu r8,r0,0x00ff
07c00400: 3c091f80 lui r9,0x1f80
07c00404: ac080068 sw r8,0x0068(r0)
07c00408: 35291c00 ori r9,r9,0x1c00
07c0040c: a5200180 sh r0,0x0180(r9)
07c00410: a5200182 sh r0,0x0182(r9)
07c00414: a5200184 sh r0,0x0184(r9)
07c00418: 0bf01bb1 j 0x07c06ec4
07c0041c: a5200186 sh r0,0x0186(r9)

Copy 0x07c10000-0x07c18bf0 to RAM 0x0500-0x90f0

07c00420: 3c04bfc1 lui r4,0xbfc1
07c00424: 3c05a000 lui r5,0xa000
07c00428: 24840000 addiu r4,r4,0x0000		;r4 = 0xbfc10000, that is address 0x07c10000
07c0042c: 34068bf0 ori r6,r0,0x8bf0		;r6 = 0x8bf0
07c00430: 24a50500 addiu r5,r5,0x0500		;r5 = 0xa0000500
07c00434: 8c870000 lw r7,0x0000(r4)		;r7 = (r4)
07c00438: 20c6fffc addi r6,r6,-0x0004		;r6 -= 4
07c0043c: 20840004 addi r4,r4,0x0004		;r4 +=4
07c00440: 20a50004 addi r5,r5,0x0004		;r5 +=4
07c00444: 14c0fffb bne r6,r0,0x07c00434		;loop until r6 = 0
07c00448: aca7fffc sw r7,-0x0004(r5)		;store r7 in (r5-0x4)
07c0044c: 3c04a000 lui r4,0xa000
07c00450: 24840500 addiu r4,r4,0x0500		;r4 = 0xa0000500
07c00454: 00800008 jr r4			;jump to r4
07c00458: 00000000 nop

PlayStation BIOS PRNG

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

0x07c06ec4

07c06ec4: 27bdffe8 addiu r29,r29,0xffe8
07c06ec8: afbf0014 sw r31,0x0014(r29)
07c06ecc: 0ff00698 jal 0x07c01a60
07c06ed0: 2404000f addiu r4,r0,0x000f
07c06ed4: 3c021f80 lui r2,0x1f80
07c06ed8: 34421c00 ori r2,r2,0x1c00
07c06edc: a4400186 sh r0,0x0186(r2)
07c06ee0: a4400184 sh r0,0x0184(r2)
07c06ee4: a4400182 sh r0,0x0182(r2)
07c06ee8: 0ff01c0f jal 0x07c0703c
07c06eec: a4400180 sh r0,0x0180(r2)