Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Yu-Gi-Oh! Worldwide Edition: Stairway to the Destined Duel/ROM map

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a ROM map for Yu-Gi-Oh! Worldwide Edition: Stairway to the Destined Duel.

Cards stats

Display card ATK

0800FC50 B570     push    r4-r6,r14                       ;
0800FC52 0400     lsl     r0,r0,10h                       ;
0800FC54 0C04     lsr     r4,r0,10h                       ;
0800FC56 0409     lsl     r1,r1,10h                       ;
0800FC58 0C0D     lsr     r5,r1,10h                       ;
0800FC5A 0412     lsl     r2,r2,10h                       ;
0800FC5C 0C16     lsr     r6,r2,10h                       ;
0800FC5E F7FFFFED bl      800FC3Ch                        ;
0800FC62 4809     ldr     r0,=2013E00h                    ;
0800FC64 8044     strh    r4,[r0,2h]                      ;
0800FC66 4809     ldr     r0,=7FFh                        ;
0800FC68 4020     and     r0,r4                           ;
0800FC6A 0080     lsl     r0,r0,2h                        ;
0800FC6C 4908     ldr     r1,=8832B84h                    ;
0800FC6E 1840     add     r0,r0,r1                        ;
0800FC70 6800     ldr     r0,[r0]                         ;
0800FC72 21F8     mov     r1,0F8h                         ;
0800FC74 0449     lsl     r1,r1,11h                       ;
0800FC76 4008     and     r0,r1                           ;
0800FC78 0D00     lsr     r0,r0,14h                       ;
0800FC7A 2815     cmp     r0,15h                          ;
0800FC7C DB0F     blt     800FC9Eh                        ;
0800FC7E 2817     cmp     r0,17h                          ;
0800FC80 DD08     ble     800FC94h                        ;
0800FC82 2818     cmp     r0,18h                          ;
0800FC84 D008     beq     800FC98h                        ;
0800FC86 E00A     b       800FC9Eh                        ;
0800FC88 3E00     sub     r6,0h                           ;
0800FC8A 0201     lsl     r1,r0,8h                        ;
0800FC8C 07FF     lsl     r7,r7,1Fh                       ;
0800FC8E 0000     lsl     r0,r0,0h                        ;
0800FC90 2B84     cmp     r3,84h                          ;
0800FC92 0883     lsr     r3,r0,2h                        ;
0800FC94 2000     mov     r0,0h                           ;
0800FC96 E00D     b       800FCB4h                        ;
0800FC98 20FA     mov     r0,0FAh                         ;
0800FC9A 0100     lsl     r0,r0,4h                        ;
0800FC9C E00A     b       800FCB4h                        ;
0800FC9E 480F     ldr     r0,=7FFh                        ;
0800FCA0 4020     and     r0,r4                           ;
0800FCA2 0080     lsl     r0,r0,2h                        ;
0800FCA4 4B0E     ldr     r3,=8832B84h                    ;
0800FCA6 18C0     add     r0,r0,r3                        ;r0 = 0x8832B84 + ((0x7FF & card_ID) << 2)
0800FCA8 6801     ldr     r1,[r0]                         ;r1 = [compressed_card_data_array]
0800FCAA 0389     lsl     r1,r1,0Eh                       ;
0800FCAC 0DC9     lsr     r1,r1,17h                       ;
0800FCAE 0088     lsl     r0,r1,2h                        ;
0800FCB0 1840     add     r0,r0,r1                        ;
0800FCB2 0040     lsl     r0,r0,1h                        ;r0 = DWORD(((r1 << 14 >> 23 << 2) + (r1 << 14 >> 23)) << 1)
0800FCB4 4A0B     ldr     r2,=2013E00h                    ;
0800FCB6 62D0     str     r0,[r2,2Ch]                     ;Store card ATK into [02013E2C]
0800FCB8 4808     ldr     r0,=7FFh                        ;
0800FCBA 4020     and     r0,r4                           ;
0800FCBC 0080     lsl     r0,r0,2h                        ;
0800FCBE 4908     ldr     r1,=8832B84h                    ;
0800FCC0 1840     add     r0,r0,r1                        ;r0 = 0x8832B84 + ((r0 & r4) << 2)
0800FCC2 6800     ldr     r0,[r0]                         ;
0800FCC4 21F8     mov     r1,0F8h                         ;
0800FCC6 0449     lsl     r1,r1,11h                       ;r1 = 0x1F00000
0800FCC8 4008     and     r0,r1                           ;r0  &= r1
0800FCCA 0D00     lsr     r0,r0,14h                       ;r0 >>= 20
0800FCCC 2815     cmp     r0,15h                          ;
0800FCCE DB10     blt     800FCF2h                        ;if (r0 < 21), branch to 0x800FCF2
0800FCD0 2817     cmp     r0,17h                          ;
0800FCD2 DD09     ble     800FCE8h                        ;if (r0 <= 23), branch to 0x800FCE8
0800FCD4 2818     cmp     r0,18h                          ;
0800FCD6 D009     beq     800FCECh                        ;if (r0 == 24), branch to 0x800FCEC
0800FCD8 E00B     b       800FCF2h                        ;else branch to 0x800FCF2
0800FCDA 0000     lsl     r0,r0,0h                        ;

