Yu-Gi-Oh! Reshef of Destruction:ROM map

From Data Crystal
Jump to: navigation, search

Trunk

Initialize Trunk cards

08008CAC B530     push    r4,r5,r14                               ;22 
08008CAE 2200     mov     r2,0h                                   ;2  
08008CB0 25C8     mov     r5,0C8h                                 ;2  
08008CB2 00AD     lsl     r5,r5,2h                                ;2  r5 = 800
08008CB4 4C05     ldr     r4,=2021790h                            ;9  Trunk cards EWRAM address
08008CB6 4B06     ldr     r3,=80904C2h                            ;9  Starting Trunk cards
08008CB8 1910     add     r0,r2,r4                                ;2  
08008CBA 18D1     add     r1,r2,r3                                ;2  
08008CBC 7809     ldrb    r1,[r1]                                 ;4  r1 = card quantity
08008CBE 7001     strb    r1,[r0]                                 ;7  Store card quantity in EWRAM (0x2021790 + offset)
08008CC0 3201     add     r2,1h                                   ;2  
08008CC2 42AA     cmp     r2,r5                                   ;2  
08008CC4 D9F8     bls     8008CB8h                                ;8  Loop 800 times to 0x8008CB8
08008CC6 BC30     pop     r4,r5                                   ;13 
08008CC8 BC01     pop     r0                                      ;9  
08008CCA 4700     bx      r0                                      ;8  
08008CCC 1790     asr     r0,r2,1Eh                               ;2

Add card to the Trunk

02 02 04 C2 08 09
08008CD4 B510     push    r4,r14                                  ;16 
08008CD6 0400     lsl     r0,r0,10h                               ;2  r0 << 0x10
08008CD8 0C00     lsr     r0,r0,10h                               ;2  r0 >> 0x10
08008CDA 0609     lsl     r1,r1,18h                               ;2  r1 << 0x18
08008CDC 0E0B     lsr     r3,r1,18h                               ;2  r3 = r1 >> 0x18
08008CDE 4904     ldr     r1,=2021790h                            ;9  
08008CE0 1842     add     r2,r0,r1                                ;2  r2 = card_ID + 0x2021790
08008CE2 7811     ldrb    r1,[r2]                                 ;4  r1 = old_card_quantity
08008CE4 24FA     mov     r4,0FAh                                 ;2  r4 = 250
08008CE6 1A60     sub     r0,r4,r1                                ;2  r0 = 250 - old_card_quantity
08008CE8 4283     cmp     r3,r0                                   ;2  
08008CEA DD03     ble     8008CF4h                                ;8  if(old_card_quantity + cards_won ≤ 250), branch to 0x8008CF4
08008CEC 7014     strb    r4,[r2]                                 ;5  r4 = old_card_quantity
08008CEE E003     b       8008CF8h                                ;8  branch to 0x8008CF8
08008CF0 1790     asr     r0,r2,1Eh                               ;2  
08008CF2 0202     lsl     r2,r0,8h                                ;2  
08008CF4 1858     add     r0,r3,r1                                ;2  r0 = old_card_quantity + cards_won
08008CF6 7010     strb    r0,[r2]                                 ;5  store new_card_quantity to (0x2021790 + card_ID)
08008CF8 BC10     pop     r4                                      ;4  
08008CFA BC01     pop     r0                                      ;4  
08008CFC 4700     bx      r0                                      ;8  
08008CFE 0000     lsl     r0,r0,0h                                ;2

Subtract from Trunk

08008D88 B510     push    r4,r14                                  ;14
08008D8A 0400     lsl     r0,r0,10h                               ;2
08008D8C 0C00     lsr     r0,r0,10h                               ;2
08008D8E 1C04     mov     r4,r0                                   ;2
08008D90 4805     ldr     r0,=2021790h                            ;9
08008D92 1821     add     r1,r4,r0                                ;2  r1 = card_ID + 0x2021790
08008D94 7808     ldrb    r0,[r1]                                 ;4  r0 = card_quantity
08008D96 1C02     mov     r2,r0                                   ;2  r2 = card_quantity
08008D98 2A00     cmp     r2,0h                                   ;2
08008D9A D00A     beq     8008DB2h                                ;8  if(card_quantity == 0), branch to 0x8008DB2
08008D9C 2A01     cmp     r2,1h                                   ;2
08008D9E D205     bcs     8008DACh                                ;8  if(card_quantity ≥ 1), branch to 0x8008DAC
08008DA0 2000     mov     r0,0h                                   ;2
08008DA2 7008     strb    r0,[r1]                                 ;5  [0x2021790 + card_ID] = 0
08008DA4 E00E     b       8008DC4h                                ;8  exit this function
08008DA6 0000     lsl     r0,r0,0h                                ;2
08008DA8 1790     asr     r0,r2,1Eh                               ;2
08008DAA 0202     lsl     r2,r0,8h                                ;2
08008DAC 3801     sub     r0,1h                                   ;2  card_quantity --
08008DAE 7008     strb    r0,[r1]                                 ;5  [0x2021790 + card_ID] = card_quantity
08008DB0 E008     b       8008DC4h                                ;8  exit this function
08008DB2 1C20     mov     r0,r4                                   ;2
08008DB4 F014FEE8 bl      801DB88h                                ;10
08008DB8 0600     lsl     r0,r0,18h                               ;2
08008DBA 2800     cmp     r0,0h                                   ;2
08008DBC D002     beq     8008DC4h                                ;8
08008DBE 1C20     mov     r0,r4                                   ;2
08008DC0 F014FDFA bl      801D9B8h                                ;10
08008DC4 BC10     pop     r4                                      ;9
08008DC6 BC01     pop     r0                                      ;9
08008DC8 4700     bx      r0                                      ;8
08008DCA 0000     lsl     r0,r0,0h                                ;2

0x8DCC - Trunk

08008DCC B500     push    r14                                     ;10
08008DCE 0400     lsl     r0,r0,10h                               ;2
08008DD0 0C00     lsr     r0,r0,10h                               ;2
08008DD2 4904     ldr     r1,=2021790h                            ;9
08008DD4 1841     add     r1,r0,r1                                ;2
08008DD6 2200     mov     r2,0h                                   ;2
08008DD8 700A     strb    r2,[r1]                                 ;5
08008DDA F014FDC1 bl      801D960h                                ;10
08008DDE BC01     pop     r0                                      ;9
08008DE0 4700     bx      r0                                      ;8
08008DE2 0000     lsl     r0,r0,0h                                ;2

Debug - set all cards in Trunk to 50

08008DE8 B510     push    r4,r14                                  ;16 
08008DEA 4907     ldr     r1,=2021790h                            ;9  r1 = trunk address
08008DEC 2000     mov     r0,0h                                   ;2  
08008DEE 7008     strb    r0,[r1]                                 ;5  Set card quantity to 0
08008DF0 2201     mov     r2,1h                                   ;2  r2 = 1
08008DF2 24C8     mov     r4,0C8h                                 ;2  
08008DF4 00A4     lsl     r4,r4,2h                                ;2  r4 = 800
08008DF6 2332     mov     r3,32h                                  ;2  
08008DF8 1850     add     r0,r2,r1                                ;2  r0 = 0x2021790 + offset
08008DFA 7003     strb    r3,[r0]                                 ;7  Set card quantity to 50
08008DFC 3201     add     r2,1h                                   ;2  
08008DFE 42A2     cmp     r2,r4                                   ;2  
08008E00 D9FA     bls     8008DF8h                                ;8  Loop 800 times
08008E02 BC10     pop     r4                                      ;9  
08008E04 BC01     pop     r0                                      ;9  
08008E06 4700     bx      r0                                      ;8  
08008E08 1790     asr     r0,r2,1Eh                               ;2

Read from Trunk ?

08008E0A 0202     lsl     r2,r0,8h                                ;2  
08008E0C B530     push    r4,r5,r14                               ;22 
08008E0E 2500     mov     r5,0h                                   ;2  
08008E10 2002     mov     r0,2h                                   ;2  
08008E12 F000F903 bl      800901Ch                                ;10 
08008E16 0400     lsl     r0,r0,10h                               ;2  
08008E18 0C04     lsr     r4,r0,10h                               ;2  
08008E1A 4818     ldr     r0,=2021790h                            ;9  r0 = trunk address
08008E1C 1820     add     r0,r4,r0                                ;2  r0 = 0x2021790 + offset
08008E1E 7800     ldrb    r0,[r0]                                 ;6  r0 = card_quantity
08008E20 2800     cmp     r0,0h                                   ;2  
08008E22 D015     beq     8008E50h                                ;8  if(card_quantity == 0), branch to 0x8008E50
08008E24 F014FE92 bl      801DB4Ch                                ;10 Read Player's Deck size
08008E28 0600     lsl     r0,r0,18h                               ;2  
08008E2A 0E00     lsr     r0,r0,18h                               ;2  deck_size & 0x2000
08008E2C 2827     cmp     r0,27h                                  ;2  
08008E2E D80F     bhi     8008E50h                                ;8  if(deck_size > 39), branch to 0x8008E50
08008E30 1C20     mov     r0,r4                                   ;2  
08008E32 F016F931 bl      801F098h                                ;10 branch to 0x801F098 and link
08008E36 0600     lsl     r0,r0,18h                               ;2  
08008E38 0E00     lsr     r0,r0,18h                               ;2  
08008E3A 2801     cmp     r0,1h                                   ;2  
08008E3C D108     bne     8008E50h                                ;8  
08008E3E 1C20     mov     r0,r4                                   ;2  
08008E40 F002FAD0 bl      800B3E4h                                ;10 
08008E44 F014FC74 bl      801D730h                                ;10 
08008E48 490D     ldr     r1,=2021AD0h                            ;9  
08008E4A 68C9     ldr     r1,[r1,0Ch]                             ;4  
08008E4C 4288     cmp     r0,r1                                   ;2  
08008E4E D200     bcs     8008E52h                                ;8  
08008E50 2501     mov     r5,1h                                   ;2  
08008E52 2D01     cmp     r5,1h                                   ;2  
08008E54 D118     bne     8008E88h                                ;8  
08008E56 2039     mov     r0,39h                                  ;2  
08008E58 F02CF882 bl      8034F60h                                ;10 
08008E5C 4A09     ldr     r2,=2020DF8h                            ;9  
08008E5E 8811     ldrh    r1,[r2]                                 ;4  
08008E60 2010     mov     r0,10h                                  ;2  
08008E62 4008     and     r0,r1                                   ;2  
08008E64 2800     cmp     r0,0h                                   ;2  
08008E66 D01A     beq     8008E9Eh                                ;8  
08008E68 1C14     mov     r4,r2                                   ;2  
08008E6A 2510     mov     r5,10h                                  ;2  
08008E6C F7FFF9D8 bl      8008220h                                ;10 
08008E70 8821     ldrh    r1,[r4]                                 ;6  
08008E72 1C28     mov     r0,r5                                   ;2  
08008E74 4008     and     r0,r1                                   ;2  
08008E76 2800     cmp     r0,0h                                   ;2  
08008E78 D1F8     bne     8008E6Ch                                ;8  
08008E7A E010     b       8008E9Eh                                ;8  
08008E7C 1790     asr     r0,r2,1Eh                               ;2

Load card data

