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.
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
Jump to navigation
Jump to search
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] ;r4 = card_id 0800FC66 4809 ldr r0,=7FFh ; 0800FC68 4020 and r0,r4 ; 0800FC6A 0080 lsl r0,r0,2h ;Ensures card_id < 2048 0800FC6C 4908 ldr r1,=8832B84h ; 0800FC6E 1840 add r0,r0,r1 ;r0 = 0x8832B84 + ((card_ID & 0x7FF) << 2) 0800FC70 6800 ldr r0,[r0] ;r0 = [compressed_card_data_array] 0800FC72 21F8 mov r1,0F8h ; 0800FC74 0449 lsl r1,r1,11h ; 0800FC76 4008 and r0,r1 ;r0 &= 0x1F00000 0800FC78 0D00 lsr r0,r0,14h ;r0 >> 20 0800FC7A 2815 cmp r0,15h ; 0800FC7C DB0F blt 800FC9Eh ;if (card_type < 0x15 [is a monster card]), branch to 0x800FC9E 0800FC7E 2817 cmp r0,17h ; 0800FC80 DD08 ble 800FC94h ;if (card_type ≤ 0x17 [is not a monster card]), branch to 0x800FC94 0800FC82 2818 cmp r0,18h ; 0800FC84 D008 beq 800FC98h ;if (card_type == DIVINE_BEAST), branch to 0x800FC98 0800FC86 E00A b 800FC9Eh ;else branch to 0x800FC9E (default for Monster cards) 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 ;if (card_type ≤ 0x17 [is not a monster card]), ATK = 0 0800FC96 E00D b 800FCB4h ;branch to 0x800FCB4 (store 0 into [0x02013E2C]) 0800FC98 20FA mov r0,0FAh ;if (card_type == DIVINE_BEAST) ... 0800FC9A 0100 lsl r0,r0,4h ;ATK = 4000 0800FC9C E00A b 800FCB4h ;branch to 0x800FCB4 (store 4000 into [0x02013E2C]) 0800FC9E 480F ldr r0,=7FFh ;if (card_type < 0x15 [is a monster card]) 0800FCA0 4020 and r0,r4 ;Ensures card_id < 2048 0800FCA2 0080 lsl r0,r0,2h ;r0 = (card_id & 0x7FF) << 2 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 [0x02013E2C] 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 (card_type < 0x15), branch to 0x800FCF2 0800FCD0 2817 cmp r0,17h ; 0800FCD2 DD09 ble 800FCE8h ;if (card_type ≤ 0x17), branch to 0x800FCE8 0800FCD4 2818 cmp r0,18h ; 0800FCD6 D009 beq 800FCECh ;if (card_type == DIVINE_BEAST), branch to 0x800FCEC 0800FCD8 E00B b 800FCF2h ;else branch to 0x800FCF2 (default for Monster cards) 0800FCDA 0000 lsl r0,r0,0h ;
Trunk management
Count quantity of cards in Player's Trunk, Deck and Sideboard
0x8AA94 - Loops through Player's inventory to count cards in Player's Trunk, Deck, and Sideboard
0808AA94 21D4 mov r1,0D4h ; 0808AA96 0000 lsl r0,r0,0h ; 0808AA98 FBC1 bl lr+782h ; 0808AA9A 0000 lsl r0,r0,0h ; 0808AA9C 10ED asr r5,r5,3h ; 0808AA9E 0000 lsl r0,r0,0h ; 0808AAA0 21DE mov r1,0DEh ; 0808AAA2 0000 lsl r0,r0,0h ; 0808AAA4 2000 mov r0,0h ; 0808AAA6 BC70 pop r4-r6 ; 0808AAA8 BC02 pop r1 ; 0808AAAA 4708 bx r1 ; 0808AAAC B570 push r4-r6,r14 ; 0808AAAE 2300 mov r3,0h ; 0808AAB0 490C ldr r1,=2011C20h ;r1 = pointer to Player's Trunk 0808AAB2 2200 mov r2,0h ;r2 = 0 0808AAB4 1C0D mov r5,r1 ;r5 = pointer to Player's Trunk 0808AAB6 4C0C ldr r4,=10EDh ;r4 = 4333 0808AAB8 880E ldrh r6,[r1] ;start of the loop, load card_quantity for current card pointed by r1 in r6 0808AABA 18F0 add r0,r6,r3 ;r0 = card_quantity + r3 0808AABC 0400 lsl r0,r0,10h ; 0808AABE 0C03 lsr r3,r0,10h ;r3 = current_card_quantity & 0xFFFF 0808AAC0 3102 add r1,2h ;pointer_to_card_trunk += 2 0808AAC2 1C50 add r0,r2,1 ;r0 = current_card_id 0808AAC4 0400 lsl r0,r0,10h ;r0 << 16 0808AAC6 0C02 lsr r2,r0,10h ;r2 = r0 & 0xFFFF 0808AAC8 42A2 cmp r2,r4 ; 0808AACA D9F5 bls 808AAB8h ;if (r2 ≤ 4333 [it's the 1082 valid cards + card_id #0 multiplied by 4 + 1]), loop to 0x808AAB8 0808AACC 43D8 mvn r0,r3 ;r0 = !r3 0808AACE 3001 add r0,1h ;r0++ 0808AAD0 4A06 ldr r2,=21DEh ;r2 = 8670 [it's the 1082 valid cards + card_id #0 multiplied by 8 + an offset of 6 for idk which reason yet] 0808AAD2 18A9 add r1,r5,r2 ;r1 = pointer to Player's Trunk + 8670 0808AAD4 8008 strh r0,[r1] ;r0 = [r1] 0808AAD6 4E06 ldr r6,=21D4h ; 0808AAD8 19A9 add r1,r5,r6 ; 0808AADA 4806 ldr r0,=0FBC1h ; 0808AADC 8008 strh r0,[r1] ; 0808AADE BC70 pop r4-r6 ; 0808AAE0 BC01 pop r0 ; 0808AAE2 4700 bx r0 ;
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 ;r4 = 0x2011C20 + (card_id << 2) 0808AF2C 8922 ldrh r2,[r4,8h] ;r2 = old card quantity 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 ;1024 is the maximum quantity for a given card 0808AF42 4010 and r0,r2 ;r2 is old card quantity 0808AF44 4308 orr r0,r1 ;r1 is new card quantity 0808AF46 8120 strh r0,[r4,8h] ;Store new card quantity in [r4 + 8] 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/DEF stats - there's a workaround to display the 4000/4000 stats from the Display ATK and DEF subroutines) 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
Internal Data for Yu-Gi-Oh! Worldwide Edition: Stairway to the Destined Duel
| |
---|---|