Trunk management

Add card to Trunk

0808AF0C 3C80     sub     r4,80h                                  ;
0808AF0E 0883     lsr     r3,r0,2h                                ;
0808AF10 F893     bl      lr+126h                                 ;
0808AF12 FFFF     bl      lr+0FFEh                                ;
0808AF14 6070     str     r0,[r6,4h]                              ;
0808AF16 0817     lsr     r7,r2,20h                               ;
0808AF18 B530     push    r4,r5,r14                               ;
0808AF1A 1C04     mov     r4,r0                                   ;
0808AF1C 0424     lsl     r4,r4,10h                               ;
0808AF1E 0C24     lsr     r4,r4,10h                               ;
0808AF20 1C20     mov     r0,r4                                   ;
0808AF22 F7FFFFDF bl      808AEE4h                                ;
0808AF26 4B0C     ldr     r3,=2011C20h                            ;
0808AF28 00A4     lsl     r4,r4,2h                                ;
0808AF2A 18E4     add     r4,r4,r3                                ;
0808AF2C 8922     ldrh    r2,[r4,8h]                              ;
0808AF2E 0591     lsl     r1,r2,16h                               ;
0808AF30 480A     ldr     r0,=0FF800000h                          ;
0808AF32 4281     cmp     r1,r0                                   ;
0808AF34 D80D     bhi     808AF52h                                ;
0808AF36 0D89     lsr     r1,r1,16h                               ;
0808AF38 3101     add     r1,1h                                   ;
0808AF3A 4D09     ldr     r5,=3FFh                                ;
0808AF3C 1C28     mov     r0,r5                                   ;
0808AF3E 4001     and     r1,r0                                   ;
0808AF40 4808     ldr     r0,=0FFFFFC00h                          ;
0808AF42 4010     and     r0,r2                                   ;
0808AF44 4308     orr     r0,r1                                   ;
0808AF46 8120     strh    r0,[r4,8h]                              ;
0808AF48 4807     ldr     r0,=20C6h                               ;
0808AF4A 1819     add     r1,r3,r0                                ;
0808AF4C 8808     ldrh    r0,[r1]                                 ;
0808AF4E 3001     add     r0,1h                                   ;
0808AF50 8008     strh    r0,[r1]                                 ;
0808AF52 BC30     pop     r4,r5                                   ;
0808AF54 BC01     pop     r0                                      ;
0808AF56 4700     bx      r0                                      ;
0808AF58 1C20     mov     r0,r4                                   ;

Cards data

Cards stats array

0x832B84 to 0x833C7F - Cards stats array, containing Attribute, Type, ATK and DEF

bitmap:
AAAB BBBC CCCC DDEE EEEE EEEF FFFF FFFF
A - Attribute
    If card_type ≤ 0x14
     0 - No Attribute
     1 - LIGHT
     2 - DARK
     3 - WATER
     4 - FIRE
     5 - EARTH
     6 - WIND
     7 - ---
    If card_type ≥ 0x15
     0 - MAGIC
     1 - TRAP
B - Level
C - Card Type
    0 - [] (Monster)
    1 - Dragon
    2 - Zombie
    3 - Fiend
    4 - Pyro
    5 - Sea Serpent
    6 - Rock
    7 - Machine
    8 - Fish
    9 - Dinosaur
    A - Insect
    B - Beast
    C - Beast-Warrior
    D - Plant
    E - Aqua
    F - Warrior
   10 - Winged-Beast
   11 - Fairy
   12 - Spellcaster
   13 - Thunder
   14 - Reptile
   15 - Trap
   16 - Magic
   17 - Ticket ("Cannot be used in duel")
   18 - Divine-Beast ("Cannot be used in duel", displays the unused Divine Attribute, sets the card Level to 10, and displays blank values as the ATK stats)
D - Monster category
   If card_type ≤ 0x14
    0 - Normal Monster
    1 - Effect Monster
    2 - Fusion Monster
    3 - Ritual Monster
   If card_type = 0x15, a 3rd bit is used
    0 - Normal
    1 - Counter
    2 - Field
    3 - Equip
    4 - Continuous
    5 - Quick
    6 - Ritual
    7 - [Unknown]
E - ATK ÷ 10
F - DEF ÷ 10

Take this example with Earthbound Spirit (ID #0001).

C8 64 30 A8 => 0xA83064C8
Card ATK :
=> DWORD(((0xA83064C8 << 14 >> 23 << 2) + (0xA83064C8 << 14 >> 23)) << 1) = 0d500
Or :
xxxx xxxx xxxx xxCC CCCC CCCx xxxx xxxx
0b000110010 = 0d50
50 × 10 = 500

Cards names

  • 0x83663C - Card names in 6 languages : Japanese, English, German, French, Italian, Spanish