0800B3E4 B570     push    r4-r6,r14                               ;22 
0800B3E6 1C04     mov     r4,r0                                   ;2  
0800B3E8 0424     lsl     r4,r4,10h                               ;2  
0800B3EA 0C24     lsr     r4,r4,10h                               ;2  
0800B3EC 4D21     ldr     r5,=2021AD0h                            ;9  r5 = 0x2021AD0
0800B3EE 822C     strh    r4,[r5,10h]                             ;5  [0x2021AE0] = r4
0800B3F0 4821     ldr     r0,=809238Ah                            ;9  r0 = 0x809238A
0800B3F2 0061     lsl     r1,r4,1h                                ;2  
0800B3F4 1808     add     r0,r1,r0                                ;2  
0800B3F6 8800     ldrh    r0,[r0]                                 ;6  
0800B3F8 8268     strh    r0,[r5,12h]                             ;5  
0800B3FA 4820     ldr     r0,=8091D48h                            ;9  r0 = 0x8091D48
0800B3FC 1809     add     r1,r1,r0                                ;2  
0800B3FE 8808     ldrh    r0,[r1]                                 ;4  
0800B400 82A8     strh    r0,[r5,14h]                             ;5  
0800B402 481F     ldr     r0,=80929CCh                            ;9  r0 = 0x80929CC
0800B404 00A6     lsl     r6,r4,2h                                ;2  
0800B406 1830     add     r0,r6,r0                                ;2  
0800B408 6800     ldr     r0,[r0]                                 ;9  
0800B40A 60E8     str     r0,[r5,0Ch]                             ;5  
0800B40C 481D     ldr     r0,=8093650h                            ;9  r0 = 0x8093650
0800B40E 1820     add     r0,r4,r0                                ;2  
0800B410 7800     ldrb    r0,[r0]                                 ;6  
0800B412 75E8     strb    r0,[r5,17h]                             ;5  
0800B414 481C     ldr     r0,=8093971h                            ;9  r0 = 0x8093971
0800B416 1820     add     r0,r4,r0                                ;2  
0800B418 7800     ldrb    r0,[r0]                                 ;6  
0800B41A 7628     strb    r0,[r5,18h]                             ;5  
0800B41C 481B     ldr     r0,=8093C92h                            ;9  r0 = 0x8093C92
0800B41E 1820     add     r0,r4,r0                                ;2  
0800B420 7800     ldrb    r0,[r0]                                 ;6  
0800B422 75A8     strb    r0,[r5,16h]                             ;5  
0800B424 481A     ldr     r0,=8093FB3h                            ;9  r0 = 0x8093FB3
0800B426 1820     add     r0,r4,r0                                ;2  
0800B428 7800     ldrb    r0,[r0]                                 ;6  
0800B42A 7668     strb    r0,[r5,19h]                             ;5  
0800B42C 4819     ldr     r0,=80945F5h                            ;9  r0 = 0x80945F5
0800B42E 1820     add     r0,r4,r0                                ;2  
0800B430 7800     ldrb    r0,[r0]                                 ;6  
0800B432 76A8     strb    r0,[r5,1Ah]                             ;5  
0800B434 4818     ldr     r0,=80942D4h                            ;9  r0 = 0x80942D4
0800B436 1820     add     r0,r4,r0                                ;2  
0800B438 7800     ldrb    r0,[r0]                                 ;6  
0800B43A 76E8     strb    r0,[r5,1Bh]                             ;5  
0800B43C 4817     ldr     r0,=8094916h                            ;9  r0 = 0x8094916
0800B43E 1820     add     r0,r4,r0                                ;2  
0800B440 7800     ldrb    r0,[r0]                                 ;6  
0800B442 7728     strb    r0,[r5,1Ch]                             ;5  
0800B444 4916     ldr     r1,=8094C37h                            ;9  r0 = 0x8094C37
0800B446 7EA8     ldrb    r0,[r5,1Ah]                             ;4  
0800B448 1840     add     r0,r0,r1                                ;2  
0800B44A 7800     ldrb    r0,[r0]                                 ;6  
0800B44C 7768     strb    r0,[r5,1Dh]                             ;5  
0800B44E 4815     ldr     r0,=8094CC3h                            ;9  r0 = 0x8094CC3
0800B450 1820     add     r0,r4,r0                                ;2  
0800B452 7800     ldrb    r0,[r0]                                 ;6  
0800B454 77A8     strb    r0,[r5,1Eh]                             ;5  
0800B456 1C20     mov     r0,r4                                   ;2  
0800B458 F000FC5C bl      800BD14h                                ;10 branch to 0x800BD14 and link
0800B45C 6028     str     r0,[r5]                                 ;5  
0800B45E 1C20     mov     r0,r4                                   ;2  
0800B460 F000FC58 bl      800BD14h                                ;10 branch to 0x800BD14 and link
0800B464 6068     str     r0,[r5,4h]                              ;5  
0800B466 4810     ldr     r0,=8F985E0h                            ;9  r0 = 0x8F985E0
0800B468 1836     add     r6,r6,r0                                ;2  
0800B46A 6830     ldr     r0,[r6]                                 ;9  
0800B46C 60A8     str     r0,[r5,8h]                              ;5  
0800B46E BC70     pop     r4-r6                                   ;6  
0800B470 BC01     pop     r0                                      ;4  
0800B472 4700     bx      r0                                      ;8

Cards data pointers

  • 0xB478-0xB4AB - Cards data pointers
8A 23 09 08 - ATK
48 1D 09 08 - DEF
CC 29 09 08 - Costs
50 36 09 08 - Attributes
71 39 09 08 - Levels
92 3C 09 08 - Types
B3 3F 09 08 - Colors
F5 45 09 08 - Effects (Magic Trap)
D4 42 09 08 - Effects (Monster)
16 49 09 08 - Effects (Trap)
37 4C 09 08 - Effects (Ritual)
C3 4C 09 08 - Permanent Effects
E0 85 F9 08 - Card Descriptions

0x1D662

0801D662 0201     lsl     r1,r0,8h                                ;2  
0801D664 0AD8     lsr     r0,r3,0Bh                               ;2  
0801D666 08E0     lsr     r0,r4,3h                                ;2  
0801D668 CB50     ldmia   [r3]!,r4,r6                             ;5  
0801D66A 0201     lsl     r1,r0,8h                                ;2  
0801D66C 0ADB     lsr     r3,r3,0Bh                               ;2  
0801D66E 08E0     lsr     r0,r4,3h                                ;2  
0801D670 C120     stmia   [r1]!,r5                                ;5  
0801D672 0000     lsl     r0,r0,0h                                ;2  
0801D674 0800     lsr     r0,r0,20h                               ;2  
0801D676 4000     and     r0,r0                                   ;2  
0801D678 4903     ldr     r1,=2018430h                            ;9  r1 = 0x2018430
0801D67A 2000     mov     r0,0h                                   ;2  r0 = 0
0801D67C 6008     str     r0,[r1]                                 ;5  
0801D67E 6048     str     r0,[r1,4h]                              ;5  
0801D680 6088     str     r0,[r1,8h]                              ;5  
0801D682 60C8     str     r0,[r1,0Ch]                             ;5  
0801D684 4770     bx      r14                                     ;8  
0801D686 0000     lsl     r0,r0,0h                                ;2  
0801D688 8430     strh    r0,[r6,20h]                             ;7  
0801D68A 0201     lsl     r1,r0,8h                                ;2  
0801D68C B500     push    r14                                     ;10 
0801D68E F027FF27 bl      80454E0h                                ;10 
0801D692 F027FF19 bl      80454C8h                                ;10 
0801D696 2180     mov     r1,80h                                  ;2  
0801D698 04C9     lsl     r1,r1,13h                               ;2  
0801D69A 22BF     mov     r2,0BFh                                 ;2  
0801D69C 0212     lsl     r2,r2,8h                                ;2  
0801D69E 1C10     mov     r0,r2                                   ;2  
0801D6A0 8008     strh    r0,[r1]                                 ;5  
0801D6A2 3152     add     r1,52h                                  ;2  
0801D6A4 2006     mov     r0,6h                                   ;2  
0801D6A6 8008     strh    r0,[r1]                                 ;5  
0801D6A8 3102     add     r1,2h                                   ;2  
0801D6AA 200A     mov     r0,0Ah                                  ;2  
0801D6AC 8008     strh    r0,[r1]                                 ;5  
0801D6AE 4A03     ldr     r2,=4000050h                            ;9  r2 = 0x4000050 (Color Special Effects Selection)
0801D6B0 8810     ldrh    r0,[r2]                                 ;6  r0 = [r2]
0801D6B2 2108     mov     r1,8h                                   ;2  r1 = 8
0801D6B4 4308     orr     r0,r1                                   ;2  r0 | 8
0801D6B6 8010     strh    r0,[r2]                                 ;7  Color Special Effects Selection: OBJ 1st Target Pixel (Top-most OBJ pixel)
0801D6B8 BC01     pop     r0                                      ;9  
0801D6BA 4700     bx      r0                                      ;8  
0801D6BC 0050     lsl     r0,r2,1h                                ;2

Deck Capacity / Duelist Level

Starting Deck Capacity

0801D6BE 0400     lsl     r0,r0,10h                               ;2  
0801D6C0 4902     ldr     r1,=2021C1Ch                            ;9  r1 = 0x2021C1C (Deck Capacity)
0801D6C2 20C8     mov     r0,0C8h                                 ;2  
0801D6C4 00C0     lsl     r0,r0,3h                                ;2  r0 = 1600
0801D6C6 6008     str     r0,[r1]                                 ;5  Store 1600 in [0x2021C1C]
0801D6C8 4770     bx      r14                                     ;8  
0801D6CA 0000     lsl     r0,r0,0h                                ;2  

Deck Capacity increase

0801D6CC 1C1C     mov     r4,r3                                   ;2  
0801D6CE 0202     lsl     r2,r0,8h                                ;2  
0801D6D0 B510     push    r4,r14                                  ;14 
0801D6D2 1C03     mov     r3,r0                                   ;2  r3 = dc_increase
0801D6D4 4A03     ldr     r2,=2021C1Ch                            ;9  r2 = 0x2021C1C (Deck Capacity)
0801D6D6 6811     ldr     r1,[r2]                                 ;9  r1 = deck_capacity
0801D6D8 4C03     ldr     r4,=0FDE8h                              ;9  r4 = 65000
0801D6DA 1A60     sub     r0,r4,r1                                ;2  r0 = 65000 - deck_capacity
0801D6DC 4283     cmp     r3,r0                                   ;2  
0801D6DE D905     bls     801D6ECh                                ;8  if(dc_increase ≤ r0), branch to 0x801D6EC
0801D6E0 6014     str     r4,[r2]                                 ;10 store 65000 in [0x2021C1C]
0801D6E2 E005     b       801D6F0h                                ;8  branch to 0x801D6F0
0801D6E4 1C1C     mov     r4,r3                                   ;2  
0801D6E6 0202     lsl     r2,r0,8h                                ;2  
0801D6E8 FDE8     bl      lr+0BD0h                                ;10 
0801D6EA 0000     lsl     r0,r0,0h                                ;2  
0801D6EC 18C8     add     r0,r1,r3                                ;2  r0 = deck_capacity + dc_increase
0801D6EE 6010     str     r0,[r2]                                 ;10 store new Deck Capacity in [0x2021C1C]
0801D6F0 F000F824 bl      801D73Ch                                ;10 
0801D6F4 BC10     pop     r4                                      ;9  
0801D6F6 BC01     pop     r0                                      ;9  
0801D6F8 4700     bx      r0                                      ;8  

Duelist Level increase

0801D73C B510     push    r4,r14                                  ;14 
0801D73E 4C01     ldr     r4,=2021C20h                            ;9  r1 = 0x2021C20 (Duelist Level)
0801D740 E005     b       801D74Eh                                ;8  branch to 0x801D74E
0801D742 0000     lsl     r0,r0,0h                                ;2  
0801D744 1C20     mov     r0,r4                                   ;2  
0801D746 0202     lsl     r2,r0,8h                                ;2  
0801D748 6820     ldr     r0,[r4]                                 ;4  r0 = [r4]
0801D74A 3001     add     r0,1h                                   ;2  r0++
0801D74C 6020     str     r0,[r4]                                 ;5  store r0 in [r4]
0801D74E F000F807 bl      801D760h                                ;10 
0801D752 0600     lsl     r0,r0,18h                               ;2  
0801D754 2800     cmp     r0,0h                                   ;2  
0801D756 D1F7     bne     801D748h                                ;8  
0801D758 BC10     pop     r4                                      ;9  
0801D75A BC01     pop     r0                                      ;9  
0801D75C 4700     bx      r0                                      ;8  
0801D75E 0000     lsl     r0,r0,0h                                ;2  

Duelist Level calculation

0801D760 480A     ldr     r0,=2021C20h                            ;9  r0 = 0x2021C20 (Duelist Level)
0801D762 6802     ldr     r2,[r0]                                 ;9  r2 = duelist_level
0801D764 480A     ldr     r0,=3E6h                                ;9  r0 = 998
0801D766 4282     cmp     r2,r0                                   ;2  
0801D768 D81A     bhi     801D7A0h                                ;8  if(duelist_level > 998), exit this function
0801D76A 490A     ldr     r1,=80B8974h                            ;9  r1 = 0x80B8974 (Deck Capacity to Duelist Level array)
0801D76C 1C50     add     r0,r2,1                                 ;2  r0 = r2 + 1
0801D76E 0040     lsl     r0,r0,1h                                ;2  r0 << 1
0801D770 1840     add     r0,r0,r1                                ;2  r0 += r1
0801D772 4909     ldr     r1,=2021C1Ch                            ;9  r1 = 0x2021C1C (Deck Capacity)
0801D774 6809     ldr     r1,[r1]                                 ;4  r1 = deck_capacity
0801D776 8800     ldrh    r0,[r0]                                 ;7  r0 = dc_value
0801D778 4281     cmp     r1,r0                                   ;2  
0801D77A D311     bcc     801D7A0h                                ;8  
0801D77C 4807     ldr     r0,=2021D10h                            ;9  r0 = 0x2021D10
0801D77E 302C     add     r0,2Ch                                  ;2  r0 + 0x2C
0801D780 7801     ldrb    r1,[r0]                                 ;7  r1 = [r0]
0801D782 2201     mov     r2,1h                                   ;2  r2 = 1
0801D784 4311     orr     r1,r2                                   ;2  r1 |= r2
0801D786 7001     strb    r1,[r0]                                 ;8  store r1 in [r0]
0801D788 2001     mov     r0,1h                                   ;2  r0 = 1
0801D78A E00A     b       801D7A2h                                ;8  Exit this function
0801D78C 1C20     mov     r0,r4                                   ;2  r0 = r4
0801D78E 0202     lsl     r2,r0,8h                                ;2  
0801D790 03E6     lsl     r6,r4,0Fh                               ;2  
0801D792 0000     lsl     r0,r0,0h                                ;2  
0801D794 8974     ldrh    r4,[r6,0Ah]                             ;6  
0801D796 080B     lsr     r3,r1,20h                               ;2  
0801D798 1C1C     mov     r4,r3                                   ;2  
0801D79A 0202     lsl     r2,r0,8h                                ;2  
0801D79C 1D10     add     r0,r2,4                                 ;2  
0801D79E 0202     lsl     r2,r0,8h                                ;2  
0801D7A0 2000     mov     r0,0h                                   ;2  r0 = 0
0801D7A2 4770     bx      r14                                     ;8  
0801D7A4 B510     push    r4,r14                                  ;14

Read Player's Deck size

0801DB4C 4801     ldr     r0,=2021C30h                            ;9  
0801DB4E 7A00     ldrb    r0,[r0,8h]                              ;7  r0 = deck_size
0801DB50 4770     bx      r14                                     ;8  
0801DB52 0000     lsl     r0,r0,0h                                ;2

0x1DB88 - Deck cards

0801DB88 B510     push    r4,r14                                  ;14 
0801DB8A 0400     lsl     r0,r0,10h                               ;2  
0801DB8C 0C03     lsr     r3,r0,10h                               ;2  
0801DB8E 2200     mov     r2,0h                                   ;2  
0801DB90 2100     mov     r1,0h                                   ;2  
0801DB92 4C09     ldr     r4,=2021C3Ah                            ;9  r4 = deck cards
0801DB94 0048     lsl     r0,r1,1h                                ;2  
0801DB96 1900     add     r0,r0,r4                                ;2  
0801DB98 8800     ldrh    r0,[r0]                                 ;7  
0801DB9A 4298     cmp     r0,r3                                   ;2  
0801DB9C D102     bne     801DBA4h                                ;8  
0801DB9E 1C50     add     r0,r2,1                                 ;2  
0801DBA0 0600     lsl     r0,r0,18h                               ;2  
0801DBA2 0E02     lsr     r2,r0,18h                               ;2  
0801DBA4 1C48     add     r0,r1,1                                 ;2  
0801DBA6 0600     lsl     r0,r0,18h                               ;2  
0801DBA8 0E01     lsr     r1,r0,18h                               ;2  
0801DBAA 2927     cmp     r1,27h                                  ;2  
0801DBAC D9F2     bls     801DB94h                                ;8  
0801DBAE 1C10     mov     r0,r2                                   ;2  
0801DBB0 BC10     pop     r4                                      ;9  
0801DBB2 BC02     pop     r1                                      ;9  
0801DBB4 4708     bx      r1                                      ;8  

0x1F098

0801F098 B570     push    r4-r6,r14                               ;22 
0801F09A 0400     lsl     r0,r0,10h                               ;2  
0801F09C 0C04     lsr     r4,r0,10h                               ;2  
0801F09E 1C20     mov     r0,r4                                   ;2  
0801F0A0 F7FEFD72 bl      801DB88h                                ;10 Branch to 0x801DB88 (related to Deck cards) and link
0801F0A4 0600     lsl     r0,r0,18h                               ;2  
0801F0A6 0E05     lsr     r5,r0,18h                               ;2  
0801F0A8 1C2E     mov     r6,r5                                   ;2  r6 = r5
0801F0AA 4905     ldr     r1,=80B9620h                            ;9  r1 = 0x80B9620
0801F0AC 1C20     mov     r0,r4                                   ;2  
0801F0AE F000F81F bl      801F0F0h                                ;10 Branch to 0x801F0F0 and link
0801F0B2 0600     lsl     r0,r0,18h                               ;2  
0801F0B4 0E00     lsr     r0,r0,18h                               ;2  r0 & 0x2000
0801F0B6 2801     cmp     r0,1h                                   ;2  
0801F0B8 D104     bne     801F0C4h                                ;8  if(r0 ≠ r1), branch to 0x801F0C4
0801F0BA 2D00     cmp     r5,0h                                   ;2  
0801F0BC D114     bne     801F0E8h                                ;8  
0801F0BE E011     b       801F0E4h                                ;8  branch to 0x801F0E4
0801F0C0 9620     str     r6,[sp,80h]                             ;5  

0x1F0E4

0801F0E4 2001     mov     r0,1h                                   ;2  r0 = 1
0801F0E6 E000     b       801F0EAh                                ;8  
0801F0E8 2000     mov     r0,0h                                   ;2  
0801F0EA BC70     pop     r4-r6                                   ;17 
0801F0EC BC02     pop     r1                                      ;9  
0801F0EE 4708     bx      r1                                      ;8  

0x1F0F0

0801F0F0 0400     lsl     r0,r0,10h                               ;2  
0801F0F2 0C03     lsr     r3,r0,10h                               ;2  
0801F0F4 2200     mov     r2,0h                                   ;2  
0801F0F6 8808     ldrh    r0,[r1]                                 ;4  
0801F0F8 2800     cmp     r0,0h                                   ;2  
0801F0FA D00E     beq     801F11Ah                                ;8  
0801F0FC 0050     lsl     r0,r2,1h                                ;2  
0801F0FE 1840     add     r0,r0,r1                                ;2  
0801F100 8800     ldrh    r0,[r0]                                 ;7  
0801F102 4298     cmp     r0,r3                                   ;2  
0801F104 D101     bne     801F10Ah                                ;8  
0801F106 2001     mov     r0,1h                                   ;2  
0801F108 E008     b       801F11Ch                                ;8  
0801F10A 1C50     add     r0,r2,1                                 ;2  

Check winning condition ?

0801FB58 B5F0     push    r4-r7,r14                               ;26 
0801FB5A B083     add     sp,-0Ch                                 ;2  
0801FB5C 4A10     ldr     r2,=2021D10h                            ;9  r2 = 0x2021D10
0801FB5E 4911     ldr     r1,=8E00B30h                            ;9  r1 = 0x8E00B30
0801FB60 8A50     ldrh    r0,[r2,12h]                             ;6  r0 = [r2+0x12]
0801FB62 0080     lsl     r0,r0,2h                                ;2  r0 << 2
0801FB64 1840     add     r0,r0,r1                                ;2  r0 += r1
0801FB66 6800     ldr     r0,[r0]                                 ;9  r0 = [0x8E00B30 + offset]
0801FB68 6980     ldr     r0,[r0,18h]                             ;9  r0 = [r0+0x18]
0801FB6A 6090     str     r0,[r2,8h]                              ;10 store r0 in [r2+0x8]
0801FB6C F7FDFDB0 bl      801D6D0h                                ;10 
0801FB70 F000FA0E bl      801FF90h                                ;10 
0801FB74 F000FA5C bl      8020030h                                ;10 
0801FB78 F000F8CC bl      801FD14h                                ;10 
0801FB7C 480A     ldr     r0,=2024258h                            ;9  r0 = 0x2024258
0801FB7E 8840     ldrh    r0,[r0,2h]                              ;7  r0 = CPU's Life Points
0801FB80 2800     cmp     r0,0h                                   ;2  
0801FB82 D113     bne     801FBACh                                ;8  
0801FB84 2004     mov     r0,4h                                   ;2  
0801FB86 F015FA4B bl      8035020h                                ;10 
0801FB8A 4668     mov     r0,r13                                  ;2  
0801FB8C F001FF42 bl      8021A14h                                ;10 
0801FB90 4669     mov     r1,r13                                  ;2  
0801FB92 2013     mov     r0,13h                                  ;2  
0801FB94 7208     strb    r0,[r1,8h]                              ;5  
0801FB96 4668     mov     r0,r13                                  ;2  
0801FB98 F001FF24 bl      80219E4h                                ;10 
0801FB9C E01B     b       801FBD6h                                ;8  
0801FB9E 0000     lsl     r0,r0,0h                                ;2  
0801FBA0 1D10     add     r0,r2,4                                 ;2  
0801FBA2 0202     lsl     r2,r0,8h                                ;2  
0801FBA4 0B30     lsr     r0,r6,0Ch                               ;2  
0801FBA6 08E0     lsr     r0,r4,3h                                ;2  
0801FBA8 4258     neg     r0,r3                                   ;2  
0801FBAA 0202     lsl     r2,r0,8h                                ;2  
0801FBAC 2001     mov     r0,1h                                   ;2  
0801FBAE F024F95F bl      8043E70h                                ;10 
0801FBB2 1C04     mov     r4,r0                                   ;2  
0801FBB4 2001     mov     r0,1h                                   ;2  
0801FBB6 F024F971 bl      8043E9Ch                                ;10 
0801FBBA 4284     cmp     r4,r0                                   ;2  
0801FBBC DA0B     bge     801FBD6h                                ;8  
0801FBBE 2004     mov     r0,4h                                   ;2  
0801FBC0 F015FA2E bl      8035020h                                ;10 
0801FBC4 4668     mov     r0,r13                                  ;2  
0801FBC6 F001FF25 bl      8021A14h                                ;10 
0801FBCA 4669     mov     r1,r13                                  ;2  
0801FBCC 2015     mov     r0,15h                                  ;2  
0801FBCE 7208     strb    r0,[r1,8h]                              ;5  
0801FBD0 4668     mov     r0,r13                                  ;2  
0801FBD2 F001FF07 bl      80219E4h                                ;10 
0801FBD6 4C26     ldr     r4,=2021D10h                            ;9  
0801FBD8 1C20     mov     r0,r4                                   ;2  
0801FBDA 302C     add     r0,2Ch                                  ;2  
0801FBDC 7801     ldrb    r1,[r0]                                 ;7  
0801FBDE 2502     mov     r5,2h                                   ;2  
0801FBE0 1C28     mov     r0,r5                                   ;2  
0801FBE2 4008     and     r0,r1                                   ;2  
0801FBE4 2800     cmp     r0,0h                                   ;2  
0801FBE6 D038     beq     801FC5Ah                                ;8  
0801FBE8 89E0     ldrh    r0,[r4,0Eh]                             ;4  
0801FBEA F015F9B9 bl      8034F60h                                ;10 
0801FBEE 4668     mov     r0,r13                                  ;2  
0801FBF0 F001FF10 bl      8021A14h                                ;10 
0801FBF4 4668     mov     r0,r13                                  ;2  
0801FBF6 7205     strb    r5,[r0,8h]                              ;8  
0801FBF8 F001FEF4 bl      80219E4h                                ;10 
0801FBFC 4668     mov     r0,r13                                  ;2  
0801FBFE F001FF09 bl      8021A14h                                ;10 
0801FC02 4669     mov     r1,r13                                  ;2  
0801FC04 2006     mov     r0,6h                                   ;2  
0801FC06 7208     strb    r0,[r1,8h]                              ;5  
0801FC08 68A0     ldr     r0,[r4,8h]                              ;4  
0801FC0A 8088     strh    r0,[r1,4h]                              ;5  
0801FC0C 4668     mov     r0,r13                                  ;2  
0801FC0E F001FEE9 bl      80219E4h                                ;10 
0801FC12 F000F941 bl      801FE98h                                ;10 
0801FC16 2500     mov     r5,0h                                   ;2  
0801FC18 8AA0     ldrh    r0,[r4,14h]                             ;4  
0801FC1A 2800     cmp     r0,0h                                   ;2  
0801FC1C D01D     beq     801FC5Ah                                ;8  
0801FC1E 466E     mov     r6,r13                                  ;2  
0801FC20 1C27     mov     r7,r4                                   ;2  
0801FC22 3714     add     r7,14h                                  ;2  
0801FC24 4668     mov     r0,r13                                  ;2  
0801FC26 F001FEF5 bl      8021A14h                                ;10 
0801FC2A 2005     mov     r0,5h                                   ;2  
0801FC2C 7230     strb    r0,[r6,8h]                              ;7  
0801FC2E 006C     lsl     r4,r5,1h                                ;2  
0801FC30 19E4     add     r4,r4,r7                                ;2  
0801FC32 8820     ldrh    r0,[r4]                                 ;4  
0801FC34 8030     strh    r0,[r6]                                 ;7  
0801FC36 4668     mov     r0,r13                                  ;2  
0801FC38 F001FED4 bl      80219E4h                                ;10 
0801FC3C 8820     ldrh    r0,[r4]                                 ;4  
0801FC3E F7EBFBD1 bl      800B3E4h                                ;10 
0801FC42 F7FFFD35 bl      801F6B0h                                ;10 
0801FC46 1C68     add     r0,r5,1                                 ;2  
0801FC48 0600     lsl     r0,r0,18h                               ;2  
0801FC4A 0E05     lsr     r5,r0,18h                               ;2  
0801FC4C 2D09     cmp     r5,9h                                   ;2  
0801FC4E D804     bhi     801FC5Ah                                ;8  
0801FC50 0068     lsl     r0,r5,1h                                ;2  
0801FC52 19C0     add     r0,r0,r7                                ;2  
0801FC54 8800     ldrh    r0,[r0]                                 ;7  
0801FC56 2800     cmp     r0,0h                                   ;2  
0801FC58 D1E4     bne     801FC24h                                ;8  
0801FC5A 4806     ldr     r0,=20241FCh                            ;9  
0801FC5C 7800     ldrb    r0,[r0]                                 ;7  
0801FC5E 2800     cmp     r0,0h                                   ;2  
0801FC60 D101     bne     801FC66h                                ;8  
0801FC62 F029F843 bl      8048CECh                                ;10 
0801FC66 B003     add     sp,0Ch                                  ;2  
0801FC68 BCF0     pop     r4-r7                                   ;21 
0801FC6A BC01     pop     r0                                      ;9  
0801FC6C 4700     bx      r0                                      ;8  
0801FC6E 0000     lsl     r0,r0,0h                                ;2

0x1FC78

0801FC78 B510     push    r4,r14                                  ;14 
0801FC7A B083     add     sp,-0Ch                                 ;2  
0801FC7C 490B     ldr     r1,=2021B04h                            ;9  
0801FC7E 8808     ldrh    r0,[r1]                                 ;4  
0801FC80 2800     cmp     r0,0h                                   ;2  
0801FC82 D002     beq     801FC8Ah                                ;8  
0801FC84 2101     mov     r1,1h                                   ;2  
0801FC86 F7E9F83B bl      8008D00h                                ;10 
0801FC8A 4809     ldr     r0,=2024258h                            ;9  
0801FC8C 8800     ldrh    r0,[r0]                                 ;7  
0801FC8E 2800     cmp     r0,0h                                   ;2  
0801FC90 D110     bne     801FCB4h                                ;8  
0801FC92 2004     mov     r0,4h                                   ;2  
0801FC94 F015F9C4 bl      8035020h                                ;10 
0801FC98 4668     mov     r0,r13                                  ;2  
0801FC9A F001FEBB bl      8021A14h                                ;10 
0801FC9E 4669     mov     r1,r13                                  ;2  
0801FCA0 2014     mov     r0,14h                                  ;2  
0801FCA2 7208     strb    r0,[r1,8h]                              ;5  
0801FCA4 4668     mov     r0,r13                                  ;2  
0801FCA6 F001FE9D bl      80219E4h                                ;10 
0801FCAA E018     b       801FCDEh                                ;8  

Card drop

Card drop subroutine

0801FF6A D4A5     bmi     801FEB8h                                ;8  
0801FF6C 00E8     lsl     r0,r5,3h                                ;2  
0801FF6E 0000     lsl     r0,r0,0h                                ;2  
0801FF70 B500     push    r14                                     ;10 
0801FF72 4804     ldr     r0,=2021D10h                            ;9  r0 = 0x2021D10
0801FF74 302B     add     r0,2Bh                                  ;2  
0801FF76 7800     ldrb    r0,[r0]                                 ;7  
0801FF78 2801     cmp     r0,1h                                   ;2  
0801FF7A D105     bne     801FF88h                                ;8  if(r0 ≠ 1), branch to 0x801FF88
0801FF7C F7FFFDEC bl      801FB58h                                ;10 
0801FF80 E004     b       801FF8Ch                                ;8  
0801FF82 0000     lsl     r0,r0,0h                                ;2  
0801FF84 1D10     add     r0,r2,4                                 ;2  
0801FF86 0202     lsl     r2,r0,8h                                ;2  
0801FF88 F7FFFE76 bl      801FC78h                                ;10 
0801FF8C BC01     pop     r0                                      ;9  
0801FF8E 4700     bx      r0                                      ;8  
0801FF90 B570     push    r4-r6,r14                               ;22 
0801FF92 4811     ldr     r0,=2021B04h                            ;9  
0801FF94 8800     ldrh    r0,[r0]                                 ;7  r0 = [r0]
0801FF96 2800     cmp     r0,0h                                   ;2  
0801FF98 D01B     beq     801FFD2h                                ;8  if(r0 == 0), exit this function
0801FF9A 2400     mov     r4,0h                                   ;2  
0801FF9C 480F     ldr     r0,=2021D10h                            ;9  r0 = 0x2021D10
0801FF9E 1C01     mov     r1,r0                                   ;2  r1 = r0
0801FFA0 312A     add     r1,2Ah                                  ;2  r1 += 0x2A
0801FFA2 780A     ldrb    r2,[r1]                                 ;4  r2 = [r1]
0801FFA4 4294     cmp     r4,r2                                   ;2  
0801FFA6 D214     bcs     801FFD2h                                ;8  if(carry), exit this function
0801FFA8 1C05     mov     r5,r0                                   ;2  r5 = r0
0801FFAA 1C0E     mov     r6,r1                                   ;2  r6 = r1
0801FFAC F000F818 bl      801FFE0h                                ;10 Card drop probability
0801FFB0 0062     lsl     r2,r4,1h                                ;2  
0801FFB2 1C29     mov     r1,r5                                   ;2  
0801FFB4 3114     add     r1,14h                                  ;2  
0801FFB6 1852     add     r2,r2,r1                                ;2  
0801FFB8 8010     strh    r0,[r2]                                 ;7  
0801FFBA 8810     ldrh    r0,[r2]                                 ;6  
0801FFBC 2101     mov     r1,1h                                   ;2  
0801FFBE F7E8FE89 bl      8008CD4h                                ;10 Add card to the Trunk
0801FFC2 1C60     add     r0,r4,1                                 ;2  
0801FFC4 0600     lsl     r0,r0,18h                               ;2  
0801FFC6 0E04     lsr     r4,r0,18h                               ;2  
0801FFC8 2C09     cmp     r4,9h                                   ;2  
0801FFCA D802     bhi     801FFD2h                                ;8  
0801FFCC 7830     ldrb    r0,[r6]                                 ;6  r0 = [r6]
0801FFCE 4284     cmp     r4,r0                                   ;2  
0801FFD0 D3EC     bcc     801FFACh                                ;8  if(!carry), loop to 0x801FFAC
0801FFD2 BC70     pop     r4-r6                                   ;17 
0801FFD4 BC01     pop     r0                                      ;9  
0801FFD6 4700     bx      r0                                      ;8  
0801FFD8 1B04     sub     r4,r0,r4                                ;2

Card drop probability

0801FFDA 0202     lsl     r2,r0,8h                                ;2  
0801FFDC 1D10     add     r0,r2,4                                 ;2  
0801FFDE 0202     lsl     r2,r0,8h                                ;2  
0801FFE0 B510     push    r4,r14                                  ;14 
0801FFE2 4804     ldr     r0,=2021B04h                            ;9  
0801FFE4 8800     ldrh    r0,[r0]                                 ;7  
0801FFE6 F005FABF bl      8025568h                                ;10 
0801FFEA 2801     cmp     r0,1h                                   ;2  
0801FFEC D106     bne     801FFFCh                                ;8  if(r0 ≠ 1), branch to 0x801FFFC
0801FFEE 4802     ldr     r0,=2021D10h                            ;9  r0 = 0x2021D10
0801FFF0 6B84     ldr     r4,[r0,38h]                             ;9  r4 = [r0+0x38]
0801FFF2 E005     b       8020000h                                ;8  branch to 0x8020000
0801FFF4 1B04     sub     r4,r0,r4                                ;2  
0801FFF6 0202     lsl     r2,r0,8h                                ;2  
0801FFF8 1D10     add     r0,r2,4                                 ;2  
0801FFFA 0202     lsl     r2,r0,8h                                ;2  
0801FFFC 4804     ldr     r0,=2021D10h                            ;9  r0 = 0x2021D10
0801FFFE 6C04     ldr     r4,[r0,40h]                             ;9  r4 = [r0+0x40]
08020000 4904     ldr     r1,=7FFh                                ;9  Probability is / 2048
08020002 2000     mov     r0,0h                                   ;2  r0 = 0
08020004 F036F94A bl      805629Ch                                ;10 
08020008 0400     lsl     r0,r0,10h                               ;2  r0 << 0x10
0802000A 0C01     lsr     r1,r0,10h                               ;2  r1 = r0 >> 0x10
0802000C E005     b       802001Ah                                ;8  Branch to Card drop determination
0802000E 0000     lsl     r0,r0,0h                                ;2

Card drop determination

08020018 3404     add     r4,4h                                   ;2  r4 +=4
0802001A 8820     ldrh    r0,[r4]                                 ;4  r0 = [r4]
0802001C 2800     cmp     r0,0h                                   ;2  
0802001E D002     beq     8020026h                                ;8  if(r0 == 0), branch to 0x8020026
08020020 8860     ldrh    r0,[r4,2h]                              ;4  r0 = [r4+0x2]
08020022 4281     cmp     r1,r0                                   ;2  
08020024 D8F8     bhi     8020018h                                ;8  if(r1 > r0), loop to 0x8020018
08020026 8820     ldrh    r0,[r4]                                 ;4  r0 = [r4]
08020028 BC10     pop     r4                                      ;4  
0802002A BC02     pop     r1                                      ;4  
0802002C 4708     bx      r1                                      ;8  
0802002E 0000     lsl     r0,r0,0h                                ;2

0x35254

08035254 2D00     cmp     r5,0h                                   ;2  
08035256 080D     lsr     r5,r1,20h                               ;2  
08035258 CD10     ldmia   [r5]!,r4                                ;4  
0803525A 08E0     lsr     r0,r4,3h                                ;2  
0803525C B530     push    r4,r5,r14                               ;7  
0803525E 2401     mov     r4,1h                                   ;2  
08035260 F000F912 bl      8035488h                                ;10 
08035264 F000FB16 bl      8035894h                                ;10 
08035268 F000FC60 bl      8035B2Ch                                ;10 
0803526C 480E     ldr     r0,=8035AA9h                            ;9  
0803526E F7D2FFB5 bl      80081DCh                                ;10 
08035272 2001     mov     r0,1h                                   ;2  
08035274 F7FFFE74 bl      8034F60h                                ;10 
08035278 F7D2FFD2 bl      8008220h                                ;10 
0803527C 2501     mov     r5,1h                                   ;2  
0803527E F020FFC3 bl      8056208h                                ;10 PRNG subroutine - 1 cycle
08035282 F000F969 bl      8035558h                                ;10 
08035286 0400     lsl     r0,r0,10h                               ;2  
08035288 0C00     lsr     r0,r0,10h                               ;2  
0803528A 1C01     mov     r1,r0                                   ;2  
0803528C 2801     cmp     r0,1h                                   ;2  
0803528E D10D     bne     80352ACh                                ;8  
08035290 2C00     cmp     r4,0h                                   ;2  
08035292 D104     bne     803529Eh                                ;8  
08035294 F000F842 bl      803531Ch                                ;10 
08035298 0600     lsl     r0,r0,18h                               ;2  
0803529A 2800     cmp     r0,0h                                   ;2  
0803529C D129     bne     80352F2h                                ;8  
0803529E 2500     mov     r5,0h                                   ;2  
080352A0 2001     mov     r0,1h                                   ;2  
080352A2 F7FFFEBD bl      8035020h                                ;10 
080352A6 E024     b       80352F2h                                ;8  
080352A8 5AA9     ldrh    r1,[r5,r2]                              ;6

0x35558

08035558 B510     push    r4,r14                                  ;6  
0803555A 2400     mov     r4,0h                                   ;2  
0803555C F7F0FDE6 bl      802612Ch                                ;10 
08035560 2101     mov     r1,1h                                   ;2  
08035562 480B     ldr     r0,=2020DFCh                            ;9  
08035564 8803     ldrh    r3,[r0]                                 ;6  
08035566 480B     ldr     r0,=3FFh                                ;9  
08035568 4018     and     r0,r3                                   ;2  
0803556A 2800     cmp     r0,0h                                   ;2  
0803556C D00C     beq     8035588h                                ;8  
0803556E 2200     mov     r2,0h                                   ;2  
08035570 1C08     mov     r0,r1                                   ;2  
08035572 4018     and     r0,r3                                   ;2  
08035574 2800     cmp     r0,0h                                   ;2  
08035576 D000     beq     803557Ah                                ;8  
08035578 1C0C     mov     r4,r1                                   ;2  
0803557A 0448     lsl     r0,r1,11h                               ;2  
0803557C 0C01     lsr     r1,r0,10h                               ;2  
0803557E 1C50     add     r0,r2,1                                 ;2  
08035580 0600     lsl     r0,r0,18h                               ;2  
08035582 0E02     lsr     r2,r0,18h                               ;2  
08035584 2A09     cmp     r2,9h                                   ;2  
08035586 D9F3     bls     8035570h                                ;8  
08035588 1C20     mov     r0,r4                                   ;2  
0803558A BC10     pop     r4                                      ;9  
0803558C BC02     pop     r1                                      ;9  
0803558E 4708     bx      r1                                      ;8  
08035590 0DFC     lsr     r4,r7,17h                               ;2  

Duel initialization

  • 0x3FD88
0803FD88 0600     lsl     r0,r0,18h                               ;2  
0803FD8A 0E05     lsr     r5,r0,18h                               ;2  
0803FD8C 2D04     cmp     r5,4h                                   ;2  
0803FD8E D9F5     bls     803FD7Ch                                ;8  
0803FD90 1C70     add     r0,r6,1                                 ;2  
0803FD92 0600     lsl     r0,r0,18h                               ;2  
0803FD94 0E06     lsr     r6,r0,18h                               ;2  
0803FD96 2E03     cmp     r6,3h                                   ;2  
0803FD98 D9EC     bls     803FD74h                                ;8  
0803FD9A 2600     mov     r6,0h                                   ;2  
0803FD9C 2001     mov     r0,1h                                   ;2  
0803FD9E 4684     mov     r12,r0                                  ;2  
0803FDA0 2111     mov     r1,11h                                  ;2  
0803FDA2 4249     neg     r1,r1                                   ;2  
0803FDA4 468A     mov     r10,r1                                  ;2  
0803FDA6 4A3A     ldr     r2,=8E0D0BEh                            ;9  
0803FDA8 4691     mov     r9,r2                                   ;2  r9 = 0x8E0D0BE
0803FDAA 3804     sub     r0,4h                                   ;2  r0 -= 4
0803FDAC 4680     mov     r8,r0                                   ;2  r8 = r0
0803FDAE 2500     mov     r5,0h                                   ;2  r5 = 0
0803FDB0 00B0     lsl     r0,r6,2h                                ;2  r0 = r6 << 2
0803FDB2 1987     add     r7,r0,r6                                ;2  r7 = r6 × 5
0803FDB4 197B     add     r3,r7,r5                                ;2  r3 = r7 + r5
0803FDB6 00DB     lsl     r3,r3,3h                                ;2  r3 << 3
0803FDB8 4934     ldr     r1,=2023EC0h                            ;9  r1 = 0x2023EC0
0803FDBA 185B     add     r3,r3,r1                                ;2  r3 += r1
0803FDBC 1978     add     r0,r7,r5                                ;2  r0 = r7 + r5
0803FDBE 0040     lsl     r0,r0,1h                                ;2  r0 << 1
0803FDC0 4A34     ldr     r2,=8E0D08Ch                            ;9  
0803FDC2 1880     add     r0,r0,r2                                ;2  r0 += 0x8E0D08C
0803FDC4 8800     ldrh    r0,[r0]                                 ;6  
0803FDC6 8018     strh    r0,[r3]                                 ;5  Copy [r0] in [r3]
0803FDC8 19EC     add     r4,r5,r7                                ;2  r4 = r5 + r7
0803FDCA 4649     mov     r1,r9                                   ;2  r1 = r9
0803FDCC 1860     add     r0,r4,r1                                ;2  r0 = r4 + r1
0803FDCE 7801     ldrb    r1,[r0]                                 ;6  r1 = [r0]
0803FDD0 4660     mov     r0,r12                                  ;2  
0803FDD2 4008     and     r0,r1                                   ;2  
0803FDD4 0100     lsl     r0,r0,4h                                ;2  
0803FDD6 795A     ldrb    r2,[r3,5h]                              ;4  
0803FDD8 4651     mov     r1,r10                                  ;2  
0803FDDA 4011     and     r1,r2                                   ;2  
0803FDDC 4301     orr     r1,r0                                   ;2  
0803FDDE 7159     strb    r1,[r3,5h]                              ;5  
0803FDE0 4A2D     ldr     r2,=8E0D0D7h                            ;9  
0803FDE2 18A4     add     r4,r4,r2                                ;2  
0803FDE4 7822     ldrb    r2,[r4]                                 ;4  
0803FDE6 4660     mov     r0,r12                                  ;2  
0803FDE8 4010     and     r0,r2                                   ;2  
0803FDEA 0040     lsl     r0,r0,1h                                ;2  
0803FDEC 4642     mov     r2,r8                                   ;2  
0803FDEE 4011     and     r1,r2                                   ;2  
0803FDF0 4301     orr     r1,r0                                   ;2  
0803FDF2 7159     strb    r1,[r3,5h]                              ;5  
0803FDF4 1C68     add     r0,r5,1                                 ;2  
0803FDF6 0600     lsl     r0,r0,18h                               ;2  
0803FDF8 0E05     lsr     r5,r0,18h                               ;2  
0803FDFA 2D04     cmp     r5,4h                                   ;2  
0803FDFC D9DA     bls     803FDB4h                                ;8  
0803FDFE 1C70     add     r0,r6,1                                 ;2  
0803FE00 0600     lsl     r0,r0,18h                               ;2  
0803FE02 0E06     lsr     r6,r0,18h                               ;2  
0803FE04 2E03     cmp     r6,3h                                   ;2  
0803FE06 D9D2     bls     803FDAEh                                ;8  
0803FE08 2600     mov     r6,0h                                   ;2  
0803FE0A 4F24     ldr     r7,=2023F60h                            ;9  
0803FE0C 2500     mov     r5,0h                                   ;2  
0803FE0E 00B0     lsl     r0,r6,2h                                ;2  
0803FE10 1980     add     r0,r0,r6                                ;2  
0803FE12 00C4     lsl     r4,r0,3h                                ;2  
0803FE14 00E8     lsl     r0,r5,3h                                ;2  
0803FE16 19C0     add     r0,r0,r7                                ;2  
0803FE18 1820     add     r0,r4,r0                                ;2  
0803FE1A F000FA4F bl      80402BCh                                ;10 
0803FE1E 1C30     mov     r0,r6                                   ;2  
0803FE20 F003FF60 bl      8043CE4h                                ;10 
0803FE24 1C68     add     r0,r5,1                                 ;2  
0803FE26 0600     lsl     r0,r0,18h                               ;2  
0803FE28 0E05     lsr     r5,r0,18h                               ;2  
0803FE2A 2D04     cmp     r5,4h                                   ;2  
0803FE2C D9F2     bls     803FE14h                                ;8  
0803FE2E 1C70     add     r0,r6,1                                 ;2  
0803FE30 0600     lsl     r0,r0,18h                               ;2  
0803FE32 0E06     lsr     r6,r0,18h                               ;2  
0803FE34 2E01     cmp     r6,1h                                   ;2  
0803FE36 D9E9     bls     803FE0Ch                                ;8  
0803FE38 4A14     ldr     r2,=2023EC0h                            ;9  
0803FE3A 4819     ldr     r0,=2021D10h                            ;9  r0 = 0x2021D10
0803FE3C 3032     add     r0,32h                                  ;2  r0 += 0x32
0803FE3E 7801     ldrb    r1,[r0]                                 ;6  r1 = [r0]
0803FE40 1C10     mov     r0,r2                                   ;2  
0803FE42 30F0     add     r0,0F0h                                 ;2  r0 = 0x2023EC0 + 0xF0
0803FE44 7001     strb    r1,[r0]                                 ;7  Store r1 in 0x2023FB0 (Field ID)
0803FE46 2600     mov     r6,0h                                   ;2  
0803FE48 1C17     mov     r7,r2                                   ;2  
0803FE4A 2004     mov     r0,4h                                   ;2  
0803FE4C 4240     neg     r0,r0                                   ;2  
0803FE4E 1C05     mov     r5,r0                                   ;2  
0803FE50 2105     mov     r1,5h                                   ;2  
0803FE52 4249     neg     r1,r1                                   ;2  
0803FE54 1C0C     mov     r4,r1                                   ;2  
0803FE56 00B1     lsl     r1,r6,2h                                ;2  
0803FE58 19C9     add     r1,r1,r7                                ;2  
0803FE5A 1C0A     mov     r2,r1                                   ;2  
0803FE5C 32F6     add     r2,0F6h                                 ;2  
0803FE5E 7810     ldrb    r0,[r2]                                 ;6  
0803FE60 4028     and     r0,r5                                   ;2  
0803FE62 4020     and     r0,r4                                   ;2  
0803FE64 7010     strb    r0,[r2]                                 ;7  
0803FE66 31F4     add     r1,0F4h                                 ;2  
0803FE68 2000     mov     r0,0h                                   ;2  
0803FE6A 8008     strh    r0,[r1]                                 ;5  
0803FE6C 1C30     mov     r0,r6                                   ;2  
0803FE6E F000FB4B bl      8040508h                                ;10 
0803FE72 1C70     add     r0,r6,1                                 ;2  
0803FE74 0600     lsl     r0,r0,18h                               ;2  
0803FE76 0E06     lsr     r6,r0,18h                               ;2  
0803FE78 2E01     cmp     r6,1h                                   ;2  
0803FE7A D9EC     bls     803FE56h                                ;8  
0803FE7C BC38     pop     r3-r5                                   ;17 
0803FE7E 4698     mov     r8,r3                                   ;2  
0803FE80 46A1     mov     r9,r4                                   ;2  
0803FE82 46AA     mov     r10,r5                                  ;2  
0803FE84 BCF0     pop     r4-r7                                   ;21 
0803FE86 BC01     pop     r0                                      ;9  
0803FE88 4700     bx      r0                                      ;8  
0803FE8A 0000     lsl     r0,r0,0h                                ;2

Battle screen update ?

08041100 3EC0     sub     r6,0C0h                                 ;2
08041102 0202     lsl     r2,r0,8h                                ;2
08041104 B500     push    r14                                     ;5
08041106 F7FFFD21 bl      8040B4Ch                                ;10
0804110A F000FEDD bl      8041EC8h                                ;10
0804110E F7FFFDAD bl      8040C6Ch                                ;10
08041112 F016FB47 bl      80577A4h                                ;10
08041116 F7FFFBF1 bl      80408FCh                                ;10
0804111A F7C7F881 bl      8008220h                                ;10
0804111E F000F859 bl      80411D4h                                ;10
08041122 2180     mov     r1,80h                                  ;2
08041124 04C9     lsl     r1,r1,13h                               ;2
08041126 22D8     mov     r2,0D8h                                 ;2
08041128 0192     lsl     r2,r2,6h                                ;2
0804112A 1C10     mov     r0,r2                                   ;2
0804112C 8008     strh    r0,[r1]                                 ;5
0804112E 3150     add     r1,50h                                  ;2
08041130 20D4     mov     r0,0D4h                                 ;2
08041132 8008     strh    r0,[r1]                                 ;5
08041134 3104     add     r1,4h                                   ;2
08041136 200A     mov     r0,0Ah                                  ;2
08041138 8008     strh    r0,[r1]                                 ;5
0804113A BC01     pop     r0                                      ;4
0804113C 4700     bx      r0                                      ;8


PRNG

PRNG subroutine - 2 cycles

080561B4 B570     push    r4-r6,r14                               ;22 
080561B6 2400     mov     r4,0h                                   ;2  r4 = 0
080561B8 2500     mov     r5,0h                                   ;2  r5 = 0
080561BA 0660     lsl     r0,r4,19h                               ;2  r0 = r4 << 0x19
080561BC 0E04     lsr     r4,r0,18h                               ;2  r4 = r0 >> 0x18
080561BE F000F837 bl      8056230h                                ;10 PRNG advance
080561C2 4304     orr     r4,r0                                   ;2  r4 |= r0
080561C4 0620     lsl     r0,r4,18h                               ;2  r0 = r4 << 0x18
080561C6 0E04     lsr     r4,r0,18h                               ;2  r4 = r0 >> 0x18
080561C8 1C68     add     r0,r5,1                                 ;2  r0 = r5 + 1
080561CA 0600     lsl     r0,r0,18h                               ;2  r0 << 0x18
080561CC 0E05     lsr     r5,r0,18h                               ;2  r5 = r0 >> 0x18
080561CE 2D07     cmp     r5,7h                                   ;2  
080561D0 D9F3     bls     80561BAh                                ;8  if(r5 ≤ 7), loop to 80561BA
080561D2 1C26     mov     r6,r4                                   ;2  r6 = r4
080561D4 2400     mov     r4,0h                                   ;2  r4 = 0
080561D6 2500     mov     r5,0h                                   ;2  r5 = 0
080561D8 0660     lsl     r0,r4,19h                               ;2  r0 = r4 << 0x19
080561DA 0E04     lsr     r4,r0,18h                               ;2  r4 = r0 >> 0x18
080561DC F000F828 bl      8056230h                                ;10 PRNG advance
080561E0 4304     orr     r4,r0                                   ;2  r4 |= r0
080561E2 0620     lsl     r0,r4,18h                               ;2  r0 = r4 << 0x18
080561E4 0E04     lsr     r4,r0,18h                               ;2  r4 = r0 >> 0x18
080561E6 1C68     add     r0,r5,1                                 ;2  r0 = r5 + 1
080561E8 0600     lsl     r0,r0,18h                               ;2  r0 << 0x18
080561EA 0E05     lsr     r5,r0,18h                               ;2  r5 = r0 >> 0x18
080561EC 2D07     cmp     r5,7h                                   ;2  
080561EE D9F3     bls     80561D8h                                ;8  if(r5 ≤ 7), loop to 0x80561D8
080561F0 0630     lsl     r0,r6,18h                               ;2  r0 = r6 << 0x18
080561F2 0C00     lsr     r0,r0,10h                               ;2  r0 >> 0x10
080561F4 4320     orr     r0,r4                                   ;2  r0 |= r4
080561F6 BC70     pop     r4-r6                                   ;17 
080561F8 BC02     pop     r1                                      ;9  
080561FA 4708     bx      r1                                      ;8  

PRNG initialization

  • 0x561FC - Sets the PRNG Seed to 1
080561FC 4901     ldr     r1,=2024594h                            ;9  r1 = 0x2024594
080561FE 2001     mov     r0,1h                                   ;2  r0 = 1
08056200 6008     str     r0,[r1]                                 ;5  seed = 1
08056202 4770     bx      r14                                     ;8  
08056204 4594     cmp     r12,r2                                  ;2
08056206 0202     lsl     r2,r0,8h                                ;2  r2 = r0 << 8

PRNG subroutine - 1 cycle

08056208 B530     push    r4,r5,r14                               ;18 
0805620A 2400     mov     r4,0h                                   ;2  r4 = 0
0805620C 2500     mov     r5,0h                                   ;2  r5 = 0
0805620E 0660     lsl     r0,r4,19h                               ;2  r0 = r4 << 0x19
08056210 0E04     lsr     r4,r0,18h                               ;2  r4 = r0 >> 0x18
08056212 F000F80D bl      8056230h                                ;10 PRNG advance
08056216 4304     orr     r4,r0                                   ;2  r4 |= r0
08056218 0620     lsl     r0,r4,18h                               ;2  r0 = r4 << 0x18
0805621A 0E04     lsr     r4,r0,18h                               ;2  r4 = r0 >> 0x18
0805621C 1C68     add     r0,r5,1                                 ;2  r0 = r5 + 1
0805621E 0600     lsl     r0,r0,18h                               ;2  r0 << 0x18
08056220 0E05     lsr     r5,r0,18h                               ;2  r5 = r0 >> 0x18
08056222 2D07     cmp     r5,7h                                   ;2  
08056224 D9F3     bls     805620Eh                                ;8  if(r5 ≤ 0x7), loop to 0x805620E
08056226 1C20     mov     r0,r4                                   ;2  r0 = r4
08056228 BC30     pop     r4,r5                                   ;13 
0805622A BC02     pop     r1                                      ;9  
0805622C 4708     bx      r1                                      ;8  
0805622E 0000     lsl     r0,r0,0h                                ;2

PRNG advance

08056230 4A03     ldr     r2,=2024594h                            ;9  r2 = 0x2024594
08056232 6811     ldr     r1,[r2]                                 ;9  r1 = seed
08056234 2900     cmp     r1,0h                                   ;2  
08056236 DB05     blt     8056244h                                ;8  if(seed ≥ 0x80000000), branch to 0x8056244
08056238 0048     lsl     r0,r1,1h                                ;2  r0 = seed << 1
0805623A 6010     str     r0,[r2]                                 ;10 store r0 at [0x2024594]
0805623C 2000     mov     r0,0h                                   ;2  r0 = 0
0805623E E009     b       8056254h                                ;8  exit this function
08056240 4594     cmp     r12,r2                                  ;2  
08056242 0202     lsl     r2,r0,8h                                ;2  
08056244 2080     mov     r0,80h                                  ;2  (from 0x8056236)
08056246 0240     lsl     r0,r0,9h                                ;2  r0 = 0x10000
08056248 4041     eor     r1,r0                                   ;2  r1 = seed ⊕ 0x10000
0805624A 0048     lsl     r0,r1,1h                                ;2  r0 = r1 << 1
0805624C 2101     mov     r1,1h                                   ;2  
0805624E 4308     orr     r0,r1                                   ;2  r0 |= 1
08056250 6010     str     r0,[r2]                                 ;10 store r0 at [0x2024594]
08056252 2001     mov     r0,1h                                   ;2  r0 = 1
08056254 4770     bx      r14                                     ;8  
08056256 0000     lsl     r0,r0,0h                                ;2

0x56258

08056258 B5F0     push    r4-r7,r14                               ;26 349062
0805625A 0600     lsl     r0,r0,18h                               ;2  349064
0805625C 0E06     lsr     r6,r0,18h                               ;2  349066
0805625E 0609     lsl     r1,r1,18h                               ;2  349068
08056260 0E09     lsr     r1,r1,18h                               ;2  349070
08056262 428E     cmp     r6,r1                                   ;2  349072
08056264 D101     bne     805626Ah                                ;8  349080
08056266 1C30     mov     r0,r6                                   ;2  349082
08056268 E015     b       8056296h                                ;8  349090
0805626A 2400     mov     r4,0h                                   ;2  349092
0805626C 2500     mov     r5,0h                                   ;2  349094
0805626E 1B8F     sub     r7,r1,r6                                ;2  349096
08056270 0660     lsl     r0,r4,19h                               ;2  349098
08056272 0E04     lsr     r4,r0,18h                               ;2  349100
08056274 F7FFFFDC bl      8056230h                                ;10 349110
08056278 4304     orr     r4,r0                                   ;2  349112
0805627A 0620     lsl     r0,r4,18h                               ;2  349114
0805627C 0E04     lsr     r4,r0,18h                               ;2  349116
0805627E 1C68     add     r0,r5,1                                 ;2  349118
08056280 0600     lsl     r0,r0,18h                               ;2  349120
08056282 0E05     lsr     r5,r0,18h                               ;2  349122
08056284 2D07     cmp     r5,7h                                   ;2  349124
08056286 D9F3     bls     8056270h                                ;8  349132
08056288 1C20     mov     r0,r4                                   ;2  349134
0805628A 1C79     add     r1,r7,1                                 ;2  349136
0805628C F004FEBA bl      805B004h                                ;10 349146
08056290 1830     add     r0,r6,r0                                ;2  349148
08056292 0600     lsl     r0,r0,18h                               ;2  349150
08056294 0E00     lsr     r0,r0,18h                               ;2  349152
08056296 BCF0     pop     r4-r7                                   ;21 349173
08056298 BC02     pop     r1                                      ;9  349182
0805629A 4708     bx      r1                                      ;8  349190

0x5629C

0805629C B530     push    r4,r5,r14                               ;7  
0805629E 1C05     mov     r5,r0                                   ;2  r5 = r0
080562A0 1C0C     mov     r4,r1                                   ;2  r4 = r1
080562A2 042D     lsl     r5,r5,10h                               ;2  
080562A4 0C2D     lsr     r5,r5,10h                               ;2  
080562A6 0424     lsl     r4,r4,10h                               ;2  
080562A8 0C24     lsr     r4,r4,10h                               ;2  
080562AA F7FFFF83 bl      80561B4h                                ;10 PRNG subroutine - 2 cycles
080562AE 0400     lsl     r0,r0,10h                               ;2  
080562B0 0C00     lsr     r0,r0,10h                               ;2  
080562B2 1B64     sub     r4,r4,r5                                ;2  r4 -= r5
080562B4 3401     add     r4,1h                                   ;2  r4++
080562B6 1C21     mov     r1,r4                                   ;2  r1 = r4
080562B8 F004FEA4 bl      805B004h                                ;10 
080562BC 182D     add     r5,r5,r0                                ;2  
080562BE 042D     lsl     r5,r5,10h                               ;2  
080562C0 0C2D     lsr     r5,r5,10h                               ;2  
080562C2 1C28     mov     r0,r5                                   ;2  r0 = r5
080562C4 BC30     pop     r4,r5                                   ;13 
080562C6 BC02     pop     r1                                      ;9  
080562C8 4708     bx      r1                                      ;8  
080562CA 0000     lsl     r0,r0,0h                                ;2

0x562CC

080562CC 4B02     ldr     r3,=2024598h                            ;9  
080562CE 4A03     ldr     r2,=2024594h                            ;9  r2 = 0x2024594
080562D0 6811     ldr     r1,[r2]                                 ;9  
080562D2 6019     str     r1,[r3]                                 ;5  
080562D4 6010     str     r0,[r2]                                 ;10 
080562D6 4770     bx      r14                                     ;8  
080562D8 4598     cmp     r8,r3                                   ;2  

Copy (0x2024598) to PRNG seed

080562DA 0202     lsl     r2,r0,8h                                ;2  
080562DC 4594     cmp     r12,r2                                  ;2  
080562DE 0202     lsl     r2,r0,8h                                ;2  r2 = r0 << 8
080562E0 4802     ldr     r0,=2024594h                            ;9  r0 = 0x2024594
080562E2 4903     ldr     r1,=2024598h                            ;9  r1 = 0x2024598
080562E4 6809     ldr     r1,[r1]                                 ;4  r1 = [0x2024598]
080562E6 6001     str     r1,[r0]                                 ;10 seed = [0x2024598]
080562E8 4770     bx      r14                                     ;8  
080562EA 0000     lsl     r0,r0,0h                                ;2

0x562EC

080562EC 4594     cmp     r12,r2                                  ;2  
080562EE 0202     lsl     r2,r0,8h                                ;2  
080562F0 4598     cmp     r8,r3                                   ;2  
080562F2 0202     lsl     r2,r0,8h                                ;2  
080562F4 B5F0     push    r4-r7,r14                               ;26 
080562F6 4657     mov     r7,r10                                  ;2  r7 = r10
080562F8 464E     mov     r6,r9                                   ;2  r6 = r9
080562FA 4645     mov     r5,r8                                   ;2  r5 = r8
080562FC B4E0     push    r5-r7                                   ;18 
080562FE 2000     mov     r0,0h                                   ;2  r0 = 0
08056300 4680     mov     r8,r0                                   ;2  r8 = r0
08056302 4D0B     ldr     r5,=8E116BCh                            ;9  r5 = 0x8E116BC
08056304 4C0B     ldr     r4,=2010400h                            ;9  r4 = 0x2010400
08056306 490C     ldr     r1,=2024040h                            ;9  r1 = 0x2024040
08056308 4642     mov     r2,r8                                   ;2  r2 = r8
0805630A 0090     lsl     r0,r2,2h                                ;2  r0 = r2 << 2
0805630C 1840     add     r0,r0,r1                                ;2  r0 += r1
0805630E 6802     ldr     r2,[r0]                                 ;9  r2 = [r0]
08056310 7951     ldrb    r1,[r2,5h]                              ;6  r1 = [r2+0x5]
08056312 2010     mov     r0,10h                                  ;2  r0 = 0x10
08056314 4008     and     r0,r1                                   ;2  r0 &= r1
08056316 2800     cmp     r0,0h                                   ;2  
08056318 D010     beq     805633Ch                                ;8  if(r0 == 0), branch to 0x805633C
0805631A 4643     mov     r3,r8                                   ;2  r3 = r8
0805631C 0058     lsl     r0,r3,1h                                ;2  r0 = r3 << 1
0805631E 1940     add     r0,r0,r5                                ;2  r0 += r5
08056320 8800     ldrh    r0,[r0]                                 ;6  r0 = [r0]
08056322 0140     lsl     r0,r0,5h                                ;2  r0 << 5
08056324 1900     add     r0,r0,r4                                ;2  r0 += r4
08056326 8811     ldrh    r1,[r2]                                 ;6  r1 = [r2]
08056328 F001F852 bl      80573D0h                                ;10 
0805632C E00E     b       805634Ch                                ;8  branch to 0x805634C
0805632E 0000     lsl     r0,r0,0h                                ;2  
08056330 16BC     asr     r4,r7,1Ah                               ;2  
08056332 08E1     lsr     r1,r4,3h                                ;2  
08056334 0400     lsl     r0,r0,10h                               ;2  
08056336 0201     lsl     r1,r0,8h                                ;2  
08056338 4040     eor     r0,r0                                   ;2  
0805633A 0202     lsl     r2,r0,8h                                ;2  
0805633C 4641     mov     r1,r8                                   ;2  r1 = r8
0805633E 0048     lsl     r0,r1,1h                                ;2  r0 = r1 << 1
08056340 1940     add     r0,r0,r5                                ;2  r0 += r5
08056342 8800     ldrh    r0,[r0]                                 ;6  r0 = [r0]
08056344 0140     lsl     r0,r0,5h                                ;2  r0 << 5
08056346 1900     add     r0,r0,r4                                ;2  r0 += r4
08056348 F001F894 bl      8057474h                                ;10 
0805634C 4640     mov     r0,r8                                   ;2  r0 = r8
0805634E 3001     add     r0,1h                                   ;2  
08056350 0600     lsl     r0,r0,18h                               ;2  
08056352 0E00     lsr     r0,r0,18h                               ;2  
08056354 4680     mov     r8,r0                                   ;2  
08056356 2804     cmp     r0,4h                                   ;2  
08056358 D9D5     bls     8056306h                                ;8  
0805635A 2200     mov     r2,0h                                   ;2  
0805635C 4690     mov     r8,r2                                   ;2  
0805635E 4B20     ldr     r3,=8E116BCh                            ;9  
08056360 469A     mov     r10,r3                                  ;2  
08056362 4820     ldr     r0,=2010400h                            ;9  
08056364 4681     mov     r9,r0                                   ;2  
08056366 4641     mov     r1,r8                                   ;2  
08056368 0088     lsl     r0,r1,2h                                ;2  
0805636A 4A1F     ldr     r2,=2024054h                            ;9  
0805636C 1887     add     r7,r0,r2                                ;2  
0805636E 683A     ldr     r2,[r7]                                 ;9  
08056370 7951     ldrb    r1,[r2,5h]                              ;6  
08056372 2010     mov     r0,10h                                  ;2  
08056374 4008     and     r0,r1                                   ;2  
08056376 2800     cmp     r0,0h                                   ;2  
08056378 D038     beq     80563ECh                                ;8  
0805637A 4646     mov     r6,r8                                   ;2  
0805637C 3605     add     r6,5h                                   ;2  
0805637E 0075     lsl     r5,r6,1h                                ;2  
08056380 4455     add     r5,r10                                  ;2  
08056382 8828     ldrh    r0,[r5]                                 ;4  
08056384 0140     lsl     r0,r0,5h                                ;2  
08056386 4448     add     r0,r9                                   ;2  
08056388 8811     ldrh    r1,[r2]                                 ;6  
0805638A F001F821 bl      80573D0h                                ;10 
0805638E 8828     ldrh    r0,[r5]                                 ;4  
08056390 0140     lsl     r0,r0,5h                                ;2  
08056392 4448     add     r0,r9                                   ;2  
08056394 6839     ldr     r1,[r7]                                 ;9  
08056396 8809     ldrh    r1,[r1]                                 ;4  
08056398 F001F9A8 bl      80576ECh                                ;10 
0805639C 8828     ldrh    r0,[r5]                                 ;4  
0805639E 0140     lsl     r0,r0,5h                                ;2  
080563A0 4448     add     r0,r9                                   ;2  
080563A2 6839     ldr     r1,[r7]                                 ;9  
080563A4 8809     ldrh    r1,[r1]                                 ;4  
080563A6 F001F985 bl      80576B4h                                ;10 
080563AA 882C     ldrh    r4,[r5]                                 ;4  
080563AC 0164     lsl     r4,r4,5h                                ;2  
080563AE 444C     add     r4,r9                                   ;2  
080563B0 6838     ldr     r0,[r7]                                 ;9  
080563B2 F7EAF973 bl      804069Ch                                ;10 
080563B6 1C01     mov     r1,r0                                   ;2  
080563B8 0609     lsl     r1,r1,18h                               ;2  
080563BA 1609     asr     r1,r1,18h                               ;2  
080563BC 1C20     mov     r0,r4                                   ;2  
080563BE F001F93D bl      805763Ch                                ;10 
080563C2 8828     ldrh    r0,[r5]                                 ;4  
080563C4 0140     lsl     r0,r0,5h                                ;2  
080563C6 4448     add     r0,r9                                   ;2  
080563C8 6839     ldr     r1,[r7]                                 ;9  
080563CA F000FF6D bl      80572A8h                                ;10 
080563CE 8828     ldrh    r0,[r5]                                 ;4  
080563D0 0140     lsl     r0,r0,5h                                ;2  
080563D2 4448     add     r0,r9                                   ;2  
080563D4 6839     ldr     r1,[r7]                                 ;9  
080563D6 F000FFB1 bl      805733Ch                                ;10 
080563DA 1C34     mov     r4,r6                                   ;2  
080563DC E00F     b       80563FEh                                ;8  
080563DE 0000     lsl     r0,r0,0h                                ;2  

Copy card drop data ?

08057474 B570     push    r4-r6,r14                               ;8  
08057476 1C02     mov     r2,r0                                   ;2  r2 = r0
08057478 2100     mov     r1,0h                                   ;2  r1 = 0
0805747A 4E0A     ldr     r6,=893B290h                            ;9  r6 = 0x893B290 (card drop data ?)
0805747C 25C0     mov     r5,0C0h                                 ;2  
0805747E 00AD     lsl     r5,r5,2h                                ;2  r5 = 800
08057480 2300     mov     r3,0h                                   ;2  r3 = 0
08057482 0208     lsl     r0,r1,8h                                ;2  r0 = r1 << 8
08057484 1C4C     add     r4,r1,1                                 ;2  r4 = r1 + 1
08057486 1981     add     r1,r0,r6                                ;2  r1 = r0 + r6
08057488 7808     ldrb    r0,[r1]                                 ;4  r0 = [r1]
0805748A 7010     strb    r0,[r2]                                 ;7  store r0 in [r2]
0805748C 3201     add     r2,1h                                   ;2  r2++
0805748E 3101     add     r1,1h                                   ;2  r1++
08057490 3301     add     r3,1h                                   ;2  r3++
08057492 2BFF     cmp     r3,0FFh                                 ;2  
08057494 D9F8     bls     8057488h                                ;8  if(r3 ≤ 0xFF), branch to 0x8057488
08057496 1952     add     r2,r2,r5                                ;2  r2 += r5
08057498 1C21     mov     r1,r4                                   ;2  r1 = r4
0805749A 2903     cmp     r1,3h                                   ;2  
0805749C D9F0     bls     8057480h                                ;8  if(r1 ≤ 3), branch to 0x8057480
0805749E BC70     pop     r4-r6                                   ;17 
080574A0 BC01     pop     r0                                      ;9  
080574A2 4700     bx      r0                                      ;8

0x58754

08058754 DF0B     swi     0Bh     ;CpuSet                         ;8  
08058756 4770     bx      r14                                     ;8  
08058758 DF13     swi     13h     ;HuffUnCompReadNormal           ;8  
0805875A 4770     bx      r14                                     ;8  
0805875C DF11     swi     11h     ;LZ77UnCompReadNormalWrite8bit  ;8  
0805875E 4770     bx      r14                                     ;8  
08058760 B530     push    r4,r5,r14                               ;18 
08058762 1C05     mov     r5,r0                                   ;2  r5 = r0
08058764 1C0C     mov     r4,r1                                   ;2  r4 = r1
08058766 1C13     mov     r3,r2                                   ;2  r3 = r2
08058768 4A0B     ldr     r2,=4000204h                            ;9  r2 = 0x4000204
0805876A 8810     ldrh    r0,[r2]                                 ;6  r0 = [0x4000204]
0805876C 490B     ldr     r1,=0FFFCh                              ;9  r1 = 0xFFFC
0805876E 4008     and     r0,r1                                   ;2  r0 &= r1
08058770 2103     mov     r1,3h                                   ;2  r1 = 3
08058772 4308     orr     r0,r1                                   ;2  r0 |= r1
08058774 8010     strh    r0,[r2]                                 ;7  store r0 to [0x4000204]
08058776 3B01     sub     r3,1h                                   ;2  r3--
08058778 2001     mov     r0,1h                                   ;2  r0 = 1
0805877A 4240     neg     r0,r0                                   ;2  -r0
0805877C 4283     cmp     r3,r0                                   ;2  
0805877E D007     beq     8058790h                                ;8  if(r3 == r0), branch to 0x8058790
08058780 1C01     mov     r1,r0                                   ;2  r1 = r0
08058782 7828     ldrb    r0,[r5]                                 ;6  
08058784 7020     strb    r0,[r4]                                 ;5  copy [r5] to [r4]
08058786 3501     add     r5,1h                                   ;2  r5++
08058788 3401     add     r4,1h                                   ;2  r4++
0805878A 3B01     sub     r3,1h                                   ;2  r3--
0805878C 428B     cmp     r3,r1                                   ;2  
0805878E D1F8     bne     8058782h                                ;8  if(r3 ≠ r1), branch to 0x8058782
08058790 BC30     pop     r4,r5                                   ;13 
08058792 BC01     pop     r0                                      ;9  
08058794 4700     bx      r0                                      ;8

Shop prices 1 ?

0805B004 2301     mov     r3,1h                                   ;2  r3 = 1
0805B006 2900     cmp     r1,0h                                   ;2  
0805B008 D05E     beq     805B0C8h                                ;8  if(r1 == 0), branch to 0c805B0C8
0805B00A D500     bpl     805B00Eh                                ;8  
0805B00C 4249     neg     r1,r1                                   ;2  (-)r1
0805B00E B410     push    r4                                      ;10 
0805B010 B401     push    r0                                      ;10 
0805B012 2800     cmp     r0,0h                                   ;2  
0805B014 D500     bpl     805B018h                                ;8  
0805B016 4240     neg     r0,r0                                   ;2  (-)r0
0805B018 4288     cmp     r0,r1                                   ;2  
0805B01A D34F     bcc     805B0BCh                                ;8  
0805B01C 2401     mov     r4,1h                                   ;2  r4 = 1
0805B01E 0724     lsl     r4,r4,1Ch                               ;2  
0805B020 42A1     cmp     r1,r4                                   ;2  
0805B022 D204     bcs     805B02Eh                                ;8  
0805B024 4281     cmp     r1,r0                                   ;2  
0805B026 D202     bcs     805B02Eh                                ;8  if(carry), branch to 0x805B02E
0805B028 0109     lsl     r1,r1,4h                                ;2  
0805B02A 011B     lsl     r3,r3,4h                                ;2  
0805B02C E7F8     b       805B020h                                ;8  loop to 0x805B020
0805B022 D204     bcs     805B02Eh                                ;8  
0805B024 4281     cmp     r1,r0                                   ;2  
0805B026 D202     bcs     805B02Eh                                ;8  
0805B028 0109     lsl     r1,r1,4h                                ;2  
0805B02A 011B     lsl     r3,r3,4h                                ;2  
0805B02C E7F8     b       805B020h                                ;8  
0805B02E 00E4     lsl     r4,r4,3h                                ;2  
0805B030 42A1     cmp     r1,r4                                   ;2  
0805B032 D204     bcs     805B03Eh                                ;8  
0805B034 4281     cmp     r1,r0                                   ;2  
0805B036 D202     bcs     805B03Eh                                ;8  
0805B038 0049     lsl     r1,r1,1h                                ;2  
0805B03A 005B     lsl     r3,r3,1h                                ;2  
0805B03C E7F8     b       805B030h                                ;8  
0805B03E 2200     mov     r2,0h                                   ;2  
0805B040 4288     cmp     r0,r1                                   ;2  
0805B042 D300     bcc     805B046h                                ;8  
0805B044 1A40     sub     r0,r0,r1                                ;2  
0805B046 084C     lsr     r4,r1,1h                                ;2  
0805B048 42A0     cmp     r0,r4                                   ;2  
0805B04A D305     bcc     805B058h                                ;8  
0805B04C 1B00     sub     r0,r0,r4                                ;2  
0805B04E 469C     mov     r12,r3                                  ;2  
0805B050 2401     mov     r4,1h                                   ;2  
0805B052 41E3     ror     r3,r4                                   ;3  
0805B054 431A     orr     r2,r3                                   ;2  
0805B056 4663     mov     r3,r12                                  ;2  
0805B058 088C     lsr     r4,r1,2h                                ;2  
0805B05A 42A0     cmp     r0,r4                                   ;2  
0805B05C D305     bcc     805B06Ah                                ;8  
0805B05E 1B00     sub     r0,r0,r4                                ;2  
0805B060 469C     mov     r12,r3                                  ;2  
0805B062 2402     mov     r4,2h                                   ;2  
0805B064 41E3     ror     r3,r4                                   ;3  
0805B066 431A     orr     r2,r3                                   ;2  
0805B068 4663     mov     r3,r12                                  ;2  
0805B06A 08CC     lsr     r4,r1,3h                                ;2  
0805B06C 42A0     cmp     r0,r4                                   ;2  
0805B06E D305     bcc     805B07Ch                                ;8  
0805B070 1B00     sub     r0,r0,r4                                ;2  
0805B072 469C     mov     r12,r3                                  ;2  
0805B074 2403     mov     r4,3h                                   ;2  
0805B076 41E3     ror     r3,r4                                   ;3  
0805B078 431A     orr     r2,r3                                   ;2  
0805B07A 4663     mov     r3,r12                                  ;2  
0805B07C 469C     mov     r12,r3                                  ;2  
0805B07E 2800     cmp     r0,0h                                   ;2  
0805B080 D003     beq     805B08Ah                                ;8  
0805B082 091B     lsr     r3,r3,4h                                ;2  
0805B084 D001     beq     805B08Ah                                ;8  
0805B086 0909     lsr     r1,r1,4h                                ;2  
0805B088 E7D9     b       805B03Eh                                ;8  
0805B08A 240E     mov     r4,0Eh                                  ;2  
0805B08C 0724     lsl     r4,r4,1Ch                               ;2  
0805B08E 4022     and     r2,r4                                   ;2  
0805B090 D014     beq     805B0BCh                                ;8  
0805B092 4663     mov     r3,r12                                  ;2  
0805B094 2403     mov     r4,3h                                   ;2  
0805B096 41E3     ror     r3,r4                                   ;3  
0805B098 421A     tst     r2,r3                                   ;2  
0805B09A D001     beq     805B0A0h                                ;8  
0805B09C 08CC     lsr     r4,r1,3h                                ;2  
0805B09E 1900     add     r0,r0,r4                                ;2  
0805B0A0 4663     mov     r3,r12                                  ;2  
0805B0A2 2402     mov     r4,2h                                   ;2  
0805B0A4 41E3     ror     r3,r4                                   ;3  
0805B0A6 421A     tst     r2,r3                                   ;2  
0805B0A8 D001     beq     805B0AEh                                ;8  
0805B0AA 088C     lsr     r4,r1,2h                                ;2  
0805B0AC 1900     add     r0,r0,r4                                ;2  
0805B0AE 4663     mov     r3,r12                                  ;2  
0805B0B0 2401     mov     r4,1h                                   ;2  
0805B0B2 41E3     ror     r3,r4                                   ;3  
0805B0B4 421A     tst     r2,r3                                   ;2  
0805B0B6 D001     beq     805B0BCh                                ;8  
0805B0B8 084C     lsr     r4,r1,1h                                ;2  
0805B0BA 1900     add     r0,r0,r4                                ;2  
0805B0BC BC10     pop     r4                                      ;9  
0805B0BE 2C00     cmp     r4,0h                                   ;2  
0805B0C0 D500     bpl     805B0C4h                                ;8  
0805B0C2 4240     neg     r0,r0                                   ;2  
0805B0C4 BC10     pop     r4                                      ;9  
0805B0C6 46F7     mov     r15,r14                                 ;2  
0805B0C8 B500     push    r14                                     ;10 
0805B0CA F7FFFF77 bl      805AFBCh                                ;10 
0805B0CE 2000     mov     r0,0h                                   ;2  
0805B0D0 BD00     pop     r15                                     ;15 
0805B0D2 0000     lsl     r0,r0,0h                                ;2  
(onto next section)

Shop prices 2 ?

0805B0D4 B5F0     push    r4-r7,r14                               ;26 
0805B0D6 B084     add     sp,-10h                                 ;2  
0805B0D8 9000     str     r0,[sp]                                 ;5  
0805B0DA 9101     str     r1,[sp,4h]                              ;5  
0805B0DC 9202     str     r2,[sp,8h]                              ;5  
0805B0DE 9303     str     r3,[sp,0Ch]                             ;5  
0805B0E0 9B00     ldr     r3,[sp]                                 ;4  
0805B0E2 4817     ldr     r0,=0FFFFh                              ;9  
0805B0E4 4684     mov     r12,r0                                  ;2  
0805B0E6 1C1A     mov     r2,r3                                   ;2  
0805B0E8 4002     and     r2,r0                                   ;2  
0805B0EA 0C1B     lsr     r3,r3,10h                               ;2  
0805B0EC 9902     ldr     r1,[sp,8h]                              ;4  
0805B0EE 1C08     mov     r0,r1                                   ;2  
0805B0F0 4664     mov     r4,r12                                  ;2  
0805B0F2 4020     and     r0,r4                                   ;2  
0805B0F4 0C09     lsr     r1,r1,10h                               ;2  
0805B0F6 1C15     mov     r5,r2                                   ;2  
0805B0F8 4345     mul     r5,r0                                   ;6  
0805B0FA 1C14     mov     r4,r2                                   ;2  
0805B0FC 434C     mul     r4,r1                                   ;3  
0805B0FE 1C1A     mov     r2,r3                                   ;2  
0805B100 4342     mul     r2,r0                                   ;6  
0805B102 434B     mul     r3,r1                                   ;3  
0805B104 0C28     lsr     r0,r5,10h                               ;2  
0805B106 1824     add     r4,r4,r0                                ;2  
0805B108 18A4     add     r4,r4,r2                                ;2  
0805B10A 4294     cmp     r4,r2                                   ;2  
0805B10C D202     bcs     805B114h                                ;8  
0805B10E 2080     mov     r0,80h                                  ;2  
0805B110 0240     lsl     r0,r0,9h                                ;2  
0805B112 181B     add     r3,r3,r0                                ;2  
0805B114 0C20     lsr     r0,r4,10h                               ;2  
0805B116 181F     add     r7,r3,r0                                ;2  
0805B118 4661     mov     r1,r12                                  ;2  
0805B11A 400C     and     r4,r1                                   ;2  
0805B11C 0420     lsl     r0,r4,10h                               ;2  
0805B11E 400D     and     r5,r1                                   ;2  
0805B120 1C06     mov     r6,r0                                   ;2  
0805B122 432E     orr     r6,r5                                   ;2  
0805B124 1C39     mov     r1,r7                                   ;2  
0805B126 1C30     mov     r0,r6                                   ;2  
0805B128 9B00     ldr     r3,[sp]                                 ;4  
0805B12A 9C03     ldr     r4,[sp,0Ch]                             ;4  
0805B12C 1C1A     mov     r2,r3                                   ;2  
0805B12E 4362     mul     r2,r4                                   ;6  
0805B130 9D01     ldr     r5,[sp,4h]                              ;4  
0805B132 9C02     ldr     r4,[sp,8h]                              ;4  
0805B134 1C2B     mov     r3,r5                                   ;2  
0805B136 4363     mul     r3,r4                                   ;3  
0805B138 18D2     add     r2,r2,r3                                ;2  
0805B13A 18B9     add     r1,r7,r2                                ;2  
0805B13C B004     add     sp,10h                                  ;2  
0805B13E BDF0     pop     r4-r7,r15                               ;14 
0805B140 FFFF     bl      lr+0FFEh                                ;10 
0805B142 0000     lsl     r0,r0,0h                                ;2  
0805B144 B5F0     push    r4-r7,r14                               ;26 
0805B146 4657     mov     r7,r10                                  ;2  
0805B148 464E     mov     r6,r9                                   ;2  
0805B14A 4645     mov     r5,r8                                   ;2  
0805B14C B4E0     push    r5-r7                                   ;18 
0805B14E B088     add     sp,-20h                                 ;2  
0805B150 1C17     mov     r7,r2                                   ;2  
0805B152 1C1E     mov     r6,r3                                   ;2  
0805B154 4682     mov     r10,r0                                  ;2  
0805B156 4688     mov     r8,r1                                   ;2  
0805B158 2E00     cmp     r6,0h                                   ;2  
0805B15A D000     beq     805B15Eh                                ;8  
0805B15C E126     b       805B3ACh                                ;8

Location names

0x75330-0x7550F - Location names. Interestingly, only the first location has been translated into all languages, meaning that the European localization was not yet finished at the time Konami decided to release the game in the United States.

$0Clock Tower Square
$1Place du clocher
$2Uhrenturmplatz
$3Piazza Campanile
$4Plaza del reloj
$5(Japanese, no proper font)
$0Domino Station
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Egypt Exhibition
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Domino Pier
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Italy
$1
$2
$3
$4
$5(Japanese, no proper font)
$0China
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Canada
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Galapagos
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Pegasus Island
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Dungeon
$1
$2
$3
$4
$(Japanese, no proper font)
$0Pegasus Castle
$1
$2
$3
$4
$5(Japanese, no proper font)
$0Hall of Eternity
$1
$2
$3
$4
$5(Japanese, no proper font)

Starting Trunk cards

0x904C2-0x907E2 - Starting Trunk spare cards (aside from starter deck), starting from blank card 0x00

2× Shadow Specter
2× Skull Servant
2× Tomozaurus
2× Dark Plant
2× Ancient Jar
2× Key Mace
2× Haniwa
2× Change Slime
2× Zone Eater
2× Steel Scorpion
2× Dancing Elf
2× Ooguchi
2× Mechanical Spider
2× Bat
2× Jinzo #7
2× Magician of Faith
2× White Dolphin
2× Turu-Purun
2× Armed Ninja
2× Sinister Serpent
2× Ameba
2× Korogashi
2× Rainbow Flower
2× Flame Dancer
2× Star Boy
2× Milus Radiant
2× Hane-Hane
2× Griggle
2× Bone Mouse
2× Pot the Trick
2× Queen's Double
2× Thousand-Eyes Idol
2× The Unhappy Maiden
2× Bite Shoes

00
00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 02 02 02 00 00 02 00 00
00 00 00 00 00 00 00 00 00 02 02 00 00 00 00 00
00 00 00 00 00 02 00 00 00 00 00 02 00 00 00 00
00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 02 00 00 00 00 00 02 00 00 00 00 00
00 00 00 02 02 00 00 02 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 02 00 00 02 00
00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
00 00 02 02 00 00 00 00 00 00 00 00 00 02 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02
00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Card Trunk menu text

0x907E4-0x90C6F - Card Trunk menu text (deck edit text, order menu text and card display text, in 6 languages)

$0Details   Move to Deck        Return to Trunk     
$1Détails   Mettre dans le Deck Remettre dans coffre
$2Details   In das Deck         Zurück zu Stamm     
$3Dettagli  Vai a Deck          Torna a Tronco      
$4Detalles  Mover a la Deck     Devolver al tronco  
$5(Japanese, no proper font)
$0Reorder       No.   Name      ATK   DEF       Type  Summon    Qty.    Cost    Stars     Exit    Effect    
$1Réorganiser   N°    Nom       ATK   DEF       Type  Invoquer  Qté     Coût    Étoiles   Quitter Effect    
$2Nachbestellen Nr.   Name      AGR   VTG       Typ   Rufen     Menge   Kosten  Sterne    Beenden Effect    
$3Riordina      N°    Nome      ATT   DIF       Tipo  Evoca     Quant.  Costo   Stelle    Esci    Effect    
$4Reorganizar   NúmeroNombre    ATAQUEDEFENDER  Tipo  Llamar    CantidadCoste   Estrellas Salir   Effect    
$5(Japanese, no proper font)
$0Cost 
$1Coût 
$2Kost.
$3Costo
$4Coste
$5(Japanese, no proper font)

Card layouts

Card layouts, at the following offsets:

  • 0x90C70-0x90DE7
  • 0x91070-0x9119F
  • 0x91468-0x91567
  • 0x91868-0x91967

Cards data

  • 0x91D4A => 0x92389 : Card DEFs
  • 0x9238C => 0x929CB : Card ATKs
  • 0x929D0 => 0x9364F : Card Costs
  • 0x93651 => 0x9396F : Card Attributes
  • 0x93972 => 0x93C91 : Card Levels
  • 0x93C93 => 0x93FB2 : Card Types
  • 0x93FB4 => 0x942D3 : Card Colors
0x00 Normal Monster
0x01 Effect Monster
0x02 Fusion Monster (Unused)
0x03 Magic
0x04 Trap
0x05 Ritual
0x06 Obelisk the Tormentor
0x07 Slifer the Sky Dragon
0x08 The Winged Dragon of Ra
  • 0x942D5 => 0x945F4 : Card Effects (Monster)
  • 0x945F6 => 0x94915 : Card Effects (Magic Trap Ritual)
  • 0x94916 => 0x94C35 : Card Effects (Trap)
  • 0x94C38 => 0x94CC2 : Card Effects (Ritual)
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 01 02 03 04 05 09 0A 0B 0C 0D 0E 00 00 00 00
00 00 00 0F 10 11 12 13 14 15 16 17 06 07 08 00
00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00
00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
  • 0x9508C => 0x9553B : ?
  • 0x9826E => 0xAA771 : Cards names

Deck Capacity to Duelist Level array

  • 0xB8974 => 0xB9143 : Deck Capacity required for each Duelist Level.

Limited cards

  • 0xB9620 => 0xB96A7 : Limited cards
11 00 12 00 13 00 14 00 15 00 38 00 39 00 43 00 
48 00 53 00 C2 00 EA 00 EE 00 F0 00 29 01 49 01 
50 01 51 01 56 01 5A 01 5B 01 5C 01 64 01 65 01 
68 01 6A 01 6C 01 6D 01 76 01 7C 01 9C 01 47 02 
48 02 49 02 4A 02 4B 02 59 02 5C 02 5E 02 85 02 
91 02 A0 02 B4 02 B9 02 BA 02 BB 02 BD 02 BE 02 
BF 02 C0 02 C1 02 C2 02 C4 02 C5 02 C6 02 CB 02 
CC 02 CD 02 CE 02 CF 02 D0 02 D1 02 DB 02 DE 02 
0D 03 10 03 11 03 15 03
  • 0xB96AA => 0xB96B3 : Semi-limited cards
54 01 55 01 59 01 95 02 AE 02

CPU decks

0xB96C0 => 0xBC9FF : Decks

A list of CPU decks is available here.

CPU opponent's data

0xBCA00-0xBE633 - Opponent's data: Field, Life Points, pointers to deck, drops, etc.

aa __ bb __ cc cc cc cc dd dd dd dd ee ee ee ee
ff ff ff ff gg gg hh hh jj __ __ __ kk kk ll ll
__ __ __ __ __ __ __ __ __ __ __ __
aa - CPU opponent ID
bb - Field ID
cc - Pointer to CPU's deck
dd - Pointer to card drops
ee - Pointer to shop cards
ff - Pointer to bad ante cards
gg - Max starting Life Points (Player)
hh - Starting Life Points (CPU)
jj - DC increase
kk - Min Domino earned
ll - Max Domino earned

A list of CPU opponent's data is available here.

Card drops lists

0xBED20-0xC180B - Card drops lists

xx xx yy yy
xx - Card ID
yy - Cumulative probability / 2048

A list of card drops is available here.

Bad Ante card drops

0xC1770-0xC1807 - Drops if you ante a "bad" card (such as Skull Servant)

xx xx yy yy
xx - Card ID
yy - Cumulative probability / 2048
09 00 35 00 68 00 6A 00 69 00 9F 00 82 00 D4 00
BF 00 09 01 CA 00 3F 01 CF 00 75 01 D2 00 AB 01
ED 00 E1 01 F2 00 17 02 40 01 4D 02 53 01 83 02
58 01 B9 02 9A 01 EF 02 A6 01 25 03 B4 01 5B 03
BC 01 91 03 E5 01 C7 03 E6 01 FD 03 E8 01 33 04
F5 01 69 04 F8 01 9F 04 FA 01 D5 04 04 02 0B 05
0C 02 41 05 1D 02 77 05 4D 02 AD 05 56 02 E3 05
63 02 19 06 9E 02 4F 06 AA 02 85 06 B6 02 BB 06
BC 02 F1 06 D2 02 27 07 DA 02 5D 07 DD 02 93 07
08 03 C9 07 0F 03 FF 07

  54/2048 Shadow Specter
  53/2048 Curtain of the Dark Ones
  53/2048 Tomozaurus
  53/2048 Weather Control
  53/2048 LaLa Li-oon
  54/2048 Air Marmot of Nefariousness
  54/2048 Droll Bird
  54/2048 Hinotama Soul
  54/2048 Haniwa
  54/2048 Candle of Fate
  54/2048 Stop Defense
  54/2048 Red Medicine
  54/2048 Hinotama
  54/2048 Mechanical Spider
  54/2048 Jinzo #7
  54/2048 White Dolphin
  54/2048 Turu-Purun
  54/2048 Korogashi
  54/2048 Boo Koo
  54/2048 Rainbow Flower
  54/2048 Man-Eater Bug
  54/2048 Flame Dancer
  54/2048 Gale Dogra
  54/2048 Muka Muka
  54/2048 Star Boy
  54/2048 Hane-Hane
  54/2048 Tentacle Plant
  54/2048 Little Chimera
  54/2048 Hiro's Shadow Scout
  54/2048 Black Luster Ritual
  54/2048 Eatgaboon
  54/2048 Infinite Dismissal
  54/2048 Darkness Approaches
  54/2048 Dark Magic Ritual
  54/2048 Dark-Eyes Illusionist
  54/2048 Thousand-Eyes Idol
  54/2048 Bite Shoes
  54/2048 Black Illusion Ritual

Shop cards probabilities

0xC8020-0xC8C8B - Probabilities for cards to appear to the shop after a duel. 795 cards are there, God cards are excluded.

xx xx yy yy

xx - Card ID
yy - Probability / 30,000

Card orders (Unused)

0xCDEC4 => 0xD29C3 : Card orders

The game uses its own subroutine to order the cards by Name / ATK / DEF / Level / etc. So these long arrays of card IDs are effectively unused, it seems. 19200 bytes wasted.

Starter deck

0xF3180 => 0xF31CF : Starter Deck

57 01 C8 00 A7 00 0B 01 A2 02 BF 00 D3 00 D5 01 
09 01 0C 02 F8 01 D2 00 F2 00 8B 01 9A 01 6F 00 
D1 00 E6 01 69 00 82 00 A6 01 A5 01 AC 01 92 01 
AA 02 B8 00 91 00 05 01 68 00 93 01 CF 00 83 01 
5E 01 B5 02 B3 00 94 01 1E 03 EB 01 1D 02 C1 00

1x Curtain of the Dark Ones
1x Tomozaurus
1x Doma The Angel of Silence
1x Weather Control
1x The Bewitching Phantom Thief
1x Ancient Jar
1x Phantom Dewan
1x Genin
1x LaLa Li-oon
1x Petit Dragon
1x Droll Bird
1x Winged Cleaver
1x Hinotama Soul
1x Kaminarikozou
1x Candle of Fate
1x Wicked Mirror
1x The Furious Sea King
1x Morphing Jar #2
1x Mystic Lamp
1x Dancing Elf
1x Monster Eye
1x Leogun
1x Tatsunootoshigo
1x Mechanical Spider
1x Cyber Commander
1x Jinzo #7
1x Magician of Faith
1x Armed Ninja
1x Boo Koo
1x Peacock
1x Flame Dancer
1x Star Boy
1x Hane-Hane
1x Lightning Conger
1x Beast of Talwar

1x Final Destiny
1x Sparks
1x Dark-Piercing Light
1x Beckon to Darkness

1x Eatgaboon

Card Effect Pointers

0x102E2C - Monster effect ASM pointers 0x10300C - Magic effect ASM pointers

0x93B290 - ? (array of data)

0x93B290 - Array ?

Minicard Palette

At 0x9A781C is a 256-color palette used by all LZ77-compressed card images when they're seen on the board or in the deck list.

Prices

0xDFDB98 => 0xDFF498 - Base Card Prices

Pointers to CPU opponent's data

0xE00B30-0xE00DBF - Pointers to CPU opponent's data

Permanent Effect Pointers

0xE0C6C0 - Always active

0xE0C940 - Active once per turn

Passwords

Card Passwords

0xE0FD54-0xE11653 - Card passwords

Special Passwords

0xE11664-0xE11673 - Passwords for Goemon Impact and Phoenix Mode Ra

Game Text

  • 0xE1936E => 0xF03FBA : In-game texts
  • 0xF05BD0 => 0xF1B7FC : In-duel effects texts
  • 0xF1C499 => 0xF9E32E : Cards texts #1
  • 0xF9F033 => 0xFA08F6 : Cards texts #2
  • 0xFA15EA => 0xFA2B9A : In-duel progress texts


Internal Data for Yu-Gi-Oh! Reshef of Destruction

ROM MapRAM MapText TableNotesTutorials