If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working soon.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
Yu-Gi-Oh! Dark Duel Stories/ROM map: Difference between revisions
Jump to navigation
Jump to search
Mantidactyle (talk | contribs) |
Mantidactyle (talk | contribs) |
||
(61 intermediate revisions by 2 users not shown) | |||
Line 3,067: | Line 3,067: | ||
ROM0:114A C9 ret | ROM0:114A C9 ret | ||
* <code>0x114B-0x1157</code> - Loops until | * <code>0x114B-0x1157</code> - Loops until <code>wC5AC</code> is non-zero. It hangs the program until the graphics on screen are updated. <code>wC5AC</code> is set to 1 during an interrupt. | ||
ROM0:114B F5 push af | ROM0:114B F5 push af | ||
ROM0:114C AF xor a | ROM0:114C AF xor a | ||
ROM0:114D EA AC C5 ld (C5AC),a ; | ROM0:114D EA AC C5 ld (C5AC),a ;game_finished_loading_graphics = false | ||
ROM0:1150 FA AC C5 ld a,(C5AC) ; | ROM0:1150 FA AC C5 ld a,(C5AC) ;a = game_finished_loading_graphics | ||
ROM0:1153 B7 or a | ROM0:1153 B7 or a | ||
ROM0:1154 28 FA jr z,1150 ;Loops until | ROM0:1154 28 FA jr z,1150 ;Loops until game_finished_loading_graphics == true | ||
ROM0:1156 F1 pop af | ROM0:1156 F1 pop af | ||
ROM0:1157 C9 ret | ROM0:1157 C9 ret | ||
Line 3,900: | Line 3,900: | ||
ROM0:168C C1 pop bc | ROM0:168C C1 pop bc | ||
ROM0:168D C9 ret | ROM0:168D C9 ret | ||
===0:1798=== | |||
ROM0:1798 F5 push af | |||
ROM0:1799 C5 push bc | |||
ROM0:179A E5 push hl | |||
ROM0:179B FA 00 40 ld a,(4000) ;ROM Bank | |||
ROM0:179E F5 push af | |||
ROM0:179F CD AA 17 call 17AA ;Display 2 ? | |||
ROM0:17A2 F1 pop af | |||
ROM0:17A3 CD 00 12 [[#ROM Bank switch|call 1200 ;ROM Bank switch]] | |||
ROM0:17A6 E1 pop hl | |||
ROM0:17A7 C1 pop bc | |||
ROM0:17A8 F1 pop af | |||
ROM0:17A9 C9 ret | |||
===Display 2=== | ===Display 2=== | ||
Line 3,930: | Line 3,944: | ||
ROM0:17D3 D5 push de | ROM0:17D3 D5 push de | ||
ROM0:17D4 E9 jp hl | ROM0:17D4 E9 jp hl | ||
ROM0:17D5 CD 6E 18 call 186E | ROM0:17D5 CD 6E 18 call 186E ;Set hFF80-hFF81 to bc | ||
ROM0:17D8 E1 pop hl | ROM0:17D8 E1 pop hl | ||
ROM0:17D9 23 inc hl | ROM0:17D9 23 inc hl | ||
Line 3,938: | Line 3,952: | ||
ROM0:17DD 2A ldi a,(hl) | ROM0:17DD 2A ldi a,(hl) | ||
ROM0:17DE 47 ld b,a | ROM0:17DE 47 ld b,a | ||
ROM0:17DF CD 77 18 call 1877 | ROM0:17DF CD 77 18 call 1877 ;Set hFF82-hFF83 to bc | ||
ROM0:17E2 7A ld a,d | ROM0:17E2 7A ld a,d | ||
ROM0:17E3 CD 00 12 [[#ROM Bank switch|call 1200 ;ROM Bank switch]] | ROM0:17E3 CD 00 12 [[#ROM Bank switch|call 1200 ;ROM Bank switch]] | ||
Line 3,947: | Line 3,961: | ||
ROM0:17EC F1 pop af | ROM0:17EC F1 pop af | ||
ROM0:17ED C9 ret | ROM0:17ED C9 ret | ||
====Pointer array used by 0:17AA==== | |||
ROM0:17EE | |||
08 18 - | |||
0D 18 - | |||
12 18 - | |||
17 18 - | |||
1C 18 - | |||
21 18 - | |||
26 18 - | |||
2B 18 - | |||
30 18 - | |||
35 18 - | |||
3A 18 - | |||
3F 18 - | |||
44 18 - | |||
===0:1849 (0x20s w3:D000-w3:D3DD, and ?)=== | |||
ROM0:1849 F5 push af | |||
ROM0:184A C5 push bc | |||
ROM0:184B D5 push de | |||
ROM0:184C E5 push hl | |||
ROM0:184D 21 00 D0 ld hl,D000 | |||
ROM0:1850 11 01 D0 ld de,D001 | |||
ROM0:1853 36 20 ld (hl),20 ;0x20s w3:D000-w3:D3DD | |||
ROM0:1855 01 DD 03 ld bc,03DD | |||
ROM0:1858 2A ldi a,(hl) | |||
ROM0:1859 12 ld (de),a | |||
ROM0:185A 13 inc de | |||
ROM0:185B 0D dec c | |||
ROM0:185C 20 FA jr nz,1858 | |||
ROM0:185E 0E 00 ld c,00 | |||
ROM0:1860 2A ldi a,(hl) | |||
ROM0:1861 12 ld (de),a | |||
ROM0:1862 13 inc de | |||
ROM0:1863 0D dec c | |||
ROM0:1864 20 FA jr nz,1860 | |||
ROM0:1866 05 dec b | |||
ROM0:1867 20 F5 jr nz,185E | |||
ROM0:1869 E1 pop hl | |||
ROM0:186A D1 pop de | |||
ROM0:186B C1 pop bc | |||
ROM0:186C F1 pop af | |||
ROM0:186D C9 ret | |||
===0:186E (hFF80-hFF81 = bc)=== | |||
ROM0:186E F5 push af | |||
ROM0:186F 79 ld a,c | |||
ROM0:1870 E0 80 ld (ff00+80),a | |||
ROM0:1872 78 ld a,b | |||
ROM0:1873 E0 81 ld (ff00+81),a | |||
ROM0:1875 F1 pop af | |||
ROM0:1876 C9 ret | |||
===0:1877 (hFF82-hFF83 = bc)=== | |||
ROM0:1877 F5 push af | |||
ROM0:1878 79 ld a,c | |||
ROM0:1879 E0 82 ld (ff00+82),a | |||
ROM0:187B 78 ld a,b | |||
ROM0:187C E0 83 ld (ff00+83),a | |||
ROM0:187E F1 pop af | |||
ROM0:187F C9 ret | |||
===0:1880=== | ===0:1880=== | ||
Line 4,016: | Line 4,092: | ||
ROM0:18EC C1 pop bc | ROM0:18EC C1 pop bc | ||
ROM0:18ED F1 pop af | ROM0:18ED F1 pop af | ||
ROM0:18EE C9 ret | ROM0:18EE C9 ret | ||
===0:18EF ((FF80)++)=== | ===0:18EF ((FF80)++)=== | ||
Line 4,599: | Line 4,675: | ||
ROM0:1D68 C9 ret | ROM0:1D68 C9 ret | ||
=== | ===Initializes Game Link data to 0x80, 00s wC84A-wC84B=== | ||
ROM0:1D69 F5 push af | ROM0:1D69 F5 push af | ||
ROM0:1D6A C5 push bc | ROM0:1D6A C5 push bc | ||
Line 4,629: | Line 4,705: | ||
ROM0:1D90 C9 ret | ROM0:1D90 C9 ret | ||
===0:1D91=== | ===0:1D91 - Send Game Link data=== | ||
ROM0:1D91 F5 push af | ROM0:1D91 F5 push af | ||
ROM0:1D92 C5 push bc | ROM0:1D92 C5 push bc | ||
Line 4,643: | Line 4,719: | ||
ROM0:1DA5 C1 pop bc | ROM0:1DA5 C1 pop bc | ||
ROM0:1DA6 F1 pop af | ROM0:1DA6 F1 pop af | ||
ROM0:1DA7 C9 ret | ROM0:1DA7 C9 ret | ||
===0:1DA8=== | ===0:1DA8=== | ||
Line 4,679: | Line 4,755: | ||
ROM0:1DD3 C9 ret | ROM0:1DD3 C9 ret | ||
===0:1DD4=== | ===0:1DD4 - Receive Game Link data=== | ||
ROM0:1DD4 C5 push bc | ROM0:1DD4 C5 push bc | ||
ROM0:1DD5 CD E5 1D call 1DE5 | ROM0:1DD5 CD E5 1D call 1DE5 | ||
Line 4,689: | Line 4,765: | ||
ROM0:1DE2 B1 or c | ROM0:1DE2 B1 or c | ||
ROM0:1DE3 C1 pop bc | ROM0:1DE3 C1 pop bc | ||
ROM0:1DE4 C9 ret | ROM0:1DE4 C9 ret | ||
===0:1DE5=== | ===0:1DE5=== | ||
Line 4,989: | Line 5,065: | ||
ROM0:1FDE C9 ret | ROM0:1FDE C9 ret | ||
==== | ====Freeze Card==== | ||
ROM0:1FDF F5 push af | ROM0:1FDF F5 push af | ||
ROM0:1FE0 FA A5 C7 ld a,(C7A5) ;Card Status | ROM0:1FE0 FA A5 C7 ld a,(C7A5) ;Card Status | ||
Line 4,995: | Line 5,071: | ||
ROM0:1FE5 EA A5 C7 ld (C7A5),a | ROM0:1FE5 EA A5 C7 ld (C7A5),a | ||
ROM0:1FE8 F1 pop af | ROM0:1FE8 F1 pop af | ||
ROM0:1FE9 C9 ret | ROM0:1FE9 C9 ret | ||
==== | ====Unfreeze Card==== | ||
* <code>0x1FEA-0x1FF4</code> - Unfreezes card. | * <code>0x1FEA-0x1FF4</code> - Unfreezes card. | ||
ROM0:1FEA F5 push af | ROM0:1FEA F5 push af | ||
Line 5,004: | Line 5,080: | ||
ROM0:1FF0 EA A5 C7 ld (C7A5),a | ROM0:1FF0 EA A5 C7 ld (C7A5),a | ||
ROM0:1FF3 F1 pop af | ROM0:1FF3 F1 pop af | ||
ROM0:1FF4 C9 ret | ROM0:1FF4 C9 ret | ||
====Card stolen for a turn==== | ====Card stolen for a turn==== | ||
Line 5,059: | Line 5,135: | ||
ROM0:203E C9 ret | ROM0:203E C9 ret | ||
====Retrieves owner, card | ====Retrieves owner, card existence and Frozen status==== | ||
ROM0:203F FA A5 C7 ld a,(C7A5) ;Card Status | ROM0:203F FA A5 C7 ld a,(C7A5) ;Card Status | ||
ROM0:2042 E6 07 and a,07 | ROM0:2042 E6 07 and a,07 | ||
Line 5,267: | Line 5,343: | ||
ROM0:21AC 47 ld b,a | ROM0:21AC 47 ld b,a | ||
ROM0:21AD CF rst 08 ;(returns ROM Bank for Fusion data in accumulator) | ROM0:21AD CF rst 08 ;(returns ROM Bank for Fusion data in accumulator) | ||
=> 09 0F | |||
ROM0:21B0 EA 85 C8 ld (C885),a ;Stores ROM Bank for Fusion data in (C885) | ROM0:21B0 EA 85 C8 ld (C885),a ;Stores ROM Bank for Fusion data in (C885) | ||
ROM0:21B3 CF rst 08 ;(returns Fusion Material pointer in accumulator) | ROM0:21B3 CF rst 08 ;(returns Fusion Material pointer in accumulator) | ||
=> 0B 0F | |||
ROM0:21B6 79 ld a,c | ROM0:21B6 79 ld a,c | ||
ROM0:21B7 EA 87 C8 ld (C887),a ;Stores Fusion Material pointer in (C887) | ROM0:21B7 EA 87 C8 ld (C887),a ;Stores Fusion Material pointer in (C887) | ||
Line 5,282: | Line 5,358: | ||
ROM0:21C9 47 ld b,a | ROM0:21C9 47 ld b,a | ||
ROM0:21CA CF rst 08 ;(returns second ROM Bank for Fusion data in accumulator) | ROM0:21CA CF rst 08 ;(returns second ROM Bank for Fusion data in accumulator) | ||
=> 09 0F | |||
ROM0:21CD EA 86 C8 ld (C886),a ;Stores second ROM Bank for Fusion data in (C886) | ROM0:21CD EA 86 C8 ld (C886),a ;Stores second ROM Bank for Fusion data in (C886) | ||
ROM0:21D0 CF rst 08 ;(returns second Fusion Material pointer in accumulator) | ROM0:21D0 CF rst 08 ;(returns second Fusion Material pointer in accumulator) | ||
=> 0B 0F | |||
ROM0:21D3 79 ld a,c | ROM0:21D3 79 ld a,c | ||
ROM0:21D4 EA 89 C8 ld (C889),a ;Stores second Fusion Material pointer in (C889) | ROM0:21D4 EA 89 C8 ld (C889),a ;Stores second Fusion Material pointer in (C889) | ||
Line 5,651: | Line 5,726: | ||
ROM0:2533 C9 ret | ROM0:2533 C9 ret | ||
=== | ===Starter deck management=== | ||
====Starter deck | ====Copy Starter deck==== | ||
*<code>0x2534</code> - | *<code>0x2534</code> - Retrieve the 40 cards in the Starter deck after starting a new game | ||
ROM0:2534 F5 push af | ROM0:2534 F5 push af | ||
ROM0:2535 C5 push bc | ROM0:2535 C5 push bc | ||
ROM0:2536 D5 push de | ROM0:2536 D5 push de | ||
ROM0:2537 E5 push hl | ROM0:2537 E5 push hl | ||
ROM0:2538 21 5D 25 ld hl,255D | ROM0:2538 21 5D 25 ld hl,255D ;Starter deck pointer | ||
ROM0:253B 1E 00 ld e,00 | ROM0:253B 1E 00 ld e,00 | ||
ROM0:253D 7B ld a,e | ROM0:253D 7B ld a,e ;Set number of cards copied to 0 | ||
ROM0:253E FE 28 cp a,28 | ROM0:253E FE 28 cp a,28 | ||
ROM0:2540 30 16 jr nc,2558 | ROM0:2540 30 16 jr nc,2558 ;if less than 40 cards have been copied to the deck, exit this function | ||
ROM0:2542 CF rst 08 | ROM0:2542 CF rst 08 | ||
=> 2D 01 | |||
ROM0:2545 2A ldi a,(hl) | |||
ROM0:2547 2A ldi a,(hl) | ROM0:2546 4F ld c,a | ||
ROM0:2548 47 ld b,a | ROM0:2547 2A ldi a,(hl) | ||
ROM0:2548 47 ld b,a ;bc = current_card_id | |||
ROM0:2549 CF rst 08 | ROM0:2549 CF rst 08 | ||
=> 2F 01 | |||
ROM0:254C CF rst 08 | |||
=> 9B 01 | |||
ROM0:254F CF rst 08 | |||
=> 0B 01 | |||
ROM0:2552 CF rst 08 | |||
=> 17 01 | |||
ROM0:2555 1C inc e | |||
ROM0:2556 18 E5 jr 253D | |||
ROM0:2558 E1 pop hl | ROM0:2558 E1 pop hl | ||
ROM0:2559 D1 pop de | ROM0:2559 D1 pop de | ||
Line 5,729: | Line 5,812: | ||
ROM0:26B7 7A ld a,d | ROM0:26B7 7A ld a,d | ||
ROM0:26B8 CD 00 12 [[#ROM_Bank_switch|call 1200 ;ROM Bank switch to 0x24 or 0x25]] | ROM0:26B8 CD 00 12 [[#ROM_Bank_switch|call 1200 ;ROM Bank switch to 0x24 or 0x25]] | ||
ROM0:26BB CD E7 23 [[# | ROM0:26BB CD E7 23 [[#Determines_which_card_to_give_after_a_duel|call 23E7 ;Determine which card to give after a duel]] | ||
ROM0:26BE F1 pop af | ROM0:26BE F1 pop af | ||
ROM0:26BF CD 00 12 [[#ROM_Bank_switch|call 1200 ;ROM Bank switch]] | ROM0:26BF CD 00 12 [[#ROM_Bank_switch|call 1200 ;ROM Bank switch]] | ||
Line 5,737: | Line 5,820: | ||
ROM0:26C5 C9 ret | ROM0:26C5 C9 ret | ||
=== | ===Duel Records=== | ||
====Initialize Duel Records==== | ====Initialize Duel Records==== | ||
* <code>0x26C6-0x26EB</code> - Sets Duel Records to either 00s or to values at <code>0x276E</code> if Debug is enabled | * <code>0x26C6-0x26EB</code> - Sets Duel Records to either 00s or to values at <code>0x276E</code> if Debug is enabled | ||
Line 5,792: | Line 5,875: | ||
====Debug Duel Records and Wins==== | ====Debug Duel Records and Wins==== | ||
* <code>0x276E-0x27C5</code> - Debug Initial Duel Records. 9 wins against almost every opponent, 4 wins against DarkNite. | * <code>0x276E-0x27C5</code> - Debug Initial Duel Records. 9 wins against almost every opponent, 4 wins against DarkNite. | ||
====Check if 5 wins or more against CPU opponent==== | |||
<code>0x27DB-0x27F9</code> | |||
* Argument: | |||
** a = cpu_opponent_id | |||
* Return value: | |||
** a = 0 if less than 5 wins | |||
** a = 1 if 5 wins or more | |||
ROM0:27DB C5 push bc | |||
ROM0:27DC D5 push de | |||
ROM0:27DD E5 push hl | |||
ROM0:27DE 1E 01 ld e,01 ;e = 1 | |||
ROM0:27E0 06 00 ld b,00 | |||
ROM0:27E2 4F ld c,a | |||
ROM0:27E3 CB 21 sla c ;c = cpu_opponent_id << 1 | |||
ROM0:27E5 21 3E C9 ld hl,C93E ;Duel Records (wins) | |||
ROM0:27E8 09 add hl,bc | |||
ROM0:27E9 2A ldi a,(hl) | |||
ROM0:27EA FE 05 cp a,05 | |||
ROM0:27EC 30 07 jr nc,27F5 ;if last byte of DarkNite wins > 5, jump to 0:27F5 | |||
ROM0:27EE 7E ld a,(hl) | |||
ROM0:27EF FE 00 cp a,00 | |||
ROM0:27F1 20 02 jr nz,27F5 ;if DarkNite wins > 255, jump to 0:27F5 | |||
ROM0:27F3 1E 00 ld e,00 ;else e = 0 | |||
ROM0:27F5 7B ld a,e | |||
ROM0:27F6 E1 pop hl | |||
ROM0:27F7 D1 pop de | |||
ROM0:27F8 C1 pop bc | |||
ROM0:27F9 C9 ret | |||
====Check which Stages the player is allowed to access==== | |||
ROM0:28C5 D5 push de | |||
ROM0:28C6 1E 00 ld e,00 | |||
ROM0:28C8 CD EF 28 [[#Check if Stage 1 opponents have been defeated 5 or more times|call 28EF ;Check if Stage 1 opponents have been defeated 5 or more times]] | |||
ROM0:28CB FE 00 cp a,00 | |||
ROM0:28CD 28 1D jr z,28EC | |||
ROM0:28CF 1E 01 ld e,01 | |||
ROM0:28D1 CD 10 29 [[#Check if Stage 2 opponents have been defeated 5 or more times|call 2910 ;Check if Stage 2 opponents have been defeated 5 or more times]] | |||
ROM0:28D4 FE 00 cp a,00 | |||
ROM0:28D6 28 14 jr z,28EC | |||
ROM0:28D8 1E 02 ld e,02 | |||
ROM0:28DA CD 32 29 [[#Check if Stage 3 opponents have been defeated 5 or more times|call 2932 ;Check if Stage 3 opponents have been defeated 5 or more times]] | |||
ROM0:28DD FE 00 cp a,00 | |||
ROM0:28DF 28 0B jr z,28EC | |||
ROM0:28E1 1E 03 ld e,03 | |||
ROM0:28E3 CD 52 29 [[#Check if Darknite has been defeated 5 or more times|call 2952 ;Check if Darknite has been defeated 5 or more times]] | |||
ROM0:28E6 FE 00 cp a,00 | |||
ROM0:28E8 28 02 jr z,28EC | |||
ROM0:28EA 1E 04 ld e,04 | |||
ROM0:28EC 7B ld a,e | |||
ROM0:28ED D1 pop de | |||
ROM0:28EE C9 ret | |||
====Check if Stage 1 opponents have been defeated 5 or more times==== | |||
ROM0:28EF C5 push bc | |||
ROM0:28F0 D5 push de | |||
ROM0:28F1 E5 push hl | |||
ROM0:28F2 1E 01 ld e,01 | |||
ROM0:28F4 21 0B 29 ld hl,290B ;Array of Stage 1 opponents | |||
ROM0:28F7 0E 05 ld c,05 | |||
ROM0:28F9 2A ldi a,(hl) | |||
ROM0:28FA CD DB 27 [[#Check_if_5_wins_or_more_against_CPU_opponent|call 27DB ;Check if 5 wins or more against CPU opponent]] | |||
ROM0:28FD FE 00 cp a,00 | |||
ROM0:28FF 20 02 jr nz,2903 | |||
ROM0:2901 1E 00 ld e,00 | |||
ROM0:2903 0D dec c | |||
ROM0:2904 20 F3 jr nz,28F9 ;Loop 5 times | |||
ROM0:2906 7B ld a,e | |||
ROM0:2907 E1 pop hl | |||
ROM0:2908 D1 pop de | |||
ROM0:2909 C1 pop bc | |||
ROM0:290A C9 ret | |||
=====Array of Stage 1 opponents===== | |||
ROM0:290B | |||
0A 05 03 01 07 | |||
Tristan Taylor | |||
Yugi Muto | |||
Mako Tsunami | |||
Mai Valentine | |||
Joey Wheeler | |||
====Check if Stage 2 opponents have been defeated 5 or more times==== | |||
ROM0:2910 C5 push bc | |||
ROM0:2911 D5 push de | |||
ROM0:2912 E5 push hl | |||
ROM0:2913 1E 01 ld e,01 | |||
ROM0:2915 21 2C 29 ld hl,292C ;Array of Stage 2 opponents | |||
ROM0:2918 0E 06 ld c,06 | |||
ROM0:291A 2A ldi a,(hl) | |||
ROM0:291B CD DB 27 [[#Check_if_5_wins_or_more_against_CPU_opponent|call 27DB ;Check if 5 wins or more against CPU opponent]] | |||
ROM0:291E FE 00 cp a,00 | |||
ROM0:2920 20 02 jr nz,2924 | |||
ROM0:2922 1E 00 ld e,00 | |||
ROM0:2924 0D dec c | |||
ROM0:2925 20 F3 jr nz,291A ;Loop 6 times | |||
ROM0:2927 7B ld a,e | |||
ROM0:2928 E1 pop hl | |||
ROM0:2929 D1 pop de | |||
ROM0:292A C1 pop bc | |||
ROM0:292B C9 ret | |||
=====Array of Stage 2 opponents===== | |||
ROM0:292C | |||
09 02 00 0B 0C 08 | |||
Espa Roba | |||
Rex Raptor | |||
Weevil Underwood | |||
Rare Hunter | |||
Pandora | |||
Seto Kaiba | |||
====Check if Stage 3 opponents have been defeated 5 or more times==== | |||
ROM0:2932 C5 push bc | |||
ROM0:2933 D5 push de | |||
ROM0:2934 E5 push hl | |||
ROM0:2935 1E 01 ld e,01 | |||
ROM0:2937 21 4E 29 ld hl,294E ;Array of Stage 3 opponents | |||
ROM0:293A 0E 04 ld c,04 | |||
ROM0:293C 2A ldi a,(hl) | |||
ROM0:293D CD DB 27 [[#Check_if_5_wins_or_more_against_CPU_opponent|call 27DB ;Check if 5 wins or more against CPU opponent]] | |||
ROM0:2940 FE 00 cp a,00 | |||
ROM0:2942 20 02 jr nz,2946 | |||
ROM0:2944 1E 00 ld e,00 | |||
ROM0:2946 0D dec c | |||
ROM0:2947 20 F3 jr nz,293C ;Loop 4 times | |||
ROM0:2949 7B ld a,e | |||
ROM0:294A E1 pop hl | |||
ROM0:294B D1 pop de | |||
ROM0:294C C1 pop bc | |||
ROM0:294D C9 ret | |||
=====Array of Stage 3 opponents===== | |||
ROM0:294E | |||
10 17 0E 0F | |||
Simon Muran | |||
Ishizu Ishtar | |||
Heishin | |||
P. Seto | |||
====Check if Darknite has been defeated 5 or more times==== | |||
ROM0:2952 C5 push bc | |||
ROM0:2953 D5 push de | |||
ROM0:2954 E5 push hl | |||
ROM0:2955 1E 01 ld e,01 ;e = 1 | |||
ROM0:2957 3E 15 ld a,15 ;DarkNite | |||
ROM0:2959 CD DB 27 [[#Check_if_5_wins_or_more_against_CPU_opponent|call 27DB ;Check if 5 wins or more against CPU opponent]] | |||
ROM0:295C FE 00 cp a,00 | |||
ROM0:295E 20 02 jr nz,2962 ;if DarkNite wins ≥ 5, skip next instruction | |||
ROM0:2960 1E 00 ld e,00 ;e = 0 | |||
ROM0:2962 7B ld a,e ;''(most of the accumulator and reg e assignments could be safely removed in this subroutine)'' | |||
ROM0:2963 E1 pop hl | |||
ROM0:2964 D1 pop de | |||
ROM0:2965 C1 pop bc | |||
ROM0:2966 C9 ret | |||
===0:2967=== | |||
ROM0:2967 F5 push af | |||
ROM0:2968 C5 push bc | |||
ROM0:2969 FA 00 40 ld a,(4000) ;ROM Bank | |||
ROM0:296C F5 push af | |||
ROM0:296D 3E 3E ld a,3E | |||
ROM0:296F CD 00 12 [[#ROM Bank switch|call 1200 ;ROM Bank switch]] | |||
ROM0:2972 CD 7C 29 call 297C | |||
ROM0:2975 F1 pop af | |||
ROM0:2976 CD 00 12 call 1200 | |||
ROM0:2979 C1 pop bc | |||
ROM0:297A F1 pop af | |||
ROM0:297B C9 ret | |||
===0:297C=== | |||
ROM0:297C F5 push af | |||
ROM0:297D C5 push bc | |||
ROM0:297E D5 push de | |||
ROM0:297F E5 push hl | |||
ROM0:2980 FA B3 C6 ld a,(C6B3) | |||
ROM0:2983 4F ld c,a | |||
ROM0:2984 FA B4 C6 ld a,(C6B4) | |||
ROM0:2987 47 ld b,a ;bc = current_card_id | |||
ROM0:2988 CD 5B 68 call 685B | |||
ROM0:298B 7A ld a,d | |||
ROM0:298C CD 00 12 [[#ROM Bank switch|call 1200 ;ROM Bank switch]] | |||
ROM0:298F 50 ld d,b | |||
ROM0:2990 59 ld e,c | |||
ROM0:2991 21 A1 D1 ld hl,D1A1 | |||
ROM0:2994 CF rst 08 | |||
=> 0D 08 | |||
ROM0:2997 0E 12 ld c,12 | |||
ROM0:2999 1A ld a,(de) | |||
ROM0:299A 13 inc de | |||
ROM0:299B CF rst 08 | |||
=> 0F 08 | |||
ROM0:299E E5 push hl | |||
ROM0:299F C5 push bc | |||
ROM0:29A0 01 20 00 ld bc,0020 | |||
ROM0:29A3 09 add hl,bc | |||
ROM0:29A4 FA E7 C5 ld a,(C5E7) | |||
ROM0:29A7 77 ld (hl),a | |||
ROM0:29A8 C1 pop bc | |||
ROM0:29A9 E1 pop hl | |||
ROM0:29AA FA E6 C5 ld a,(C5E6) | |||
ROM0:29AD 22 ldi (hl),a | |||
ROM0:29AE 0D dec c | |||
ROM0:29AF 20 E8 jr nz,2999 | |||
ROM0:29B1 CF rst 08 | |||
=> 11 08 ; to 8:451E - sets wC5E5 to 0 | |||
ROM0:29B4 21 E1 D1 ld hl,D1E1 | |||
ROM0:29B7 0E 12 ld c,12 | |||
ROM0:29B9 1A ld a,(de) | |||
ROM0:29BA 13 inc de | |||
ROM0:29BB CF rst 08 | |||
=> 0F 08 | |||
ROM0:29BE E5 push hl | |||
ROM0:29BF C5 push bc | |||
ROM0:29C0 01 20 00 ld bc,0020 | |||
ROM0:29C3 09 add hl,bc | |||
ROM0:29C4 FA E7 C5 ld a,(C5E7) | |||
ROM0:29C7 77 ld (hl),a | |||
ROM0:29C8 C1 pop bc | |||
ROM0:29C9 E1 pop hl | |||
ROM0:29CA FA E6 C5 ld a,(C5E6) | |||
ROM0:29CD 22 ldi (hl),a | |||
ROM0:29CE 0D dec c | |||
ROM0:29CF 20 E8 jr nz,29B9 | |||
ROM0:29D1 E1 pop hl | |||
ROM0:29D2 D1 pop de | |||
ROM0:29D3 C1 pop bc | |||
ROM0:29D4 F1 pop af | |||
ROM0:29D5 C9 ret | |||
===Music tracks management=== | ===Music tracks management=== | ||
Line 5,922: | Line 6,237: | ||
* <code>0x2A79-0x2B50</code> - Calls <code>0:2BFC</code> with accumulator as a parameter, or calls <code>0x2B51</code> to return | * <code>0x2A79-0x2B50</code> - Calls <code>0:2BFC</code> with accumulator as a parameter, or calls <code>0x2B51</code> to return | ||
==== | ====SE: Return to previous screen==== | ||
ROM0:2A79 F5 push af | ROM0:2A79 F5 push af | ||
ROM0:2A7A 3E 06 ld a,06 | ROM0:2A7A 3E 06 ld a,06 | ||
Line 5,957: | Line 6,272: | ||
ROM0:2AA0 C9 ret | ROM0:2AA0 C9 ret | ||
====0:2AA1==== | ====0:2AA1 (SE: Cursor, not sure where)==== | ||
ROM0:2AA1 F5 push af | ROM0:2AA1 F5 push af | ||
ROM0:2AA2 3E 02 ld a,02 | ROM0:2AA2 3E 02 ld a,02 | ||
ROM0:2AA4 CD FC 2B [[#Loads_Sound_Effect_Bank_and_pointer|call 2BFC ;Loads Sound Effect Bank and pointer]] | ROM0:2AA4 CD FC 2B [[#Loads_Sound_Effect_Bank_and_pointer|call 2BFC ;Loads Sound Effect Bank and pointer]] | ||
ROM0:2AA7 F1 pop af | ROM0:2AA7 F1 pop af | ||
ROM0:2AA8 C9 ret | ROM0:2AA8 C9 ret | ||
====SE: Set Trap card / Failed Fusion==== | ====SE: Set Trap card / Failed Fusion==== | ||
Line 6,312: | Line 6,627: | ||
ROM0:2C99 C9 ret | ROM0:2C99 C9 ret | ||
=====Check | =====Check Player's SoRL counter===== | ||
* <code>0x2C9A- | * <code>0x2C9A-0x2CA9</code> - Checks Player's Swords of Revealing Light counter | ||
ROM0:2C9A C5 push bc ;Is Player restrained by SoRL ? | ROM0:2C9A C5 push bc ;Is Player restrained by SoRL ? | ||
ROM0:2C9B E5 push hl | ROM0:2C9B E5 push hl | ||
Line 6,321: | Line 6,636: | ||
ROM0:2CA2 21 BA 2C ld hl,2CBA | ROM0:2CA2 21 BA 2C ld hl,2CBA | ||
ROM0:2CA5 09 add hl,bc | ROM0:2CA5 09 add hl,bc | ||
ROM0:2CA6 7E ld a,(hl) ;Loads corresponding value from the "can the monster attack ?" list at | ROM0:2CA6 7E ld a,(hl) ;Loads corresponding value from the "can the monster attack ?" list at 0:2CBA | ||
ROM0:2CA7 E1 pop hl | ROM0:2CA7 E1 pop hl | ||
ROM0:2CA8 C1 pop bc | ROM0:2CA8 C1 pop bc | ||
ROM0:2CA9 C9 ret | ROM0:2CA9 C9 ret | ||
=====Check CPU's SoRL counter===== | |||
* <code>0x2CAA-0x2CB9</code> - Checks CPU's Swords of Revealing Light counter | |||
ROM0:2CAA C5 push bc ;Is CPU restrained by SoRL ? | ROM0:2CAA C5 push bc ;Is CPU restrained by SoRL ? | ||
ROM0:2CAB E5 push hl | ROM0:2CAB E5 push hl | ||
Line 6,335: | Line 6,653: | ||
ROM0:2CB7 E1 pop hl | ROM0:2CB7 E1 pop hl | ||
ROM0:2CB8 C1 pop bc | ROM0:2CB8 C1 pop bc | ||
ROM0:2CB9 C9 ret | ROM0:2CB9 C9 ret | ||
* <code>0x2CBA-0x2CBE</code> - "Can the monster attack ?" list, depending on Swords of Revealing Light current counter | * <code>0x2CBA-0x2CBE</code> - "Can the monster attack ?" list, depending on Swords of Revealing Light current counter | ||
Line 6,355: | Line 6,673: | ||
ROM0:2CD1 3E 01 ld a,01 ;If SoRL has just ended | ROM0:2CD1 3E 01 ld a,01 ;If SoRL has just ended | ||
ROM0:2CD3 CF rst 08 ;Displays « Swords of Revealing Light has stopped » in another function | ROM0:2CD3 CF rst 08 ;Displays « Swords of Revealing Light has stopped » in another function | ||
=> 27 05 | |||
ROM0:2CD6 F1 pop af | ROM0:2CD6 F1 pop af | ||
ROM0:2CD7 C9 ret | ROM0:2CD7 C9 ret | ||
Line 9,836: | Line 10,153: | ||
ROM2:72F7 C9 ret | ROM2:72F7 C9 ret | ||
====Text: Tea - Trade | ====Text: Tea - Trade Complete, COMM Fusion==== | ||
ROM2:72F8 F5 push af | ROM2:72F8 F5 push af | ||
ROM2:72F9 C5 push bc | ROM2:72F9 C5 push bc | ||
Line 10,960: | Line 11,277: | ||
ROM3:4DF1 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ROM3:4DF1 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ||
ROM3:4DF4 CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ROM3:4DF4 CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ||
ROM3:4DF7 CD DF 1F [[# | ROM3:4DF7 CD DF 1F [[#Freeze_Card|call 1FDF ;Freeze Attacking Monster]] | ||
ROM3:4DFA CD 12 50 call 5012 ;Loads attacking monster ID, rst 08 and does stuff to document | ROM3:4DFA CD 12 50 call 5012 ;Loads attacking monster ID, rst 08 and does stuff to document | ||
ROM3:4DFD CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM3:4DFD CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
Line 10,979: | Line 11,296: | ||
ROM3:4E20 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ROM3:4E20 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ||
ROM3:4E23 CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ROM3:4E23 CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ||
ROM3:4E26 CD DF 1F [[# | ROM3:4E26 CD DF 1F [[#Freeze_Card|call 1FDF ;Freeze Attacking Monster]] | ||
ROM3:4E29 CD 12 50 call 5012 ;Loads attacking monster ID, rst 08 and does stuff to document | ROM3:4E29 CD 12 50 call 5012 ;Loads attacking monster ID, rst 08 and does stuff to document | ||
ROM3:4E2C CD FB 19 [[#Battle_Process_1|call 19FB]] | ROM3:4E2C CD FB 19 [[#Battle_Process_1|call 19FB]] | ||
Line 11,037: | Line 11,354: | ||
ROM3:4F32 C1 pop bc | ROM3:4F32 C1 pop bc | ||
====Freeze | ====Freeze card in Hand==== | ||
ROM3:4FEC F5 push af | ROM3:4FEC F5 push af | ||
ROM3:4FED C5 push bc | ROM3:4FED C5 push bc | ||
Line 11,049: | Line 11,366: | ||
ROM3:4FFE FE 00 cp a,00 | ROM3:4FFE FE 00 cp a,00 | ||
ROM3:5000 20 06 jr nz,5008 | ROM3:5000 20 06 jr nz,5008 | ||
ROM3:5002 CD DF 1F [[# | ROM3:5002 CD DF 1F [[#Freeze_Card|call 1FDF ;Freeze card]] | ||
ROM3:5005 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Updates selected card ID and status]] | ROM3:5005 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Updates selected card ID and status]] | ||
ROM3:5008 04 inc b | ROM3:5008 04 inc b | ||
Line 11,058: | Line 11,375: | ||
ROM3:500F C1 pop bc | ROM3:500F C1 pop bc | ||
ROM3:5010 F1 pop af | ROM3:5010 F1 pop af | ||
ROM3:5011 C9 ret | ROM3:5011 C9 ret | ||
====Stores attacking monster ID in bc==== | ====Stores attacking monster ID in bc==== | ||
Line 11,302: | Line 11,619: | ||
ROM3:52AC C1 pop bc | ROM3:52AC C1 pop bc | ||
ROM3:52AD C9 ret | ROM3:52AD C9 ret | ||
===Duel values - send for Game Link=== | |||
ROM3:5535 FA C7 C5 ld a,(C5C7) ;a = P1's Life Points | |||
ROM3:5538 CD 91 1D call 1D91 | |||
ROM3:553B FA C8 C5 ld a,(C5C8) ;a = P1's Life Points | |||
ROM3:553E CD 91 1D call 1D91 | |||
ROM3:5541 FA CA C5 ld a,(C5CA) ;a = P2's Life Points | |||
ROM3:5544 CD 91 1D call 1D91 | |||
ROM3:5547 FA CB C5 ld a,(C5CB) ;a = P2's Life Points | |||
ROM3:554A CD 91 1D call 1D91 | |||
ROM3:554D FA E8 C5 ld a,(C5E8) ;a = [[Yu-Gi-Oh!_Dark_Duel_Stories:Notes#Field_IDs|Field ID]] | |||
ROM3:5550 CD 91 1D call 1D91 | |||
ROM3:5553 FA D1 C8 ld a,(C8D1) ;a = First turn and Duel winner - P1 | |||
ROM3:5556 CD 91 1D call 1D91 | |||
ROM3:5559 FA 97 C9 ld a,(C997) ;a = ? | |||
ROM3:555C CD 91 1D call 1D91 | |||
ROM3:555F FA 98 C9 ld a,(C998) ;a = ? | |||
ROM3:5562 CD 91 1D call 1D91 | |||
ROM3:5565 FA 99 C9 ld a,(C999) ;a = P1's Swords of Revealing Light | |||
ROM3:5568 CD 91 1D call 1D91 | |||
ROM3:556B FA 9A C9 ld a,(C99A) ;a = P2's Swords of Revealing Light | |||
ROM3:556E CD 91 1D call 1D91 | |||
ROM3:5571 FA 55 C7 ld a,(C755) ;a = P1's deck size / cards drawn | |||
ROM3:5574 CD 91 1D call 1D91 | |||
ROM3:5577 F1 pop af | |||
ROM3:5578 C9 ret | |||
===Duel values - receive from Game Link=== | |||
ROM3:5579 F5 push af | |||
ROM3:557A CD D4 1D call 1DD4 | |||
ROM3:557D EA CA C5 ld (C5CA),a ;P2's Life Points | |||
ROM3:5580 CD D4 1D call 1DD4 | |||
ROM3:5583 EA CB C5 ld (C5CB),a ;P2's Life Points | |||
ROM3:5586 CD D4 1D call 1DD4 | |||
ROM3:5589 EA C7 C5 ld (C5C7),a ;P1's Life Points | |||
ROM3:558C CD D4 1D call 1DD4 | |||
ROM3:558F EA C8 C5 ld (C5C8),a ;P1's Life Points | |||
ROM3:5592 CD D4 1D call 1DD4 | |||
ROM3:5595 EA E8 C5 ld (C5E8),a ;[[Yu-Gi-Oh!_Dark_Duel_Stories:Notes#Field_IDs|Field ID]] | |||
ROM3:5598 CD D4 1D call 1DD4 | |||
ROM3:559B EA D2 C8 ld (C8D2),a ;First turn and Duel winner - P2 | |||
ROM3:559E CD D4 1D call 1DD4 | |||
ROM3:55A1 EA 98 C9 ld (C998),a ;? | |||
ROM3:55A4 CD D4 1D call 1DD4 | |||
ROM3:55A7 EA 97 C9 ld (C997),a ;? | |||
ROM3:55AA CD D4 1D call 1DD4 | |||
ROM3:55AD EA 9A C9 ld (C99A),a ;P2's Swords of Revealing Light | |||
ROM3:55B0 CD D4 1D call 1DD4 | |||
ROM3:55B3 EA 99 C9 ld (C999),a ;P1's Swords of Revealing Light | |||
ROM3:55B6 CD D4 1D call 1DD4 | |||
ROM3:55B9 EA AA C6 ld (C6AA),a ;P2's deck size / cards drawn | |||
ROM3:55BC F1 pop af | |||
ROM3:55BD C9 ret | |||
===Damage Calculation=== | ===Damage Calculation=== | ||
Line 11,742: | Line 12,112: | ||
ROM3:5EFA EA A4 C7 ld (C7A4),a ;Copy Fusion Monster ID in (C7A3) (Card being processed) | ROM3:5EFA EA A4 C7 ld (C7A4),a ;Copy Fusion Monster ID in (C7A3) (Card being processed) | ||
ROM3:5EFD CD 25 20 [[#Hide_Player.27s_Card.2C_Level_-1|call 2025 ;Hide Player's Card, reset Level]] | ROM3:5EFD CD 25 20 [[#Hide_Player.27s_Card.2C_Level_-1|call 2025 ;Hide Player's Card, reset Level]] | ||
ROM3:5F00 CD DF 1F [[# | ROM3:5F00 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM3:5F03 CD 12 50 [[#Stores_attacking_monster_ID_in_bc|call 5012 ;Stores monster ID in bc, and reveal monster card]] | ROM3:5F03 CD 12 50 [[#Stores_attacking_monster_ID_in_bc|call 5012 ;Stores monster ID in bc, and reveal monster card]] | ||
ROM3:5F06 CD 2B 1A call 1A2B ;Remove card played from hand ? | ROM3:5F06 CD 2B 1A call 1A2B ;Remove card played from hand ? | ||
Line 11,829: | Line 12,199: | ||
====Summon Monster card from hand==== | ====Summon Monster card from hand==== | ||
ROM3:61CA F5 push af | ROM3:61CA F5 push af | ||
ROM3:61CB CD 42 21 [[#Fusion_subroutine|call 2142 | ROM3:61CB CD 42 21 [[#Fusion_subroutine|call 2142 ;Fusion subroutine]] | ||
ROM3:61CE FE 00 cp a,00 | ROM3:61CE FE 00 cp a,00 | ||
ROM3:61D0 20 05 jr nz,61D7 | ROM3:61D0 20 05 jr nz,61D7 ;if the Fusion failed, jump to 3:61D7 | ||
ROM3:61D2 CD 92 61 call 6192 | ROM3:61D2 CD 92 61 call 6192 | ||
ROM3:61D5 18 0F jr 61E6 | ROM3:61D5 18 0F jr 61E6 | ||
ROM3:61D7 CD A9 2A [[#SE: Set Trap card / Failed Fusion|call 2AA9 | ROM3:61D7 CD A9 2A [[#SE: Set Trap card / Failed Fusion|call 2AA9 ;SE: Failed Fusion]] | ||
ROM3:61DA CD 3E 5E call 5E3E | ROM3:61DA CD 3E 5E call 5E3E | ||
ROM3:61DD CD 14 7B call 7B14 | ROM3:61DD CD 14 7B call 7B14 | ||
ROM3:61E0 CD 91 79 call 7991 | ROM3:61E0 CD 91 79 call 7991 | ||
ROM3:61E3 CD AD 79 call 79AD | ROM3:61E3 CD AD 79 [[#Freeze_Monster_card_in_Hand_if_a_Monster_has_already_been_summoned_this_turn|call 79AD ;Freeze Monster card in Hand if a Monster has already been summoned this turn]] | ||
ROM3:61E6 F1 pop af | ROM3:61E6 F1 pop af | ||
ROM3:61E7 C9 ret | ROM3:61E7 C9 ret | ||
Line 14,994: | Line 15,364: | ||
ROM3:75A6 CD 2B 45 [[#Player_draws_a_card|call 452B ;Player draws a card]] | ROM3:75A6 CD 2B 45 [[#Player_draws_a_card|call 452B ;Player draws a card]] | ||
ROM3:75A9 CD 2B 45 [[#Player_draws_a_card|call 452B ;Player draws a card]] | ROM3:75A9 CD 2B 45 [[#Player_draws_a_card|call 452B ;Player draws a card]] | ||
ROM3:75AC CD AD 79 call 79AD | ROM3:75AC CD AD 79 [[#Freeze_Monster_card_in_Hand_if_a_Monster_has_already_been_summoned_this_turn|call 79AD ;Freeze Monster card in Hand if a Monster has already been summoned this turn]] | ||
ROM3:75AF CD 7F 5F [[#Removes_a_card_from_Player.27s_Hand|call 5F7F ;Removes card from Player's Hand]] | ROM3:75AF CD 7F 5F [[#Removes_a_card_from_Player.27s_Hand|call 5F7F ;Removes card from Player's Hand]] | ||
ROM3:75B2 3E 65 ld a,65 | ROM3:75B2 3E 65 ld a,65 | ||
Line 15,385: | Line 15,755: | ||
0C 77 - Anti Raigeki | 0C 77 - Anti Raigeki | ||
16 77 - Brain Control | 16 77 - Brain Control | ||
===Has a Monster been summoned this turn ?=== | |||
* Output: | |||
** No Monster summoned this turn = 0 | |||
** Monster summoned this turn = 1 | |||
ROM3:799F FA 44 CA ld a,(CA44) ;a = Did the player play a monster this turn ? | |||
ROM3:79A2 FE 01 cp a,01 | |||
ROM3:79A4 30 04 jr nc,79AA ;if a Monster has been summoned this turn, skip to 3:79AA (a = 1) | |||
ROM3:79A6 3E 00 ld a,00 ;else a = 0 | |||
ROM3:79A8 18 02 jr 79AC | |||
ROM3:79AA 3E 01 ld a,01 | |||
ROM3:79AC C9 ret | |||
===Freeze Monster card in Hand if a Monster has already been summoned this turn=== | |||
ROM3:79AD F5 push af | |||
ROM3:79AE CD 9F 79 call 799F | |||
ROM3:79B1 FE 00 cp a,00 | |||
ROM3:79B3 28 03 jr z,79B8 ;if a Monster has not been summoned this turn, skip next instruction | |||
ROM3:79B5 CD EC 4F call 4FEC ;[[#Freeze_card_in_Hand|Freeze card in Hand]] | |||
ROM3:79B8 F1 pop af | |||
ROM3:79B9 C9 ret | |||
===Tribute Summon=== | ===Tribute Summon=== | ||
* <code>0xFB3F-0xFB7D</code> - Tribute Summon | * <code>0xFB3F-0xFB7D</code> - Tribute Summon | ||
ROM3:7B3F 0E 00 ld c,00 | ROM3:7B3F 0E 00 ld c,00 | ||
ROM3:7B41 FA BF C6 ld a,(C6BF) ;[[Yu-Gi-Oh! Dark Duel Stories:Notes#Card Effect IDs (Magic Ritual Trap)|Effect ID (magic trap ritual)]] | ROM3:7B41 FA BF C6 ld a,(C6BF) ;[[Yu-Gi-Oh! Dark Duel Stories:Notes#Card Effect IDs (Magic Ritual Trap)|Effect ID (magic trap ritual)]] | ||
ROM3:7B44 FE 02 cp a,02 | ROM3:7B44 FE 02 cp a,02 | ||
ROM3:7B46 20 18 jr nz,7B60 | ROM3:7B46 20 18 jr nz,7B60 ;if it is not a Monster Card, jump to 3:7B60 | ||
ROM3:7B48 0E 02 ld c,02 | ROM3:7B48 0E 02 ld c,02 ;2 Sacrifice required | ||
ROM3:7B4A FA BD C6 ld a,(C6BD) ;Monster Level | ROM3:7B4A FA BD C6 ld a,(C6BD) ;Monster Level | ||
ROM3:7B4D FE 05 cp a,05 | ROM3:7B4D FE 05 cp a,05 | ||
ROM3:7B4F 30 04 jr nc,7B55 | ROM3:7B4F 30 04 jr nc,7B55 ;if(Monster Level ≥ 5), jump to 3:7B55 | ||
ROM3:7B51 0E 00 ld c,00 | ROM3:7B51 0E 00 ld c,00 ;No Sacrifice required | ||
ROM3:7B53 18 09 jr 7B5E | ROM3:7B53 18 09 jr 7B5E | ||
ROM3:7B55 FA BD C6 ld a,(C6BD) | ROM3:7B55 FA BD C6 ld a,(C6BD) | ||
ROM3:7B58 FE 07 cp a,07 | ROM3:7B58 FE 07 cp a,07 | ||
ROM3:7B5A 30 02 jr nc,7B5E | ROM3:7B5A 30 02 jr nc,7B5E ;if(Monster Level ≥ 7), jump to 3:7B5E | ||
ROM3:7B5C 0E 01 ld c,01 | ROM3:7B5C 0E 01 ld c,01 ;1 Sacrifice required | ||
ROM3:7B5E 18 1B jr 7B7B | ROM3:7B5E 18 1B jr 7B7B ;Exit this function | ||
ROM3:7B60 FA BB C6 ld a,(C6BB) ;[[Yu-Gi-Oh!_Dark_Duel_Stories:Notes#Card_Type_IDs|Card Type]] | ROM3:7B60 FA BB C6 ld a,(C6BB) ;[[Yu-Gi-Oh!_Dark_Duel_Stories:Notes#Card_Type_IDs|Card Type]] | ||
ROM3:7B63 FE 16 cp a,16 | ROM3:7B63 FE 16 cp a,16 | ||
ROM3:7B65 20 14 jr nz,7B7B | ROM3:7B65 20 14 jr nz,7B7B ;if it is not a Ritual, exit this function | ||
ROM3:7B67 0E 02 ld c,02 | ROM3:7B67 0E 02 ld c,02 ;2 Sacrifice required | ||
ROM3:7B69 FA BF C6 ld a,(C6BF) ;[[Yu-Gi-Oh! Dark Duel Stories:Notes#Card Effect IDs (Magic Ritual Trap)|Effect ID (magic trap ritual)]] | ROM3:7B69 FA BF C6 ld a,(C6BF) ;[[Yu-Gi-Oh! Dark Duel Stories:Notes#Card Effect IDs (Magic Ritual Trap)|Effect ID (magic trap ritual)]] | ||
ROM3:7B6C FE 45 cp a,45 | ROM3:7B6C FE 45 cp a,45 | ||
ROM3:7B6E 20 02 jr nz,7B72 | ROM3:7B6E 20 02 jr nz,7B72 ;if(Effect ID ≠ Ultimate Dragon), jump to 3:7B72 | ||
ROM3:7B70 0E 00 ld c,00 | ROM3:7B70 0E 00 ld c,00 ;No Sacrifice required | ||
ROM3:7B72 FA BF C6 ld a,(C6BF) ;[[Yu-Gi-Oh! Dark Duel Stories:Notes#Card Effect IDs (Magic Ritual Trap)|Effect ID (magic trap ritual)]] | ROM3:7B72 FA BF C6 ld a,(C6BF) ;[[Yu-Gi-Oh! Dark Duel Stories:Notes#Card Effect IDs (Magic Ritual Trap)|Effect ID (magic trap ritual)]] | ||
ROM3:7B75 FE 5E cp a,5E | ROM3:7B75 FE 5E cp a,5E | ||
ROM3:7B77 20 02 jr nz,7B7B | ROM3:7B77 20 02 jr nz,7B7B ;if(Effect ID ≠ Gate Guardian Ritual), exit this function | ||
ROM3:7B79 0E 00 ld c,00 | ROM3:7B79 0E 00 ld c,00 ;No Sacrifice required | ||
ROM3:7B7B 79 ld a,c | ROM3:7B7B 79 ld a,c | ||
ROM3:7B7C C1 pop bc | ROM3:7B7C C1 pop bc | ||
Line 15,587: | Line 15,978: | ||
ROM4:4FD6 EA CC C8 ld (C8CC),a | ROM4:4FD6 EA CC C8 ld (C8CC),a | ||
ROM4:4FD9 21 15 50 ld hl,5015 | ROM4:4FD9 21 15 50 ld hl,5015 | ||
ROM4:4FDC 19 add hl,de | ROM4:4FDC 19 add hl,de ;hl = Pre-Duel musics IDs pointer | ||
ROM4:4FDD 2A ldi a,(hl) | ROM4:4FDD 2A ldi a,(hl) | ||
ROM4:4FDE 66 ld h,(hl) | ROM4:4FDE 66 ld h,(hl) | ||
Line 15,593: | Line 15,984: | ||
ROM4:4FE0 09 add hl,bc | ROM4:4FE0 09 add hl,bc | ||
ROM4:4FE1 7E ld a,(hl) | ROM4:4FE1 7E ld a,(hl) | ||
ROM4:4FE2 EA CD C8 ld (C8CD),a | ROM4:4FE2 EA CD C8 ld (C8CD),a ;Sets the Pre-Duel music to be played | ||
ROM4:4FE5 21 34 50 ld hl,5034 | ROM4:4FE5 21 34 50 ld hl,5034 | ||
ROM4:4FE8 19 add hl,de | ROM4:4FE8 19 add hl,de ;hl = Duel musics IDs pointer | ||
ROM4:4FE9 2A ldi a,(hl) | ROM4:4FE9 2A ldi a,(hl) | ||
ROM4:4FEA 66 ld h,(hl) | ROM4:4FEA 66 ld h,(hl) | ||
Line 15,601: | Line 15,992: | ||
ROM4:4FEC 09 add hl,bc | ROM4:4FEC 09 add hl,bc | ||
ROM4:4FED 7E ld a,(hl) | ROM4:4FED 7E ld a,(hl) | ||
ROM4:4FEE EA CE C8 ld (C8CE),a | ROM4:4FEE EA CE C8 ld (C8CE),a ;Sets the Duel Music to be played | ||
ROM4:4FF1 E1 pop hl | ROM4:4FF1 E1 pop hl | ||
ROM4:4FF2 D1 pop de | ROM4:4FF2 D1 pop de | ||
Line 16,078: | Line 16,469: | ||
ROM4:577F C1 pop bc | ROM4:577F C1 pop bc | ||
ROM4:5780 F1 pop af | ROM4:5780 F1 pop af | ||
ROM4:5781 C9 ret | ROM4:5781 C9 ret | ||
====4:5786==== | |||
=====4:5786 subroutine===== | |||
ROM4:5786 F5 push af | |||
ROM4:5787 C5 push bc | |||
ROM4:5788 E5 push hl | |||
ROM4:5789 06 00 ld b,00 | |||
ROM4:578B FA D7 C8 ld a,(C8D7) | |||
ROM4:578E 4F ld c,a | |||
ROM4:578F CB 21 sla c | |||
ROM4:5791 21 BC 57 ld hl,57BC | |||
ROM4:5794 09 add hl,bc | |||
ROM4:5795 2A ldi a,(hl) | |||
ROM4:5796 66 ld h,(hl) | |||
ROM4:5797 6F ld l,a ;hl = SRAM block location | |||
ROM4:5798 11 00 00 ld de,0000 | |||
ROM4:579B 0E F6 ld c,F6 | |||
ROM4:579D 2A ldi a,(hl) | |||
ROM4:579E 83 add e | |||
ROM4:579F 5F ld e,a | |||
ROM4:57A0 3E 00 ld a,00 | |||
ROM4:57A2 8A adc d | |||
ROM4:57A3 57 ld d,a | |||
ROM4:57A4 0D dec c | |||
ROM4:57A5 20 F6 jr nz,579D | |||
ROM4:57A7 06 0C ld b,0C | |||
ROM4:57A9 0E 00 ld c,00 | |||
ROM4:57AB 2A ldi a,(hl) | |||
ROM4:57AC 83 add e | |||
ROM4:57AD 5F ld e,a | |||
ROM4:57AE 3E 00 ld a,00 | |||
ROM4:57B0 8A adc d | |||
ROM4:57B1 57 ld d,a | |||
ROM4:57B2 0D dec c | |||
ROM4:57B3 20 F6 jr nz,57AB | |||
ROM4:57B5 05 dec b | |||
ROM4:57B6 20 F1 jr nz,57A9 | |||
ROM4:57B8 E1 pop hl | |||
ROM4:57B9 C1 pop bc | |||
ROM4:57BA F1 pop af | |||
ROM4:57BB C9 ret | |||
=====4:5786 data array - SRAM block locations===== | |||
00 A0 F8 AC | |||
A000 - SRAM block 1 | |||
ACF8 - SRAM block 2 | |||
====Check SRAM Block and Checksum==== | |||
ROM4:57C0 C5 push bc | |||
ROM4:57C1 D5 push de | |||
ROM4:57C2 E5 push hl | |||
ROM4:57C3 FA F0 B9 ld a,(B9F0) ;a = SRAM block currently used | |||
ROM4:57C6 FE 03 cp a,03 | |||
ROM4:57C8 38 04 jr c,57CE | |||
ROM4:57CA 3E 01 ld a,01 | |||
ROM4:57CC 18 2D jr 57FB | |||
ROM4:57CE 06 00 ld b,00 | |||
ROM4:57D0 FA F0 B9 ld a,(B9F0) | |||
ROM4:57D3 4F ld c,a | |||
ROM4:57D4 21 FF 57 ld hl,57FF | |||
ROM4:57D7 09 add hl,bc | |||
ROM4:57D8 7E ld a,(hl) | |||
ROM4:57D9 EA D7 C8 ld (C8D7),a | |||
ROM4:57DC CD 86 57 call 5786 | |||
ROM4:57DF 06 00 ld b,00 | |||
ROM4:57E1 FA D7 C8 ld a,(C8D7) | |||
ROM4:57E4 4F ld c,a | |||
ROM4:57E5 CB 21 sla c | |||
ROM4:57E7 21 82 57 ld hl,5782 | |||
ROM4:57EA 09 add hl,bc | |||
ROM4:57EB 2A ldi a,(hl) | |||
ROM4:57EC 66 ld h,(hl) | |||
ROM4:57ED 6F ld l,a | |||
ROM4:57EE 2A ldi a,(hl) | |||
ROM4:57EF BB cp e | |||
ROM4:57F0 28 02 jr z,57F4 | |||
ROM4:57F2 06 01 ld b,01 | |||
ROM4:57F4 7E ld a,(hl) | |||
ROM4:57F5 BA cp d | |||
ROM4:57F6 28 02 jr z,57FA | |||
ROM4:57F8 06 01 ld b,01 | |||
ROM4:57FA 78 ld a,b | |||
ROM4:57FB E1 pop hl | |||
ROM4:57FC D1 pop de | |||
ROM4:57FD C1 pop bc | |||
ROM4:57FE C9 ret | |||
====Normal New Game==== | ====Normal New Game==== | ||
Line 16,231: | Line 16,708: | ||
ROM4:5C73 F1 pop af | ROM4:5C73 F1 pop af | ||
ROM4:5C74 C9 ret | ROM4:5C74 C9 ret | ||
ROM4:5C75 F5 push af | ROM4:5C75 F5 push af | ||
ROM4:5C76 CD 89 2A [[#SE:_Cursor|call 2A89 ;Sound Effect: Cursor]] | ROM4:5C76 CD 89 2A [[#SE:_Cursor|call 2A89 ;Sound Effect: Cursor]] | ||
Line 16,241: | Line 16,718: | ||
ROM4:5C83 EA 70 C9 ld (C970),a | ROM4:5C83 EA 70 C9 ld (C970),a | ||
ROM4:5C86 F1 pop af | ROM4:5C86 F1 pop af | ||
ROM4:5C87 C9 ret | ROM4:5C87 C9 ret | ||
=====Loads Opponent music IDs===== | =====Loads Opponent music IDs===== | ||
Line 17,789: | Line 18,266: | ||
ROM7:40A0 F5 push af | ROM7:40A0 F5 push af | ||
ROM7:40A1 C5 push bc | ROM7:40A1 C5 push bc | ||
ROM7:40A2 CD 84 1A [[#Checks_Card_ID_validity|call 1A84 | ROM7:40A2 CD 84 1A [[#Checks_Card_ID_validity|call 1A84 ;Checks Card ID validity]] | ||
ROM7:40A5 FE 01 cp a,01 | ROM7:40A5 FE 01 cp a,01 | ||
ROM7:40A7 20 05 jr nz,40AE | ROM7:40A7 20 05 jr nz,40AE ;if(card_ID > 800), jump to 7:40AE | ||
ROM7:40A9 CD C6 40 [[#Retrieve_card_data|call 40C6 | ROM7:40A9 CD C6 40 [[#Retrieve_card_data|call 40C6 ;Retrieve card data]] | ||
ROM7:40AC 18 15 jr 40C3 | ROM7:40AC 18 15 jr 40C3 | ||
ROM7:40AE FE 02 cp a,02 | ROM7:40AE FE 02 cp a,02 | ||
ROM7:40B0 20 05 jr nz,40B7 | ROM7:40B0 20 05 jr nz,40B7 ;if(card_ID > 5700), jump to 7:40B7 | ||
ROM7:40B2 CD 29 41 [[#Retrieve_Construction_card_data|call 4129 | ROM7:40B2 CD 29 41 [[#Retrieve_Construction_card_data|call 4129 ;Retrieve Construction card data]] | ||
ROM7:40B5 18 0C jr 40C3 | ROM7:40B5 18 0C jr 40C3 | ||
ROM7:40B7 FE 03 cp a,03 | ROM7:40B7 FE 03 cp a,03 | ||
ROM7:40B9 20 05 jr nz,40C0 | ROM7:40B9 20 05 jr nz,40C0 ;if(card_ID == 0), jump to 7:40C0 | ||
ROM7:40BB CD 29 41 [[#Retrieve_Construction_card_data|call 4129 | ROM7:40BB CD 29 41 [[#Retrieve_Construction_card_data|call 4129 ;Retrieve Construction card data]], '''no fail-safe !''' | ||
ROM7:40BE 18 03 jr 40C3 | ROM7:40BE 18 03 jr 40C3 | ||
ROM7:40C0 CD F6 41 call 41F6 | ROM7:40C0 CD F6 41 [[#Initialize_current_card_data|call 41F6 ;Initialize current card data]] | ||
ROM7:40C3 C1 pop bc | ROM7:40C3 C1 pop bc | ||
ROM7:40C4 F1 pop af | ROM7:40C4 F1 pop af | ||
Line 18,454: | Line 18,931: | ||
* <code>0x1D0FC-0x1D1A3</code> - Field type bonus arrays | * <code>0x1D0FC-0x1D1A3</code> - Field type bonus arrays | ||
=====Arena bonus===== | =====Arena bonus===== | ||
02 - | 02 - Dragon | ||
02 - | 02 - Magician | ||
02 - | 02 - Zombie | ||
02 - | 02 - Warrior | ||
02 - | 02 - BeastWar | ||
02 - | 02 - Beast | ||
02 - | 02 - WngBeast | ||
02 - | 02 - Fiend | ||
02 - | 02 - Fairy | ||
02 - | 02 - Insect | ||
02 - | 02 - Dinosaur | ||
02 - | 02 - Reptile | ||
02 - | 02 - Fish | ||
02 - | 02 - SeaDragn | ||
02 - | 02 - Machine | ||
02 - | 02 - Thunder | ||
02 - | 02 - Aqua | ||
02 - | 02 - Pyro | ||
02 - | 02 - Rock | ||
02 - | 02 - Plant | ||
02 - | 02 - Magic | ||
02 - | 02 - Trap | ||
02 - | 02 - Ritual | ||
02 - | 02 - | ||
Line 18,506: | Line 18,983: | ||
=====Wasteland bonus===== | =====Wasteland bonus===== | ||
02 - | |||
=====Mountain bonus===== | 02 - | ||
03 - Zombie | |||
=====Sogen bonus===== | 02 - | ||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
03 - Dinosaur | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
03 - Rock | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
=====Mountain bonus===== | |||
03 - Dragon | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
03 - WngBeast | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
03 - Thunder | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
=====Sogen bonus===== | |||
02 - | |||
02 - | |||
02 - | |||
03 - Warrior | |||
03 - BeastWar | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
=====Umi bonus===== | =====Umi bonus===== | ||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
03 - Fish | |||
03 - SeaDragn | |||
01 - Machine | |||
03 - Thunder | |||
03 - Aqua | |||
01 - Pyro | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
=====Yami bonus===== | =====Yami bonus===== | ||
* <code>0x1D18C-0x1D1A3</code> | |||
02 - | |||
03 - Magician | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
03 - Fiend | |||
01 - Fairy | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
02 - | |||
====Cards Types==== | ====Cards Types==== | ||
Line 19,397: | Line 19,995: | ||
ROM8:4997 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ROM8:4997 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ||
ROM8:499A CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ROM8:499A CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ||
ROM8:499D CD DF 1F [[# | ROM8:499D CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:49A0 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:49A0 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:49A3 C1 pop bc | ROM8:49A3 C1 pop bc | ||
Line 19,499: | Line 20,097: | ||
ROM8:4A44 3E 01 ld a,01 | ROM8:4A44 3E 01 ld a,01 | ||
ROM8:4A46 CF rst 08 | ROM8:4A46 CF rst 08 | ||
=> 2F 05 | |||
ROM8:4A49 F1 pop af | ROM8:4A49 F1 pop af | ||
ROM8:4A4A C9 ret | ROM8:4A4A C9 ret | ||
=====Reaper of the Card===== | =====Reaper of the Card===== | ||
Line 19,507: | Line 20,105: | ||
ROM8:4A4B F5 push af | ROM8:4A4B F5 push af | ||
ROM8:4A4C C5 push bc | ROM8:4A4C C5 push bc | ||
ROM8:4A4D CD 61 49 [[#Display card effect text|call 4961 | ROM8:4A4D CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4A50 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4A50 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4A53 CF rst 08 | ROM8:4A53 CF rst 08 | ||
=> 17 0A | |||
ROM8:4A56 CF rst 08 | ROM8:4A56 CF rst 08 | ||
=> 59 03 | |||
ROM8:4A59 C1 pop bc | ROM8:4A59 C1 pop bc | ||
ROM8:4A5A F1 pop af | ROM8:4A5A F1 pop af | ||
Line 19,521: | Line 20,119: | ||
ROM8:4A5C F5 push af | ROM8:4A5C F5 push af | ||
ROM8:4A5D C5 push bc | ROM8:4A5D C5 push bc | ||
ROM8:4A5E CD 61 49 [[#Display card effect text|call 4961 | ROM8:4A5E CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4A61 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4A61 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4A64 01 00 10 ld bc,1000 ;Heal 1000 LP | ROM8:4A64 01 00 10 ld bc,1000 ;Heal 1000 LP | ||
ROM8:4A67 CF rst 08 | ROM8:4A67 CF rst 08 | ||
=> 43 03 | |||
ROM8:4A6A CF rst 08 | ROM8:4A6A CF rst 08 | ||
=> 59 03 | |||
ROM8:4A6D C1 pop bc | ROM8:4A6D C1 pop bc | ||
ROM8:4A6E F1 pop af | ROM8:4A6E F1 pop af | ||
Line 19,536: | Line 20,134: | ||
ROM8:4A70 F5 push af | ROM8:4A70 F5 push af | ||
ROM8:4A71 C5 push bc | ROM8:4A71 C5 push bc | ||
ROM8:4A72 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4A72 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4A75 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4A75 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4A78 CF rst 08 | ROM8:4A78 CF rst 08 | ||
=> 17 03 | |||
ROM8:4A7B FE 00 cp a,00 | ROM8:4A7B FE 00 cp a,00 | ||
ROM8:4A7D 20 25 jr nz,4AA4 | ROM8:4A7D 20 25 jr nz,4AA4 | ||
Line 19,556: | Line 20,154: | ||
ROM8:4A9E CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:4A9E CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:4AA1 CF rst 08 | ROM8:4AA1 CF rst 08 | ||
=> 59 03 | |||
ROM8:4AA4 C1 pop bc | ROM8:4AA4 C1 pop bc | ||
ROM8:4AA5 F1 pop af | ROM8:4AA5 F1 pop af | ||
Line 19,566: | Line 20,163: | ||
ROM8:4AA7 F5 push af | ROM8:4AA7 F5 push af | ||
ROM8:4AA8 C5 push bc | ROM8:4AA8 C5 push bc | ||
ROM8:4AA9 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4AA9 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4AAC CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4AAC CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4AAF CF rst 08 | ROM8:4AAF CF rst 08 | ||
=> 17 03 | |||
ROM8:4AB2 FE 00 cp a,00 | ROM8:4AB2 FE 00 cp a,00 | ||
ROM8:4AB4 20 2E jr nz,4AE4 | ROM8:4AB4 20 2E jr nz,4AE4 | ||
Line 19,589: | Line 20,186: | ||
ROM8:4ADE CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:4ADE CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:4AE1 CF rst 08 | ROM8:4AE1 CF rst 08 | ||
=> 59 03 | |||
ROM8:4AE4 C1 pop bc | ROM8:4AE4 C1 pop bc | ||
ROM8:4AE5 F1 pop af | ROM8:4AE5 F1 pop af | ||
Line 19,597: | Line 20,193: | ||
=====Skelengel===== | =====Skelengel===== | ||
* <code>0x20AE7-0x20AF6</code> - Skelengel : Draw 1 card. | * <code>0x20AE7-0x20AF6</code> - Skelengel : Draw 1 card. | ||
ROM8:4AE7 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4AE7 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4AEA CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4AEA CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4AED CF rst 08 | ROM8:4AED CF rst 08 | ||
=> 7D 03 | |||
ROM8:4AF0 CF rst 08 | ROM8:4AF0 CF rst 08 | ||
=> 63 03 | |||
ROM8:4AF3 CF rst 08 | ROM8:4AF3 CF rst 08 | ||
=> 59 03 | |||
ROM8:4AF6 C9 ret | ROM8:4AF6 C9 ret | ||
Line 19,617: | Line 20,213: | ||
ROM8:4B01 7A ld a,d | ROM8:4B01 7A ld a,d | ||
ROM8:4B02 EA AC C8 ld (C8AC),a | ROM8:4B02 EA AC C8 ld (C8AC),a | ||
ROM8:4B05 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4B05 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4B08 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4B08 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4B0B 01 02 01 ld bc,0102 | ROM8:4B0B 01 02 01 ld bc,0102 | ||
ROM8:4B0E CF rst 08 | ROM8:4B0E CF rst 08 | ||
=> 1F 03 | |||
ROM8:4B11 FE 00 cp a,00 | ROM8:4B11 FE 00 cp a,00 | ||
ROM8:4B13 20 03 jr nz,4B18 | ROM8:4B13 20 03 jr nz,4B18 | ||
ROM8:4B15 CF rst 08 | ROM8:4B15 CF rst 08 | ||
=> 21 03 | |||
ROM8:4B18 04 inc b | ROM8:4B18 04 inc b | ||
ROM8:4B19 78 ld a,b | ROM8:4B19 78 ld a,b | ||
Line 19,631: | Line 20,227: | ||
ROM8:4B1C 38 F0 jr c,4B0E ;If all the Monster card zones have not been checked, loop to 8:4B0E | ROM8:4B1C 38 F0 jr c,4B0E ;If all the Monster card zones have not been checked, loop to 8:4B0E | ||
ROM8:4B1E CF rst 08 | ROM8:4B1E CF rst 08 | ||
=> 59 03 | |||
ROM8:4B21 D1 pop de | ROM8:4B21 D1 pop de | ||
ROM8:4B22 C1 pop bc | ROM8:4B22 C1 pop bc | ||
Line 19,647: | Line 20,243: | ||
ROM8:4B2F 7A ld a,d | ROM8:4B2F 7A ld a,d | ||
ROM8:4B30 EA AC C8 ld (C8AC),a | ROM8:4B30 EA AC C8 ld (C8AC),a | ||
ROM8:4B33 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4B33 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4B36 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4B36 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4B39 01 02 01 ld bc,0102 | ROM8:4B39 01 02 01 ld bc,0102 | ||
ROM8:4B3C CF rst 08 | ROM8:4B3C CF rst 08 | ||
=> 1F 03 | |||
ROM8:4B3F FE 00 cp a,00 | ROM8:4B3F FE 00 cp a,00 | ||
ROM8:4B41 20 09 jr nz,4B4C | ROM8:4B41 20 09 jr nz,4B4C | ||
ROM8:4B43 CF rst 08 | ROM8:4B43 CF rst 08 | ||
=> 21 03 | |||
ROM8:4B46 CF rst 08 | ROM8:4B46 CF rst 08 | ||
=> 21 03 | |||
ROM8:4B49 CF rst 08 | ROM8:4B49 CF rst 08 | ||
=> 21 03 | |||
ROM8:4B4C 04 inc b | ROM8:4B4C 04 inc b | ||
ROM8:4B4D 78 ld a,b | ROM8:4B4D 78 ld a,b | ||
Line 19,664: | Line 20,261: | ||
ROM8:4B50 38 EA jr c,4B3C ;If all the Monster card zones have not been checked, loop to 8:4B3C | ROM8:4B50 38 EA jr c,4B3C ;If all the Monster card zones have not been checked, loop to 8:4B3C | ||
ROM8:4B52 CF rst 08 | ROM8:4B52 CF rst 08 | ||
=> 59 03 | |||
ROM8:4B55 D1 pop de | ROM8:4B55 D1 pop de | ||
ROM8:4B56 C1 pop bc | ROM8:4B56 C1 pop bc | ||
Line 19,680: | Line 20,277: | ||
ROM8:4B63 7A ld a,d | ROM8:4B63 7A ld a,d | ||
ROM8:4B64 EA AC C8 ld (C8AC),a | ROM8:4B64 EA AC C8 ld (C8AC),a | ||
ROM8:4B67 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4B67 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4B6A CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4B6A CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4B6D 01 02 01 ld bc,0102 | ROM8:4B6D 01 02 01 ld bc,0102 | ||
ROM8:4B70 CF rst 08 | ROM8:4B70 CF rst 08 | ||
=> 1F 03 | |||
ROM8:4B73 FE 00 cp a,00 | ROM8:4B73 FE 00 cp a,00 | ||
ROM8:4B75 20 19 jr nz,4B90 ;If that's not Baby Dragon, jump to 8:4B90 | ROM8:4B75 20 19 jr nz,4B90 ;If that's not Baby Dragon, jump to 8:4B90 | ||
Line 19,701: | Line 20,298: | ||
ROM8:4B94 38 DA jr c,4B70 ;If all the Monster card zones have not been checked, loop to 8:4B70 | ROM8:4B94 38 DA jr c,4B70 ;If all the Monster card zones have not been checked, loop to 8:4B70 | ||
ROM8:4B96 CF rst 08 | ROM8:4B96 CF rst 08 | ||
=> 59 03 | |||
ROM8:4B99 D1 pop de | ROM8:4B99 D1 pop de | ||
ROM8:4B9A C1 pop bc | ROM8:4B9A C1 pop bc | ||
Line 19,709: | Line 20,306: | ||
=====Castle of D. Magic===== | =====Castle of D. Magic===== | ||
* <code>0x20B9D-0x20BE6</code> - Castle of D. Magic : Changes the field to Yami, then sets Player's Monsters face down, then reveals any Castle of D. Magic on Player's field. | * <code>0x20B9D-0x20BE6</code> - Castle of D. Magic : Changes the field to Yami, then sets Player's Monsters face down, then reveals any Castle of D. Magic on Player's field. | ||
ROM8:4B9D CD 61 49 [[#Display card effect text|call 4961 | ROM8:4B9D CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4BA0 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4BA0 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4BA3 CF rst 08 | ROM8:4BA3 CF rst 08 | ||
=> 87 03 | |||
ROM8:4BA6 01 02 01 ld bc,0102 | ROM8:4BA6 01 02 01 ld bc,0102 | ||
ROM8:4BA9 78 ld a,b | ROM8:4BA9 78 ld a,b | ||
Line 19,718: | Line 20,315: | ||
ROM8:4BAC 30 16 jr nc,4BC4 ;If all the Monster card zones have been checked, loop to 8:4BC4 | ROM8:4BAC 30 16 jr nc,4BC4 ;If all the Monster card zones have been checked, loop to 8:4BC4 | ||
ROM8:4BAE CF rst 08 | ROM8:4BAE CF rst 08 | ||
=> 11 03 | |||
ROM8:4BB1 FE 00 cp a,00 | ROM8:4BB1 FE 00 cp a,00 | ||
ROM8:4BB3 20 0C jr nz,4BC1 ;If there's no Monster in the selected card zone, jump to 8:4BC1 | ROM8:4BB3 20 0C jr nz,4BC1 ;If there's no Monster in the selected card zone, jump to 8:4BC1 | ||
Line 19,730: | Line 20,327: | ||
ROM8:4BC7 01 02 01 ld bc,0102 | ROM8:4BC7 01 02 01 ld bc,0102 | ||
ROM8:4BCA CF rst 08 | ROM8:4BCA CF rst 08 | ||
=> 1F 03 | |||
ROM8:4BCD FE 00 cp a,00 | ROM8:4BCD FE 00 cp a,00 | ||
ROM8:4BCF 20 0C jr nz,4BDD ;If it's not Castle of D. Magic, jump to 8:4BDD | ROM8:4BCF 20 0C jr nz,4BDD ;If it's not Castle of D. Magic, jump to 8:4BDD | ||
Line 19,742: | Line 20,339: | ||
ROM8:4BE1 38 E7 jr c,4BCA ;If all the Monster card zones have not been checked, loop to 8:4BCA | ROM8:4BE1 38 E7 jr c,4BCA ;If all the Monster card zones have not been checked, loop to 8:4BCA | ||
ROM8:4BE3 CF rst 08 | ROM8:4BE3 CF rst 08 | ||
=> 59 03 | |||
ROM8:4BE6 C9 ret | ROM8:4BE6 C9 ret | ||
Line 19,755: | Line 20,352: | ||
ROM8:4BF1 7A ld a,d | ROM8:4BF1 7A ld a,d | ||
ROM8:4BF2 EA AC C8 ld (C8AC),a | ROM8:4BF2 EA AC C8 ld (C8AC),a | ||
ROM8:4BF5 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4BF5 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4BF8 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4BF8 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4BFB 01 02 01 ld bc,0102 | ROM8:4BFB 01 02 01 ld bc,0102 | ||
ROM8:4BFE CF rst 08 | ROM8:4BFE CF rst 08 | ||
=> 1F 03 | |||
ROM8:4C01 FE 00 cp a,00 | ROM8:4C01 FE 00 cp a,00 | ||
ROM8:4C03 20 03 jr nz,4C08 | ROM8:4C03 20 03 jr nz,4C08 | ||
ROM8:4C05 CF rst 08 | ROM8:4C05 CF rst 08 | ||
=> 21 03 | |||
ROM8:4C08 04 inc b | ROM8:4C08 04 inc b | ||
ROM8:4C09 78 ld a,b | ROM8:4C09 78 ld a,b | ||
Line 19,769: | Line 20,366: | ||
ROM8:4C0C 38 F0 jr c,4BFE ;If all the Monster card zones have not been checked, loop to 8:4BFE | ROM8:4C0C 38 F0 jr c,4BFE ;If all the Monster card zones have not been checked, loop to 8:4BFE | ||
ROM8:4C0E CF rst 08 | ROM8:4C0E CF rst 08 | ||
=> 59 03 | |||
ROM8:4C11 D1 pop de | ROM8:4C11 D1 pop de | ||
ROM8:4C12 C1 pop bc | ROM8:4C12 C1 pop bc | ||
ROM8:4C13 F1 pop af | ROM8:4C13 F1 pop af | ||
ROM8:4C14 C9 ret | ROM8:4C14 C9 ret | ||
=====Curse of Dragon===== | =====Curse of Dragon===== | ||
* <code>0x20C15-0x20C21</code> - Curse of Dragon : Changes the field to Desert. | * <code>0x20C15-0x20C21</code> - Curse of Dragon : Changes the field to Desert. | ||
ROM8:4C15 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4C15 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4C18 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4C18 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4C1B CF rst 08 | ROM8:4C1B CF rst 08 | ||
=> 89 03 | |||
ROM8:4C1E CF rst 08 | ROM8:4C1E CF rst 08 | ||
=> 59 03 | |||
ROM8:4C21 C9 ret | ROM8:4C21 C9 ret | ||
Line 19,790: | Line 20,387: | ||
ROM8:4C22 F5 push af | ROM8:4C22 F5 push af | ||
ROM8:4C23 C5 push bc | ROM8:4C23 C5 push bc | ||
ROM8:4C24 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4C24 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4C27 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4C27 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4C2A 0E 01 ld c,01 | ROM8:4C2A 0E 01 ld c,01 | ||
Line 19,806: | Line 20,403: | ||
ROM8:4C40 18 EC jr 4C2E | ROM8:4C40 18 EC jr 4C2E | ||
ROM8:4C42 CF rst 08 | ROM8:4C42 CF rst 08 | ||
=> 59 03 | |||
ROM8:4C45 C1 pop bc | ROM8:4C45 C1 pop bc | ||
ROM8:4C46 F1 pop af | ROM8:4C46 F1 pop af | ||
Line 19,813: | Line 20,410: | ||
=====Giant Rock Soldier===== | =====Giant Rock Soldier===== | ||
* <code>0x20C48-0x20C54</code> - Giant Rock Soldier : Reverts the field to Arena. | * <code>0x20C48-0x20C54</code> - Giant Rock Soldier : Reverts the field to Arena. | ||
ROM8:4C48 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4C48 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4C4B CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4C4B CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4C4E CF rst 08 | ROM8:4C4E CF rst 08 | ||
... | ... | ||
ROM8:4C51 CF rst 08 | ROM8:4C51 CF rst 08 | ||
=> 59 03 | |||
ROM8:4C54 C9 ret | ROM8:4C54 C9 ret | ||
Line 19,825: | Line 20,422: | ||
ROM8:4C55 F5 push af | ROM8:4C55 F5 push af | ||
ROM8:4C56 C5 push bc | ROM8:4C56 C5 push bc | ||
ROM8:4C57 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4C57 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4C5A CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4C5A CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4C2A 0E 01 ld c,01 | ROM8:4C2A 0E 01 ld c,01 | ||
Line 19,842: | Line 20,439: | ||
ROM8:4C73 18 EC jr 4C61 | ROM8:4C73 18 EC jr 4C61 | ||
ROM8:4C75 CF rst 08 | ROM8:4C75 CF rst 08 | ||
=> 59 03 | |||
ROM8:4C78 C1 pop bc | ROM8:4C78 C1 pop bc | ||
ROM8:4C79 F1 pop af | ROM8:4C79 F1 pop af | ||
Line 19,857: | Line 20,454: | ||
ROM8:4C85 7A ld a,d | ROM8:4C85 7A ld a,d | ||
ROM8:4C86 EA AC C8 ld (C8AC),a | ROM8:4C86 EA AC C8 ld (C8AC),a | ||
ROM8:4C89 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4C89 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4C8C CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4C8C CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4C8F 01 02 01 ld bc,0102 | ROM8:4C8F 01 02 01 ld bc,0102 | ||
Line 19,871: | Line 20,468: | ||
ROM8:4CA0 38 F0 jr c,4C92 | ROM8:4CA0 38 F0 jr c,4C92 | ||
ROM8:4CA2 CF rst 08 | ROM8:4CA2 CF rst 08 | ||
=> 59 03 | |||
ROM8:4CA5 D1 pop de | ROM8:4CA5 D1 pop de | ||
ROM8:4CA6 C1 pop bc | ROM8:4CA6 C1 pop bc | ||
Line 19,882: | Line 20,479: | ||
ROM8:4CAA C5 push bc | ROM8:4CAA C5 push bc | ||
ROM8:4CAB D5 push de | ROM8:4CAB D5 push de | ||
ROM8:4CAC CD 61 49 [[#Display card effect text|call 4961 | ROM8:4CAC CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4CAF CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4CAF CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4CB2 01 02 01 ld bc,0102 | ROM8:4CB2 01 02 01 ld bc,0102 | ||
Line 19,909: | Line 20,506: | ||
ROM8:4CE0 38 D3 jr c,4CB5 | ROM8:4CE0 38 D3 jr c,4CB5 | ||
ROM8:4CE2 CF rst 08 | ROM8:4CE2 CF rst 08 | ||
=> 59 03 | |||
ROM8:4CE5 D1 pop de | ROM8:4CE5 D1 pop de | ||
ROM8:4CE6 C1 pop bc | ROM8:4CE6 C1 pop bc | ||
Line 19,918: | Line 20,515: | ||
ROM8:4CE9 F5 push af | ROM8:4CE9 F5 push af | ||
ROM8:4CEA C5 push bc | ROM8:4CEA C5 push bc | ||
ROM8:4CEB CD 61 49 [[#Display card effect text|call 4961 | ROM8:4CEB CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4CEE CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4CEE CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4CF1 0E 01 ld c,01 | ROM8:4CF1 0E 01 ld c,01 | ||
Line 19,934: | Line 20,531: | ||
ROM8:4D08 18 EB jr 4CF5 | ROM8:4D08 18 EB jr 4CF5 | ||
ROM8:4D0A CF rst 08 | ROM8:4D0A CF rst 08 | ||
=> 59 03 | |||
ROM8:4D0D C1 pop bc | ROM8:4D0D C1 pop bc | ||
ROM8:4D0E F1 pop af | ROM8:4D0E F1 pop af | ||
Line 19,943: | Line 20,540: | ||
ROM8:4D11 C5 push bc | ROM8:4D11 C5 push bc | ||
ROM8:4D12 D5 push de | ROM8:4D12 D5 push de | ||
ROM8:4D13 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4D13 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4D16 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4D16 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4D19 11 00 00 ld de,0000 | ROM8:4D19 11 00 00 ld de,0000 | ||
Line 19,981: | Line 20,578: | ||
... | ... | ||
ROM8:4D5B CF rst 08 | ROM8:4D5B CF rst 08 | ||
=> 59 03 | |||
ROM8:4D5E D1 pop de | ROM8:4D5E D1 pop de | ||
ROM8:4D5F C1 pop bc | ROM8:4D5F C1 pop bc | ||
Line 19,991: | Line 20,587: | ||
ROM8:4D62 F5 push af | ROM8:4D62 F5 push af | ||
ROM8:4D63 C5 push bc | ROM8:4D63 C5 push bc | ||
ROM8:4D64 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4D64 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4D67 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4D67 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4D6A CF rst 08 | ROM8:4D6A CF rst 08 | ||
Line 20,007: | Line 20,603: | ||
ROM8:4D7E CD E6 19 call 19E6 | ROM8:4D7E CD E6 19 call 19E6 | ||
ROM8:4D81 CF rst 08 | ROM8:4D81 CF rst 08 | ||
=> 59 03 | |||
ROM8:4D84 C1 pop bc | ROM8:4D84 C1 pop bc | ||
ROM8:4D85 F1 pop af | ROM8:4D85 F1 pop af | ||
Line 20,014: | Line 20,609: | ||
=====Spirit of the Mountain===== | =====Spirit of the Mountain===== | ||
ROM8:4D87 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4D87 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4D8A CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4D8A CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4D8D CF rst 08 | ROM8:4D8D CF rst 08 | ||
Line 20,020: | Line 20,615: | ||
ROM8:4D8F 03 inc bc | ROM8:4D8F 03 inc bc | ||
ROM8:4D90 CF rst 08 | ROM8:4D90 CF rst 08 | ||
=> 59 03 | |||
ROM8:4D93 C9 ret | ROM8:4D93 C9 ret | ||
Line 20,027: | Line 20,621: | ||
ROM8:4D94 F5 push af | ROM8:4D94 F5 push af | ||
ROM8:4D95 C5 push bc | ROM8:4D95 C5 push bc | ||
ROM8:4D96 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4D96 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4D99 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4D99 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4D9C 0E 01 ld c,01 | ROM8:4D9C 0E 01 ld c,01 | ||
Line 20,044: | Line 20,638: | ||
ROM8:4DB2 18 EC jr 4DA0 | ROM8:4DB2 18 EC jr 4DA0 | ||
ROM8:4DB4 CF rst 08 | ROM8:4DB4 CF rst 08 | ||
=> 59 03 | |||
ROM8:4DB7 C1 pop bc | ROM8:4DB7 C1 pop bc | ||
ROM8:4DB8 F1 pop af | ROM8:4DB8 F1 pop af | ||
Line 20,059: | Line 20,652: | ||
ROM8:4DC4 7A ld a,d | ROM8:4DC4 7A ld a,d | ||
ROM8:4DC5 EA AC C8 ld (C8AC),a | ROM8:4DC5 EA AC C8 ld (C8AC),a | ||
ROM8:4DC8 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4DC8 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4DCB CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4DCB CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4DCE 01 03 00 ld bc,0003 | ROM8:4DCE 01 03 00 ld bc,0003 | ||
Line 20,071: | Line 20,664: | ||
ROM8:4DE2 CD FB 19 call 19FB | ROM8:4DE2 CD FB 19 call 19FB | ||
ROM8:4DE5 CF rst 08 | ROM8:4DE5 CF rst 08 | ||
=> 59 03 | |||
ROM8:4DE8 D1 pop de | ROM8:4DE8 D1 pop de | ||
ROM8:4DE9 C1 pop bc | ROM8:4DE9 C1 pop bc | ||
Line 20,081: | Line 20,673: | ||
ROM8:4DEC F5 push af | ROM8:4DEC F5 push af | ||
ROM8:4DED C5 push bc | ROM8:4DED C5 push bc | ||
ROM8:4DEE CD 61 49 [[#Display card effect text|call 4961 | ROM8:4DEE CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4DF1 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4DF1 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4DF4 CF rst 08 | ROM8:4DF4 CF rst 08 | ||
Line 20,100: | Line 20,692: | ||
ROM8:4E14 CD E6 19 call 19E6 | ROM8:4E14 CD E6 19 call 19E6 | ||
ROM8:4E17 CF rst 08 | ROM8:4E17 CF rst 08 | ||
=> 59 03 | |||
ROM8:4E1A C1 pop bc | ROM8:4E1A C1 pop bc | ||
ROM8:4E1B F1 pop af | ROM8:4E1B F1 pop af | ||
Line 20,109: | Line 20,700: | ||
ROM8:4E1D F5 push af | ROM8:4E1D F5 push af | ||
ROM8:4E1E C5 push bc | ROM8:4E1E C5 push bc | ||
ROM8:4E1F CD 61 49 [[#Display card effect text|call 4961 | ROM8:4E1F CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4E22 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4E22 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4E25 0E 01 ld c,01 | ROM8:4E25 0E 01 ld c,01 | ||
Line 20,122: | Line 20,713: | ||
ROM8:4E35 CD D0 19 call 19D0 | ROM8:4E35 CD D0 19 call 19D0 | ||
ROM8:4E38 CD 13 1A call 1A13 | ROM8:4E38 CD 13 1A call 1A13 | ||
ROM8:4E3B CD DF 1F call 1FDF | ROM8:4E3B CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:4E3E CD FB 19 call 19FB | ROM8:4E3E CD FB 19 call 19FB | ||
ROM8:4E41 04 inc b | ROM8:4E41 04 inc b | ||
ROM8:4E42 18 E5 jr 4E29 | ROM8:4E42 18 E5 jr 4E29 | ||
ROM8:4E44 CF rst 08 | ROM8:4E44 CF rst 08 | ||
=> 59 03 | |||
ROM8:4E47 C1 pop bc | ROM8:4E47 C1 pop bc | ||
ROM8:4E48 F1 pop af | ROM8:4E48 F1 pop af | ||
Line 20,135: | Line 20,726: | ||
ROM8:4E4A F5 push af | ROM8:4E4A F5 push af | ||
ROM8:4E4B C5 push bc | ROM8:4E4B C5 push bc | ||
ROM8:4E4C CD 61 49 [[#Display card effect text|call 4961 | ROM8:4E4C CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4E4F CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4E4F CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4E52 CF rst 08 | ROM8:4E52 CF rst 08 | ||
Line 20,144: | Line 20,735: | ||
ROM8:4E5B CD D0 19 call 19D0 | ROM8:4E5B CD D0 19 call 19D0 | ||
ROM8:4E5E CD 13 1A call 1A13 | ROM8:4E5E CD 13 1A call 1A13 | ||
ROM8:4E61 CD DF 1F call 1FDF | ROM8:4E61 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:4E64 CD FB 19 call 19FB | ROM8:4E64 CD FB 19 call 19FB | ||
ROM8:4E67 CF rst 08 | ROM8:4E67 CF rst 08 | ||
=> 59 03 | |||
ROM8:4E6A C1 pop bc | ROM8:4E6A C1 pop bc | ||
ROM8:4E6B F1 pop af | ROM8:4E6B F1 pop af | ||
Line 20,161: | Line 20,752: | ||
ROM8:4E77 7A ld a,d | ROM8:4E77 7A ld a,d | ||
ROM8:4E78 EA AC C8 ld (C8AC),a | ROM8:4E78 EA AC C8 ld (C8AC),a | ||
ROM8:4E7B CD 61 49 [[#Display card effect text|call 4961 | ROM8:4E7B CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4E7E CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4E7E CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4E81 01 03 01 ld bc,0103 | ROM8:4E81 01 03 01 ld bc,0103 | ||
Line 20,180: | Line 20,771: | ||
ROM8:4E9C 38 E6 jr c,4E84 | ROM8:4E9C 38 E6 jr c,4E84 | ||
ROM8:4E9E CF rst 08 | ROM8:4E9E CF rst 08 | ||
=> 59 03 | |||
ROM8:4EA1 D1 pop de | ROM8:4EA1 D1 pop de | ||
ROM8:4EA2 C1 pop bc | ROM8:4EA2 C1 pop bc | ||
Line 20,190: | Line 20,780: | ||
ROM8:4EA5 F5 push af | ROM8:4EA5 F5 push af | ||
ROM8:4EA6 C5 push bc | ROM8:4EA6 C5 push bc | ||
ROM8:4EA7 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4EA7 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4EAA CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4EAA CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4EAD 01 02 01 ld bc,0102 | ROM8:4EAD 01 02 01 ld bc,0102 | ||
Line 20,210: | Line 20,800: | ||
ROM8:4ECA 38 E4 jr c,4EB0 | ROM8:4ECA 38 E4 jr c,4EB0 | ||
ROM8:4ECC CF rst 08 | ROM8:4ECC CF rst 08 | ||
=> 59 03 | |||
ROM8:4ECF C1 pop bc | ROM8:4ECF C1 pop bc | ||
ROM8:4ED0 F1 pop af | ROM8:4ED0 F1 pop af | ||
Line 20,225: | Line 20,814: | ||
ROM8:4EDC 7A ld a,d | ROM8:4EDC 7A ld a,d | ||
ROM8:4EDD EA AC C8 ld (C8AC),a | ROM8:4EDD EA AC C8 ld (C8AC),a | ||
ROM8:4EE0 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4EE0 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4EE3 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4EE3 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4EE6 01 02 01 ld bc,0102 | ROM8:4EE6 01 02 01 ld bc,0102 | ||
Line 20,239: | Line 20,828: | ||
ROM8:4EF7 38 F0 jr c,4EE9 | ROM8:4EF7 38 F0 jr c,4EE9 | ||
ROM8:4EF9 CF rst 08 | ROM8:4EF9 CF rst 08 | ||
=> 59 03 | |||
ROM8:4EFC D1 pop de | ROM8:4EFC D1 pop de | ||
ROM8:4EFD C1 pop bc | ROM8:4EFD C1 pop bc | ||
Line 20,255: | Line 20,843: | ||
ROM8:4F0A 7A ld a,d | ROM8:4F0A 7A ld a,d | ||
ROM8:4F0B EA AC C8 ld (C8AC),a | ROM8:4F0B EA AC C8 ld (C8AC),a | ||
ROM8:4F0E CD 61 49 [[#Display card effect text|call 4961 | ROM8:4F0E CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4F11 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4F11 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4F14 01 02 01 ld bc,0102 | ROM8:4F14 01 02 01 ld bc,0102 | ||
Line 20,269: | Line 20,857: | ||
ROM8:4F25 38 F0 jr c,4F17 | ROM8:4F25 38 F0 jr c,4F17 | ||
ROM8:4F27 CF rst 08 | ROM8:4F27 CF rst 08 | ||
=> 59 03 | |||
ROM8:4F2A D1 pop de | ROM8:4F2A D1 pop de | ||
ROM8:4F2B C1 pop bc | ROM8:4F2B C1 pop bc | ||
Line 20,280: | Line 20,867: | ||
ROM8:4F2F C5 push bc | ROM8:4F2F C5 push bc | ||
ROM8:4F30 D5 push de | ROM8:4F30 D5 push de | ||
ROM8:4F31 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4F31 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4F34 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4F34 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4F37 CF rst 08 | ROM8:4F37 CF rst 08 | ||
Line 20,291: | Line 20,878: | ||
ROM8:4F43 CD 13 1A call 1A13 | ROM8:4F43 CD 13 1A call 1A13 | ||
ROM8:4F46 CD 92 1F call 1F92 | ROM8:4F46 CD 92 1F call 1F92 | ||
ROM8:4F49 CD DF 1F call 1FDF | ROM8:4F49 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:4F4C CD FB 19 call 19FB | ROM8:4F4C CD FB 19 call 19FB | ||
ROM8:4F4F CF rst 08 | ROM8:4F4F CF rst 08 | ||
=> 59 03 | |||
ROM8:4F52 D1 pop de | ROM8:4F52 D1 pop de | ||
ROM8:4F53 C1 pop bc | ROM8:4F53 C1 pop bc | ||
Line 20,304: | Line 20,890: | ||
ROM8:4F56 F5 push af | ROM8:4F56 F5 push af | ||
ROM8:4F57 C5 push bc | ROM8:4F57 C5 push bc | ||
ROM8:4F58 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4F58 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4F5B CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4F5B CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4F5E 01 00 05 ld bc,0500 | ROM8:4F5E 01 00 05 ld bc,0500 | ||
Line 20,311: | Line 20,897: | ||
ROM8:4F63 03 inc bc | ROM8:4F63 03 inc bc | ||
ROM8:4F64 CF rst 08 | ROM8:4F64 CF rst 08 | ||
=> 59 03 | |||
ROM8:4F67 C1 pop bc | ROM8:4F67 C1 pop bc | ||
ROM8:4F68 F1 pop af | ROM8:4F68 F1 pop af | ||
Line 20,327: | Line 20,912: | ||
ROM8:4F77 03 inc bc | ROM8:4F77 03 inc bc | ||
ROM8:4F78 CF rst 08 | ROM8:4F78 CF rst 08 | ||
=> 59 03 | |||
ROM8:4F7B C1 pop bc | ROM8:4F7B C1 pop bc | ||
ROM8:4F7C F1 pop af | ROM8:4F7C F1 pop af | ||
Line 20,334: | Line 20,918: | ||
=====Kairyu-shin===== | =====Kairyu-shin===== | ||
ROM8:4F7E CD 61 49 [[#Display card effect text|call 4961 | ROM8:4F7E CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4F81 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4F81 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4F84 CF rst 08 | ROM8:4F84 CF rst 08 | ||
Line 20,340: | Line 20,924: | ||
ROM8:4F86 03 inc bc | ROM8:4F86 03 inc bc | ||
ROM8:4F87 CF rst 08 | ROM8:4F87 CF rst 08 | ||
=> 59 03 | |||
ROM8:4F8A C9 ret | ROM8:4F8A C9 ret | ||
Line 20,348: | Line 20,931: | ||
ROM8:4F8C C5 push bc | ROM8:4F8C C5 push bc | ||
ROM8:4F8D D5 push de | ROM8:4F8D D5 push de | ||
ROM8:4F8E CD 61 49 [[#Display card effect text|call 4961 | ROM8:4F8E CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4F91 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4F91 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4F94 01 02 01 ld bc,0102 | ROM8:4F94 01 02 01 ld bc,0102 | ||
Line 20,374: | Line 20,957: | ||
ROM8:4FBC 38 D9 jr c,4F97 | ROM8:4FBC 38 D9 jr c,4F97 | ||
ROM8:4FBE CF rst 08 | ROM8:4FBE CF rst 08 | ||
=> 59 03 | |||
ROM8:4FC1 D1 pop de | ROM8:4FC1 D1 pop de | ||
ROM8:4FC2 C1 pop bc | ROM8:4FC2 C1 pop bc | ||
Line 20,385: | Line 20,967: | ||
ROM8:4FC6 C5 push bc | ROM8:4FC6 C5 push bc | ||
ROM8:4FC7 D5 push de | ROM8:4FC7 D5 push de | ||
ROM8:4FC8 CD 61 49 [[#Display card effect text|call 4961 | ROM8:4FC8 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4FCB CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4FCB CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4FCE 01 00 00 ld bc,0000 | ROM8:4FCE 01 00 00 ld bc,0000 | ||
Line 20,399: | Line 20,981: | ||
ROM8:4FE1 38 EE jr c,4FD1 | ROM8:4FE1 38 EE jr c,4FD1 | ||
ROM8:4FE3 CF rst 08 | ROM8:4FE3 CF rst 08 | ||
=> 59 03 | |||
ROM8:4FE6 D1 pop de | ROM8:4FE6 D1 pop de | ||
ROM8:4FE7 C1 pop bc | ROM8:4FE7 C1 pop bc | ||
Line 20,410: | Line 20,991: | ||
ROM8:4FEB C5 push bc | ROM8:4FEB C5 push bc | ||
ROM8:4FEC D5 push de | ROM8:4FEC D5 push de | ||
ROM8:4FED CD 61 49 [[#Display card effect text|call 4961 | ROM8:4FED CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:4FF0 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:4FF0 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:4FF3 01 02 01 ld bc,0102 | ROM8:4FF3 01 02 01 ld bc,0102 | ||
Line 20,434: | Line 21,015: | ||
ROM8:501B CD FB 19 call 19FB | ROM8:501B CD FB 19 call 19FB | ||
ROM8:501E CF rst 08 | ROM8:501E CF rst 08 | ||
=> 59 03 | |||
ROM8:5021 D1 pop de | ROM8:5021 D1 pop de | ||
ROM8:5022 C1 pop bc | ROM8:5022 C1 pop bc | ||
Line 20,450: | Line 21,030: | ||
ROM8:502F 7A ld a,d | ROM8:502F 7A ld a,d | ||
ROM8:5030 EA AC C8 ld (C8AC),a | ROM8:5030 EA AC C8 ld (C8AC),a | ||
ROM8:5033 CD 61 49 [[#Display card effect text|call 4961 | ROM8:5033 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:5036 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:5036 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:5039 01 02 01 ld bc,0102 | ROM8:5039 01 02 01 ld bc,0102 | ||
Line 20,464: | Line 21,044: | ||
ROM8:504A 38 F0 jr c,503C | ROM8:504A 38 F0 jr c,503C | ||
ROM8:504C CF rst 08 | ROM8:504C CF rst 08 | ||
=> 59 03 | |||
ROM8:504F D1 pop de | ROM8:504F D1 pop de | ||
ROM8:5050 C1 pop bc | ROM8:5050 C1 pop bc | ||
Line 20,480: | Line 21,059: | ||
ROM8:505D 7A ld a,d | ROM8:505D 7A ld a,d | ||
ROM8:505E EA AC C8 ld (C8AC),a | ROM8:505E EA AC C8 ld (C8AC),a | ||
ROM8:5061 CD 61 49 [[#Display card effect text|call 4961 | ROM8:5061 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:5064 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:5064 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:5067 01 02 01 ld bc,0102 | ROM8:5067 01 02 01 ld bc,0102 | ||
Line 20,494: | Line 21,073: | ||
ROM8:5078 38 F0 jr c,506A | ROM8:5078 38 F0 jr c,506A | ||
ROM8:507A CF rst 08 | ROM8:507A CF rst 08 | ||
=> 59 03 | |||
ROM8:507D D1 pop de | ROM8:507D D1 pop de | ||
ROM8:507E C1 pop bc | ROM8:507E C1 pop bc | ||
Line 20,502: | Line 21,080: | ||
=====Trent===== | =====Trent===== | ||
ROM8:5081 CD 61 49 [[#Display card effect text|call 4961 | ROM8:5081 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:5084 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:5084 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:5087 CF rst 08 | ROM8:5087 CF rst 08 | ||
Line 20,508: | Line 21,086: | ||
ROM8:5089 03 inc bc | ROM8:5089 03 inc bc | ||
ROM8:508A CF rst 08 | ROM8:508A CF rst 08 | ||
=> 59 03 | |||
ROM8:508D C9 ret | ROM8:508D C9 ret | ||
Line 20,521: | Line 21,098: | ||
ROM8:5098 7A ld a,d | ROM8:5098 7A ld a,d | ||
ROM8:5099 EA AC C8 ld (C8AC),a | ROM8:5099 EA AC C8 ld (C8AC),a | ||
ROM8:509C CD 61 49 [[#Display card effect text|call 4961 | ROM8:509C CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:509F CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:509F CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:50A2 01 02 01 ld bc,0102 | ROM8:50A2 01 02 01 ld bc,0102 | ||
Line 20,541: | Line 21,118: | ||
ROM8:50BD 38 E6 jr c,50A5 | ROM8:50BD 38 E6 jr c,50A5 | ||
ROM8:50BF CF rst 08 | ROM8:50BF CF rst 08 | ||
=> 59 03 | |||
ROM8:50C2 D1 pop de | ROM8:50C2 D1 pop de | ||
ROM8:50C3 C1 pop bc | ROM8:50C3 C1 pop bc | ||
Line 20,558: | Line 21,134: | ||
ROM8:50D0 7A ld a,d | ROM8:50D0 7A ld a,d | ||
ROM8:50D1 EA AC C8 ld (C8AC),a | ROM8:50D1 EA AC C8 ld (C8AC),a | ||
ROM8:50D4 CD 61 49 [[#Display card effect text|call 4961 | ROM8:50D4 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:50D7 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:50D7 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:50DA 01 02 01 ld bc,0102 | ROM8:50DA 01 02 01 ld bc,0102 | ||
ROM8:50DD CF rst 08 | ROM8:50DD CF rst 08 | ||
=> 11 03 | |||
ROM8:50E0 FE 01 cp a,01 | ROM8:50E0 FE 01 cp a,01 | ||
ROM8:50E2 28 06 jr z,50EA ;If the selected card zone is free, jump to 8:50EA | ROM8:50E2 28 06 jr z,50EA ;If the selected card zone is free, jump to 8:50EA | ||
Line 20,580: | Line 21,156: | ||
ROM8:50FD CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ROM8:50FD CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ||
ROM8:5100 CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ROM8:5100 CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ||
ROM8:5103 CD DF 1F [[# | ROM8:5103 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:5106 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:5106 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:5109 CF rst 08 | ROM8:5109 CF rst 08 | ||
=> 59 03 | |||
ROM8:510C D1 pop de | ROM8:510C D1 pop de | ||
ROM8:510D C1 pop bc | ROM8:510D C1 pop bc | ||
Line 20,594: | Line 21,170: | ||
ROM8:5111 C5 push bc | ROM8:5111 C5 push bc | ||
ROM8:5112 D5 push de | ROM8:5112 D5 push de | ||
ROM8:5113 CD 61 49 [[#Display card effect text|call 4961 | ROM8:5113 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:5116 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:5116 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:5119 01 02 01 ld bc,0102 ;Column 1, Row 2 | ROM8:5119 01 02 01 ld bc,0102 ;Column 1, Row 2 | ||
Line 20,611: | Line 21,187: | ||
... | ... | ||
ROM8:5132 CF rst 08 | ROM8:5132 CF rst 08 | ||
=> 59 03 | |||
ROM8:5135 D1 pop de | ROM8:5135 D1 pop de | ||
ROM8:5136 C1 pop bc | ROM8:5136 C1 pop bc | ||
Line 20,621: | Line 21,197: | ||
ROM8:5139 F5 push af | ROM8:5139 F5 push af | ||
ROM8:513A C5 push bc | ROM8:513A C5 push bc | ||
ROM8:513B CD 61 49 [[#Display card effect text|call 4961 | ROM8:513B CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:513E CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:513E CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:5141 01 01 00 ld bc,0001 | ROM8:5141 01 01 00 ld bc,0001 | ||
Line 20,638: | Line 21,214: | ||
ROM8:515B 18 F5 jr 5152 | ROM8:515B 18 F5 jr 5152 | ||
ROM8:515D CF rst 08 | ROM8:515D CF rst 08 | ||
=> 59 03 | |||
ROM8:5160 C1 pop bc | ROM8:5160 C1 pop bc | ||
ROM8:5161 F1 pop af | ROM8:5161 F1 pop af | ||
Line 20,648: | Line 21,223: | ||
ROM8:5163 F5 push af | ROM8:5163 F5 push af | ||
ROM8:5164 C5 push bc | ROM8:5164 C5 push bc | ||
ROM8:5165 CD 61 49 [[#Display card effect text|call 4961 | ROM8:5165 CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:5168 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:5168 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:516B 01 01 00 ld bc,0001 | ROM8:516B 01 01 00 ld bc,0001 | ||
Line 20,656: | Line 21,231: | ||
ROM8:5173 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ROM8:5173 CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ||
ROM8:5176 CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ROM8:5176 CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ||
ROM8:5179 CD DF 1F [[# | ROM8:5179 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:517C CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:517C CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:517F 04 inc b | ROM8:517F 04 inc b | ||
Line 20,666: | Line 21,241: | ||
ROM8:518A CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ROM8:518A CD D0 19 [[#Updates_field_Column_and_Row|call 19D0 ;Updates field Column and Row to value in bc]] | ||
ROM8:518D CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ROM8:518D CD 13 1A [[#Stores_selected_card_ID_and_status|call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3)]] | ||
ROM8:5190 CD DF 1F [[# | ROM8:5190 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:5193 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:5193 CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:5196 04 inc b | ROM8:5196 04 inc b | ||
ROM8:5197 18 EC jr 5185 | ROM8:5197 18 EC jr 5185 | ||
ROM8:5199 CF rst 08 | ROM8:5199 CF rst 08 | ||
=> 59 03 | |||
ROM8:519C C1 pop bc | ROM8:519C C1 pop bc | ||
ROM8:519D F1 pop af | ROM8:519D F1 pop af | ||
Line 20,687: | Line 21,261: | ||
ROM8:51A9 7A ld a,d | ROM8:51A9 7A ld a,d | ||
ROM8:51AA EA AC C8 ld (C8AC),a | ROM8:51AA EA AC C8 ld (C8AC),a | ||
ROM8:51AD CD 61 49 [[#Display card effect text|call 4961 | ROM8:51AD CD 61 49 [[#Display card effect text|call 4961 ;Displays card effect text]] | ||
ROM8:51B0 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ROM8:51B0 CD 8D 49 [[#Freeze_card_in_selected_card_zone|call 498D ;Freezes this card]] | ||
ROM8:51B3 01 02 01 ld bc,0102 | ROM8:51B3 01 02 01 ld bc,0102 | ||
Line 20,709: | Line 21,283: | ||
ROM8:51D6 CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ROM8:51D6 CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ||
ROM8:51D9 CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ROM8:51D9 CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ||
ROM8:51DC CD DF 1F [[# | ROM8:51DC CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROM8:51DF CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROM8:51DF CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROM8:51E2 D1 pop de | ROM8:51E2 D1 pop de | ||
Line 21,267: | Line 21,841: | ||
ROM9:54C0 CD C5 28 call 28C5 | ROM9:54C0 CD C5 28 call 28C5 | ||
ROM9:54C3 FE 04 cp a,04 | ROM9:54C3 FE 04 cp a,04 | ||
ROM9:54C5 20 0F jr nz,54D6 | ROM9:54C5 20 0F jr nz,54D6 ;if Stage 5 has not been unlocked, jump to 9:54D6 | ||
ROM9:54C7 3E 00 ld a,00 | ROM9:54C7 3E 00 ld a,00 | ||
ROM9:54C9 CF rst 08 | ROM9:54C9 CF rst 08 | ||
Line 22,073: | Line 22,647: | ||
ROMA:4CF2 CD 3E 30 call 303E | ROMA:4CF2 CD 3E 30 call 303E | ||
ROMA:4CF5 CF rst 08 | ROMA:4CF5 CF rst 08 | ||
=> 21 0B | => 21 0B; updates characters displayed on screen ? | ||
ROMA:4CF8 E1 pop hl | ROMA:4CF8 E1 pop hl | ||
ROMA:4CF9 F1 pop af | ROMA:4CF9 F1 pop af | ||
Line 22,135: | Line 22,709: | ||
02 40 08 24 02 28 10 22 | 02 40 08 24 02 28 10 22 | ||
02 18 18 20 02 | 02 18 18 20 02 | ||
===A:4DCE routine group=== | |||
====A:4DCE==== | |||
ROMA:4DCE F5 push af | |||
ROMA:4DCF C5 push bc | |||
ROMA:4DD0 D5 push de | |||
ROMA:4DD1 E5 push hl | |||
ROMA:4DD2 CD F1 4D call 4DF1 | |||
ROMA:4DD5 06 00 ld b,00 | |||
ROMA:4DD7 4F ld c,a | |||
ROMA:4DD8 21 ED 4D ld hl,4DED | |||
ROMA:4DDB 09 add hl,bc | |||
ROMA:4DDC 2A ldi a,(hl) | |||
ROMA:4DDD 66 ld h,(hl) | |||
ROMA:4DDE 6F ld l,a | |||
ROMA:4DDF 01 E4 4D ld bc,4DE4 | |||
ROMA:4DE2 C5 push bc | |||
ROMA:4DE3 E9 jp hl | |||
ROMA:4DE4 FE 01 cp a,01 | |||
ROMA:4DE6 20 EA jr nz,4DD2 ;I think it proceeds only after the A button is pressed | |||
ROMA:4DE8 E1 pop hl | |||
ROMA:4DE9 D1 pop de | |||
ROMA:4DEA C1 pop bc | |||
ROMA:4DEB F1 pop af | |||
ROMA:4DEC C9 ret | |||
=====Pointer array used by A:4DCE===== | |||
ROMA:4DED | |||
2B 4E - | |||
35 4E - | |||
====A:4DF1==== | |||
ROMA:4DF1 C5 push bc | |||
ROMA:4DF2 D5 push de | |||
ROMA:4DF3 E5 push hl | |||
ROMA:4DF4 16 00 ld d,00 | |||
ROMA:4DF6 FA A8 C5 ld a,(C5A8) | |||
ROMA:4DF9 E6 03 and a,03 | |||
ROMA:4DFB 28 0D jr z,4E0A | |||
ROMA:4DFD 0E 08 ld c,08 | |||
ROMA:4DFF 0D dec c | |||
ROMA:4E00 07 rlca | |||
ROMA:4E01 30 FC jr nc,4DFF | |||
ROMA:4E03 06 00 ld b,00 | |||
ROMA:4E05 21 23 4E ld hl,4E23 | |||
ROMA:4E08 09 add hl,bc | |||
ROMA:4E09 56 ld d,(hl) | |||
ROMA:4E0A FA A9 C5 ld a,(C5A9) | |||
ROMA:4E0D E6 00 and a,00 | |||
ROMA:4E0F 28 0D jr z,4E1E | |||
ROMA:4E11 0E 08 ld c,08 | |||
ROMA:4E13 0D dec c | |||
ROMA:4E14 07 rlca | |||
ROMA:4E15 30 FC jr nc,4E13 | |||
ROMA:4E17 06 00 ld b,00 | |||
ROMA:4E19 21 23 4E ld hl,4E23 | |||
ROMA:4E1C 09 add hl,bc | |||
ROMA:4E1D 56 ld d,(hl) | |||
ROMA:4E1E 7A ld a,d | |||
ROMA:4E1F E1 pop hl | |||
ROMA:4E20 D1 pop de | |||
ROMA:4E21 C1 pop bc | |||
ROMA:4E22 C9 ret | |||
=====Array used by A:4DF1===== | |||
ROMA:4E23 | |||
02 02 00 00 00 00 00 00 | |||
====A:4E2B==== | |||
ROMA:4E2B 3E 02 ld a,02 | |||
ROMA:4E2D CD E3 0E call 0EE3 | |||
ROMA:4E30 CD C1 10 call 10C1 | |||
ROMA:4E33 AF xor a | |||
ROMA:4E34 C9 ret | |||
====A:4E35==== | |||
ROMA:4E35 3E 02 ld a,02 | |||
ROMA:4E37 CD E3 0E call 0EE3 | |||
ROMA:4E3A CD C1 10 call 10C1 | |||
ROMA:4E3D 3E 01 ld a,01 | |||
ROMA:4E3F C9 ret | |||
==Bank B - Prolly Display== | ==Bank B - Prolly Display== | ||
Line 22,144: | Line 22,799: | ||
ROMB:4140 D5 push de | ROMB:4140 D5 push de | ||
ROMB:4141 E5 push hl | ROMB:4141 E5 push hl | ||
ROMB:4142 CD 6D 44 [[#Select_Card_Color|call 446D | ROMB:4142 CD 6D 44 [[#Select_Card_Color|call 446D ;Select Card Color]] | ||
ROMB:4145 06 00 ld b,00 | ROMB:4145 06 00 ld b,00 | ||
ROMB:4147 4F ld c,a | ROMB:4147 4F ld c,a | ||
ROMB:4148 CB 21 sla c | ROMB:4148 CB 21 sla c ;bc = Color ID × 2 | ||
ROMB:414A 21 61 41 ld hl,4161 | ROMB:414A 21 61 41 ld hl,4161 | ||
ROMB:414D 09 add hl,bc | ROMB:414D 09 add hl,bc ;hl = Pointer to Color pointers | ||
ROMB:414E 2A ldi a,(hl) | ROMB:414E 2A ldi a,(hl) | ||
ROMB:414F 66 ld h,(hl) | ROMB:414F 66 ld h,(hl) | ||
Line 22,155: | Line 22,810: | ||
ROMB:4151 11 B8 C9 ld de,C9B8 | ROMB:4151 11 B8 C9 ld de,C9B8 | ||
ROMB:4154 0E 08 ld c,08 | ROMB:4154 0E 08 ld c,08 | ||
ROMB:4156 2A ldi a,(hl) | ROMB:4156 2A ldi a,(hl) ;Read next byte | ||
ROMB:4157 12 ld (de),a | ROMB:4157 12 ld (de),a ;Stores it in (C9B8) + current iteration | ||
ROMB:4158 13 inc de | ROMB:4158 13 inc de | ||
ROMB:4159 0D dec c | ROMB:4159 0D dec c | ||
ROMB:415A 20 FA jr nz,4156 | ROMB:415A 20 FA jr nz,4156 ;Loop 8 times | ||
ROMB:415C E1 pop hl | ROMB:415C E1 pop hl | ||
ROMB:415D D1 pop de | ROMB:415D D1 pop de | ||
Line 22,166: | Line 22,821: | ||
ROMB:4160 C9 ret | ROMB:4160 C9 ret | ||
====Color pointers array==== | ====Card Color pointers array==== | ||
ROMB:4161 | ROMB:4161 | ||
6D 41 - Normal Monster | 6D 41 - Normal Monster | ||
Line 22,174: | Line 22,829: | ||
6D 43 - Magic | 6D 43 - Magic | ||
ED 43 - Trap | ED 43 - Trap | ||
====Card Color data arrays==== | |||
=====Card Color - Normal Monster===== | |||
ROMB:416D | |||
82 00 4A 15 D6 36 FF 53 | |||
=====Card Color - Effect Monster===== | |||
ROMB:41ED | |||
04 00 12 00 1B 01 FF 26 | |||
=====Card Color - Fusion Monster ? (''Unused'')===== | |||
ROMB:426D | |||
42 2C 0C 7C F7 7C F9 7E | |||
=====Card Color - Ritual===== | |||
ROMB:42ED | |||
80 38 40 7D 80 7E EE 7F | |||
=====Card Color - Magic===== | |||
ROMB:436D | |||
C0 00 C0 01 40 03 F4 0F | |||
=====Card Color - Trap===== | |||
ROMB:43ED | |||
06 08 0F 1C 1F 54 BF 71 | |||
====Select Card Color==== | ====Select Card Color==== | ||
Line 22,181: | Line 22,861: | ||
ROMB:446E E5 push hl | ROMB:446E E5 push hl | ||
ROMB:446F 06 00 ld b,00 | ROMB:446F 06 00 ld b,00 | ||
ROMB:4471 FA BB C6 ld a,(C6BB) ;Current card Type | ROMB:4471 FA BB C6 ld a,(C6BB) ;Current card Type | ||
ROMB:4474 4F ld c,a | ROMB:4474 4F ld c,a | ||
ROMB:4475 21 8C 44 ld hl,448C | ROMB:4475 21 8C 44 ld hl,448C | ||
ROMB:4478 09 add hl,bc | ROMB:4478 09 add hl,bc ;hl = Pointer to Colors offsets array | ||
ROMB:4479 4E ld c,(hl) | ROMB:4479 4E ld c,(hl) | ||
ROMB:447A 79 ld a,c | ROMB:447A 79 ld a,c ;a = Color offset | ||
ROMB:447B FE 00 cp a,00 | ROMB:447B FE 00 cp a,00 | ||
ROMB:447D 20 09 jr nz,4488 | ROMB:447D 20 09 jr nz,4488 ;if (a ≠ 0), get out of this function | ||
ROMB:447F FA C0 C6 ld a,(C6C0) ;Current card Effect ID (monster) | ROMB:447F FA C0 C6 ld a,(C6C0) ;Current card Effect ID (monster) | ||
ROMB:4482 FE 00 cp a,00 | ROMB:4482 FE 00 cp a,00 | ||
ROMB:4484 28 02 jr z,4488 | ROMB:4484 28 02 jr z,4488 ;if(Normal Monster), offset = 0 | ||
ROMB:4486 0E 01 ld c,01 | ROMB:4486 0E 01 ld c,01 ;if(Effect Monster), offset = 1 | ||
ROMB:4488 79 ld a,c | ROMB:4488 79 ld a,c ;a = Color offset | ||
ROMB:4489 E1 pop hl | ROMB:4489 E1 pop hl | ||
ROMB:448A C1 pop bc | ROMB:448A C1 pop bc | ||
ROMB:448B C9 ret | ROMB:448B C9 ret | ||
====Color offsets array==== | ====Card Color offsets array==== | ||
ROMB:448B | ROMB:448B | ||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ||
Line 22,236: | Line 22,916: | ||
ROMB:45FD C9 ret | ROMB:45FD C9 ret | ||
===B:469E (updates characters displayed on screen ?)=== | ===B:469E (updates colors and characters displayed on screen ?)=== | ||
ROMB:469E F5 push af | ROMB:469E F5 push af | ||
ROMB:469F C5 push bc | ROMB:469F C5 push bc | ||
Line 22,242: | Line 22,922: | ||
ROMB:46A1 3E 18 ld a,18 | ROMB:46A1 3E 18 ld a,18 | ||
ROMB:46A3 CD E3 0E call 0EE3 ;set wC5AE (used to manage display) to 0x18, then idk what, then set wC5AD (used to manage display) to 0 | ROMB:46A3 CD E3 0E call 0EE3 ;set wC5AE (used to manage display) to 0x18, then idk what, then set wC5AD (used to manage display) to 0 | ||
ROMB:46A6 21 B8 C9 ld hl,C9B8 | ROMB:46A6 21 B8 C9 ld hl,C9B8 ;pointer to Screen BG color and other display data | ||
ROMB:46A9 06 02 ld b,02 | ROMB:46A9 06 02 ld b,02 | ||
ROMB:46AB 0E 80 ld c,80 | ROMB:46AB 0E 80 ld c,80 | ||
ROMB:46AD 2A ldi a,(hl) | ROMB:46AD 2A ldi a,(hl) ;a = wC9B8 + offset | ||
ROMB:46AE CD 13 11 [[#Updates_characters_displayed_on_screen|call 1113 ;Updates characters displayed on screen]] | ROMB:46AE CD 13 11 [[#Updates_characters_displayed_on_screen|call 1113 ;Updates characters displayed on screen]] | ||
ROMB:46B1 0D dec c | ROMB:46B1 0D dec c | ||
ROMB:46B2 20 F9 jr nz,46AD | ROMB:46B2 20 F9 jr nz,46AD | ||
ROMB:46B4 05 dec b | ROMB:46B4 05 dec b | ||
ROMB:46B5 20 F4 jr nz,46AB | ROMB:46B5 20 F4 jr nz,46AB ;Loop 384 times | ||
ROMB:46B7 CD C1 10 call 10C1 | ROMB:46B7 CD C1 10 call 10C1 ;Call subroutine waiting for graphics update interrupt to happen and to resolve. Display: (C5AF) = (C5AE), then (C5AE) = 0 | ||
ROMB:46BA E1 pop hl | ROMB:46BA E1 pop hl | ||
ROMB:46BB C1 pop bc | ROMB:46BB C1 pop bc | ||
Line 22,758: | Line 23,438: | ||
ROMD:415A CD 25 20 [[#Hide_Player.27s_Card.2C_Level_-1|call 2025 ;Hide Card, reset Level]] | ROMD:415A CD 25 20 [[#Hide_Player.27s_Card.2C_Level_-1|call 2025 ;Hide Card, reset Level]] | ||
ROMD:415D CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ROMD:415D CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ||
ROMD:4160 CD DF 1F [[# | ROMD:4160 CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROMD:4163 CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ROMD:4163 CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ||
ROMD:4166 CD 00 20 call 2000 ;Card controlled by its owner | ROMD:4166 CD 00 20 call 2000 ;Card controlled by its owner | ||
Line 22,930: | Line 23,610: | ||
ROMD:46D4 CD 25 20 call 2025 | ROMD:46D4 CD 25 20 call 2025 | ||
ROMD:46D7 CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ROMD:46D7 CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ||
ROMD:46DA CD DF 1F [[# | ROMD:46DA CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROMD:46DD CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ROMD:46DD CD FB 19 [[#Updates_selected_card_ID_and_status|call 19FB ;Update selected card ID and status]] | ||
ROMD:46E0 FA A3 C7 ld a,(C7A3) | ROMD:46E0 FA A3 C7 ld a,(C7A3) | ||
Line 23,295: | Line 23,975: | ||
ROMD:5BB7 CD 25 20 [[#Hide_Player.27s_Card.2C_Level_-1|call 2025 ;Hide Card, reset Level]] | ROMD:5BB7 CD 25 20 [[#Hide_Player.27s_Card.2C_Level_-1|call 2025 ;Hide Card, reset Level]] | ||
ROMD:5BBA CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ROMD:5BBA CD C9 1F [[#Reveal_Card|call 1FC9 ;Reveal Card]] | ||
ROMD:5BBD CD DF 1F [[# | ROMD:5BBD CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROMD:5BC0 CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ROMD:5BC0 CD B4 1F [[#Reset_Card_Level|call 1FB4 ;Reset Card Level]] | ||
ROMD:5BC3 CD 00 20 call 2000 ;Card controlled by its owner | ROMD:5BC3 CD 00 20 call 2000 ;Card controlled by its owner | ||
Line 23,485: | Line 24,165: | ||
ROMD:60C8 FE 00 cp a,00 | ROMD:60C8 FE 00 cp a,00 | ||
ROMD:60CA 20 06 jr nz,60D2 | ROMD:60CA 20 06 jr nz,60D2 | ||
ROMD:60CC CD DF 1F call 1FDF | ROMD:60CC CD DF 1F [[#Freeze_Card|call 1FDF ;Freezes Card]] | ||
ROMD:60CF CD FB 19 call 19FB | ROMD:60CF CD FB 19 call 19FB | ||
ROMD:60D2 14 inc d | ROMD:60D2 14 inc d | ||
Line 26,120: | Line 26,800: | ||
E7 60 - Nitemare | E7 60 - Nitemare | ||
9A 65 - Ishizu Ishtar | 9A 65 - Ishizu Ishtar | ||
===3E:742B (Legendary Password ?)=== | |||
RO3E:742B F5 push af | |||
RO3E:742C E5 push hl | |||
RO3E:742D 21 BC 74 ld hl,74BC | |||
RO3E:7430 09 add hl,bc | |||
RO3E:7431 56 ld d,(hl) | |||
RO3E:7432 CB 21 sla c | |||
RO3E:7434 CB 10 rl b | |||
RO3E:7436 21 40 74 ld hl,7440 | |||
RO3E:7439 09 add hl,bc | |||
RO3E:743A 2A ldi a,(hl) | |||
RO3E:743B 46 ld b,(hl) | |||
RO3E:743C 4F ld c,a | |||
RO3E:743D E1 pop hl | |||
RO3E:743E F1 pop af | |||
RO3E:743F C9 ret | |||
====Pointer array used by 3E:742B==== | |||
* <code>0xFB440-0xFB4BB</code> | |||
RO3E:7440 | |||
02 40 - | |||
70 40 - | |||
E3 40 - | |||
5B 41 - | |||
C5 41 - | |||
37 42 - | |||
A3 42 - | |||
13 43 - | |||
7F 43 - | |||
E5 43 - | |||
37 44 - | |||
A1 44 - | |||
0B 45 - | |||
79 45 - | |||
E6 45 - | |||
4F 46 - | |||
BA 46 - | |||
3B 47 - | |||
8A 47 - | |||
F1 47 - | |||
4B 48 - | |||
B2 48 - | |||
17 49 - | |||
6A 49 - | |||
DF 49 - | |||
51 4A - | |||
74 4A - | |||
88 4A - | |||
9C 4A - | |||
AF 4A - | |||
F8 4A - | |||
44 4B - | |||
C0 4B - | |||
3C 4C - | |||
4E 4C - | |||
69 4C - | |||
84 4C - | |||
CA 4C - | |||
11 4D - | |||
35 4D - | |||
A2 4D - | |||
19 4E - | |||
8B 4E - | |||
A7 4E - | |||
C3 4E - | |||
DE 4E - | |||
1F 4F - | |||
7E 4F - | |||
CF 4F - | |||
30 50 - | |||
A2 50 - | |||
E3 50 - | |||
24 51 - | |||
3F 51 - | |||
B1 51 - | |||
CD 51 - | |||
E0 51 - | |||
56 52 - | |||
9C 52 - | |||
E2 52 - | |||
28 53 - | |||
63 53 - | |||
===Data array (3E:74BC, used by func_3E:742B)=== | |||
* <code>0xFB4BC-0xFB4FA</code> - A ton of 0xD5s, followed by many 00s, used by func_3E:742B | |||
RO3E:74BC | |||
D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 | |||
D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 | |||
D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 | |||
D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 00 00 | |||
==Bank 40== | ==Bank 40== |
Latest revision as of 10:02, 17 September 2024
The following article is a ROM map for Yu-Gi-Oh! Dark Duel Stories.
Bank 0
rst
rst 00
ROM0:0000 D9 reti
rst 08
ROM0:0008 C3 A2 11 jp 11A2 ;rst 08 instructions
rst 10
ROM0:0010 D9 reti
rst 18
ROM0:0018 D9 reti
rst 20
ROM0:0020 D9 reti
rst 28
ROM0:0028 D9 reti
rst 30
ROM0:0030 D9 reti
rst 38 (error trap)
ROM0:0038 00 nop ROM0:0039 18 FE jr 0039
rst 40 (vblank)
ROM0:0040 C3 24 05 jp 0524
rst 48 (LCD)
ROM0:0048 00 nop ROM0:0049 D9 reti
rst 50 (timer)
ROM0:0050 C3 2C 3D jp 3D2C ;Read Game Boy Sound file
rst 58 (serial)
ROM0:0058 C3 DA 02 jp 02DA
rst 60 (joypad)
ROM0:0060 D9 reti
ROM start
ROM0:0100 00 nop ROM0:0101 C3 50 01 jp 0150
ROM0:0150 E0 DD ld (ff00+DD),a ;System running the game ROM0:0152 21 00 C0 ld hl,C000 ROM0:0155 01 FF 1F ld bc,1FFF ROM0:0158 AF xor a ROM0:0159 22 ldi (hl),a ;Blanks WRAM ROM0:015A 0B dec bc ROM0:015B 78 ld a,b ROM0:015C B1 or c ROM0:015D 20 F9 jr nz,0158 ;Loops until WRAM is cleared ROM0:015F 21 00 D0 ld hl,D000 ROM0:0162 F9 ld sp,hl ROM0:0163 CD EF 11 call 11EF ;Game Boy Color check ROM0:0166 CD D1 2F call 2FD1 ROM0:0169 3E 01 ld a,01 ROM0:016B E0 70 ld (ff00+70),a ;WRAM Bank 1 ROM0:016D CD 8E 01 call 018E ROM0:0170 CF rst 08 ... ROM0:0173 CF rst 08 ... ROM0:0176 CD D6 29 call 29D6 ROM0:0179 CD 8E 16 call 168E ROM0:017C CD A0 04 call 04A0 ;Initialize Joypad ? ROM0:017F CD D8 0E call 0ED8 ;Sets (C5AE) and OAM pointer offset to 0 ROM0:0182 CD 99 02 call 0299 ;Disable Serial (Game Link) ROM0:0185 CF rst 08 ... ROM0:0188 CF rst 08 ... ROM0:018B 18 FE jr 018B ;Error trap ROM0:018D C9 ret
0:018E
ROM0:018E F5 push af ROM0:018F 3E E0 ld a,E0 ROM0:0191 E0 DF ld (ff00+DF),a ;(FFDF) = 0xE0 ROM0:0193 CD 11 02 call 0211 ;Set (C5A0) and (C5A1) to 0 ROM0:0196 CD 9B 01 call 019B ROM0:0199 F1 pop af ROM0:019A C9 ret
0:019B
ROM0:019B F5 push af ROM0:019C C5 push bc ROM0:019D D5 push de ROM0:019E E5 push hl ROM0:019F 21 BF 01 ld hl,01BF ROM0:01A2 0E E0 ld c,E0 ROM0:01A4 06 02 ld b,02 ROM0:01A6 1E 05 ld e,05 ROM0:01A8 2A ldi a,(hl) ROM0:01A9 E2 ld (ff00+c),a ;Copy array at 0:01BF to (FFE0) ROM0:01AA 0C inc c ROM0:01AB 1D dec e ROM0:01AC 20 FA jr nz,01A8 ROM0:01AE 2A ldi a,(hl) ROM0:01AF 5F ld e,a ROM0:01B0 2A ldi a,(hl) ROM0:01B1 57 ld d,a ROM0:01B2 2A ldi a,(hl) ROM0:01B3 12 ld (de),a ROM0:01B4 13 inc de ROM0:01B5 2A ldi a,(hl) ROM0:01B6 12 ld (de),a ROM0:01B7 05 dec b ROM0:01B8 20 EC jr nz,01A6 ROM0:01BA E1 pop hl ROM0:01BB D1 pop de ROM0:01BC C1 pop bc ROM0:01BD F1 pop af ROM0:01BE C9 ret
0:01BF (array)
ROM0:01BF 76 CF 04 00 01 7E CF D1 41 76 CD 3D 00 03 7E CD 04 40
ROM Bank + WRAM Bank switching
ROM0:01D1 F5 push af ROM0:01D2 C5 push bc ROM0:01D3 D5 push de ROM0:01D4 E5 push hl ROM0:01D5 F8 08 ld hl,sp+08 ROM0:01D7 2A ldi a,(hl) ROM0:01D8 5F ld e,a ROM0:01D9 56 ld d,(hl) ROM0:01DA 1A ld a,(de) ROM0:01DB 47 ld b,a ROM0:01DC 13 inc de ROM0:01DD 7A ld a,d ROM0:01DE 32 ldd (hl),a ROM0:01DF 73 ld (hl),e ROM0:01E0 F0 DF ld a,(ff00+DF) ROM0:01E2 4F ld c,a ROM0:01E3 F8 00 ld hl,sp+00 ROM0:01E5 7D ld a,l ROM0:01E6 E2 ld (ff00+c),a ROM0:01E7 0C inc c ROM0:01E8 7C ld a,h ROM0:01E9 E2 ld (ff00+c),a ROM0:01EA 0C inc c ROM0:01EB FA 00 40 ld a,(4000) ;ROM Bank ROM0:01EE E2 ld (ff00+c),a ROM0:01EF 0C inc c ROM0:01F0 FA 01 40 ld a,(4001) ;WRAM Bank ROM0:01F3 E2 ld (ff00+c),a ROM0:01F4 0C inc c ROM0:01F5 F0 70 ld a,(ff00+70) ;WRAM Bank switch ROM0:01F7 E2 ld (ff00+c),a ROM0:01F8 78 ld a,b ROM0:01F9 E0 DF ld (ff00+DF),a ROM0:01FB 4F ld c,a ROM0:01FC F2 ld a,(ff00+c) ROM0:01FD 6F ld l,a ROM0:01FE 0C inc c ROM0:01FF F2 ld a,(ff00+c) ROM0:0200 67 ld h,a ROM0:0201 F9 ld sp,hl ROM0:0202 0C inc c ROM0:0203 F2 ld a,(ff00+c) ROM0:0204 0C inc c ROM0:0205 0C inc c ROM0:0206 CD 00 12 call 1200 ;ROM Bank switch ROM0:0209 F2 ld a,(ff00+c) ROM0:020A E0 70 ld (ff00+70),a ROM0:020C E1 pop hl ROM0:020D D1 pop de ROM0:020E C1 pop bc ROM0:020F F1 pop af ROM0:0210 C9 ret
0:0211
ROM0:0211 F5 push af ROM0:0212 AF xor a ROM0:0213 EA A0 C5 ld (C5A0),a ROM0:0216 EA A1 C5 ld (C5A1),a ROM0:0219 F1 pop af ROM0:021A C9 ret
0:021B
ROM0:021B F5 push af ROM0:021C C5 push bc ROM0:021D D5 push de ROM0:021E FA A0 C5 ld a,(C5A0) ROM0:0221 5F ld e,a ROM0:0222 FA A1 C5 ld a,(C5A1) ROM0:0225 BB cp e ROM0:0226 20 04 jr nz,022C ROM0:0228 CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROM0:022B E5 push hl ROM0:022C 16 C0 ld d,C0 ROM0:022E 0E 80 ld c,80 ROM0:0230 1A ld a,(de) ROM0:0231 22 ldi (hl),a ROM0:0232 1C inc e ROM0:0233 0D dec c ROM0:0234 20 FA jr nz,0230 ROM0:0236 7B ld a,e ROM0:0237 EA A0 C5 ld (C5A0),a ROM0:023A D1 pop de ROM0:023B C1 pop bc ROM0:023C F1 pop af ROM0:023D C9 ret
0:023E
ROM0:023E D5 push de ROM0:023F FA A0 C5 ld a,(C5A0) ROM0:0242 5F ld e,a ROM0:0243 FA A1 C5 ld a,(C5A1) ROM0:0246 BB cp e ROM0:0247 20 06 jr nz,024F ROM0:0249 CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROM0:024C E5 push hl ROM0:024D 18 F4 jr 0243 ROM0:024F 16 C0 ld d,C0 ROM0:0251 1A ld a,(de) ROM0:0252 57 ld d,a ROM0:0253 1C inc e ROM0:0254 7B ld a,e ROM0:0255 EA A0 C5 ld (C5A0),a ROM0:0258 7A ld a,d ROM0:0259 D1 pop de ROM0:025A C9 ret
0:025B
ROM0:025B F5 push af ROM0:025C D5 push de ROM0:025D F5 push af ROM0:025E FA A1 C5 ld a,(C5A1) ROM0:0261 5F ld e,a ROM0:0262 3E 80 ld a,80 ROM0:0264 83 add e ROM0:0265 57 ld d,a ROM0:0266 FA A0 C5 ld a,(C5A0) ROM0:0269 BA cp d ROM0:026A 20 06 jr nz,0272 ;If(((C5A1) + 0x80) ≠ (C5A0)), jump to 0:0272 ROM0:026C CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROM0:026F E0 18 ld (ff00+18),a ;NR23 - Channel 2 Frequency low ... ROM0:0272 F1 pop af ROM0:0273 16 C0 ld d,C0 ROM0:0275 12 ld (de),a ;Write in (C000) - (C0FF) area ROM0:0276 1C inc e ROM0:0277 7B ld a,e ROM0:0278 EA A1 C5 ld (C5A1),a ROM0:027B D1 pop de ROM0:027C F1 pop af ROM0:027D C9 ret
Game Link
0:0299
ROM0:0299 F5 push af ROM0:029A E5 push hl ROM0:029B F3 di ROM0:029C CD 69 1D call 1D69 ROM0:029F 21 FF FF ld hl,FFFF ROM0:02A2 CB 9E res 3,(hl) ;Serial Interrupt Disabled ROM0:02A4 21 0F FF ld hl,FF0F ROM0:02A7 CB 9E res 3,(hl) ;Serial Interrupt Flag = 0 ROM0:02A9 3E 00 ld a,00 ROM0:02AB EA A3 C5 ld (C5A3),a ROM0:02AE AF xor a ROM0:02AF EA A6 C5 ld (C5A6),a ROM0:02B2 EA A4 C5 ld (C5A4),a ROM0:02B5 EA A5 C5 ld (C5A5),a ROM0:02B8 EA A2 C5 ld (C5A2),a ROM0:02BB E0 02 ld (ff00+02),a ;Serial Transfer control: No Transfer, Normal Clock Speed ROM0:02BD 3E 00 ld a,00 ROM0:02BF E0 01 ld (ff00+01),a ;Serial Transfer data = 0 ROM0:02C1 21 02 FF ld hl,FF02 ROM0:02C4 CB 86 res 0,(hl) ;Serial Transfer control: External Clock ROM0:02C6 FB ei ROM0:02C7 E1 pop hl ROM0:02C8 F1 pop af ROM0:02C9 C9 ret
rst 58 - Serial Interrupt
ROM0:02DA F5 push af ROM0:02DB C5 push bc ROM0:02DC D5 push de ROM0:02DD E5 push hl ROM0:02DE FA A3 C5 ld a,(C5A3) ROM0:02E1 FE 00 cp a,00 ROM0:02E3 20 05 jr nz,02EA ROM0:02E5 CD 00 03 call 0300 ROM0:02E8 18 10 jr 02FA ROM0:02EA FE 02 cp a,02 ROM0:02EC 20 05 jr nz,02F3 ROM0:02EE CD 19 03 call 0319 ROM0:02F1 18 07 jr 02FA ROM0:02F3 FE 04 cp a,04 ROM0:02F5 20 03 jr nz,02FA ROM0:02F7 CD 24 03 call 0324 ROM0:02FA E1 pop hl ROM0:02FB D1 pop de ROM0:02FC C1 pop bc ROM0:02FD F1 pop af ROM0:02FE D9 reti ROM0:02FF C9 ret
0:0300
ROM0:0300 F0 01 ld a,(ff00+01) ROM0:0302 EA A4 C5 ld (C5A4),a ROM0:0305 FE 20 cp a,20 ROM0:0307 28 0F jr z,0318 ROM0:0309 3E 00 ld a,00 ROM0:030B E0 01 ld (ff00+01),a ROM0:030D CD 80 04 call 0480 ROM0:0310 3E 00 ld a,00 ROM0:0312 E0 02 ld (ff00+02),a ROM0:0314 3E 80 ld a,80 ROM0:0316 E0 02 ld (ff00+02),a ROM0:0318 C9 ret
0:0319
ROM0:0319 F0 01 ld a,(ff00+01) ROM0:031B EA A4 C5 ld (C5A4),a ROM0:031E 3E 01 ld a,01 ROM0:0320 EA A2 C5 ld (C5A2),a ROM0:0323 C9 ret
0:0324
ROM0:0324 F0 01 ld a,(ff00+01) ROM0:0326 EA A4 C5 ld (C5A4),a ROM0:0329 4F ld c,a ROM0:032A E6 F0 and a,F0 ROM0:032C FE 80 cp a,80 ROM0:032E 20 08 jr nz,0338 ROM0:0330 FA A4 C5 ld a,(C5A4) ROM0:0333 CD A8 1D call 1DA8 ROM0:0336 18 07 jr 033F ROM0:0338 FE 50 cp a,50 ROM0:033A 28 03 jr z,033F ROM0:033C CD F6 1B call 1BF6 ROM0:033F FA A5 C5 ld a,(C5A5) ROM0:0342 E0 01 ld (ff00+01),a ROM0:0344 21 02 FF ld hl,FF02 ROM0:0347 CB FE set 7,(hl) ROM0:0349 3E 01 ld a,01 ROM0:034B EA A2 C5 ld (C5A2),a ROM0:034E AF xor a ROM0:034F EA B5 C5 ld (C5B5),a ROM0:0352 EA B6 C5 ld (C5B6),a ROM0:0355 EA B7 C5 ld (C5B7),a ROM0:0358 C9 ret
Checks Game Link status
0x359-0x39F
Checks Game Link status, returns 0 if there's no error, or 1 if there's an error
ROM0:0359 C5 push bc ROM0:035A D5 push de ROM0:035B E5 push hl ROM0:035C CD 99 02 call 0299 ROM0:035F CD 4B 1D call 1D4B ROM0:0362 1E 00 ld e,00 ROM0:0364 06 0A ld b,0A ROM0:0366 16 01 ld d,01 ROM0:0368 0E 3C ld c,3C ROM0:036A CD BF 03 call 03BF ROM0:036D FE 00 cp a,00 ROM0:036F 20 06 jr nz,0377 ROM0:0371 1E 01 ld e,01 ROM0:0373 16 00 ld d,00 ROM0:0375 18 1A jr 0391 ROM0:0377 0D dec c ROM0:0378 20 F0 jr nz,036A ROM0:037A 0E 02 ld c,02 ROM0:037C 05 dec b ROM0:037D 28 19 jr z,0398 ROM0:037F CD A0 03 call 03A0 ROM0:0382 FE 00 cp a,00 ROM0:0384 20 06 jr nz,038C ROM0:0386 1E 02 ld e,02 ROM0:0388 16 00 ld d,00 ROM0:038A 18 05 jr 0391 ROM0:038C 0D dec c ROM0:038D 20 ED jr nz,037C ROM0:038F 18 D7 jr 0368 ROM0:0391 CD E2 03 call 03E2 ROM0:0394 FE 00 cp a,00 ROM0:0396 20 CA jr nz,0362 ROM0:0398 CD 5A 1D call 1D5A ROM0:039B 7A ld a,d ROM0:039C E1 pop hl ROM0:039D D1 pop de ROM0:039E C1 pop bc ROM0:039F C9 ret
0:03A0
ROM0:03A0 E5 push hl ROM0:03A1 21 02 FF ld hl,FF02 ROM0:03A4 36 00 ld (hl),00 ROM0:03A6 3E 10 ld a,10 ROM0:03A8 E0 01 ld (ff00+01),a ROM0:03AA 36 01 ld (hl),01 ROM0:03AC CB FE set 7,(hl) ROM0:03AE CD 4B 11 call 114B ROM0:03B1 2E 01 ld l,01 ROM0:03B3 FA A4 C5 ld a,(C5A4) ROM0:03B6 FE 20 cp a,20 ROM0:03B8 20 02 jr nz,03BC ROM0:03BA 2E 00 ld l,00 ROM0:03BC 7D ld a,l ROM0:03BD E1 pop hl ROM0:03BE C9 ret
0:03BF
ROM0:03BF E5 push hl ROM0:03C0 21 02 FF ld hl,FF02 ROM0:03C3 3E 00 ld a,00 ROM0:03C5 77 ld (hl),a ROM0:03C6 3E 00 ld a,00 ROM0:03C8 EA A4 C5 ld (C5A4),a ROM0:03CB 3E 20 ld a,20 ROM0:03CD E0 01 ld (ff00+01),a ROM0:03CF CB FE set 7,(hl) ROM0:03D1 CD 4B 11 call 114B ROM0:03D4 2E 01 ld l,01 ROM0:03D6 FA A4 C5 ld a,(C5A4) ROM0:03D9 FE 10 cp a,10 ROM0:03DB 20 02 jr nz,03DF ROM0:03DD 2E 00 ld l,00 ROM0:03DF 7D ld a,l ROM0:03E0 E1 pop hl ROM0:03E1 C9 ret
0:03E2
ROM0:03E2 C5 push bc ROM0:03E3 D5 push de ROM0:03E4 06 01 ld b,01 ROM0:03E6 7B ld a,e ROM0:03E7 FE 01 cp a,01 ROM0:03E9 20 09 jr nz,03F4 ROM0:03EB CD 22 04 call 0422 ROM0:03EE CD 4A 04 call 044A ROM0:03F1 47 ld b,a ROM0:03F2 18 14 jr 0408 ROM0:03F4 FE 02 cp a,02 ROM0:03F6 20 10 jr nz,0408 ROM0:03F8 CD D9 1B call 1BD9 ROM0:03FB CD 0F 04 call 040F ROM0:03FE CD D9 1B call 1BD9 ROM0:0401 CD 33 04 call 0433 ROM0:0404 47 ld b,a ROM0:0405 CD D9 1B call 1BD9 ROM0:0408 D1 pop de ROM0:0409 C1 pop bc ROM0:040A C9 ret
0:040B
ROM0:040B EA A3 C5 ld (C5A3),a ROM0:040E C9 ret
Stop data transfer
ROM0:040F F5 push af ROM0:0410 E5 push hl ROM0:0411 3E 10 ld a,10 ROM0:0413 EA A6 C5 ld (C5A6),a ROM0:0416 3E 02 ld a,02 ROM0:0418 CD 0B 04 call 040B ;(C5A3) = 2 ROM0:041B 3E 01 ld a,01 ROM0:041D E0 02 ld (ff00+02),a ;Stop transfer, Fast Clock speed ROM0:041F E1 pop hl ROM0:0420 F1 pop af ROM0:0421 C9 ret
0:0422
ROM0:0422 F5 push af ROM0:0423 3E 20 ld a,20 ROM0:0425 EA A6 C5 ld (C5A6),a ;(C5A6) = 0x20 ROM0:0428 3E 04 ld a,04 ROM0:042A CD 0B 04 call 040B ;(C5A3) = 4 ROM0:042D 3E 00 ld a,00 ROM0:042F E0 02 ld (ff00+02),a ROM0:0431 F1 pop af ROM0:0432 C9 ret
0:0433
ROM0:0433 C5 push bc ROM0:0434 06 01 ld b,01 ROM0:0436 3E 50 ld a,50 ROM0:0438 CD 61 04 call 0461 ROM0:043B CD 4B 11 call 114B ROM0:043E FA A4 C5 ld a,(C5A4) ROM0:0441 FE 60 cp a,60 ROM0:0443 20 02 jr nz,0447 ROM0:0445 06 00 ld b,00 ROM0:0447 78 ld a,b ROM0:0448 C1 pop bc ROM0:0449 C9 ret
0:044A
ROM0:044A C5 push bc ROM0:044B 06 01 ld b,01 ROM0:044D 3E 60 ld a,60 ROM0:044F CD 89 04 call 0489 ;Start data transfer ROM0:0452 CD 65 11 call 1165 ROM0:0455 FA A4 C5 ld a,(C5A4) ROM0:0458 FE 50 cp a,50 ROM0:045A 20 02 jr nz,045E ROM0:045C 06 00 ld b,00 ROM0:045E 78 ld a,b ROM0:045F C1 pop bc ROM0:0460 C9 ret
0:0461
ROM0:0461 F5 push af ROM0:0462 E5 push hl ROM0:0463 F3 di ROM0:0464 21 02 FF ld hl,FF02 ROM0:0467 CD 74 04 call 0474 ROM0:046A 36 01 ld (hl),01 ROM0:046C E0 01 ld (ff00+01),a ROM0:046E CB FE set 7,(hl) ROM0:0470 FB ei ROM0:0471 E1 pop hl ROM0:0472 F1 pop af ROM0:0473 C9 ret
0:0474
ROM0:0474 F5 push af ROM0:0475 E5 push hl ROM0:0476 21 02 FF ld hl,FF02 ROM0:0479 CB 7E bit 7,(hl) ROM0:047B 20 FC jr nz,0479 ROM0:047D E1 pop hl ROM0:047E F1 pop af ROM0:047F C9 ret
0:0480
ROM0:0480 F5 push af ROM0:0481 AF xor a ROM0:0482 00 nop ROM0:0483 00 nop ROM0:0484 3D dec a ROM0:0485 20 FB jr nz,0482 ROM0:0487 F1 pop af ROM0:0488 C9 ret
Start data transfer
ROM0:0489 F5 push af ROM0:048A E5 push hl ROM0:048B F5 push af ROM0:048C F3 di ROM0:048D AF xor a ROM0:048E EA A2 C5 ld (C5A2),a ROM0:0491 3E 00 ld a,00 ROM0:0493 E0 02 ld (ff00+02),a ;Serial Transfer Control (R/W) ROM0:0495 F1 pop af ROM0:0496 E0 01 ld (ff00+01),a ;Serial transfer data (R/W) ROM0:0498 3E 80 ld a,80 ROM0:049A E0 02 ld (ff00+02),a ;Start transfer, Normal Clock speed, External Clock ROM0:049C FB ei ROM0:049D E1 pop hl ROM0:049E F1 pop af ROM0:049F C9 ret
ROM0:04A0 F5 push af ROM0:04A1 3E FF ld a,FF ROM0:04A3 EA A7 C5 ld (C5A7),a ROM0:04A6 AF xor a ROM0:04A7 EA A8 C5 ld (C5A8),a ROM0:04AA EA A9 C5 ld (C5A9),a ROM0:04AD 3E 14 ld a,14 ROM0:04AF EA AA C5 ld (C5AA),a ROM0:04B2 F1 pop af ROM0:04B3 C9 ret
0:04B4 (Joypad inputs ?)
ROM0:04B4 F5 push af ROM0:04B5 C5 push bc ROM0:04B6 D5 push de ROM0:04B7 3E 20 ld a,20 ROM0:04B9 E0 00 ld (ff00+00),a ROM0:04BB F0 00 ld a,(ff00+00) ;Joypad ROM0:04BD F0 00 ld a,(ff00+00) ROM0:04BF 2F cpl ROM0:04C0 E6 0F and a,0F ROM0:04C2 CB 37 swap a ROM0:04C4 47 ld b,a ROM0:04C5 3E 10 ld a,10 ROM0:04C7 E0 00 ld (ff00+00),a ;Disable Direction keys ROM0:04C9 F0 00 ld a,(ff00+00) ROM0:04CB F0 00 ld a,(ff00+00) ROM0:04CD F0 00 ld a,(ff00+00) ROM0:04CF F0 00 ld a,(ff00+00) ROM0:04D1 F0 00 ld a,(ff00+00) ROM0:04D3 F0 00 ld a,(ff00+00) ROM0:04D5 2F cpl ;Enable Direction keys ROM0:04D6 E6 0F and a,0F ROM0:04D8 B0 or b ROM0:04D9 4F ld c,a ROM0:04DA FA A7 C5 ld a,(C5A7) ROM0:04DD 57 ld d,a ROM0:04DE A9 xor c ROM0:04DF A1 and c ROM0:04E0 EA A8 C5 ld (C5A8),a ROM0:04E3 79 ld a,c ROM0:04E4 EA A7 C5 ld (C5A7),a ROM0:04E7 3E 30 ld a,30 ROM0:04E9 E0 00 ld (ff00+00),a ROM0:04EB FA A7 C5 ld a,(C5A7) ROM0:04EE BA cp d ROM0:04EF 20 19 jr nz,050A ROM0:04F1 3E 00 ld a,00 ROM0:04F3 EA A9 C5 ld (C5A9),a ;(C5A9) = 0 ROM0:04F6 FA AA C5 ld a,(C5AA) ROM0:04F9 3D dec a ROM0:04FA EA AA C5 ld (C5AA),a ;(C5AA) -- ROM0:04FD 20 09 jr nz,0508 ;If(a == 0), jump to 0:0508 ROM0:04FF 3E 03 ld a,03 ROM0:0501 EA AA C5 ld (C5AA),a ;Else (C5AA) = 3 ROM0:0504 7A ld a,d ROM0:0505 EA A9 C5 ld (C5A9),a ROM0:0508 18 08 jr 0512 ROM0:050A EA A9 C5 ld (C5A9),a ROM0:050D 3E 14 ld a,14 ROM0:050F EA AA C5 ld (C5AA),a ;(C5AA) = 14 ROM0:0512 D1 pop de ROM0:0513 C1 pop bc ROM0:0514 F1 pop af ROM0:0515 C9 ret
Object Attribute Memory
rst 40 - Load pointer to OAM subroutine
ROM0:0524 F5 push af ROM0:0525 E5 push hl ROM0:0526 C5 push bc ROM0:0527 D5 push de ROM0:0528 06 00 ld b,00 ROM0:052A FA AF C5 ld a,(C5AF) ROM0:052D 4F ld c,a ROM0:052E 21 36 05 ld hl,0536 ROM0:0531 09 add hl,bc ROM0:0532 2A ldi a,(hl) ROM0:0533 66 ld h,(hl) ROM0:0534 6F ld l,a ROM0:0535 E9 jp hl
Pointer array
ROM0:0536 56 05 60 05 72 05 87 05 E6 05 F5 05 6B 08 31 09 81 0A C5 0B 52 0C
0:0556
ROM0:0556 3E 01 ld a,01 ROM0:0558 EA AC C5 ld (C5AC),a ROM0:055B D1 pop de ROM0:055C C1 pop bc ROM0:055D E1 pop hl ROM0:055E F1 pop af ROM0:055F D9 reti
0:0560
ROM0:0560 3E 00 ld a,00 ROM0:0562 EA AF C5 ld (C5AF),a ROM0:0565 3E 01 ld a,01 ROM0:0567 EA AC C5 ld (C5AC),a ROM0:056A CD B4 04 call 04B4 ROM0:056D D1 pop de ROM0:056E C1 pop bc ROM0:056F E1 pop hl ROM0:0570 F1 pop af ROM0:0571 D9 reti
0:0572 (OAM)
ROM0:0572 CD F5 FF call FFF5 ;OAM ROM0:0575 3E 00 ld a,00 ROM0:0577 EA AF C5 ld (C5AF),a ROM0:057A 3E 01 ld a,01 ROM0:057C EA AC C5 ld (C5AC),a ROM0:057F CD B4 04 call 04B4 ROM0:0582 D1 pop de ROM0:0583 C1 pop bc ROM0:0584 E1 pop hl ROM0:0585 F1 pop af ROM0:0586 D9 reti
0:0587 (OAM)
ROM0:0587 CD F5 FF call FFF5 ;OAM ROM0:058A 01 00 C1 ld bc,C100 ROM0:058D 1E 04 ld e,04 ROM0:058F 0A ld a,(bc) ROM0:0590 6F ld l,a ROM0:0591 0C inc c ROM0:0592 0A ld a,(bc) ROM0:0593 67 ld h,a ROM0:0594 0C inc c ROM0:0595 0A ld a,(bc) ROM0:0596 22 ldi (hl),a ROM0:0597 0C inc c ROM0:0598 0A ld a,(bc) ROM0:0599 22 ldi (hl),a ROM0:059A 0C inc c ROM0:059B 0A ld a,(bc) ROM0:059C 22 ldi (hl),a ROM0:059D 0C inc c ROM0:059E 0A ld a,(bc) ROM0:059F 22 ldi (hl),a ROM0:05A0 0C inc c ROM0:05A1 0A ld a,(bc) ROM0:05A2 22 ldi (hl),a ROM0:05A3 0C inc c ROM0:05A4 0A ld a,(bc) ROM0:05A5 22 ldi (hl),a ROM0:05A6 0C inc c ROM0:05A7 0A ld a,(bc) ROM0:05A8 22 ldi (hl),a ROM0:05A9 0C inc c ROM0:05AA 0A ld a,(bc) ROM0:05AB 22 ldi (hl),a ROM0:05AC 0C inc c ROM0:05AD 0A ld a,(bc) ROM0:05AE 22 ldi (hl),a ROM0:05AF 0C inc c ROM0:05B0 0A ld a,(bc) ROM0:05B1 22 ldi (hl),a ROM0:05B2 0C inc c ROM0:05B3 0A ld a,(bc) ROM0:05B4 22 ldi (hl),a ROM0:05B5 0C inc c ROM0:05B6 0A ld a,(bc) ROM0:05B7 22 ldi (hl),a ROM0:05B8 0C inc c ROM0:05B9 0A ld a,(bc) ROM0:05BA 22 ldi (hl),a ROM0:05BB 0C inc c ROM0:05BC 0A ld a,(bc) ROM0:05BD 22 ldi (hl),a ROM0:05BE 0C inc c ROM0:05BF 0A ld a,(bc) ROM0:05C0 22 ldi (hl),a ROM0:05C1 0C inc c ROM0:05C2 0A ld a,(bc) ROM0:05C3 22 ldi (hl),a ROM0:05C4 0C inc c ROM0:05C5 0A ld a,(bc) ROM0:05C6 22 ldi (hl),a ROM0:05C7 0C inc c ROM0:05C8 0A ld a,(bc) ROM0:05C9 22 ldi (hl),a ROM0:05CA 0C inc c ROM0:05CB 0A ld a,(bc) ROM0:05CC 22 ldi (hl),a ROM0:05CD 0C inc c ROM0:05CE 0A ld a,(bc) ROM0:05CF 22 ldi (hl),a ROM0:05D0 0C inc c ROM0:05D1 1D dec e ROM0:05D2 20 BB jr nz,058F ROM0:05D4 3E 00 ld a,00 ROM0:05D6 EA AF C5 ld (C5AF),a ROM0:05D9 3E 01 ld a,01 ROM0:05DB EA AC C5 ld (C5AC),a ROM0:05DE CD B4 04 call 04B4 ROM0:05E1 D1 pop de ROM0:05E2 C1 pop bc ROM0:05E3 E1 pop hl ROM0:05E4 F1 pop af ROM0:05E5 D9 reti
0:05E6
ROM0:05E6 3E 00 ld a,00 ROM0:05E8 EA AF C5 ld (C5AF),a ROM0:05EB 3E 01 ld a,01 ROM0:05ED EA AC C5 ld (C5AC),a ROM0:05F0 D1 pop de ROM0:05F1 C1 pop bc ROM0:05F2 E1 pop hl ROM0:05F3 F1 pop af ROM0:05F4 D9 reti
0:05F5 (OAM)
ROM0:05F5 CD F5 FF call FFF5 ;OAM ROM0:05F8 01 00 C1 ld bc,C100 ROM0:05FB 0A ld a,(bc) ROM0:05FC 6F ld l,a ROM0:05FD 0C inc c ROM0:05FE 0A ld a,(bc) ROM0:05FF 67 ld h,a ROM0:0600 0C inc c ROM0:0601 0A ld a,(bc) ROM0:0602 22 ldi (hl),a ROM0:0603 0C inc c ROM0:0604 0A ld a,(bc) ROM0:0605 22 ldi (hl),a ROM0:0606 0C inc c ROM0:0607 0A ld a,(bc) ROM0:0608 22 ldi (hl),a ROM0:0609 0C inc c ROM0:060A 0A ld a,(bc) ROM0:060B 22 ldi (hl),a ROM0:060C 0C inc c ROM0:060D 0A ld a,(bc) ROM0:060E 22 ldi (hl),a ROM0:060F 0C inc c ROM0:0610 0A ld a,(bc) ROM0:0611 22 ldi (hl),a ROM0:0612 0C inc c ROM0:0613 0A ld a,(bc) ROM0:0614 22 ldi (hl),a ROM0:0615 0C inc c ROM0:0616 0A ld a,(bc) ROM0:0617 22 ldi (hl),a ROM0:0618 0C inc c ROM0:0619 0A ld a,(bc) ROM0:061A 6F ld l,a ROM0:061B 0C inc c ROM0:061C 0A ld a,(bc) ROM0:061D 67 ld h,a ROM0:061E 0C inc c ROM0:061F 0A ld a,(bc) ROM0:0620 22 ldi (hl),a ROM0:0621 0C inc c ROM0:0622 0A ld a,(bc) ROM0:0623 22 ldi (hl),a ROM0:0624 0C inc c ROM0:0625 0A ld a,(bc) ROM0:0626 22 ldi (hl),a ROM0:0627 0C inc c ROM0:0628 0A ld a,(bc) ROM0:0629 22 ldi (hl),a ROM0:062A 0C inc c ROM0:062B 0A ld a,(bc) ROM0:062C 22 ldi (hl),a ROM0:062D 0C inc c ROM0:062E 0A ld a,(bc) ROM0:062F 22 ldi (hl),a ROM0:0630 0C inc c ROM0:0631 0A ld a,(bc) ROM0:0632 22 ldi (hl),a ROM0:0633 0C inc c ROM0:0634 0A ld a,(bc) ROM0:0635 22 ldi (hl),a ROM0:0636 0C inc c ROM0:0637 0A ld a,(bc) ROM0:0638 6F ld l,a ROM0:0639 0C inc c ROM0:063A 0A ld a,(bc) ROM0:063B 67 ld h,a ROM0:063C 0C inc c ROM0:063D 0A ld a,(bc) ROM0:063E 22 ldi (hl),a ROM0:063F 0C inc c ROM0:0640 0A ld a,(bc) ROM0:0641 22 ldi (hl),a ROM0:0642 0C inc c ROM0:0643 0A ld a,(bc) ROM0:0644 22 ldi (hl),a ROM0:0645 0C inc c ROM0:0646 0A ld a,(bc) ROM0:0647 22 ldi (hl),a ROM0:0648 0C inc c ROM0:0649 0A ld a,(bc) ROM0:064A 22 ldi (hl),a ROM0:064B 0C inc c ROM0:064C 0A ld a,(bc) ROM0:064D 22 ldi (hl),a ROM0:064E 0C inc c ROM0:064F 0A ld a,(bc) ROM0:0650 22 ldi (hl),a ROM0:0651 0C inc c ROM0:0652 0A ld a,(bc) ROM0:0653 22 ldi (hl),a ROM0:0654 0C inc c ROM0:0655 0A ld a,(bc) ROM0:0656 6F ld l,a ROM0:0657 0C inc c ROM0:0658 0A ld a,(bc) ROM0:0659 67 ld h,a ROM0:065A 0C inc c ROM0:065B 0A ld a,(bc) ROM0:065C 22 ldi (hl),a ROM0:065D 0C inc c ROM0:065E 0A ld a,(bc) ROM0:065F 22 ldi (hl),a ROM0:0660 0C inc c ROM0:0661 0A ld a,(bc) ROM0:0662 22 ldi (hl),a ROM0:0663 0C inc c ROM0:0664 0A ld a,(bc) ROM0:0665 22 ldi (hl),a ROM0:0666 0C inc c ROM0:0667 0A ld a,(bc) ROM0:0668 22 ldi (hl),a ROM0:0669 0C inc c ROM0:066A 0A ld a,(bc) ROM0:066B 22 ldi (hl),a ROM0:066C 0C inc c ROM0:066D 0A ld a,(bc) ROM0:066E 22 ldi (hl),a ROM0:066F 0C inc c ROM0:0670 0A ld a,(bc) ROM0:0671 22 ldi (hl),a ROM0:0672 0C inc c ROM0:0673 0A ld a,(bc) ROM0:0674 6F ld l,a ROM0:0675 0C inc c ROM0:0676 0A ld a,(bc) ROM0:0677 67 ld h,a ROM0:0678 0C inc c ROM0:0679 0A ld a,(bc) ROM0:067A 22 ldi (hl),a ROM0:067B 0C inc c ROM0:067C 0A ld a,(bc) ROM0:067D 22 ldi (hl),a ROM0:067E 0C inc c ROM0:067F 0A ld a,(bc) ROM0:0680 22 ldi (hl),a ROM0:0681 0C inc c ROM0:0682 0A ld a,(bc) ROM0:0683 22 ldi (hl),a ROM0:0684 0C inc c ROM0:0685 0A ld a,(bc) ROM0:0686 22 ldi (hl),a ROM0:0687 0C inc c ROM0:0688 0A ld a,(bc) ROM0:0689 22 ldi (hl),a ROM0:068A 0C inc c ROM0:068B 0A ld a,(bc) ROM0:068C 22 ldi (hl),a ROM0:068D 0C inc c ROM0:068E 0A ld a,(bc) ROM0:068F 22 ldi (hl),a ROM0:0690 0C inc c ROM0:0691 0A ld a,(bc) ROM0:0692 6F ld l,a ROM0:0693 0C inc c ROM0:0694 0A ld a,(bc) ROM0:0695 67 ld h,a ROM0:0696 0C inc c ROM0:0697 0A ld a,(bc) ROM0:0698 22 ldi (hl),a ROM0:0699 0C inc c ROM0:069A 0A ld a,(bc) ROM0:069B 22 ldi (hl),a ROM0:069C 0C inc c ROM0:069D 0A ld a,(bc) ROM0:069E 22 ldi (hl),a ROM0:069F 0C inc c ROM0:06A0 0A ld a,(bc) ROM0:06A1 22 ldi (hl),a ROM0:06A2 0C inc c ROM0:06A3 0A ld a,(bc) ROM0:06A4 22 ldi (hl),a ROM0:06A5 0C inc c ROM0:06A6 0A ld a,(bc) ROM0:06A7 22 ldi (hl),a ROM0:06A8 0C inc c ROM0:06A9 0A ld a,(bc) ROM0:06AA 22 ldi (hl),a ROM0:06AB 0C inc c ROM0:06AC 0A ld a,(bc) ROM0:06AD 22 ldi (hl),a ROM0:06AE 0C inc c ROM0:06AF 0A ld a,(bc) ROM0:06B0 6F ld l,a ROM0:06B1 0C inc c ROM0:06B2 0A ld a,(bc) ROM0:06B3 67 ld h,a ROM0:06B4 0C inc c ROM0:06B5 0A ld a,(bc) ROM0:06B6 22 ldi (hl),a ROM0:06B7 0C inc c ROM0:06B8 0A ld a,(bc) ROM0:06B9 22 ldi (hl),a ROM0:06BA 0C inc c ROM0:06BB 0A ld a,(bc) ROM0:06BC 22 ldi (hl),a ROM0:06BD 0C inc c ROM0:06BE 0A ld a,(bc) ROM0:06BF 22 ldi (hl),a ROM0:06C0 0C inc c ROM0:06C1 0A ld a,(bc) ROM0:06C2 22 ldi (hl),a ROM0:06C3 0C inc c ROM0:06C4 0A ld a,(bc) ROM0:06C5 22 ldi (hl),a ROM0:06C6 0C inc c ROM0:06C7 0A ld a,(bc) ROM0:06C8 22 ldi (hl),a ROM0:06C9 0C inc c ROM0:06CA 0A ld a,(bc) ROM0:06CB 22 ldi (hl),a ROM0:06CC 0C inc c ROM0:06CD 0A ld a,(bc) ROM0:06CE 6F ld l,a ROM0:06CF 0C inc c ROM0:06D0 0A ld a,(bc) ROM0:06D1 67 ld h,a ROM0:06D2 0C inc c ROM0:06D3 0A ld a,(bc) ROM0:06D4 22 ldi (hl),a ROM0:06D5 0C inc c ROM0:06D6 0A ld a,(bc) ROM0:06D7 22 ldi (hl),a ROM0:06D8 0C inc c ROM0:06D9 0A ld a,(bc) ROM0:06DA 22 ldi (hl),a ROM0:06DB 0C inc c ROM0:06DC 0A ld a,(bc) ROM0:06DD 22 ldi (hl),a ROM0:06DE 0C inc c ROM0:06DF 0A ld a,(bc) ROM0:06E0 22 ldi (hl),a ROM0:06E1 0C inc c ROM0:06E2 0A ld a,(bc) ROM0:06E3 22 ldi (hl),a ROM0:06E4 0C inc c ROM0:06E5 0A ld a,(bc) ROM0:06E6 22 ldi (hl),a ROM0:06E7 0C inc c ROM0:06E8 0A ld a,(bc) ROM0:06E9 22 ldi (hl),a ROM0:06EA 0C inc c ROM0:06EB 0A ld a,(bc) ROM0:06EC 6F ld l,a ROM0:06ED 0C inc c ROM0:06EE 0A ld a,(bc) ROM0:06EF 67 ld h,a ROM0:06F0 0C inc c ROM0:06F1 0A ld a,(bc) ROM0:06F2 22 ldi (hl),a ROM0:06F3 0C inc c ROM0:06F4 0A ld a,(bc) ROM0:06F5 22 ldi (hl),a ROM0:06F6 0C inc c ROM0:06F7 0A ld a,(bc) ROM0:06F8 22 ldi (hl),a ROM0:06F9 0C inc c ROM0:06FA 0A ld a,(bc) ROM0:06FB 22 ldi (hl),a ROM0:06FC 0C inc c ROM0:06FD 0A ld a,(bc) ROM0:06FE 22 ldi (hl),a ROM0:06FF 0C inc c ROM0:0700 0A ld a,(bc) ROM0:0701 22 ldi (hl),a ROM0:0702 0C inc c ROM0:0703 0A ld a,(bc) ROM0:0704 22 ldi (hl),a ROM0:0705 0C inc c ROM0:0706 0A ld a,(bc) ROM0:0707 22 ldi (hl),a ROM0:0708 0C inc c ROM0:0709 0A ld a,(bc) ROM0:070A 6F ld l,a ROM0:070B 0C inc c ROM0:070C 0A ld a,(bc) ROM0:070D 67 ld h,a ROM0:070E 0C inc c ROM0:070F 0A ld a,(bc) ROM0:0710 22 ldi (hl),a ROM0:0711 0C inc c ROM0:0712 0A ld a,(bc) ROM0:0713 22 ldi (hl),a ROM0:0714 0C inc c ROM0:0715 0A ld a,(bc) ROM0:0716 22 ldi (hl),a ROM0:0717 0C inc c ROM0:0718 0A ld a,(bc) ROM0:0719 22 ldi (hl),a ROM0:071A 0C inc c ROM0:071B 0A ld a,(bc) ROM0:071C 22 ldi (hl),a ROM0:071D 0C inc c ROM0:071E 0A ld a,(bc) ROM0:071F 22 ldi (hl),a ROM0:0720 0C inc c ROM0:0721 0A ld a,(bc) ROM0:0722 22 ldi (hl),a ROM0:0723 0C inc c ROM0:0724 0A ld a,(bc) ROM0:0725 22 ldi (hl),a ROM0:0726 0C inc c ROM0:0727 CD 17 12 call 1217 ROM0:072A 0A ld a,(bc) ROM0:072B 6F ld l,a ROM0:072C 0C inc c ROM0:072D 0A ld a,(bc) ROM0:072E 67 ld h,a ROM0:072F 0C inc c ROM0:0730 0A ld a,(bc) ROM0:0731 22 ldi (hl),a ROM0:0732 0C inc c ROM0:0733 0A ld a,(bc) ROM0:0734 22 ldi (hl),a ROM0:0735 0C inc c ROM0:0736 0A ld a,(bc) ROM0:0737 22 ldi (hl),a ROM0:0738 0C inc c ROM0:0739 0A ld a,(bc) ROM0:073A 22 ldi (hl),a ROM0:073B 0C inc c ROM0:073C 0A ld a,(bc) ROM0:073D 22 ldi (hl),a ROM0:073E 0C inc c ROM0:073F 0A ld a,(bc) ROM0:0740 22 ldi (hl),a ROM0:0741 0C inc c ROM0:0742 0A ld a,(bc) ROM0:0743 22 ldi (hl),a ROM0:0744 0C inc c ROM0:0745 0A ld a,(bc) ROM0:0746 22 ldi (hl),a ROM0:0747 0C inc c ROM0:0748 0A ld a,(bc) ROM0:0749 6F ld l,a ROM0:074A 0C inc c ROM0:074B 0A ld a,(bc) ROM0:074C 67 ld h,a ROM0:074D 0C inc c ROM0:074E 0A ld a,(bc) ROM0:074F 22 ldi (hl),a ROM0:0750 0C inc c ROM0:0751 0A ld a,(bc) ROM0:0752 22 ldi (hl),a ROM0:0753 0C inc c ROM0:0754 0A ld a,(bc) ROM0:0755 22 ldi (hl),a ROM0:0756 0C inc c ROM0:0757 0A ld a,(bc) ROM0:0758 22 ldi (hl),a ROM0:0759 0C inc c ROM0:075A 0A ld a,(bc) ROM0:075B 22 ldi (hl),a ROM0:075C 0C inc c ROM0:075D 0A ld a,(bc) ROM0:075E 22 ldi (hl),a ROM0:075F 0C inc c ROM0:0760 0A ld a,(bc) ROM0:0761 22 ldi (hl),a ROM0:0762 0C inc c ROM0:0763 0A ld a,(bc) ROM0:0764 22 ldi (hl),a ROM0:0765 0C inc c ROM0:0766 0A ld a,(bc) ROM0:0767 6F ld l,a ROM0:0768 0C inc c ROM0:0769 0A ld a,(bc) ROM0:076A 67 ld h,a ROM0:076B 0C inc c ROM0:076C 0A ld a,(bc) ROM0:076D 22 ldi (hl),a ROM0:076E 0C inc c ROM0:076F 0A ld a,(bc) ROM0:0770 22 ldi (hl),a ROM0:0771 0C inc c ROM0:0772 0A ld a,(bc) ROM0:0773 22 ldi (hl),a ROM0:0774 0C inc c ROM0:0775 0A ld a,(bc) ROM0:0776 22 ldi (hl),a ROM0:0777 0C inc c ROM0:0778 0A ld a,(bc) ROM0:0779 22 ldi (hl),a ROM0:077A 0C inc c ROM0:077B 0A ld a,(bc) ROM0:077C 22 ldi (hl),a ROM0:077D 0C inc c ROM0:077E 0A ld a,(bc) ROM0:077F 22 ldi (hl),a ROM0:0780 0C inc c ROM0:0781 0A ld a,(bc) ROM0:0782 22 ldi (hl),a ROM0:0783 0C inc c ROM0:0784 0A ld a,(bc) ROM0:0785 6F ld l,a ROM0:0786 0C inc c ROM0:0787 0A ld a,(bc) ROM0:0788 67 ld h,a ROM0:0789 0C inc c ROM0:078A 0A ld a,(bc) ROM0:078B 22 ldi (hl),a ROM0:078C 0C inc c ROM0:078D 0A ld a,(bc) ROM0:078E 22 ldi (hl),a ROM0:078F 0C inc c ROM0:0790 0A ld a,(bc) ROM0:0791 22 ldi (hl),a ROM0:0792 0C inc c ROM0:0793 0A ld a,(bc) ROM0:0794 22 ldi (hl),a ROM0:0795 0C inc c ROM0:0796 0A ld a,(bc) ROM0:0797 22 ldi (hl),a ROM0:0798 0C inc c ROM0:0799 0A ld a,(bc) ROM0:079A 22 ldi (hl),a ROM0:079B 0C inc c ROM0:079C 0A ld a,(bc) ROM0:079D 22 ldi (hl),a ROM0:079E 0C inc c ROM0:079F 0A ld a,(bc) ROM0:07A0 22 ldi (hl),a ROM0:07A1 0C inc c ROM0:07A2 0A ld a,(bc) ROM0:07A3 6F ld l,a ROM0:07A4 0C inc c ROM0:07A5 0A ld a,(bc) ROM0:07A6 67 ld h,a ROM0:07A7 0C inc c ROM0:07A8 0A ld a,(bc) ROM0:07A9 22 ldi (hl),a ROM0:07AA 0C inc c ROM0:07AB 0A ld a,(bc) ROM0:07AC 22 ldi (hl),a ROM0:07AD 0C inc c ROM0:07AE 0A ld a,(bc) ROM0:07AF 22 ldi (hl),a ROM0:07B0 0C inc c ROM0:07B1 0A ld a,(bc) ROM0:07B2 22 ldi (hl),a ROM0:07B3 0C inc c ROM0:07B4 0A ld a,(bc) ROM0:07B5 22 ldi (hl),a ROM0:07B6 0C inc c ROM0:07B7 0A ld a,(bc) ROM0:07B8 22 ldi (hl),a ROM0:07B9 0C inc c ROM0:07BA 0A ld a,(bc) ROM0:07BB 22 ldi (hl),a ROM0:07BC 0C inc c ROM0:07BD 0A ld a,(bc) ROM0:07BE 22 ldi (hl),a ROM0:07BF 0C inc c ROM0:07C0 0A ld a,(bc) ROM0:07C1 6F ld l,a ROM0:07C2 0C inc c ROM0:07C3 0A ld a,(bc) ROM0:07C4 67 ld h,a ROM0:07C5 0C inc c ROM0:07C6 0A ld a,(bc) ROM0:07C7 22 ldi (hl),a ROM0:07C8 0C inc c ROM0:07C9 0A ld a,(bc) ROM0:07CA 22 ldi (hl),a ROM0:07CB 0C inc c ROM0:07CC 0A ld a,(bc) ROM0:07CD 22 ldi (hl),a ROM0:07CE 0C inc c ROM0:07CF 0A ld a,(bc) ROM0:07D0 22 ldi (hl),a ROM0:07D1 0C inc c ROM0:07D2 0A ld a,(bc) ROM0:07D3 22 ldi (hl),a ROM0:07D4 0C inc c ROM0:07D5 0A ld a,(bc) ROM0:07D6 22 ldi (hl),a ROM0:07D7 0C inc c ROM0:07D8 0A ld a,(bc) ROM0:07D9 22 ldi (hl),a ROM0:07DA 0C inc c ROM0:07DB 0A ld a,(bc) ROM0:07DC 22 ldi (hl),a ROM0:07DD 0C inc c ROM0:07DE 0A ld a,(bc) ROM0:07DF 6F ld l,a ROM0:07E0 0C inc c ROM0:07E1 0A ld a,(bc) ROM0:07E2 67 ld h,a ROM0:07E3 0C inc c ROM0:07E4 0A ld a,(bc) ROM0:07E5 22 ldi (hl),a ROM0:07E6 0C inc c ROM0:07E7 0A ld a,(bc) ROM0:07E8 22 ldi (hl),a ROM0:07E9 0C inc c ROM0:07EA 0A ld a,(bc) ROM0:07EB 22 ldi (hl),a ROM0:07EC 0C inc c ROM0:07ED 0A ld a,(bc) ROM0:07EE 22 ldi (hl),a ROM0:07EF 0C inc c ROM0:07F0 0A ld a,(bc) ROM0:07F1 22 ldi (hl),a ROM0:07F2 0C inc c ROM0:07F3 0A ld a,(bc) ROM0:07F4 22 ldi (hl),a ROM0:07F5 0C inc c ROM0:07F6 0A ld a,(bc) ROM0:07F7 22 ldi (hl),a ROM0:07F8 0C inc c ROM0:07F9 0A ld a,(bc) ROM0:07FA 22 ldi (hl),a ROM0:07FB 0C inc c ROM0:07FC 0A ld a,(bc) ROM0:07FD 6F ld l,a ROM0:07FE 0C inc c ROM0:07FF 0A ld a,(bc) ROM0:0800 67 ld h,a ROM0:0801 0C inc c ROM0:0802 0A ld a,(bc) ROM0:0803 22 ldi (hl),a ROM0:0804 0C inc c ROM0:0805 0A ld a,(bc) ROM0:0806 22 ldi (hl),a ROM0:0807 0C inc c ROM0:0808 0A ld a,(bc) ROM0:0809 22 ldi (hl),a ROM0:080A 0C inc c ROM0:080B 0A ld a,(bc) ROM0:080C 22 ldi (hl),a ROM0:080D 0C inc c ROM0:080E 0A ld a,(bc) ROM0:080F 22 ldi (hl),a ROM0:0810 0C inc c ROM0:0811 0A ld a,(bc) ROM0:0812 22 ldi (hl),a ROM0:0813 0C inc c ROM0:0814 0A ld a,(bc) ROM0:0815 22 ldi (hl),a ROM0:0816 0C inc c ROM0:0817 0A ld a,(bc) ROM0:0818 22 ldi (hl),a ROM0:0819 0C inc c ROM0:081A 0A ld a,(bc) ROM0:081B 6F ld l,a ROM0:081C 0C inc c ROM0:081D 0A ld a,(bc) ROM0:081E 67 ld h,a ROM0:081F 0C inc c ROM0:0820 0A ld a,(bc) ROM0:0821 22 ldi (hl),a ROM0:0822 0C inc c ROM0:0823 0A ld a,(bc) ROM0:0824 22 ldi (hl),a ROM0:0825 0C inc c ROM0:0826 0A ld a,(bc) ROM0:0827 22 ldi (hl),a ROM0:0828 0C inc c ROM0:0829 0A ld a,(bc) ROM0:082A 22 ldi (hl),a ROM0:082B 0C inc c ROM0:082C 0A ld a,(bc) ROM0:082D 22 ldi (hl),a ROM0:082E 0C inc c ROM0:082F 0A ld a,(bc) ROM0:0830 22 ldi (hl),a ROM0:0831 0C inc c ROM0:0832 0A ld a,(bc) ROM0:0833 22 ldi (hl),a ROM0:0834 0C inc c ROM0:0835 0A ld a,(bc) ROM0:0836 22 ldi (hl),a ROM0:0837 0C inc c ROM0:0838 0A ld a,(bc) ROM0:0839 6F ld l,a ROM0:083A 0C inc c ROM0:083B 0A ld a,(bc) ROM0:083C 67 ld h,a ROM0:083D 0C inc c ROM0:083E 0A ld a,(bc) ROM0:083F 22 ldi (hl),a ROM0:0840 0C inc c ROM0:0841 0A ld a,(bc) ROM0:0842 22 ldi (hl),a ROM0:0843 0C inc c ROM0:0844 0A ld a,(bc) ROM0:0845 22 ldi (hl),a ROM0:0846 0C inc c ROM0:0847 0A ld a,(bc) ROM0:0848 22 ldi (hl),a ROM0:0849 0C inc c ROM0:084A 0A ld a,(bc) ROM0:084B 22 ldi (hl),a ROM0:084C 0C inc c ROM0:084D 0A ld a,(bc) ROM0:084E 22 ldi (hl),a ROM0:084F 0C inc c ROM0:0850 0A ld a,(bc) ROM0:0851 22 ldi (hl),a ROM0:0852 0C inc c ROM0:0853 0A ld a,(bc) ROM0:0854 22 ldi (hl),a ROM0:0855 0C inc c ROM0:0856 CD 1E 12 call 121E ROM0:0859 3E 00 ld a,00 ROM0:085B EA AF C5 ld (C5AF),a ROM0:085E 3E 01 ld a,01 ROM0:0860 EA AC C5 ld (C5AC),a ROM0:0863 CD B4 04 call 04B4 ROM0:0866 D1 pop de ROM0:0867 C1 pop bc ROM0:0868 E1 pop hl ROM0:0869 F1 pop af ROM0:086A D9 reti
0:086B (OAM)
ROM0:086B CD F5 FF call FFF5 ;OAM ROM0:086E 01 00 C1 ld bc,C100 ROM0:0871 0A ld a,(bc) ROM0:0872 6F ld l,a ROM0:0873 0C inc c ROM0:0874 0A ld a,(bc) ROM0:0875 67 ld h,a ROM0:0876 0C inc c ROM0:0877 0A ld a,(bc) ROM0:0878 22 ldi (hl),a ROM0:0879 0C inc c ROM0:087A 0A ld a,(bc) ROM0:087B 22 ldi (hl),a ROM0:087C 0C inc c ROM0:087D 0A ld a,(bc) ROM0:087E 22 ldi (hl),a ROM0:087F 0C inc c ROM0:0880 0A ld a,(bc) ROM0:0881 22 ldi (hl),a ROM0:0882 0C inc c ROM0:0883 0A ld a,(bc) ROM0:0884 22 ldi (hl),a ROM0:0885 0C inc c ROM0:0886 0A ld a,(bc) ROM0:0887 22 ldi (hl),a ROM0:0888 0C inc c ROM0:0889 0A ld a,(bc) ROM0:088A 22 ldi (hl),a ROM0:088B 0C inc c ROM0:088C 0A ld a,(bc) ROM0:088D 22 ldi (hl),a ROM0:088E 0C inc c ROM0:088F 0A ld a,(bc) ROM0:0890 22 ldi (hl),a ROM0:0891 0C inc c ROM0:0892 0A ld a,(bc) ROM0:0893 22 ldi (hl),a ROM0:0894 0C inc c ROM0:0895 0A ld a,(bc) ROM0:0896 22 ldi (hl),a ROM0:0897 0C inc c ROM0:0898 0A ld a,(bc) ROM0:0899 22 ldi (hl),a ROM0:089A 0C inc c ROM0:089B 0A ld a,(bc) ROM0:089C 22 ldi (hl),a ROM0:089D 0C inc c ROM0:089E 0A ld a,(bc) ROM0:089F 22 ldi (hl),a ROM0:08A0 0C inc c ROM0:08A1 0A ld a,(bc) ROM0:08A2 22 ldi (hl),a ROM0:08A3 0C inc c ROM0:08A4 0A ld a,(bc) ROM0:08A5 22 ldi (hl),a ROM0:08A6 0C inc c ROM0:08A7 0A ld a,(bc) ROM0:08A8 22 ldi (hl),a ROM0:08A9 0C inc c ROM0:08AA 0A ld a,(bc) ROM0:08AB 22 ldi (hl),a ROM0:08AC 0C inc c ROM0:08AD 0A ld a,(bc) ROM0:08AE 6F ld l,a ROM0:08AF 0C inc c ROM0:08B0 0A ld a,(bc) ROM0:08B1 67 ld h,a ROM0:08B2 0C inc c ROM0:08B3 0A ld a,(bc) ROM0:08B4 22 ldi (hl),a ROM0:08B5 0C inc c ROM0:08B6 0A ld a,(bc) ROM0:08B7 22 ldi (hl),a ROM0:08B8 0C inc c ROM0:08B9 0A ld a,(bc) ROM0:08BA 22 ldi (hl),a ROM0:08BB 0C inc c ROM0:08BC 0A ld a,(bc) ROM0:08BD 22 ldi (hl),a ROM0:08BE 0C inc c ROM0:08BF 0A ld a,(bc) ROM0:08C0 22 ldi (hl),a ROM0:08C1 0C inc c ROM0:08C2 0A ld a,(bc) ROM0:08C3 22 ldi (hl),a ROM0:08C4 0C inc c ROM0:08C5 0A ld a,(bc) ROM0:08C6 22 ldi (hl),a ROM0:08C7 0C inc c ROM0:08C8 0A ld a,(bc) ROM0:08C9 22 ldi (hl),a ROM0:08CA 0C inc c ROM0:08CB 0A ld a,(bc) ROM0:08CC 22 ldi (hl),a ROM0:08CD 0C inc c ROM0:08CE 0A ld a,(bc) ROM0:08CF 22 ldi (hl),a ROM0:08D0 0C inc c ROM0:08D1 0A ld a,(bc) ROM0:08D2 22 ldi (hl),a ROM0:08D3 0C inc c ROM0:08D4 0A ld a,(bc) ROM0:08D5 22 ldi (hl),a ROM0:08D6 0C inc c ROM0:08D7 0A ld a,(bc) ROM0:08D8 22 ldi (hl),a ROM0:08D9 0C inc c ROM0:08DA 0A ld a,(bc) ROM0:08DB 22 ldi (hl),a ROM0:08DC 0C inc c ROM0:08DD 0A ld a,(bc) ROM0:08DE 22 ldi (hl),a ROM0:08DF 0C inc c ROM0:08E0 0A ld a,(bc) ROM0:08E1 22 ldi (hl),a ROM0:08E2 0C inc c ROM0:08E3 0A ld a,(bc) ROM0:08E4 22 ldi (hl),a ROM0:08E5 0C inc c ROM0:08E6 0A ld a,(bc) ROM0:08E7 22 ldi (hl),a ROM0:08E8 0C inc c ROM0:08E9 0A ld a,(bc) ROM0:08EA 6F ld l,a ROM0:08EB 0C inc c ROM0:08EC 0A ld a,(bc) ROM0:08ED 67 ld h,a ROM0:08EE 0C inc c ROM0:08EF 0A ld a,(bc) ROM0:08F0 22 ldi (hl),a ROM0:08F1 0C inc c ROM0:08F2 0A ld a,(bc) ROM0:08F3 22 ldi (hl),a ROM0:08F4 0C inc c ROM0:08F5 0A ld a,(bc) ROM0:08F6 22 ldi (hl),a ROM0:08F7 0C inc c ROM0:08F8 0A ld a,(bc) ROM0:08F9 22 ldi (hl),a ROM0:08FA 0C inc c ROM0:08FB 0A ld a,(bc) ROM0:08FC 22 ldi (hl),a ROM0:08FD 0C inc c ROM0:08FE 0A ld a,(bc) ROM0:08FF 22 ldi (hl),a ROM0:0900 0C inc c ROM0:0901 0A ld a,(bc) ROM0:0902 22 ldi (hl),a ROM0:0903 0C inc c ROM0:0904 0A ld a,(bc) ROM0:0905 22 ldi (hl),a ROM0:0906 0C inc c ROM0:0907 0A ld a,(bc) ROM0:0908 22 ldi (hl),a ROM0:0909 0C inc c ROM0:090A 0A ld a,(bc) ROM0:090B 22 ldi (hl),a ROM0:090C 0C inc c ROM0:090D 0A ld a,(bc) ROM0:090E 22 ldi (hl),a ROM0:090F 0C inc c ROM0:0910 0A ld a,(bc) ROM0:0911 22 ldi (hl),a ROM0:0912 0C inc c ROM0:0913 0A ld a,(bc) ROM0:0914 22 ldi (hl),a ROM0:0915 0C inc c ROM0:0916 0A ld a,(bc) ROM0:0917 22 ldi (hl),a ROM0:0918 0C inc c ROM0:0919 0A ld a,(bc) ROM0:091A 22 ldi (hl),a ROM0:091B 0C inc c ROM0:091C 0A ld a,(bc) ROM0:091D 22 ldi (hl),a ROM0:091E 0C inc c ROM0:091F 3E 00 ld a,00 ROM0:0921 EA AF C5 ld (C5AF),a ROM0:0924 3E 01 ld a,01 ROM0:0926 EA AC C5 ld (C5AC),a ROM0:0929 CD B4 04 call 04B4 ROM0:092C D1 pop de ROM0:092D C1 pop bc ROM0:092E E1 pop hl ROM0:092F F1 pop af ROM0:0930 D9 reti
0:0931 (OAM)
ROM0:0931 CD F5 FF call FFF5 ;OAM ROM0:0934 01 00 C1 ld bc,C100 ROM0:0937 0A ld a,(bc) ROM0:0938 6F ld l,a ROM0:0939 0C inc c ROM0:093A 0A ld a,(bc) ROM0:093B 67 ld h,a ROM0:093C 0C inc c ROM0:093D 0A ld a,(bc) ROM0:093E 22 ldi (hl),a ROM0:093F 0C inc c ROM0:0940 0A ld a,(bc) ROM0:0941 22 ldi (hl),a ROM0:0942 0C inc c ROM0:0943 0A ld a,(bc) ROM0:0944 22 ldi (hl),a ROM0:0945 0C inc c ROM0:0946 0A ld a,(bc) ROM0:0947 22 ldi (hl),a ROM0:0948 0C inc c ROM0:0949 0A ld a,(bc) ROM0:094A 22 ldi (hl),a ROM0:094B 0C inc c ROM0:094C 0A ld a,(bc) ROM0:094D 22 ldi (hl),a ROM0:094E 0C inc c ROM0:094F 0A ld a,(bc) ROM0:0950 22 ldi (hl),a ROM0:0951 0C inc c ROM0:0952 0A ld a,(bc) ROM0:0953 22 ldi (hl),a ROM0:0954 0C inc c ROM0:0955 0A ld a,(bc) ROM0:0956 6F ld l,a ROM0:0957 0C inc c ROM0:0958 0A ld a,(bc) ROM0:0959 67 ld h,a ROM0:095A 0C inc c ROM0:095B 0A ld a,(bc) ROM0:095C 22 ldi (hl),a ROM0:095D 0C inc c ROM0:095E 0A ld a,(bc) ROM0:095F 22 ldi (hl),a ROM0:0960 0C inc c ROM0:0961 0A ld a,(bc) ROM0:0962 22 ldi (hl),a ROM0:0963 0C inc c ROM0:0964 0A ld a,(bc) ROM0:0965 22 ldi (hl),a ROM0:0966 0C inc c ROM0:0967 0A ld a,(bc) ROM0:0968 22 ldi (hl),a ROM0:0969 0C inc c ROM0:096A 0A ld a,(bc) ROM0:096B 22 ldi (hl),a ROM0:096C 0C inc c ROM0:096D 0A ld a,(bc) ROM0:096E 22 ldi (hl),a ROM0:096F 0C inc c ROM0:0970 0A ld a,(bc) ROM0:0971 22 ldi (hl),a ROM0:0972 0C inc c ROM0:0973 0A ld a,(bc) ROM0:0974 6F ld l,a ROM0:0975 0C inc c ROM0:0976 0A ld a,(bc) ROM0:0977 67 ld h,a ROM0:0978 0C inc c ROM0:0979 0A ld a,(bc) ROM0:097A 22 ldi (hl),a ROM0:097B 0C inc c ROM0:097C 0A ld a,(bc) ROM0:097D 22 ldi (hl),a ROM0:097E 0C inc c ROM0:097F 0A ld a,(bc) ROM0:0980 22 ldi (hl),a ROM0:0981 0C inc c ROM0:0982 0A ld a,(bc) ROM0:0983 22 ldi (hl),a ROM0:0984 0C inc c ROM0:0985 0A ld a,(bc) ROM0:0986 6F ld l,a ROM0:0987 0C inc c ROM0:0988 0A ld a,(bc) ROM0:0989 67 ld h,a ROM0:098A 0C inc c ROM0:098B 0A ld a,(bc) ROM0:098C 22 ldi (hl),a ROM0:098D 0C inc c ROM0:098E 0A ld a,(bc) ROM0:098F 22 ldi (hl),a ROM0:0990 0C inc c ROM0:0991 0A ld a,(bc) ROM0:0992 22 ldi (hl),a ROM0:0993 0C inc c ROM0:0994 0A ld a,(bc) ROM0:0995 22 ldi (hl),a ROM0:0996 0C inc c ROM0:0997 0A ld a,(bc) ROM0:0998 6F ld l,a ROM0:0999 0C inc c ROM0:099A 0A ld a,(bc) ROM0:099B 67 ld h,a ROM0:099C 0C inc c ROM0:099D 0A ld a,(bc) ROM0:099E 22 ldi (hl),a ROM0:099F 0C inc c ROM0:09A0 0A ld a,(bc) ROM0:09A1 22 ldi (hl),a ROM0:09A2 0C inc c ROM0:09A3 0A ld a,(bc) ROM0:09A4 22 ldi (hl),a ROM0:09A5 0C inc c ROM0:09A6 0A ld a,(bc) ROM0:09A7 22 ldi (hl),a ROM0:09A8 0C inc c ROM0:09A9 0A ld a,(bc) ROM0:09AA 6F ld l,a ROM0:09AB 0C inc c ROM0:09AC 0A ld a,(bc) ROM0:09AD 67 ld h,a ROM0:09AE 0C inc c ROM0:09AF 0A ld a,(bc) ROM0:09B0 22 ldi (hl),a ROM0:09B1 0C inc c ROM0:09B2 0A ld a,(bc) ROM0:09B3 22 ldi (hl),a ROM0:09B4 0C inc c ROM0:09B5 0A ld a,(bc) ROM0:09B6 22 ldi (hl),a ROM0:09B7 0C inc c ROM0:09B8 0A ld a,(bc) ROM0:09B9 22 ldi (hl),a ROM0:09BA 0C inc c ROM0:09BB 0A ld a,(bc) ROM0:09BC 6F ld l,a ROM0:09BD 0C inc c ROM0:09BE 0A ld a,(bc) ROM0:09BF 67 ld h,a ROM0:09C0 0C inc c ROM0:09C1 0A ld a,(bc) ROM0:09C2 22 ldi (hl),a ROM0:09C3 0C inc c ROM0:09C4 0A ld a,(bc) ROM0:09C5 22 ldi (hl),a ROM0:09C6 0C inc c ROM0:09C7 0A ld a,(bc) ROM0:09C8 22 ldi (hl),a ROM0:09C9 0C inc c ROM0:09CA 0A ld a,(bc) ROM0:09CB 22 ldi (hl),a ROM0:09CC 0C inc c ROM0:09CD 0A ld a,(bc) ROM0:09CE 22 ldi (hl),a ROM0:09CF 0C inc c ROM0:09D0 0A ld a,(bc) ROM0:09D1 22 ldi (hl),a ROM0:09D2 0C inc c ROM0:09D3 0A ld a,(bc) ROM0:09D4 22 ldi (hl),a ROM0:09D5 0C inc c ROM0:09D6 0A ld a,(bc) ROM0:09D7 22 ldi (hl),a ROM0:09D8 0C inc c ROM0:09D9 0A ld a,(bc) ROM0:09DA 6F ld l,a ROM0:09DB 0C inc c ROM0:09DC 0A ld a,(bc) ROM0:09DD 67 ld h,a ROM0:09DE 0C inc c ROM0:09DF 0A ld a,(bc) ROM0:09E0 22 ldi (hl),a ROM0:09E1 0C inc c ROM0:09E2 0A ld a,(bc) ROM0:09E3 22 ldi (hl),a ROM0:09E4 0C inc c ROM0:09E5 0A ld a,(bc) ROM0:09E6 22 ldi (hl),a ROM0:09E7 0C inc c ROM0:09E8 0A ld a,(bc) ROM0:09E9 22 ldi (hl),a ROM0:09EA 0C inc c ROM0:09EB 0A ld a,(bc) ROM0:09EC 22 ldi (hl),a ROM0:09ED 0C inc c ROM0:09EE 0A ld a,(bc) ROM0:09EF 22 ldi (hl),a ROM0:09F0 0C inc c ROM0:09F1 0A ld a,(bc) ROM0:09F2 22 ldi (hl),a ROM0:09F3 0C inc c ROM0:09F4 0A ld a,(bc) ROM0:09F5 22 ldi (hl),a ROM0:09F6 0C inc c ROM0:09F7 0A ld a,(bc) ROM0:09F8 6F ld l,a ROM0:09F9 0C inc c ROM0:09FA 0A ld a,(bc) ROM0:09FB 67 ld h,a ROM0:09FC 0C inc c ROM0:09FD 0A ld a,(bc) ROM0:09FE 22 ldi (hl),a ROM0:09FF 0C inc c ROM0:0A00 0A ld a,(bc) ROM0:0A01 22 ldi (hl),a ROM0:0A02 0C inc c ROM0:0A03 0A ld a,(bc) ROM0:0A04 22 ldi (hl),a ROM0:0A05 0C inc c ROM0:0A06 0A ld a,(bc) ROM0:0A07 22 ldi (hl),a ROM0:0A08 0C inc c ROM0:0A09 0A ld a,(bc) ROM0:0A0A 22 ldi (hl),a ROM0:0A0B 0C inc c ROM0:0A0C 0A ld a,(bc) ROM0:0A0D 22 ldi (hl),a ROM0:0A0E 0C inc c ROM0:0A0F 0A ld a,(bc) ROM0:0A10 22 ldi (hl),a ROM0:0A11 0C inc c ROM0:0A12 0A ld a,(bc) ROM0:0A13 22 ldi (hl),a ROM0:0A14 0C inc c ROM0:0A15 0A ld a,(bc) ROM0:0A16 6F ld l,a ROM0:0A17 0C inc c ROM0:0A18 0A ld a,(bc) ROM0:0A19 67 ld h,a ROM0:0A1A 0C inc c ROM0:0A1B 0A ld a,(bc) ROM0:0A1C 22 ldi (hl),a ROM0:0A1D 0C inc c ROM0:0A1E 0A ld a,(bc) ROM0:0A1F 22 ldi (hl),a ROM0:0A20 0C inc c ROM0:0A21 0A ld a,(bc) ROM0:0A22 22 ldi (hl),a ROM0:0A23 0C inc c ROM0:0A24 0A ld a,(bc) ROM0:0A25 22 ldi (hl),a ROM0:0A26 0C inc c ROM0:0A27 0A ld a,(bc) ROM0:0A28 22 ldi (hl),a ROM0:0A29 0C inc c ROM0:0A2A 0A ld a,(bc) ROM0:0A2B 22 ldi (hl),a ROM0:0A2C 0C inc c ROM0:0A2D 0A ld a,(bc) ROM0:0A2E 22 ldi (hl),a ROM0:0A2F 0C inc c ROM0:0A30 0A ld a,(bc) ROM0:0A31 22 ldi (hl),a ROM0:0A32 0C inc c ROM0:0A33 0A ld a,(bc) ROM0:0A34 6F ld l,a ROM0:0A35 0C inc c ROM0:0A36 0A ld a,(bc) ROM0:0A37 67 ld h,a ROM0:0A38 0C inc c ROM0:0A39 0A ld a,(bc) ROM0:0A3A 22 ldi (hl),a ROM0:0A3B 0C inc c ROM0:0A3C 0A ld a,(bc) ROM0:0A3D 22 ldi (hl),a ROM0:0A3E 0C inc c ROM0:0A3F 0A ld a,(bc) ROM0:0A40 22 ldi (hl),a ROM0:0A41 0C inc c ROM0:0A42 0A ld a,(bc) ROM0:0A43 22 ldi (hl),a ROM0:0A44 0C inc c ROM0:0A45 0A ld a,(bc) ROM0:0A46 22 ldi (hl),a ROM0:0A47 0C inc c ROM0:0A48 0A ld a,(bc) ROM0:0A49 22 ldi (hl),a ROM0:0A4A 0C inc c ROM0:0A4B 0A ld a,(bc) ROM0:0A4C 22 ldi (hl),a ROM0:0A4D 0C inc c ROM0:0A4E 0A ld a,(bc) ROM0:0A4F 22 ldi (hl),a ROM0:0A50 0C inc c ROM0:0A51 0A ld a,(bc) ROM0:0A52 6F ld l,a ROM0:0A53 0C inc c ROM0:0A54 0A ld a,(bc) ROM0:0A55 67 ld h,a ROM0:0A56 0C inc c ROM0:0A57 0A ld a,(bc) ROM0:0A58 22 ldi (hl),a ROM0:0A59 0C inc c ROM0:0A5A 0A ld a,(bc) ROM0:0A5B 22 ldi (hl),a ROM0:0A5C 0C inc c ROM0:0A5D 0A ld a,(bc) ROM0:0A5E 22 ldi (hl),a ROM0:0A5F 0C inc c ROM0:0A60 0A ld a,(bc) ROM0:0A61 22 ldi (hl),a ROM0:0A62 0C inc c ROM0:0A63 0A ld a,(bc) ROM0:0A64 22 ldi (hl),a ROM0:0A65 0C inc c ROM0:0A66 0A ld a,(bc) ROM0:0A67 22 ldi (hl),a ROM0:0A68 0C inc c ROM0:0A69 0A ld a,(bc) ROM0:0A6A 22 ldi (hl),a ROM0:0A6B 0C inc c ROM0:0A6C 0A ld a,(bc) ROM0:0A6D 22 ldi (hl),a ROM0:0A6E 0C inc c ROM0:0A6F 3E 00 ld a,00 ROM0:0A71 EA AF C5 ld (C5AF),a ROM0:0A74 3E 01 ld a,01 ROM0:0A76 EA AC C5 ld (C5AC),a ROM0:0A79 CD B4 04 call 04B4 ROM0:0A7C D1 pop de ROM0:0A7D C1 pop bc ROM0:0A7E E1 pop hl ROM0:0A7F F1 pop af ROM0:0A80 D9 reti
0:0A81 (OAM)
ROM0:0A81 CD F5 FF call FFF5 ;OAM ROM0:0A84 01 00 C1 ld bc,C100 ROM0:0A87 0A ld a,(bc) ROM0:0A88 6F ld l,a ROM0:0A89 0C inc c ROM0:0A8A 0A ld a,(bc) ROM0:0A8B 67 ld h,a ROM0:0A8C 0C inc c ROM0:0A8D 0A ld a,(bc) ROM0:0A8E 22 ldi (hl),a ROM0:0A8F 0C inc c ROM0:0A90 0A ld a,(bc) ROM0:0A91 22 ldi (hl),a ROM0:0A92 0C inc c ROM0:0A93 0A ld a,(bc) ROM0:0A94 22 ldi (hl),a ROM0:0A95 0C inc c ROM0:0A96 0A ld a,(bc) ROM0:0A97 22 ldi (hl),a ROM0:0A98 0C inc c ROM0:0A99 0A ld a,(bc) ROM0:0A9A 22 ldi (hl),a ROM0:0A9B 0C inc c ROM0:0A9C 0A ld a,(bc) ROM0:0A9D 22 ldi (hl),a ROM0:0A9E 0C inc c ROM0:0A9F 0A ld a,(bc) ROM0:0AA0 22 ldi (hl),a ROM0:0AA1 0C inc c ROM0:0AA2 0A ld a,(bc) ROM0:0AA3 22 ldi (hl),a ROM0:0AA4 0C inc c ROM0:0AA5 0A ld a,(bc) ROM0:0AA6 22 ldi (hl),a ROM0:0AA7 0C inc c ROM0:0AA8 0A ld a,(bc) ROM0:0AA9 22 ldi (hl),a ROM0:0AAA 0C inc c ROM0:0AAB 0A ld a,(bc) ROM0:0AAC 22 ldi (hl),a ROM0:0AAD 0C inc c ROM0:0AAE 0A ld a,(bc) ROM0:0AAF 22 ldi (hl),a ROM0:0AB0 0C inc c ROM0:0AB1 0A ld a,(bc) ROM0:0AB2 22 ldi (hl),a ROM0:0AB3 0C inc c ROM0:0AB4 0A ld a,(bc) ROM0:0AB5 22 ldi (hl),a ROM0:0AB6 0C inc c ROM0:0AB7 0A ld a,(bc) ROM0:0AB8 22 ldi (hl),a ROM0:0AB9 0C inc c ROM0:0ABA 0A ld a,(bc) ROM0:0ABB 22 ldi (hl),a ROM0:0ABC 0C inc c ROM0:0ABD 0A ld a,(bc) ROM0:0ABE 22 ldi (hl),a ROM0:0ABF 0C inc c ROM0:0AC0 0A ld a,(bc) ROM0:0AC1 22 ldi (hl),a ROM0:0AC2 0C inc c ROM0:0AC3 0A ld a,(bc) ROM0:0AC4 6F ld l,a ROM0:0AC5 0C inc c ROM0:0AC6 0A ld a,(bc) ROM0:0AC7 67 ld h,a ROM0:0AC8 0C inc c ROM0:0AC9 0A ld a,(bc) ROM0:0ACA 22 ldi (hl),a ROM0:0ACB 0C inc c ROM0:0ACC 0A ld a,(bc) ROM0:0ACD 22 ldi (hl),a ROM0:0ACE 0C inc c ROM0:0ACF 0A ld a,(bc) ROM0:0AD0 22 ldi (hl),a ROM0:0AD1 0C inc c ROM0:0AD2 0A ld a,(bc) ROM0:0AD3 22 ldi (hl),a ROM0:0AD4 0C inc c ROM0:0AD5 0A ld a,(bc) ROM0:0AD6 22 ldi (hl),a ROM0:0AD7 0C inc c ROM0:0AD8 0A ld a,(bc) ROM0:0AD9 22 ldi (hl),a ROM0:0ADA 0C inc c ROM0:0ADB 0A ld a,(bc) ROM0:0ADC 22 ldi (hl),a ROM0:0ADD 0C inc c ROM0:0ADE 0A ld a,(bc) ROM0:0ADF 22 ldi (hl),a ROM0:0AE0 0C inc c ROM0:0AE1 0A ld a,(bc) ROM0:0AE2 22 ldi (hl),a ROM0:0AE3 0C inc c ROM0:0AE4 0A ld a,(bc) ROM0:0AE5 22 ldi (hl),a ROM0:0AE6 0C inc c ROM0:0AE7 0A ld a,(bc) ROM0:0AE8 22 ldi (hl),a ROM0:0AE9 0C inc c ROM0:0AEA 0A ld a,(bc) ROM0:0AEB 22 ldi (hl),a ROM0:0AEC 0C inc c ROM0:0AED 0A ld a,(bc) ROM0:0AEE 22 ldi (hl),a ROM0:0AEF 0C inc c ROM0:0AF0 0A ld a,(bc) ROM0:0AF1 22 ldi (hl),a ROM0:0AF2 0C inc c ROM0:0AF3 0A ld a,(bc) ROM0:0AF4 22 ldi (hl),a ROM0:0AF5 0C inc c ROM0:0AF6 0A ld a,(bc) ROM0:0AF7 22 ldi (hl),a ROM0:0AF8 0C inc c ROM0:0AF9 0A ld a,(bc) ROM0:0AFA 22 ldi (hl),a ROM0:0AFB 0C inc c ROM0:0AFC 0A ld a,(bc) ROM0:0AFD 22 ldi (hl),a ROM0:0AFE 0C inc c ROM0:0AFF 0A ld a,(bc) ROM0:0B00 6F ld l,a ROM0:0B01 0C inc c ROM0:0B02 0A ld a,(bc) ROM0:0B03 67 ld h,a ROM0:0B04 0C inc c ROM0:0B05 0A ld a,(bc) ROM0:0B06 22 ldi (hl),a ROM0:0B07 0C inc c ROM0:0B08 0A ld a,(bc) ROM0:0B09 22 ldi (hl),a ROM0:0B0A 0C inc c ROM0:0B0B 0A ld a,(bc) ROM0:0B0C 22 ldi (hl),a ROM0:0B0D 0C inc c ROM0:0B0E 0A ld a,(bc) ROM0:0B0F 22 ldi (hl),a ROM0:0B10 0C inc c ROM0:0B11 0A ld a,(bc) ROM0:0B12 22 ldi (hl),a ROM0:0B13 0C inc c ROM0:0B14 0A ld a,(bc) ROM0:0B15 22 ldi (hl),a ROM0:0B16 0C inc c ROM0:0B17 0A ld a,(bc) ROM0:0B18 22 ldi (hl),a ROM0:0B19 0C inc c ROM0:0B1A 0A ld a,(bc) ROM0:0B1B 22 ldi (hl),a ROM0:0B1C 0C inc c ROM0:0B1D 0A ld a,(bc) ROM0:0B1E 22 ldi (hl),a ROM0:0B1F 0C inc c ROM0:0B20 0A ld a,(bc) ROM0:0B21 22 ldi (hl),a ROM0:0B22 0C inc c ROM0:0B23 0A ld a,(bc) ROM0:0B24 22 ldi (hl),a ROM0:0B25 0C inc c ROM0:0B26 0A ld a,(bc) ROM0:0B27 22 ldi (hl),a ROM0:0B28 0C inc c ROM0:0B29 0A ld a,(bc) ROM0:0B2A 22 ldi (hl),a ROM0:0B2B 0C inc c ROM0:0B2C 0A ld a,(bc) ROM0:0B2D 22 ldi (hl),a ROM0:0B2E 0C inc c ROM0:0B2F 0A ld a,(bc) ROM0:0B30 22 ldi (hl),a ROM0:0B31 0C inc c ROM0:0B32 0A ld a,(bc) ROM0:0B33 22 ldi (hl),a ROM0:0B34 0C inc c ROM0:0B35 0A ld a,(bc) ROM0:0B36 22 ldi (hl),a ROM0:0B37 0C inc c ROM0:0B38 0A ld a,(bc) ROM0:0B39 22 ldi (hl),a ROM0:0B3A 0C inc c ROM0:0B3B 0A ld a,(bc) ROM0:0B3C 6F ld l,a ROM0:0B3D 0C inc c ROM0:0B3E 0A ld a,(bc) ROM0:0B3F 67 ld h,a ROM0:0B40 0C inc c ROM0:0B41 0A ld a,(bc) ROM0:0B42 22 ldi (hl),a ROM0:0B43 0C inc c ROM0:0B44 0A ld a,(bc) ROM0:0B45 22 ldi (hl),a ROM0:0B46 0C inc c ROM0:0B47 0A ld a,(bc) ROM0:0B48 22 ldi (hl),a ROM0:0B49 0C inc c ROM0:0B4A 0A ld a,(bc) ROM0:0B4B 22 ldi (hl),a ROM0:0B4C 0C inc c ROM0:0B4D 0A ld a,(bc) ROM0:0B4E 22 ldi (hl),a ROM0:0B4F 0C inc c ROM0:0B50 0A ld a,(bc) ROM0:0B51 22 ldi (hl),a ROM0:0B52 0C inc c ROM0:0B53 0A ld a,(bc) ROM0:0B54 22 ldi (hl),a ROM0:0B55 0C inc c ROM0:0B56 0A ld a,(bc) ROM0:0B57 22 ldi (hl),a ROM0:0B58 0C inc c ROM0:0B59 0A ld a,(bc) ROM0:0B5A 22 ldi (hl),a ROM0:0B5B 0C inc c ROM0:0B5C 0A ld a,(bc) ROM0:0B5D 22 ldi (hl),a ROM0:0B5E 0C inc c ROM0:0B5F 0A ld a,(bc) ROM0:0B60 22 ldi (hl),a ROM0:0B61 0C inc c ROM0:0B62 0A ld a,(bc) ROM0:0B63 22 ldi (hl),a ROM0:0B64 0C inc c ROM0:0B65 0A ld a,(bc) ROM0:0B66 22 ldi (hl),a ROM0:0B67 0C inc c ROM0:0B68 0A ld a,(bc) ROM0:0B69 22 ldi (hl),a ROM0:0B6A 0C inc c ROM0:0B6B 0A ld a,(bc) ROM0:0B6C 22 ldi (hl),a ROM0:0B6D 0C inc c ROM0:0B6E 0A ld a,(bc) ROM0:0B6F 22 ldi (hl),a ROM0:0B70 0C inc c ROM0:0B71 0A ld a,(bc) ROM0:0B72 22 ldi (hl),a ROM0:0B73 0C inc c ROM0:0B74 0A ld a,(bc) ROM0:0B75 22 ldi (hl),a ROM0:0B76 0C inc c ROM0:0B77 0A ld a,(bc) ROM0:0B78 6F ld l,a ROM0:0B79 0C inc c ROM0:0B7A 0A ld a,(bc) ROM0:0B7B 67 ld h,a ROM0:0B7C 0C inc c ROM0:0B7D 0A ld a,(bc) ROM0:0B7E 22 ldi (hl),a ROM0:0B7F 0C inc c ROM0:0B80 0A ld a,(bc) ROM0:0B81 22 ldi (hl),a ROM0:0B82 0C inc c ROM0:0B83 0A ld a,(bc) ROM0:0B84 22 ldi (hl),a ROM0:0B85 0C inc c ROM0:0B86 0A ld a,(bc) ROM0:0B87 22 ldi (hl),a ROM0:0B88 0C inc c ROM0:0B89 0A ld a,(bc) ROM0:0B8A 22 ldi (hl),a ROM0:0B8B 0C inc c ROM0:0B8C 0A ld a,(bc) ROM0:0B8D 22 ldi (hl),a ROM0:0B8E 0C inc c ROM0:0B8F 0A ld a,(bc) ROM0:0B90 22 ldi (hl),a ROM0:0B91 0C inc c ROM0:0B92 0A ld a,(bc) ROM0:0B93 22 ldi (hl),a ROM0:0B94 0C inc c ROM0:0B95 0A ld a,(bc) ROM0:0B96 22 ldi (hl),a ROM0:0B97 0C inc c ROM0:0B98 0A ld a,(bc) ROM0:0B99 22 ldi (hl),a ROM0:0B9A 0C inc c ROM0:0B9B 0A ld a,(bc) ROM0:0B9C 22 ldi (hl),a ROM0:0B9D 0C inc c ROM0:0B9E 0A ld a,(bc) ROM0:0B9F 22 ldi (hl),a ROM0:0BA0 0C inc c ROM0:0BA1 0A ld a,(bc) ROM0:0BA2 22 ldi (hl),a ROM0:0BA3 0C inc c ROM0:0BA4 0A ld a,(bc) ROM0:0BA5 22 ldi (hl),a ROM0:0BA6 0C inc c ROM0:0BA7 0A ld a,(bc) ROM0:0BA8 22 ldi (hl),a ROM0:0BA9 0C inc c ROM0:0BAA 0A ld a,(bc) ROM0:0BAB 22 ldi (hl),a ROM0:0BAC 0C inc c ROM0:0BAD 0A ld a,(bc) ROM0:0BAE 22 ldi (hl),a ROM0:0BAF 0C inc c ROM0:0BB0 0A ld a,(bc) ROM0:0BB1 22 ldi (hl),a ROM0:0BB2 0C inc c ROM0:0BB3 3E 00 ld a,00 ROM0:0BB5 EA AF C5 ld (C5AF),a ROM0:0BB8 3E 01 ld a,01 ROM0:0BBA EA AC C5 ld (C5AC),a ROM0:0BBD CD B4 04 call 04B4 ROM0:0BC0 D1 pop de ROM0:0BC1 C1 pop bc ROM0:0BC2 E1 pop hl ROM0:0BC3 F1 pop af ROM0:0BC4 D9 reti
0:0BC5 (OAM)
ROM0:0BC5 CD F5 FF call FFF5 ;OAM ROM0:0BC8 01 00 C1 ld bc,C100 ROM0:0BCB 11 20 00 ld de,0020 ROM0:0BCE 0A ld a,(bc) ROM0:0BCF 6F ld l,a ROM0:0BD0 0C inc c ROM0:0BD1 0A ld a,(bc) ROM0:0BD2 67 ld h,a ROM0:0BD3 0C inc c ROM0:0BD4 0A ld a,(bc) ROM0:0BD5 22 ldi (hl),a ROM0:0BD6 0C inc c ROM0:0BD7 0A ld a,(bc) ROM0:0BD8 32 ldd (hl),a ROM0:0BD9 0C inc c ROM0:0BDA 19 add hl,de ROM0:0BDB 0A ld a,(bc) ROM0:0BDC 22 ldi (hl),a ROM0:0BDD 0C inc c ROM0:0BDE 0A ld a,(bc) ROM0:0BDF 32 ldd (hl),a ROM0:0BE0 0C inc c ROM0:0BE1 0A ld a,(bc) ROM0:0BE2 6F ld l,a ROM0:0BE3 0C inc c ROM0:0BE4 0A ld a,(bc) ROM0:0BE5 67 ld h,a ROM0:0BE6 0C inc c ROM0:0BE7 0A ld a,(bc) ROM0:0BE8 22 ldi (hl),a ROM0:0BE9 0C inc c ROM0:0BEA 0A ld a,(bc) ROM0:0BEB 32 ldd (hl),a ROM0:0BEC 0C inc c ROM0:0BED 19 add hl,de ROM0:0BEE 0A ld a,(bc) ROM0:0BEF 22 ldi (hl),a ROM0:0BF0 0C inc c ROM0:0BF1 0A ld a,(bc) ROM0:0BF2 32 ldd (hl),a ROM0:0BF3 0C inc c ROM0:0BF4 0A ld a,(bc) ROM0:0BF5 6F ld l,a ROM0:0BF6 0C inc c ROM0:0BF7 0A ld a,(bc) ROM0:0BF8 67 ld h,a ROM0:0BF9 0C inc c ROM0:0BFA 0A ld a,(bc) ROM0:0BFB 22 ldi (hl),a ROM0:0BFC 0C inc c ROM0:0BFD 0A ld a,(bc) ROM0:0BFE 32 ldd (hl),a ROM0:0BFF 0C inc c ROM0:0C00 19 add hl,de ROM0:0C01 0A ld a,(bc) ROM0:0C02 22 ldi (hl),a ROM0:0C03 0C inc c ROM0:0C04 0A ld a,(bc) ROM0:0C05 32 ldd (hl),a ROM0:0C06 0C inc c ROM0:0C07 0A ld a,(bc) ROM0:0C08 6F ld l,a ROM0:0C09 0C inc c ROM0:0C0A 0A ld a,(bc) ROM0:0C0B 67 ld h,a ROM0:0C0C 0C inc c ROM0:0C0D 0A ld a,(bc) ROM0:0C0E 22 ldi (hl),a ROM0:0C0F 0C inc c ROM0:0C10 0A ld a,(bc) ROM0:0C11 32 ldd (hl),a ROM0:0C12 0C inc c ROM0:0C13 19 add hl,de ROM0:0C14 0A ld a,(bc) ROM0:0C15 22 ldi (hl),a ROM0:0C16 0C inc c ROM0:0C17 0A ld a,(bc) ROM0:0C18 32 ldd (hl),a ROM0:0C19 0C inc c ROM0:0C1A 0A ld a,(bc) ROM0:0C1B 6F ld l,a ROM0:0C1C 0C inc c ROM0:0C1D 0A ld a,(bc) ROM0:0C1E 67 ld h,a ROM0:0C1F 0C inc c ROM0:0C20 0A ld a,(bc) ROM0:0C21 22 ldi (hl),a ROM0:0C22 0C inc c ROM0:0C23 0A ld a,(bc) ROM0:0C24 32 ldd (hl),a ROM0:0C25 0C inc c ROM0:0C26 19 add hl,de ROM0:0C27 0A ld a,(bc) ROM0:0C28 22 ldi (hl),a ROM0:0C29 0C inc c ROM0:0C2A 0A ld a,(bc) ROM0:0C2B 32 ldd (hl),a ROM0:0C2C 0C inc c ROM0:0C2D 0A ld a,(bc) ROM0:0C2E 6F ld l,a ROM0:0C2F 0C inc c ROM0:0C30 0A ld a,(bc) ROM0:0C31 67 ld h,a ROM0:0C32 0C inc c ROM0:0C33 0A ld a,(bc) ROM0:0C34 22 ldi (hl),a ROM0:0C35 0C inc c ROM0:0C36 0A ld a,(bc) ROM0:0C37 32 ldd (hl),a ROM0:0C38 0C inc c ROM0:0C39 19 add hl,de ROM0:0C3A 0A ld a,(bc) ROM0:0C3B 22 ldi (hl),a ROM0:0C3C 0C inc c ROM0:0C3D 0A ld a,(bc) ROM0:0C3E 32 ldd (hl),a ROM0:0C3F 0C inc c ROM0:0C40 3E 00 ld a,00 ROM0:0C42 EA AF C5 ld (C5AF),a ROM0:0C45 3E 01 ld a,01 ROM0:0C47 EA AC C5 ld (C5AC),a ROM0:0C4A CD B4 04 call 04B4 ROM0:0C4D D1 pop de ROM0:0C4E C1 pop bc ROM0:0C4F E1 pop hl ROM0:0C50 F1 pop af ROM0:0C51 D9 reti
0:0C52
ROM0:0C52 01 00 C1 ld bc,C100 ROM0:0C55 0A ld a,(bc) ROM0:0C56 6F ld l,a ROM0:0C57 0C inc c ROM0:0C58 0A ld a,(bc) ROM0:0C59 67 ld h,a ROM0:0C5A 0C inc c ROM0:0C5B 0A ld a,(bc) ROM0:0C5C 22 ldi (hl),a ROM0:0C5D 0C inc c ROM0:0C5E 0A ld a,(bc) ROM0:0C5F 22 ldi (hl),a ROM0:0C60 0C inc c ROM0:0C61 0A ld a,(bc) ROM0:0C62 22 ldi (hl),a ROM0:0C63 0C inc c ROM0:0C64 0A ld a,(bc) ROM0:0C65 22 ldi (hl),a ROM0:0C66 0C inc c ROM0:0C67 0A ld a,(bc) ROM0:0C68 22 ldi (hl),a ROM0:0C69 0C inc c ROM0:0C6A 0A ld a,(bc) ROM0:0C6B 22 ldi (hl),a ROM0:0C6C 0C inc c ROM0:0C6D 0A ld a,(bc) ROM0:0C6E 22 ldi (hl),a ROM0:0C6F 0C inc c ROM0:0C70 0A ld a,(bc) ROM0:0C71 22 ldi (hl),a ROM0:0C72 0C inc c ROM0:0C73 0A ld a,(bc) ROM0:0C74 6F ld l,a ROM0:0C75 0C inc c ROM0:0C76 0A ld a,(bc) ROM0:0C77 67 ld h,a ROM0:0C78 0C inc c ROM0:0C79 0A ld a,(bc) ROM0:0C7A 22 ldi (hl),a ROM0:0C7B 0C inc c ROM0:0C7C 0A ld a,(bc) ROM0:0C7D 22 ldi (hl),a ROM0:0C7E 0C inc c ROM0:0C7F 0A ld a,(bc) ROM0:0C80 22 ldi (hl),a ROM0:0C81 0C inc c ROM0:0C82 0A ld a,(bc) ROM0:0C83 22 ldi (hl),a ROM0:0C84 0C inc c ROM0:0C85 0A ld a,(bc) ROM0:0C86 22 ldi (hl),a ROM0:0C87 0C inc c ROM0:0C88 0A ld a,(bc) ROM0:0C89 22 ldi (hl),a ROM0:0C8A 0C inc c ROM0:0C8B 0A ld a,(bc) ROM0:0C8C 22 ldi (hl),a ROM0:0C8D 0C inc c ROM0:0C8E 0A ld a,(bc) ROM0:0C8F 22 ldi (hl),a ROM0:0C90 0C inc c ROM0:0C91 0A ld a,(bc) ROM0:0C92 22 ldi (hl),a ROM0:0C93 0C inc c ROM0:0C94 0A ld a,(bc) ROM0:0C95 22 ldi (hl),a ROM0:0C96 0C inc c ROM0:0C97 0A ld a,(bc) ROM0:0C98 22 ldi (hl),a ROM0:0C99 0C inc c ROM0:0C9A 0A ld a,(bc) ROM0:0C9B 22 ldi (hl),a ROM0:0C9C 0C inc c ROM0:0C9D 0A ld a,(bc) ROM0:0C9E 22 ldi (hl),a ROM0:0C9F 0C inc c ROM0:0CA0 0A ld a,(bc) ROM0:0CA1 22 ldi (hl),a ROM0:0CA2 0C inc c ROM0:0CA3 0A ld a,(bc) ROM0:0CA4 22 ldi (hl),a ROM0:0CA5 0C inc c ROM0:0CA6 0A ld a,(bc) ROM0:0CA7 22 ldi (hl),a ROM0:0CA8 0C inc c ROM0:0CA9 0A ld a,(bc) ROM0:0CAA 22 ldi (hl),a ROM0:0CAB 0C inc c ROM0:0CAC 0A ld a,(bc) ROM0:0CAD 22 ldi (hl),a ROM0:0CAE 0C inc c ROM0:0CAF 0A ld a,(bc) ROM0:0CB0 22 ldi (hl),a ROM0:0CB1 0C inc c ROM0:0CB2 0A ld a,(bc) ROM0:0CB3 22 ldi (hl),a ROM0:0CB4 0C inc c ROM0:0CB5 0A ld a,(bc) ROM0:0CB6 22 ldi (hl),a ROM0:0CB7 0C inc c ROM0:0CB8 0A ld a,(bc) ROM0:0CB9 22 ldi (hl),a ROM0:0CBA 0C inc c ROM0:0CBB 0A ld a,(bc) ROM0:0CBC 22 ldi (hl),a ROM0:0CBD 0C inc c ROM0:0CBE 0A ld a,(bc) ROM0:0CBF 22 ldi (hl),a ROM0:0CC0 0C inc c ROM0:0CC1 0A ld a,(bc) ROM0:0CC2 22 ldi (hl),a ROM0:0CC3 0C inc c ROM0:0CC4 0A ld a,(bc) ROM0:0CC5 22 ldi (hl),a ROM0:0CC6 0C inc c ROM0:0CC7 0A ld a,(bc) ROM0:0CC8 22 ldi (hl),a ROM0:0CC9 0C inc c ROM0:0CCA 0A ld a,(bc) ROM0:0CCB 22 ldi (hl),a ROM0:0CCC 0C inc c ROM0:0CCD 0A ld a,(bc) ROM0:0CCE 22 ldi (hl),a ROM0:0CCF 0C inc c ROM0:0CD0 0A ld a,(bc) ROM0:0CD1 22 ldi (hl),a ROM0:0CD2 0C inc c ROM0:0CD3 0A ld a,(bc) ROM0:0CD4 22 ldi (hl),a ROM0:0CD5 0C inc c ROM0:0CD6 0A ld a,(bc) ROM0:0CD7 22 ldi (hl),a ROM0:0CD8 0C inc c ROM0:0CD9 0A ld a,(bc) ROM0:0CDA 22 ldi (hl),a ROM0:0CDB 0C inc c ROM0:0CDC 0A ld a,(bc) ROM0:0CDD 22 ldi (hl),a ROM0:0CDE 0C inc c ROM0:0CDF 0A ld a,(bc) ROM0:0CE0 22 ldi (hl),a ROM0:0CE1 0C inc c ROM0:0CE2 0A ld a,(bc) ROM0:0CE3 22 ldi (hl),a ROM0:0CE4 0C inc c ROM0:0CE5 0A ld a,(bc) ROM0:0CE6 22 ldi (hl),a ROM0:0CE7 0C inc c ROM0:0CE8 0A ld a,(bc) ROM0:0CE9 22 ldi (hl),a ROM0:0CEA 0C inc c ROM0:0CEB 0A ld a,(bc) ROM0:0CEC 22 ldi (hl),a ROM0:0CED 0C inc c ROM0:0CEE 0A ld a,(bc) ROM0:0CEF 22 ldi (hl),a ROM0:0CF0 0C inc c ROM0:0CF1 0A ld a,(bc) ROM0:0CF2 22 ldi (hl),a ROM0:0CF3 0C inc c ROM0:0CF4 0A ld a,(bc) ROM0:0CF5 22 ldi (hl),a ROM0:0CF6 0C inc c ROM0:0CF7 0A ld a,(bc) ROM0:0CF8 22 ldi (hl),a ROM0:0CF9 0C inc c ROM0:0CFA 0A ld a,(bc) ROM0:0CFB 22 ldi (hl),a ROM0:0CFC 0C inc c ROM0:0CFD 0A ld a,(bc) ROM0:0CFE 22 ldi (hl),a ROM0:0CFF 0C inc c ROM0:0D00 0A ld a,(bc) ROM0:0D01 22 ldi (hl),a ROM0:0D02 0C inc c ROM0:0D03 0A ld a,(bc) ROM0:0D04 22 ldi (hl),a ROM0:0D05 0C inc c ROM0:0D06 0A ld a,(bc) ROM0:0D07 22 ldi (hl),a ROM0:0D08 0C inc c ROM0:0D09 0A ld a,(bc) ROM0:0D0A 22 ldi (hl),a ROM0:0D0B 0C inc c ROM0:0D0C 0A ld a,(bc) ROM0:0D0D 22 ldi (hl),a ROM0:0D0E 0C inc c ROM0:0D0F 0A ld a,(bc) ROM0:0D10 22 ldi (hl),a ROM0:0D11 0C inc c ROM0:0D12 0A ld a,(bc) ROM0:0D13 22 ldi (hl),a ROM0:0D14 0C inc c ROM0:0D15 0A ld a,(bc) ROM0:0D16 22 ldi (hl),a ROM0:0D17 0C inc c ROM0:0D18 0A ld a,(bc) ROM0:0D19 22 ldi (hl),a ROM0:0D1A 0C inc c ROM0:0D1B 0A ld a,(bc) ROM0:0D1C 22 ldi (hl),a ROM0:0D1D 0C inc c ROM0:0D1E 0A ld a,(bc) ROM0:0D1F 22 ldi (hl),a ROM0:0D20 0C inc c ROM0:0D21 0A ld a,(bc) ROM0:0D22 22 ldi (hl),a ROM0:0D23 0C inc c ROM0:0D24 0A ld a,(bc) ROM0:0D25 22 ldi (hl),a ROM0:0D26 0C inc c ROM0:0D27 0A ld a,(bc) ROM0:0D28 22 ldi (hl),a ROM0:0D29 0C inc c ROM0:0D2A 0A ld a,(bc) ROM0:0D2B 22 ldi (hl),a ROM0:0D2C 0C inc c ROM0:0D2D 0A ld a,(bc) ROM0:0D2E 22 ldi (hl),a ROM0:0D2F 0C inc c ROM0:0D30 0A ld a,(bc) ROM0:0D31 22 ldi (hl),a ROM0:0D32 0C inc c ROM0:0D33 0A ld a,(bc) ROM0:0D34 22 ldi (hl),a ROM0:0D35 0C inc c ROM0:0D36 0A ld a,(bc) ROM0:0D37 22 ldi (hl),a ROM0:0D38 0C inc c ROM0:0D39 0A ld a,(bc) ROM0:0D3A 22 ldi (hl),a ROM0:0D3B 0C inc c ROM0:0D3C 0A ld a,(bc) ROM0:0D3D 22 ldi (hl),a ROM0:0D3E 0C inc c ROM0:0D3F 0A ld a,(bc) ROM0:0D40 22 ldi (hl),a ROM0:0D41 0C inc c ROM0:0D42 0A ld a,(bc) ROM0:0D43 22 ldi (hl),a ROM0:0D44 0C inc c ROM0:0D45 0A ld a,(bc) ROM0:0D46 22 ldi (hl),a ROM0:0D47 0C inc c ROM0:0D48 0A ld a,(bc) ROM0:0D49 22 ldi (hl),a ROM0:0D4A 0C inc c ROM0:0D4B 0A ld a,(bc) ROM0:0D4C 22 ldi (hl),a ROM0:0D4D 0C inc c ROM0:0D4E 0A ld a,(bc) ROM0:0D4F 22 ldi (hl),a ROM0:0D50 0C inc c ROM0:0D51 0A ld a,(bc) ROM0:0D52 22 ldi (hl),a ROM0:0D53 0C inc c ROM0:0D54 0A ld a,(bc) ROM0:0D55 22 ldi (hl),a ROM0:0D56 0C inc c ROM0:0D57 0A ld a,(bc) ROM0:0D58 22 ldi (hl),a ROM0:0D59 0C inc c ROM0:0D5A 0A ld a,(bc) ROM0:0D5B 22 ldi (hl),a ROM0:0D5C 0C inc c ROM0:0D5D 0A ld a,(bc) ROM0:0D5E 22 ldi (hl),a ROM0:0D5F 0C inc c ROM0:0D60 0A ld a,(bc) ROM0:0D61 22 ldi (hl),a ROM0:0D62 0C inc c ROM0:0D63 0A ld a,(bc) ROM0:0D64 22 ldi (hl),a ROM0:0D65 0C inc c ROM0:0D66 0A ld a,(bc) ROM0:0D67 22 ldi (hl),a ROM0:0D68 0C inc c ROM0:0D69 0A ld a,(bc) ROM0:0D6A 22 ldi (hl),a ROM0:0D6B 0C inc c ROM0:0D6C 0A ld a,(bc) ROM0:0D6D 22 ldi (hl),a ROM0:0D6E 0C inc c ROM0:0D6F 0A ld a,(bc) ROM0:0D70 22 ldi (hl),a ROM0:0D71 0C inc c ROM0:0D72 0A ld a,(bc) ROM0:0D73 22 ldi (hl),a ROM0:0D74 0C inc c ROM0:0D75 0A ld a,(bc) ROM0:0D76 22 ldi (hl),a ROM0:0D77 0C inc c ROM0:0D78 0A ld a,(bc) ROM0:0D79 22 ldi (hl),a ROM0:0D7A 0C inc c ROM0:0D7B 0A ld a,(bc) ROM0:0D7C 22 ldi (hl),a ROM0:0D7D 0C inc c ROM0:0D7E 0A ld a,(bc) ROM0:0D7F 22 ldi (hl),a ROM0:0D80 0C inc c ROM0:0D81 0A ld a,(bc) ROM0:0D82 22 ldi (hl),a ROM0:0D83 0C inc c ROM0:0D84 0A ld a,(bc) ROM0:0D85 22 ldi (hl),a ROM0:0D86 0C inc c ROM0:0D87 0A ld a,(bc) ROM0:0D88 22 ldi (hl),a ROM0:0D89 0C inc c ROM0:0D8A 0A ld a,(bc) ROM0:0D8B 22 ldi (hl),a ROM0:0D8C 0C inc c ROM0:0D8D 0A ld a,(bc) ROM0:0D8E 22 ldi (hl),a ROM0:0D8F 0C inc c ROM0:0D90 0A ld a,(bc) ROM0:0D91 22 ldi (hl),a ROM0:0D92 0C inc c ROM0:0D93 0A ld a,(bc) ROM0:0D94 22 ldi (hl),a ROM0:0D95 0C inc c ROM0:0D96 0A ld a,(bc) ROM0:0D97 22 ldi (hl),a ROM0:0D98 0C inc c ROM0:0D99 0A ld a,(bc) ROM0:0D9A 22 ldi (hl),a ROM0:0D9B 0C inc c ROM0:0D9C 0A ld a,(bc) ROM0:0D9D 22 ldi (hl),a ROM0:0D9E 0C inc c ROM0:0D9F 0A ld a,(bc) ROM0:0DA0 22 ldi (hl),a ROM0:0DA1 0C inc c ROM0:0DA2 0A ld a,(bc) ROM0:0DA3 22 ldi (hl),a ROM0:0DA4 0C inc c ROM0:0DA5 0A ld a,(bc) ROM0:0DA6 22 ldi (hl),a ROM0:0DA7 0C inc c ROM0:0DA8 0A ld a,(bc) ROM0:0DA9 22 ldi (hl),a ROM0:0DAA 0C inc c ROM0:0DAB 0A ld a,(bc) ROM0:0DAC 22 ldi (hl),a ROM0:0DAD 0C inc c ROM0:0DAE 0A ld a,(bc) ROM0:0DAF 22 ldi (hl),a ROM0:0DB0 0C inc c ROM0:0DB1 0A ld a,(bc) ROM0:0DB2 22 ldi (hl),a ROM0:0DB3 0C inc c ROM0:0DB4 0A ld a,(bc) ROM0:0DB5 22 ldi (hl),a ROM0:0DB6 0C inc c ROM0:0DB7 0A ld a,(bc) ROM0:0DB8 22 ldi (hl),a ROM0:0DB9 0C inc c ROM0:0DBA 0A ld a,(bc) ROM0:0DBB 22 ldi (hl),a ROM0:0DBC 0C inc c ROM0:0DBD 0A ld a,(bc) ROM0:0DBE 22 ldi (hl),a ROM0:0DBF 0C inc c ROM0:0DC0 0A ld a,(bc) ROM0:0DC1 22 ldi (hl),a ROM0:0DC2 0C inc c ROM0:0DC3 0A ld a,(bc) ROM0:0DC4 22 ldi (hl),a ROM0:0DC5 0C inc c ROM0:0DC6 0A ld a,(bc) ROM0:0DC7 22 ldi (hl),a ROM0:0DC8 0C inc c ROM0:0DC9 0A ld a,(bc) ROM0:0DCA 22 ldi (hl),a ROM0:0DCB 0C inc c ROM0:0DCC 0A ld a,(bc) ROM0:0DCD 22 ldi (hl),a ROM0:0DCE 0C inc c ROM0:0DCF 0A ld a,(bc) ROM0:0DD0 22 ldi (hl),a ROM0:0DD1 0C inc c ROM0:0DD2 0A ld a,(bc) ROM0:0DD3 22 ldi (hl),a ROM0:0DD4 0C inc c ROM0:0DD5 0A ld a,(bc) ROM0:0DD6 22 ldi (hl),a ROM0:0DD7 0C inc c ROM0:0DD8 0A ld a,(bc) ROM0:0DD9 22 ldi (hl),a ROM0:0DDA 0C inc c ROM0:0DDB 0A ld a,(bc) ROM0:0DDC 22 ldi (hl),a ROM0:0DDD 0C inc c ROM0:0DDE 0A ld a,(bc) ROM0:0DDF 22 ldi (hl),a ROM0:0DE0 0C inc c ROM0:0DE1 0A ld a,(bc) ROM0:0DE2 22 ldi (hl),a ROM0:0DE3 0C inc c ROM0:0DE4 0A ld a,(bc) ROM0:0DE5 22 ldi (hl),a ROM0:0DE6 0C inc c ROM0:0DE7 0A ld a,(bc) ROM0:0DE8 22 ldi (hl),a ROM0:0DE9 0C inc c ROM0:0DEA 0A ld a,(bc) ROM0:0DEB 22 ldi (hl),a ROM0:0DEC 0C inc c ROM0:0DED 0A ld a,(bc) ROM0:0DEE 22 ldi (hl),a ROM0:0DEF 0C inc c ROM0:0DF0 0A ld a,(bc) ROM0:0DF1 22 ldi (hl),a ROM0:0DF2 0C inc c ROM0:0DF3 0A ld a,(bc) ROM0:0DF4 22 ldi (hl),a ROM0:0DF5 0C inc c ROM0:0DF6 0A ld a,(bc) ROM0:0DF7 22 ldi (hl),a ROM0:0DF8 0C inc c ROM0:0DF9 0A ld a,(bc) ROM0:0DFA 6F ld l,a ROM0:0DFB 0C inc c ROM0:0DFC 0A ld a,(bc) ROM0:0DFD 67 ld h,a ROM0:0DFE 0C inc c ROM0:0DFF 0A ld a,(bc) ROM0:0E00 22 ldi (hl),a ROM0:0E01 0C inc c ROM0:0E02 0A ld a,(bc) ROM0:0E03 22 ldi (hl),a ROM0:0E04 0C inc c ROM0:0E05 0A ld a,(bc) ROM0:0E06 22 ldi (hl),a ROM0:0E07 0C inc c ROM0:0E08 0A ld a,(bc) ROM0:0E09 22 ldi (hl),a ROM0:0E0A 0C inc c ROM0:0E0B 0A ld a,(bc) ROM0:0E0C 22 ldi (hl),a ROM0:0E0D 0C inc c ROM0:0E0E 0A ld a,(bc) ROM0:0E0F 22 ldi (hl),a ROM0:0E10 0C inc c ROM0:0E11 0A ld a,(bc) ROM0:0E12 22 ldi (hl),a ROM0:0E13 0C inc c ROM0:0E14 0A ld a,(bc) ROM0:0E15 22 ldi (hl),a ROM0:0E16 0C inc c ROM0:0E17 3E 00 ld a,00 ROM0:0E19 EA AF C5 ld (C5AF),a ROM0:0E1C 3E 01 ld a,01 ROM0:0E1E EA AC C5 ld (C5AC),a ROM0:0E21 CD B4 04 call 04B4 ROM0:0E24 D1 pop de ROM0:0E25 C1 pop bc ROM0:0E26 E1 pop hl ROM0:0E27 F1 pop af ROM0:0E28 D9 reti
Display 1
Display graphics interrupt
ROM0:0E29 21 00 C1 ld hl,C100 ROM0:0E2C 0E 40 ld c,40 ROM0:0E2E 06 00 ld b,00 ROM0:0E30 78 ld a,b ROM0:0E31 E0 68 ld (ff00+68),a ROM0:0E33 2A ldi a,(hl) ROM0:0E34 E0 69 ld (ff00+69),a ROM0:0E36 04 inc b ROM0:0E37 0D dec c ROM0:0E38 20 F6 jr nz,0E30 ROM0:0E3A 0E 40 ld c,40 ROM0:0E3C 06 00 ld b,00 ROM0:0E3E 78 ld a,b ROM0:0E3F E0 6A ld (ff00+6A),a ROM0:0E41 2A ldi a,(hl) ROM0:0E42 E0 6B ld (ff00+6B),a ROM0:0E44 04 inc b ROM0:0E45 0D dec c ROM0:0E46 20 F6 jr nz,0E3E ROM0:0E48 3E 00 ld a,00 ROM0:0E4A EA AF C5 ld (C5AF),a ;OAM pointer offset ROM0:0E4D 3E 01 ld a,01 ROM0:0E4F EA AC C5 ld (C5AC),a ;Indicates the game is loading graphics ROM0:0E52 CD B4 04 call 04B4 ROM0:0E55 D1 pop de ROM0:0E56 C1 pop bc ROM0:0E57 E1 pop hl ROM0:0E58 F1 pop af ROM0:0E59 D9 reti
High Speed DMA
ROM0:0EAD FA B0 C5 ld a,(C5B0) ROM0:0EB0 E0 51 ld (ff00+51),a ;HDMA src hi ROM0:0EB2 FA B1 C5 ld a,(C5B1) ROM0:0EB5 E0 52 ld (ff00+52),a ;HDMA src low ROM0:0EB7 FA B2 C5 ld a,(C5B2) ROM0:0EBA E0 53 ld (ff00+53),a ;HDMA dest hi ROM0:0EBC FA B3 C5 ld a,(C5B3) ROM0:0EBF E0 54 ld (ff00+54),a ;HDMA dest low ROM0:0EC1 FA B4 C5 ld a,(C5B4) ROM0:0EC4 E0 55 ld (ff00+55),a ;HDMA count ROM0:0EC6 3E 00 ld a,00 ROM0:0EC8 EA AF C5 ld (C5AF),a ;OAM pointer offset ROM0:0ECB 3E 01 ld a,01 ROM0:0ECD EA AC C5 ld (C5AC),a ;Indicates the game is loading graphics ROM0:0ED0 CD B4 04 call 04B4 ROM0:0ED3 D1 pop de ROM0:0ED4 C1 pop bc ROM0:0ED5 E1 pop hl ROM0:0ED6 F1 pop af ROM0:0ED7 D9 reti
0:0ED8 (Sets (C5AE) and (C5AF) to 0)
ROM0:0ED8 F5 push af ROM0:0ED9 3E 00 ld a,00 ROM0:0EDB EA AE C5 ld (C5AE),a ROM0:0EDE EA AF C5 ld (C5AF),a ROM0:0EE1 F1 pop af ROM0:0EE2 C9 ret
0:0EE3
0xEE3-0xEFF
- Related to display
ROM0:0EE3 F5 push af ROM0:0EE4 C5 push bc ROM0:0EE5 E5 push hl ROM0:0EE6 EA AE C5 ld (C5AE),a ;(C5AE) is used to manage display. ROM0:0EE9 4F ld c,a ROM0:0EEA 06 00 ld b,00 ROM0:0EEC 21 00 0F ld hl,0F00 ROM0:0EEF 09 add hl,bc ROM0:0EF0 2A ldi a,(hl) ROM0:0EF1 66 ld h,(hl) ROM0:0EF2 6F ld l,a ROM0:0EF3 01 F8 0E ld bc,0EF8 ROM0:0EF6 C5 push bc ROM0:0EF7 E9 jp hl ROM0:0EF8 AF xor a ROM0:0EF9 EA AD C5 ld (C5AD),a ;Sets (C5AD) to 0. Used to manage display. ROM0:0EFC E1 pop hl ROM0:0EFD C1 pop bc ROM0:0EFE F1 pop af ROM0:0EFF C9 ret
0:0F00 (Display functions pointers array)
0xF00-0xF1F
- Pointers related to display, read by function 0:0EE3
20 0F - ret 20 0F - ret 20 0F - ret 21 0F 20 0F 46 0F A3 0F C0 0F 25 10 52 10 87 10 20 0F - ret 20 0F - ret A4 10 A5 10 B2 10
ret (called by 0:0EE3)
ROM0:0F20 C9 ret
0:0F21
ROM0:0F21 F5 push af ROM0:0F22 E5 push hl ROM0:0F23 21 00 C1 ld hl,C100 ROM0:0F26 3E 02 ld a,02 ROM0:0F28 22 ldi (hl),a ROM0:0F29 36 C1 ld (hl),C1 ROM0:0F2B 21 16 C1 ld hl,C116 ROM0:0F2E 3E 18 ld a,18 ROM0:0F30 22 ldi (hl),a ROM0:0F31 36 C1 ld (hl),C1 ROM0:0F33 21 2C C1 ld hl,C12C ROM0:0F36 3E 2E ld a,2E ROM0:0F38 22 ldi (hl),a ROM0:0F39 36 C1 ld (hl),C1 ROM0:0F3B 21 42 C1 ld hl,C142 ROM0:0F3E 3E 42 ld a,42 ROM0:0F40 22 ldi (hl),a ROM0:0F41 36 C1 ld (hl),C1 ROM0:0F43 E1 pop hl ROM0:0F44 F1 pop af ROM0:0F45 C9 ret
0:10C1 (Call subroutine waiting for graphics update interrupt to happen and to resolve. Display: (C5AF) = (C5AE), then (C5AE) = 0)
0x10C1-0x10D1
- Related to display
ROM0:10C1 F5 push af ROM0:10C2 FA AE C5 ld a,(C5AE) ROM0:10C5 EA AF C5 ld (C5AF),a ROM0:10C8 3E 00 ld a,00 ROM0:10CA EA AE C5 ld (C5AE),a ROM0:10CD CD 4B 11 call 114B ;Loops until RAM address 0xC5AC is non-zero. It hangs the program until the graphics on screen are updated. ROM0:10D0 F1 pop af ROM0:10D1 C9 ret
0:10D2
0x10D2-0x1103
- Related to display
ROM0:10D2 F5 push af ROM0:10D3 E5 push hl ROM0:10D4 FA AE C5 ld a,(C5AE) ROM0:10D7 FE 1A cp a,1A ROM0:10D9 20 0A jr nz,10E5 ROM0:10DB 78 ld a,b ROM0:10DC EA B2 C5 ld (C5B2),a ROM0:10DF 79 ld a,c ROM0:10E0 EA B3 C5 ld (C5B3),a ROM0:10E3 18 1C jr 1101 ROM0:10E5 FE 1E cp a,1E ROM0:10E7 20 0A jr nz,10F3 ROM0:10E9 78 ld a,b ROM0:10EA EA B2 C5 ld (C5B2),a ROM0:10ED 79 ld a,c ROM0:10EE EA B3 C5 ld (C5B3),a ROM0:10F1 18 0E jr 1101 ROM0:10F3 26 C1 ld h,C1 ROM0:10F5 FA AD C5 ld a,(C5AD) ROM0:10F8 6F ld l,a ROM0:10F9 79 ld a,c ROM0:10FA 22 ldi (hl),a ROM0:10FB 78 ld a,b ROM0:10FC 22 ldi (hl),a ROM0:10FD 7D ld a,l ROM0:10FE EA AD C5 ld (C5AD),a ROM0:1101 E1 pop hl ROM0:1102 F1 pop af ROM0:1103 C9 ret
0:1104 (Set wC5B0-wC5B1 to bc)
ROM0:1104 F5 push af ROM0:1105 78 ld a,b ROM0:1106 EA B0 C5 ld (C5B0),a ROM0:1109 79 ld a,c ROM0:110A EA B1 C5 ld (C5B1),a ROM0:110D F1 pop af ROM0:110E C9 ret
0:110F (Set wC5B4)
ROM0:110F EA B4 C5 ld (C5B4),a ROM0:1112 C9 ret
0:1113
ROM0:1113 F5 push af ROM0:1114 E5 push hl ROM0:1115 F5 push af ROM0:1116 26 C1 ld h,C1 ROM0:1118 FA AD C5 ld a,(C5AD) ;wC5AD is the offset to the WRAM display array at (C100) ROM0:111B 6F ld l,a ROM0:111C F1 pop af ROM0:111D 22 ldi (hl),a ROM0:111E 7D ld a,l ROM0:111F EA AD C5 ld (C5AD),a ROM0:1122 E1 pop hl ROM0:1123 F1 pop af ROM0:1124 C9 ret
Updates characters displayed on screen
0x1113-0x1124
- Used to update the password at (C102), the name entry at (C10C) and various values displayed in battle
ROM0:1113 F5 push af ROM0:1114 E5 push hl ROM0:1115 F5 push af ROM0:1116 26 C1 ld h,C1 ROM0:1118 FA AD C5 ld a,(C5AD) ROM0:111B 6F ld l,a ROM0:111C F1 pop af ROM0:111D 22 ldi (hl),a ROM0:111E 7D ld a,l ROM0:111F EA AD C5 ld (C5AD),a ROM0:1122 E1 pop hl ROM0:1123 F1 pop af ROM0:1124 C9 ret
Wait for screen graphics to be updated
0x1125-0x1136
ROM0:1125 F5 push af ROM0:1126 E5 push hl ROM0:1127 26 C1 ld h,C1 ROM0:1129 FA AD C5 ld a,(C5AD) ;offset to the WRAM display array at (C100) ROM0:112C 6F ld l,a ROM0:112D CD 1B 02 call 021B ROM0:1130 7D ld a,l ROM0:1131 EA AD C5 ld (C5AD),a ;offset to the WRAM display array at (C100) ROM0:1134 E1 pop hl ROM0:1135 F1 pop af ROM0:1136 C9 ret
0x1137-0x114A
ROM0:1137 F5 push af ROM0:1138 E5 push hl ROM0:1139 21 00 C1 ld hl,C100 ;WRAM display array ROM0:113C CD 1B 02 call 021B ROM0:113F CD 1B 02 call 021B ROM0:1142 CD 1B 02 call 021B ROM0:1145 CD 1B 02 call 021B ROM0:1148 E1 pop hl ROM0:1149 F1 pop af ROM0:114A C9 ret
0x114B-0x1157
- Loops untilwC5AC
is non-zero. It hangs the program until the graphics on screen are updated.wC5AC
is set to 1 during an interrupt.
ROM0:114B F5 push af ROM0:114C AF xor a ROM0:114D EA AC C5 ld (C5AC),a ;game_finished_loading_graphics = false ROM0:1150 FA AC C5 ld a,(C5AC) ;a = game_finished_loading_graphics ROM0:1153 B7 or a ROM0:1154 28 FA jr z,1150 ;Loops until game_finished_loading_graphics == true ROM0:1156 F1 pop af ROM0:1157 C9 ret
0x1158-0x1164
- Calls 10 times the function "wait for graphics being updated"
ROM0:1158 F5 push af ROM0:1159 C5 push bc ROM0:115A 0E 0A ld c,0A ROM0:115C CD 4B 11 call 114B ROM0:115F 0D dec c ROM0:1160 20 FA jr nz,115C ;Loops until function 0x114B has been called 10 times ROM0:1162 C1 pop bc ROM0:1163 F1 pop af ROM0:1164 C9 ret
0:1165
ROM0:1165 F5 push af ROM0:1166 E5 push hl ROM0:1167 AF xor a ROM0:1168 EA B5 C5 ld (C5B5),a ROM0:116B EA B6 C5 ld (C5B6),a ROM0:116E EA B7 C5 ld (C5B7),a ROM0:1171 CD 85 11 call 1185 ROM0:1174 FE 01 cp a,01 ROM0:1176 28 06 jr z,117E ROM0:1178 FA A2 C5 ld a,(C5A2) ROM0:117B B7 or a ROM0:117C 28 F3 jr z,1171 ROM0:117E AF xor a ROM0:117F EA A2 C5 ld (C5A2),a ROM0:1182 E1 pop hl ROM0:1183 F1 pop af ROM0:1184 C9 ret
0:1185
ROM0:1185 FA B5 C5 ld a,(C5B5) ROM0:1188 C6 01 add a,01 ROM0:118A EA B5 C5 ld (C5B5),a ROM0:118D FA B6 C5 ld a,(C5B6) ROM0:1190 CE 00 adc a,00 ROM0:1192 EA B6 C5 ld (C5B6),a ROM0:1195 FE FF cp a,FF ROM0:1197 20 07 jr nz,11A0 ROM0:1199 CD F6 1B call 1BF6 ;(C7AD) | 2 ROM0:119C 3E 01 ld a,01 ROM0:119E 18 01 jr 11A1 ROM0:11A0 AF xor a ROM0:11A1 C9 ret
rst 08 instructions
0x11A2-0x11D7
- rst 08 jumps here: ROM Bank switch, load pointer to next instructions
ROM0:11A2 F5 push af ROM0:11A3 E8 FD add sp,FD ROM0:11A5 F5 push af ROM0:11A6 E5 push hl ROM0:11A7 C5 push bc ROM0:11A8 D5 push de ROM0:11A9 F8 06 ld hl,sp+06 ROM0:11AB 54 ld d,h ROM0:11AC 5D ld e,l ROM0:11AD F8 0E ld hl,sp+0E ROM0:11AF 3A ldd a,(hl) ROM0:11B0 47 ld b,a ROM0:11B1 3A ldd a,(hl) ROM0:11B2 4F ld c,a ROM0:11B3 FA 00 40 ld a,(4000) ;ROM Bank ROM0:11B6 32 ldd (hl),a ROM0:11B7 7E ld a,(hl) ROM0:11B8 12 ld (de),a ROM0:11B9 3E 11 ld a,11 ROM0:11BB 32 ldd (hl),a ROM0:11BC 3E D8 ld a,D8 ROM0:11BE 32 ldd (hl),a ROM0:11BF 0A ld a,(bc) ROM0:11C0 5F ld e,a ROM0:11C1 03 inc bc ROM0:11C2 16 40 ld d,40 ROM0:11C4 0A ld a,(bc) ROM0:11C5 03 inc bc ROM0:11C6 EA 00 20 ld (2000),a ;ROM Bank switch ROM0:11C9 1A ld a,(de) ROM0:11CA 32 ldd (hl),a ROM0:11CB 1D dec e ROM0:11CC 1A ld a,(de) ROM0:11CD 77 ld (hl),a ROM0:11CE F8 0D ld hl,sp+0D ROM0:11D0 79 ld a,c ROM0:11D1 22 ldi (hl),a ROM0:11D2 70 ld (hl),b ROM0:11D3 D1 pop de ROM0:11D4 C1 pop bc ROM0:11D5 E1 pop hl ROM0:11D6 F1 pop af ROM0:11D7 C9 ret
0:11D8 (next instructions)
ROM0:11D8 F5 push af ROM0:11D9 E5 push hl ROM0:11DA C5 push bc ROM0:11DB F8 06 ld hl,sp+06 ROM0:11DD 7E ld a,(hl) ROM0:11DE EA 00 20 ld (2000),a ;ROM Bank switch ROM0:11E1 44 ld b,h ROM0:11E2 4D ld c,l ROM0:11E3 0B dec bc ROM0:11E4 0A ld a,(bc) ROM0:11E5 32 ldd (hl),a ROM0:11E6 0B dec bc ROM0:11E7 0A ld a,(bc) ROM0:11E8 77 ld (hl),a ROM0:11E9 C1 pop bc ROM0:11EA E1 pop hl ROM0:11EB E8 01 add sp,01 ROM0:11ED F1 pop af ROM0:11EE C9 ret
Banks and Interrupts handling
Initialize Banks
ROM0:11EF F5 push af ROM0:11F0 3E 01 ld a,01 ROM0:11F2 EA 00 20 ld (2000),a ;ROM Bank = 1 ROM0:11F5 AF xor a ROM0:11F6 EA 00 30 ld (3000),a ;ROM Bank (High) = 0 ROM0:11F9 EA 00 40 ld (4000),a ;RAM Bank = 0 ROM0:11FC E0 4F ld (ff00+4F),a ;VRAM Bank = 0 ROM0:11FE F1 pop af ROM0:11FF C9 ret
ROM Bank switch
0x1200-0x1203
- ROM Bank switch
ROM0:1200 EA 00 20 ld (2000),a ROM0:1203 C9 ret
0x1205-0x1210
- ROM Bank switch, two bytes
ROM0:1205 F3 di ROM0:1206 79 ld a,c ROM0:1207 EA 00 20 ld (2000),a ;Low ROM0:120A 78 ld a,b ROM0:120B EA 00 30 ld (3000),a ;High ROM0:120E FB ei ROM0:120F F1 pop af ROM0:1210 C9 ret
VRAM Bank switch
0x1211-0x1216
- VRAM bank 0
ROM0:1211 F5 push af ROM0:1212 AF xor a ROM0:1213 E0 4F ld (ff00+4F),a ROM0:1215 F1 pop af ROM0:1216 C9 ret
0x1211-0x1216
- VRAM bank 1
ROM0:1217 F5 push af ROM0:1218 3E 01 ld a,01 ROM0:121A E0 4F ld (ff00+4F),a ROM0:121C F1 pop af ROM0:121D C9 ret
0x121E-0x1223
- VRAM bank 0 (initialize)
ROM0:121E F5 push af ROM0:121F AF xor a ROM0:1220 E0 4F ld (ff00+4F),a ROM0:1222 F1 pop af ROM0:1223 C9 ret
WRAM Bank switch
0x1224-0x1247
- WRAM Bank switch
ROM0:1224 F5 push af ROM0:1225 E8 FF add sp,FF ROM0:1227 E5 push hl ROM0:1228 C5 push bc ROM0:1229 D5 push de ROM0:122A 4F ld c,a ROM0:122B F8 06 ld hl,sp+06 ROM0:122D 54 ld d,h ROM0:122E 5D ld e,l ROM0:122F F8 07 ld hl,sp+07 ROM0:1231 2A ldi a,(hl) ROM0:1232 12 ld (de),a ROM0:1233 13 inc de ROM0:1234 2A ldi a,(hl) ROM0:1235 12 ld (de),a ROM0:1236 13 inc de ROM0:1237 2A ldi a,(hl) ROM0:1238 12 ld (de),a ROM0:1239 13 inc de ROM0:123A 2A ldi a,(hl) ROM0:123B 12 ld (de),a ROM0:123C 13 inc de ROM0:123D F0 70 ld a,(ff00+70) ROM0:123F 12 ld (de),a ROM0:1240 79 ld a,c ROM0:1241 E0 70 ld (ff00+70),a ;SVBK ROM0:1243 D1 pop de ROM0:1244 C1 pop bc ROM0:1245 E1 pop hl ROM0:1246 F1 pop af ROM0:1247 C9 ret
WRAM Bank restore
0x1248-0x1263
- WRAM Bank restore
ROM0:1248 F5 push af ROM0:1249 E5 push hl ROM0:124A C5 push bc ROM0:124B F8 08 ld hl,sp+08 ROM0:124D 7E ld a,(hl) ROM0:124E E0 70 ld (ff00+70),a ;SVBK ROM0:1250 44 ld b,h ROM0:1251 4D ld c,l ROM0:1252 0B dec bc ROM0:1253 0A ld a,(bc) ROM0:1254 32 ldd (hl),a ROM0:1255 0B dec bc ROM0:1256 0A ld a,(bc) ROM0:1257 32 ldd (hl),a ROM0:1258 0B dec bc ROM0:1259 0A ld a,(bc) ROM0:125A 32 ldd (hl),a ROM0:125B 0B dec bc ROM0:125C 0A ld a,(bc) ROM0:125D 32 ldd (hl),a ROM0:125E C1 pop bc ROM0:125F E1 pop hl ROM0:1260 E8 01 add sp,01 ROM0:1262 F1 pop af ROM0:1263 C9 ret
Video Display switches
LCD Display Disable
0x1264-0x1277
- LCD Display Disable
ROM0:1264 F5 push af ROM0:1265 E5 push hl ROM0:1266 21 40 FF ld hl,FF40 ROM0:1269 CB 7E bit 7,(hl) ;Test the LCD Display ROM0:126B 28 08 jr z,1275 ;If the LCD Display is already OFF, get out of this function ROM0:126D F0 44 ld a,(ff00+44) ROM0:126F FE 92 cp a,92 ROM0:1271 38 FA jr c,126D ;Loop until VBlank + 2 ROM0:1273 CB BE res 7,(hl) ;LCD Display Disable ROM0:1275 E1 pop hl ROM0:1276 F1 pop af ROM0:1277 C9 ret
LCD Display Enable
0x1278-0x1281
- LCD Display Enable
ROM0:1278 F5 push af ROM0:1279 E5 push hl ROM0:127A 21 40 FF ld hl,FF40 ROM0:127D CB FE set 7,(hl) ;LCD Display Enable ROM0:127F E1 pop hl ROM0:1280 F1 pop af ROM0:1281 C9 ret
LCD Control
0x1282-0x129D
-
ROM0:1282 F5 push af ROM0:1283 C5 push bc ROM0:1284 D5 push de ROM0:1285 E5 push hl ROM0:1286 0E 40 ld c,40 ROM0:1288 11 F0 F5 ld de,F5F0 ROM0:128B 06 0C ld b,0C ROM0:128D CB 23 sla e ROM0:128F CB 12 rl d ROM0:1291 30 02 jr nc,1295 ROM0:1293 2A ldi a,(hl) ROM0:1294 E2 ld (ff00+c),a ;hFF40: LCD Control ROM0:1295 0C inc c ROM0:1296 05 dec b ROM0:1297 20 F4 jr nz,128D ROM0:1299 E1 pop hl ROM0:129A D1 pop de ROM0:129B C1 pop bc ROM0:129C F1 pop af ROM0:129D C9 ret
Wait for VBlank
ROM0:129E F5 push af ROM0:129F F0 44 ld a,(ff00+44) ;LY ROM0:12A1 FE 90 cp a,90 ROM0:12A3 38 FA jr c,129F ;Loop until VBlank start ROM0:12A5 F0 44 ld a,(ff00+44) ROM0:12A7 FE 00 cp a,00 ROM0:12A9 20 FA jr nz,12A5 ;Loop until VBlank end ROM0:12AB F1 pop af ROM0:12AC C9 ret
LCD Control - OBJ Display Enable
ROM0:12AD E5 push hl ROM0:12AE 21 40 FF ld hl,FF40 ROM0:12B1 CB CE set 1,(hl) ;LCD Control - OBJ Display Enable ROM0:12B3 E1 pop hl ROM0:12B4 C9 ret
LCD Control - OBJ Display Disable
ROM0:12B5 E5 push hl ROM0:12B6 21 40 FF ld hl,FF40 ROM0:12B9 CB 8E res 1,(hl) ;LCD Control - OBJ Display Disable ROM0:12BB E1 pop hl ROM0:12BC C9 ret
Blanks card illustration
0x12BD-0x12D7
- Fills(C500)
to(C59F)
toFF FF 00 00
.
ROM0:12BD F5 push af ROM0:12BE C5 push bc ROM0:12BF E5 push hl ROM0:12C0 21 00 C5 ld hl,C500 ROM0:12C3 0E 28 ld c,28 ROM0:12C5 3E FF ld a,FF ROM0:12C7 22 ldi (hl),a ROM0:12C8 3E FF ld a,FF ROM0:12CA 22 ldi (hl),a ROM0:12CB 3E 00 ld a,00 ROM0:12CD 22 ldi (hl),a ROM0:12CE 3E 00 ld a,00 ROM0:12D0 22 ldi (hl),a ROM0:12D1 0D dec c ROM0:12D2 20 F1 jr nz,12C5 ROM0:12D4 E1 pop hl ROM0:12D5 C1 pop bc ROM0:12D6 F1 pop af ROM0:12D7 C9 ret
0:12D8 (Text display ?)
ROM0:12D8 F5 push af ROM0:12D9 C5 push bc ROM0:12DA D5 push de ROM0:12DB E5 push hl ROM0:12DC 21 00 C5 ld hl,C500 ROM0:12DF 11 00 FE ld de,FE00 ROM0:12E2 0E A0 ld c,A0 ROM0:12E4 2A ldi a,(hl) ROM0:12E5 12 ld (de),a ROM0:12E6 1C inc e ROM0:12E7 0D dec c ROM0:12E8 20 FA jr nz,12E4 ROM0:12EA E1 pop hl ROM0:12EB D1 pop de ROM0:12EC C1 pop bc ROM0:12ED F1 pop af ROM0:12EE C9 ret
0:12EF
ROM0:12EF F5 push af ROM0:12F0 C5 push bc ROM0:12F1 E5 push hl ROM0:12F2 C5 push bc ROM0:12F3 CB 21 sla c ROM0:12F5 CB 21 sla c ROM0:12F7 06 00 ld b,00 ROM0:12F9 21 00 C5 ld hl,C500 ROM0:12FC 09 add hl,bc ROM0:12FD C1 pop bc ROM0:12FE 22 ldi (hl),a ROM0:12FF 7A ld a,d ROM0:1300 22 ldi (hl),a ROM0:1301 78 ld a,b ROM0:1302 22 ldi (hl),a ROM0:1303 36 00 ld (hl),00 ROM0:1305 E1 pop hl ROM0:1306 C1 pop bc ROM0:1307 F1 pop af ROM0:1308 C9 ret
0:1309
ROM0:1309 F5 push af ROM0:130A C5 push bc ROM0:130B D5 push de ROM0:130C E5 push hl ROM0:130D 3E B0 ld a,B0 ROM0:130F EA C4 C6 ld (C6C4),a ROM0:1312 3E B0 ld a,B0 ROM0:1314 EA C3 C6 ld (C6C3),a ROM0:1317 21 02 C5 ld hl,C502 ROM0:131A 3E 00 ld a,00 ROM0:131C 11 03 00 ld de,0003 ROM0:131F 01 28 02 ld bc,0228 ROM0:1322 22 ldi (hl),a ROM0:1323 80 add b ROM0:1324 36 00 ld (hl),00 ROM0:1326 19 add hl,de ROM0:1327 0D dec c ROM0:1328 20 F8 jr nz,1322 ROM0:132A CD 57 13 call 1357 ROM0:132D CD D8 12 call 12D8 ROM0:1330 E1 pop hl ROM0:1331 D1 pop de ROM0:1332 C1 pop bc ROM0:1333 F1 pop af ROM0:1334 C9 ret
0:1335
ROM0:1335 CD 3C 13 call 133C ROM0:1338 CD 57 13 call 1357 ROM0:133B C9 ret
0:133C
ROM0:133C F5 push af ROM0:133D C5 push bc ROM0:133E FA C5 C6 ld a,(C6C5) ROM0:1341 47 ld b,a ROM0:1342 FA C3 C6 ld a,(C6C3) ROM0:1345 80 add b ROM0:1346 EA C3 C6 ld (C6C3),a ROM0:1349 FA C6 C6 ld a,(C6C6) ROM0:134C 47 ld b,a ROM0:134D FA C4 C6 ld a,(C6C4) ROM0:1350 80 add b ROM0:1351 EA C4 C6 ld (C6C4),a ROM0:1354 C1 pop bc ROM0:1355 F1 pop af ROM0:1356 C9 ret
0:1357
ROM0:1357 F5 push af ROM0:1358 C5 push bc ROM0:1359 D5 push de ROM0:135A E5 push hl ROM0:135B 21 00 C5 ld hl,C500 ROM0:135E 16 00 ld d,00 ROM0:1360 06 05 ld b,05 ROM0:1362 1E 00 ld e,00 ROM0:1364 0E 08 ld c,08 ROM0:1366 FA C3 C6 ld a,(C6C3) ROM0:1369 82 add d ROM0:136A 22 ldi (hl),a ROM0:136B FA C4 C6 ld a,(C6C4) ROM0:136E 83 add e ROM0:136F 22 ldi (hl),a ROM0:1370 23 inc hl ROM0:1371 23 inc hl ROM0:1372 3E 08 ld a,08 ROM0:1374 83 add e ROM0:1375 5F ld e,a ROM0:1376 0D dec c ROM0:1377 20 ED jr nz,1366 ROM0:1379 3E 10 ld a,10 ROM0:137B 82 add d ROM0:137C 57 ld d,a ROM0:137D 05 dec b ROM0:137E 20 E2 jr nz,1362 ROM0:1380 E1 pop hl ROM0:1381 D1 pop de ROM0:1382 C1 pop bc ROM0:1383 F1 pop af ROM0:1384 C9 ret
0:1385
ROM0:1385 F5 push af ROM0:1386 E5 push hl ROM0:1387 D5 push de ROM0:1388 16 00 ld d,00 ROM0:138A CB 23 sla e ROM0:138C CB 23 sla e ROM0:138E CB 12 rl d ROM0:1390 21 00 C5 ld hl,C500 ROM0:1393 19 add hl,de ROM0:1394 D1 pop de ROM0:1395 79 ld a,c ROM0:1396 22 ldi (hl),a ROM0:1397 78 ld a,b ROM0:1398 22 ldi (hl),a ROM0:1399 7A ld a,d ROM0:139A 22 ldi (hl),a ROM0:139B 3E 00 ld a,00 ROM0:139D 22 ldi (hl),a ROM0:139E 79 ld a,c ROM0:139F 22 ldi (hl),a ROM0:13A0 78 ld a,b ROM0:13A1 C6 08 add a,08 ROM0:13A3 22 ldi (hl),a ROM0:13A4 7A ld a,d ROM0:13A5 C6 02 add a,02 ROM0:13A7 22 ldi (hl),a ROM0:13A8 36 00 ld (hl),00 ROM0:13AA E1 pop hl ROM0:13AB F1 pop af ROM0:13AC C9 ret
0:13AD
ROM0:13AD CD BD 12 call 12BD ;Blanks card illustration ROM0:13B0 CD D8 12 call 12D8 ROM0:13B3 C9 ret
0:13B4
ROM0:13B4 F5 push af ROM0:13B5 E5 push hl ROM0:13B6 D5 push de ROM0:13B7 16 00 ld d,00 ROM0:13B9 CB 23 sla e ROM0:13BB CB 23 sla e ROM0:13BD 21 00 C5 ld hl,C500 ROM0:13C0 19 add hl,de ROM0:13C1 D1 pop de ROM0:13C2 79 ld a,c ROM0:13C3 22 ldi (hl),a ROM0:13C4 78 ld a,b ROM0:13C5 22 ldi (hl),a ROM0:13C6 7A ld a,d ROM0:13C7 22 ldi (hl),a ROM0:13C8 3E 00 ld a,00 ROM0:13CA 22 ldi (hl),a ROM0:13CB 79 ld a,c ROM0:13CC 22 ldi (hl),a ROM0:13CD 78 ld a,b ROM0:13CE C6 08 add a,08 ROM0:13D0 22 ldi (hl),a ROM0:13D1 7A ld a,d ROM0:13D2 C6 02 add a,02 ROM0:13D4 22 ldi (hl),a ROM0:13D5 36 00 ld (hl),00 ROM0:13D7 E1 pop hl ROM0:13D8 F1 pop af ROM0:13D9 C9 ret
Alternate PRNG
0x13DA-0x13F0
- Alternate PRNG, used for example by Construction Cards
ROM0:13DA F5 push af ROM0:13DB C5 push bc ROM0:13DC 1E 00 ld e,00 ROM0:13DE 0E 08 ld c,08 ROM0:13E0 CB 22 sla d ;d << 1 ROM0:13E2 CB 13 rl e ROM0:13E4 7B ld a,e ;a = ((lsb(d) << 8) | (e >> 1)); d = ((lsb(e) << 8) | (d >> 1)) ROM0:13E5 B8 cp b ROM0:13E6 38 03 jr c,13EB ;If(a < b), jump to 0:13EB ROM0:13E8 90 sub b ROM0:13E9 5F ld e,a ROM0:13EA 14 inc d ;Else e = a - b; d++ ROM0:13EB 0D dec c ROM0:13EC 20 F2 jr nz,13E0 ;Loop 8 times ROM0:13EE C1 pop bc ROM0:13EF F1 pop af ROM0:13F0 C9 ret
Division
0x1432-0x1467
- Divides register de by register bc, returns result in registerde
ROM0:1432 F5 push af ROM0:1433 C5 push bc ROM0:1434 E5 push hl ROM0:1435 21 00 00 ld hl,0000 ROM0:1438 3E 10 ld a,10 ;Loop counter ROM0:143A F5 push af ROM0:143B CB 23 sla e ROM0:143D CB 12 rl d ;de << 1 ROM0:143F CB 15 rl l ROM0:1441 CB 14 rl h ;hl << 1 ROM0:1443 7C ld a,h ROM0:1444 B8 cp b ROM0:1445 38 19 jr c,1460 ;If(h < b), jump to 0:1460 ROM0:1447 7C ld a,h ROM0:1448 B8 cp b ROM0:1449 20 0D jr nz,1458 ;If(h ≠ b), jump to 0:1458 ROM0:144B 7D ld a,l ROM0:144C B9 cp c ROM0:144D 38 07 jr c,1456 ;If(l < c), jump to 0:1456 ROM0:144F 91 sub c ;Handle carry ROM0:1450 6F ld l,a ROM0:1451 7C ld a,h ROM0:1452 98 sbc b ;bc -- ROM0:1453 67 ld h,a ROM0:1454 CB C3 set 0,e ;Set bit 0 of register e to 1 ROM0:1456 18 08 jr 1460 ROM0:1458 7D ld a,l ROM0:1459 91 sub c ROM0:145A 6F ld l,a ROM0:145B 7C ld a,h ROM0:145C 98 sbc b ;bc -- ROM0:145D 67 ld h,a ROM0:145E CB C3 set 0,e ;Set bit 0 of register e to 1 ROM0:1460 F1 pop af ;pop iterations counter in accumulator ROM0:1461 3D dec a ;a -- ROM0:1462 20 D6 jr nz,143A ;Loop 16 times ROM0:1464 E1 pop hl ROM0:1465 C1 pop bc ROM0:1466 F1 pop af ROM0:1467 C9 ret
0:1468
ROM0:1468 F5 push af ROM0:1469 C5 push bc ROM0:146A D5 push de ROM0:146B 16 00 ld d,00 ;d = 0 ROM0:146D 21 00 00 ld hl,0000 ;hl = 0 ROM0:1470 0E 08 ld c,08 ;c = 8 ROM0:1472 CB 38 srl b ;b >> 1 ROM0:1474 30 01 jr nc,1477 ;If no carry, jump to 0:1477 ROM0:1476 19 add hl,de ;hl += de ROM0:1477 CB 23 sla e ROM0:1479 CB 12 rl d ;de << 1 ROM0:147B 0D dec c ;c -- ROM0:147C 20 F4 jr nz,1472 ;Loop to 0:1472 ROM0:147E D1 pop de ROM0:147F C1 pop bc ROM0:1480 F1 pop af ROM0:1481 C9 ret
daa addition
0x1482-0x1491
- daa addition (used for Life Points healing, Deck Capacity...)
ROM0:1482 F5 push af ROM0:1483 7B ld a,e ROM0:1484 81 add c ROM0:1485 27 daa ROM0:1486 4F ld c,a ROM0:1487 7A ld a,d ROM0:1488 80 add b ROM0:1489 27 daa ROM0:148A 47 ld b,a ROM0:148B 30 03 jr nc,1490 ROM0:148D 01 99 99 ld bc,9999 ;If(bc>10000), sets bc to 9999 ROM0:1490 F1 pop af ROM0:1491 C9 ret
daa substraction
0x1492-0x14B1
- daa substraction (used for Damage calculation, Card ID display...)
ROM0:1492 F5 push af ROM0:1493 78 ld a,b ROM0:1494 BA cp d ROM0:1495 20 0B jr nz,14A2 ROM0:1497 79 ld a,c ROM0:1498 BB cp e ROM0:1499 20 07 jr nz,14A2 ROM0:149B 01 00 00 ld bc,0000 ROM0:149E 1E 01 ld e,01 ;If (bc==de), sets bc to 0, and e to 1 ROM0:14A0 18 0E jr 14B0 ROM0:14A2 7B ld a,e ROM0:14A3 91 sub c ROM0:14A4 27 daa ROM0:14A5 4F ld c,a ROM0:14A6 7A ld a,d ROM0:14A7 98 sbc b ROM0:14A8 27 daa ROM0:14A9 47 ld b,a ROM0:14AA 1E 02 ld e,02 ROM0:14AC 30 02 jr nc,14B0 ROM0:14AE 1E 00 ld e,00 ;If(bc<0), set e to 2 ; else set e to 0 ROM0:14B0 F1 pop af ROM0:14B1 C9 ret
ROM0:14B2 F5 push af ROM0:14B3 C5 push bc ROM0:14B4 E5 push hl ROM0:14B5 FA F6 C5 ld a,(C5F6) ROM0:14B8 47 ld b,a ROM0:14B9 FA F7 C5 ld a,(C5F7) ROM0:14BC 4F ld c,a ROM0:14BD FA F8 C5 ld a,(C5F8) ROM0:14C0 57 ld d,a ROM0:14C1 FA F9 C5 ld a,(C5F9) ROM0:14C4 B8 cp b ROM0:14C5 20 1A jr nz,14E1 ROM0:14C7 FA FA C5 ld a,(C5FA) ROM0:14CA B9 cp c ROM0:14CB 20 14 jr nz,14E1 ROM0:14CD FA FB C5 ld a,(C5FB) ROM0:14D0 BA cp d ROM0:14D1 20 0E jr nz,14E1 ROM0:14D3 AF xor a ROM0:14D4 EA F6 C5 ld (C5F6),a ROM0:14D7 EA F7 C5 ld (C5F7),a ROM0:14DA EA F8 C5 ld (C5F8),a ROM0:14DD 1E 01 ld e,01 ROM0:14DF 18 1E jr 14FF ROM0:14E1 FA F9 C5 ld a,(C5F9) ROM0:14E4 90 sub b ROM0:14E5 27 daa ROM0:14E6 EA F6 C5 ld (C5F6),a ROM0:14E9 FA FA C5 ld a,(C5FA) ROM0:14EC 99 sbc c ROM0:14ED 27 daa ROM0:14EE EA F7 C5 ld (C5F7),a ROM0:14F1 FA FB C5 ld a,(C5FB) ROM0:14F4 9A sbc d ROM0:14F5 27 daa ROM0:14F6 EA F8 C5 ld (C5F8),a ROM0:14F9 1E 02 ld e,02 ROM0:14FB 30 02 jr nc,14FF ROM0:14FD 1E 00 ld e,00 ROM0:14FF E1 pop hl ROM0:1500 C1 pop bc ROM0:1501 F1 pop af ROM0:1502 C9 ret
Converts in decimal
Decimal conversion function
ROM0:1503 F5 push af ROM0:1504 D5 push de ROM0:1505 E5 push hl ROM0:1506 06 00 ld b,00 ROM0:1508 FA F6 C5 ld a,(C5F6) ROM0:150B E6 0F and a,0F ROM0:150D 4F ld c,a ROM0:150E CB 21 sla c ROM0:1510 21 5B 15 ld hl,155B ROM0:1513 09 add hl,bc ROM0:1514 2A ldi a,(hl) ROM0:1515 56 ld d,(hl) ROM0:1516 5F ld e,a ROM0:1517 FA F6 C5 ld a,(C5F6) ROM0:151A E6 F0 and a,F0 ROM0:151C 4F ld c,a ROM0:151D CB 31 swap c ROM0:151F CB 21 sla c ROM0:1521 21 7B 15 ld hl,157B ROM0:1524 09 add hl,bc ROM0:1525 2A ldi a,(hl) ROM0:1526 83 add e ROM0:1527 27 daa ROM0:1528 5F ld e,a ROM0:1529 7E ld a,(hl) ROM0:152A 8A adc d ROM0:152B 27 daa ROM0:152C 57 ld d,a ROM0:152D FA F7 C5 ld a,(C5F7) ROM0:1530 E6 0F and a,0F ROM0:1532 4F ld c,a ROM0:1533 CB 21 sla c ROM0:1535 21 9B 15 ld hl,159B ROM0:1538 09 add hl,bc ROM0:1539 2A ldi a,(hl) ROM0:153A 83 add e ROM0:153B 27 daa ROM0:153C 5F ld e,a ROM0:153D 7E ld a,(hl) ROM0:153E 8A adc d ROM0:153F 27 daa ROM0:1540 57 ld d,a ROM0:1541 FA F7 C5 ld a,(C5F7) ROM0:1544 E6 F0 and a,F0 ROM0:1546 4F ld c,a ROM0:1547 CB 31 swap c ROM0:1549 CB 21 sla c ROM0:154B 21 BB 15 ld hl,15BB ROM0:154E 09 add hl,bc ROM0:154F 2A ldi a,(hl) ROM0:1550 83 add e ROM0:1551 27 daa ROM0:1552 4F ld c,a ROM0:1553 7E ld a,(hl) ROM0:1554 8A adc d ROM0:1555 27 daa ROM0:1556 47 ld b,a ROM0:1557 E1 pop hl ROM0:1558 D1 pop de ROM0:1559 F1 pop af ROM0:155A C9 ret
4th nibble array
00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 10 00 11 00 12 00 13 00 14 00 15 00
3rd nibble array
00 00 16 00 32 00 48 00 64 00 80 00 96 00 12 01 28 01 44 01 60 01 76 01 92 01 08 02 24 02 40 02
2nd nibble array
00 00 56 02 12 05 68 07 24 10 80 12 36 15 92 17 48 20 04 23 60 25 16 28 72 30 28 33 84 35 40 38
1st nibble array
00 00 96 40 92 81
0:1673 bit array
0x1673
array of single bits
0:1673 01 02 04 08 10 20 40 80
0:167B
ROM0:167B C5 push bc ROM0:167C E5 push hl ROM0:167D 06 00 ld b,00 ROM0:167F 4F ld c,a ;bc = a ROM0:1680 21 73 16 ld hl,1673 ROM0:1683 09 add hl,bc ROM0:1684 4E ld c,(hl) ;c has a bit set, picked from array at 0:1673 ROM0:1685 E1 pop hl ROM0:1686 7E ld a,(hl) ROM0:1687 A1 and c ROM0:1688 28 02 jr z,168C ;compares the bit with the value at WRAM address that was passed as argument to this routine ROM0:168A 3E 01 ld a,01 ;if that's not equal: a = 1, else if that's equal: a = 0 ROM0:168C C1 pop bc ROM0:168D C9 ret
0:1798
ROM0:1798 F5 push af ROM0:1799 C5 push bc ROM0:179A E5 push hl ROM0:179B FA 00 40 ld a,(4000) ;ROM Bank ROM0:179E F5 push af ROM0:179F CD AA 17 call 17AA ;Display 2 ? ROM0:17A2 F1 pop af ROM0:17A3 CD 00 12 call 1200 ;ROM Bank switch ROM0:17A6 E1 pop hl ROM0:17A7 C1 pop bc ROM0:17A8 F1 pop af ROM0:17A9 C9 ret
Display 2
0x17AA-0x17ED
- Displays the card data and picture
ROM0:17AA F5 push af ROM0:17AB C5 push bc ROM0:17AC D5 push de ROM0:17AD E5 push hl ROM0:17AE CD 49 18 call 1849 ROM0:17B1 06 00 ld b,00 ROM0:17B3 FA B0 C6 ld a,(C6B0) ROM0:17B6 4F ld c,a ROM0:17B7 CB 21 sla c ROM0:17B9 21 EE 17 ld hl,17EE ROM0:17BC 09 add hl,bc ROM0:17BD 2A ldi a,(hl) ROM0:17BE 66 ld h,(hl) ROM0:17BF 6F ld l,a ROM0:17C0 2A ldi a,(hl) ROM0:17C1 CD 00 12 call 1200 ;ROM Bank switch ROM0:17C4 E5 push hl ROM0:17C5 FA AE C6 ld a,(C6AE) ROM0:17C8 4F ld c,a ROM0:17C9 FA AF C6 ld a,(C6AF) ROM0:17CC 47 ld b,a ROM0:17CD 2A ldi a,(hl) ROM0:17CE 66 ld h,(hl) ROM0:17CF 6F ld l,a ROM0:17D0 11 D5 17 ld de,17D5 ROM0:17D3 D5 push de ROM0:17D4 E9 jp hl ROM0:17D5 CD 6E 18 call 186E ;Set hFF80-hFF81 to bc ROM0:17D8 E1 pop hl ROM0:17D9 23 inc hl ROM0:17DA 23 inc hl ROM0:17DB 2A ldi a,(hl) ROM0:17DC 4F ld c,a ROM0:17DD 2A ldi a,(hl) ROM0:17DE 47 ld b,a ROM0:17DF CD 77 18 call 1877 ;Set hFF82-hFF83 to bc ROM0:17E2 7A ld a,d ROM0:17E3 CD 00 12 call 1200 ;ROM Bank switch ROM0:17E6 CD 80 18 call 1880 ROM0:17E9 E1 pop hl ROM0:17EA D1 pop de ROM0:17EB C1 pop bc ROM0:17EC F1 pop af ROM0:17ED C9 ret
Pointer array used by 0:17AA
ROM0:17EE 08 18 - 0D 18 - 12 18 - 17 18 - 1C 18 - 21 18 - 26 18 - 2B 18 - 30 18 - 35 18 - 3A 18 - 3F 18 - 44 18 -
0:1849 (0x20s w3:D000-w3:D3DD, and ?)
ROM0:1849 F5 push af ROM0:184A C5 push bc ROM0:184B D5 push de ROM0:184C E5 push hl ROM0:184D 21 00 D0 ld hl,D000 ROM0:1850 11 01 D0 ld de,D001 ROM0:1853 36 20 ld (hl),20 ;0x20s w3:D000-w3:D3DD ROM0:1855 01 DD 03 ld bc,03DD ROM0:1858 2A ldi a,(hl) ROM0:1859 12 ld (de),a ROM0:185A 13 inc de ROM0:185B 0D dec c ROM0:185C 20 FA jr nz,1858 ROM0:185E 0E 00 ld c,00 ROM0:1860 2A ldi a,(hl) ROM0:1861 12 ld (de),a ROM0:1862 13 inc de ROM0:1863 0D dec c ROM0:1864 20 FA jr nz,1860 ROM0:1866 05 dec b ROM0:1867 20 F5 jr nz,185E ROM0:1869 E1 pop hl ROM0:186A D1 pop de ROM0:186B C1 pop bc ROM0:186C F1 pop af ROM0:186D C9 ret
0:186E (hFF80-hFF81 = bc)
ROM0:186E F5 push af ROM0:186F 79 ld a,c ROM0:1870 E0 80 ld (ff00+80),a ROM0:1872 78 ld a,b ROM0:1873 E0 81 ld (ff00+81),a ROM0:1875 F1 pop af ROM0:1876 C9 ret
0:1877 (hFF82-hFF83 = bc)
ROM0:1877 F5 push af ROM0:1878 79 ld a,c ROM0:1879 E0 82 ld (ff00+82),a ROM0:187B 78 ld a,b ROM0:187C E0 83 ld (ff00+83),a ROM0:187E F1 pop af ROM0:187F C9 ret
0:1880
ROM0:1880 F5 push af ROM0:1881 C5 push bc ROM0:1882 D5 push de ROM0:1883 E5 push hl ROM0:1884 11 DE D3 ld de,D3DE ROM0:1887 0E 80 ld c,80 ROM0:1889 CD EF 18 call 18EF ROM0:188C 4F ld c,a ROM0:188D 06 08 ld b,08 ROM0:188F CB 19 rr c ROM0:1891 30 16 jr nc,18A9 ROM0:1893 CD EF 18 call 18EF ROM0:1896 CD 02 19 call 1902 ROM0:1899 38 4F jr c,18EA ROM0:189B 12 ld (de),a ROM0:189C 1C inc e ROM0:189D 20 08 jr nz,18A7 ROM0:189F 14 inc d ROM0:18A0 7A ld a,d ROM0:18A1 FE D4 cp a,D4 ROM0:18A3 20 02 jr nz,18A7 ROM0:18A5 16 D0 ld d,D0 ROM0:18A7 18 3C jr 18E5 ROM0:18A9 C5 push bc ROM0:18AA CD EF 18 call 18EF ROM0:18AD 6F ld l,a ROM0:18AE CD EF 18 call 18EF ROM0:18B1 67 ld h,a ROM0:18B2 E6 1F and a,1F ROM0:18B4 C6 03 add a,03 ROM0:18B6 4F ld c,a ROM0:18B7 7C ld a,h ROM0:18B8 CB 37 swap a ROM0:18BA 0F rrca ROM0:18BB E6 03 and a,03 ROM0:18BD C6 D0 add a,D0 ROM0:18BF 67 ld h,a ROM0:18C0 7E ld a,(hl) ROM0:18C1 CD 02 19 call 1902 ROM0:18C4 30 04 jr nc,18CA ROM0:18C6 E8 02 add sp,02 ROM0:18C8 18 20 jr 18EA ROM0:18CA 12 ld (de),a ROM0:18CB 2C inc l ROM0:18CC 20 08 jr nz,18D6 ROM0:18CE 24 inc h ROM0:18CF 7C ld a,h ROM0:18D0 FE D4 cp a,D4 ROM0:18D2 20 02 jr nz,18D6 ROM0:18D4 26 D0 ld h,D0 ROM0:18D6 1C inc e ROM0:18D7 20 08 jr nz,18E1 ROM0:18D9 14 inc d ROM0:18DA 7A ld a,d ROM0:18DB FE D4 cp a,D4 ROM0:18DD 20 02 jr nz,18E1 ROM0:18DF 16 D0 ld d,D0 ROM0:18E1 0D dec c ROM0:18E2 20 DC jr nz,18C0 ROM0:18E4 C1 pop bc ROM0:18E5 05 dec b ROM0:18E6 20 A7 jr nz,188F ROM0:18E8 18 9F jr 1889 ROM0:18EA E1 pop hl ROM0:18EB D1 pop de ROM0:18EC C1 pop bc ROM0:18ED F1 pop af ROM0:18EE C9 ret
0:18EF ((FF80)++)
ROM0:18EF E5 push hl ROM0:18F0 F0 80 ld a,(ff00+80) ROM0:18F2 C6 01 add a,01 ROM0:18F4 E0 80 ld (ff00+80),a ;(FF80)++ ROM0:18F6 6F ld l,a ROM0:18F7 F0 81 ld a,(ff00+81) ROM0:18F9 CE 00 adc a,00 ROM0:18FB E0 81 ld (ff00+81),a ROM0:18FD 67 ld h,a ROM0:18FE 2B dec hl ROM0:18FF 7E ld a,(hl) ROM0:1900 E1 pop hl ROM0:1901 C9 ret
0:1902 ((FF82)--)
ROM0:1902 D5 push de ROM0:1903 E5 push hl ROM0:1904 57 ld d,a ROM0:1905 CD 5B 02 call 025B ROM0:1908 F0 82 ld a,(ff00+82) ROM0:190A 6F ld l,a ROM0:190B F0 83 ld a,(ff00+83) ROM0:190D 67 ld h,a ROM0:190E 2B dec hl ROM0:190F 7D ld a,l ROM0:1910 E0 82 ld (ff00+82),a ;(FF82)-- ROM0:1912 7C ld a,h ROM0:1913 E0 83 ld (ff00+83),a ROM0:1915 7C ld a,h ROM0:1916 B5 or l ROM0:1917 20 01 jr nz,191A ROM0:1919 37 scf ROM0:191A 7A ld a,d ROM0:191B E1 pop hl ROM0:191C D1 pop de ROM0:191D C9 ret
0:191E
ROM0:191E F5 push af ROM0:191F 79 ld a,c ROM0:1920 EA C1 C6 ld (C6C1),a ROM0:1923 78 ld a,b ROM0:1924 EA C2 C6 ld (C6C2),a ROM0:1927 F1 pop af ROM0:1928 C9 ret
0:1929
ROM0:1929 F5 push af ROM0:192A C5 push bc ROM0:192B D5 push de ROM0:192C E5 push hl ROM0:192D 21 C3 C6 ld hl,C6C3 ROM0:1930 11 40 19 ld de,1940 ROM0:1933 0E 04 ld c,04 ROM0:1935 1A ld a,(de) ROM0:1936 22 ldi (hl),a ROM0:1937 13 inc de ROM0:1938 0D dec c ROM0:1939 20 FA jr nz,1935 ROM0:193B E1 pop hl ROM0:193C D1 pop de ROM0:193D C1 pop bc ROM0:193E F1 pop af ROM0:193F C9 ret
0:1940 (array)
ROM0:1940 30 38 00 00
0:1944
ROM0:1944 F5 push af ROM0:1945 3E B0 ld a,B0 ROM0:1947 EA C4 C6 ld (C6C4),a ROM0:194A F1 pop af ROM0:194B C9 ret
0:194C
ROM0:194C F5 push af ROM0:194D 78 ld a,b ROM0:194E EA C6 C6 ld (C6C6),a ROM0:1951 79 ld a,c ROM0:1952 EA C5 C6 ld (C6C5),a ROM0:1955 F1 pop af ROM0:1956 C9 ret
0:1957
ROM0:1957 F5 push af ROM0:1958 78 ld a,b ROM0:1959 EA C4 C6 ld (C6C4),a ROM0:195C 79 ld a,c ROM0:195D EA C3 C6 ld (C6C3),a ROM0:1960 F1 pop af ROM0:1961 C9 ret
0:1962
ROM0:1962 EA C7 C6 ld (C6C7),a ROM0:1965 C9 ret
0:1966
ROM0:1966 F5 push af ROM0:1967 E5 push hl ROM0:1968 06 00 ld b,00 ROM0:196A FA C3 C6 ld a,(C6C3) ROM0:196D D6 10 sub a,10 ROM0:196F 4F ld c,a ROM0:1970 CB 21 sla c ROM0:1972 CB 10 rl b ROM0:1974 CB 21 sla c ROM0:1976 CB 10 rl b ROM0:1978 FA C4 C6 ld a,(C6C4) ROM0:197B D6 08 sub a,08 ROM0:197D CB 3F srl a ROM0:197F CB 3F srl a ROM0:1981 CB 3F srl a ROM0:1983 81 add c ROM0:1984 4F ld c,a ROM0:1985 21 00 98 ld hl,9800 ;pointer to VRAM ROM0:1988 09 add hl,bc ROM0:1989 44 ld b,h ROM0:198A 4D ld c,l ROM0:198B E1 pop hl ROM0:198C F1 pop af ROM0:198D C9 ret
0:198E
ROM0:198E F5 push af ROM0:198F D5 push de ROM0:1990 E5 push hl ROM0:1991 06 08 ld b,08 ROM0:1993 FA C7 C6 ld a,(C6C7) ROM0:1996 4F ld c,a ROM0:1997 FE 80 cp a,80 ROM0:1999 30 01 jr nc,199C ROM0:199B 04 inc b ROM0:199C 1E 04 ld e,04 ROM0:199E CB 21 sla c ROM0:19A0 CB 10 rl b ROM0:19A2 1D dec e ROM0:19A3 20 F9 jr nz,199E ROM0:19A5 E1 pop hl ROM0:19A6 D1 pop de ROM0:19A7 F1 pop af ROM0:19A8 C9 ret
Battle Process 1
Blanks CPU's hand
0x19A9-0x19CF
- Blanks all data in0xC759-0xC768
(CPU's hand + card statuses) and0xC7A1-0xC7A2
(Field Column and Row)
ROM0:19A9 F5 push af ROM0:19AA C5 push bc ROM0:19AB E5 push hl ROM0:19AC 3E 00 ld a,00 ROM0:19AE EA A1 C7 ld (C7A1),a ROM0:19B1 3E 00 ld a,00 ROM0:19B3 EA A2 C7 ld (C7A2),a ROM0:19B6 21 59 C7 ld hl,C759 ROM0:19B9 06 04 ld b,04 ROM0:19BB 0E 06 ld c,06 ROM0:19BD 3E 00 ld a,00 ROM0:19BF 22 ldi (hl),a ROM0:19C0 3E 00 ld a,00 ROM0:19C2 22 ldi (hl),a ROM0:19C3 3E 10 ld a,10 ROM0:19C5 22 ldi (hl),a ROM0:19C6 0D dec c ROM0:19C7 20 F4 jr nz,19BD ROM0:19C9 05 dec b ROM0:19CA 20 EF jr nz,19BB ROM0:19CC E1 pop hl ROM0:19CD C1 pop bc ROM0:19CE F1 pop af ROM0:19CF C9 ret
Updates field Column and Row
0x19D0-0x19DA
- Updates field Column and Row
ROM0:19D0 F5 push af ROM0:19D1 78 ld a,b ROM0:19D2 EA A1 C7 ld (C7A1),a ;Field Column ROM0:19D5 79 ld a,c ROM0:19D6 EA A2 C7 ld (C7A2),a ;Field Row ROM0:19D9 F1 pop af ROM0:19DA C9 ret
Retrieves field Column and Row
0x19DB-0x19E5
- Stores field Column and Row in register bc
ROM0:19DB F5 push af ROM0:19DC FA A1 C7 ld a,(C7A1) ;Field Column ROM0:19DF 47 ld b,a ROM0:19E0 FA A2 C7 ld a,(C7A2) ;Field Row ROM0:19E3 4F ld c,a ROM0:19E4 F1 pop af ROM0:19E5 C9 ret
Remove card from selected card zone on the field
0x19E6-0x19FA
- Remove card from selected card zone on the field
ROM0:19E6 F5 push af ROM0:19E7 C5 push bc ROM0:19E8 E5 push hl ROM0:19E9 CD 36 1A call 1A36 ;Returns card zone RAM address of the selected column and row in register bc ROM0:19EC 60 ld h,b ROM0:19ED 69 ld l,c ROM0:19EE 3E 00 ld a,00 ROM0:19F0 22 ldi (hl),a ;00s card ID in the selected card zone ROM0:19F1 3E 00 ld a,00 ROM0:19F3 22 ldi (hl),a ROM0:19F4 3E 10 ld a,10 ;Sets card Level to 0 in the selected card zone ROM0:19F6 22 ldi (hl),a ROM0:19F7 E1 pop hl ROM0:19F8 C1 pop bc ROM0:19F9 F1 pop af ROM0:19FA C9 ret
Updates selected card ID and status
0x19FB-0x1A12
- Updates card ID + card status from (C7A3) to the selected card zone
ROM0:19FB F5 push af ROM0:19FC C5 push bc ROM0:19FD E5 push hl ROM0:19FE CD 36 1A call 1A36 ;Returns card zone RAM address of the selected column and row in register bc ROM0:1A01 60 ld h,b ROM0:1A02 69 ld l,c ROM0:1A03 FA A3 C7 ld a,(C7A3) ROM0:1A06 22 ldi (hl),a ;Updates card ID ROM0:1A07 FA A4 C7 ld a,(C7A4) ROM0:1A0A 22 ldi (hl),a ROM0:1A0B FA A5 C7 ld a,(C7A5) ROM0:1A0E 22 ldi (hl),a ;Updates card status ROM0:1A0F E1 pop hl ROM0:1A10 C1 pop bc ROM0:1A11 F1 pop af ROM0:1A12 C9 ret
Stores selected card ID and status
0x1A13-0x1A2A
- Stores card ID from the selected card zone + card status in (C7A3)
ROM0:1A13 F5 push af ROM0:1A14 C5 push bc ROM0:1A15 E5 push hl ROM0:1A16 CD 36 1A call 1A36 ;Returns card zone RAM address of the selected column and row in register bc ROM0:1A19 60 ld h,b ROM0:1A1A 69 ld l,c ROM0:1A1B 2A ldi a,(hl) ROM0:1A1C EA A3 C7 ld (C7A3),a ROM0:1A1F 2A ldi a,(hl) ROM0:1A20 EA A4 C7 ld (C7A4),a ROM0:1A23 2A ldi a,(hl) ROM0:1A24 EA A5 C7 ld (C7A5),a ROM0:1A27 E1 pop hl ROM0:1A28 C1 pop bc ROM0:1A29 F1 pop af ROM0:1A2A C9 ret
Card update subroutine
ROM0:1A2B F5 push af ROM0:1A2C C5 push bc ROM0:1A2D CF rst 08 ... ROM0:1A30 CD FB 19 call 19FB ;Updates selected card ID and status ROM0:1A33 C1 pop bc ROM0:1A34 F1 pop af ROM0:1A35 C9 ret
Retrieve selected card zone pointer
0x1A36-0x1A5D
- Returns card zone RAM address of the selected column and row in register bc
ROM0:1A36 F5 push af ROM0:1A37 E5 push hl ROM0:1A38 06 00 ld b,00 ROM0:1A3A FA A2 C7 ld a,(C7A2) ROM0:1A3D 4F ld c,a ROM0:1A3E CB 21 sla c ROM0:1A40 21 5E 1A ld hl,1A5E ROM0:1A43 09 add hl,bc ROM0:1A44 2A ldi a,(hl) ROM0:1A45 66 ld h,(hl) ROM0:1A46 6F ld l,a ROM0:1A47 E5 push hl ROM0:1A48 06 00 ld b,00 ROM0:1A4A FA A1 C7 ld a,(C7A1) ROM0:1A4D 4F ld c,a ROM0:1A4E CB 21 sla c ROM0:1A50 21 66 1A ld hl,1A66 ROM0:1A53 09 add hl,bc ROM0:1A54 2A ldi a,(hl) ROM0:1A55 46 ld b,(hl) ROM0:1A56 4F ld c,a ROM0:1A57 E1 pop hl ROM0:1A58 09 add hl,bc ROM0:1A59 44 ld b,h ROM0:1A5A 4D ld c,l ROM0:1A5B E1 pop hl ROM0:1A5C F1 pop af ROM0:1A5D C9 ret
0x1A5E-0x1A65
- Pointers used during Attack Phase by function at0x1A36-0x1A5D
0x1A66-0x1A71
- Values to be added to pointer in register hl by function at0x1A36-0x1A5D
Checks if a card is being processed
0x1A72-0x1A83
- Sets accumulator to 1 if there is no card being currently processed, 0 otherwise
ROM0:1A72 D5 push de ROM0:1A73 1E 00 ld e,00 ROM0:1A75 78 ld a,b ROM0:1A76 FE 00 cp a,00 ROM0:1A78 20 07 jr nz,1A81 ROM0:1A7A 79 ld a,c ROM0:1A7B FE 00 cp a,00 ROM0:1A7D 20 02 jr nz,1A81 ROM0:1A7F 1E 01 ld e,01 ROM0:1A81 7B ld a,e ROM0:1A82 D1 pop de ROM0:1A83 C9 ret
Checks Card ID validity
0x1A84-0x1AB7
- Checks Card ID validity, returns error code in accumulator
ROM0:1A84 C5 push bc ROM0:1A85 D5 push de ROM0:1A86 E5 push hl ROM0:1A87 11 00 00 ld de,0000 ROM0:1A8A CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1A8D FE 01 cp a,01 ROM0:1A8F 20 04 jr nz,1A95 ;If(Card ID ≠ 0), jump to 0:1A95 ROM0:1A91 0E 04 ld c,04 ROM0:1A93 18 1E jr 1AB3 ;Else get out of this function (No card) ROM0:1A95 11 20 03 ld de,0320 ROM0:1A98 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1A9B FE 00 cp a,00 ROM0:1A9D 28 04 jr z,1AA3 ;If(Card ID > 800), jump to 0:1AA3 ROM0:1A9F 0E 01 ld c,01 ROM0:1AA1 18 10 jr 1AB3 ;Else get out of this function (Normal card) ROM0:1AA3 11 44 16 ld de,1644 ROM0:1AA6 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1AA9 FE 00 cp a,00 ROM0:1AAB 28 04 jr z,1AB1 ;If(Card ID > 5700), jump to 0:1AB1 ROM0:1AAD 0E 02 ld c,02 ROM0:1AAF 18 02 jr 1AB3 ;Else get out of this function (Construction card) ROM0:1AB1 0E 03 ld c,03 ;Invalid card ID ROM0:1AB3 79 ld a,c ROM0:1AB4 E1 pop hl ROM0:1AB5 D1 pop de ROM0:1AB6 C1 pop bc ROM0:1AB7 C9 ret
Checks position in Card Trunk
0x1AB8-0x1AE9
-
ROM0:1AB8 C5 push bc ROM0:1AB9 D5 push de ROM0:1ABA E5 push hl ROM0:1ABB 11 00 00 ld de,0000 ROM0:1ABE CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1AC1 FE 01 cp a,01 ROM0:1AC3 20 04 jr nz,1AC9 ;If(Position in Card Trunk ≠ 0), jump to 0:1AC9 ROM0:1AC5 0E 00 ld c,00 ROM0:1AC7 18 1C jr 1AE5 ROM0:1AC9 11 E9 03 ld de,03E9 ROM0:1ACC CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1ACF FE 01 cp a,01 ROM0:1AD1 20 04 jr nz,1AD7 ;If(Position in Card Trunk ≠ 1001), jump to 0:1AC9 ROM0:1AD3 0E 03 ld c,03 ROM0:1AD5 18 0E jr 1AE5 ROM0:1AD7 11 21 03 ld de,0321 ;de = 801 ROM0:1ADA CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1ADD 16 00 ld d,00 ROM0:1ADF 5F ld e,a ROM0:1AE0 21 EA 1A ld hl,1AEA ROM0:1AE3 19 add hl,de ROM0:1AE4 4E ld c,(hl) ROM0:1AE5 79 ld a,c ROM0:1AE6 E1 pop hl ROM0:1AE7 D1 pop de ROM0:1AE8 C1 pop bc ROM0:1AE9 C9 ret
0x1AEA-0x1AEC
- Array ?
ROM0:1AEA 02 02 01
0:1AED (checks card validity in Trunk ?)
0x1AED-0x1B10
-
ROM0:1AED C5 push bc ROM0:1AEE D5 push de ROM0:1AEF E5 push hl ROM0:1AF0 11 38 04 ld de,0438 ;1080, theoretical max number of different cards in Card Trunk ROM0:1AF3 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1AF6 FE 01 cp a,01 ROM0:1AF8 20 04 jr nz,1AFE ;If bc ≠ 1080, jump to 0:1AFE ROM0:1AFA 0E 03 ld c,03 ROM0:1AFC 18 0E jr 1B0C ROM0:1AFE 11 20 03 ld de,0320 ;800, number of non-construction cards ROM0:1B01 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:1B04 16 00 ld d,00 ROM0:1B06 5F ld e,a ROM0:1B07 21 11 1B ld hl,1B11 ROM0:1B0A 19 add hl,de ROM0:1B0B 4E ld c,(hl) ROM0:1B0C 79 ld a,c ROM0:1B0D E1 pop hl ROM0:1B0E D1 pop de ROM0:1B0F C1 pop bc ROM0:1B10 C9 ret
0:1B11 (array)
ROM0:1B11 02 - Invalid card 02 - Invalid card 01 - Valid card
Check if is equal
0x1B14-0x1B22
- Returns 0 ifbc
==de
, 1 otherwise
ROM0:1B14 E5 push hl ROM0:1B15 2E 01 ld l,01 ROM0:1B17 78 ld b,a ROM0:1B18 BA cp d ROM0:1B19 20 05 jr nz,1B20 ROM0:1B1B 79 ld a,c ROM0:1B1C BB cp e ROM0:1B1D 20 01 jr nz,1B20 ROM0:1B1F 2D dec l ROM0:1B20 7D ld a,l ROM0:1B21 E1 pop hl ROM0:1B22 C9 ret
Checks if less than, equal to, or greater than
0x1B23-0x1B3D
- Returns 2 if bc < de, 1 if bc == de, 0 if bc > de
ROM0:1B23 C5 push bc ROM0:1B24 D5 push de ROM0:1B25 E5 push hl ROM0:1B26 2E 02 ld l,02 ROM0:1B28 CD 92 14 call 1492 ;daa subtraction, de - bc ROM0:1B2B 7B ld a,e ROM0:1B2C FE 01 cp a,01 ROM0:1B2E 20 02 jr nz,1B32 ;If(bc ≠ de), jump to 0:1B32 ROM0:1B30 2E 01 ld l,01 ROM0:1B32 7B ld a,e ROM0:1B33 FE 00 cp a,00 ROM0:1B35 20 02 jr nz,1B39 ;If(bc < de), jump to 0:1B39 ROM0:1B37 2E 00 ld l,00 ROM0:1B39 7D ld a,l ROM0:1B3A E1 pop hl ROM0:1B3B D1 pop de ROM0:1B3C C1 pop bc ROM0:1B3D C9 ret
Copy Life Points, (C7A8) and (C7AB) to (C5F6)-(C5FB)
ROM0:1B3E D5 push de ROM0:1B3F E5 push hl ROM0:1B40 2E 02 ld l,02 ROM0:1B42 FA A6 C7 ld a,(C7A6) ROM0:1B45 EA F6 C5 ld (C5F6),a ROM0:1B48 FA A7 C7 ld a,(C7A7) ROM0:1B4B EA F7 C5 ld (C5F7),a ROM0:1B4E FA A8 C7 ld a,(C7A8) ROM0:1B51 EA F8 C5 ld (C5F8),a ROM0:1B54 FA A9 C7 ld a,(C7A9) ROM0:1B57 EA F9 C5 ld (C5F9),a ROM0:1B5A FA AA C7 ld a,(C7AA) ROM0:1B5D EA FA C5 ld (C5FA),a ROM0:1B60 FA AB C7 ld a,(C7AB) ROM0:1B63 EA FB C5 ld (C5FB),a ROM0:1B66 CD B2 14 call 14B2 ROM0:1B69 7B ld a,e ROM0:1B6A FE 01 cp a,01 ROM0:1B6C 20 02 jr nz,1B70 ROM0:1B6E 2E 01 ld l,01 ROM0:1B70 7B ld a,e ROM0:1B71 FE 00 cp a,00 ROM0:1B73 20 02 jr nz,1B77 ROM0:1B75 2E 00 ld l,00 ROM0:1B77 7D ld a,l ROM0:1B78 E1 pop hl ROM0:1B79 D1 pop de ROM0:1B7A C9 ret
0:1B7B
ROM0:1B7B F5 push af ROM0:1B7C C5 push bc ROM0:1B7D D5 push de ROM0:1B7E E5 push hl ROM0:1B7F 3E 00 ld a,00 ROM0:1B81 EA A4 C5 ld (C5A4),a ROM0:1B84 3E 00 ld a,00 ROM0:1B86 EA AC C7 ld (C7AC),a ROM0:1B89 CD FF 1D call 1DFF ROM0:1B8C 11 FE FE ld de,FEFE ROM0:1B8F FA A6 C5 ld a,(C5A6) ROM0:1B92 FE 10 cp a,10 ROM0:1B94 20 1D jr nz,1BB3 ROM0:1B96 3E 30 ld a,30 ROM0:1B98 CD 61 04 call 0461 ROM0:1B9B CD 4B 11 call 114B ROM0:1B9E FA A4 C5 ld a,(C5A4) ROM0:1BA1 E6 F0 and a,F0 ROM0:1BA3 FE 40 cp a,40 ROM0:1BA5 20 0A jr nz,1BB1 ROM0:1BA7 CD D9 1B call 1BD9 ROM0:1BAA 3E 01 ld a,01 ROM0:1BAC EA AC C7 ld (C7AC),a ROM0:1BAF 18 23 jr 1BD4 ROM0:1BB1 18 0F jr 1BC2 ROM0:1BB3 3E 40 ld a,40 ROM0:1BB5 CD 89 04 call 0489 ROM0:1BB8 3E 01 ld a,01 ROM0:1BBA EA AC C7 ld (C7AC),a ROM0:1BBD CD 65 11 call 1165 ROM0:1BC0 18 12 jr 1BD4 ROM0:1BC2 1D dec e ROM0:1BC3 20 0D jr nz,1BD2 ROM0:1BC5 15 dec d ROM0:1BC6 7A ld a,d ROM0:1BC7 FE FF cp a,FF ROM0:1BC9 20 07 jr nz,1BD2 ROM0:1BCB 3E 02 ld a,02 ROM0:1BCD EA AC C7 ld (C7AC),a ROM0:1BD0 18 02 jr 1BD4 ROM0:1BD2 18 BB jr 1B8F ROM0:1BD4 E1 pop hl ROM0:1BD5 D1 pop de ROM0:1BD6 C1 pop bc ROM0:1BD7 F1 pop af ROM0:1BD8 C9 ret
0:1BD9
ROM0:1BD9 F5 push af ROM0:1BDA C5 push bc ROM0:1BDB 0E 03 ld c,03 ROM0:1BDD CD 4B 11 call 114B ROM0:1BE0 0D dec c ROM0:1BE1 20 FA jr nz,1BDD ROM0:1BE3 C1 pop bc ROM0:1BE4 F1 pop af ROM0:1BE5 C9 ret
0:1BE6 (00s (C5B5) to (C5B7) and (C7AD))
ROM0:1BE6 F5 push af ROM0:1BE7 AF xor a ROM0:1BE8 EA B5 C5 ld (C5B5),a ROM0:1BEB EA B6 C5 ld (C5B6),a ROM0:1BEE EA B7 C5 ld (C5B7),a ROM0:1BF1 EA AD C7 ld (C7AD),a ROM0:1BF4 F1 pop af ROM0:1BF5 C9 ret
0:1BF6 ((C7AD) | 2)
ROM0:1BF6 F5 push af ROM0:1BF7 FA AD C7 ld a,(C7AD) ROM0:1BFA F6 02 or a,02 ROM0:1BFC EA AD C7 ld (C7AD),a ROM0:1BFF F1 pop af ROM0:1C00 C9 ret
Menu ID handling
0x1D3F-0x1D46
- Initializes Menu ID to 0
ROM0:1D3F F5 push af ROM0:1D40 3E 00 ld a,00 ROM0:1D42 EA B1 C7 ld (C7B1),a ROM0:1D45 F1 pop af ROM0:1D46 C9 ret
0x1D47-0x1D4A
- Changes Menu ID to the value in accumulator
ROM0:1D47 EA B1 C7 ld (C7B1),a ROM0:1D4A C9 ret
Enable Serial Interrupt
ROM0:1D4B E5 push hl ROM0:1D4C F3 di ROM0:1D4D 21 0F FF ld hl,FF0F ;Serial Interrupt Flag = 0 ROM0:1D50 CB 9E res 3,(hl) ROM0:1D52 21 FF FF ld hl,FFFF ROM0:1D55 CB DE set 3,(hl) ;Serial Interrupt Enabled ROM0:1D57 FB ei ROM0:1D58 E1 pop hl ROM0:1D59 C9 ret
Disable Serial Interrupt
ROM0:1D5A E5 push hl ROM0:1D5B F3 di ROM0:1D5C 21 0F FF ld hl,FF0F ROM0:1D5F CB 9E res 3,(hl) ;Serial Interrupt Flag = 0 ROM0:1D61 21 FF FF ld hl,FFFF ROM0:1D64 CB 9E res 3,(hl) ;Serial Interrupt Disabled ROM0:1D66 FB ei ROM0:1D67 E1 pop hl ROM0:1D68 C9 ret
Initializes Game Link data to 0x80, 00s wC84A-wC84B
ROM0:1D69 F5 push af ROM0:1D6A C5 push bc ROM0:1D6B E5 push hl ROM0:1D6C 21 CA C7 ld hl,C7CA ROM0:1D6F 3E 80 ld a,80 ROM0:1D71 0E 80 ld c,80 ROM0:1D73 22 ldi (hl),a ROM0:1D74 0D dec c ROM0:1D75 20 FC jr nz,1D73 ROM0:1D77 AF xor a ROM0:1D78 EA 4A C8 ld (C84A),a ROM0:1D7B EA 4B C8 ld (C84B),a ROM0:1D7E E1 pop hl ROM0:1D7F C1 pop bc ROM0:1D80 F1 pop af ROM0:1D81 C9 ret
0:1D82
ROM0:1D82 F5 push af ROM0:1D83 E6 0F and a,0F ROM0:1D85 47 ld b,a ROM0:1D86 CB 30 swap b ROM0:1D88 79 ld a,c ROM0:1D89 E6 0F and a,0F ROM0:1D8B B0 or b ROM0:1D8C CD A8 1D call 1DA8 ROM0:1D8F F1 pop af ROM0:1D90 C9 ret
0:1D91 - Send Game Link data
ROM0:1D91 F5 push af ROM0:1D92 C5 push bc ROM0:1D93 4F ld c,a ROM0:1D94 CB 37 swap a ROM0:1D96 E6 0F and a,0F ROM0:1D98 F6 80 or a,80 ROM0:1D9A CD A8 1D call 1DA8 ROM0:1D9D 79 ld a,c ROM0:1D9E E6 0F and a,0F ROM0:1DA0 F6 80 or a,80 ROM0:1DA2 CD A8 1D call 1DA8 ROM0:1DA5 C1 pop bc ROM0:1DA6 F1 pop af ROM0:1DA7 C9 ret
0:1DA8
ROM0:1DA8 C5 push bc ROM0:1DA9 E5 push hl ROM0:1DAA F5 push af ROM0:1DAB 3E 00 ld a,00 ROM0:1DAD 47 ld b,a ROM0:1DAE FA 4B C8 ld a,(C84B) ROM0:1DB1 4F ld c,a ROM0:1DB2 3C inc a ROM0:1DB3 FE 80 cp a,80 ROM0:1DB5 20 01 jr nz,1DB8 ROM0:1DB7 AF xor a ROM0:1DB8 EA 4B C8 ld (C84B),a ROM0:1DBB 21 CA C7 ld hl,C7CA ROM0:1DBE 09 add hl,bc ROM0:1DBF F1 pop af ROM0:1DC0 77 ld (hl),a ROM0:1DC1 E1 pop hl ROM0:1DC2 C1 pop bc ROM0:1DC3 C9 ret
0:1DC4
ROM0:1DC4 F5 push af ROM0:1DC5 CD E5 1D call 1DE5 ROM0:1DC8 47 ld b,a ROM0:1DC9 E6 0F and a,0F ROM0:1DCB 4F ld c,a ROM0:1DCC 78 ld a,b ROM0:1DCD E6 0F and a,0F ROM0:1DCF 47 ld b,a ROM0:1DD0 CB 30 swap b ROM0:1DD2 F1 pop af ROM0:1DD3 C9 ret
0:1DD4 - Receive Game Link data
ROM0:1DD4 C5 push bc ROM0:1DD5 CD E5 1D call 1DE5 ROM0:1DD8 E6 0F and a,0F ROM0:1DDA 4F ld c,a ROM0:1DDB CB 31 swap c ROM0:1DDD CD E5 1D call 1DE5 ROM0:1DE0 E6 0F and a,0F ROM0:1DE2 B1 or c ROM0:1DE3 C1 pop bc ROM0:1DE4 C9 ret
0:1DE5
ROM0:1DE5 C5 push bc ROM0:1DE6 E5 push hl ROM0:1DE7 3E 00 ld a,00 ROM0:1DE9 47 ld b,a ROM0:1DEA FA 4A C8 ld a,(C84A) ROM0:1DED 4F ld c,a ROM0:1DEE 3C inc a ROM0:1DEF FE 80 cp a,80 ROM0:1DF1 20 01 jr nz,1DF4 ROM0:1DF3 AF xor a ROM0:1DF4 EA 4A C8 ld (C84A),a ROM0:1DF7 21 CA C7 ld hl,C7CA ROM0:1DFA 09 add hl,bc ROM0:1DFB 7E ld a,(hl) ROM0:1DFC E1 pop hl ROM0:1DFD C1 pop bc ROM0:1DFE C9 ret ROM0:1DFF F5 push af ROM0:1E00 AF xor a ROM0:1E01 EA 4A C8 ld (C84A),a ROM0:1E04 EA 4B C8 ld (C84B),a ROM0:1E07 F1 pop af ROM0:1E08 C9 ret
Pseudo-Random Numbers
Initial Seed (new game, after name entry)
0x1E09-0x1E4E
: Initial seed (final result is always 0x0F07031F)
ROM0:1E09 F5 push af ROM0:1E0A C5 push bc ROM0:1E0B D5 push de ROM0:1E0C E5 push hl ROM0:1E0D 21 FF FF ld hl,FFFF ROM0:1E10 CB 96 res 2,(hl) ROM0:1E12 21 07 FF ld hl,FF07 ROM0:1E15 CB 96 res 2,(hl) ROM0:1E17 3E 01 ld a,01 ROM0:1E19 E0 06 ld (ff00+06),a ROM0:1E1B E0 05 ld (ff00+05),a ROM0:1E1D CB D6 set 2,(hl) ROM0:1E1F 06 00 ld b,00 ROM0:1E21 21 55 C8 ld hl,C855 ;initial seed is stored in w0:C855 to w0:C858 ROM0:1E24 0E 04 ld c,04 ROM0:1E26 F0 05 ld a,(ff00+05) ROM0:1E28 22 ldi (hl),a ROM0:1E29 FE 00 cp a,00 ROM0:1E2B 28 01 jr z,1E2E ROM0:1E2D 04 inc b ROM0:1E2E 0D dec c ROM0:1E2F 20 F5 jr nz,1E26 ROM0:1E31 78 ld a,b ROM0:1E32 FE 00 cp a,00 ROM0:1E34 20 05 jr nz,1E3B ROM0:1E36 3E 01 ld a,01 ROM0:1E38 EA 55 C8 ld (C855),a ;store 01 in w0:C855 ROM0:1E3B CD 7F 1E call 1E7F ;Updates Pseudo-Random Numbers ROM0:1E3E CD 7F 1E call 1E7F ;Updates Pseudo-Random Numbers ROM0:1E41 CD 7F 1E call 1E7F ;Updates Pseudo-Random Numbers ROM0:1E44 CD 7F 1E call 1E7F ;Updates Pseudo-Random Numbers ROM0:1E47 CD 7F 1E call 1E7F ;Updates Pseudo-Random Numbers ROM0:1E4A E1 pop hl ROM0:1E4B D1 pop de ROM0:1E4C C1 pop bc ROM0:1E4D F1 pop af ROM0:1E4E C9 ret
PRNG
0x1E4F-0x1E7E
- Main PRNG. Generates a 1-byte Pseudo-Random Number, and stores it in (C84D) and (C85B)
ROM0:1E4F F5 push af ROM0:1E50 C5 push bc ROM0:1E51 D5 push de ROM0:1E52 FA 50 C8 ld a,(C850) ROM0:1E55 47 ld b,a ROM0:1E56 4F ld c,a ROM0:1E57 FA 4F C8 ld a,(C84F) ROM0:1E5A CB 19 rr c ROM0:1E5C 1F rra ROM0:1E5D CB 1A rr d ROM0:1E5F A8 xor b ROM0:1E60 CB 12 rl d ROM0:1E62 17 rla ROM0:1E63 CB 11 rl c ROM0:1E65 EA 50 C8 ld (C850),a ROM0:1E68 FA 4E C8 ld a,(C84E) ROM0:1E6B EA 4F C8 ld (C84F),a ROM0:1E6E FA 4D C8 ld a,(C84D) ROM0:1E71 EA 4E C8 ld (C84E),a ROM0:1E74 79 ld a,c ROM0:1E75 EA 4D C8 ld (C84D),a ROM0:1E78 EA 5B C8 ld (C85B),a ROM0:1E7B D1 pop de ROM0:1E7C C1 pop bc ROM0:1E7D F1 pop af ROM0:1E7E C9 ret
Updates Pseudo-Random Numbers
0x1E7F-0x1EB4
- Updates Pseudo-Random Numbers in (C84D) and (C855)
ROM0:1E7F F5 push af ROM0:1E80 FA 55 C8 ld a,(C855) ROM0:1E83 EA 4D C8 ld (C84D),a ROM0:1E86 FA 56 C8 ld a,(C856) ROM0:1E89 EA 4E C8 ld (C84E),a ROM0:1E8C FA 57 C8 ld a,(C857) ROM0:1E8F EA 4F C8 ld (C84F),a ROM0:1E92 FA 58 C8 ld a,(C858) ROM0:1E95 EA 50 C8 ld (C850),a ROM0:1E98 CD 4F 1E call 1E4F ;Generates a 1-byte Pseudo-Random Number ROM0:1E9B FA 4D C8 ld a,(C84D) ROM0:1E9E EA 55 C8 ld (C855),a ROM0:1EA1 FA 4E C8 ld a,(C84E) ROM0:1EA4 EA 56 C8 ld (C856),a ROM0:1EA7 FA 4F C8 ld a,(C84F) ROM0:1EAA EA 57 C8 ld (C857),a ROM0:1EAD FA 50 C8 ld a,(C850) ROM0:1EB0 EA 58 C8 ld (C858),a ROM0:1EB3 F1 pop af ROM0:1EB4 C9 ret
Fixed PRNG - Card ID seed
0x1EB5-0x1EE9
- Calls the PRNG, with the current card ID as a seed.
Called by the Construction card generation routine with the Construction card id as a parameter.
ROM0:1EB5 F5 push af ROM0:1EB6 FA B3 C6 ld a,(C6B3) ROM0:1EB9 EA 4D C8 ld (C84D),a ROM0:1EBC FA B4 C6 ld a,(C6B4) ROM0:1EBF EA 4E C8 ld (C84E),a ;seed = card_id ROM0:1EC2 FA B3 C6 ld a,(C6B3) ROM0:1EC5 EA 4F C8 ld (C84F),a ROM0:1EC8 3E 04 ld a,04 ROM0:1ECA EA 50 C8 ld (C850),a ROM0:1ECD CD 4F 1E call 1E7F ;PRNG ROM0:1ED0 FA 4D C8 ld a,(C84D) ROM0:1ED3 EA 51 C8 ld (C851),a ROM0:1ED6 FA 4E C8 ld a,(C84E) ROM0:1ED9 EA 52 C8 ld (C852),a ROM0:1EDC FA 4F C8 ld a,(C84F) ROM0:1EDF EA 53 C8 ld (C853),a ROM0:1EE2 FA 50 C8 ld a,(C850) ROM0:1EE5 EA 54 C8 ld (C854),a ROM0:1EE8 F1 pop af ROM0:1EE9 C9 ret
0:1EEA
ROM0:1EEA F5 push af ROM0:1EEB FA 51 C8 ld a,(C851) ROM0:1EEE EA 4D C8 ld (C84D),a ROM0:1EF1 FA 52 C8 ld a,(C852) ROM0:1EF4 EA 4E C8 ld (C84E),a ROM0:1EF7 FA 53 C8 ld a,(C853) ROM0:1EFA EA 4F C8 ld (C84F),a ROM0:1EFD FA 54 C8 ld a,(C854) ROM0:1F00 EA 50 C8 ld (C850),a ROM0:1F03 CD 4F 1E call 1E4F ROM0:1F06 FA 4D C8 ld a,(C84D) ROM0:1F09 EA 51 C8 ld (C851),a ROM0:1F0C FA 4E C8 ld a,(C84E) ROM0:1F0F EA 52 C8 ld (C852),a ROM0:1F12 FA 4F C8 ld a,(C84F) ROM0:1F15 EA 53 C8 ld (C853),a ROM0:1F18 FA 50 C8 ld a,(C850) ROM0:1F1B EA 54 C8 ld (C854),a ROM0:1F1E F1 pop af ROM0:1F1F C9 ret
Pseudo-Random Number between x and y
0x1F1F-0x1F47
- Generates a Pseudo-Random Number between (C859) and (C85A), then stores it in (C85B)
ROM0:1F20 F5 push af ROM0:1F21 C5 push bc ROM0:1F22 D5 push de ROM0:1F23 FA 59 C8 ld a,(C859) ROM0:1F26 4F ld c,a ROM0:1F27 FA 5A C8 ld a,(C85A) ROM0:1F2A B9 cp c ROM0:1F2B 20 05 jr nz,1F32 ;If((C859) < (C85A)), jump to 0:1F32 ROM0:1F2D EA 5B C8 ld (C85B),a ;Else, (C85B) = (C85A), and get out of this function ROM0:1F30 18 12 jr 1F44 ROM0:1F32 91 sub c ROM0:1F33 47 ld b,a ROM0:1F34 04 inc b ROM0:1F35 CD 7F 1E call 1E7F ;PRNG ROM0:1F38 FA 5B C8 ld a,(C85B) ROM0:1F3B 57 ld d,a ROM0:1F3C CD DA 13 call 13DA ;Alternate PRNG ROM0:1F3F 7B ld a,e ROM0:1F40 81 add c ROM0:1F41 EA 5B C8 ld (C85B),a ROM0:1F44 D1 pop de ROM0:1F45 C1 pop bc ROM0:1F46 F1 pop af ROM0:1F47 C9 ret
Generates Construction Cards data
0x1F48-0x1F6F
- Generates a new value for (C859)(C85A)(C85B) (used to generate Construction cards Cost, Alignment and Type)
ROM0:1F48 F5 push af ROM0:1F49 C5 push bc ROM0:1F4A D5 push de ROM0:1F4B FA 59 C8 ld a,(C859) ROM0:1F4E 4F ld c,a ROM0:1F4F FA 5A C8 ld a,(C85A) ROM0:1F52 B9 cp c ROM0:1F53 20 05 jr nz,1F5A ROM0:1F55 EA 5B C8 ld (C85B),a ROM0:1F58 18 12 jr 1F6C ROM0:1F5A 91 sub c ROM0:1F5B 47 ld b,a ROM0:1F5C 04 inc b ROM0:1F5D CD EA 1E call 1EEA ;retrieve fixed seeds from wC851 - wC854, and run the standard PRNG once ROM0:1F60 FA 5B C8 ld a,(C85B) ROM0:1F63 57 ld d,a ROM0:1F64 CD DA 13 call 13DA ;alternate PRNG ROM0:1F67 7B ld a,e ROM0:1F68 81 add c ROM0:1F69 EA 5B C8 ld (C85B),a ROM0:1F6C D1 pop de ROM0:1F6D C1 pop bc ROM0:1F6E F1 pop af ROM0:1F6F C9 ret
Card Status
Increase Card Level
ROM0:1F70 F5 push af ROM0:1F71 C5 push bc ROM0:1F72 E5 push hl ROM0:1F73 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1F76 E6 30 and a,30 ROM0:1F78 4F ld c,a ROM0:1F79 CB 31 swap c ROM0:1F7B 06 00 ld b,00 ROM0:1F7D 21 8E 1F ld hl,1F8E ROM0:1F80 09 add hl,bc ROM0:1F81 FA A5 C7 ld a,(C7A5) ROM0:1F84 E6 CF and a,CF ROM0:1F86 B6 or (hl) ROM0:1F87 EA A5 C7 ld (C7A5),a ROM0:1F8A E1 pop hl ROM0:1F8B C1 pop bc ROM0:1F8C F1 pop af ROM0:1F8D C9 ret
Card Levels array
ROM0:1F8E 10 20 30 30
Decrease Card Level
ROM0:1F92 F5 push af ROM0:1F93 C5 push bc ROM0:1F94 E5 push hl ROM0:1F95 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1F98 E6 30 and a,30 ROM0:1F9A 4F ld c,a ROM0:1F9B CB 31 swap c ROM0:1F9D 06 00 ld b,00 ROM0:1F9F 21 B0 1F ld hl,1FB0 ROM0:1FA2 09 add hl,bc ROM0:1FA3 FA A5 C7 ld a,(C7A5) ROM0:1FA6 E6 CF and a,CF ROM0:1FA8 B6 or (hl) ROM0:1FA9 EA A5 C7 ld (C7A5),a ROM0:1FAC E1 pop hl ROM0:1FAD C1 pop bc ROM0:1FAE F1 pop af ROM0:1FAF C9 ret
Card Levels array
ROM0:1FB0 00 00 10 20
Reset Card Level
ROM0:1FB4 F5 push af ROM0:1FB5 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FB8 E6 CF and a,CF ROM0:1FBA F6 10 or a,10 ROM0:1FBC EA A5 C7 ld (C7A5),a ROM0:1FBF F1 pop af ROM0:1FC0 C9 ret
Retrieve Card Level
ROM0:1FC1 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FC4 E6 30 and a,30 ROM0:1FC6 CB 37 swap a ROM0:1FC8 C9 ret
Reveal Card
ROM0:1FC9 F5 push af ROM0:1FCA FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FCD F6 40 or a,40 ROM0:1FCF EA A5 C7 ld (C7A5),a ROM0:1FD2 F1 pop af ROM0:1FD3 C9 ret
Hide Card
ROM0:1FD4 F5 push af ROM0:1FD5 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FD8 E6 BF and a,BF ROM0:1FDA EA A5 C7 ld (C7A5),a ROM0:1FDD F1 pop af ROM0:1FDE C9 ret
Freeze Card
ROM0:1FDF F5 push af ROM0:1FE0 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FE3 F6 08 or a,08 ROM0:1FE5 EA A5 C7 ld (C7A5),a ROM0:1FE8 F1 pop af ROM0:1FE9 C9 ret
Unfreeze Card
0x1FEA-0x1FF4
- Unfreezes card.
ROM0:1FEA F5 push af ROM0:1FEB FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FEE E6 F7 and a,F7 ROM0:1FF0 EA A5 C7 ld (C7A5),a ROM0:1FF3 F1 pop af ROM0:1FF4 C9 ret
Card stolen for a turn
0x1FF5-0x1FFF
- Indicates the monster has been stolen for a turn, returns to the opponent at the end of turn
ROM0:1FF5 F5 push af ROM0:1FF6 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:1FF9 F6 80 or a,80 ROM0:1FFB EA A5 C7 ld (C7A5),a ROM0:1FFE F1 pop af ROM0:1FFF C9 ret
Card controlled by its owner
ROM0:2000 F5 push af ROM0:2001 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2004 E6 7F and a,7F ROM0:2006 EA A5 C7 ld (C7A5),a ROM0:2009 F1 pop af ROM0:200A C9 ret
Remove Player's Card
ROM0:200B F5 push af ROM0:200C FA A5 C7 ld a,(C7A5) ;Card Status ROM0:200F E6 F8 and a,F8 ROM0:2011 F6 00 or a,00 ROM0:2013 EA A5 C7 ld (C7A5),a ROM0:2016 F1 pop af ROM0:2017 C9 ret
Remove CPU's Card
ROM0:2018 F5 push af ROM0:2019 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:201C E6 F8 and a,F8 ROM0:201E F6 01 or a,01 ROM0:2020 EA A5 C7 ld (C7A5),a ROM0:2023 F1 pop af ROM0:2024 C9 ret
Hide Player's Card, Level -1
ROM0:2025 F5 push af ROM0:2026 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2029 E6 F8 and a,F8 ROM0:202B F6 02 or a,02 ROM0:202D EA A5 C7 ld (C7A5),a ROM0:2030 F1 pop af ROM0:2031 C9 ret
Hide CPU's Card, Level -1
ROM0:2032 F5 push af ROM0:2033 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2036 E6 F8 and a,F8 ROM0:2038 F6 03 or a,03 ROM0:203A EA A5 C7 ld (C7A5),a ROM0:203D F1 pop af ROM0:203E C9 ret
Retrieves owner, card existence and Frozen status
ROM0:203F FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2042 E6 07 and a,07 ROM0:2044 C9 ret
Retrieve Card Hidden status
ROM0:2045 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2048 E6 40 and a,40 ROM0:204A 28 02 jr z,204E ROM0:204C 3E 01 ld a,01 ROM0:204E C9 ret
Retrieve Card Frozen status
ROM0:204F FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2052 E6 08 and a,08 ROM0:2054 28 02 jr z,2058 ROM0:2056 3E 01 ld a,01 ROM0:2058 C9 ret
Retrieve Card Level (lsb)
ROM0:2059 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:205C E6 10 and a,10 ROM0:205E 28 02 jr z,2062 ROM0:2060 3E 01 ld a,01 ROM0:2062 C9 ret
Retrieve Card Stolen status
ROM0:2063 FA A5 C7 ld a,(C7A5) ;Card Status ROM0:2066 E6 80 and a,80 ROM0:2068 28 02 jr z,206C ROM0:206A 3E 01 ld a,01 ROM0:206C C9 ret
Remove selected card from the field
0x206D-0x2085
- Removes selected card from the field, and copies it to (CAD6)
ROM0:206D F5 push af ROM0:206E C5 push bc ROM0:206F CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM0:2072 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM0:2075 FA A3 C7 ld a,(C7A3) ;Copy card being processed in bc ROM0:2078 4F ld c,a ROM0:2079 FA A4 C7 ld a,(C7A4) ROM0:207C 47 ld b,a ROM0:207D CD 9A 30 call 309A ;Copies card being processed to (CAD6) ROM0:2080 CD E6 19 call 19E6 ;Remove selected card from the field ROM0:2083 C1 pop bc ROM0:2084 F1 pop af ROM0:2085 C9 ret
0x2086-0x209B
- Removes selected card from the field
ROM0:2086 F5 push af ROM0:2087 C5 push bc ROM0:2088 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM0:208B CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM0:208E FA A3 C7 ld a,(C7A3) ;Copy card being processed in bc ROM0:2091 4F ld c,a ROM0:2092 FA A4 C7 ld a,(C7A4) ROM0:2095 47 ld b,a ROM0:2096 CD E6 19 call 19E6 ;Remove selected card from the field ROM0:2099 C1 pop bc ROM0:209A F1 pop af ROM0:209B C9 ret
Reveal Hidden card subroutine
ROM0:209C C5 push bc ROM0:209D CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM0:20A0 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM0:20A3 CD 45 20 call 2045 ;Retrieve Card Hidden status ROM0:20A6 FE 00 cp a,00 ROM0:20A8 20 08 jr nz,20B2 ;If the card is Hidden, jump to 0:20B2 (useless, the code executed is the same !) ROM0:20AA CD C9 1F call 1FC9 ;Reveal Card ROM0:20AD CD FB 19 call 19FB ;Update selected card ID and status ROM0:20B0 18 06 jr 20B8 ROM0:20B2 CD C9 1F call 1FC9 ;Reveal Card ROM0:20B5 CD FB 19 call 19FB ;Update selected card ID and status ROM0:20B8 C1 pop bc ROM0:20B9 C9 ret ROM0:20BA C9 ret
Blanks IDs of Card played, Fusion and Equip
0x20BB-0x20DB
- Blanks IDs of Card played, Fusion and Equip (Player's turn)
ROM0:20BB F5 push af ROM0:20BC 3E 00 ld a,00 ROM0:20BE EA 8B C8 ld (C88B),a ROM0:20C1 3E 00 ld a,00 ROM0:20C3 EA 8C C8 ld (C88C),a ;Blanks Card played by CPU, or Monster Card targeted by Equip Card ROM0:20C6 3E 00 ld a,00 ROM0:20C8 EA 8D C8 ld (C88D),a ROM0:20CB 3E 00 ld a,00 ROM0:20CD EA 8E C8 ld (C88E),a ;Blanks Card played by Player, or Equip Card targeting Monster Card ROM0:20D0 3E 00 ld a,00 ROM0:20D2 EA 8F C8 ld (C88F),a ROM0:20D5 3E 00 ld a,00 ROM0:20D7 EA 90 C8 ld (C890),a ;Blanks Fusion Monster Card ID ROM0:20DA F1 pop af ROM0:20DB C9 ret
0x20DC-0x20FC
- Blanks IDs of Card played, Fusion and Equip (CPU's turn)
ROM0:20DC F5 push af ROM0:20DD 3E 00 ld a,00 ROM0:20DF EA 8B C8 ld (C88B),a ROM0:20E2 3E 00 ld a,00 ROM0:20E4 EA 8C C8 ld (C88C),a ;Blanks Card played by CPU, or Monster Card targeted by Equip Card ROM0:20E7 3E 00 ld a,00 ROM0:20E9 EA 8D C8 ld (C88D),a ROM0:20EC 3E 00 ld a,00 ROM0:20EE EA 8E C8 ld (C88E),a ;Blanks Card played by Player, or Equip Card targeting Monster Card ROM0:20F1 3E 00 ld a,00 ROM0:20F3 EA 8F C8 ld (C88F),a ROM0:20F6 3E 00 ld a,00 ROM0:20F8 EA 90 C8 ld (C890),a ;Blanks Fusion Monster Card ID ROM0:20FB F1 pop af ROM0:20FC C9 ret
Copies Card played by CPU in (C88B)
ROM0:20FD F5 push af ROM0:20FE CD 72 1A call 1A72 ;Checks if a card is being played ROM0:2101 FE 00 cp a,00 ROM0:2103 20 08 jr nz,210D ;If there is no Card being played, get out of this function ROM0:2105 79 ld a,c ROM0:2106 EA 8B C8 ld (C88B),a ROM0:2109 78 ld a,b ROM0:210A EA 8C C8 ld (C88C),a ;Copy Card played by CPU in (C88B) ROM0:210D F1 pop af ROM0:210E C9 ret
Monster Fusion
Inverts Fused cards 1 and 2
0x2121 - 0x2141
- Inverts (C88B) and (C88D), Fused Monsters #1 and #2
ROM0:2121 F5 push af ROM0:2122 C5 push bc ROM0:2123 FA 8B C8 ld a,(C88B) ;Fused Monster #1 ROM0:2126 4F ld c,a ROM0:2127 FA 8C C8 ld a,(C88C) ROM0:212A 47 ld b,a ROM0:212B FA 8D C8 ld a,(C88D) ;Fused Monster #2 ROM0:212E EA 8B C8 ld (C88B),a ROM0:2131 FA 8E C8 ld a,(C88E) ROM0:2134 EA 8C C8 ld (C88C),a ROM0:2137 79 ld a,c ROM0:2138 EA 8D C8 ld (C88D),a ROM0:213B 78 ld a,b ROM0:213C EA 8E C8 ld (C88E),a ROM0:213F C1 pop bc ROM0:2140 F1 pop af ROM0:2141 C9 ret
Fusion subroutine
0x2142-0x2197
- Checks if the Fusion is valid, returns Fusion Monster ID in registerde
and stores it in(C88F)
ROM0:2142 C5 push bc ROM0:2143 D5 push de ROM0:2144 E5 push hl ROM0:2145 CD 85 22 call 2285 ROM0:2148 FE 01 cp a,01 ROM0:214A 20 04 jr nz,2150 ROM0:214C 3E 01 ld a,01 ROM0:214E 18 44 jr 2194 ROM0:2150 2E 01 ld l,01 ROM0:2152 FA 8B C8 ld a,(C88B) ;Fused Monster #1 ROM0:2155 4F ld c,a ROM0:2156 FA 8C C8 ld a,(C88C) ROM0:2159 47 ld b,a ROM0:215A 11 00 00 ld de,0000 ROM0:215D CD 14 1B call 1B14 ;Checks if Fused Monster #1 ≠ 0 ROM0:2160 A7 and a ROM0:2161 28 28 jr z,218B ;If Fused Monster #1 == 0, get out of this function ROM0:2163 FA 8D C8 ld a,(C88D) ;Fused Monster #2 ROM0:2166 4F ld c,a ROM0:2167 FA 8E C8 ld a,(C88E) ROM0:216A 47 ld b,a ROM0:216B CD 14 1B call 1B14 ;Checks if Fused Monster #2 ≠ 0 ROM0:216E A7 and a ROM0:216F 28 1A jr z,218B ;If Fused Monster #2 == 0, get out of this function ROM0:2171 CD 98 21 call 2198 ;Fusion check ROM0:2174 FE 00 cp a,00 ROM0:2176 20 04 jr nz,217C ROM0:2178 2E 00 ld l,00 ROM0:217A 18 0F jr 218B ROM0:217C CD 21 21 call 2121 ;Inverts Fused Monsters #1 and #2 ROM0:217F CD 98 21 call 2198 ;Fusion check ROM0:2182 FE 00 cp a,00 ROM0:2184 20 02 jr nz,2188 ROM0:2186 2E 00 ld l,00 ROM0:2188 CD 21 21 call 2121 ;Inverts Fused Monsters #1 and #2 ROM0:218B 7B ld a,e ROM0:218C EA 8F C8 ld (C88F),a ;Fused Monster ID ROM0:218F 7A ld a,d ROM0:2190 EA 90 C8 ld (C890),a ROM0:2193 7D ld a,l ROM0:2194 E1 pop hl ROM0:2195 D1 pop de ROM0:2196 C1 pop bc ROM0:2197 C9 ret
Fusion check
0x2198-0x222B
- Checks if the Fusion is valid, returns a = 0 and de = Fusion_Monster_ID if it is valid, or a = 1 otherwise
ROM0:2198 C5 push bc ROM0:2199 E5 push hl ROM0:219A E8 FF add sp,FF ROM0:219C FA 00 40 ld a,(4000) ROM0:219F F5 push af ;Stores current ROM Bank ROM0:21A0 3E 0F ld a,0F ROM0:21A2 CD 00 12 call 1200 ;ROM Bank switch ROM0:21A5 FA 8B C8 ld a,(C88B) ;bc = Fused Monster #1 ROM0:21A8 4F ld c,a ROM0:21A9 FA 8C C8 ld a,(C88C) ROM0:21AC 47 ld b,a ROM0:21AD CF rst 08 ;(returns ROM Bank for Fusion data in accumulator) => 09 0F ROM0:21B0 EA 85 C8 ld (C885),a ;Stores ROM Bank for Fusion data in (C885) ROM0:21B3 CF rst 08 ;(returns Fusion Material pointer in accumulator) => 0B 0F ROM0:21B6 79 ld a,c ROM0:21B7 EA 87 C8 ld (C887),a ;Stores Fusion Material pointer in (C887) ROM0:21BA 78 ld a,b ROM0:21BB EA 88 C8 ld (C888),a ROM0:21BE FA 8B C8 ld a,(C88B) ;bc = Fusion_material_ID +1 ROM0:21C1 C6 01 add a,01 ROM0:21C3 4F ld c,a ROM0:21C4 FA 8C C8 ld a,(C88C) ROM0:21C7 CE 00 adc a,00 ROM0:21C9 47 ld b,a ROM0:21CA CF rst 08 ;(returns second ROM Bank for Fusion data in accumulator) => 09 0F ROM0:21CD EA 86 C8 ld (C886),a ;Stores second ROM Bank for Fusion data in (C886) ROM0:21D0 CF rst 08 ;(returns second Fusion Material pointer in accumulator) => 0B 0F ROM0:21D3 79 ld a,c ROM0:21D4 EA 89 C8 ld (C889),a ;Stores second Fusion Material pointer in (C889) ROM0:21D7 78 ld a,b ROM0:21D8 EA 8A C8 ld (C88A),a ROM0:21DB F8 02 ld hl,sp+02 ROM0:21DD 36 01 ld (hl),01 ROM0:21DF FA 85 C8 ld a,(C885) ;a = ROM Bank for Fusion data ROM0:21E2 CD 00 12 call 1200 ;ROM Bank switch ROM0:21E5 CD 2C 22 call 222C ;Checks if end of Fusion array ROM0:21E8 FE 00 cp a,00 ROM0:21EA 28 25 jr z,2211 ;If end of Fusion array, jump to 0:2211 ROM0:21EC FA 87 C8 ld a,(C887) ;hl = Fusion Material pointer ROM0:21EF 6F ld l,a ROM0:21F0 FA 88 C8 ld a,(C888) ROM0:21F3 67 ld h,a ROM0:21F4 2A ldi a,(hl) ;de = next Fusion material in array ROM0:21F5 56 ld d,(hl) ROM0:21F6 5F ld e,a ROM0:21F7 FA 8D C8 ld a,(C88D) ;bc = Fused card #2 ROM0:21FA 4F ld c,a ROM0:21FB FA 8E C8 ld a,(C88E) ROM0:21FE 47 ld b,a ROM0:21FF CD 14 1B call 1B14 ;Checks if Fused card #2 == Fusion Material ID ROM0:2202 FE 00 cp a,00 ROM0:2204 20 06 jr nz,220C ;If(Fused Monster #2 ≠ Fusion Material ID), jump to 0:220C ROM0:2206 F8 02 ld hl,sp+02 ROM0:2208 36 00 ld (hl),00 ROM0:220A 18 05 jr 2211 ROM0:220C CD 54 22 call 2254 ;Next Fusion material in array ROM0:220F 18 D4 jr 21E5 ;Loop to 0:21E5 ROM0:2211 FA 87 C8 ld a,(C887) ;a = Fusion Material pointer + 2 ROM0:2214 C6 02 add a,02 ROM0:2216 6F ld l,a ROM0:2217 FA 88 C8 ld a,(C888) ROM0:221A CE 00 adc a,00 ROM0:221C 67 ld h,a ROM0:221D 2A ldi a,(hl) ;de = Fusion monster ROM0:221E 56 ld d,(hl) ROM0:221F 5F ld e,a ROM0:2220 F1 pop af ;Retrieves previous ROM Bank ROM0:2221 CD 00 12 call 1200 ;ROM Bank switch ROM0:2224 F8 00 ld hl,sp+00 ROM0:2226 7E ld a,(hl) ;a = 0 if the Fusion succeeded, a = 1 if the Fusion failed ROM0:2227 E8 01 add sp,01 ROM0:2229 E1 pop hl ROM0:222A C1 pop bc ROM0:222B C9 ret
Checks if end of Fusion array
0x222C-0x2253
- Returns 1 if the Fusion array has not been completely read, 0 otherwise
ROM0:222C C5 push bc ROM0:222D D5 push de ROM0:222E E5 push hl ROM0:222F 2E 01 ld l,01 ROM0:2231 FA 85 C8 ld a,(C885) ;Current ROM Bank for Fusion data ROM0:2234 4F ld c,a ROM0:2235 FA 86 C8 ld a,(C886) ;Last ROM Bank for Fusion data ROM0:2238 B9 cp c ROM0:2239 20 14 jr nz,224F ;If it is not the last ROM Bank for Fusion data, get out of this function ROM0:223B FA 87 C8 ld a,(C887) ;Fusion Material pointer ROM0:223E 5F ld e,a ROM0:223F FA 88 C8 ld a,(C888) ROM0:2242 57 ld d,a ROM0:2243 FA 89 C8 ld a,(C889) ;Second Fusion Material pointer ROM0:2246 4F ld c,a ROM0:2247 FA 8A C8 ld a,(C88A) ROM0:224A 47 ld b,a ROM0:224B CD 14 1B call 1B14 ;Checks if the two Fusion Material pointers are equal ROM0:224E 6F ld l,a ROM0:224F 7D ld a,l ROM0:2250 E1 pop hl ROM0:2251 D1 pop de ROM0:2252 C1 pop bc ROM0:2253 C9 ret
Next Fusion material in array
0x2254-0x2284
- Increase Fusion pointer by 4, increments ROM Bank if needed
ROM0:2254 C5 push bc ROM0:2255 D5 push de ROM0:2256 01 00 80 ld bc,8000 ;ROM is loaded in (0000-7FFF) area ROM0:2259 FA 87 C8 ld a,(C887) ;de = Fusion Material pointer + 4 ROM0:225C C6 04 add a,04 ROM0:225E 5F ld e,a ROM0:225F FA 88 C8 ld a,(C888) ROM0:2262 CE 00 adc a,00 ROM0:2264 57 ld d,a ROM0:2265 CD 14 1B call 1B14 ;Checks if Fusion Material pointer ≠ 0x8000 ROM0:2268 FE 00 cp a,00 ROM0:226A 20 0E jr nz,227A ;If Fusion pointer < 0x8000, jump to 0:227A ROM0:226C FA 85 C8 ld a,(C885) ;ROM Bank for Fusion data ROM0:226F C6 01 add a,01 ;ROM Bank ++ ROM0:2271 EA 85 C8 ld (C885),a ROM0:2274 CD 00 12 call 1200 ;ROM Bank switch ROM0:2277 11 04 40 ld de,4004 ROM0:227A 7B ld a,e ROM0:227B EA 87 C8 ld (C887),a ;Fusion Material pointer = de ROM0:227E 7A ld a,d ROM0:227F EA 88 C8 ld (C888),a ROM0:2282 D1 pop de ROM0:2283 C1 pop bc ROM0:2284 C9 ret
Ensures Fused Monsters IDs are ≤ 800
ROM0:2285 C5 push bc ROM0:2286 FA 8B C8 ld a,(C88B) ;Fused Monster #1 ROM0:2289 4F ld c,a ROM0:228A FA 8C C8 ld a,(C88C) ROM0:228D 47 ld b,a ROM0:228E CD 84 1A call 1A84 ;Checks Card ID validity ROM0:2291 FE 01 cp a,01 ROM0:2293 28 04 jr z,2299 ;If Fused Monster #1 ID ≤ 800, jump to 0:2299 ROM0:2295 3E 01 ld a,01 ROM0:2297 18 14 jr 22AD ;Else a = 1, and get out of this function ROM0:2299 FA 8D C8 ld a,(C88D) ;Fused Monster #2 ROM0:229C 4F ld c,a ROM0:229D FA 8E C8 ld a,(C88E) ROM0:22A0 47 ld b,a ROM0:22A1 CD 84 1A call 1A84 ;Checks Card ID validity ROM0:22A4 FE 01 cp a,01 ROM0:22A6 28 04 jr z,22AC ;If Fused Monster #1 ID ≤ 800, jump to 0:22AC ROM0:22A8 3E 01 ld a,01 ROM0:22AA 18 01 jr 22AD ;Else a = 1, and get out of this function ROM0:22AC AF xor a ;a = 0 ROM0:22AD C1 pop bc ROM0:22AE C9 ret
Initialize Battle values
ROM0:22AF F5 push af ROM0:22B0 AF xor a ROM0:22B1 EA 91 C8 ld (C891),a ;Player's card ID ROM0:22B4 EA 92 C8 ld (C892),a ROM0:22B7 EA 93 C8 ld (C893),a ;Player's Life Points ROM0:22BA EA 94 C8 ld (C894),a ROM0:22BD EA 95 C8 ld (C895),a ;Player's Life Points (copy) ROM0:22C0 EA 96 C8 ld (C896),a ROM0:22C3 EA 97 C8 ld (C897),a ;Player's Monster ATK ROM0:22C6 EA 98 C8 ld (C898),a ROM0:22C9 EA 99 C8 ld (C899),a ;Player's Monster DEF ROM0:22CC EA 9A C8 ld (C89A),a ROM0:22CF EA 9B C8 ld (C89B),a ;Player's Monster Alignment ROM0:22D2 EA 9C C8 ld (C89C),a ;CPU's card ID ROM0:22D5 EA 9D C8 ld (C89D),a ROM0:22D8 EA 9E C8 ld (C89E),a ;CPU's Life Points ROM0:22DB EA 9F C8 ld (C89F),a ROM0:22DE EA A0 C8 ld (C8A0),a ;CPU's Life Points (copy) ROM0:22E1 EA A1 C8 ld (C8A1),a ROM0:22E4 EA A2 C8 ld (C8A2),a ;CPU's Monster ATK ROM0:22E7 EA A3 C8 ld (C8A3),a ROM0:22EA EA A4 C8 ld (C8A4),a ;CPU's Monster DEF ROM0:22ED EA A5 C8 ld (C8A5),a ROM0:22F0 EA A6 C8 ld (C8A6),a ;CPU's Monster Alignment ROM0:22F3 EA A7 C8 ld (C8A7),a ;? (Battle value) ROM0:22F6 F1 pop af ROM0:22F7 C9 ret
0:22F8 (Copies 0x00 in (C8A7), to document)
0x22F8-0x22FF
- Copies 0x00 in (C8A7) (Called by function Direct Attack vs CPU at 3:D8EE)
ROM0:22F8 F5 push af ROM0:22F9 3E 00 ld a,00 ROM0:22FB EA A7 C8 ld (C8A7),a ROM0:22FE F1 pop af ROM0:22FF C9 ret
0x2300-0x2303
- Copies value sent to the function in (C8A7) (Called by function Direct Attack vs CPU at 3:D8EE)
ROM0:2300 EA A7 C8 ld (C8A7),a ROM0:2303 C9 ret
Determines which card to give after a duel
0x23E7-0x2446
- Checks card drops probabilities, and returns Card ID in registerbc
ROM0:23E7 F5 push af ROM0:23E8 D5 push de ROM0:23E9 E5 push hl ROM0:23EA 3E 00 ld a,00 ROM0:23EC EA 59 C8 ld (C859),a ROM0:23EF 3E FF ld a,FF ROM0:23F1 EA 5A C8 ld (C85A),a ROM0:23F4 CD 20 1F call 1F20 ;PRN between 0 and 255 ROM0:23F7 FA 5B C8 ld a,(C85B) ;a = PRN ROM0:23FA 5F ld e,a ROM0:23FB 3E 00 ld a,00 ROM0:23FD EA 59 C8 ld (C859),a ROM0:2400 3E 07 ld a,07 ROM0:2402 EA 5A C8 ld (C85A),a ROM0:2405 CD 20 1F call 1F20 ;PRN between 0 and 7 ROM0:2408 FA 5B C8 ld a,(C85B) ;a = PRN ROM0:240B 57 ld d,a ;de = rnd[0;2047] ROM0:240C 60 ld h,b ROM0:240D 69 ld l,c ;hl = card drop probability pointer ROM0:240E 01 00 00 ld bc,0000 ROM0:2411 AF xor a ;a = 0 ROM0:2412 F5 push af ;push current iteration ROM0:2413 C5 push bc ;push current Card ID ROM0:2414 E6 01 and a,01 ROM0:2416 20 14 jr nz,242C ;If(a == 1), jump to 0:242C ROM0:2418 2A ldi a,(hl) ROM0:2419 47 ld b,a ROM0:241A 7E ld a,(hl) ROM0:241B E6 F0 and a,F0 ROM0:241D CB 38 srl b ROM0:241F 1F rra ROM0:2420 CB 38 srl b ROM0:2422 1F rra ROM0:2423 CB 38 srl b ROM0:2425 1F rra ROM0:2426 CB 38 srl b ROM0:2428 1F rra ROM0:2429 4F ld c,a ;bc = 12 msb (card drop probability) ROM0:242A 18 06 jr 2432 ROM0:242C 2A ldi a,(hl) ROM0:242D E6 0F and a,0F ROM0:242F 47 ld b,a ROM0:2430 2A ldi a,(hl) ROM0:2431 4F ld c,a ;bc = 12 lsb (card drop probability) ROM0:2432 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM0:2435 C1 pop bc ROM0:2436 FE 00 cp a,00 ROM0:2438 20 04 jr nz,243E ;If(bc ≤ de), jump to 0:243E ROM0:243A E8 02 add sp,02 ;Else get out of this function ROM0:243C 18 05 jr 2443 ROM0:243E 03 inc bc ;Card ID ++ ROM0:243F F1 pop af ;Retrieves current iteration ROM0:2440 3C inc a ;a ++ ROM0:2441 18 CF jr 2412 ;Loop to 0:2412 ROM0:2443 E1 pop hl ROM0:2444 D1 pop de ROM0:2445 F1 pop af ROM0:2446 C9 ret
Duel handling
First turn, no attack
ROM0:2447 F5 push af ROM0:2448 3E 00 ld a,00 ROM0:244A EA D1 C8 ld (C8D1),a ;(C8D1) = 0 (attacks are disabled) ROM0:244D 3E 00 ld a,00 ROM0:244F EA D2 C8 ld (C8D2),a ;(C8D2) = 0 (same, for link duels) ROM0:2452 F1 pop af ROM0:2453 C9 ret
Other turns
ROM0:2454 F5 push af ROM0:2455 FA D1 C8 ld a,(C8D1) ROM0:2458 FE 00 cp a,00 ROM0:245A 20 05 jr nz,2461 ROM0:245C 3E 01 ld a,01 ROM0:245E EA D1 C8 ld (C8D1),a ;(C8D1) = 1 (attacks are enabled) ROM0:2461 F1 pop af ROM0:2462 C9 ret
Player loses
ROM0:2463 F5 push af ROM0:2464 3E 02 ld a,02 ROM0:2466 EA D1 C8 ld (C8D1),a ROM0:2469 F1 pop af ROM0:246A C9 ret
Player wins
ROM0:246B F5 push af ROM0:246C 3E 03 ld a,03 ROM0:246E EA D1 C8 ld (C8D1),a ROM0:2471 F1 pop af ROM0:2472 C9 ret
Duel Win and Loss subroutine
0x2473-0x24B7
- Checks if the game has been won by either player during the duel
ROM0:2473 C5 push bc ROM0:2474 0E 00 ld c,00 ROM0:2476 FA B1 C7 ld a,(C7B1) ;Menu ID ROM0:2479 FE 01 cp a,01 ;Campaign Mode ROM0:247B 20 14 jr nz,2491 ;If it isn't a Campaign Mode duel, jump to 0:2491 ROM0:247D FA D1 C8 ld a,(C8D1) ROM0:2480 FE 02 cp a,02 ROM0:2482 20 02 jr nz,2486 ;If the Player didn't lose, jump to 0:2486 ROM0:2484 0E 01 ld c,01 ROM0:2486 FA D1 C8 ld a,(C8D1) ROM0:2489 FE 03 cp a,03 ROM0:248B 20 02 jr nz,248F ;If the Player didn't win, jump to 0:248F ROM0:248D 0E 01 ld c,01 ROM0:248F 18 24 jr 24B5 ;Exit this function ROM0:2491 FA D1 C8 ld a,(C8D1) ROM0:2494 FE 02 cp a,02 ROM0:2496 20 02 jr nz,249A ;If the Player didn't lose, jump to 0:249A ROM0:2498 0E 01 ld c,01 ROM0:249A FA D1 C8 ld a,(C8D1) ROM0:249D FE 03 cp a,03 ROM0:249F 20 02 jr nz,24A3 ;If the Player didn't lose, jump to 0:24A3 ROM0:24A1 0E 01 ld c,01 ROM0:24A3 FA D2 C8 ld a,(C8D2) ROM0:24A6 FE 02 cp a,02 ROM0:24A8 20 02 jr nz,24AC ROM0:24AA 0E 01 ld c,01 ROM0:24AC FA D2 C8 ld a,(C8D2) ROM0:24AF FE 03 cp a,03 ROM0:24B1 20 02 jr nz,24B5 ROM0:24B3 0E 01 ld c,01 ROM0:24B5 79 ld a,c ROM0:24B6 C1 pop bc ROM0:24B7 C9 ret
Did the player win ?
0x24B8-0x24F5
- Returns 1 if the player won, 0 otherwise
ROM0:24B8 FA B1 C7 ld a,(C7B1) ;Menu ID ROM0:24BB FE 01 cp a,01 ROM0:24BD 20 0E jr nz,24CD ;If this isn't Campaign, jump to 0:24CD ROM0:24BF FA D1 C8 ld a,(C8D1) ;Did the player won a CPU Duel ? ROM0:24C2 FE 02 cp a,02 ROM0:24C4 20 03 jr nz,24C9 ;If the player won a CPU Duel, jump to 0:24C9 ROM0:24C6 AF xor a ROM0:24C7 18 02 jr 24CB ROM0:24C9 3E 01 ld a,01 ROM0:24CB 18 28 jr 24F5 ROM0:24CD FA D1 C8 ld a,(C8D1) ;Did the player won a CPU Duel ? ROM0:24D0 FE 03 cp a,03 ROM0:24D2 20 04 jr nz,24D8 ;If the player lost a CPU Duel, jump to 0:24D8 ROM0:24D4 3E 01 ld a,01 ROM0:24D6 18 1D jr 24F5 ROM0:24D8 FA D1 C8 ld a,(C8D1) ROM0:24DB FE 02 cp a,02 ROM0:24DD 20 03 jr nz,24E2 ;If this isn't a CPU duel, jump to 0:24E2 ROM0:24DF AF xor a ROM0:24E0 18 13 jr 24F5 ROM0:24E2 FA D2 C8 ld a,(C8D2) ;Did the player won a Link Duel ? ROM0:24E5 FE 03 cp a,03 ROM0:24E7 20 03 jr nz,24EC ;If the player lost a Link Duel, jump to 0:24EC ROM0:24E9 AF xor a ROM0:24EA 18 09 jr 24F5 ROM0:24EC FA D2 C8 ld a,(C8D2) ROM0:24EF FE 03 cp a,03 ROM0:24F1 20 02 jr nz,24F5 ;If this isn't a Link Duel, get out of this function ROM0:24F3 3E 01 ld a,01 ROM0:24F5 C9 ret
Did the player lose ?
0x24F6-0x2533
- Returns 1 if the player lost, 0 otherwise
ROM0:24F6 FA B1 C7 ld a,(C7B1) ;Menu ID ROM0:24F9 FE 01 cp a,01 ROM0:24FB 20 0E jr nz,250B ;If this isn't Campaign, jump to 0:250B ROM0:24FD FA D1 C8 ld a,(C8D1) ;Did the player lost a CPU Duel ? ROM0:2500 FE 03 cp a,03 ROM0:2502 20 03 jr nz,2507 ;If the player lost a CPU Duel, jump to 0:2507 ROM0:2504 AF xor a ROM0:2505 18 02 jr 2509 ROM0:2507 3E 01 ld a,01 ROM0:2509 18 28 jr 2533 ROM0:250B FA D1 C8 ld a,(C8D1) ;Did the player lost a CPU Duel ? ROM0:250E FE 03 cp a,03 ROM0:2510 20 03 jr nz,2515 ;If the player lost a CPU Duel, jump to 0:2515 ROM0:2512 AF xor a ROM0:2513 18 1E jr 2533 ROM0:2515 FA D1 C8 ld a,(C8D1) ROM0:2518 FE 02 cp a,02 ROM0:251A 20 04 jr nz,2520 ;If this isn't a CPU duel, jump to 0:2520 ROM0:251C 3E 01 ld a,01 ROM0:251E 18 13 jr 2533 ROM0:2520 FA D2 C8 ld a,(C8D2) ;Did the player lost a Link Duel ? ROM0:2523 FE 03 cp a,03 ROM0:2525 20 04 jr nz,252B ;If the player lost a Link Duel, jump to 0:252B ROM0:2527 3E 01 ld a,01 ROM0:2529 18 08 jr 2533 ROM0:252B FA D2 C8 ld a,(C8D2) ROM0:252E FE 03 cp a,03 ROM0:2530 20 01 jr nz,2533 ;If this isn't a Link Duel, get out of this function ROM0:2532 AF xor a ROM0:2533 C9 ret
Starter deck management
Copy Starter deck
0x2534
- Retrieve the 40 cards in the Starter deck after starting a new game
ROM0:2534 F5 push af ROM0:2535 C5 push bc ROM0:2536 D5 push de ROM0:2537 E5 push hl ROM0:2538 21 5D 25 ld hl,255D ;Starter deck pointer ROM0:253B 1E 00 ld e,00 ROM0:253D 7B ld a,e ;Set number of cards copied to 0 ROM0:253E FE 28 cp a,28 ROM0:2540 30 16 jr nc,2558 ;if less than 40 cards have been copied to the deck, exit this function ROM0:2542 CF rst 08 => 2D 01 ROM0:2545 2A ldi a,(hl) ROM0:2546 4F ld c,a ROM0:2547 2A ldi a,(hl) ROM0:2548 47 ld b,a ;bc = current_card_id ROM0:2549 CF rst 08 => 2F 01 ROM0:254C CF rst 08 => 9B 01 ROM0:254F CF rst 08 => 0B 01 ROM0:2552 CF rst 08 => 17 01 ROM0:2555 1C inc e ROM0:2556 18 E5 jr 253D ROM0:2558 E1 pop hl ROM0:2559 D1 pop de ROM0:255A C1 pop bc ROM0:255B F1 pop af ROM0:255C C9 ret
Starter deck
0x255D
- Starter deck
ROM0:255D ----------------------------------------------- DB 01 0F 02 89 01 DB 01 8F 01 DB 01 8D 01 F8 01 09 00 09 00 8D 01 92 01 09 00 24 02 D3 00 B4 01 33 02 BC 01 A6 01 04 02 C5 00 9A 01 33 02 BC 01 E6 01 0C 02 43 02 89 00 63 02 CA 00 CF 00 63 02 89 00 89 00 7A 00 61 02 25 02 FA 01 B6 00 A4 01 ----------------------------------------------- 3× Sinister Serpent 1× Milus Radiant 1× Zone Eater 1× Swordsman from a Foreign Land 2× Leghul 1× Fungi of the Musk 3× Shadow Specter 1× Monster Eye 1× Bone Mouse 1× Kaminarikozou 1× White Dolphin 2× Wretched Ghost of the Attic 2× Turu-Purun 1× Jinzo #7 1× Muka Muka 1× Mech Mole Zombie 1× Mechanical Spider 1× Boo Koo 1× Star Boy 1× Abyss Flower 3× Mystery Hand 2× Hiro's Shadow Scout 1× Air Marmot of Nefariousness 1× Droll Bird 1× Yamatano Dragon Scroll 1× Bladefly 1× Frog The Jam 1× Gale Dogra 1× Masked Clown 1× Cyber-Stein
Gives a card to the Player
ROM0:26A8 F5 push af ROM0:26A9 D5 push de ROM0:26AA E5 push hl ROM0:26AB FA 00 40 ld a,(4000) ROM0:26AE F5 push af ROM0:26AF 3E 3E ld a,3E ROM0:26B1 CD 00 12 call 1200 ;ROM Bank switch to 0x3E ROM0:26B4 CD E8 71 call 71E8 ;Returns the address containing the card drop list ROM0:26B7 7A ld a,d ROM0:26B8 CD 00 12 call 1200 ;ROM Bank switch to 0x24 or 0x25 ROM0:26BB CD E7 23 call 23E7 ;Determine which card to give after a duel ROM0:26BE F1 pop af ROM0:26BF CD 00 12 call 1200 ;ROM Bank switch ROM0:26C2 E1 pop hl ROM0:26C3 D1 pop de ROM0:26C4 F1 pop af ROM0:26C5 C9 ret
Duel Records
Initialize Duel Records
0x26C6-0x26EB
- Sets Duel Records to either 00s or to values at0x276E
if Debug is enabled
ROM0:26C6 F5 push af ROM0:26C7 C5 push bc ROM0:26C8 D5 push de ROM0:26C9 E5 push hl ROM0:26CA AF xor a ROM0:26CB 21 0C C9 ld hl,C90C ROM0:26CE CF rst 08 ROM0:26CF 11 04 => Checks if(wC8D6 ≠ 0) ROM0:26D1 FE 00 cp a,00 ROM0:26D3 20 05 jr nz,26DA ;If debug, jump to 0:26DA ROM0:26D5 11 0A 27 ld de,270A ;New Game Duel Records ROM0:26D8 18 03 jr 26DD ROM0:26DA 11 6E 27 ld de,276E ;Debug Duel Records ROM0:26DD 0E 19 ld c,19 ROM0:26DF 1A ld a,(de) ROM0:26E0 22 ldi (hl),a ROM0:26E1 13 inc de ROM0:26E2 1A ld a,(de) ROM0:26E3 22 ldi (hl),a ROM0:26E4 13 inc de ROM0:26E5 0D dec c ROM0:26E6 20 F7 jr nz,26DF ROM0:26E8 21 3E C9 ld hl,C93E ROM0:26EB CF rst 08
Initialize Duel Wins
0x26EF-0x2709
- Sets Duel Wins to either 00s or to values at0x279A
if Debug is enabled
ROM0:26EF FE 00 cp a,00 ROM0:26F0 20 05 jr nz,26F7 ;If debug, jump to 0:26F7 ROM0:26F2 11 3C 27 ld de,273C ;New Game Duel Wins ROM0:26F5 18 03 jr 26FA ROM0:26F7 11 9A 27 ld de,279A ;Debug Duel Wins ROM0:26FA 0E 19 ld c,19 ROM0:26FC 1A ld a,(de) ROM0:26FD 22 ldi (hl),a ROM0:26FE 13 inc de ROM0:26FF 1A ld a,(de) ROM0:2700 22 ldi (hl),a ROM0:2701 13 inc de ROM0:2702 0D dec c ROM0:2703 20 F7 jr nz,26FC ROM0:2705 E1 pop hl ROM0:2706 D1 pop de ROM0:2707 C1 pop bc ROM0:2708 F1 pop af ROM0:2709 C9 ret
New Game Duel Records and Wins
0x270A-0x2761
- Initial Duel Records. 0 wins against every opponent.
Debug Duel Records and Wins
0x276E-0x27C5
- Debug Initial Duel Records. 9 wins against almost every opponent, 4 wins against DarkNite.
Check if 5 wins or more against CPU opponent
0x27DB-0x27F9
- Argument:
- a = cpu_opponent_id
- Return value:
- a = 0 if less than 5 wins
- a = 1 if 5 wins or more
ROM0:27DB C5 push bc ROM0:27DC D5 push de ROM0:27DD E5 push hl ROM0:27DE 1E 01 ld e,01 ;e = 1 ROM0:27E0 06 00 ld b,00 ROM0:27E2 4F ld c,a ROM0:27E3 CB 21 sla c ;c = cpu_opponent_id << 1 ROM0:27E5 21 3E C9 ld hl,C93E ;Duel Records (wins) ROM0:27E8 09 add hl,bc ROM0:27E9 2A ldi a,(hl) ROM0:27EA FE 05 cp a,05 ROM0:27EC 30 07 jr nc,27F5 ;if last byte of DarkNite wins > 5, jump to 0:27F5 ROM0:27EE 7E ld a,(hl) ROM0:27EF FE 00 cp a,00 ROM0:27F1 20 02 jr nz,27F5 ;if DarkNite wins > 255, jump to 0:27F5 ROM0:27F3 1E 00 ld e,00 ;else e = 0 ROM0:27F5 7B ld a,e ROM0:27F6 E1 pop hl ROM0:27F7 D1 pop de ROM0:27F8 C1 pop bc ROM0:27F9 C9 ret
Check which Stages the player is allowed to access
ROM0:28C5 D5 push de ROM0:28C6 1E 00 ld e,00 ROM0:28C8 CD EF 28 call 28EF ;Check if Stage 1 opponents have been defeated 5 or more times ROM0:28CB FE 00 cp a,00 ROM0:28CD 28 1D jr z,28EC ROM0:28CF 1E 01 ld e,01 ROM0:28D1 CD 10 29 call 2910 ;Check if Stage 2 opponents have been defeated 5 or more times ROM0:28D4 FE 00 cp a,00 ROM0:28D6 28 14 jr z,28EC ROM0:28D8 1E 02 ld e,02 ROM0:28DA CD 32 29 call 2932 ;Check if Stage 3 opponents have been defeated 5 or more times ROM0:28DD FE 00 cp a,00 ROM0:28DF 28 0B jr z,28EC ROM0:28E1 1E 03 ld e,03 ROM0:28E3 CD 52 29 call 2952 ;Check if Darknite has been defeated 5 or more times ROM0:28E6 FE 00 cp a,00 ROM0:28E8 28 02 jr z,28EC ROM0:28EA 1E 04 ld e,04 ROM0:28EC 7B ld a,e ROM0:28ED D1 pop de ROM0:28EE C9 ret
Check if Stage 1 opponents have been defeated 5 or more times
ROM0:28EF C5 push bc ROM0:28F0 D5 push de ROM0:28F1 E5 push hl ROM0:28F2 1E 01 ld e,01 ROM0:28F4 21 0B 29 ld hl,290B ;Array of Stage 1 opponents ROM0:28F7 0E 05 ld c,05 ROM0:28F9 2A ldi a,(hl) ROM0:28FA CD DB 27 call 27DB ;Check if 5 wins or more against CPU opponent ROM0:28FD FE 00 cp a,00 ROM0:28FF 20 02 jr nz,2903 ROM0:2901 1E 00 ld e,00 ROM0:2903 0D dec c ROM0:2904 20 F3 jr nz,28F9 ;Loop 5 times ROM0:2906 7B ld a,e ROM0:2907 E1 pop hl ROM0:2908 D1 pop de ROM0:2909 C1 pop bc ROM0:290A C9 ret
Array of Stage 1 opponents
ROM0:290B 0A 05 03 01 07 Tristan Taylor Yugi Muto Mako Tsunami Mai Valentine Joey Wheeler
Check if Stage 2 opponents have been defeated 5 or more times
ROM0:2910 C5 push bc ROM0:2911 D5 push de ROM0:2912 E5 push hl ROM0:2913 1E 01 ld e,01 ROM0:2915 21 2C 29 ld hl,292C ;Array of Stage 2 opponents ROM0:2918 0E 06 ld c,06 ROM0:291A 2A ldi a,(hl) ROM0:291B CD DB 27 call 27DB ;Check if 5 wins or more against CPU opponent ROM0:291E FE 00 cp a,00 ROM0:2920 20 02 jr nz,2924 ROM0:2922 1E 00 ld e,00 ROM0:2924 0D dec c ROM0:2925 20 F3 jr nz,291A ;Loop 6 times ROM0:2927 7B ld a,e ROM0:2928 E1 pop hl ROM0:2929 D1 pop de ROM0:292A C1 pop bc ROM0:292B C9 ret
Array of Stage 2 opponents
ROM0:292C 09 02 00 0B 0C 08 Espa Roba Rex Raptor Weevil Underwood Rare Hunter Pandora Seto Kaiba
Check if Stage 3 opponents have been defeated 5 or more times
ROM0:2932 C5 push bc ROM0:2933 D5 push de ROM0:2934 E5 push hl ROM0:2935 1E 01 ld e,01 ROM0:2937 21 4E 29 ld hl,294E ;Array of Stage 3 opponents ROM0:293A 0E 04 ld c,04 ROM0:293C 2A ldi a,(hl) ROM0:293D CD DB 27 call 27DB ;Check if 5 wins or more against CPU opponent ROM0:2940 FE 00 cp a,00 ROM0:2942 20 02 jr nz,2946 ROM0:2944 1E 00 ld e,00 ROM0:2946 0D dec c ROM0:2947 20 F3 jr nz,293C ;Loop 4 times ROM0:2949 7B ld a,e ROM0:294A E1 pop hl ROM0:294B D1 pop de ROM0:294C C1 pop bc ROM0:294D C9 ret
Array of Stage 3 opponents
ROM0:294E 10 17 0E 0F Simon Muran Ishizu Ishtar Heishin P. Seto
Check if Darknite has been defeated 5 or more times
ROM0:2952 C5 push bc ROM0:2953 D5 push de ROM0:2954 E5 push hl ROM0:2955 1E 01 ld e,01 ;e = 1 ROM0:2957 3E 15 ld a,15 ;DarkNite ROM0:2959 CD DB 27 call 27DB ;Check if 5 wins or more against CPU opponent ROM0:295C FE 00 cp a,00 ROM0:295E 20 02 jr nz,2962 ;if DarkNite wins ≥ 5, skip next instruction ROM0:2960 1E 00 ld e,00 ;e = 0 ROM0:2962 7B ld a,e ;(most of the accumulator and reg e assignments could be safely removed in this subroutine) ROM0:2963 E1 pop hl ROM0:2964 D1 pop de ROM0:2965 C1 pop bc ROM0:2966 C9 ret
0:2967
ROM0:2967 F5 push af ROM0:2968 C5 push bc ROM0:2969 FA 00 40 ld a,(4000) ;ROM Bank ROM0:296C F5 push af ROM0:296D 3E 3E ld a,3E ROM0:296F CD 00 12 call 1200 ;ROM Bank switch ROM0:2972 CD 7C 29 call 297C ROM0:2975 F1 pop af ROM0:2976 CD 00 12 call 1200 ROM0:2979 C1 pop bc ROM0:297A F1 pop af ROM0:297B C9 ret
0:297C
ROM0:297C F5 push af ROM0:297D C5 push bc ROM0:297E D5 push de ROM0:297F E5 push hl ROM0:2980 FA B3 C6 ld a,(C6B3) ROM0:2983 4F ld c,a ROM0:2984 FA B4 C6 ld a,(C6B4) ROM0:2987 47 ld b,a ;bc = current_card_id ROM0:2988 CD 5B 68 call 685B ROM0:298B 7A ld a,d ROM0:298C CD 00 12 call 1200 ;ROM Bank switch ROM0:298F 50 ld d,b ROM0:2990 59 ld e,c ROM0:2991 21 A1 D1 ld hl,D1A1 ROM0:2994 CF rst 08 => 0D 08 ROM0:2997 0E 12 ld c,12 ROM0:2999 1A ld a,(de) ROM0:299A 13 inc de ROM0:299B CF rst 08 => 0F 08 ROM0:299E E5 push hl ROM0:299F C5 push bc ROM0:29A0 01 20 00 ld bc,0020 ROM0:29A3 09 add hl,bc ROM0:29A4 FA E7 C5 ld a,(C5E7) ROM0:29A7 77 ld (hl),a ROM0:29A8 C1 pop bc ROM0:29A9 E1 pop hl ROM0:29AA FA E6 C5 ld a,(C5E6) ROM0:29AD 22 ldi (hl),a ROM0:29AE 0D dec c ROM0:29AF 20 E8 jr nz,2999 ROM0:29B1 CF rst 08 => 11 08 ; to 8:451E - sets wC5E5 to 0 ROM0:29B4 21 E1 D1 ld hl,D1E1 ROM0:29B7 0E 12 ld c,12 ROM0:29B9 1A ld a,(de) ROM0:29BA 13 inc de ROM0:29BB CF rst 08 => 0F 08 ROM0:29BE E5 push hl ROM0:29BF C5 push bc ROM0:29C0 01 20 00 ld bc,0020 ROM0:29C3 09 add hl,bc ROM0:29C4 FA E7 C5 ld a,(C5E7) ROM0:29C7 77 ld (hl),a ROM0:29C8 C1 pop bc ROM0:29C9 E1 pop hl ROM0:29CA FA E6 C5 ld a,(C5E6) ROM0:29CD 22 ldi (hl),a ROM0:29CE 0D dec c ROM0:29CF 20 E8 jr nz,29B9 ROM0:29D1 E1 pop hl ROM0:29D2 D1 pop de ROM0:29D3 C1 pop bc ROM0:29D4 F1 pop af ROM0:29D5 C9 ret
Music tracks management
Title Screen music
ROM0:29E1 F5 push af ROM0:29E2 3E 00 ld a,00 ROM0:29E4 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:29E7 F1 pop af ROM0:29E8 C9 ret
Duel Preparation music
ROM0:29E9 F5 push af ROM0:29EA 3E 17 ld a,17 ROM0:29EC CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:29EF F1 pop af ROM0:29F0 C9 ret
Main Menu music
ROM0:29F1 F5 push af ROM0:29F2 3E 01 ld a,01 ROM0:29F4 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:29F7 F1 pop af ROM0:29F8 C9 ret
Duel Records music
ROM0:29F9 F5 push af ROM0:29FA 3E 18 ld a,18 ROM0:29FC CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:29FF F1 pop af ROM0:2A00 C9 ret
Password Mode music
ROM0:2A01 F5 push af ROM0:2A02 3E 1A ld a,1A ROM0:2A04 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A07 F1 pop af ROM0:2A08 C9 ret
Construction Mode music
ROM0:2A09 F5 push af ROM0:2A0A 3E 1B ld a,1B ROM0:2A0C CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A0F F1 pop af ROM0:2A10 C9 ret
Name Entry music
ROM0:2A11 F5 push af ROM0:2A12 3E 19 ld a,19 ROM0:2A14 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A17 F1 pop af ROM0:2A18 C9 ret
Campaign Mode music
ROM0:2A19 F5 push af ROM0:2A1A 3E 14 ld a,14 ROM0:2A1C CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A1F F1 pop af ROM0:2A20 C9 ret
Link Duel music (fail-safe)
ROM0:2A21 F5 push af ROM0:2A22 3E 11 ld a,11 ROM0:2A24 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A27 F1 pop af ROM0:2A28 C9 ret
Duel Win music
ROM0:2A29 F5 push af ROM0:2A2A 3E 12 ld a,12 ROM0:2A2C CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A2F F1 pop af ROM0:2A30 C9 ret
Duel Loss music
ROM0:2A31 F5 push af ROM0:2A32 3E 13 ld a,13 ROM0:2A34 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A37 F1 pop af ROM0:2A38 C9 ret
Tea music
ROM0:2A39 F5 push af ROM0:2A3A 3E 15 ld a,15 ROM0:2A3C CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A3F F1 pop af ROM0:2A40 C9 ret
Grandpa music
ROM0:2A41 F5 push af ROM0:2A42 3E 16 ld a,16 ROM0:2A44 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A47 F1 pop af ROM0:2A48 C9 ret
Correct Password music
ROM0:2A49 F5 push af ROM0:2A4A 3E 06 ld a,06 ROM0:2A4C CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A4F F1 pop af ROM0:2A50 C9 ret
Credits music
ROM0:2A51 F5 push af ROM0:2A52 3E 1C ld a,1C ROM0:2A54 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A57 F1 pop af ROM0:2A58 C9 ret
Duel Music subroutine
ROM0:2A59 F5 push af ROM0:2A5A FA B1 C7 ld a,(C7B1) ROM0:2A5D FE 01 cp a,01 ROM0:2A5F 20 08 jr nz,2A69 ;If it's not Campaign Mode, jump to 0:2A69 ROM0:2A61 FA CE C8 ld a,(C8CE) ;a = Duel Music ID ROM0:2A64 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A67 18 05 jr 2A6E ROM0:2A69 3E 11 ld a,11 ;Link Duel Music ID ROM0:2A6B CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A6E F1 pop af ROM0:2A6F C9 ret
Pre-duel Music subroutine
ROM0:2A70 F5 push af ROM0:2A71 FA CD C8 ld a,(C8CD) ;a = Pre-duel Music ID ROM0:2A74 CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer ROM0:2A77 F1 pop af ROM0:2A78 C9 ret
Sound Effects management
0x2A79-0x2B50
- Calls0:2BFC
with accumulator as a parameter, or calls0x2B51
to return
SE: Return to previous screen
ROM0:2A79 F5 push af ROM0:2A7A 3E 06 ld a,06 ROM0:2A7C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2A7F F1 pop af ROM0:2A80 C9 ret
SE: Validate (Menu)
ROM0:2A81 F5 push af ROM0:2A82 3E 03 ld a,03 ROM0:2A84 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2A87 F1 pop af ROM0:2A88 C9 ret
SE: Cursor
ROM0:2A89 F5 push af ROM0:2A8A 3E 02 ld a,02 ROM0:2A8C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2A8F F1 pop af ROM0:2A90 C9 ret
SE: Invalid
ROM0:2A91 F5 push af ROM0:2A92 3E 06 ld a,06 ROM0:2A94 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2A97 F1 pop af ROM0:2A98 C9 ret
SE: Validate (Duel)
ROM0:2A99 F5 push af ROM0:2A9A 3E 03 ld a,03 ROM0:2A9C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2A9F F1 pop af ROM0:2AA0 C9 ret
0:2AA1 (SE: Cursor, not sure where)
ROM0:2AA1 F5 push af ROM0:2AA2 3E 02 ld a,02 ROM0:2AA4 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AA7 F1 pop af ROM0:2AA8 C9 ret
SE: Set Trap card / Failed Fusion
ROM0:2AA9 F5 push af ROM0:2AAA 3E 01 ld a,01 ROM0:2AAC CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AAF F1 pop af ROM0:2AB0 C9 ret
0:2AB1
ROM0:2AB1 F5 push af ROM0:2AB2 3E 06 ld a,06 ROM0:2AB4 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AB7 F1 pop af ROM0:2AB8 C9 ret
SE: Effect Monster
ROM0:2AB9 F5 push af ROM0:2ABA 3E 04 ld a,04 ROM0:2ABC CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2ABF F1 pop af ROM0:2AC0 C9 ret
0:2AC1
ROM0:2AC1 F5 push af ROM0:2AC2 3E 05 ld a,05 ROM0:2AC4 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AC7 F1 pop af ROM0:2AC8 C9 ret
0:2AC9
ROM0:2AC9 F5 push af ROM0:2ACA 3E 14 ld a,14 ROM0:2ACC CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2ACF F1 pop af ROM0:2AD0 C9 ret
0:2AD1
ROM0:2AD1 F5 push af ROM0:2AD2 3E 07 ld a,07 ROM0:2AD4 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AD7 F1 pop af ROM0:2AD8 C9 ret
0:2AD9 (Removed)
ROM0:2AD9 F5 push af ROM0:2ADA 3E 20 ld a,20 ROM0:2ADC CD 51 2B call 2B51 ;Fail-safe for Sound Effects no longer used ROM0:2ADF F1 pop af ROM0:2AE0 C9 ret
0:2AE1
ROM0:2AE1 F5 push af ROM0:2AE2 3E 0A ld a,0A ROM0:2AE4 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AE7 F1 pop af ROM0:2AE8 C9 ret
SE: Cursor (Duel)
ROM0:2AE9 F5 push af ROM0:2AEA 3E 09 ld a,09 ROM0:2AEC CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AEF F1 pop af ROM0:2AF0 C9 ret
0:2AF1 (Removed)
ROM0:2AF1 F5 push af ROM0:2AF2 3E 1B ld a,1B ROM0:2AF4 CD 51 2B call 2B51 ;Fail-safe for Sound Effects no longer used ROM0:2AF7 F1 pop af ROM0:2AF8 C9 ret
0:2AF9
ROM0:2AF9 F5 push af ROM0:2AFA 3E 10 ld a,10 ROM0:2AFC CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2AFF F1 pop af ROM0:2B00 C9 ret
SE: Swords of Revealing Light
ROM0:2B01 F5 push af ROM0:2B02 3E 11 ld a,11 ROM0:2B04 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B07 F1 pop af ROM0:2B08 C9 ret
SE: Dark Hole
ROM0:2B09 F5 push af ROM0:2B0A 3E 12 ld a,12 ROM0:2B0C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B0F F1 pop af ROM0:2B10 C9 ret
SE: Raigeki
ROM0:2B11 F5 push af ROM0:2B12 3E 13 ld a,13 ROM0:2B14 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B17 F1 pop af ROM0:2B18 C9 ret
0:2B19
ROM0:2B19 F5 push af ROM0:2B1A 3E 0D ld a,0D ROM0:2B1C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B1F F1 pop af ROM0:2B20 C9 ret
0:2B21
ROM0:2B21 F5 push af ROM0:2B22 3E 0C ld a,0C ROM0:2B24 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B27 F1 pop af ROM0:2B28 C9 ret
SE: End of turn
ROM0:2B29 F5 push af ROM0:2B2A 3E 0B ld a,0B ROM0:2B2C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B2F F1 pop af ROM0:2B30 C9 ret
0:2B31
ROM0:2B31 F5 push af ROM0:2B32 3E 08 ld a,08 ROM0:2B34 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B37 F1 pop af ROM0:2B38 C9 ret
0:2B39
ROM0:2B39 F5 push af ROM0:2B3A 3E 00 ld a,00 ROM0:2B3C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B3F F1 pop af ROM0:2B40 C9 ret
0:2B41
ROM0:2B41 F5 push af ROM0:2B42 3E 0E ld a,0E ROM0:2B44 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B47 F1 pop af ROM0:2B48 C9 ret
SE: Exodia
ROM0:2B49 F5 push af ROM0:2B4A 3E 0F ld a,0F ROM0:2B4C CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer ROM0:2B4F F1 pop af ROM0:2B50 C9 ret
Fail-safe for Sound Effects no longer used
ROM0:2B51 C9 ret
Music and SE management
Loads Music ROM Bank and pointer
ROM0:2B52 F5 push af ROM0:2B53 C5 push bc ROM0:2B54 D5 push de ROM0:2B55 E5 push hl ROM0:2B56 06 00 ld b,00 ROM0:2B58 4F ld c,a ROM0:2B59 CB 21 sla c ROM0:2B5B CB 10 rl b ROM0:2B5D CB 21 sla c ROM0:2B5F CB 10 rl b ROM0:2B61 21 74 2B ld hl,2B74 ;Music Bank ROM0:2B64 09 add hl,bc ROM0:2B65 2A ldi a,(hl) ROM0:2B66 5F ld e,a ROM0:2B67 2A ldi a,(hl) ROM0:2B68 57 ld d,a ROM0:2B69 2A ldi a,(hl) ;Music pointer ROM0:2B6A 66 ld h,(hl) ROM0:2B6B 6F ld l,a ROM0:2B6C CD 11 3C call 3C11 ;Check if Music ROM Bank and pointer changed, and store these in WRAM ROM0:2B6F E1 pop hl ROM0:2B70 D1 pop de ROM0:2B71 C1 pop bc ROM0:2B72 F1 pop af ROM0:2B73 C9 ret
Music ROM Bank and pointers
0x2B74-0x2BFB
- ROM Banks and pointers to the Game Boy Sound files
ROM0:2B74 41 00 02 40 - Title Screen 41 00 88 46 - Main Menu 41 00 45 50 - Stage 1 Pre-Duel 41 00 4B 55 - Stage 2 Pre-Duel 42 00 02 40 - Stage 3 Pre-Duel 42 00 2B 4B - Stage 4 Pre-Duel 42 00 08 57 - Stage 5 Pre-Duel 43 00 02 40 - Stage 1 Duel 44 00 02 40 - 45 00 02 40 - Stage 2 Duel 44 00 0D 69 - Unused Duel 46 00 02 40 - Stage 3 Duel 46 00 E4 5F - 47 00 02 40 - Marik Ishtar Duel 48 00 02 40 - DarkNite Duel 49 00 02 40 - 4A 00 02 40 - Yami Yugi Duel 4B 00 02 40 - Link Duel 4C 00 02 40 - Duel win 4C 00 C1 41 - Duel loss 4C 00 87 42 - Stage selection 4C 00 C9 49 - Tea gives a card 4C 00 FC 4F - Grandpa gives a card 4C 00 AC 58 - Pre-Duel Menu 4D 00 02 40 - Duel Records 4D 00 14 50 - Name entry 4D 00 C0 55 - Password entry 4D 00 35 59 - Construction Mode 4E 00 02 40 - Credits 4F 00 02 40 - Yami Bakura Duel 50 00 02 40 - Shadi Duel 51 00 02 40 - Nitemare Duel 52 00 02 40 - Unused Duel 53 00 02 40 - Unused Credits
Loads Sound Effect Bank and pointer
0x2BFC-0x2C19
- Loads Sound Effect Bank and pointer
ROM0:2BFC F5 push af ROM0:2BFD C5 push bc ROM0:2BFE D5 push de ROM0:2BFF E5 push hl ROM0:2C00 6F ld l,a ROM0:2C01 FA 00 40 ld a,(4000) ROM0:2C04 F5 push af ROM0:2C05 3E 40 ld a,40 ROM0:2C07 CD 00 12 call 1200 ;ROM Bank switch ROM0:2C0A 7D ld a,l ROM0:2C0B CD 02 40 call 4002 ;Loads Sound Effect pointer ROM0:2C0E F1 pop af ROM0:2C0F CD 00 12 call 1200 ;ROM Bank switch ROM0:2C12 CD 75 3C call 3C75 ROM0:2C15 E1 pop hl ROM0:2C16 D1 pop de ROM0:2C17 C1 pop bc ROM0:2C18 F1 pop af ROM0:2C19 C9 ret
Battle Operation 1
(C997) (C998) flags check
0:2C1A
0x2C1A-0x2C23
- Sets (C997) and (C998) to 0
ROM0:2C1A F5 push af ROM0:2C1B AF xor a ROM0:2C1C EA 97 C9 ld (C997),a ROM0:2C1F EA 98 C9 ld (C998),a ROM0:2C22 F1 pop af ROM0:2C23 C9 ret
0:2C24
0x2C24-0x2C2E
- (C997) | 1
ROM0:2C24 F5 push af ROM0:2C25 FA 97 C9 ld a,(C997) ROM0:2C28 F6 01 or a,01 ROM0:2C2A EA 97 C9 ld (C997),a ROM0:2C2D F1 pop af ROM0:2C2E C9 ret
0:2C2F
0x2C2F-0x2C39
- (C997) & 0xFE
ROM0:2C2F F5 push af ROM0:2C30 FA 97 C9 ld a,(C997) ROM0:2C33 E6 FE and a,FE ROM0:2C35 EA 97 C9 ld (C997),a ROM0:2C38 F1 pop af ROM0:2C39 C9 ret
0:2C3A
0x2C3A-0x2C44
- (C998) | 1
ROM0:2C3A F5 push af ROM0:2C3B FA 98 C9 ld a,(C998) ROM0:2C3E F6 01 or a,01 ROM0:2C40 EA 98 C9 ld (C998),a ROM0:2C43 F1 pop af ROM0:2C44 C9 ret
0:2C45
0x2C45-0x2C4F
- (C998) & 0xFE
ROM0:2C45 F5 push af ROM0:2C46 FA 98 C9 ld a,(C998) ROM0:2C49 E6 FE and a,FE ROM0:2C4B EA 98 C9 ld (C998),a ROM0:2C4E F1 pop af ROM0:2C4F C9 ret
0:2C50
0x2C50-0x2C59
- (C997) & 0x01
ROM0:2C50 FA 97 C9 ld a,(C997) ROM0:2C53 E6 01 and a,01 ROM0:2C55 28 02 jr z,2C59 ROM0:2C57 3E 01 ld a,01 ROM0:2C59 C9 ret
0:2C5A
0x2C5A-0x2C63
- (C998) & 0x01
ROM0:2C5A FA 98 C9 ld a,(C998) ROM0:2C5D E6 01 and a,01 ROM0:2C5F 28 02 jr z,2C63 ROM0:2C61 3E 01 ld a,01 ROM0:2C63 C9 ret
Swords of Revealing Light handling
Initialize SoRL counters to 0
0x2C64-0x2C6D
- Sets both Swords of Revealing Light counters to 0
ROM0:2C64 F5 push af ROM0:2C65 AF xor a ROM0:2C66 EA 99 C9 ld (C999),a ;Sets Player's SoRL counter to 0 ROM0:2C69 EA 9A C9 ld (C99A),a ;Sets CPU's SoRL counter to 0 ROM0:2C6C F1 pop af ROM0:2C6D C9 ret
Set Player's SoRL counter to 4
0x2C6E-0x2C7D
- Sets Swords of Revealing Light counter to 4
ROM0:2C6E F5 push af ROM0:2C6F 3E 04 ld a,04 ROM0:2C71 EA 99 C9 ld (C999),a ;Sets Player's SoRL counter to 4 ROM0:2C74 F1 pop af ROM0:2C75 C9 ret
Set CPU's SoRL counter to 4
ROM0:2C76 F5 push af ROM0:2C77 3E 04 ld a,04 ROM0:2C79 EA 9A C9 ld (C99A),a ;Sets CPU's SoRL counter to 4 ROM0:2C7C F1 pop af ROM0:2C7D C9 ret
Decrease Player's SoRL counter
0x2C7E-0x2C8B
- Decrease Player's Swords of Revealing Light counter by 1
ROM0:2C7E F5 push af ROM0:2C7F FA 99 C9 ld a,(C999) ;Loads Player's SoRL counter in accumulator ROM0:2C82 FE 00 cp a,00 ROM0:2C84 28 04 jr z,2C8A ;If SoRL is not active, gtfo of this function ROM0:2C86 3D dec a ROM0:2C87 EA 99 C9 ld (C999),a ;Updates Player's SoRL counter ROM0:2C8A F1 pop af ROM0:2C8B C9 ret
Decrease CPU's SoRL counter
0x2C8C-0x2C99
- Decrease CPU's Swords of Revealing Light counter by 1
ROM0:2C8C F5 push af ROM0:2C8D FA 9A C9 ld a,(C99A) ;Loads CPU's SoRL counter in accumulator ROM0:2C90 FE 00 cp a,00 ROM0:2C92 28 04 jr z,2C98 ;If SoRL is not active, gtfo of this function ROM0:2C94 3D dec a ROM0:2C95 EA 9A C9 ld (C99A),a ;Updates CPU's SoRL counter ROM0:2C98 F1 pop af ROM0:2C99 C9 ret
Check Player's SoRL counter
0x2C9A-0x2CA9
- Checks Player's Swords of Revealing Light counter
ROM0:2C9A C5 push bc ;Is Player restrained by SoRL ? ROM0:2C9B E5 push hl ROM0:2C9C 06 00 ld b,00 ROM0:2C9E FA 99 C9 ld a,(C999) ;Loads Player's SoRL counter in accumulator ROM0:2CA1 4F ld c,a ROM0:2CA2 21 BA 2C ld hl,2CBA ROM0:2CA5 09 add hl,bc ROM0:2CA6 7E ld a,(hl) ;Loads corresponding value from the "can the monster attack ?" list at 0:2CBA ROM0:2CA7 E1 pop hl ROM0:2CA8 C1 pop bc ROM0:2CA9 C9 ret
Check CPU's SoRL counter
0x2CAA-0x2CB9
- Checks CPU's Swords of Revealing Light counter
ROM0:2CAA C5 push bc ;Is CPU restrained by SoRL ? ROM0:2CAB E5 push hl ROM0:2CAC 06 00 ld b,00 ROM0:2CAE FA 9A C9 ld a,(C99A) ;Loads CPU's SoRL counter in accumulator ROM0:2CB1 4F ld c,a ROM0:2CB2 21 BA 2C ld hl,2CBA ROM0:2CB5 09 add hl,bc ROM0:2CB6 7E ld a,(hl) ;Loads corresponding value from the "can the monster attack ?" list at (2CBA) ROM0:2CB7 E1 pop hl ROM0:2CB8 C1 pop bc ROM0:2CB9 C9 ret
0x2CBA-0x2CBE
- "Can the monster attack ?" list, depending on Swords of Revealing Light current counter
02 01 00 00 00
Check if SoRL restrains Player
0x2CBF-0x2CD7
- Checks if there is no SoRL restraining Player or if it has just ended
ROM0:2CBF F5 push af ROM0:2CC0 CD 9A 2C call 2C9A ;Check CPU's SoRL counter ROM0:2CC3 FE 00 cp a,00 ROM0:2CC5 20 06 jr nz,2CCD ROM0:2CC7 AF xor a ;If SoRL is not active ROM0:2CC8 CF rst 08 ROM0:2CC9 27 daa ROM0:2CCA 05 dec b ROM0:2CCB 18 09 jr 2CD6 ROM0:2CCD FE 01 cp a,01 ROM0:2CCF 20 05 jr nz,2CD6 ROM0:2CD1 3E 01 ld a,01 ;If SoRL has just ended ROM0:2CD3 CF rst 08 ;Displays « Swords of Revealing Light has stopped » in another function => 27 05 ROM0:2CD6 F1 pop af ROM0:2CD7 C9 ret
Reveals monster on the field
0x2CD8-0x2D08
- Reveals monster on the field (also used by Dark-Piercing Light)
ROM0:2CD8 F5 push af ROM0:2CD9 C5 push bc ROM0:2CDA E5 push hl ROM0:2CDB AF xor a ROM0:2CDC EA 9B C9 ld (C99B),a ;Sets (C99B) to (C9B7) to 0 ROM0:2CDF EA AF C9 ld (C9AF),a ROM0:2CE2 EA B0 C9 ld (C9B0),a ROM0:2CE5 EA B1 C9 ld (C9B1),a ROM0:2CE8 EA B2 C9 ld (C9B2),a ROM0:2CEB EA B3 C9 ld (C9B3),a ROM0:2CEE EA B4 C9 ld (C9B4),a ROM0:2CF1 EA B5 C9 ld (C9B5),a ROM0:2CF4 EA B6 C9 ld (C9B6),a ROM0:2CF7 EA B7 C9 ld (C9B7),a ROM0:2CFA 21 9D C9 ld hl,C99D ROM0:2CFD 3E FF ld a,FF ROM0:2CFF 0E 12 ld c,12 ROM0:2D01 22 ldi (hl),a ;Sets (C99D) -> (C9A9) to 0xFF ROM0:2D02 0D dec c ROM0:2D03 20 FC jr nz,2D01 ROM0:2D05 E1 pop hl ROM0:2D06 C1 pop bc ROM0:2D07 F1 pop af ROM0:2D08 C9 ret
Special text
0:2D09
ROM0:2D09 D5 push de ROM0:2D0A E5 push hl ROM0:2D0B 06 00 ld b,00 ROM0:2D0D FA 9C C9 ld a,(C99C) ;Special text pointer offset ROM0:2D10 4F ld c,a ROM0:2D11 CB 21 sla c ROM0:2D13 21 49 2D ld hl,2D49 ROM0:2D16 09 add hl,bc ;hl = 0x2D49 + Special text pointer offset ROM0:2D17 2A ldi a,(hl) ROM0:2D18 66 ld h,(hl) ROM0:2D19 6F ld l,a ROM0:2D1A FA 9B C9 ld a,(C99B) ROM0:2D1D FE 00 cp a,00 ROM0:2D1F 20 08 jr nz,2D29 ROM0:2D21 2A ldi a,(hl) ROM0:2D22 4F ld c,a ROM0:2D23 2A ldi a,(hl) ROM0:2D24 47 ld b,a ROM0:2D25 56 ld d,(hl) ROM0:2D26 CD 4F 2D call 2D4F ROM0:2D29 06 00 ld b,00 ROM0:2D2B FA 9B C9 ld a,(C99B) ROM0:2D2E 4F ld c,a ROM0:2D2F 3C inc a ROM0:2D30 EA 9B C9 ld (C99B),a ROM0:2D33 21 9D C9 ld hl,C99D ROM0:2D36 09 add hl,bc ROM0:2D37 2A ldi a,(hl) ROM0:2D38 4F ld c,a ROM0:2D39 FA 9B C9 ld a,(C99B) ROM0:2D3C 5F ld e,a ROM0:2D3D FA E4 C5 ld a,(C5E4) ROM0:2D40 BB cp e ROM0:2D41 20 02 jr nz,2D45 ROM0:2D43 06 01 ld b,01 ROM0:2D45 79 ld a,c ROM0:2D46 E1 pop hl ROM0:2D47 D1 pop de ROM0:2D48 C9 ret
0:2D4F
ROM0:2D4F F5 push af ROM0:2D50 C5 push bc ROM0:2D51 D5 push de ROM0:2D52 E5 push hl ROM0:2D53 7A ld a,d ROM0:2D54 FE 04 cp a,04 ROM0:2D56 28 0C jr z,2D64 ROM0:2D58 7A ld a,d ROM0:2D59 CF rst 08 ... ROM0:2D5C CF rst 08 ... ROM0:2D5F CF rst 08 ... ROM0:2D62 18 06 jr 2D6A ROM0:2D64 CF rst 08 ... ROM0:2D67 CD AC 16 call 16AC ROM0:2D6A 21 9D C9 ld hl,C99D ROM0:2D6D 11 D0 C5 ld de,C5D0 ROM0:2D70 0E 12 ld c,12 ROM0:2D72 1A ld a,(de) ROM0:2D73 22 ldi (hl),a ROM0:2D74 13 inc de ROM0:2D75 0D dec c ROM0:2D76 20 FA jr nz,2D72 ROM0:2D78 AF xor a ROM0:2D79 EA 9B C9 ld (C99B),a ROM0:2D7C E1 pop hl ROM0:2D7D D1 pop de ROM0:2D7E C1 pop bc ROM0:2D7F F1 pop af ROM0:2D80 C9 ret
Set special text pointer offset
ROM0:2D81 F5 push af ROM0:2D82 EA 9C C9 ld (C99C),a ;Special text pointer offset = a ROM0:2D85 AF xor a ROM0:2D86 EA 9B C9 ld (C99B),a ;(C99B) = 0 ROM0:2D89 F1 pop af ROM0:2D8A C9 ret
Display card illustration
ROM0:2E22 F5 push af ROM0:2E23 C5 push bc ROM0:2E24 D5 push de ROM0:2E25 E5 push hl ROM0:2E26 3E 3E ld a,3E ROM0:2E28 CD 00 12 call 1200 ;ROM Bank switch ROM0:2E2B CD 9B 5B call 5B9B ROM0:2E2E 7A ld a,d ROM0:2E2F CD 00 12 call 1200 ;ROM Bank switch ROM0:2E32 60 ld h,b ROM0:2E33 69 ld l,c ROM0:2E34 11 00 C5 ld de,C500 ROM0:2E37 2A ldi a,(hl) ROM0:2E38 47 ld b,a ROM0:2E39 78 ld a,b ROM0:2E3A FE 00 cp a,00 ROM0:2E3C 28 1F jr z,2E5D ROM0:2E3E F0 42 ld a,(ff00+42) ROM0:2E40 4F ld c,a ROM0:2E41 FA C3 C6 ld a,(C6C3) ROM0:2E44 86 add (hl) ROM0:2E45 91 sub c ROM0:2E46 12 ld (de),a ;Store card illustration to (C500) ROM0:2E47 23 inc hl ROM0:2E48 13 inc de ROM0:2E49 F0 43 ld a,(ff00+43) ROM0:2E4B 4F ld c,a ROM0:2E4C FA C4 C6 ld a,(C6C4) ROM0:2E4F 86 add (hl) ROM0:2E50 91 sub c ROM0:2E51 12 ld (de),a ROM0:2E52 23 inc hl ROM0:2E53 13 inc de ROM0:2E54 2A ldi a,(hl) ROM0:2E55 12 ld (de),a ROM0:2E56 13 inc de ROM0:2E57 2A ldi a,(hl) ROM0:2E58 12 ld (de),a ROM0:2E59 13 inc de ROM0:2E5A 05 dec b ROM0:2E5B 18 DC jr 2E39 ROM0:2E5D E1 pop hl ROM0:2E5E D1 pop de ROM0:2E5F C1 pop bc ROM0:2E60 F1 pop af ROM0:2E61 C9 ret
Game Boy Color check
0x2FD1-0x2FE3
- Checks if the system running the game is a Game Boy Color
ROM0:2FD1 F5 push af ROM0:2FD2 3E 04 ld a,04 ROM0:2FD4 EA 38 CA ld (CA38),a ROM0:2FD7 F0 DD ld a,(ff00+DD) ROM0:2FD9 FE 11 cp a,11 ROM0:2FDB 28 05 jr z,2FE2 ;If the system is a Game Boy Color, get out of this function ROM0:2FDD CF rst 08 ;Else rst 08 (to error screen) ROM0:2FDE 0D 06 => 6:400D ROM0:2FE0 18 FE jr 2FE0 ;Softlock ROM0:2FE2 F1 pop af ROM0:2FE3 C9 ret
0:303E
ROM0:303E F5 push af ROM0:303F C5 push bc ROM0:3040 3E 06 ld a,06 ROM0:3042 CD 24 12 call 1224 ;Switches to WRAM Bank 6 ROM0:3045 CD 17 12 call 1217 ROM0:3048 3E 1A ld a,1A ROM0:304A CD E3 0E call 0EE3 ;related to display ROM0:304D 3E 7F ld a,7F ROM0:304F CD 0F 11 call 110F ROM0:3052 01 00 98 ld bc,9800 ROM0:3055 CD D2 10 call 10D2 ROM0:3058 01 00 D8 ld bc,D800 ROM0:305B CD 04 11 call 1104 ROM0:305E CD C1 10 call 10C1 ROM0:3061 CD 11 12 call 1211 ROM0:3064 3E 1A ld a,1A ROM0:3066 CD E3 0E call 0EE3 ROM0:3069 3E 7F ld a,7F ROM0:306B CD 0F 11 call 110F ROM0:306E 01 00 98 ld bc,9800 ROM0:3071 CD D2 10 call 10D2 ROM0:3074 01 00 D0 ld bc,D000 ROM0:3077 CD 04 11 call 1104 ROM0:307A CD C1 10 call 10C1 ROM0:307D CD 48 12 call 1248 ROM0:3080 C1 pop bc ROM0:3081 F1 pop af ROM0:3082 C9 ret
Copies card being processed
0x309A-0x30AB
- Copies card being processed to(CAD6)
ROM0:309A F5 push af ROM0:309B CD 72 1A call 1A72 ;Checks if a card is being processed ROM0:309E FE 01 cp a,01 ROM0:30A0 28 08 jr z,30AA ;If no card is being processed, GTFO of this function ROM0:30A2 79 ld a,c ROM0:30A3 EA D6 CA ld (CAD6),a ;If a card is being processed, copy it to (CAD6) ROM0:30A6 78 ld a,b ROM0:30A7 EA D7 CA ld (CAD7),a ROM0:30AA F1 pop af ROM0:30AB C9 ret
Sound
0:3B00
ROM0:3B00 AF xor a ROM0:3B01 E0 07 ld (ff00+07),a ;Timer Control ROM0:3B03 E0 06 ld (ff00+06),a ;Timer Modulo ROM0:3B05 EA 38 C4 ld (C438),a ROM0:3B08 21 0F FF ld hl,FF0F ROM0:3B0B CB 96 res 2,(hl) ROM0:3B0D 21 FF FF ld hl,FFFF ROM0:3B10 CB D6 set 2,(hl) ROM0:3B12 21 26 C4 ld hl,C426 ROM0:3B15 36 76 ld (hl),76 ROM0:3B17 23 inc hl ROM0:3B18 36 3B ld (hl),3B ROM0:3B1A 23 inc hl ROM0:3B1B AF xor a ROM0:3B1C 22 ldi (hl),a ROM0:3B1D 22 ldi (hl),a ROM0:3B1E 22 ldi (hl),a ROM0:3B1F 22 ldi (hl),a ROM0:3B20 22 ldi (hl),a ROM0:3B21 77 ld (hl),a ROM0:3B22 21 32 C4 ld hl,C432 ROM0:3B25 36 77 ld (hl),77 ROM0:3B27 23 inc hl ROM0:3B28 36 3B ld (hl),3B ROM0:3B2A 23 inc hl ROM0:3B2B 22 ldi (hl),a ROM0:3B2C 77 ld (hl),a ROM0:3B2D 3E FF ld a,FF ROM0:3B2F EA 3A C4 ld (C43A),a ROM0:3B32 CD AD 3B call 3BAD ROM0:3B35 CD D3 3B call 3BD3 ROM0:3B38 3E 01 ld a,01 ROM0:3B3A EA 3B C4 ld (C43B),a ROM0:3B3D 3E FF ld a,FF ROM0:3B3F EA 00 C4 ld (C400),a ROM0:3B42 F0 4D ld a,(ff00+4D) ;Game Boy Color speed switch ROM0:3B44 07 rlca ROM0:3B45 3E 39 ld a,39 ROM0:3B47 30 02 jr nc,3B4B ROM0:3B49 3E 3A ld a,3A ROM0:3B4B EA 3C C4 ld (C43C),a ROM0:3B4E CD 80 3B call 3B80 ;Mute a few seconds ROM0:3B51 C9 ret
0:3B78 (Array)
ROM0:3B78 01 02 04 08 10 20 40 80
Mute
0x3B80-0x3BAC
- Mute (called at the start of a new game, after name entry)
ROM0:3B80 3E 80 ld a,80 ROM0:3B82 E0 26 ld (ff00+26),a ;NR52, Sound off ROM0:3B84 21 52 3B ld hl,3B52 ROM0:3B87 01 10 14 ld bc,1410 ROM0:3B8A 2A ldi a,(hl) ROM0:3B8B E2 ld (ff00+c),a ROM0:3B8C 0C inc c ROM0:3B8D 05 dec b ROM0:3B8E 20 FA jr nz,3B8A ROM0:3B90 21 66 3B ld hl,3B66 ROM0:3B93 01 30 10 ld bc,1030 ROM0:3B96 2A ldi a,(hl) ROM0:3B97 E2 ld (ff00+c),a ROM0:3B98 0C inc c ROM0:3B99 05 dec b ROM0:3B9A 20 FA jr nz,3B96 ROM0:3B9C 3E 80 ld a,80 ROM0:3B9E E0 1A ld (ff00+1A),a ;NR30, Channel 3 Sound on ROM0:3BA0 3E 77 ld a,77 ROM0:3BA2 E0 24 ld (ff00+24),a ;NR50, Channel control and Volume ROM0:3BA4 3E FF ld a,FF ROM0:3BA6 E0 25 ld (ff00+25),a ;NR51, Sound output terminal ROM0:3BA8 3E 8F ld a,8F ROM0:3BAA E0 26 ld (ff00+26),a ;NR52, Sound on ROM0:3BAC C9 ret
0:3BAD
ROM0:3BAD AF xor a ROM0:3BAE 21 07 C4 ld hl,C407 ROM0:3BB1 06 1F ld b,1F ROM0:3BB3 22 ldi (hl),a ROM0:3BB4 05 dec b ROM0:3BB5 20 FC jr nz,3BB3 ROM0:3BB7 EA 3D C4 ld (C43D),a ROM0:3BBA EA 3E C4 ld (C43E),a ROM0:3BBD EA 3F C4 ld (C43F),a ROM0:3BC0 EA 40 C4 ld (C440),a ROM0:3BC3 3C inc a ROM0:3BC4 EA 01 C4 ld (C401),a ROM0:3BC7 EA 02 C4 ld (C402),a ROM0:3BCA EA 03 C4 ld (C403),a ROM0:3BCD 3E 0F ld a,0F ROM0:3BCF EA 39 C4 ld (C439),a ROM0:3BD2 C9 ret
0:3BD3
ROM0:3BD3 FA 3A C4 ld a,(C43A) ROM0:3BD6 3C inc a ROM0:3BD7 C4 E8 3B call nz,3BE8 ROM0:3BDA 3E FF ld a,FF ROM0:3BDC EA 3A C4 ld (C43A),a ROM0:3BDF 3E 01 ld a,01 ROM0:3BE1 EA 04 C4 ld (C404),a ROM0:3BE4 EA 05 C4 ld (C405),a ROM0:3BE7 C9 ret
0:3BE8
ROM0:3BE8 FA 3A C4 ld a,(C43A) ROM0:3BEB 47 ld b,a ROM0:3BEC 0E 12 ld c,12 ROM0:3BEE CB 28 sra b ROM0:3BF0 38 0B jr c,3BFD ROM0:3BF2 AF xor a ROM0:3BF3 F3 di ROM0:3BF4 E2 ld (ff00+c),a ROM0:3BF5 0C inc c ROM0:3BF6 0C inc c ROM0:3BF7 3E 80 ld a,80 ROM0:3BF9 E2 ld (ff00+c),a ROM0:3BFA FB ei ROM0:3BFB 0D dec c ROM0:3BFC 0D dec c ROM0:3BFD 79 ld a,c ROM0:3BFE C6 05 add a,05 ROM0:3C00 4F ld c,a ROM0:3C01 FE 22 cp a,22 ROM0:3C03 38 E9 jr c,3BEE ROM0:3C05 C9 ret
0:3C06
ROM0:3C06 FA 38 C4 ld a,(C438) ;Sound effect playing ? ROM0:3C09 A7 and a ROM0:3C0A C8 ret z
0:3C0B
ROM0:3C0B FA 3D C4 ld a,(C43D) ;Music playing ? ROM0:3C0E CB 37 swap a ROM0:3C10 C9 ret
Checks if the Music or SE playing changed
ROM0:3C11 F0 FF ld a,(ff00+FF) ROM0:3C13 E6 04 and a,04 ROM0:3C15 28 04 jr z,3C1B ;If Timer Interrupt is enabled, jump to 0:3C1B ROM0:3C17 F0 07 ld a,(ff00+07) ;Timer Control ROM0:3C19 E6 04 and a,04 ROM0:3C1B F5 push af ROM0:3C1C D5 push de ROM0:3C1D E5 push hl ROM0:3C1E CC 00 3B call z,3B00 ;If Timer is enabled, jump to 0:3B00 ROM0:3C21 D1 pop de ROM0:3C22 C1 pop bc ROM0:3C23 21 38 C4 ld hl,C438 ;Sound Effect playing ? ROM0:3C26 CB 46 bit 0,(hl) ROM0:3C28 28 15 jr z,3C3F ROM0:3C2A 21 2A C4 ld hl,C42A ;Music or SE pointer ROM0:3C2D 2A ldi a,(hl) ROM0:3C2E BB cp e ROM0:3C2F 20 0E jr nz,3C3F ROM0:3C31 2A ldi a,(hl) ROM0:3C32 BA cp d ROM0:3C33 20 0A jr nz,3C3F ;If(de ≠ (C42A)), jump to 0:3C3F ROM0:3C35 2A ldi a,(hl) ;Music or SE ROM Bank ROM0:3C36 B9 cp c ROM0:3C37 20 06 jr nz,3C3F ROM0:3C39 7E ld a,(hl) ROM0:3C3A B8 cp b ROM0:3C3B 20 02 jr nz,3C3F ;If(bc ≠ (C42C)), jump to 0:3C3F ROM0:3C3D F1 pop af ROM0:3C3E C9 ret
Writes Music or SE ROM Bank and Pointer to (C426)
ROM0:3C3F C5 push bc ROM0:3C40 D5 push de ROM0:3C41 CD AD 3B call 3BAD ROM0:3C44 D1 pop de ROM0:3C45 C1 pop bc ROM0:3C46 21 26 C4 ld hl,C426 ;Pointer to the Music data being read ROM0:3C49 73 ld (hl),e ROM0:3C4A 23 inc hl ROM0:3C4B 72 ld (hl),d ROM0:3C4C 23 inc hl ;ROM Bank of the Music data being read ROM0:3C4D 71 ld (hl),c ROM0:3C4E 23 inc hl ROM0:3C4F 70 ld (hl),b ROM0:3C50 23 inc hl ;Music pointer ROM0:3C51 73 ld (hl),e ROM0:3C52 23 inc hl ROM0:3C53 72 ld (hl),d ROM0:3C54 23 inc hl ;Music ROM Bank ROM0:3C55 71 ld (hl),c ROM0:3C56 23 inc hl ROM0:3C57 70 ld (hl),b ROM0:3C58 AF xor a ROM0:3C59 EA 41 C4 ld (C441),a ;Music loop flag ROM0:3C5C 3E F0 ld a,F0 ROM0:3C5E EA 3D C4 ld (C43D),a ;Music playing ? ROM0:3C61 21 38 C4 ld hl,C438 ;Sound Effect playing ? ROM0:3C64 CB C6 set 0,(hl) ROM0:3C66 F1 pop af ROM0:3C67 20 0A jr nz,3C73 ROM0:3C69 AF xor a ROM0:3C6A E0 06 ld (ff00+06),a ;Timer Modulo = 0 ROM0:3C6C 3D dec a ROM0:3C6D E0 05 ld (ff00+05),a ;Timer Counter, a Timer Interrupt will be requested at the next tick (rst $50) ROM0:3C6F 3E 04 ld a,04 ROM0:3C71 E0 07 ld (ff00+07),a ;Timer Enabled, 4096 Hz ROM0:3C73 FB ei ROM0:3C74 C9 ret
0:3C75
ROM0:3C75 F0 FF ld a,(ff00+FF) ROM0:3C77 E6 04 and a,04 ROM0:3C79 28 04 jr z,3C7F ROM0:3C7B F0 07 ld a,(ff00+07) ROM0:3C7D E6 04 and a,04 ROM0:3C7F F5 push af ROM0:3C80 D5 push de ROM0:3C81 E5 push hl ROM0:3C82 CC 00 3B call z,3B00 ROM0:3C85 CD D3 3B call 3BD3 ROM0:3C88 D1 pop de ROM0:3C89 13 inc de ROM0:3C8A 21 32 C4 ld hl,C432 ROM0:3C8D 73 ld (hl),e ROM0:3C8E 23 inc hl ROM0:3C8F 72 ld (hl),d ROM0:3C90 23 inc hl ROM0:3C91 C1 pop bc ROM0:3C92 71 ld (hl),c ROM0:3C93 23 inc hl ROM0:3C94 70 ld (hl),b ROM0:3C95 FA 00 40 ld a,(4000) ROM0:3C98 F5 push af ROM0:3C99 FA 01 40 ld a,(4001) ROM0:3C9C F5 push af ROM0:3C9D 78 ld a,b ROM0:3C9E EA 00 30 ld (3000),a ROM0:3CA1 79 ld a,c ROM0:3CA2 EA 00 20 ld (2000),a ROM0:3CA5 1B dec de ROM0:3CA6 1A ld a,(de) ROM0:3CA7 EA 3A C4 ld (C43A),a ROM0:3CAA F1 pop af ROM0:3CAB EA 00 30 ld (3000),a ROM0:3CAE F1 pop af ROM0:3CAF EA 00 20 ld (2000),a ROM0:3CB2 21 38 C4 ld hl,C438 ROM0:3CB5 CB CE set 1,(hl) ROM0:3CB7 F1 pop af ROM0:3CB8 20 0A jr nz,3CC4 ROM0:3CBA AF xor a ROM0:3CBB E0 06 ld (ff00+06),a ROM0:3CBD 3D dec a ROM0:3CBE E0 05 ld (ff00+05),a ROM0:3CC0 3E 04 ld a,04 ROM0:3CC2 E0 07 ld (ff00+07),a ROM0:3CC4 FB ei ROM0:3CC5 C9 ret
rst 50 - Read Game Boy Sound file
ROM0:3D2C FB ei ROM0:3D2D F5 push af ROM0:3D2E C5 push bc ROM0:3D2F D5 push de ROM0:3D30 E5 push hl ROM0:3D31 21 38 C4 ld hl,C438 ROM0:3D34 CB 46 bit 0,(hl) ROM0:3D36 CA 7E 3E jp z,3E7E ROM0:3D39 21 00 C4 ld hl,C400 ROM0:3D3C FA 3B C4 ld a,(C43B) ROM0:3D3F 86 add (hl) ROM0:3D40 22 ldi (hl),a ROM0:3D41 C2 47 3E jp nz,3E47 ROM0:3D44 35 dec (hl) ROM0:3D45 C2 47 3E jp nz,3E47 ROM0:3D48 FA 00 40 ld a,(4000) ROM0:3D4B EA 36 C4 ld (C436),a ;Stores ROM Bank ROM0:3D4E FA 01 40 ld a,(4001) ROM0:3D51 EA 37 C4 ld (C437),a ;Stores WRAM Bank ROM0:3D54 21 29 C4 ld hl,C429 ROM0:3D57 3A ldd a,(hl) ROM0:3D58 EA 00 30 ld (3000),a ;Music ROM Bank - High ROM0:3D5B 3A ldd a,(hl) ROM0:3D5C EA 00 20 ld (2000),a ;Music ROM Bank - Low ROM0:3D5F 46 ld b,(hl) ROM0:3D60 2B dec hl ROM0:3D61 4E ld c,(hl) ;bc = Pointer to next byte in gbs file ROM0:3D62 0A ld a,(bc) ;a = Next byte in gbs file ROM0:3D63 03 inc bc ;bc ++ ROM0:3D64 5F ld e,a ROM0:3D65 87 add a ROM0:3D66 D2 28 3E jp nc,3E28 ROM0:3D69 FE FE cp a,FE ROM0:3D6B CA 05 3E jp z,3E05 ;End of file, do a loop if needed ROM0:3D6E E6 60 and a,60 ROM0:3D70 28 3B jr z,3DAD ROM0:3D72 FE 20 cp a,20 ROM0:3D74 28 1E jr z,3D94 ROM0:3D76 FE 60 cp a,60 ROM0:3D78 28 5A jr z,3DD4 ;Activate Music Loop ROM0:3D7A 7B ld a,e ROM0:3D7B E6 07 and a,07 ROM0:3D7D 5F ld e,a ROM0:3D7E C6 78 add a,78 ROM0:3D80 6F ld l,a ROM0:3D81 26 3B ld h,3B ROM0:3D83 7E ld a,(hl) ;Array at 0x3B78 ROM0:3D84 21 39 C4 ld hl,C439 ROM0:3D87 B6 or (hl) ROM0:3D88 77 ld (hl),a ROM0:3D89 7B ld a,e ROM0:3D8A 87 add a ROM0:3D8B 87 add a ROM0:3D8C C6 07 add a,07 ROM0:3D8E 6F ld l,a ROM0:3D8F 0A ld a,(bc) ;a = Next byte in gbs file ROM0:3D90 03 inc bc ;bc ++ ROM0:3D91 77 ld (hl),a ROM0:3D92 18 CE jr 3D62 ;Loop to 0:3D62 ROM0:3D94 7B ld a,e ROM0:3D95 E6 07 and a,07 ROM0:3D97 5F ld e,a ROM0:3D98 C6 78 add a,78 ROM0:3D9A 6F ld l,a ROM0:3D9B 26 3B ld h,3B ROM0:3D9D 7E ld a,(hl) ROM0:3D9E 21 39 C4 ld hl,C439 ROM0:3DA1 B6 or (hl) ROM0:3DA2 77 ld (hl),a ROM0:3DA3 7B ld a,e ROM0:3DA4 87 add a ROM0:3DA5 87 add a ROM0:3DA6 C6 06 add a,06 ROM0:3DA8 6F ld l,a ROM0:3DA9 36 00 ld (hl),00 ROM0:3DAB 18 B5 jr 3D62 ROM0:3DAD 7B ld a,e ROM0:3DAE E6 07 and a,07 ROM0:3DB0 5F ld e,a ROM0:3DB1 C6 78 add a,78 ROM0:3DB3 6F ld l,a ROM0:3DB4 26 3B ld h,3B ROM0:3DB6 7E ld a,(hl) ROM0:3DB7 21 39 C4 ld hl,C439 ROM0:3DBA B6 or (hl) ROM0:3DBB 77 ld (hl),a ROM0:3DBC 7B ld a,e ROM0:3DBD 87 add a ROM0:3DBE 87 add a ROM0:3DBF C6 06 add a,06 ROM0:3DC1 6F ld l,a ROM0:3DC2 36 01 ld (hl),01 ROM0:3DC4 2C inc l ROM0:3DC5 2C inc l ROM0:3DC6 0A ld a,(bc) ROM0:3DC7 03 inc bc ROM0:3DC8 87 add a ROM0:3DC9 87 add a ROM0:3DCA 5F ld e,a ROM0:3DCB 16 36 ld d,36 ROM0:3DCD 1A ld a,(de) ROM0:3DCE 22 ldi (hl),a ROM0:3DCF 14 inc d ROM0:3DD0 1A ld a,(de) ROM0:3DD1 77 ld (hl),a ROM0:3DD2 18 8E jr 3D62 ROM0:3DD4 7B ld a,e ROM0:3DD5 FE F0 cp a,F0 ROM0:3DD7 28 0D jr z,3DE6 ROM0:3DD9 E6 F8 and a,F8 ROM0:3DDB FE C0 cp a,C0 ROM0:3DDD 28 1E jr z,3DFD ROM0:3DDF FE C8 cp a,C8 ROM0:3DE1 28 1E jr z,3E01 ROM0:3DE3 C3 62 3D jp 3D62 ROM0:3DE6 21 2E C4 ld hl,C42E ROM0:3DE9 79 ld a,c ROM0:3DEA 22 ldi (hl),a ROM0:3DEB 78 ld a,b ROM0:3DEC 22 ldi (hl),a ROM0:3DED FA 36 C4 ld a,(C436) ROM0:3DF0 22 ldi (hl),a ROM0:3DF1 FA 37 C4 ld a,(C437) ROM0:3DF4 77 ld (hl),a ROM0:3DF5 3E 01 ld a,01 ROM0:3DF7 EA 41 C4 ld (C441),a ;Music loop flag = 1 ROM0:3DFA C3 62 3D jp 3D62 ROM0:3DFD 03 inc bc ROM0:3DFE C3 62 3D jp 3D62 ROM0:3E01 03 inc bc ROM0:3E02 C3 62 3D jp 3D62 ROM0:3E05 FA 41 C4 ld a,(C441) ;Music loop flag ROM0:3E08 3D dec a ROM0:3E09 20 09 jr nz,3E14 ROM0:3E0B 21 2F C4 ld hl,C42F ROM0:3E0E 46 ld b,(hl) ROM0:3E0F 2B dec hl ROM0:3E10 4E ld c,(hl) ;bc = Beginning of the Music loop ROM0:3E11 C3 62 3D jp 3D62 ;Loop ROM0:3E14 FA 36 C4 ld a,(C436) ;ROM Bank - Low ROM0:3E17 EA 00 20 ld (2000),a ROM0:3E1A FA 37 C4 ld a,(C437) ;ROM Bank - High ROM0:3E1D EA 00 30 ld (3000),a ROM0:3E20 21 38 C4 ld hl,C438 ROM0:3E23 CB 86 res 0,(hl) ROM0:3E25 C3 7E 3E jp 3E7E ROM0:3E28 21 26 C4 ld hl,C426 ROM0:3E2B 71 ld (hl),c ROM0:3E2C 2C inc l ROM0:3E2D 70 ld (hl),b ;Stores current position in the GBS file in (C426) ROM0:3E2E 6F ld l,a ROM0:3E2F FA 3C C4 ld a,(C43C) ROM0:3E32 67 ld h,a ROM0:3E33 2A ldi a,(hl) ROM0:3E34 EA 00 C4 ld (C400),a ROM0:3E37 7E ld a,(hl) ROM0:3E38 EA 01 C4 ld (C401),a ROM0:3E3B FA 36 C4 ld a,(C436) ROM0:3E3E EA 00 20 ld (2000),a ;ROM Bank switch - Low ROM0:3E41 FA 37 C4 ld a,(C437) ROM0:3E44 EA 00 30 ld (3000),a ;ROM Bank switch - High ROM0:3E47 21 02 C4 ld hl,C402 ROM0:3E4A FA 3B C4 ld a,(C43B) ROM0:3E4D 86 add (hl) ROM0:3E4E 22 ldi (hl),a ROM0:3E4F 20 2D jr nz,3E7E ROM0:3E51 35 dec (hl) ROM0:3E52 20 2A jr nz,3E7E ROM0:3E54 FA 40 C4 ld a,(C440) ROM0:3E57 A7 and a ROM0:3E58 28 24 jr z,3E7E ROM0:3E5A 21 39 C4 ld hl,C439 ROM0:3E5D 36 0F ld (hl),0F ROM0:3E5F FA 3D C4 ld a,(C43D) ROM0:3E62 D6 11 sub a,11 ROM0:3E64 3C inc a ROM0:3E65 30 09 jr nc,3E70 ROM0:3E67 21 38 C4 ld hl,C438 ROM0:3E6A CB 86 res 0,(hl) ROM0:3E6C AF xor a ROM0:3E6D EA 40 C4 ld (C440),a ROM0:3E70 EA 3D C4 ld (C43D),a ROM0:3E73 21 3E C4 ld hl,C43E ROM0:3E76 2A ldi a,(hl) ROM0:3E77 EA 02 C4 ld (C402),a ROM0:3E7A 7E ld a,(hl) ROM0:3E7B EA 03 C4 ld (C403),a ROM0:3E7E 21 38 C4 ld hl,C438 ROM0:3E81 CB 4E bit 1,(hl) ROM0:3E83 CA 19 3F jp z,3F19 ROM0:3E86 21 04 C4 ld hl,C404 ROM0:3E89 FA 3B C4 ld a,(C43B) ROM0:3E8C 86 add (hl) ROM0:3E8D 22 ldi (hl),a ROM0:3E8E C2 19 3F jp nz,3F19 ROM0:3E91 FA 00 40 ld a,(4000) ROM0:3E94 EA 36 C4 ld (C436),a ROM0:3E97 FA 01 40 ld a,(4001) ROM0:3E9A EA 37 C4 ld (C437),a ROM0:3E9D 21 35 C4 ld hl,C435 ROM0:3EA0 3A ldd a,(hl) ROM0:3EA1 EA 00 30 ld (3000),a ROM0:3EA4 3A ldd a,(hl) ROM0:3EA5 EA 00 20 ld (2000),a ROM0:3EA8 3A ldd a,(hl) ROM0:3EA9 6E ld l,(hl) ROM0:3EAA 67 ld h,a ROM0:3EAB 7E ld a,(hl) ROM0:3EAC 23 inc hl ROM0:3EAD 4F ld c,a ROM0:3EAE 87 add a ROM0:3EAF DA FA 3E jp c,3EFA ROM0:3EB2 28 1B jr z,3ECF ROM0:3EB4 FE FE cp a,FE ROM0:3EB6 28 04 jr z,3EBC ROM0:3EB8 2A ldi a,(hl) ROM0:3EB9 E2 ld (ff00+c),a ROM0:3EBA 18 EF jr 3EAB ROM0:3EBC 3E 00 ld a,00 ROM0:3EBE E0 1A ld (ff00+1A),a ROM0:3EC0 01 30 10 ld bc,1030 ROM0:3EC3 2A ldi a,(hl) ROM0:3EC4 E2 ld (ff00+c),a ROM0:3EC5 0C inc c ROM0:3EC6 05 dec b ROM0:3EC7 20 FA jr nz,3EC3 ROM0:3EC9 3E 80 ld a,80 ROM0:3ECB E0 1A ld (ff00+1A),a ROM0:3ECD 18 DC jr 3EAB ROM0:3ECF 21 3A C4 ld hl,C43A ROM0:3ED2 7E ld a,(hl) ROM0:3ED3 36 FF ld (hl),FF ROM0:3ED5 2F cpl ROM0:3ED6 21 39 C4 ld hl,C439 ROM0:3ED9 B6 or (hl) ROM0:3EDA 77 ld (hl),a ROM0:3EDB 21 32 C4 ld hl,C432 ROM0:3EDE 36 77 ld (hl),77 ROM0:3EE0 2C inc l ROM0:3EE1 36 3B ld (hl),3B ROM0:3EE3 2C inc l ROM0:3EE4 AF xor a ROM0:3EE5 22 ldi (hl),a ROM0:3EE6 77 ld (hl),a ROM0:3EE7 21 38 C4 ld hl,C438 ROM0:3EEA CB 8E res 1,(hl) ROM0:3EEC FA 36 C4 ld a,(C436) ROM0:3EEF EA 00 20 ld (2000),a ROM0:3EF2 FA 37 C4 ld a,(C437) ROM0:3EF5 EA 00 30 ld (3000),a ROM0:3EF8 18 1F jr 3F19 ROM0:3EFA 4D ld c,l ROM0:3EFB 44 ld b,h ROM0:3EFC 21 32 C4 ld hl,C432 ROM0:3EFF 71 ld (hl),c ROM0:3F00 2C inc l ROM0:3F01 70 ld (hl),b ROM0:3F02 21 3C C4 ld hl,C43C ROM0:3F05 CB 46 bit 0,(hl) ROM0:3F07 28 01 jr z,3F0A ROM0:3F09 87 add a ROM0:3F0A EA 04 C4 ld (C404),a ROM0:3F0D FA 36 C4 ld a,(C436) ROM0:3F10 EA 00 20 ld (2000),a ROM0:3F13 FA 37 C4 ld a,(C437) ROM0:3F16 EA 00 30 ld (3000),a ROM0:3F19 16 38 ld d,38 ROM0:3F1B 21 06 C4 ld hl,C406 ROM0:3F1E 0E 12 ld c,12 ROM0:3F20 FA 39 C4 ld a,(C439) ROM0:3F23 47 ld b,a ROM0:3F24 FA 3A C4 ld a,(C43A) ROM0:3F27 A0 and b ROM0:3F28 47 ld b,a ROM0:3F29 CB 38 srl b ROM0:3F2B 30 48 jr nc,3F75 ROM0:3F2D CB 46 bit 0,(hl) ROM0:3F2F 28 2D jr z,3F5E ROM0:3F31 2C inc l ROM0:3F32 FA 3D C4 ld a,(C43D) ROM0:3F35 B6 or (hl) ROM0:3F36 2C inc l ROM0:3F37 5F ld e,a ROM0:3F38 79 ld a,c ROM0:3F39 FE 1C cp a,1C ROM0:3F3B 38 14 jr c,3F51 ROM0:3F3D 20 10 jr nz,3F4F ROM0:3F3F 1A ld a,(de) ROM0:3F40 2F cpl ROM0:3F41 C6 40 add a,40 ROM0:3F43 0F rrca ROM0:3F44 E2 ld (ff00+c),a ROM0:3F45 0C inc c ROM0:3F46 2A ldi a,(hl) ROM0:3F47 E2 ld (ff00+c),a ROM0:3F48 0C inc c ROM0:3F49 2A ldi a,(hl) ROM0:3F4A E6 7F and a,7F ROM0:3F4C E2 ld (ff00+c),a ROM0:3F4D 18 0A jr 3F59 ROM0:3F4F 0E 21 ld c,21 ROM0:3F51 1A ld a,(de) ROM0:3F52 E2 ld (ff00+c),a ROM0:3F53 0C inc c ROM0:3F54 2A ldi a,(hl) ROM0:3F55 E2 ld (ff00+c),a ROM0:3F56 0C inc c ROM0:3F57 2A ldi a,(hl) ROM0:3F58 E2 ld (ff00+c),a ROM0:3F59 0C inc c ROM0:3F5A 0C inc c ROM0:3F5B 0C inc c ROM0:3F5C 18 CB jr 3F29 ROM0:3F5E 79 ld a,c ROM0:3F5F FE 22 cp a,22 ROM0:3F61 38 02 jr c,3F65 ROM0:3F63 0E 21 ld c,21 ROM0:3F65 AF xor a ROM0:3F66 E2 ld (ff00+c),a ROM0:3F67 0C inc c ROM0:3F68 0C inc c ROM0:3F69 3E 80 ld a,80 ROM0:3F6B E2 ld (ff00+c),a ROM0:3F6C 0C inc c ROM0:3F6D 0C inc c ROM0:3F6E 0C inc c ROM0:3F6F 2C inc l ROM0:3F70 2C inc l ROM0:3F71 2C inc l ROM0:3F72 2C inc l ROM0:3F73 18 B4 jr 3F29 ROM0:3F75 28 0A jr z,3F81 ROM0:3F77 2C inc l ROM0:3F78 2C inc l ROM0:3F79 2C inc l ROM0:3F7A 2C inc l ROM0:3F7B 79 ld a,c ROM0:3F7C C6 05 add a,05 ROM0:3F7E 4F ld c,a ROM0:3F7F 18 A8 jr 3F29 ROM0:3F81 AF xor a ROM0:3F82 EA 39 C4 ld (C439),a ROM0:3F85 FA 38 C4 ld a,(C438) ROM0:3F88 B7 or a ROM0:3F89 20 09 jr nz,3F94 ROM0:3F8B E0 07 ld (ff00+07),a ROM0:3F8D 21 FF FF ld hl,FFFF ROM0:3F90 CB 96 res 2,(hl) ROM0:3F92 18 19 jr 3FAD ROM0:3F94 21 00 C4 ld hl,C400 ROM0:3F97 4E ld c,(hl) ROM0:3F98 2C inc l ROM0:3F99 2C inc l ROM0:3F9A 06 02 ld b,02 ROM0:3F9C 2A ldi a,(hl) ROM0:3F9D 2C inc l ROM0:3F9E B9 cp c ROM0:3F9F 38 01 jr c,3FA2 ROM0:3FA1 4F ld c,a ROM0:3FA2 05 dec b ROM0:3FA3 20 F7 jr nz,3F9C ROM0:3FA5 79 ld a,c ROM0:3FA6 E0 05 ld (ff00+05),a ROM0:3FA8 2F cpl ROM0:3FA9 3C inc a ROM0:3FAA EA 3B C4 ld (C43B),a ROM0:3FAD E1 pop hl ROM0:3FAE D1 pop de ROM0:3FAF C1 pop bc ROM0:3FB0 F1 pop af ROM0:3FB1 D9 reti
Bank 1
rst 08 pointers
ROM1:4002 71 4C - 62 52 - 61 54 - 61 53 - 92 52 - 46 53 - 9D 53 - FE 53 - AD 52 - C8 52 - 19 53 - F6 54 - 2D 55 - 1A 54 - C8 4F - 52 55 - 40 5A - 2B 5B - 1E 5B - 78 5A - A6 5A - 5C 5A - 60 5A - 63 5B - 3B 61 - 0E 61 - 44 75 - 09 65 - 72 75 - 40 74 - 8A 74 - D6 74 - 5A 74 - 76 74 - A2 74 - 1A 75 - F3 6F - D3 72 - 35 70 - 87 72 - 4E 70 - F4 70 - A0 70 - 54 71 - 0D 70 - 15 70 - 25 70 - 2D 70 - B2 71 - 47 72 - 66 6F - 4A 6F - 58 6F - 0A 7B - 1E 7B - 34 7B - A7 7C - C3 7C - 7B 7D - BD 7D - CB 7F - DF 7C - 96 76 - 61 66 - AC 6A - 8E 66 - A6 6A - B2 40 - FB 43 - 95 49 - 12 4A - 1D 4A - 2E 4A - 7C 4A - 9C 4A - 61 4A - DF 4A - Returns offset for selected card ID 41 4B - Display a monster ? BE 46 - Card parts initialization 38 47 - Stores the Construction part ID 7D 47 - DB 47 - 43 47 - 60 47 - F6 47 - 11 4C - 08 45 - 98 4B -
Construction mode
Card parts initialization
ROM1:46BE F5 push af ROM1:46BF C5 push bc ROM1:46C0 D5 push de ROM1:46C1 E5 push hl ROM1:46C2 01 00 00 ld bc,0000 ROM1:46C5 11 8C 00 ld de,008C ;Construction parts 0 to 140 ROM1:46C8 3E 00 ld a,00 ROM1:46CA CD 38 47 call 4738 ;Stores the Construction part ID ROM1:46CD 3E 00 ld a,00 ;0 card parts ROM1:46CF CD BC 47 call 47BC ;Changes a card part quantity ROM1:46D2 79 ld a,c ROM1:46D3 C6 01 add a,01 ROM1:46D5 4F ld c,a ROM1:46D6 78 ld a,b ROM1:46D7 CE 00 adc a,00 ROM1:46D9 47 ld b,a ROM1:46DA CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:46DD FE 02 cp a,02 ROM1:46DF 20 1B jr nz,46FC ROM1:46E1 3E 00 ld a,00 ROM1:46E3 CD 38 47 call 4738 ;Stores the Construction part ID ROM1:46E6 3E 00 ld a,00 ;0 card parts ROM1:46E8 CD BC 47 call 47BC ;Changes a card part quantity ROM1:46EB 79 ld a,c ROM1:46EC C6 01 add a,01 ROM1:46EE 4F ld c,a ROM1:46EF 78 ld a,b ROM1:46F0 CE 00 adc a,00 ROM1:46F2 47 ld b,a ROM1:46F3 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:46F6 FE 02 cp a,02 ROM1:46F8 20 02 jr nz,46FC ;If(bc ≥ de) ,jump to 1:46FC ROM1:46FA 18 CC jr 46C8 ROM1:46FC 11 18 01 ld de,0118 ;Construction parts 141 to 280 ROM1:46FF 3E 01 ld a,01 ROM1:4701 CD 38 47 call 4738 ;Stores the Construction part ID ROM1:4704 3E 00 ld a,00 ;0 card parts ROM1:4706 CD BC 47 call 47BC ;Changes a card part quantity ROM1:4709 79 ld a,c ROM1:470A C6 01 add a,01 ROM1:470C 4F ld c,a ROM1:470D 78 ld a,b ROM1:470E CE 00 adc a,00 ROM1:4710 47 ld b,a ROM1:4711 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:4714 FE 02 cp a,02 ROM1:4716 20 1B jr nz,4733 ROM1:4718 3E 01 ld a,01 ROM1:471A CD 38 47 call 4738 ;Stores the Construction part ID ROM1:471D 3E 00 ld a,00 ROM1:471F CD BC 47 call 47BC ;Changes a card part quantity ROM1:4722 79 ld a,c ROM1:4723 C6 01 add a,01 ROM1:4725 4F ld c,a ROM1:4726 78 ld a,b ROM1:4727 CE 00 adc a,00 ROM1:4729 47 ld b,a ROM1:472A CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:472D FE 02 cp a,02 ROM1:472F 20 02 jr nz,4733 ROM1:4731 18 CC jr 46FF ROM1:4733 E1 pop hl ROM1:4734 D1 pop de ROM1:4735 C1 pop bc ROM1:4736 F1 pop af ROM1:4737 C9 ret
Stores the Construction part ID
ROM1:4738 F5 push af ROM1:4739 79 ld a,c ROM1:473A EA BA C5 ld (C5BA),a ;Construction part ID = bc ROM1:473D 78 ld a,b ROM1:473E EA BB C5 ld (C5BB),a ROM1:4741 F1 pop af ROM1:4742 C9 ret
Changes a card part quantity
ROM1:47BC F5 push af ROM1:47BD C5 push bc ROM1:47BE D5 push de ROM1:47BF E5 push hl ROM1:47C0 57 ld d,a ROM1:47C1 3E 02 ld a,02 ROM1:47C3 CD 24 12 call 1224 ;Switches to WRAM Bank 2 ROM1:47C6 FA BA C5 ld a,(C5BA) ;Construction part ID ROM1:47C9 4F ld c,a ROM1:47CA FA BB C5 ld a,(C5BB) ROM1:47CD 47 ld b,a ROM1:47CE 21 E8 D3 ld hl,D3E8 ROM1:47D1 09 add hl,bc ;WRAM address of the card part ROM1:47D2 72 ld (hl),d ;Writes the new card part quantity to (2:C5BA + offset) ROM1:47D3 CD 48 12 call 1248 ;WRAM Bank restore ROM1:47D6 E1 pop hl ROM1:47D7 D1 pop de ROM1:47D8 C1 pop bc ROM1:47D9 F1 pop af ROM1:47DA C9 ret
1:4A12
ROM1:4A12 F5 push af ROM1:4A13 79 ld a,c ROM1:4A14 EA BC C5 ld (C5BC),a ROM1:4A17 78 ld a,b ROM1:4A18 EA BD C5 ld (C5BD),a ROM1:4A1B F1 pop af ROM1:4A1C C9 ret ROM1:4A1D F5 push af ROM1:4A1E C5 push bc ROM1:4A1F FA BC C5 ld a,(C5BC) ROM1:4A22 FE C8 cp a,C8 ROM1:4A24 30 05 jr nc,4A2B ROM1:4A26 C6 01 add a,01 ROM1:4A28 EA BC C5 ld (C5BC),a ROM1:4A2B C1 pop bc ROM1:4A2C F1 pop af ROM1:4A2D C9 ret
1:4A2E
ROM1:4A2E F5 push af ROM1:4A2F C5 push bc ROM1:4A30 FA BC C5 ld a,(C5BC) ROM1:4A33 FE 00 cp a,00 ROM1:4A35 28 05 jr z,4A3C ROM1:4A37 D6 01 sub a,01 ROM1:4A39 EA BC C5 ld (C5BC),a ROM1:4A3C C1 pop bc ROM1:4A3D F1 pop af ROM1:4A3E C9 ret
1:4A3F
ROM1:4A3F F5 push af ROM1:4A40 E5 push hl ROM1:4A41 C5 push bc ROM1:4A42 FA BC C5 ld a,(C5BC) ROM1:4A45 4F ld c,a ROM1:4A46 FA BD C5 ld a,(C5BD) ROM1:4A49 47 ld b,a ROM1:4A4A CB 21 sla c ROM1:4A4C CB 10 rl b ROM1:4A4E 21 00 D5 ld hl,D500 ROM1:4A51 09 add hl,bc ROM1:4A52 C1 pop bc ROM1:4A53 3E 02 ld a,02 ROM1:4A55 CD 24 12 call 1224 ;Switches to WRAM Bank 2 ROM1:4A58 79 ld a,c ROM1:4A59 22 ldi (hl),a ROM1:4A5A 70 ld (hl),b ROM1:4A5B CD 48 12 call 1248 ;WRAM Bank restore ROM1:4A5E E1 pop hl ROM1:4A5F F1 pop af ROM1:4A60 C9 ret
1:4A61
ROM1:4A61 F5 push af ROM1:4A62 C5 push bc ROM1:4A63 E5 push hl ROM1:4A64 CD 92 52 call 5292 ROM1:4A67 CD AD 52 call 52AD ;Increase card quantity ROM1:4A6A 21 E0 FC ld hl,FCE0 ROM1:4A6D 09 add hl,bc ROM1:4A6E 44 ld b,h ROM1:4A6F 4D ld c,l ROM1:4A70 CD 12 4A call 4A12 ROM1:4A73 42 ld b,d ROM1:4A74 4B ld c,e ROM1:4A75 CD 3F 4A call 4A3F ROM1:4A78 E1 pop hl ROM1:4A79 C1 pop bc ROM1:4A7A F1 pop af ROM1:4A7B C9 ret
1:4A7C
ROM1:4A7C F5 push af ROM1:4A7D E5 push hl ROM1:4A7E FA BC C5 ld a,(C5BC) ROM1:4A81 4F ld c,a ROM1:4A82 FA BD C5 ld a,(C5BD) ROM1:4A85 47 ld b,a ROM1:4A86 CB 21 sla c ROM1:4A88 CB 10 rl b ROM1:4A8A 21 00 D5 ld hl,D500 ROM1:4A8D 09 add hl,bc ROM1:4A8E 3E 02 ld a,02 ROM1:4A90 CD 24 12 call 1224 ;Switches to WRAM Bank 2 ROM1:4A93 2A ldi a,(hl) ROM1:4A94 4F ld c,a ROM1:4A95 46 ld b,(hl) ROM1:4A96 CD 48 12 call 1248 ;WRAM Bank restore ROM1:4A99 E1 pop hl ROM1:4A9A F1 pop af ROM1:4A9B C9 ret
1:4A9C
ROM1:4A9C F5 push af ROM1:4A9D D5 push de ROM1:4A9E E5 push hl ROM1:4A9F 50 ld d,b ROM1:4AA0 59 ld e,c ROM1:4AA1 CD ED 1A call 1AED ;Checks position in Card Trunk ? ROM1:4AA4 FE 02 cp a,02 ROM1:4AA6 20 10 jr nz,4AB8 ROM1:4AA8 21 E0 FC ld hl,FCE0 ROM1:4AAB 09 add hl,bc ROM1:4AAC 44 ld b,h ROM1:4AAD 4D ld c,l ROM1:4AAE CD 12 4A call 4A12 ROM1:4AB1 CD 7C 4A call 4A7C ROM1:4AB4 50 ld d,b ROM1:4AB5 59 ld e,c ROM1:4AB6 18 08 jr 4AC0 ROM1:4AB8 7B ld a,e ROM1:4AB9 C6 01 add a,01 ROM1:4ABB 4F ld c,a ROM1:4ABC 7A ld a,d ROM1:4ABD CE 00 adc a,00 ROM1:4ABF 47 ld b,a ROM1:4AC0 E1 pop hl ROM1:4AC1 D1 pop de ROM1:4AC2 F1 pop af ROM1:4AC3 C9 ret
Returns offset for selected card ID
0x4ADF-0x4B02
- Returns Card ID - 1 if 0 < Card ID ≤ 800, or specific offset for Construction cards, or a = 0 if invalid Card ID or no Card ID
ROM1:4ADF D5 push de ROM1:4AE0 E5 push hl ROM1:4AE1 CD 84 1A call 1A84 ;Checks Card ID validity ROM1:4AE4 FE 00 cp a,00 ROM1:4AE6 20 04 jr nz,4AEC ;Impossible to fail, jump to 1:4AEC ROM1:4AE8 3E 00 ld a,00 ROM1:4AEA 18 14 jr 4B00 ROM1:4AEC FE 04 cp a,04 ROM1:4AEE 20 04 jr nz,4AF4 ;If Card ID ≠ 0, jump to 1:4AF4 ROM1:4AF0 3E 00 ld a,00 ROM1:4AF2 18 0C jr 4B00 ;Else a = 0, and get out of this function ROM1:4AF4 FE 01 cp a,01 ROM1:4AF6 20 05 jr nz,4AFD ;If Card ID > 800, jump to 1:4AFD ROM1:4AF8 CD 03 4B call 4B03 ;Decrements Card ID ROM1:4AFB 18 03 jr 4B00 ROM1:4AFD CD 0E 4B call 4B0E ;Construction cards handling ROM1:4B00 E1 pop hl ROM1:4B01 D1 pop de ROM0:4B02 C9 ret
Decrements Card ID (Card ID < 800)
0x4B02-0x4B0D
-
ROM1:4B03 79 ld a,c ROM1:4B04 D6 01 sub a,01 ROM1:4B06 4F ld c,a ROM1:4B07 78 ld a,b ROM1:4B08 DE 00 sbc a,00 ROM1:4B0A 47 ld b,a ;bc -- ROM1:4B0B 3E 01 ld a,01 ;a = 1 ROM0:4B0D C9 ret
1:4B0E (Construction Card)
0x4B0E-0x4B40
-
ROM1:4B0E D5 push de ROM1:4B0F E5 push hl ROM1:4B10 50 ld d,b ROM1:4B11 59 ld e,c ;de = Card ID ROM1:4B12 2E 00 ld l,00 ROM1:4B14 01 20 03 ld bc,0320 ;bc = 800 ROM1:4B17 C5 push bc ROM1:4B18 CD 9C 4A call 4A9C ROM1:4B1B CD 14 1B call 1B14 ROM1:4B1E C1 pop bc ROM1:4B1F FE 00 cp a,00 ROM1:4B21 20 04 jr nz,4B27 ROM1:4B23 2E 01 ld l,01 ROM1:4B25 18 16 jr 4B3D ROM1:4B27 D5 push de ROM1:4B28 11 E8 03 ld de,03E8 ROM1:4B2B CD 14 1B call 1B14 ROM1:4B2E D1 pop de ROM1:4B2F FE 00 cp a,00 ROM1:4B31 28 0A jr z,4B3D ROM1:4B33 79 ld a,c ROM1:4B34 C6 01 add a,01 ROM1:4B36 4F ld c,a ROM1:4B37 78 ld a,b ROM1:4B38 CE 00 adc a,00 ROM1:4B3A 47 ld b,a ROM1:4B3B 18 DA jr 4B17 ROM1:4B3D 7D ld a,l ROM1:4B3E E1 pop hl ROM1:4B3F D1 pop de ROM0:4B40 C9 ret
1:4B41
ROM1:4B41 F5 push af ROM1:4B42 C5 push bc ROM1:4B43 D5 push de ROM1:4B44 79 ld a,c ROM1:4B45 EA BE C5 ld (C5BE),a ;Copy Card ID to (C5BE) ROM1:4B48 78 ld a,b ROM1:4B49 EA BF C5 ld (C5BF),a ROM1:4B4C CD 98 4B call 4B98 ROM1:4B4F EA C6 C5 ld (C5C6),a ROM1:4B52 CD 64 4B call 4B64 ROM1:4B55 79 ld a,c ROM1:4B56 EA C1 C5 ld (C5C1),a ROM1:4B59 7B ld a,e ROM1:4B5A EA C0 C5 ld (C5C0),a ROM1:4B5D CD B9 4B call 4BB9 ROM1:4B60 D1 pop de ROM1:4B61 C1 pop bc ROM1:4B62 F1 pop af ROM1:4B63 C9 ret
Deck Builder
1:501B
ROM1:501B F5 push af ROM1:501C C5 push bc ROM1:501D FA EC C5 ld a,(C5EC) ROM1:5020 4F ld c,a ROM1:5021 79 ld a,c ROM1:5022 FE 00 cp a,00 ROM1:5024 20 1A jr nz,5040 ROM1:5026 CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM1:5029 3E 01 ld a,01 ROM1:502B EA EC C5 ld (C5EC),a ROM1:502E 3E 00 ld a,00 ROM1:5030 EA EE C5 ld (C5EE),a ROM1:5033 3E 04 ld a,04 ROM1:5035 CD E3 0E call 0EE3 ;Manages display ? ROM1:5038 CD C4 51 call 51C4 ROM1:503B CD C1 10 call 10C1 ROM1:503E 18 03 jr 5043 ROM1:5040 CD 00 6C call 6C00 ROM1:5043 C1 pop bc ROM1:5044 F1 pop af ROM1:5045 C9 ret
1:5046
ROM1:5046 F5 push af ROM1:5047 CD 79 2A call 2A79 ;Sound Effect 0x06 ROM1:504A FA EC C5 ld a,(C5EC) ROM1:504D FE 01 cp a,01 ROM1:504F 20 05 jr nz,5056 ROM1:5051 3E 00 ld a,00 ROM1:5053 EA EC C5 ld (C5EC),a ROM1:5056 F1 pop af ROM1:5057 C9 ret
1:5058
ROM1:5058 F5 push af ROM1:5059 C5 push bc ROM1:505A FA EC C5 ld a,(C5EC) ROM1:505D FE 00 cp a,00 ROM1:505F 20 28 jr nz,5089 ROM1:5061 FA F1 C5 ld a,(C5F1) ROM1:5064 4F ld c,a ROM1:5065 FA F0 C5 ld a,(C5F0) ROM1:5068 B9 cp c ROM1:5069 20 10 jr nz,507B ROM1:506B FA EF C5 ld a,(C5EF) ROM1:506E 47 ld b,a ROM1:506F FA ED C5 ld a,(C5ED) ROM1:5072 B8 cp b ROM1:5073 28 04 jr z,5079 ROM1:5075 3C inc a ROM1:5076 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:5079 18 0B jr 5086 ROM1:507B FA ED C5 ld a,(C5ED) ROM1:507E FE 04 cp a,04 ROM1:5080 28 04 jr z,5086 ROM1:5082 3C inc a ROM1:5083 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:5086 EA ED C5 ld (C5ED),a ROM1:5089 FA EC C5 ld a,(C5EC) ROM1:508C FE 01 cp a,01 ROM1:508E 20 0E jr nz,509E ROM1:5090 FA EE C5 ld a,(C5EE) ROM1:5093 FE 00 cp a,00 ROM1:5095 20 04 jr nz,509B ROM1:5097 3C inc a ROM1:5098 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:509B EA EE C5 ld (C5EE),a ROM1:509E C1 pop bc ROM1:509F F1 pop af ROM1:50A0 C9 ret
1:50A1
ROM1:50A1 F5 push af ROM1:50A2 FA EC C5 ld a,(C5EC) ROM1:50A5 FE 00 cp a,00 ROM1:50A7 20 0E jr nz,50B7 ROM1:50A9 FA ED C5 ld a,(C5ED) ROM1:50AC FE 00 cp a,00 ROM1:50AE 28 04 jr z,50B4 ROM1:50B0 3D dec a ROM1:50B1 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:50B4 EA ED C5 ld (C5ED),a ROM1:50B7 FA EC C5 ld a,(C5EC) ROM1:50BA FE 01 cp a,01 ROM1:50BC 20 0E jr nz,50CC ROM1:50BE FA EE C5 ld a,(C5EE) ROM1:50C1 FE 01 cp a,01 ROM1:50C3 20 04 jr nz,50C9 ROM1:50C5 3D dec a ROM1:50C6 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:50C9 EA EE C5 ld (C5EE),a ROM1:50CC F1 pop af ROM1:50CD C9 ret
1:50CE
ROM1:50CE F5 push af ROM1:50CF C5 push bc ROM1:50D0 FA EC C5 ld a,(C5EC) ROM1:50D3 FE 00 cp a,00 ROM1:50D5 20 19 jr nz,50F0 ROM1:50D7 FA F1 C5 ld a,(C5F1) ROM1:50DA 4F ld c,a ROM1:50DB FA F0 C5 ld a,(C5F0) ROM1:50DE B9 cp c ROM1:50DF 20 05 jr nz,50E6 ROM1:50E1 FA F2 C5 ld a,(C5F2) ROM1:50E4 D6 01 sub a,01 ROM1:50E6 3C inc a ROM1:50E7 EA F0 C5 ld (C5F0),a ROM1:50EA CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:50ED CD BE 4C call 4CBE ROM1:50F0 C1 pop bc ROM1:50F1 F1 pop af ROM1:50F2 C9 ret
1:50F3
ROM1:50F3 F5 push af ROM1:50F4 C5 push bc ROM1:50F5 FA EC C5 ld a,(C5EC) ROM1:50F8 FE 00 cp a,00 ROM1:50FA 20 1E jr nz,511A ROM1:50FC FA F1 C5 ld a,(C5F1) ROM1:50FF 4F ld c,a ROM1:5100 FA F0 C5 ld a,(C5F0) ROM1:5103 B9 cp c ROM1:5104 20 05 jr nz,510B ROM1:5106 FA F2 C5 ld a,(C5F2) ROM1:5109 D6 14 sub a,14 ROM1:510B C6 14 add a,14 ROM1:510D B9 cp c ROM1:510E 38 01 jr c,5111 ROM1:5110 79 ld a,c ROM1:5111 EA F0 C5 ld (C5F0),a ROM1:5114 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:5117 CD BE 4C call 4CBE ROM1:511A C1 pop bc ROM1:511B F1 pop af ROM1:511C C9 ret
1:511D
ROM1:511D F5 push af ROM1:511E C5 push bc ROM1:511F FA EC C5 ld a,(C5EC) ROM1:5122 FE 00 cp a,00 ROM1:5124 20 19 jr nz,513F ROM1:5126 FA F2 C5 ld a,(C5F2) ROM1:5129 4F ld c,a ROM1:512A FA F0 C5 ld a,(C5F0) ROM1:512D B9 cp c ROM1:512E 20 05 jr nz,5135 ROM1:5130 FA F1 C5 ld a,(C5F1) ROM1:5133 C6 01 add a,01 ROM1:5135 3D dec a ROM1:5136 EA F0 C5 ld (C5F0),a ROM1:5139 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:513C CD BE 4C call 4CBE ROM1:513F C1 pop bc ROM1:5140 F1 pop af ROM1:5141 C9 ret
1:5142
ROM1:5142 F5 push af ROM1:5143 C5 push bc ROM1:5144 FA EC C5 ld a,(C5EC) ROM1:5147 FE 00 cp a,00 ROM1:5149 20 28 jr nz,5173 ROM1:514B FA F0 C5 ld a,(C5F0) ROM1:514E FE 00 cp a,00 ROM1:5150 20 05 jr nz,5157 ROM1:5152 FA F1 C5 ld a,(C5F1) ROM1:5155 18 13 jr 516A ROM1:5157 FA F2 C5 ld a,(C5F2) ROM1:515A C6 14 add a,14 ROM1:515C 4F ld c,a ROM1:515D FA F0 C5 ld a,(C5F0) ROM1:5160 B9 cp c ROM1:5161 38 04 jr c,5167 ROM1:5163 D6 14 sub a,14 ROM1:5165 18 03 jr 516A ROM1:5167 FA F2 C5 ld a,(C5F2) ROM1:516A EA F0 C5 ld (C5F0),a ROM1:516D CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:5170 CD BE 4C call 4CBE ROM1:5173 C1 pop bc ROM1:5174 F1 pop af ROM1:5175 C9 ret
1:5176
ROM1:5176 F5 push af ROM1:5177 C5 push bc ROM1:5178 E5 push hl ROM1:5179 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:517C 06 00 ld b,00 ROM1:517E FA F5 C5 ld a,(C5F5) ROM1:5181 4F ld c,a ROM1:5182 21 97 51 ld hl,5197 ROM1:5185 09 add hl,bc ROM1:5186 7E ld a,(hl) ROM1:5187 EA F5 C5 ld (C5F5),a ROM1:518A FA F2 C5 ld a,(C5F2) ROM1:518D EA F0 C5 ld (C5F0),a ROM1:5190 CD BE 4C call 4CBE ROM1:5193 E1 pop hl ROM1:5194 C1 pop bc ROM1:5195 F1 pop af ROM1:5196 C9 ret
1:519D
ROM1:519D F5 push af ROM1:519E C5 push bc ROM1:519F E5 push hl ROM1:51A0 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM1:51A3 06 00 ld b,00 ROM1:51A5 FA F5 C5 ld a,(C5F5) ROM1:51A8 4F ld c,a ROM1:51A9 21 BE 51 ld hl,51BE ROM1:51AC 09 add hl,bc ROM1:51AD 7E ld a,(hl) ROM1:51AE EA F5 C5 ld (C5F5),a ROM1:51B1 FA F2 C5 ld a,(C5F2) ROM1:51B4 EA F0 C5 ld (C5F0),a ROM1:51B7 CD BE 4C call 4CBE ROM1:51BA E1 pop hl ROM1:51BB C1 pop bc ROM1:51BC F1 pop af ROM1:51BD C9 ret
1:51C4
ROM1:51C4 F5 push af ROM1:51C5 C5 push bc ROM1:51C6 D5 push de ROM1:51C7 E5 push hl ROM1:51C8 FA EC C5 ld a,(C5EC) ROM1:51CB FE 00 cp a,00 ROM1:51CD 20 20 jr nz,51EF ROM1:51CF 0E 00 ld c,00 ROM1:51D1 3E FF ld a,FF ROM1:51D3 16 08 ld d,08 ROM1:51D5 CD EF 12 call 12EF ROM1:51D8 0E 01 ld c,01 ROM1:51DA 3E FF ld a,FF ROM1:51DC 16 08 ld d,08 ROM1:51DE CD EF 12 call 12EF ROM1:51E1 01 02 00 ld bc,0002 ROM1:51E4 FA ED C5 ld a,(C5ED) ROM1:51E7 CD 32 52 call 5232 ROM1:51EA 16 08 ld d,08 ROM1:51EC CD EF 12 call 12EF ROM1:51EF FA EC C5 ld a,(C5EC) ROM1:51F2 FE 01 cp a,01 ROM1:51F4 20 37 jr nz,522D ROM1:51F6 0E 00 ld c,00 ROM1:51F8 3E FF ld a,FF ROM1:51FA 16 08 ld d,08 ROM1:51FC CD EF 12 call 12EF ROM1:51FF 01 01 00 ld bc,0001 ROM1:5202 FA EE C5 ld a,(C5EE) ROM1:5205 FE 02 cp a,02 ROM1:5207 28 0C jr z,5215 ROM1:5209 C6 05 add a,05 ROM1:520B CD 32 52 call 5232 ROM1:520E 16 10 ld d,10 ROM1:5210 CD EF 12 call 12EF ROM1:5213 18 0A jr 521F ROM1:5215 3E 05 ld a,05 ROM1:5217 CD 32 52 call 5232 ROM1:521A 16 65 ld d,65 ROM1:521C CD EF 12 call 12EF ROM1:521F 01 02 01 ld bc,0102 ROM1:5222 FA ED C5 ld a,(C5ED) ROM1:5225 CD 32 52 call 5232 ROM1:5228 16 08 ld d,08 ROM1:522A CD EF 12 call 12EF ROM1:522D E1 pop hl ROM1:522E D1 pop de ROM1:522F C1 pop bc ROM1:5230 F1 pop af ROM1:5231 C9 ret
1:5232
ROM1:5232 C5 push bc ROM1:5233 E5 push hl ROM1:5234 06 00 ld b,00 ROM1:5236 4F ld c,a ROM1:5237 21 3F 52 ld hl,523F ROM1:523A 09 add hl,bc ROM1:523B 7E ld a,(hl) ROM1:523C E1 pop hl ROM1:523D C1 pop bc ROM1:523E C9 ret
1:523F (array)
ROM1:523F 28 38 48 58 68 78 88 98 A8
1:5248
ROM1:5248 F5 push af ROM1:5249 C5 push bc ROM1:524A D5 push de ROM1:524B E5 push hl ROM1:524C FA F0 C5 ld a,(C5F0) ROM1:524F 5F ld e,a ROM1:5250 06 05 ld b,05 ROM1:5252 CD 68 14 call 1468 ROM1:5255 7D ld a,l ROM1:5256 EA F3 C5 ld (C5F3),a ROM1:5259 7C ld a,h ROM1:525A EA F4 C5 ld (C5F4),a ROM1:525D E1 pop hl ROM1:525E D1 pop de ROM1:525F C1 pop bc ROM1:5260 F1 pop af ROM1:5261 C9 ret
Initialize Cards in trunk
0x5262-0x5291
- Initialize the cards owned to 0. Debug should give 200 copies of each card, but doesn't due to the accumulator being FF'd at1:5278
.
ROM1:5262 F5 push af ROM1:5263 C5 push bc ROM1:5264 E5 push hl ROM1:5265 CF rst 08 ... ROM1:5268 FE 00 cp a,00 ROM1:526A 20 04 jr nz,5270 ;If debug, jump to 1:5270 ROM1:526C 3E FF ld a,FF ;Normal: 0xFF ROM1:526E 18 02 jr 5272 ROM1:5270 3E C8 ld a,C8 ;Debug: 200 ROM1:5272 01 00 00 ld bc,0000 ROM1:5275 CD 92 52 call 5292 ROM1:5278 3E FF ld a,FF ;Change this instruction to activate this debug function ROM1:527A CD 27 53 call 5327 ;Writes card quantity in trunk ROM1:527D 03 inc bc ;Card ID ++ ROM1:527E CD ED 1A call 1AED ROM1:5281 FE 03 cp a,03 ROM1:5283 28 02 jr z,5287 ;If the entire trunk is initialized, jump to 1:5287 ROM1:5285 18 EE jr 5275 ;Else loop to 1:5275 ROM1:5287 AF xor a ROM1:5288 EA FC C5 ld (C5FC),a ROM1:528B EA FD C5 ld (C5FD),a ;Blanks (C5FC) ROM1:528E E1 pop hl ROM1:528F C1 pop bc ROM1:5290 F1 pop af ROM1:5291 C9 ret
(Try to) check if card ID is valid, store it to wC5FC
0x5292 - 0x52AC
- BUG: It only checks if the card ID is different from 1001, instead of making sure that the card ID is < 801.
ROM1:5292 F5 push af ROM1:5293 CD B8 1A call 1AB8 ;Checks position in Card Trunk ROM1:5296 FE 03 cp a,03 ROM1:5298 28 0A jr z,52A4 ;if(card_ID == 1001), jump to 1:52A4 ROM1:529A 79 ld a,c ROM1:529B EA FC C5 ld (C5FC),a ROM1:529E 78 ld a,b ROM1:529F EA FD C5 ld (C5FD),a ;Stores current Card ID to (C5FC) ROM1:52A2 18 07 jr 52AB ROM1:52A4 AF xor a ROM1:52A5 EA FC C5 ld (C5FC),a ROM1:52A8 EA FD C5 ld (C5FD),a ;Blanks (C5FC) ROM1:52AB F1 pop af ROM1:52AC C9 ret
Increase card quantity
ROM1:52AD F5 push af ROM1:52AE C5 push bc ROM1:52AF CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:52B2 FE FF cp a,FF ROM1:52B4 20 04 jr nz,52BA ;If card is registered, jump to 1:52BA ROM1:52B6 AF xor a ROM1:52B7 CD 27 53 call 5327 ;Writes 0x00 in trunk ROM1:52BA CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:52BD FE FA cp a,FA ROM1:52BF 28 04 jr z,52C5 ;If(quantity == 250), jump to 1:52C5 ROM1:52C1 3C inc a ;Else increase card quantity ROM1:52C2 CD 27 53 call 5327 ;Writes card quantity in trunk ROM1:52C5 C1 pop bc ROM1:52C6 F1 pop af ROM1:52C7 C9 ret
Decrease card quantity (deck)
ROM1:52C8 C5 push bc ROM1:52C9 D5 push de ROM1:52CA 16 00 ld d,00 ROM1:52CC CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:52CF FE 00 cp a,00 ROM1:52D1 20 04 jr nz,52D7 ;If(quantity ≠ 0), jump to 1:52FB ROM1:52D3 16 01 ld d,01 ;Error: can't decrease card not owned ROM1:52D5 18 0C jr 52E3 ROM1:52D7 FE FF cp a,FF ROM1:52D9 20 04 jr nz,52DF ;If card is registered, jump to 1:52FB ROM1:52DB 16 01 ld d,01 ;Error: can't decrease card not registered ROM1:52DD 18 04 jr 52E3 ROM1:52DF 3D dec a ;Decrease card quantity ROM1:52E0 CD 27 53 call 5327 ;Writes card quantity in trunk ROM1:52E3 7A ld a,d ROM1:52E4 D1 pop de ROM1:52E5 C1 pop bc ROM1:52E6 C9 ret
Decrease card quantity (trade)
ROM1:52E7 C5 push bc ROM1:52E8 D5 push de ROM1:52E9 16 00 ld d,00 ROM1:52EB CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:52EE FE 01 cp a,01 ROM1:52F0 20 09 jr nz,52FB ;If(quantity ≠ 1), jump to 1:52FB ROM1:52F2 3E FF ld a,FF ;Unregister card from trunk ROM1:52F4 CD 27 53 call 5327 ;Writes 0xFF in trunk ROM1:52F7 16 00 ld d,00 ROM1:52F9 18 0C jr 5307 ROM1:52FB FE FF cp a,FF ROM1:52FD 20 04 jr nz,5303 ;If card is registered, jump to 1:52FB ROM1:52FF 16 01 ld d,01 ;Error: can't decrease card not registered ROM1:5301 18 04 jr 5307 ROM1:5303 3D dec a ;Decrease card quantity ROM1:5304 CD 27 53 call 5327 ;Writes card quantity in trunk ROM1:5307 7A ld a,d ROM1:5308 D1 pop de ROM1:5309 C1 pop bc ROM1:530A C9 ret
Decrease card quantity (still registered)
ROM1:530B F5 push af ROM1:530C CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:530F FE FF cp a,FF ROM1:5311 28 04 jr z,5317 ;If card is not registered, jump to 1:5317 ROM1:5313 3D dec a ;Card quantity - 1 ROM1:5314 CD 27 53 call 5327 ;Writes card quantity in trunk ROM1:5317 F1 pop af ROM1:5318 C9 ret
Register a card (not owned)
ROM1:5319 F5 push af ROM1:531A CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:531D FE FF cp a,FF ROM1:531F 20 04 jr nz,5325 ;If card is registered, jump to 1:5325 ROM1:5321 AF xor a ;Card quantity = 0 ROM1:5322 CD 27 53 call 5327 ;Writes card quantity in trunk ROM1:5325 F1 pop af ROM1:5326 C9 ret
Writes card quantity in trunk
0x5327-0x5345
- Writes cards quantities in (2:D000
)
ROM1:5327 F5 push af ROM1:5328 C5 push bc ROM1:5329 D5 push de ROM1:532A E5 push hl ROM1:532B 57 ld d,a ROM1:532C 3E 02 ld a,02 ROM1:532E CD 24 12 call 1224 ;Switches to WRAM Bank 2 ROM1:5331 FA FC C5 ld a,(C5FC) ROM1:5334 4F ld c,a ROM1:5335 FA FD C5 ld a,(C5FD) ROM1:5338 47 ld b,a ROM1:5339 21 00 D0 ld hl,D000 ROM1:533C 09 add hl,bc ;hl = pointer to card quantity in trunk ROM1:533D 72 ld (hl),d ;Writes card quantity to 2:D000 + offset ROM1:533E CD 48 12 call 1248 ;WRAM Bank restore ROM1:5341 E1 pop hl ROM1:5342 D1 pop de ROM1:5343 C1 pop bc ROM1:5344 F1 pop af ROM1:5345 C9 ret
Loads card quantity in trunk
ROM1:5346 C5 push bc ROM1:5347 E5 push hl ROM1:5348 3E 02 ld a,02 ROM1:534A CD 24 12 call 1224 ;Switches to WRAM Bank 2 ROM1:534D FA FC C5 ld a,(C5FC) ROM1:5350 4F ld c,a ROM1:5351 FA FD C5 ld a,(C5FD) ROM1:5354 47 ld b,a ROM1:5355 21 00 D0 ld hl,D000 ROM1:5358 09 add hl,bc ;hl = pointer to card quantity in trunk ROM1:5359 4E ld c,(hl) ROM1:535A CD 48 12 call 1248 ;WRAM Bank restore ROM1:535D 79 ld a,c ;a = card quantity ROM1:535E E1 pop hl ROM1:535F C1 pop bc ROM1:5360 C9 ret
Add card in deck
ROM1:5361 C5 push bc ROM1:5362 D5 push de ROM1:5363 1E 01 ld e,01 ROM1:5365 FA FC C5 ld a,(C5FC) ROM1:5368 4F ld c,a ROM1:5369 FA FD C5 ld a,(C5FD) ROM1:536C 47 ld b,a ROM1:536D CD 9C 4A call 4A9C ROM1:5370 CD B3 54 call 54B3 ;Checks if the card is limited ROM1:5373 FE 00 cp a,00 ROM1:5375 20 04 jr nz,537B ;If the card is limited, jump to 1:537B ROM1:5377 16 03 ld d,03 ;Copies allowed: 3 ROM1:5379 18 02 jr 537D ROM1:537B 16 01 ld d,01 ;Copies allowed: 1 ROM1:537D CD 8D 5B call 5B8D ;Number of copies of the card in the deck ROM1:5380 BA cp d ROM1:5381 30 16 jr nc,5399 ;If(Card Quantity ≥ Card Limitation), get out of that function ROM1:5383 C5 push bc ROM1:5384 CD DA 5A call 5ADA ;Checks if the deck has 40 cards ROM1:5387 78 ld a,b ROM1:5388 C1 pop bc ROM1:5389 FE 00 cp a,00 ROM1:538B 20 0C jr nz,5399 ;If the deck has 40 cards, get out of that function ROM1:538D CD C8 52 call 52C8 ;Decrease card quantity in trunk ROM1:5390 FE 00 cp a,00 ROM1:5392 20 05 jr nz,5399 ROM1:5394 CD 8C 5A call 5A8C ROM1:5397 1E 00 ld e,00 ROM1:5399 7B ld a,e ROM1:539A D1 pop de ROM1:539B C1 pop bc ROM1:539C C9 ret
1:539D
ROM1:539D F5 push af ROM1:539E C5 push bc ROM1:539F CD DA 5A call 5ADA ;Checks if the deck has 40 cards ROM1:53A2 79 ld a,c ROM1:53A3 FE 01 cp a,01 ROM1:53A5 28 0F jr z,53B6 ROM1:53A7 CD 78 5A call 5A78 ROM1:53AA CD DF 4A call 4ADF ROM1:53AD CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:53B0 CD AD 52 call 52AD ;Increase card quantity ROM1:53B3 CD A6 5A call 5AA6 ROM1:53B6 C1 pop bc ROM1:53B7 F1 pop af ROM1:53B8 C9 ret
1:53B9
ROM1:53B9 F5 push af ROM1:53BA C5 push bc ROM1:53BB CD DA 5A call 5ADA ;Checks if the deck has 40 cards ROM1:53BE 79 ld a,c ROM1:53BF FE 00 cp a,00 ROM1:53C1 28 0F jr z,53D2 ROM1:53C3 CD 78 5A call 5A78 ROM1:53C6 CD DF 4A call 4ADF ROM1:53C9 CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:53CC CD AD 52 call 52AD ;Increase card quantity ROM1:53CF CD A6 5A call 5AA6 ROM1:53D2 C1 pop bc ROM1:53D3 F1 pop af ROM1:53D4 C9 ret
1:53D5
ROM1:53D5 C5 push bc ROM1:53D6 D5 push de ROM1:53D7 1E 01 ld e,01 ROM1:53D9 FA FC C5 ld a,(C5FC) ROM1:53DC 4F ld c,a ROM1:53DD FA FD C5 ld a,(C5FD) ROM1:53E0 47 ld b,a ROM1:53E1 CD 9C 4A call 4A9C ROM1:53E4 C5 push bc ROM1:53E5 CD D6 74 call 74D6 ROM1:53E8 78 ld a,b ROM1:53E9 C1 pop bc ROM1:53EA FE 00 cp a,00 ROM1:53EC 20 0C jr nz,53FA ROM1:53EE CD C8 52 call 52C8 ROM1:53F1 FE 00 cp a,00 ROM1:53F3 20 05 jr nz,53FA ROM1:53F5 CD 8A 74 call 748A ROM1:53F8 1E 00 ld e,00 ROM1:53FA 7B ld a,e ROM1:53FB D1 pop de ROM1:53FC C1 pop bc ROM1:53FD C9 ret
1:53FE
ROM1:53FE F5 push af ROM1:53FF C5 push bc ROM1:5400 CD D6 74 call 74D6 ROM1:5403 79 ld a,c ROM1:5404 FE 00 cp a,00 ROM1:5406 28 0F jr z,5417 ROM1:5408 CD 76 74 call 7476 ROM1:540B CD DF 4A call 4ADF ROM1:540E CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:5411 CD AD 52 call 52AD ;Increase card quantity ROM1:5414 CD A2 74 call 74A2 ROM1:5417 C1 pop bc ROM1:5418 F1 pop af ROM1:5419 C9 ret
1:541A
ROM1:541A C5 push bc ROM1:541B D5 push de ROM1:541C FA FC C5 ld a,(C5FC) ROM1:541F 4F ld c,a ROM1:5420 FA FD C5 ld a,(C5FD) ROM1:5423 47 ld b,a ROM1:5424 CD 9C 4A call 4A9C ROM1:5427 CD 8D 5B call 5B8D ;Number of copies of the card in the deck ROM1:542A FE 00 cp a,00 ROM1:542C 28 04 jr z,5432 ROM1:542E 3E 01 ld a,01 ROM1:5430 18 2C jr 545E ROM1:5432 1E 01 ld e,01 ROM1:5434 FA FC C5 ld a,(C5FC) ROM1:5437 4F ld c,a ROM1:5438 FA FD C5 ld a,(C5FD) ROM1:543B 47 ld b,a ROM1:543C CD E7 52 call 52E7 ;Decrease card quantity ROM1:543F FE 00 cp a,00 ROM1:5441 20 1A jr nz,545D ROM1:5443 CD 9C 4A call 4A9C ROM1:5446 CD 41 4B call 4B41 ROM1:5449 FA C1 C5 ld a,(C5C1) ROM1:544C CD 43 47 call 4743 ROM1:544F CD F6 47 call 47F6 ROM1:5452 FA C0 C5 ld a,(C5C0) ROM1:5455 CD 60 47 call 4760 ROM1:5458 CD F6 47 call 47F6 ROM1:545B 1E 00 ld e,00 ROM1:545D 7B ld a,e ROM1:545E D1 pop de ROM1:545F C1 pop bc ROM1:5460 C9 ret
1:5461
ROM1:5461 F5 push af ROM1:5462 E5 push hl ROM1:5463 E8 FE add sp,FE ROM1:5465 F8 00 ld hl,sp+00 ROM1:5467 AF xor a ROM1:5468 22 ldi (hl),a ROM1:5469 22 ldi (hl),a ROM1:546A 22 ldi (hl),a ROM1:546B 01 00 00 ld bc,0000 ROM1:546E CF rst 08 ROM1:546F 03 inc bc ROM1:5470 07 rlca ROM1:5471 FA BB C6 ld a,(C6BB) ROM1:5474 FE 14 cp a,14 ROM1:5476 30 23 jr nc,549B ROM1:5478 CF rst 08 ROM1:5479 3D dec a ROM1:547A 05 dec b ROM1:547B 5F ld e,a ROM1:547C FA BC C6 ld a,(C6BC) ROM1:547F BB cp e ROM1:5480 28 02 jr z,5484 ROM1:5482 30 17 jr nc,549B ROM1:5484 CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:5487 CD 46 53 call 5346 ;Loads card quantity in Card Trunk ROM1:548A FE FF cp a,FF ROM1:548C 20 01 jr nz,548F ROM1:548E AF xor a ROM1:548F F8 00 ld hl,sp+00 ROM1:5491 86 add (hl) ROM1:5492 22 ldi (hl),a ROM1:5493 3E 00 ld a,00 ROM1:5495 8E adc (hl) ROM1:5496 22 ldi (hl),a ROM1:5497 3E 00 ld a,00 ROM1:5499 8E adc (hl) ROM1:549A 77 ld (hl),a ROM1:549B 03 inc bc ROM1:549C 11 20 03 ld de,0320 ROM1:549F CD 14 1B call 1B14 ROM1:54A2 FE 00 cp a,00 ROM1:54A4 20 C8 jr nz,546E ROM1:54A6 F8 00 ld hl,sp+00 ROM1:54A8 2A ldi a,(hl) ROM1:54A9 5F ld e,a ROM1:54AA 2A ldi a,(hl) ROM1:54AB 4F ld c,a ROM1:54AC 2A ldi a,(hl) ROM1:54AD 47 ld b,a ROM1:54AE E8 02 add sp,02 ROM1:54B0 E1 pop hl ROM1:54B1 F1 pop af ROM1:54B2 C9 ret
Checks if the card is limited
0x54B3-0x54DB
- Checks if the specified card is limited
ROM1:54B3 C5 push bc ROM1:54B4 D5 push de ROM1:54B5 E5 push hl ROM1:54B6 50 ld d,b ROM1:54B7 59 ld e,c ;de = Card ID being checked ROM1:54B8 21 DC 54 ld hl,54DC ;hl = Pointer to limited cards array ROM1:54BB 2A ldi a,(hl) ROM1:54BC 4F ld c,a ROM1:54BD 2A ldi a,(hl) ROM1:54BE 47 ld b,a ;bc = Limited card ID ROM1:54BF CD 72 1A call 1A72 ;Checks if a card is being processed ROM1:54C2 FE 01 cp a,01 ROM1:54C4 20 04 jr nz,54CA ROM1:54C6 0E 00 ld c,00 ROM1:54C8 18 0D jr 54D7 ;If there's no card processed, get out of this function ROM1:54CA CD 14 1B call 1B14 ;Checks if Card ID ≠ Limited Card ID ROM1:54CD FE 00 cp a,00 ROM1:54CF 20 04 jr nz,54D5 ;If(Card ID ≠ Limited Card ID), jump to 1:54D5 ROM1:54D1 0E 01 ld c,01 ROM1:54D3 18 02 jr 54D7 ROM1:54D5 18 E4 jr 54BB ;Loops to next card ID in Limited cards array ROM1:54D7 79 ld a,c ;If the card is limited, a = 1, else a = 0 ROM1:54D8 E1 pop hl ROM1:54D9 D1 pop de ROM1:54DA C1 pop bc ROM1:54DB C9 ret
Limited cards list
0x54DC-0x54F3
- Limited cards list
ROM1:54DC 11 00 Exodia part 12 00 Exodia part 13 00 Exodia part 14 00 Exodia part 15 00 Exodia the Forbidden One 50 01 Dark Hole 51 01 Raigeki 5C 01 Swords of Revealing Light 91 02 Megamorph 0D 03 Brain Control 10 03 Change of Heart 15 03 Pot of Greed 00 00 (end of array)
1:54F6
ROM1:54F6 F5 push af ROM1:54F7 D5 push de ROM1:54F8 E5 push hl ROM1:54F9 60 ld h,b ROM1:54FA 69 ld l,c ROM1:54FB 11 00 00 ld de,0000 ROM1:54FE CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:5501 FE 02 cp a,02 ROM1:5503 28 03 jr z,5508 ROM1:5505 01 00 00 ld bc,0000 ROM1:5508 CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:550B CD 46 53 call 5346 ;Loads card quantity in trunk ROM1:550E FE FF cp a,FF ROM1:5510 28 04 jr z,5516 ;If card not registered, jump to 1:5516 ROM1:5512 FE 00 cp a,00 ROM1:5514 20 13 jr nz,5529 ;If card not owned, jump to 1:5529 ROM1:5516 79 ld a,c ROM1:5517 C6 01 add a,01 ROM1:5519 4F ld c,a ROM1:551A 78 ld a,b ROM1:551B CE 00 adc a,00 ROM1:551D 47 ld b,a ROM1:551E 54 ld d,h ROM1:551F 5D ld e,l ROM1:5520 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:5523 FE 01 cp a,01 ROM1:5525 28 02 jr z,5529 ROM1:5527 18 D2 jr 54FB ROM1:5529 E1 pop hl ROM1:552A D1 pop de ROM1:552B F1 pop af ROM1:552C C9 ret
Stores position in deck
ROM1:5A5C EA 09 C6 ld (C609),a ;Current position -1 in Deck ROM1:5A5F C9 ret
Copy Starter deck
0x5A60-0x5A77
- Writes the starter deck from ROM0:255D
in WRAM0:C60A
when a new game is started
ROM1:5A60 F5 push af ROM1:5A61 C5 push bc ROM1:5A62 D5 push de ROM1:5A63 E5 push hl ROM1:5A64 16 00 ld d,00 ROM1:5A66 FA 09 C6 ld a,(C609) ROM1:5A69 5F ld e,a ROM1:5A6A CB 23 sla e ;Loads ((current deck count - 1) × 2) in register e ROM1:5A6C 21 0A C6 ld hl,C60A ROM1:5A6F 19 add hl,de ROM1:5A70 79 ld a,c ROM1:5A71 22 ldi (hl),a ROM1:5A72 70 ld (hl),b ;Writes card ID to ((C60A) + position offset) ROM1:5A73 E1 pop hl ROM1:5A74 D1 pop de ROM1:5A75 C1 pop bc ROM1:5A76 F1 pop af ROM1:5A77 C9 ret
Retrieves card from deck at position x
ROM1:5A78 F5 push af ROM1:5A79 E5 push hl ROM1:5A7A 06 00 ld b,00 ROM1:5A7C FA 09 C6 ld a,(C609) ;Current position -1 in Deck ROM1:5A7F 4F ld c,a ROM1:5A80 CB 21 sla c ROM1:5A82 21 0A C6 ld hl,C60A ROM1:5A85 09 add hl,bc ;hl = Pointer to Player's deck ROM1:5A86 2A ldi a,(hl) ROM1:5A87 46 ld b,(hl) ROM1:5A88 4F ld c,a ;bc = Card ID ROM1:5A89 E1 pop hl ROM1:5A8A F1 pop af ROM1:5A8B C9 ret
1:5A8C
ROM1:5A8C F5 push af ROM1:5A8D C5 push bc ROM1:5A8E D5 push de ROM1:5A8F 50 ld d,b ROM1:5A90 59 ld e,c ROM1:5A91 CD DA 5A call 5ADA ;Checks if the deck has 40 cards ROM1:5A94 78 ld a,b ROM1:5A95 FE 00 cp a,00 ROM1:5A97 20 09 jr nz,5AA2 ;If the deck has 40 cards, jump to 1:5AA2 ROM1:5A99 79 ld a,c ROM1:5A9A CD 5C 5A call 5A5C ROM1:5A9D 42 ld b,d ROM1:5A9E 4B ld c,e ROM1:5A9F CD 60 5A call 5A60 ROM1:5AA2 D1 pop de ROM1:5AA3 C1 pop bc ROM1:5AA4 F1 pop af ROM1:5AA5 C9 ret
1:5AA6
ROM1:5AA6 F5 push af ROM1:5AA7 C5 push bc ROM1:5AA8 D5 push de ROM1:5AA9 E5 push hl ROM1:5AAA FA 09 C6 ld a,(C609) ROM1:5AAD 6F ld l,a ROM1:5AAE 16 00 ld d,00 ROM1:5AB0 1E 00 ld e,00 ROM1:5AB2 7B ld a,e ROM1:5AB3 CD 5C 5A call 5A5C ROM1:5AB6 CD 78 5A call 5A78 ROM1:5AB9 7B ld a,e ROM1:5ABA BD cp l ROM1:5ABB 28 08 jr z,5AC5 ROM1:5ABD 7A ld a,d ROM1:5ABE CD 5C 5A call 5A5C ROM1:5AC1 CD 60 5A call 5A60 ROM1:5AC4 14 inc d ROM1:5AC5 1C inc e ROM1:5AC6 7B ld a,e ROM1:5AC7 FE 28 cp a,28 ROM1:5AC9 38 E7 jr c,5AB2 ROM1:5ACB 7A ld a,d ROM1:5ACC CD 5C 5A call 5A5C ROM1:5ACF 01 00 00 ld bc,0000 ROM1:5AD2 CD 60 5A call 5A60 ROM1:5AD5 E1 pop hl ROM1:5AD6 D1 pop de ROM1:5AD7 C1 pop bc ROM1:5AD8 F1 pop af ROM1:5AD9 C9 ret
Checks if the deck has 40 cards (push / pop)
ROM1:5ADA F5 push af ROM1:5ADB D5 push de ROM1:5ADC E5 push hl ROM1:5ADD 21 0A C6 ld hl,C60A ;hl = Pointer to Player's deck ROM1:5AE0 1E 00 ld e,00 ;e = card count ROM1:5AE2 2A ldi a,(hl) ROM1:5AE3 4F ld c,a ROM1:5AE4 2A ldi a,(hl) ROM1:5AE5 47 ld b,a ROM1:5AE6 CD 72 1A call 1A72 ;Checks if a card is being processed ROM1:5AE9 FE 01 cp a,01 ROM1:5AEB 28 06 jr z,5AF3 ;If no card is being processed, jump to 1:5AF3 ROM1:5AED 1C inc e ;card count ++ ROM1:5AEE 7B ld a,e ROM1:5AEF FE 28 cp a,28 ROM1:5AF1 38 EF jr c,5AE2 ;If(card count < 40), loop to 1:5AE2 ROM1:5AF3 06 00 ld b,00 ROM1:5AF5 4B ld c,e ROM1:5AF6 79 ld a,c ROM1:5AF7 FE 28 cp a,28 ROM1:5AF9 20 01 jr nz,5AFC ;If(card count < 40), b = 0 ROM1:5AFB 04 inc b ;Else b = 1 ROM1:5AFC E1 pop hl ROM1:5AFD D1 pop de ROM1:5AFE F1 pop af ROM1:5AFF C9 ret
Returns deck size
ROM1:5B00 C5 push bc ROM1:5B01 E5 push hl ROM1:5B02 21 0A C6 ld hl,C60A ;Pointer to Player's deck ROM1:5B05 0E 00 ld c,00 ;c = card count ROM1:5B07 2A ldi a,(hl) ;Checks if there's a card to check ROM1:5B08 FE 00 cp a,00 ROM1:5B0A 20 07 jr nz,5B13 ROM1:5B0C 2A ldi a,(hl) ROM1:5B0D FE 00 cp a,00 ROM1:5B0F 28 09 jr z,5B1A ;If(card ID == 0), there's no more card to check; jump to 1:5B1A ROM1:5B11 18 01 jr 5B14 ROM1:5B13 23 inc hl ROM1:5B14 0C inc c ;card count ++ ROM1:5B15 79 ld a,c ROM1:5B16 FE 28 cp a,28 ROM1:5B18 38 ED jr c,5B07 ;If(card count < 40), loop to 1:5B07 ROM1:5B1A 79 ld a,c ;a = card count ROM1:5B1B E1 pop hl ROM1:5B1C C1 pop bc ROM1:5B1D C9 ret
Checks if the deck has 40 cards
ROM1:5B1E CD 00 5B call 5B00 ;Returns deck size ROM1:5B21 FE 28 cp a,28 ROM1:5B23 20 03 jr nz,5B28 ROM1:5B25 AF xor a ROM1:5B26 18 02 jr 5B2A ;If the deck has 40 cards, a = 0 ROM1:5B28 3E 01 ld a,01 ;Else a = 1 ROM1:5B2A C9 ret
Deck Cost
ROM1:5B2B F5 push af ROM1:5B2C D5 push de ROM1:5B2D E5 push hl ROM1:5B2E CD 00 5B call 5B00 ;Returns deck size ROM1:5B31 57 ld d,a ;d = Deck size ROM1:5B32 1E 00 ld e,00 ROM1:5B34 01 00 00 ld bc,0000 ROM1:5B37 7B ld a,e ;Current position in deck = 0 ROM1:5B38 BA cp d ROM1:5B39 30 18 jr nc,5B53 ;If a > deck size, jump to 1:5B53 ROM1:5B3B C5 push bc ROM1:5B3C 7B ld a,e ROM1:5B3D CD 5C 5A call 5A5C ;Current position in deck = a ROM1:5B40 CD 78 5A call 5A78 ;Retrieves card ID from deck in that position ROM1:5B43 CF rst 08 ... ROM1:5B46 C1 pop bc ROM1:5B47 FA BC C6 ld a,(C6BC) ;Card Cost ROM1:5B4A 81 add c ;Add previous total ROM1:5B4B 4F ld c,a ROM1:5B4C 3E 00 ld a,00 ROM1:5B4E 88 adc b ;Store new total in bc ROM1:5B4F 47 ld b,a ROM1:5B50 1C inc e ;Current position in deck ++ ROM1:5B51 18 E4 jr 5B37 ;Loop to 1:5B37 ROM1:5B53 11 0F 27 ld de,270F ROM1:5B56 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM1:5B59 FE 00 cp a,00 ROM1:5B5B 20 02 jr nz,5B5F ;If Deck Cost ≤ 9999, get out of this function ROM1:5B5D 42 ld b,d ROM1:5B5E 4B ld c,e ;Else Deck Cost = 9999 ROM1:5B5F E1 pop hl ROM1:5B60 D1 pop de ROM1:5B61 F1 pop af ROM1:5B62 C9 ret
Checks if a specific card is present in the deck
ROM1:5B63 F5 push af ROM1:5B64 D5 push de ROM1:5B65 50 ld d,b ROM1:5B66 59 ld e,c ROM1:5B67 CD 00 5B call 5B00 ;Returns deck size ROM1:5B6A 3D dec a ROM1:5B6B 4F ld c,a ROM1:5B6C 06 00 ld b,00 ROM1:5B6E 79 ld a,c ROM1:5B6F FE FF cp a,FF ROM1:5B71 28 17 jr z,5B8A ;If the deck has been entirely checked, get out of this function ROM1:5B73 C5 push bc ROM1:5B74 79 ld a,c ROM1:5B75 CD 5C 5A call 5A5C ;Current position in deck = a ROM1:5B78 CD 78 5A call 5A78 ;Retrieves card ID from deck in that position ROM1:5B7B CD 14 1B call 1B14 ;Checks if Card ID ≠ submitted ID ROM1:5B7E C1 pop bc ROM1:5B7F FE 00 cp a,00 ROM1:5B81 20 04 jr nz,5B87 ;If(Card ID ≠ submitted ID), jump to 1:5B87 ROM1:5B83 06 01 ld b,01 ROM1:5B85 18 03 jr 5B8A ;Else b = 1, and get out of this function ROM1:5B87 0D dec c ;Deck size -- ROM1:5B88 18 E4 jr 5B6E ;Loop to 1:5B6E ROM1:5B8A D1 pop de ROM1:5B8B F1 pop af ROM1:5B8C C9 ret
Number of copies of a card in the deck
ROM1:5B8D C5 push bc ROM1:5B8E D5 push de ROM1:5B8F E5 push hl ROM1:5B90 50 ld d,b ROM1:5B91 59 ld e,c ROM1:5B92 CD 00 5B call 5B00 ;Returns deck size ROM1:5B95 47 ld b,a ROM1:5B96 0E 00 ld c,00 ROM1:5B98 2E 00 ld l,00 ROM1:5B9A 79 ld a,c ;a = position in the deck ROM1:5B9B B8 cp b ROM1:5B9C 30 14 jr nc,5BB2 ;If every card of the deck has been checked, jump to 1:5BB2 ROM1:5B9E C5 push bc ROM1:5B9F 79 ld a,c ROM1:5BA0 CD 5C 5A call 5A5C ;Current position in deck = a ROM1:5BA3 CD 78 5A call 5A78 ;Retrieves card ID from deck in that position ROM1:5BA6 CD 14 1B call 1B14 ;Checks if Card ID == Specified card ID ROM1:5BA9 C1 pop bc ROM1:5BAA FE 00 cp a,00 ROM1:5BAC 20 01 jr nz,5BAF ;If(Card ID ≠ Specified card ID), jump to 1:5BAF ROM1:5BAE 2C inc l ;Else l ++ ROM1:5BAF 0C inc c ;Loop to 1:5B9A ROM1:5BB0 18 E8 jr 5B9A ROM1:5BB2 7D ld a,l ;a = Number of copies of the specified card ROM1:5BB3 E1 pop hl ROM1:5BB4 D1 pop de ROM1:5BB5 C1 pop bc ROM1:5BB6 C9 ret
Versus mode
Checks communication errors
ROM1:660D C5 push bc ROM1:660E 0E 00 ld c,00 ROM1:6610 CD 1E 5B call 5B1E ROM1:6613 FE 00 cp a,00 ROM1:6615 20 1D jr nz,6634 ROM1:6617 CF rst 08 ROM1:6618 4B ld c,e ROM1:6619 05 dec b ROM1:661A FE 01 cp a,01 ROM1:661C 20 04 jr nz,6622 ROM1:661E 0E 02 ld c,02 ROM1:6620 18 10 jr 6632 ROM1:6622 FA B1 C7 ld a,(C7B1) ;Current Menu ID ROM1:6625 FE 02 cp a,02 ROM1:6627 20 09 jr nz,6632 ;If(Menu ID ≠ Versus), jump to 1:6632 ROM1:6629 CD 59 03 call 0359 ;Checks Game link status ROM1:662C FE 00 cp a,00 ROM1:662E 28 02 jr z,6632 ;If there's no communication error, jump to 1:6632 ROM1:6630 0E 03 ld c,03 ;Else c = 3 ROM1:6632 18 02 jr 6636 ROM1:6634 0E 01 ld c,01 ROM1:6636 79 ld a,c ;a = c ROM1:6637 C1 pop bc ROM1:6638 C9 ret
Duelist Level check
ROM1:6DCE F5 push af ROM1:6DCF C5 push bc ROM1:6DD0 D5 push de ROM1:6DD1 E5 push hl ROM1:6DD2 CD D1 6E call 6ED1 ROM1:6DD5 CF rst 08 ... ROM1:6DD8 CD 9C 4A call 4A9C ROM1:6DDB CF rst 08 ... ROM1:6DDE CF rst 08 ... ROM1:6DE1 5F ld e,a ;e = Duelist Level ROM1:6DE2 FA BC C6 ld a,(C6BC) ;a = Card Cost ROM1:6DE5 BB cp e ROM1:6DE6 28 0E jr z,6DF6 ROM1:6DE8 38 0C jr c,6DF6 ;if(Card Cost ≤ Duelist Level), jump to 1:6DF6 ROM1:6DEA CD 91 2A call 2A91 ;Sound Effect: Invalid ROM1:6DED AF xor a ROM1:6DEE EA EC C5 ld (C5EC),a ;wC5EC = 0 ROM1:6DF1 EA EE C5 ld (C5EE),a ;wC5EE = 0 ROM1:6DF4 18 21 jr 6E17 ROM1:6DF6 CD DF 4A call 4ADF ;Checks Card ID validity, and decrements Card ID ROM1:6DF9 CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:6DFC CD 61 53 call 5361 ROM1:6DFF FE 00 cp a,00 ROM1:6E01 28 0E jr z,6E11 ROM1:6E03 CD 91 2A call 2A91 ;Sound Effect: Invalid ROM1:6E06 AF xor a ROM1:6E07 EA EC C5 ld (C5EC),a ROM1:6E0A EA EE C5 ld (C5EE),a ROM1:6E0D 18 08 jr 6E17 ROM1:6E0F 18 06 jr 6E17 ROM1:6E11 CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM1:6E14 CD E6 6E call 6EE6 ROM1:6E17 E1 pop hl ROM1:6E18 D1 pop de ROM1:6E19 C1 pop bc ROM1:6E1A F1 pop af ROM1:6E1B C9 ret
1:6E1C
ROM1:6E1C F5 push af ROM1:6E1D C5 push bc ROM1:6E1E D5 push de ROM1:6E1F E5 push hl ROM1:6E20 CD D1 6E call 6ED1 ROM1:6E23 CF rst 08 ... ROM1:6E26 CD 4C 6E call 6E4C ROM1:6E29 FE 00 cp a,00 ROM1:6E2B 20 14 jr nz,6E41 ROM1:6E2D CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:6E30 CD D5 53 call 53D5 ROM1:6E33 FE 00 cp a,00 ROM1:6E35 20 05 jr nz,6E3C ROM1:6E37 CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM1:6E3A 18 03 jr 6E3F ROM1:6E3C CD 91 2A call 2A91 ;Sound Effect: Invalid ROM1:6E3F 18 03 jr 6E44 ROM1:6E41 CD 91 2A call 2A91 ;Sound Effect: Invalid ROM1:6E44 CD E6 6E call 6EE6 ROM1:6E47 E1 pop hl ROM1:6E48 D1 pop de ROM1:6E49 C1 pop bc ROM1:6E4A F1 pop af ROM1:6E4B C9 ret
1:6E4C
ROM1:6E4C C5 push bc ROM1:6E4D D5 push de ROM1:6E4E E5 push hl ROM1:6E4F FA F1 C5 ld a,(C5F1) ROM1:6E52 FE 8F cp a,8F ROM1:6E54 28 03 jr z,6E59 ROM1:6E56 AF xor a ROM1:6E57 18 22 jr 6E7B ROM1:6E59 50 ld d,b ROM1:6E5A 59 ld e,c ROM1:6E5B 21 7F 6E ld hl,6E7F ;Ritual Monsters IDs array at 1:6E7F ROM1:6E5E 2A ldi a,(hl) ROM1:6E5F 4F ld c,a ROM1:6E60 2A ldi a,(hl) ROM1:6E61 47 ld b,a ROM1:6E62 CD 72 1A call 1A72 ;Checks if a card is being processed ROM1:6E65 FE 01 cp a,01 ROM1:6E67 20 04 jr nz,6E6D ROM1:6E69 0E 00 ld c,00 ROM1:6E6B 18 0D jr 6E7A ROM1:6E6D CD 14 1B call 1B14 ;Checks if bc ≠ de ROM1:6E70 FE 00 cp a,00 ROM1:6E72 20 04 jr nz,6E78 ;If(bc ≠ de), jump to 1:6E78 ROM1:6E74 0E 01 ld c,01 ROM1:6E76 18 02 jr 6E7A ROM1:6E78 18 E4 jr 6E5E ;Loop to 1:6E5E ROM1:6E7A 79 ld a,c ROM1:6E7B E1 pop hl ROM1:6E7C D1 pop de ROM1:6E7D C1 pop bc ROM1:6E7E C9 ret
1:6E7F
0x6E7F-0x6EAA
- Ritual Monster IDs + Meteor Black Dragon
ROM1:6E7F 6B 01 67 01 63 01 6C 01 7B 01 75 01 BC 02 BD 02 BE 02 BF 02 C0 02 C1 02 C5 02 CF 02 C4 02 CA 02 CC 02 CB 02 C3 02 CE 02 CD 02 C8 02 00 00
1:6EAD
ROM1:6EAD F5 push af ROM1:6EAE C5 push bc ROM1:6EAF D5 push de ROM1:6EB0 E5 push hl ROM1:6EB1 CD D1 6E call 6ED1 ROM1:6EB4 CF rst 08 ROM1:6EB5 05 dec b ROM1:6EB6 13 inc de ROM1:6EB7 CD 92 52 call 5292 ;(Try to) check if card ID is valid, store it to wC5FC ROM1:6EBA CD 1A 54 call 541A ROM1:6EBD FE 00 cp a,00 ROM1:6EBF 20 05 jr nz,6EC6 ROM1:6EC1 CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM1:6EC4 18 03 jr 6EC9 ROM1:6EC6 CD 91 2A call 2A91 ;Sound Effect: Invalid ROM1:6EC9 CD E6 6E call 6EE6 ROM1:6ECC E1 pop hl ROM1:6ECD D1 pop de ROM1:6ECE C1 pop bc ROM1:6ECF F1 pop af ROM1:6ED0 C9 ret
1:6ED1
ROM1:6ED1 F5 push af ROM1:6ED2 FA ED C5 ld a,(C5ED) ROM1:6ED5 4F ld c,a ROM1:6ED6 CD 48 52 call 5248 ROM1:6ED9 FA F3 C5 ld a,(C5F3) ROM1:6EDC 81 add c ROM1:6EDD 4F ld c,a ROM1:6EDE FA F4 C5 ld a,(C5F4) ROM1:6EE1 CE 00 adc a,00 ROM1:6EE3 47 ld b,a ROM1:6EE4 F1 pop af ROM1:6EE5 C9 ret
1:6E7F
0x6E7F-0x6EAA
- Ritual Monster IDs + Meteor Black Dragon
6B 01 67 01 63 01 6C 01 7B 01 75 01 BC 02 BD 02 BE 02 BF 02 C0 02 C1 02 C5 02 CF 02 C4 02 CA 02 CC 02 CB 02 C3 02 CE 02 CD 02 C8 02
1:700D
0x700D-0x7034
-
ROM1:700D F5 push af ROM1:700E 3E 00 ld a,00 ROM1:7010 EA FE C6 ld (C6FE),a ROM1:7013 F1 pop af ROM1:7014 C9 ret ROM1:7015 F5 push af ROM1:7016 3E 01 ld a,01 ROM1:7018 EA FE C6 ld (C6FE),a ROM1:701B F1 pop af ROM1:701C C9 ret ROM1:701D F5 push af ROM1:701E 3E 02 ld a,02 ROM1:7020 EA FE C6 ld (C6FE),a ROM1:7023 F1 pop af ROM1:7024 C9 ret ROM1:7025 F5 push af ROM1:7026 3E 03 ld a,03 ROM1:7028 EA FE C6 ld (C6FE),a ROM1:702B F1 pop af ROM1:702C C9 ret ROM1:702D F5 push af ROM1:702E 3E 04 ld a,04 ROM1:7030 EA FE C6 ld (C6FE),a ROM1:7033 F1 pop af ROM1:7034 C9 ret
1:72D3
ROM1:72D3 F5 push af ROM1:72D4 79 ld a,c ROM1:72D5 FE 00 cp a,00 ROM1:72D7 20 04 jr nz,72DD ROM1:72D9 3E 05 ld a,05 ROM1:72DB 90 sub b ROM1:72DC 47 ld b,a ROM1:72DD 79 ld a,c ROM1:72DE FE 01 cp a,01 ROM1:72E0 20 04 jr nz,72E6 ROM1:72E2 3E 05 ld a,05 ROM1:72E4 90 sub b ROM1:72E5 47 ld b,a ROM1:72E6 F1 pop af ROM1:72E7 C9 ret
1:72E8
ROM1:72E8 F5 push af ROM1:72E9 C5 push bc ROM1:72EA E5 push hl ROM1:72EB CD 50 2C call 2C50 ROM1:72EE FE 00 cp a,00 ROM1:72F0 20 1B jr nz,730D ROM1:72F2 06 00 ld b,00 ROM1:72F4 FA 72 C9 ld a,(C972) ROM1:72F7 4F ld c,a ROM1:72F8 21 36 73 ld hl,7336 ROM1:72FB 09 add hl,bc ROM1:72FC 7E ld a,(hl) ROM1:72FD CF rst 08 ROM1:72FE 19 add hl,de ROM1:72FF 04 inc b ROM1:7300 CF rst 08 ROM1:7301 13 inc de ROM1:7302 03 inc bc ROM1:7303 3E 00 ld a,00 ROM1:7305 CF rst 08 ROM1:7306 1B dec de ROM1:7307 04 inc b ROM1:7308 CF rst 08 ROM1:7309 57 ld d,a ROM1:730A 03 inc bc ROM1:730B 18 19 jr 7326 ROM1:730D 06 00 ld b,00 ROM1:730F FA 72 C9 ld a,(C972) ROM1:7312 4F ld c,a ROM1:7313 21 3A 73 ld hl,733A ROM1:7316 09 add hl,bc ROM1:7317 7E ld a,(hl) ROM1:7318 CF rst 08 ROM1:7319 19 add hl,de ROM1:731A 04 inc b ROM1:731B CF rst 08 ROM1:731C 13 inc de ROM1:731D 03 inc bc ROM1:731E 3E 00 ld a,00 ROM1:7320 CF rst 08 ROM1:7321 1B dec de ROM1:7322 04 inc b ROM1:7323 CF rst 08 ROM1:7324 57 ld d,a ROM1:7325 03 inc bc ROM1:7326 FA 72 C9 ld a,(C972) ROM1:7329 B9 cp c ROM1:732A 28 03 jr z,732F ROM1:732C CD A1 2A call 2AA1 ROM1:732F CD 58 11 call 1158 ROM1:7332 E1 pop hl ROM1:7333 C1 pop bc ROM1:7334 F1 pop af ROM1:7335 C9 ret
Bank 2
Text display
Text display - Main
ROM2:4012 F5 push af ROM2:4013 E5 push hl ROM2:4014 CD 4D 40 call 404D ROM2:4017 CD 64 12 call 1264 ROM2:401A 21 2F 40 ld hl,402F ROM2:401D CD 82 12 call 1282 ROM2:4020 CD BD 12 call 12BD ;Blanks card illustration ROM2:4023 CF rst 08 ... ROM2:4026 CD 39 40 call 4039 ROM2:4029 CD 78 12 call 1278 ROM2:402C E1 pop hl ROM2:402D F1 pop af ROM2:402E C9 ret
2:4039
ROM2:4039 F5 push af ROM2:403A C5 push bc ROM2:403B FA F9 C6 ld a,(C6F9) ;Text pointer offset ROM2:403E 47 ld b,a ROM2:403F 0E 00 ld c,00 ROM2:4041 CF rst 08 ... ROM2:4044 CF rst 08 ... ROM2:4047 CD D8 12 call 12D8 ROM2:404A C1 pop bc ROM2:404B F1 pop af ROM2:404C C9 ret
2:406E
ROM2:406E C5 push bc ROM2:406F E5 push hl ROM2:4070 FA C8 C6 ld a,(C6C8) ROM2:4073 FE 01 cp a,01 ROM2:4075 20 08 jr nz,407F ROM2:4077 CD D4 40 call 40D4 ROM2:407A EA EF C6 ld (C6EF),a ROM2:407D 18 16 jr 4095 ROM2:407F CD 98 40 call 4098 ;Load text pointer ROM2:4082 EA EF C6 ld (C6EF),a ROM2:4085 CD C5 40 call 40C5 ROM2:4088 FE 00 cp a,00 ROM2:408A 20 09 jr nz,4095 ROM2:408C CD 55 40 call 4055 ROM2:408F CD D4 40 call 40D4 ROM2:4092 EA EF C6 ld (C6EF),a ROM2:4095 E1 pop hl ROM2:4096 C1 pop bc ROM2:4097 C9 ret
Load text pointer
ROM2:4098 C5 push bc ROM2:4099 E5 push hl ROM2:409A 06 00 ld b,00 ROM2:409C FA FA C6 ld a,(C6FA) ;a = text_ID ROM2:409F 4F ld c,a ROM2:40A0 CB 21 sla c ROM2:40A2 CB 10 rl b ROM2:40A4 21 E4 40 ld hl,40E4 ;hl = text_pointer_array ROM2:40A7 09 add hl,bc ;hl = text_pointer ROM2:40A8 2A ldi a,(hl) ROM2:40A9 66 ld h,(hl) ROM2:40AA 6F ld l,a ;hl = text_address ROM2:40AB FA F1 C6 ld a,(C6F1) ROM2:40AE 47 ld b,a ROM2:40AF FA F0 C6 ld a,(C6F0) ROM2:40B2 4F ld c,a ROM2:40B3 3C inc a ROM2:40B4 EA F0 C6 ld (C6F0),a ROM2:40B7 20 07 jr nz,40C0 ROM2:40B9 FA F1 C6 ld a,(C6F1) ROM2:40BC 3C inc a ROM2:40BD EA F1 C6 ld (C6F1),a ROM2:40C0 09 add hl,bc ROM2:40C1 7E ld a,(hl) ROM2:40C2 E1 pop hl ROM2:40C3 C1 pop bc ROM2:40C4 C9 ret
Text pointers
0x80E4-0x41F3
- Text pointers
F4 41 - 00 53 42 - 01 D9 42 - 02 35 43 - 03 92 43 - 04 13 44 - 05 D0 44 - 06 3B 45 - 07 C2 45 - 08 2F 46 - 09 8F 46 - 0A 16 47 - 0B 90 47 - 0C 37 48 - 0D D2 48 - 0E 50 49 - 0F D5 49 - 10 5D 4A - 11 E2 4A - 12 57 4B - 13 9D 4B - 14 22 4C - 15 62 4C - 16 AA 4C - 17 CA 4C - 18 02 4D - 19 41 4D - 1A 8A 4D - 1B AB 4D - 1C E5 4D - 1D 0B 4E - 1E 6A 4E - 1F A6 4E - 20 E0 4E - 21 20 4F - 22 64 4F - 23 C1 4F - 24 E6 4F - 25 47 50 - 26 8A 50 - 27 AE 50 - 28 F0 50 - 29 2A 51 - 2A 6C 51 - 2B AD 51 - 2C F6 51 - 2D 3A 52 - 2E 80 52 - 2F C4 52 - 30 05 53 - 31 43 53 - 32 73 53 - 33 AB 53 - 34 F5 53 - 35 46 54 - 36 A8 54 - 37 DC 54 - 38 02 55 - 39 24 55 - 3A 68 55 - 3B CF 55 - 3C 0B 56 - 3D 4C 56 - 3E 8A 56 - 3F BD 56 - 40 08 57 - 41 40 57 - 42 89 57 - 43 C3 57 - 44 25 58 - 45 67 58 - 46 AC 58 - 47 CA 58 - 48 0A 59 - 49 3B 59 - 4A 7A 59 - 4B BB 59 - 4C D6 59 - 4D F1 59 - 4E 35 5A - 4F 74 5A - 50 BA 5A - 51 0E 5B - 52 4A 5B - 53 90 5B - 54 CF 5B - 55 18 5C - 56 4C 5C - 57 98 5C - 58 9C 5C - 59 E2 5C - 5A 0B 5D - 5B 4F 5D - 5C 98 5D - 5D DF 5D - 5E FA 5E - 5F 45 60 - 60 9C 60 - 61 4A 61 - 62 AD 61 - 63 24 62 - 64 58 62 - 65 5C 62 - 66 1A 63 - 67 44 63 - 68 82 63 - 69 9F 63 - 6A FC 63 - 6B 35 64 - 6C 64 64 - 6D 9F 64 - 6E CC 64 - 6F 07 65 - 70 43 65 - 71 87 65 - 72 F1 65 - 73 25 66 - 74 94 66 - 75 BD 66 - 76 1D 67 - 77 58 67 - 78 9A 67 - 79 CD 67 - 7A 06 68 - 7B 4D 68 - 7C 6E 68 - 7D 92 68 - 7E A9 68 - 7F BF 68 - 80 D3 68 - 81 FD 68 - 82 41 69 - 83 57 69 - 84 7E 69 - 85 C2 69 - 86 - Unused password text 4E 6A - 87 - Unused untranslated testing string
CPU Duel text
First match
0x81F4
- Weevil0x8253
- Mai Valentine0x82D9
- Rex Raptor0x8335
- Mako Tsunami0x8392
- Yami Yugi0x8413
- Yugi Muto0x84D0
- Joey Wheeler0x853B
- Seto Kaiba0x85C2
- Espa Roba0x862F
- Tristan Taylor0x868F
- Rare Hunter0x8716
- Pandora0x8790
- Marik Ishtar0x8837
- Heishin0x88D2
- P. Seto0x8950
- Simon Muran0x89D5
- Yami Bakura0x8A5D
- Shadi0x8B07
- DarkNite0x8B57
- Nitemare0x8B9D
- Isis Ishtar
Rematch
0x8C22
- Weevil0x8C62
- Mai Valentine0x8CAA
- Rex Raptor0x8CCA
- Mako Tsunami0x8D02
- Yami Yugi0x8D41
- Yugi Muto0x8D8A
- Joey Wheeler0x8DAB
- Seto Kaiba0x8DE5
- Espa Roba0x8E0B
- Tristan Taylor0x8E6A
- Rare Hunter0x8EA6
- Pandora0x8EE0
- Marik Ishtar0x8F20
- Heishin0x8F64
- P. Seto0x8FC1
- Simon Muran0x8FE6
- Yami Bakura0x9047
- Shadi0x908A
- DarkNite0x90AE
- Nitemare0x90F0
- Isis Ishtar
Defeat
0x912A
- Weevil0x916C
- Mai Valentine0x91AD
- Rex Raptor0x91F6
- Mako Tsunami0x923A
- Yami Yugi0x9280
- Yugi Muto0x92C4
- Joey Wheeler0x9305
- Seto Kaiba0x9343
- Espa Roba0x9373
- Tristan Taylor0x93AB
- Rare Hunter0x93F5
- Pandora0x9446
- Marik Ishtar0x94A8
- Heishin0x94DC
- P. Seto0x9502
- Simon Muran0x9524
- Yami Bakura0x9568
- Shadi0x95CF
- DarkNite0x960B
- Nitemare0x964C
- Isis Ishtar
Victory
0x968A
- Weevil0x96BD
- Mai Valentine0x9708
- Rex Raptor0x9740
- Mako Tsunami0x9789
- Yami Yugi0x97C3
- Yugi Muto0x9825
- Joey Wheeler0x9867
- Seto Kaiba0x98AC
- Espa Roba0x98CA
- Tristan Taylor0x990A
- Rare Hunter0x9927
- Pandora0x997A
- Marik Ishtar0x99BB
- Heishin0x99D6
- P. Seto0x99F1
- Simon Muran0x9A35
- Yami Bakura0x9A74
- Shadi0x9ABA
- DarkNite0x9B0E
- Nitemare0x9B4A
- Isis Ishtar
Stage clear
0x9B90
- Weevil0x9BCF
- Mai Valentine0x9C18
- Rex Raptor0x9C4C
- Mako Tsunami0x9C98
- Yugi Muto0x9CE2
- Joey Wheeler0x9D0B
- Seto Kaiba0x9D4F
- Espa Roba0x9D98
- Tristan Taylor0x9DDF
- Rare Hunter0x9EFA
- Pandora0xA045
- Marik Ishtar (Unused)0xA09C
- Heishin0xA14A
- P. Seto0xA1AD
- Simon Muran0xA224
- Yami Bakura (Unused, identical to Yami Bakura Password)0xA258
- DarkNite0xA344
- Isis Ishtar
Game text 1
0xA382
- Exodia0xA39F
- Intro text0xA3F0
- Password Input0xA435
- Correct Password0xA464
- Password Already Entered0xA49F
- Wrong Password0xA4CC
- Duelist Name Input0xA507
- Can't Record Password0xA543
- Yami Yugi Password0xA587
- Password Can't Be Used Yet0xA5F1
- Yami Bakura Password0xA525
- Shadi Password0xA694
- Nitemare Password0xA6BD
- Marik Ishtar Password0xA71D
- Tea - Link Duel Victory0xA758
- Tea - Link Duel Defeat0xA79A
- Tea - CPU Duel Victory0xA7CD
- Tea - « Since you've kept winning... Here! You can have this [Card Name] »0xA806
- Tea - « You've faced a lot of COMM duels... So take this [Card Name] And keep dueling! »0xA84D
- Tea - Deck Under 40 cards0xA86E
- Tea - Deck Capacity Exceeded0xA892
- Tea - « Good. You now have [Card Name] »0xA8A9
- Tea - Communication Error0xA8BF
- Tea - Trade Complete0xA8D3
- « COMM fusion's been activated! Result:[Card Name] »0xA8FD
- Tea - Not enough monsters to trade0xA941
- Tea - Memory Access Error0xA941
- Grandpa - CPU Duel Victory0xA97E
- Grandpa Password0xA9C2
- « Very good! You've found the secret. The secret of the legendary card... It's hidden here. Your password... It will reveal it to your eyes! » (Unused)0xAA4E
- « テストだよ » → "It's a test" (Unused)
2:6C98
ROM2:6C98 F5 push af ROM2:6C99 C5 push bc ROM2:6C9A E5 push hl ROM2:6C9B FA EE C6 ld a,(C6EE) ROM2:6C9E 3D dec a ROM2:6C9F EA EE C6 ld (C6EE),a ROM2:6CA2 20 1B jr nz,6CBF ROM2:6CA4 FA EF C6 ld a,(C6EF) ROM2:6CA7 FE B0 cp a,B0 ROM2:6CA9 30 07 jr nc,6CB2 ROM2:6CAB 3E 02 ld a,02 ROM2:6CAD EA EE C6 ld (C6EE),a ROM2:6CB0 18 0D jr 6CBF ROM2:6CB2 06 00 ld b,00 ROM2:6CB4 D6 B0 sub a,B0 ROM2:6CB6 4F ld c,a ROM2:6CB7 21 C3 6C ld hl,6CC3 ROM2:6CBA 09 add hl,bc ROM2:6CBB 7E ld a,(hl) ROM2:6CBC EA EE C6 ld (C6EE),a ROM2:6CBF E1 pop hl ROM2:6CC0 C1 pop bc ROM2:6CC1 F1 pop af ROM2:6CC2 C9 ret
2:6CC3 (array)
ROM2:6CC3 01 14 10 03 01
2:6CC8
ROM2:6CC8 F5 push af ROM2:6CC9 C5 push bc ROM2:6CCA D5 push de ROM2:6CCB E5 push hl ROM2:6CCC 16 00 ld d,00 ROM2:6CCE FA A8 C5 ld a,(C5A8) ROM2:6CD1 E6 03 and a,03 ROM2:6CD3 28 0D jr z,6CE2 ROM2:6CD5 0E 08 ld c,08 ROM2:6CD7 0D dec c ROM2:6CD8 07 rlca ROM2:6CD9 30 FC jr nc,6CD7 ROM2:6CDB 06 00 ld b,00 ROM2:6CDD 21 F6 6C ld hl,6CF6 ROM2:6CE0 09 add hl,bc ROM2:6CE1 56 ld d,(hl) ROM2:6CE2 3E 01 ld a,01 ROM2:6CE4 EA FD C6 ld (C6FD),a ROM2:6CE7 7A ld a,d ROM2:6CE8 FE 02 cp a,02 ROM2:6CEA 20 05 jr nz,6CF1 ROM2:6CEC 3E 00 ld a,00 ROM2:6CEE EA FB C6 ld (C6FB),a ROM2:6CF1 E1 pop hl ROM2:6CF2 D1 pop de ROM2:6CF3 C1 pop bc ROM2:6CF4 F1 pop af ROM2:6CF5 C9 ret
2:6CF6 (array)
ROM2:6CF6 02 02 00 00 00 00 00 00
2:6CFE
ROM2:6CFE F5 push af ROM2:6CFF 3E 04 ld a,04 ROM2:6D01 EA FB C6 ld (C6FB),a ROM2:6D04 3E 01 ld a,01 ROM2:6D06 EA F4 C6 ld (C6F4),a ROM2:6D09 F1 pop af ROM2:6D0A C9 ret
2:6D0B
ROM2:6D0B F5 push af ROM2:6D0C 3E 02 ld a,02 ROM2:6D0E EA FB C6 ld (C6FB),a ROM2:6D11 3E 01 ld a,01 ROM2:6D13 EA F4 C6 ld (C6F4),a ROM2:6D16 F1 pop af ROM2:6D17 C9 ret
2:6D18
ROM2:6D18 F5 push af ROM2:6D19 3E 05 ld a,05 ROM2:6D1B EA FB C6 ld (C6FB),a ROM2:6D1E F1 pop af ROM2:6D1F C9 ret
2:6D20
ROM2:6D20 CD 27 6D call 6D27 ROM2:6D23 CD 4F 6D call 6D4F ROM2:6D26 C9 ret
2:6D27
ROM2:6D27 F5 push af ROM2:6D28 C5 push bc ROM2:6D29 E5 push hl ROM2:6D2A FA F4 C6 ld a,(C6F4) ROM2:6D2D 3D dec a ROM2:6D2E EA F4 C6 ld (C6F4),a ROM2:6D31 20 13 jr nz,6D46 ROM2:6D33 3E 14 ld a,14 ROM2:6D35 EA F4 C6 ld (C6F4),a ROM2:6D38 06 00 ld b,00 ROM2:6D3A FA FB C6 ld a,(C6FB) ROM2:6D3D 4F ld c,a ROM2:6D3E 21 4A 6D ld hl,6D4A ROM2:6D41 09 add hl,bc ROM2:6D42 7E ld a,(hl) ROM2:6D43 EA FB C6 ld (C6FB),a ROM2:6D46 E1 pop hl ROM2:6D47 C1 pop bc ROM2:6D48 F1 pop af ROM2:6D49 C9 ret
2:6D4A (array)
ROM2:6D4A 00 02 01 04 03
2:6D4F
ROM2:6D4F CD A5 6B call 6BA5 ROM2:6D52 CD 85 6A call 6A85 ROM2:6D55 CD 59 6D call 6D59 ROM2:6D58 C9 ret
2:6D59
ROM2:6D59 F5 push af ROM2:6D5A C5 push bc ROM2:6D5B E5 push hl ROM2:6D5C CD D9 6A call 6AD9 ROM2:6D5F 06 00 ld b,00 ROM2:6D61 FA FB C6 ld a,(C6FB) ROM2:6D64 3D dec a ROM2:6D65 07 rlca ROM2:6D66 4F ld c,a ROM2:6D67 21 7B 6D ld hl,6D7B ROM2:6D6A 09 add hl,bc ROM2:6D6B 2A ldi a,(hl) ROM2:6D6C 66 ld h,(hl) ROM2:6D6D 6F ld l,a ROM2:6D6E 0E 10 ld c,10 ROM2:6D70 2A ldi a,(hl) ROM2:6D71 CD 13 11 call 1113 ;Related to display ROM2:6D74 0D dec c ROM2:6D75 20 F9 jr nz,6D70 ROM2:6D77 E1 pop hl ROM2:6D78 C1 pop bc ROM2:6D79 F1 pop af ROM2:6D7A C9 ret
2:6D7B (pointers array)
ROM2:6D7B 93 6D 83 6D A3 6D 83 6D
2:6D83 (arrays)
ROM2:6D83 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
ROM2:6D93 FF FF BF BF 9F 9F 8F 8F 87 87 8F 8F 9F 9F BF BF
ROM2:6DA3 FF FF 81 81 BD BD BD BD BD BD B1 B1 B3 B3 87 87
Initialize CPU Character ID and Text ID
ROM2:6DB3 F5 push af ROM2:6DB4 3E 00 ld a,00 ROM2:6DB6 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Weevil ROM2:6DB9 3E 00 ld a,00 ROM2:6DBB EA FA C6 ld (C6FA),a ;Text ID displayed = Weevil ROM2:6DBE F1 pop af ROM2:6DBF C9 ret
2:6DC0
ROM2:6DC0 F5 push af ROM2:6DC1 3E 1D ld a,1D ROM2:6DC3 EA F5 C6 ld (C6F5),a ROM2:6DC6 3E 01 ld a,01 ROM2:6DC8 EA F6 C6 ld (C6F6),a ROM2:6DCB 3E 11 ld a,11 ROM2:6DCD EA F7 C6 ld (C6F7),a ROM2:6DD0 3E 01 ld a,01 ROM2:6DD2 EA F8 C6 ld (C6F8),a ROM2:6DD5 3E 00 ld a,00 ROM2:6DD7 EA FC C6 ld (C6FC),a ROM2:6DDA 3E 00 ld a,00 ROM2:6DDC EA FB C6 ld (C6FB),a ROM2:6DDF CD 55 6A call 6A55 ROM2:6DE2 CD 7F 1E call 1E7F ;Updates Pseudo-Random Numbers ROM2:6DE5 3E 0C ld a,0C ROM2:6DE7 CD E3 0E call 0EE3 ;Related to display ROM2:6DEA CD C8 6C call 6CC8 ROM2:6DED CD 10 6E call 6E10 ROM2:6DF0 CD B3 6E call 6EB3 ROM2:6DF3 FA FB C6 ld a,(C6FB) ROM2:6DF6 FE 00 cp a,00 ROM2:6DF8 20 05 jr nz,6DFF ROM2:6DFA CD 79 6A call 6A79 ROM2:6DFD 18 03 jr 6E02 ROM2:6DFF CD 20 6D call 6D20 ROM2:6E02 CD C1 10 call 10C1 ;Related to display ROM2:6E05 FA FB C6 ld a,(C6FB) ROM2:6E08 FE 05 cp a,05 ROM2:6E0A 28 02 jr z,6E0E ROM2:6E0C 18 D4 jr 6DE2 ROM2:6E0E F1 pop af ROM2:6E0F C9 ret
2:6E10
ROM2:6E10 F5 push af ROM2:6E11 C5 push bc ROM2:6E12 D5 push de ROM2:6E13 E5 push hl ROM2:6E14 FA F6 C6 ld a,(C6F6) ROM2:6E17 3D dec a ROM2:6E18 EA F6 C6 ld (C6F6),a ROM2:6E1B 20 1C jr nz,6E39 ROM2:6E1D 06 00 ld b,00 ROM2:6E1F FA F5 C6 ld a,(C6F5) ROM2:6E22 4F ld c,a ROM2:6E23 21 3E 6E ld hl,6E3E ROM2:6E26 09 add hl,bc ROM2:6E27 7E ld a,(hl) ROM2:6E28 EA F6 C6 ld (C6F6),a ROM2:6E2B CD 7A 6E call 6E7A ;Display selected Character ID ROM2:6E2E 79 ld a,c ROM2:6E2F 3D dec a ROM2:6E30 FE FF cp a,FF ROM2:6E32 20 02 jr nz,6E36 ROM2:6E34 3E 1D ld a,1D ROM2:6E36 EA F5 C6 ld (C6F5),a ROM2:6E39 E1 pop hl ROM2:6E3A D1 pop de ROM2:6E3B C1 pop bc ROM2:6E3C F1 pop af ROM2:6E3D C9 ret
2:6E3E (Array)
ROM2:6E3E 64 04 04 A0 04 04 04 04 04 78 04 04 8C 04 04 64 04 04 64 04 04 78 04 04 8C 04 04 82 04 04
2:6E5C (Arrays, used by Character display)
ROM2:6E5C 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02
Display selected Character ID
ROM2:6E7A F5 push af ROM2:6E7B C5 push bc ROM2:6E7C E5 push hl ROM2:6E7D 06 00 ld b,00 ROM2:6E7F FA F5 C6 ld a,(C6F5) ROM2:6E82 4F ld c,a ROM2:6E83 21 5C 6E ld hl,6E5C ROM2:6E86 09 add hl,bc ROM2:6E87 7E ld a,(hl) ROM2:6E88 FE 00 cp a,00 ROM2:6E8A 20 0B jr nz,6E97 ROM2:6E8C FA F9 C6 ld a,(C6F9) ;CPU Character ID displayed ROM2:6E8F 47 ld b,a ROM2:6E90 0E 00 ld c,00 ROM2:6E92 CF rst 08 ... ROM2:6E95 18 18 jr 6EAF ROM2:6E97 FE 01 cp a,01 ROM2:6E99 20 0B jr nz,6EA6 ROM2:6E9B FA F9 C6 ld a,(C6F9) ;CPU Character ID displayed ROM2:6E9E 47 ld b,a ROM2:6E9F 0E 01 ld c,01 ROM2:6EA1 CF rst 08 ... ROM2:6EA4 18 09 jr 6EAF ROM2:6EA6 FA F9 C6 ld a,(C6F9) ;CPU Character ID displayed ROM2:6EA9 47 ld b,a ROM2:6EAA 0E 02 ld c,02 ROM2:6EAC CF rst 08 ... ROM2:6EAF E1 pop hl ROM2:6EB0 C1 pop bc ROM2:6EB1 F1 pop af ROM2:6EB2 C9 ret
2:6F1B
ROM2:6F1B F5 push af ROM2:6F1C C5 push bc ROM2:6F1D E5 push hl ROM2:6F1E 06 00 ld b,00 ROM2:6F20 FA F7 C6 ld a,(C6F7) ROM2:6F23 4F ld c,a ROM2:6F24 21 09 6F ld hl,6F09 ROM2:6F27 09 add hl,bc ROM2:6F28 7E ld a,(hl) ROM2:6F29 FE 00 cp a,00 ROM2:6F2B 20 0B jr nz,6F38 ROM2:6F2D FA F9 C6 ld a,(C6F9) ROM2:6F30 47 ld b,a ROM2:6F31 0E 00 ld c,00 ROM2:6F33 CF rst 08 => 05 0C ROM2:6F36 18 18 jr 6F50 ROM2:6F38 FE 01 cp a,01 ROM2:6F3A 20 0B jr nz,6F47 ROM2:6F3C FA F9 C6 ld a,(C6F9) ROM2:6F3F 47 ld b,a ROM2:6F40 0E 01 ld c,01 ROM2:6F42 CF rst 08 => 05 0C ROM2:6F45 18 09 jr 6F50 ROM2:6F47 FA F9 C6 ld a,(C6F9) ROM2:6F4A 47 ld b,a ROM2:6F4B 0E 02 ld c,02 ROM2:6F4D CF rst 08 => 05 0C ROM2:6F50 E1 pop hl ROM2:6F51 C1 pop bc ROM2:6F52 F1 pop af ROM2:6F53 C9 ret
2:6F54
ROM2:6F54 C5 push bc ROM2:6F55 FA F9 C6 ld a,(C6F9) ;a = CPU Character ID displayed ROM2:6F58 47 ld b,a ROM2:6F59 0E 00 ld c,00 ;bc = CPU Character ID ROM2:6F5B CF rst 08 => 05 0C ROM2:6F5E C1 pop bc ROM2:6F5F C9 ret
Text display subroutine
0xAF60
- Text display subroutine
ROM2:6F60 F5 push af ROM2:6F61 C5 push bc ROM2:6F62 E5 push hl ROM2:6F63 06 00 ld b,00 ROM2:6F65 4F ld c,a ROM2:6F66 CB 21 sla c ROM2:6F68 21 78 6F ld hl,6F78 ;hl = Pointer from the array at 2:6F78 ROM2:6F6B 09 add hl,bc ROM2:6F6C 2A ldi a,(hl) ROM2:6F6D 66 ld h,(hl) ROM2:6F6E 6F ld l,a ROM2:6F6F 01 74 6F ld bc,6F74 ROM2:6F72 C5 push bc ROM2:6F73 E9 jp hl ROM2:6F74 E1 pop hl ROM2:6F75 C1 pop bc ROM2:6F76 F1 pop af ROM2:6F77 C9 ret
Pointers to Text display subroutines
ROM2:6F78 C0 6F - 00 - Stores CPU Character ID and Text ID D8 6F - 01 - F0 6F - 02 - 08 70 - 03 - A0 72 - 04 - Text: Tea - Not enough monsters to trade B6 72 - 05 - Text: Tea - Deck Capacity Exceeded CC 72 - 06 - Text: Tea - Deck Under 40 cards 4A 73 - 07 - Text: Exosha - Exodia win 63 73 - 08 - Text: Yami Yugi - Intro text 79 73 - 09 - Text: Yami Yugi - Duelist Name Input 79 70 - 0A - BC 70 - 0B - FF 70 - 0C - 44 71 - 0D - 89 71 - 0E - 8F 73 - 0F - AD 73 - 10 - B7 73 - 11 - C3 73 - 12 - Store bc in wC8D4 - wC8D5 CE 73 - 13 - DA 73 - 14 - Text: Yugi Muto - テストだよ - This is a test (Unused) ED 73 - 15 - Text: Yami Yugi - Correct password 1B 74 - 16 - Text: Yami Yugi - Password already entered 31 74 - 17 - Text: Yami Yugi - Invalid password 44 74 - 18 - Text: Yami Yugi - Password Input 5A 74 - 19 - Text: Yami Yugi - Invalid password E2 72 - 1A - Text: Yami Yugi - Password Input F8 72 - 1B - Text: Yami Yugi - Can't Record Password 6D 74 - 1C - Text: Yami Yugi - Stage 5 password entered 83 74 - 1D - Text: Yami Bakura - Stage 5 password entered 99 74 - 1E - Text: Nitemare - Stage 5 password entered AF 74 - 1F - Text: Shadi - Stage 5 password entered C5 74 - 20 - Text: Marik Ishtar - Stage 5 password entered DB 74 - 21 - Text: Grandpa - Grandpa password entered F1 74 - 22 - Text: Simon Muran - Legendary card password (Unused) 04 75 - 23 - Text: Yami Yugi - Password can't be used yet
Stores CPU Character ID and Text ID
0xAFC0
- Stores CPU Character ID in(C6F9)
and Text ID in(C6FA)
ROM2:6FC0 F5 push af ROM2:6FC1 FA CC C8 ld a,(C8CC) ROM2:6FC4 EA F9 C6 ld (C6F9),a ROM2:6FC7 CD CE 71 call 71CE ROM2:6FCA EA FA C6 ld (C6FA),a ROM2:6FCD CD 12 40 call 4012 ROM2:6FD0 CD 70 2A call 2A70 ROM2:6FD3 CD C0 6D call 6DC0 ROM2:6FD6 F1 pop af ROM2:6FD7 C9 ret
Load CPU opponent text ID
ROM2:71CE C5 push bc ROM2:71CF E5 push hl ROM2:71D0 06 00 ld b,00 ROM2:71D2 FA CC C8 ld a,(C8CC) ;a = Current_CPU_opponent ROM2:71D5 CD 2A 28 call 282A ROM2:71D8 21 0B 72 ld hl,720B ROM2:71DB 79 ld a,c ROM2:71DC FE 00 cp a,00 ROM2:71DE 20 08 jr nz,71E8 ROM2:71E0 78 ld a,b ROM2:71E1 FE 00 cp a,00 ROM2:71E3 20 03 jr nz,71E8 ROM2:71E5 21 F3 71 ld hl,71F3 ROM2:71E8 06 00 ld b,00 ROM2:71EA FA CC C8 ld a,(C8CC) ;a = Current_CPU_opponent ROM2:71ED 4F ld c,a ROM2:71EE 09 add hl,bc ROM2:71EF 7E ld a,(hl) ROM2:71F0 E1 pop hl ROM2:71F1 C1 pop bc ROM2:71F2 C9 ret
CPU opponent text IDs
ROM2:71F3 00 01 02 03 04 05 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0E 0E 10 11 12 13 14 15 16 17 18 19 1A 1A 1B 1C 1D 1E 1F 20 21 22 23 24 23 23 25 26 27 28 29
2:7223
ROM2:7223 C5 push bc ROM2:7224 E5 push hl ROM2:7225 06 00 ld b,00 ROM2:7227 FA CC C8 ld a,(C8CC) ROM2:722A CD 2A 28 call 282A ROM2:722D 21 60 72 ld hl,7260 ROM2:7230 79 ld a,c ROM2:7231 FE 05 cp a,05 ROM2:7233 20 08 jr nz,723D ROM2:7235 78 ld a,b ROM2:7236 FE 00 cp a,00 ROM2:7238 20 03 jr nz,723D ROM2:723A 21 48 72 ld hl,7248 ROM2:723D 06 00 ld b,00 ROM2:723F FA CC C8 ld a,(C8CC) ROM2:7242 4F ld c,a ROM2:7243 09 add hl,bc ROM2:7244 7E ld a,(hl) ROM2:7245 E1 pop hl ROM2:7246 C1 pop bc ROM2:7247 C9 ret
2:7248 - Text IDs Array
2:7248 54 55 56 57 43 59 59 5A 5B 5C 5D 5E 5F 4B 61 62 63 62 62 4F 50 66 52 68 3F 40 41 42 43 44 44 45 46 47 48 49 4A 4B 4C 4D 4E 4D 4D 4F 50 51 52 53
Load defeat text ID
ROM2:7278 C5 push bc ROM2:7279 E5 push hl ROM2:727A 06 00 ld b,00 ROM2:727C FA CC C8 ld a,(C8CC) ROM2:727F 4F ld c,a ;c = Current CPU opponent ROM2:7280 21 88 72 ld hl,7288 ROM2:7283 09 add hl,bc ;hl = pointer_to_text_ID ROM2:7284 7E ld a,(hl) ;a = text_ID ROM2:7285 E1 pop hl ROM2:7286 C1 pop bc ROM2:7287 C9 ret
Defeat text IDs array
2:7288 2A - Weevil 2B - Mai Valentine 2C - Rex Raptor 2D - Mako Tsunami 2E - Yami Yugi 2F - Yugi Muto 2F - Yugi Muto 30 - Joey Wheeler 31 - Seto Kaiba 32 - Espa Roba 33 - Tristan Taylor 34 - Rare Hunter 35 - Pandora 36 - Marik Ishtar 37 - Heishin 38 - P. Seto 39 - Simon Muran 38 - P. Seto 38 - P. Seto 3A - Yami Bakura 3B - Shadi 3C - DarkNite 3D - Nitemare 3E - Isis Ishtar
Text: Tea - Not enough monsters to trade
ROM2:72A0 F5 push af ROM2:72A1 3E 06 ld a,06 ROM2:72A3 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Tea ROM2:72A6 3E 82 ld a,82 ROM2:72A8 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x82 ; Not enough monsters to trade ROM2:72AB CD 12 40 call 4012 ROM2:72AE CD 39 2A call 2A39 ROM2:72B1 CD C0 6D call 6DC0 ROM2:72B4 F1 pop af ROM2:72B5 C9 ret
Text: Tea - Deck Capacity Exceeded
ROM2:72B6 F5 push af ROM2:72B7 3E 06 ld a,06 ROM2:72B9 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Tea ROM2:72BC 3E 7D ld a,7D ROM2:72BE EA FA C6 ld (C6FA),a ;Text ID displayed = 0x7D ; Deck Capacity Exceeded ROM2:72C1 CD 12 40 call 4012 ROM2:72C4 CD 39 2A call 2A39 ROM2:72C7 CD C0 6D call 6DC0 ROM2:72CA F1 pop af ROM2:72CB C9 ret
Text: Tea - Deck Under 40 cards
ROM2:72CC F5 push af ROM2:72CD 3E 06 ld a,06 ROM2:72CF EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Tea ROM2:72D2 3E 7C ld a,7C ROM2:72D4 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x7C ; Deck Under 40 cards ROM2:72D7 CD 12 40 call 4012 ROM2:72DA CD 39 2A call 2A39 ROM2:72DD CD C0 6D call 6DC0 ROM2:72E0 F1 pop af ROM2:72E1 C9 ret
Text: Tea - Communication Error
ROM2:72E2 F5 push af ROM2:72E3 3E 06 ld a,06 ROM2:72E5 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Tea ROM2:72E8 3E 7F ld a,7F ROM2:72EA EA FA C6 ld (C6FA),a ;Text ID displayed = 0x7F ; Communication Error ROM2:72ED CD 12 40 call 4012 ROM2:72F0 CD 39 2A call 2A39 ROM2:72F3 CD C0 6D call 6DC0 ROM2:72F6 F1 pop af ROM2:72F7 C9 ret
Text: Tea - Trade Complete, COMM Fusion
ROM2:72F8 F5 push af ROM2:72F9 C5 push bc ROM2:72FA D5 push de ROM2:72FB E5 push hl ROM2:72FC E8 FA add sp,FA ROM2:72FE F8 00 ld hl,sp+00 ROM2:7300 54 ld d,h ROM2:7301 5D ld e,l ROM2:7302 CF rst 08 => 17 05 ROM2:7305 CD 72 1A call 1A72 ROM2:7308 FE 00 cp a,00 ROM2:730A 28 15 jr z,7321 ROM2:730C 3E 06 ld a,06 ROM2:730E EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Tea ROM2:7311 3E 80 ld a,80 ROM2:7313 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x80 ; Trade Complete ROM2:7316 CD 12 40 call 4012 ROM2:7319 CD 39 2A call 2A39 ROM2:731C CD C0 6D call 6DC0 ROM2:731F 18 22 jr 7343 ROM2:7321 CD AD 73 call 73AD ROM2:7324 F8 00 ld hl,sp+00 ROM2:7326 D5 push de ROM2:7327 1E 04 ld e,04 ROM2:7329 2A ldi a,(hl) ROM2:732A 46 ld b,(hl) ROM2:732B 4F ld c,a ROM2:732C CD 8B 2D call 2D8B ROM2:732F D1 pop de ROM2:7330 3E 06 ld a,06 ROM2:7332 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Tea ROM2:7335 3E 81 ld a,81 ROM2:7337 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x81 ; COMM fusion's been activated! Result:[Card Name] ROM2:733A CD 12 40 call 4012 ROM2:733D CD 39 2A call 2A39 ROM2:7340 CD C0 6D call 6DC0 ROM2:7343 E8 06 add sp,06 ROM2:7345 E1 pop hl ROM2:7346 D1 pop de ROM2:7347 C1 pop bc ROM2:7348 F1 pop af ROM2:7349 C9 ret
Text: Exosha - Exodia win
ROM2:734A F5 push af ROM2:734B 3E 11 ld a,11 ROM2:734D EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Exosha ROM2:7350 3E 69 ld a,69 ROM2:7352 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x69 ; Exodia win ROM2:7355 CD DA 29 call 29DA ROM2:7358 CD 12 40 call 4012 ROM2:735B CD 49 2B call 2B49 ROM2:735E CD C0 6D call 6DC0 ROM2:7361 F1 pop af ROM2:7362 C9 ret
Text: Yami Yugi - Intro text
ROM2:7363 F5 push af ROM2:7364 3E 04 ld a,04 ROM2:7366 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:7369 3E 6A ld a,6A ROM2:736B EA FA C6 ld (C6FA),a ;Text ID displayed = 0x6A ; Intro text ROM2:736E CD 12 40 call 4012 ROM2:7371 CD 11 2A call 2A11 ROM2:7374 CD C0 6D call 6DC0 ROM2:7377 F1 pop af ROM2:7378 C9 ret
Text: Yami Yugi - Duelist Name Input
ROM2:7379 F5 push af ROM2:737A 3E 04 ld a,04 ROM2:737C EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:737F 3E 6F ld a,6F ROM2:7381 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x6F ; Duelist Name Input ROM2:7384 CD 12 40 call 4012 ROM2:7387 CD 11 2A call 2A11 ROM2:738A CD C0 6D call 6DC0 ROM2:738D F1 pop af ROM2:738E C9 ret
2:738F
ROM2:738F F5 push af ROM2:7390 E5 push hl ROM2:7391 62 ld h,d ROM2:7392 6B ld l,e ROM2:7393 3E 00 ld a,00 ROM2:7395 22 ldi (hl),a ROM2:7396 36 00 ld (hl),00 ROM2:7398 21 02 00 ld hl,0002 ROM2:739B 19 add hl,de ROM2:739C 3E 00 ld a,00 ROM2:739E 22 ldi (hl),a ROM2:739F 36 00 ld (hl),00 ROM2:73A1 21 04 00 ld hl,0004 ROM2:73A4 19 add hl,de ROM2:73A5 3E 00 ld a,00 ROM2:73A7 22 ldi (hl),a ROM2:73A8 36 00 ld (hl),00 ROM2:73AA E1 pop hl ROM2:73AB F1 pop af ROM2:73AC C9 ret
2:73AD
ROM2:73AD F5 push af ROM2:73AE E5 push hl ROM2:73AF 62 ld h,d ROM2:73B0 6B ld l,e ROM2:73B1 79 ld a,c ROM2:73B2 22 ldi (hl),a ROM2:73B3 70 ld (hl),b ROM2:73B4 E1 pop hl ROM2:73B5 F1 pop af ROM2:73B6 C9 ret
2:73B7
ROM2:73B7 F5 push af ROM2:73B8 E5 push hl ROM2:73B9 21 02 00 ld hl,0002 ROM2:73BC 19 add hl,de ROM2:73BD 79 ld a,c ROM2:73BE 22 ldi (hl),a ROM2:73BF 70 ld (hl),b ROM2:73C0 E1 pop hl ROM2:73C1 F1 pop af ROM2:73C2 C9 ret
2:73C3 - Store bc in wC8D4 - wC8D5
ROM2:73C3 F5 push af ROM2:73C4 79 ld a,c ROM2:73C5 EA D4 C8 ld (C8D4),a ROM2:73C8 78 ld a,b ROM2:73C9 EA D5 C8 ld (C8D5),a ROM2:73CC F1 pop af ROM2:73CD C9 ret
2:73CE
ROM2:73CE F5 push af ROM2:73CF E5 push hl ROM2:73D0 21 04 00 ld hl,0004 ROM2:73D3 19 add hl,de ROM2:73D4 79 ld a,c ROM2:73D5 22 ldi (hl),a ROM2:73D6 70 ld (hl),b ROM2:73D7 E1 pop hl ROM2:73D8 F1 pop af ROM2:73D9 C9 ret
Text: Yugi Muto - テストだよ - This is a test (Unused)
ROM2:73DA F5 push af ROM2:73DB 3E 05 ld a,05 ROM2:73DD EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yugi Muto ROM2:73E0 3E 87 ld a,87 ROM2:73E2 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x87 - テストだよ - This is a test (Unused) ROM2:73E5 CD 12 40 call 4012 ROM2:73E8 CD C0 6D call 6DC0 ROM2:73EB F1 pop af ROM2:73EC C9 ret
Text: Yami Yugi - Correct password
ROM2:73ED F5 push af ROM2:73EE C5 push bc ROM2:73EF D5 push de ROM2:73F0 3E 04 ld a,04 ROM2:73F2 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:73F5 3E 6C ld a,6C ROM2:73F7 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x6C ; Correct password ROM2:73FA CD D8 2C call 2CD8 ROM2:73FD 1E 04 ld e,04 ;e = 4 ROM2:73FF CD 8B 2D call 2D8B ROM2:7402 CD 12 40 call 4012 ROM2:7405 CD 49 2A call 2A49 ROM2:7408 CD C0 6D call 6DC0 ROM2:740B CF rst 08 => 03 07 ROM2:740E CF rst 08 =>03 05 ROM2:7411 CD 31 2B call 2B31 ROM2:7414 CF rst 08 ROM2:7415 09 add hl,bc ROM2:7416 05 dec b ;b-- ROM2:7417 D1 pop de ROM2:7418 C1 pop bc ROM2:7419 F1 pop af ROM2:741A C9 ret
Text: Yami Yugi - Password already entered
ROM2:741B F5 push af ROM2:741C 3E 04 ld a,04 ROM2:741E EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:7421 3E 6D ld a,6D ROM2:7423 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x9D ; Password already entered ROM2:7426 CD 12 40 call 4012 ROM2:7429 CD 49 2A call 2A49 ROM2:742C CD C0 6D call 6DC0 ROM2:742F F1 pop af ROM2:7430 C9 ret
Text: Yami Yugi - Invalid password
ROM2:7431 F5 push af ROM2:7432 3E 04 ld a,04 ROM2:7434 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:7437 3E 6E ld a,6E ROM2:7439 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x6E ; Invalid password ROM2:743C CD 12 40 call 4012 ROM2:743F CD C0 6D call 6DC0 ROM2:7442 F1 pop af ROM2:7443 C9 ret
Text: Yami Yugi - Password Input
ROM2:7444 F5 push af ROM2:7445 3E 04 ld a,04 ROM2:7447 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:744A 3E 6B ld a,6B ROM2:744C EA FA C6 ld (C6FA),a ;Text ID displayed = 0x6B ; Password Input ROM2:744F CD 12 40 call 4012 ROM2:7452 CD 01 2A call 2A01 ROM2:7455 CD C0 6D call 6DC0 ROM2:7458 F1 pop af ROM2:7459 C9 ret
Text: Yami Yugi - Can't Record Password
ROM2:745A F5 push af ROM2:745B 3E 04 ld a,04 ROM2:745D EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:7460 3E 70 ld a,70 ROM2:7462 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x70 ; Can't Record Password ROM2:7465 CD 12 40 call 4012 ROM2:7468 CD C0 6D call 6DC0 ROM2:746B F1 pop af ROM2:746C C9 ret
Text: Yami Yugi - Stage 5 password entered
ROM2:746D F5 push af ROM2:746E 3E 04 ld a,04 ROM2:7470 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:7473 3E 71 ld a,71 ROM2:7475 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x71 ; Yami Yugi Stage 5 password entered ROM2:7478 CD 12 40 call 4012 ROM2:747B CD 49 2A call 2A49 ROM2:747E CD C0 6D call 6DC0 ROM2:7481 F1 pop af ROM2:7482 C9 ret
Text: Yami Bakura - Stage 5 password entered
ROM2:7483 F5 push af ROM2:7484 3E 13 ld a,13 ROM2:7486 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Bakura ROM2:7489 3E 73 ld a,73 ROM2:748B EA FA C6 ld (C6FA),a ;Text ID displayed = 0x73 ; Yami Bakura Stage 5 password entered ROM2:748E CD 12 40 call 4012 ROM2:7491 CD 49 2A call 2A49 ROM2:7494 CD C0 6D call 6DC0 ROM2:7497 F1 pop af ROM2:7498 C9 ret
Text: Nitemare - Stage 5 password entered
ROM2:7499 F5 push af ROM2:749A 3E 16 ld a,16 ROM2:749C EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Nitemare ROM2:749F 3E 75 ld a,75 ROM2:74A1 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x75 ; Nitemare Stage 5 password entered ROM2:74A4 CD 12 40 call 4012 ROM2:74A7 CD 49 2A call 2A49 ROM2:74AA CD C0 6D call 6DC0 ROM2:74AD F1 pop af ROM2:74AE C9 ret
Text: Shadi - Stage 5 password entered
ROM2:74AF F5 push af ROM2:74B0 3E 14 ld a,14 ROM2:74B2 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Shadi ROM2:74B5 3E 74 ld a,74 ROM2:74B7 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x74 ; Shadi Stage 5 password entered ROM2:74BA CD 12 40 call 4012 ROM2:74BD CD 49 2A call 2A49 ROM2:74C0 CD C0 6D call 6DC0 ROM2:74C3 F1 pop af ROM2:74C4 C9 ret
Text: Marik Ishtar - Stage 5 password entered
ROM2:74C5 F5 push af ROM2:74C6 3E 0D ld a,0D ROM2:74C8 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Marik Ishtar ROM2:74CB 3E 76 ld a,76 ROM2:74CD EA FA C6 ld (C6FA),a ;Text ID displayed = 0x76 ; Marik Ishtar Stage 5 password entered ROM2:74D0 CD 12 40 call 4012 ROM2:74D3 CD 49 2A call 2A49 ROM2:74D6 CD C0 6D call 6DC0 ROM2:74D9 F1 pop af ROM2:74DA C9 ret
Text: Grandpa - Grandpa password entered
ROM2:74DB F5 push af ROM2:74DC 3E 12 ld a,12 ROM2:74DE EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Grandpa ROM2:74E1 3E 85 ld a,85 ROM2:74E3 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x85 ; Grandpa password entered ROM2:74E6 CD 12 40 call 4012 ROM2:74E9 CD 41 2A call 2A41 ROM2:74EC CD C0 6D call 6DC0 ROM2:74EF F1 pop af ROM2:74F0 C9 ret
Text: Simon Muran - Legendary card password (unused)
ROM2:74F1 F5 push af ROM2:74F2 3E 10 ld a,10 ROM2:74F4 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Simon Muran ROM2:74F7 3E 86 ld a,86 ROM2:74F9 EA FA C6 ld (C6FA),a ;Text ID displayed = 0x86 - Unused Legendary card password ROM2:74FC CD 12 40 call 4012 ROM2:74FF CD C0 6D call 6DC0 ROM2:7502 F1 pop af ROM2:7503 C9 ret
Text: Yami Yugi - Password can't be used yet
ROM2:7504 F5 push af ROM2:7505 3E 04 ld a,04 ROM2:7507 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = Yami Yugi ROM2:750A 3E 72 ld a,72 ROM2:750C EA FA C6 ld (C6FA),a ;Text ID displayed = 0x72 ; Password can't be used yet ROM2:750F CD 12 40 call 4012 ROM2:7512 CD 49 2A call 2A49 ROM2:7515 CD C0 6D call 6DC0 ROM2:7518 F1 pop af ROM2:7519 C9 ret
Bank 3 - Duel Operation
rst 08 pointers
ROM3:4002 7E 45 5C 45 F3 48 8E 48 AF 48 FF 50 1A 51 CB 4E 5A 4F 94 51 B1 51 86 50 2B 50 EC 4F 0D 52 - Check if selected card ID = register de C7 50 36 51 59 51 2C 52 D7 50 EB 50 8A 4F 12 50 77 57 A1 59 CE 59 FB 59 10 5A 9D 59 91 5B - Stores damage type and Life Points 24 5C 51 5C 77 5C 87 5C 97 5C A7 5C 70 5E C8 5E - Remove Player's Trap Card D6 5E - Remove CPU's Trap Card D9 41 0B 42 68 41 A7 41 4A 5D - Win condition : Life Points A3 78 38 43 41 79 46 52 AD 79 AE 52 1D 53 33 53 49 53 5F 53 18 56 21 56 2B 45 52 45 2E 43 F3 42 07 43 6C 42 B2 42 14 7B 3B 7B 2C 41 60 41 40 41 48 41 58 41 38 41 C9 5D
Life Points initialization, Healing and Damage
0xC093-0xC0A3
- Sets Player's Life Points to 8000
ROM3:4093 3E 00 ld a,00 ROM3:4095 EA C7 C5 ld (C5C7),a ROM3:4098 3E 80 ld a,80 ROM3:409A EA C8 C5 ld (C5C8),a ROM3:409D 3E 00 ld a,00 ROM3:409F EA C9 C5 ld (C5C9),a ;? ROM3:40A2 F1 pop af ROM3:40A3 C9 ret
0xC0A4-0xC0BD
- Heals Player's Life Points by amount in register bc
ROM3:40A4 F5 push af ROM3:40A5 C5 push bc ROM3:40A6 D5 push de ROM3:40A7 FA C7 C5 ld a,(C5C7) ROM3:40AA 5F ld e,a ROM3:40AB FA C8 C5 ld a,(C5C8) ROM3:40AE 57 ld d,a ;Copies Player's Life Points in register de ROM3:40AF CD 82 14 call 1482 ;daa addtion ROM3:40B2 79 ld a,c ROM3:40B3 EA C7 C5 ld (C5C7),a ROM3:40B6 78 ld a,b ROM3:40B7 EA C8 C5 ld (C5C8),a ;Copies updated Player's Life Points in (C5C7) ROM3:40BA D1 pop de ROM3:40BB C1 pop bc ROM3:40BC F1 pop af ROM3:40BD C9 ret
0xC0BE-0xC0DE
- Damage Player's Life Points by amount in register bc
ROM3:40BE C5 push bc ROM3:40BF D5 push de ROM3:40C0 FA C7 C5 ld a,(C5C7) ROM3:40C3 5F ld e,a ROM3:40C4 FA C8 C5 ld a,(C5C8) ROM3:40C7 57 ld d,a ;Copies Player's Life Points in register de ROM3:40C8 CD 92 14 call 1492 ;daa substraction ROM3:40CB 7B ld a,e ROM3:40CC FE 00 cp a,00 ROM3:40CE 20 03 jr nz,40D3 ROM3:40D0 01 00 00 ld bc,0000 ;If(bc≤0), sets bc to 0 ROM3:40D3 79 ld a,c ROM3:40D4 EA C7 C5 ld (C5C7),a ROM3:40D7 78 ld a,b ROM3:40D8 EA C8 C5 ld (C5C8),a ;Copies updated Player's Life Points in (C5C7) ROM3:40DB 7B ld a,e ;Copies e (0 : LP>0 ; 1 : LP==0 ; 2 : LP≤0) in accumulator ROM3:40DC D1 pop de ROM3:40DD C1 pop bc ROM3:40DE C9 ret
0xC0DF-0xC0F0
- Sets CPU's Life Points to 8000
ROM3:40DF F5 push af ROM3:40E0 3E 00 ld a,00 ROM3:40E2 EA CA C5 ld (C5CA),a ROM3:40E5 3E 80 ld a,80 ROM3:40E7 EA CB C5 ld (C5CB),a ROM3:40EA 3E 00 ld a,00 ROM3:40EC EA CC C5 ld (C5CC),a ;? ROM3:40EF F1 pop af ROM3:40F0 C9 ret
0xC0F1-0xC10A
- Heals CPU's Life Points by amount in register bc
ROM3:40F1 F5 push af ROM3:40F2 C5 push bc ROM3:40F3 D5 push de ROM3:40F4 FA BB C7 ld a,(C7BB) ROM3:40F7 5F ld e,a ROM3:40F8 FA BC C7 ld a,(C7BC) ROM3:40FB 57 ld d,a ;Copies CPU's Life Points in register de ROM3:40FC CD 82 14 call 1482 ;daa addtion ROM3:40FF 79 ld a,c ROM3:4100 EA BB C7 ld (C7BB),a ROM3:4103 78 ld a,b ROM3:4104 EA BC C7 ld (C7BC),a ;Copies updated CPU's Life Points in (C7BB) ROM3:4107 D1 pop de ROM3:4108 C1 pop bc ROM3:4109 F1 pop af ROM3:410A C9 ret
0xC10B-0xC12B
- Damage CPU's Life Points by amount in register bc
ROM3:410B C5 push bc ROM3:410C D5 push de ROM3:410D FA BB C7 ld a,(C7BB) ROM3:4110 5F ld e,a ROM3:4111 FA BC C7 ld a,(C7BC) ROM3:4114 57 ld d,a ;Copies CPU's Life Points in register de ROM3:4115 CD 92 14 call 1492 ;daa substraction ROM3:4118 7B ld a,e ROM3:4119 FE 00 cp a,00 ROM3:411B 20 03 jr nz,4120 ROM3:411D 01 00 00 ld bc,0000 ;If(bc≤0), sets bc to 0 ROM3:4120 79 ld a,c ROM3:4121 EA BB C7 ld (C7BB),a ROM3:4124 78 ld a,b ROM3:4125 EA BC C7 ld (C7BC),a ;Copies updated CPU's Life Points in (C7BB) ROM3:4128 7B ld a,e ;Copies e (0 : LP>0 ; 1 : LP==0 ; 2 : LP≤0) in accumulator ROM3:4129 D1 pop de ROM3:412A C1 pop bc ROM3:412B C9 ret
Field management
Reverts field to Arena
0xC12C-0xC133
- Reverts field to Arena
ROM3:412C F5 push af ROM3:412D 3E 00 ld a,00 ROM3:412F EA E8 C5 ld (C5E8),a ROM3:4132 F1 pop af ROM3:4133 C9 ret
Field change
0xC134-0xC137
- Changes Field to the value in accumulator
ROM3:4134 EA E8 C5 ld (C5E8),a ;Field ID ROM3:4137 C9 ret
Change field to Forest
0xC138-0xC13F
- Change field to Forest
ROM3:4138 F5 push af ROM3:4139 3E 01 ld a,01 ROM3:413B CD 34 41 call 4134 ;Field change ROM3:413E F1 pop af ROM3:413F C9 ret
Change field to Wasteland
0xC140-0xC148
- Change field to Wasteland
ROM3:4140 F5 push af ROM3:4141 3E 02 ld a,02 ROM3:4143 CD 34 41 call 4134 ;Field change ROM3:4146 F1 pop af ROM3:4147 C9 ret
Change field to Mountain
0xC148-0xC14F
- Change field to Mountain
ROM3:4148 F5 push af ROM3:4149 3E 03 ld a,03 ROM3:414B CD 34 41 call 4134 ;Field change ROM3:414E F1 pop af ROM3:414F C9 ret
Change field to Sogen
0xC150-0xC157
- Change field to Sogen
ROM3:4150 F5 push af ROM3:4151 3E 04 ld a,04 ROM3:4153 CD 34 41 call 4134 ;Field change ROM3:4156 F1 pop af ROM3:4157 C9 ret
Change field to Umi
0xC158-0xC15F
- Change field to Umi
ROM3:4158 F5 push af ROM3:4159 3E 05 ld a,05 ROM3:415B CD 34 41 call 4134 ;Field change ROM3:415E F1 pop af ROM3:415F C9 ret
Change field to Yami
0xC160-0xC167
- Change field to Yami
ROM3:4160 F5 push af ROM3:4161 3E 06 ld a,06 ROM3:4163 CD 34 41 call 4134 ;Field change ROM3:4166 F1 pop af ROM3:4167 C9 ret
3:4168 (Checks hand + display ?)
ROM3:4168 CD 75 41 call 4175 ROM3:416B CD A7 41 call 41A7 ROM3:416E CD D9 41 call 41D9 ROM3:4171 CD 0B 42 call 420B ;Checks Hand + Trap Zone ROM3:4174 C9 ret
3:4175
ROM3:4175 F5 push af ROM3:4176 C5 push bc ROM3:4177 D5 push de ROM3:4178 E5 push hl ROM3:4179 3E 12 ld a,12 ROM3:417B CD E3 0E call 0EE3 ROM3:417E 01 08 9A ld bc,9A08 ROM3:4181 16 00 ld d,00 ROM3:4183 1E 06 ld e,06 ROM3:4185 CD D2 10 call 10D2 ROM3:4188 03 inc bc ROM3:4189 03 inc bc ROM3:418A C5 push bc ROM3:418B 42 ld b,d ROM3:418C 0E 03 ld c,03 ROM3:418E CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:4191 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:4194 CD 46 52 call 5246 ROM3:4197 CD 3D 42 call 423D ROM3:419A C1 pop bc ROM3:419B 14 inc d ROM3:419C 1D dec e ROM3:419D 20 E6 jr nz,4185 ROM3:419F CD C1 10 call 10C1 ROM3:41A2 E1 pop hl ROM3:41A3 D1 pop de ROM3:41A4 C1 pop bc ROM3:41A5 F1 pop af ROM3:41A6 C9 ret
3:41A7
ROM3:41A7 F5 push af ROM3:41A8 C5 push bc ROM3:41A9 D5 push de ROM3:41AA E5 push hl ROM3:41AB 3E 12 ld a,12 ROM3:41AD CD E3 0E call 0EE3 ROM3:41B0 01 CA 99 ld bc,99CA ROM3:41B3 16 01 ld d,01 ROM3:41B5 1E 05 ld e,05 ROM3:41B7 CD D2 10 call 10D2 ROM3:41BA 03 inc bc ROM3:41BB 03 inc bc ROM3:41BC C5 push bc ROM3:41BD 42 ld b,d ROM3:41BE 0E 02 ld c,02 ROM3:41C0 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:41C3 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:41C6 CD 46 52 call 5246 ROM3:41C9 CD 3D 42 call 423D ROM3:41CC C1 pop bc ROM3:41CD 14 inc d ROM3:41CE 1D dec e ROM3:41CF 20 E6 jr nz,41B7 ROM3:41D1 CD C1 10 call 10C1 ROM3:41D4 E1 pop hl ROM3:41D5 D1 pop de ROM3:41D6 C1 pop bc ROM3:41D7 F1 pop af ROM3:41D8 C9 ret
3:41D9
ROM3:41D9 F5 push af ROM3:41DA C5 push bc ROM3:41DB D5 push de ROM3:41DC E5 push hl ROM3:41DD 3E 12 ld a,12 ROM3:41DF CD E3 0E call 0EE3 ROM3:41E2 01 4A 98 ld bc,984A ROM3:41E5 16 04 ld d,04 ROM3:41E7 1E 05 ld e,05 ROM3:41E9 CD D2 10 call 10D2 ROM3:41EC 03 inc bc ROM3:41ED 03 inc bc ROM3:41EE C5 push bc ROM3:41EF 42 ld b,d ROM3:41F0 0E 01 ld c,01 ROM3:41F2 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:41F5 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:41F8 CD 46 52 call 5246 ROM3:41FB CD 3D 42 call 423D ROM3:41FE C1 pop bc ROM3:41FF 15 dec d ROM3:4200 1D dec e ROM3:4201 20 E6 jr nz,41E9 ROM3:4203 CD C1 10 call 10C1 ROM3:4206 E1 pop hl ROM3:4207 D1 pop de ROM3:4208 C1 pop bc ROM3:4209 F1 pop af ROM3:420A C9 ret
Checks Hand + Trap Zone
ROM3:420B F5 push af ROM3:420C C5 push bc ROM3:420D D5 push de ROM3:420E E5 push hl ROM3:420F 3E 12 ld a,12 ROM3:4211 CD E3 0E call 0EE3 ;(Related to display) ROM3:4214 01 08 98 ld bc,9808 ROM3:4217 16 05 ld d,05 ROM3:4219 1E 06 ld e,06 ROM3:421B CD D2 10 call 10D2 ROM3:421E 03 inc bc ROM3:421F 03 inc bc ROM3:4220 C5 push bc ROM3:4221 42 ld b,d ROM3:4222 0E 00 ld c,00 ROM3:4224 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:4227 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:422A CD 46 52 call 5246 ROM3:422D CD 3D 42 call 423D ROM3:4230 C1 pop bc ROM3:4231 15 dec d ROM3:4232 1D dec e ;Loop 6 times ROM3:4233 20 E6 jr nz,421B ROM3:4235 CD C1 10 call 10C1 ;Copy (C5AE) to (C5AF, then sets (C5AE) to 0) ROM3:4238 E1 pop hl ROM3:4239 D1 pop de ROM3:423A C1 pop bc ROM3:423B F1 pop af ROM3:423C C9 ret
3:423D
ROM3:423D F5 push af ROM3:423E CD 13 11 call 1113 ;updates WRAM (C5AD), related to Battle display ROM3:4241 C6 02 add a,02 ROM3:4243 CD 13 11 call 1113 ROM3:4246 D6 01 sub a,01 ROM3:4248 CD 13 11 call 1113 ROM3:424B C6 02 add a,02 ROM3:424D CD 13 11 call 1113 ROM3:4250 F1 pop af ROM3:4251 C9 ret
CPU's deck
Blanks CPU's deck
ROM3:4252 F5 push af ROM3:4253 C5 push bc ROM3:4254 E5 push hl ROM3:4255 3E 00 ld a,00 ROM3:4257 EA AA C6 ld (C6AA),a ;CPU's deck counter = 0 ROM3:425A 21 5A C6 ld hl,C65A ;hl = Pointer to next card in CPU's deck ROM3:425D 0E 28 ld c,28 ROM3:425F 3E 00 ld a,00 ROM3:4261 22 ldi (hl),a ;Blanks CPU's deck ROM3:4262 3E 00 ld a,00 ROM3:4264 22 ldi (hl),a ROM3:4265 0D dec c ROM3:4266 20 F7 jr nz,425F ;Loops 40 times ROM3:4268 E1 pop hl ROM3:4269 C1 pop bc ROM3:426A F1 pop af ROM3:426B C9 ret
Writes value in CPU's deck counter
ROM3:426C EA AA C6 ld (C6AA),a ;CPU's deck counter = a ROM3:426F C9 ret
Writes 0 in CPU's deck counter
ROM3:4270 F5 push af ROM3:4271 AF xor a ROM3:4272 EA AA C6 ld (C6AA),a ;CPU's deck counter = 0 ROM3:4275 F1 pop af ROM3:4276 C9 ret
Removes card in CPU's deck
ROM3:4277 F5 push af ROM3:4278 C5 push bc ROM3:4279 E5 push hl ROM3:427A 06 00 ld b,00 ROM3:427C FA AA C6 ld a,(C6AA) ROM3:427F 4F ld c,a ROM3:4280 CB 21 sla c ;c = CPU's deck counter × 2 ROM3:4282 21 5A C6 ld hl,C65A ROM3:4285 09 add hl,bc ;hl = Pointer to next card in CPU's deck ROM3:4286 3E 00 ld a,00 ROM3:4288 22 ldi (hl),a ;Removes card in CPU's deck ROM3:4289 36 00 ld (hl),00 ROM3:428B E1 pop hl ROM3:428C C1 pop bc ROM3:428D F1 pop af ROM3:428E C9 ret
Loads next card in CPU's deck
ROM3:428F F5 push af ROM3:4290 E5 push hl ROM3:4291 06 00 ld b,00 ROM3:4293 FA AA C6 ld a,(C6AA) ROM3:4296 4F ld c,a ROM3:4297 CB 21 sla c ;c = CPU's deck counter × 2 ROM3:4299 21 5A C6 ld hl,C65A ROM3:429C 09 add hl,bc ;hl = Pointer to next card in CPU's deck ROM3:429D 2A ldi a,(hl) ;Loads card from CPU's deck ROM3:429E 4F ld c,a ROM3:429F 3A ldd a,(hl) ROM3:42A0 47 ld b,a ROM3:42A1 E1 pop hl ROM3:42A2 F1 pop af ROM3:42A3 C9 ret
Increments CPU's deck counter
ROM3:42A4 F5 push af ROM3:42A5 FA AA C6 ld a,(C6AA) ;a = CPU's cards drawn ROM3:42A8 FE 28 cp a,28 ROM3:42AA 30 04 jr nc,42B0 ;If 40 cards have been drawn by CPU, get out of this function ROM3:42AC 3C inc a ROM3:42AD EA AA C6 ld (C6AA),a ROM3:42B0 F1 pop af ROM3:42B1 C9 ret
Writes next card in CPU's deck
ROM3:42B2 F5 push af ROM3:42B3 E5 push hl ROM3:42B4 C5 push bc ROM3:42B5 06 00 ld b,00 ROM3:42B7 FA AA C6 ld a,(C6AA) ROM3:42BA 4F ld c,a ROM3:42BB CB 21 sla c ROM3:42BD 21 5A C6 ld hl,C65A ROM3:42C0 09 add hl,bc ;hl = Pointer to next card in CPU's deck ROM3:42C1 C1 pop bc ROM3:42C2 79 ld a,c ROM3:42C3 22 ldi (hl),a ;Writes card in CPU's deck ROM3:42C4 70 ld (hl),b ROM3:42C5 E1 pop hl ROM3:42C6 F1 pop af ROM3:42C7 C9 ret
CPU draws a card
ROM3:42C8 F5 push af ROM3:42C9 C5 push bc ROM3:42CA 47 ld b,a ROM3:42CB 0E 00 ld c,00 ROM3:42CD CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:42D0 CD E6 19 call 19E6 ;Remove CPU's Trap card from the field ROM3:42D3 CD 8F 42 call 428F ;Loads next card in CPU's deck ROM3:42D6 CD 77 42 call 4277 ;Removes card in CPU's deck ROM3:42D9 CD A4 42 call 42A4 ;Increments CPU's deck counter ROM3:42DC 79 ld a,c ROM3:42DD EA A3 C7 ld (C7A3),a ;(C7A3) = Card drawn by CPU ROM3:42E0 78 ld a,b ROM3:42E1 EA A4 C7 ld (C7A4),a ROM3:42E4 CD 18 20 call 2018 ;Card Owner = CPU ROM3:42E7 CD B4 1F call 1FB4 ;Reset Card Level ROM3:42EA CD D4 1F call 1FD4 ;Hide Card ROM3:42ED CD 2B 1A call 1A2B ;Updates Card ID and status ROM3:42F0 C1 pop bc ROM3:42F1 F1 pop af ROM3:42F2 C9 ret
CPU's starting hand
ROM3:42F3 F5 push af ROM3:42F4 C5 push bc ROM3:42F5 CD 70 42 call 4270 ;Writes 0 in CPU's deck counter ROM3:42F8 06 00 ld b,00 ROM3:42FA 0E 05 ld c,05 ROM3:42FC 78 ld a,b ROM3:42FD CD C8 42 call 42C8 ;CPU draws a card ROM3:4300 04 inc b ROM3:4301 0D dec c ROM3:4302 20 F8 jr nz,42FC ;Loop 5 times to 3:42FC ROM3:4304 C1 pop bc ROM3:4305 F1 pop af ROM3:4306 C9 ret
CPU's card drawing subroutine
ROM3:4307 F5 push af ROM3:4308 C5 push bc ROM3:4309 06 00 ld b,00 ;Column ROM3:430B 0E 05 ld c,05 ROM3:430D 78 ld a,b ROM3:430E CD EA 4E call 4EEA ;Checks if the card zone is free ROM3:4311 FE 01 cp a,01 ROM3:4313 20 12 jr nz,4327 ;If there is already a card in this card zone, jump to 3:4327 ROM3:4315 CD 2E 43 call 432E ;Counts cards remaining in CPU's deck ROM3:4318 FE 00 cp a,00 ROM3:431A 28 08 jr z,4324 ;If CPU has no more cards in its deck, jump to 3:4324 ROM3:431C 78 ld a,b ROM3:431D CD C8 42 call 42C8 ;CPU draws a card ROM3:4320 18 09 jr 432B ROM3:4322 18 03 jr 4327 ROM3:4324 CD 6B 24 call 246B ;Player wins ROM3:4327 04 inc b ;Next Column ROM3:4328 0D dec c ROM3:4329 20 E2 jr nz,430D ;Loop up to 5 times to 3:430D ROM3:432B C1 pop bc ROM3:432C F1 pop af ROM3:432D C9 ret
Counts cards remaining in CPU's deck
ROM3:432E C5 push bc ROM3:432F FA AA C6 ld a,(C6AA) ROM3:4332 4F ld c,a ;c = CPU's cards drawn ROM3:4333 3E 28 ld a,28 ROM3:4335 91 sub c ;a = 40 - CPU's cards drawn ROM3:4336 C1 pop bc ROM3:4337 C9 ret
Player's deck
3:4338
ROM3:4338 F5 push af ROM3:4339 C5 push bc ROM3:433A D5 push de ROM3:433B E5 push hl ROM3:433C AF xor a ROM3:433D EA 04 C7 ld (C704),a ROM3:4340 CD 2B 45 call 452B ;Player draws a card ROM3:4343 CF rst 08 ... ROM3:4349 FE 01 cp a,01 ROM3:434B 28 30 jr z,437D ROM3:434D CD 73 24 call 2473 ROM3:4350 FE 01 cp a,01 ROM3:4352 28 29 jr z,437D ROM3:4354 CF rst 08 ... ROM3:4357 CD 90 43 call 4390 ROM3:435A CD C2 43 call 43C2 ROM3:435D 06 00 ld b,00 ROM3:435F 4F ld c,a ROM3:4360 21 82 43 ld hl,4382 ROM3:4363 09 add hl,bc ROM3:4364 2A ldi a,(hl) ROM3:4365 66 ld h,(hl) ROM3:4366 6F ld l,a ROM3:4367 01 6C 43 ld bc,436C ROM3:436A C5 push bc ROM3:436B E9 jp hl ROM3:436C CD 73 24 call 2473 ;Duel Win and Loss subroutine ROM3:436F FE 01 cp a,01 ROM3:4371 28 07 jr z,437A ;If the duel is finished, jump to 3:437A ROM3:4373 FA 04 C7 ld a,(C704) ROM3:4376 FE 01 cp a,01 ROM3:4378 20 E0 jr nz,435A ROM3:437A CD B2 43 call 43B2 ROM3:437D E1 pop hl ROM3:437E D1 pop de ROM3:437F C1 pop bc ROM3:4380 F1 pop af ROM3:4381 C9 ret
3:4382 (Pointers array)
ROM3:4382 FC 43 06 44 17 44 24 44 31 44 3E 44 4B 44
3:4390
ROM3:4390 CD 8A 79 call 798A ROM3:4393 CD 57 78 call 7857 ROM3:4396 CD BF 2C call 2CBF ROM3:4399 CF rst 08 ... ROM3:439F CD 2B 50 call 502B ROM3:43A2 CF rst 08 ... ROM3:43A8 CD 8E 48 call 488E ROM3:43AB CD AD 12 call 12AD ROM3:43AE CD 14 7B call 7B14 ROM3:43B1 C9 ret
3:43B2
ROM3:43B2 CF rst 08 ... ROM3:43B8 CD 7E 2C call 2C7E ;Decrease Swords of Revealing Light counter by 1 ROM3:43BB CF rst 08 ... ROM3:43C1 C9 ret
3:43C2
ROM3:43C2 C5 push bc ROM3:43C3 D5 push de ROM3:43C4 E5 push hl ROM3:43C5 16 00 ld d,00 ROM3:43C7 FA A8 C5 ld a,(C5A8) ROM3:43CA E6 F3 and a,F3 ROM3:43CC 28 0D jr z,43DB ROM3:43CE 0E 08 ld c,08 ROM3:43D0 0D dec c ROM3:43D1 07 rlca ROM3:43D2 30 FC jr nc,43D0 ROM3:43D4 06 00 ld b,00 ROM3:43D6 21 F4 43 ld hl,43F4 ROM3:43D9 09 add hl,bc ROM3:43DA 56 ld d,(hl) ROM3:43DB FA A7 C5 ld a,(C5A7) ROM3:43DE E6 F0 and a,F0 ROM3:43E0 28 0D jr z,43EF ROM3:43E2 0E 08 ld c,08 ROM3:43E4 0D dec c ROM3:43E5 07 rlca ROM3:43E6 30 FC jr nc,43E4 ROM3:43E8 06 00 ld b,00 ROM3:43EA 21 F4 43 ld hl,43F4 ROM3:43ED 09 add hl,bc ROM3:43EE 56 ld d,(hl) ROM3:43EF 7A ld a,d ROM3:43F0 E1 pop hl ROM3:43F1 D1 pop de ROM3:43F2 C1 pop bc ROM3:43F3 C9 ret
Removes top card from Player's deck
0xC47D-0xC494
- 00s top card from Player's deck
ROM3:447D F5 push af ROM3:447E C5 push bc ROM3:447F E5 push hl ROM3:4480 06 00 ld b,00 ROM3:4482 FA 55 C7 ld a,(C755) ROM3:4485 4F ld c,a ROM3:4486 CB 21 sla c ROM3:4488 21 05 C7 ld hl,C705 ROM3:448B 09 add hl,bc ROM3:448C 3E 00 ld a,00 ROM3:448E 22 ldi (hl),a ROM3:448F 36 00 ld (hl),00 ROM3:4491 E1 pop hl ROM3:4492 C1 pop bc ROM3:4493 F1 pop af ROM3:4494 C9 ret
Copies top card from Player's deck
0xC495-0xC4A8
- Copies top card from Player's deck in register bc
ROM3:4495 F5 push af ROM3:4496 E5 push hl ROM3:4497 06 00 ld b,00 ROM3:4499 FA 55 C7 ld a,(C755) ROM3:449C 4F ld c,a ROM3:449D CB 21 sla c ROM3:449F 21 05 C7 ld hl,C705 ROM3:44A2 09 add hl,bc ROM3:44A3 2A ldi a,(hl) ROM3:44A4 4F ld c,a ROM3:44A5 46 ld b,(hl) ROM3:44A6 E1 pop hl ROM3:44A7 F1 pop af ROM3:44A8 C9 ret
Increases cards drawn counter
0xC4A9-0xC4B6
- Increases the number of cards that have been drawn during the duel.
ROM3:44A9 F5 push af ROM3:44AA FA 55 C7 ld a,(C755) ;Cards drawn during this duel ROM3:44AD FE 28 cp a,28 ROM3:44AF 30 04 jr nc,44B5 ;If more than 40 cards have been drawn, exit this function ROM3:44B1 3C inc a ROM3:44B2 EA 55 C7 ld (C755),a ;Cards drawn ++ ROM3:44B5 F1 pop af ROM3:44B6 C9 ret
Card drawing subroutine
0xC4E4-0xC516
- Copies the top card from Player's deck, then removes top card from Player's deck, increases the card drawn counter, then put the copied card into Player's Hand.
ROM3:44E4 F5 push af ROM3:44E5 C5 push bc ROM3:44E6 47 ld b,a ROM3:44E7 CD F3 4E call 4EF3 ROM3:44EA FE 00 cp a,00 ROM3:44EC 28 26 jr z,4514 ROM3:44EE FA 55 C7 ld a,(C755) ;Cards drawn during this duel ROM3:44F1 FE 28 cp a,28 ROM3:44F3 30 1F jr nc,4514 ;If more than 40 cards have been drawn during this duel, jump to 3:4514 ROM3:44F5 0E 03 ld c,03 ROM3:44F7 CD D0 19 call 19D0 ;Set column and row to bc ROM3:44FA CD 95 44 call 4495 ;Copies top card from Player's deck ROM3:44FD CD 7D 44 call 447D ;Removes top card from Player's deck ROM3:4500 CD A9 44 call 44A9 ;Increases cards drawn counter ROM3:4503 79 ld a,c ROM3:4504 EA A3 C7 ld (C7A3),a ;Copies card ID to (C7A3) ROM3:4507 78 ld a,b ROM3:4508 EA A4 C7 ld (C7A4),a ROM3:450B CD 18 20 call 2018 ROM3:450E CD B4 1F call 1FB4 ;Reset Card Level ROM3:4511 CD 2B 1A call 1A2B ROM3:4514 C1 pop bc ROM3:4515 F1 pop af ROM3:4516 C9 ret
Player draws a card
0xC52B-0xC551
- Player draws a card
ROM3:452B F5 push af ROM3:452C C5 push bc ROM3:452D 06 01 ld b,01 ROM3:452F 0E 05 ld c,05 ROM3:4531 78 ld a,b ROM3:4532 CD F3 4E call 4EF3 ROM3:4535 FE 01 cp a,01 ROM3:4537 20 12 jr nz,454B ROM3:4539 CD 52 45 call 4552 ;Cards remaining in deck ROM3:453C FE 00 cp a,00 ROM3:453E 28 08 jr z,4548 ;If there's no card left in the deck, jump to 3:4548 ROM3:4540 78 ld a,b ROM3:4541 CD E4 44 call 44E4 ;Card drawing subroutine ROM3:4544 18 09 jr 454F ROM3:4546 18 03 jr 454B ROM3:4548 CD 63 24 call 2463 ;Player loses ROM3:454B 04 inc b ROM3:454C 0D dec c ROM3:454D 20 E2 jr nz,4531 ROM3:454F C1 pop bc ROM3:4550 F1 pop af ROM3:4551 C9 ret
Cards remaining in deck
ROM3:4552 C5 push bc ROM3:4553 FA 55 C7 ld a,(C755) ;Cards drawn during this duel ROM3:4556 4F ld c,a ROM3:4557 3E 28 ld a,28 ROM3:4559 91 sub c ;a = 40 - cards drawn ROM3:455A C1 pop bc ROM3:455B C9 ret
3:455C
ROM3:455C CD 47 24 call 2447 ;First turn, no attack ROM3:455F CD 2C 41 call 412C ROM3:4562 CD A9 19 call 19A9 ROM3:4565 CD 92 40 call 4092 ROM3:4568 CD DF 40 call 40DF ROM3:456B CD 99 5D call 5D99 ROM3:456E CD 17 45 call 4517 ROM3:4571 CD 1A 2C call 2C1A ROM3:4574 CD 64 2C call 2C64 ROM3:4577 CD 83 30 call 3083 ROM3:457A CF rst 08 ... ROM3:457D C9 ret
3:457E
ROM3:457E F5 push af ROM3:457F CD FE 1C call 1CFE ROM3:4582 CD 5C 45 call 455C ROM3:4585 CF rst 08 ... ROM3:4588 CD BD 12 call 12BD ;Blanks card illustration ROM3:458B CD E1 52 call 52E1 ROM3:458E FE 00 cp a,00 ROM3:4590 20 05 jr nz,4597 ROM3:4592 CD 9E 45 call 459E ROM3:4595 18 05 jr 459C ROM3:4597 3E 1A ld a,1A ROM3:4599 CF rst 08 ... ROM3:459C F1 pop af ROM3:459D C9 ret
Attack Phase
Attack Phase - Main
0xCDDF-0xCE3C
- Attack Phase. Everything that happens when the Player attacks is handled here.
ROM3:4DE1 CD 99 2A call 2A99 ;Sound Effect: Validate (Duel) ROM3:4DE4 CD 9A 2C call 2C9A ;Checks Swords of Revealing Light ROM3:4DE7 FE 00 cp a,00 ROM3:4DE9 20 1A jr nz,4E05 ;If Swords of Revealing Light is not active, jump to 3:4E05 ROM3:4DEB FA 00 C7 ld a,(C700) ;If Swords of Revealing Light is active... ROM3:4DEE 47 ld b,a ROM3:4DEF 0E 02 ld c,02 ROM3:4DF1 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:4DF4 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:4DF7 CD DF 1F call 1FDF ;Freeze Attacking Monster ROM3:4DFA CD 12 50 call 5012 ;Loads attacking monster ID, rst 08 and does stuff to document ROM3:4DFD CD FB 19 call 19FB ;Update selected card ID and status ROM3:4E00 CD 2C 61 call 612C ROM3:4E03 18 35 jr 4E3A ROM3:4E05 FA 00 C7 ld a,(C700) ;If Swords of Revealing Light is not active... ROM3:4E08 47 ld b,a ROM3:4E09 0E 02 ld c,02 ROM3:4E0B CD 9F 5B call 5B9F ROM3:4E0E CD 18 4F call 4F18 ROM3:4E11 FE 00 cp a,00 ROM3:4E13 28 05 jr z,4E1A ROM3:4E15 CD 02 61 call 6102 ROM3:4E18 18 20 jr 4E3A ROM3:4E1A FA 00 C7 ld a,(C700) ROM3:4E1D 47 ld b,a ROM3:4E1E 0E 02 ld c,02 ROM3:4E20 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:4E23 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:4E26 CD DF 1F call 1FDF ;Freeze Attacking Monster ROM3:4E29 CD 12 50 call 5012 ;Loads attacking monster ID, rst 08 and does stuff to document ROM3:4E2C CD FB 19 call 19FB ROM3:4E2F CD 12 61 call 6112 ;rst 08, then handles Battle Display ROM3:4E32 3E 01 ld a,01 ROM3:4E34 EA 4C C8 ld (C84C),a ROM3:4E37 CD B7 5C call 5CB7 ROM3:4E3A C1 pop bc ROM3:4E3B F1 pop af
Stores processed card ID
0xCECB-0xCEE9
- Stores processed card ID, and check if there's a card in the selected card zone.
ROM3:4ECB C5 push bc ROM3:4ECC D5 push de ROM3:4ECD 1E 01 ld e,01 ROM3:4ECF CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:4ED2 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:4ED5 FA A3 C7 ld a,(C7A3) ;Loads processed card ID in accumulator, then stores it in register bc ROM3:4ED8 4F ld c,a ROM3:4ED9 FA A4 C7 ld a,(C7A4) ROM3:4EDC 47 ld b,a ROM3:4EDD CD 72 1A call 1A72 ;Sets accumulator to 1 if there is no card in this row and column, 0 otherwise ROM3:4EE0 FE 00 cp a,00 ROM3:4EE2 20 02 jr nz,4EE6 ROM3:4EE4 1E 00 ld e,00 ROM3:4EE6 7B ld a,e ROM3:4EE7 D1 pop de ROM3:4EE8 C1 pop bc ROM3:4EE9 C9 ret
Checks if card zone is free
ROM3:4EEA C5 push bc ROM3:4EEB 47 ld b,a ROM3:4EEC 0E 00 ld c,00 ROM3:4EEE CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:4EF1 C1 pop bc ROM3:4EF2 C9 ret
3:4F18
0xCF18-0xCF33
-
ROM3:4F18 C5 push bc ROM3:4F19 D5 push de ROM3:4F1A 06 00 ld b,00 ROM3:4F1C 0E 01 ld c,01 ROM3:4F1E 1E 00 ld e,00 ROM3:4F20 78 ld a,b ROM3:4F21 FE 05 cp a,05 ROM3:4F23 30 0B jr nc,4F30 ROM3:4F25 CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:4F28 FE 00 cp a,00 ROM3:4F2A 20 01 jr nz,4F2D ROM3:4F2C 1C inc e ROM3:4F2D 04 inc b ROM3:4F2E 18 F0 jr 4F20 ROM3:4F30 7B ld a,e ROM3:4F31 D1 pop de ROM3:4F32 C1 pop bc
Freeze card in Hand
ROM3:4FEC F5 push af ROM3:4FED C5 push bc ROM3:4FEE D5 push de ROM3:4FEF 06 01 ld b,01 ROM3:4FF1 0E 03 ld c,03 ROM3:4FF3 16 00 ld d,00 ROM3:4FF5 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:4FF8 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:4FFB CD F2 51 call 51F2 ROM3:4FFE FE 00 cp a,00 ROM3:5000 20 06 jr nz,5008 ROM3:5002 CD DF 1F call 1FDF ;Freeze card ROM3:5005 CD FB 19 call 19FB ;Updates selected card ID and status ROM3:5008 04 inc b ROM3:5009 78 ld a,b ROM3:500A FE 06 cp a,06 ROM3:500C 38 E7 jr c,4FF5 ;Loop until every Monster card in Hand is frozen ROM3:500E D1 pop de ROM3:500F C1 pop bc ROM3:5010 F1 pop af ROM3:5011 C9 ret
Stores attacking monster ID in bc
0xD012-0xD01C
- Loads attacking monster ID in register bc
ROM3:5012 F5 push af ROM3:5013 C5 push bc ROM3:5014 FA A3 C7 ld a,(C7A3) ROM3:5017 4F ld c,a ROM3:5018 FA A4 C7 ld a,(C7A4) ROM3:501B 47 ld b,a ROM3:501C CF rst 08
Reveal stored Monster ID
0xD012-0xD01C
- Reveal stored Monster ID
ROM3:501F CF rst 08 ... ROM3:5022 CF rst 08 ... ROM3:5025 CD C9 1F call 1FC9 ;Reveal card ROM3:5028 C1 pop bc ROM3:5029 F1 pop af ROM3:502A C9 ret
Increase card Level subroutine
0xD0C7-0xD0D6
-
ROM3:50C7 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:50CA CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:50CD CD 70 1F call 1F70 ;Increase Card Level ROM3:50D0 CD C9 1F call 1FC9 ;Reveal Card ROM3:50D3 CD FB 19 call 19FB ;Update selected card ID and status ROM3:50D6 C9 ret
3:50D7
ROM3:50D7 C5 push bc ROM3:50D8 01 01 00 ld bc,0001 ROM3:50DB CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:50DE FE 01 cp a,01 ROM3:50E0 28 06 jr z,50E8 ROM3:50E2 04 inc b ROM3:50E3 78 ld a,b ROM3:50E4 FE 05 cp a,05 ROM3:50E6 38 F3 jr c,50DB ROM3:50E8 78 ld a,b ROM3:50E9 C1 pop bc ROM3:50EA C9 ret
3:50EB
ROM3:50EB C5 push bc ROM3:50EC 01 02 01 ld bc,0102 ROM3:50EF CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:50F2 FE 01 cp a,01 ROM3:50F4 28 06 jr z,50FC ROM3:50F6 04 inc b ROM3:50F7 78 ld a,b ROM3:50F8 FE 06 cp a,06 ROM3:50FA 38 F3 jr c,50EF ROM3:50FC 78 ld a,b ROM3:50FD C1 pop bc ROM3:50FE C9 ret
3:50FF
ROM3:50FF C5 push bc ROM3:5100 01 02 01 ld bc,0102 ROM3:5103 CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:5106 FE 01 cp a,01 ROM3:5108 28 06 jr z,5110 ROM3:510A 04 inc b ROM3:510B 78 ld a,b ROM3:510C FE 06 cp a,06 ROM3:510E 38 F3 jr c,5103 ROM3:5110 78 ld a,b ROM3:5111 FE 06 cp a,06 ROM3:5113 20 02 jr nz,5117 ROM3:5115 06 01 ld b,01 ROM3:5117 78 ld a,b ROM3:5118 C1 pop bc ROM3:5119 C9 ret
Retrieve strongest CPU's Monster ID
0xD1B1-0xD1C6
- Retrieves card ID + card status of the strongest CPU's Monster
ROM3:51B1 D5 push de ROM3:51B2 E5 push hl ROM3:51B3 16 01 ld d,01 ROM3:51B5 1E 00 ld e,00 ROM3:51B7 21 00 00 ld hl,0000 ROM3:51BA 01 01 00 ld bc,0001 ;Column 1, Row 0 ROM3:51BD CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:51C0 FE 00 cp a,00 ;If there's no card being processed, check next card zone ROM3:51C2 20 23 jr nz,51E7 ;Increases card column being checked ROM3:51C4 C5 push bc ROM3:51C5 D5 push de ROM3:51C6 CF rst 08 ROM3:51C7 0B 07 => Pointer 07:400B ROM3:51C9 54 ld d,h ROM3:51CA 5D ld e,l ROM3:51CB FA B7 C6 ld a,(C6B7) ROM3:51CE 4F ld c,a ROM3:51CF FA B8 C6 ld a,(C6B8) ROM3:51D2 47 ld b,a ;bc = Current card ATK ROM3:51D3 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM3:51D6 D1 pop de ROM3:51D7 C1 pop bc ROM3:51D8 FE 02 cp a,02 ROM3:51DA 28 0B jr z,51E7 ;If(Current card ATK < Strongest ATK), jump to 3:51E7 ROM3:51DC FA B7 C6 ld a,(C6B7) ROM3:51DF 6F ld l,a ROM3:51E0 FA B8 C6 ld a,(C6B8) ROM3:51E3 67 ld h,a ;hl = Strongest ATK ROM3:51E4 58 ld e,b ROM3:51E5 16 00 ld d,00 ROM3:51E7 04 inc b ROM3:51E8 78 ld a,b ROM3:51E9 FE 06 cp a,06 ROM3:51EB 38 D0 jr c,51BD ;Loop to 3:51BD until every Monster Card Zone has been checked ROM3:51ED 7A ld a,d ROM3:51EE 43 ld b,e ROM3:51EF E1 pop hl ROM3:51F0 D1 pop de ROM3:51F1 C9 ret
3:51F2
ROM3:51F2 C5 push bc ROM3:51F3 D5 push de ROM3:51F4 1E 01 ld e,01 ROM3:51F6 CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:51F9 FE 00 cp a,00 ROM3:51FB 20 0C jr nz,5209 ROM3:51FD CF rst 08 ROM3:51FE 0B dec bc ROM3:51FF 07 rlca ROM3:5200 FA BF C6 ld a,(C6BF) ROM3:5203 FE 02 cp a,02 ROM3:5205 20 02 jr nz,5209 ROM3:5207 1E 00 ld e,00 ROM3:5209 7B ld a,e ROM3:520A D1 pop de ROM3:520B C1 pop bc ROM3:520C C9 ret
Check if selected card ID = register de
ROM3:520D C5 push bc ROM3:520E E5 push hl ROM3:520F 2E 01 ld l,01 ROM3:5211 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:5214 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:5217 FA A3 C7 ld a,(C7A3) ;Card being processed ROM3:521A 4F ld c,a ROM3:521B FA A4 C7 ld a,(C7A4) ROM3:521E 47 ld b,a ROM3:521F CD 14 1B call 1B14 ;Check if bc = de ROM3:5222 FE 00 cp a,00 ROM3:5224 20 02 jr nz,5228 ROM3:5226 2E 00 ld l,00 ROM3:5228 7D ld a,l ROM3:5229 E1 pop hl ROM3:522A C1 pop bc ROM3:522B C9 ret
Checks if a specific Monster card is on the field
ROM3:522C E5 push hl ROM3:522D 2E 01 ld l,01 ROM3:522F 06 00 ld b,00 ROM3:5231 78 ld a,b ROM3:5232 FE 06 cp a,06 ROM3:5234 30 0D jr nc,5243 ;If all the Monster cards have been checked, jump to 3:5243 ROM3:5236 CD 0D 52 call 520D ;Check if selected card ID = register de ROM3:5239 FE 00 cp a,00 ROM3:523B 20 03 jr nz,5240 ROM3:523D 6F ld l,a ROM3:523E 18 03 jr 5243 ROM3:5240 04 inc b ROM3:5241 18 EE jr 5231 ROM3:5243 7D ld a,l ROM3:5244 E1 pop hl ROM3:5245 C9 ret
3:5246
ROM3:5246 C5 push bc ROM3:5247 D5 push de ROM3:5248 E5 push hl ROM3:5249 1E 00 ld e,00 ROM3:524B FA A3 C7 ld a,(C7A3) ;bc = Card being processed ROM3:524E 4F ld c,a ROM3:524F FA A4 C7 ld a,(C7A4) ROM3:5252 47 ld b,a ROM3:5253 CD 72 1A call 1A72 ;Checks if there is a card being processed ROM3:5256 FE 01 cp a,01 ROM3:5258 28 20 jr z,527A ;If no card is being processed, jump to 3:527A ROM3:525A 21 8E 52 ld hl,528E ROM3:525D CD 4F 20 call 204F ;Retrieve Card Frozen status ROM3:5260 FE 00 cp a,00 ROM3:5262 20 03 jr nz,5267 ;If the card is Frozen, jump to 3:5267 ROM3:5264 21 8A 52 ld hl,528A ROM3:5267 CD DB 19 call 19DB ;Retrieves field Column and Row ROM3:526A 79 ld a,c ROM3:526B FE 00 cp a,00 ROM3:526D 20 03 jr nz,5272 ;If not Row 0, jump to 3:5272 ROM3:526F 21 8A 52 ld hl,528A ROM3:5272 CD 3F 20 call 203F ;Stores owner, card existence and "stay Frozen" status flags in accumulator ROM3:5275 06 00 ld b,00 ROM3:5277 4F ld c,a ROM3:5278 09 add hl,bc ;hl = 0x528A + card flags, or 0x528E + card flags ROM3:5279 5E ld e,(hl) ROM3:527A CD 92 52 call 5292 ;Compares Column/Row to check with current Column/Row ROM3:527D FE 01 cp a,01 ROM3:527F 20 04 jr nz,5285 ;If Column and Row to check ≠ current Column and Row, jump to 3:5285 ROM3:5281 7B ld a,e ROM3:5282 C6 14 add a,14 ROM3:5284 5F ld e,a ROM3:5285 7B ld a,e ;a = (hl) + 0x14, or a = (hl) ROM3:5286 E1 pop hl ROM3:5287 D1 pop de ROM3:5288 C1 pop bc ROM3:5289 C9 ret
3:528A (data array)
ROM3:528A 00 04 04 08 00 0C 0C 10
Compares Column/Row to check with current Column/Row
ROM3:5292 C5 push bc ROM3:5293 D5 push de ROM3:5294 1E 00 ld e,00 ROM3:5296 CD DB 19 call 19DB ;Retrieves field Column and Row ROM3:5299 CF rst 08 ;to 1:72D3 ROM3:529A 4D 01 => pointer 1:404D ROM3:529B FA 00 C7 ld a,(C700) ;Column to check ROM3:529F B8 cp b ROM3:52A0 20 08 jr nz,52AA ROM3:52A2 FA 01 C7 ld a,(C701) ;Row to check ROM3:52A5 B9 cp c ROM3:52A6 20 02 jr nz,52AA ;If Column and Row to check ≠ Column and Row stored in bc, e=0 and jump to 3:52AA ROM3:52A8 1E 01 ld e,01 ;Else e=1 ROM3:52AA 7B ld a,e ROM3:52AB D1 pop de ROM3:52AC C1 pop bc ROM3:52AD C9 ret
Duel values - send for Game Link
ROM3:5535 FA C7 C5 ld a,(C5C7) ;a = P1's Life Points ROM3:5538 CD 91 1D call 1D91 ROM3:553B FA C8 C5 ld a,(C5C8) ;a = P1's Life Points ROM3:553E CD 91 1D call 1D91 ROM3:5541 FA CA C5 ld a,(C5CA) ;a = P2's Life Points ROM3:5544 CD 91 1D call 1D91 ROM3:5547 FA CB C5 ld a,(C5CB) ;a = P2's Life Points ROM3:554A CD 91 1D call 1D91 ROM3:554D FA E8 C5 ld a,(C5E8) ;a = Field ID ROM3:5550 CD 91 1D call 1D91 ROM3:5553 FA D1 C8 ld a,(C8D1) ;a = First turn and Duel winner - P1 ROM3:5556 CD 91 1D call 1D91 ROM3:5559 FA 97 C9 ld a,(C997) ;a = ? ROM3:555C CD 91 1D call 1D91 ROM3:555F FA 98 C9 ld a,(C998) ;a = ? ROM3:5562 CD 91 1D call 1D91 ROM3:5565 FA 99 C9 ld a,(C999) ;a = P1's Swords of Revealing Light ROM3:5568 CD 91 1D call 1D91 ROM3:556B FA 9A C9 ld a,(C99A) ;a = P2's Swords of Revealing Light ROM3:556E CD 91 1D call 1D91 ROM3:5571 FA 55 C7 ld a,(C755) ;a = P1's deck size / cards drawn ROM3:5574 CD 91 1D call 1D91 ROM3:5577 F1 pop af ROM3:5578 C9 ret
Duel values - receive from Game Link
ROM3:5579 F5 push af ROM3:557A CD D4 1D call 1DD4 ROM3:557D EA CA C5 ld (C5CA),a ;P2's Life Points ROM3:5580 CD D4 1D call 1DD4 ROM3:5583 EA CB C5 ld (C5CB),a ;P2's Life Points ROM3:5586 CD D4 1D call 1DD4 ROM3:5589 EA C7 C5 ld (C5C7),a ;P1's Life Points ROM3:558C CD D4 1D call 1DD4 ROM3:558F EA C8 C5 ld (C5C8),a ;P1's Life Points ROM3:5592 CD D4 1D call 1DD4 ROM3:5595 EA E8 C5 ld (C5E8),a ;Field ID ROM3:5598 CD D4 1D call 1DD4 ROM3:559B EA D2 C8 ld (C8D2),a ;First turn and Duel winner - P2 ROM3:559E CD D4 1D call 1DD4 ROM3:55A1 EA 98 C9 ld (C998),a ;? ROM3:55A4 CD D4 1D call 1DD4 ROM3:55A7 EA 97 C9 ld (C997),a ;? ROM3:55AA CD D4 1D call 1DD4 ROM3:55AD EA 9A C9 ld (C99A),a ;P2's Swords of Revealing Light ROM3:55B0 CD D4 1D call 1DD4 ROM3:55B3 EA 99 C9 ld (C999),a ;P1's Swords of Revealing Light ROM3:55B6 CD D4 1D call 1DD4 ROM3:55B9 EA AA C6 ld (C6AA),a ;P2's deck size / cards drawn ROM3:55BC F1 pop af ROM3:55BD C9 ret
Damage Calculation
0xD777-0xD7A3
- Handles Damage Calculation
ROM3:5777 F5 push af ROM3:5778 C5 push bc ROM3:5779 E5 push hl ROM3:577A 3E 00 ld a,00 ROM3:577C EA C5 C7 ld (C7C5),a ROM3:577F 06 00 ld b,00 ROM3:5781 FA B2 C7 ld a,(C7B2) ;Loads type of damage in accumulator ROM3:5784 4F ld c,a ROM3:5785 CB 21 sla c ROM3:5787 21 A4 57 ld hl,57A4 ROM3:578A 09 add hl,bc ROM3:578B 2A ldi a,(hl) ROM3:578C 66 ld h,(hl) ROM3:578D 6F ld l,a ROM3:578E 01 93 57 ld bc,5793 ROM3:5791 C5 push bc ROM3:5792 E9 jp hl ;Jump to address from 0xD7A4-0xD7B9 depending on the type of damage ROM3:5793 FA B2 C7 ld a,(C7B2) ;Loads type of damage in accumulator ROM3:5796 FE 00 cp a,00 ROM3:5798 28 06 jr z,57A0 ;If no damage, skip Life Points calculation ROM3:579A CD 9D 5A call 5A9D ;Copies Player's and CPU's Life Points ROM3:579D CD C4 5A call 5AC4 ;Copies Player's and CPU's monsters IDs / Alignment / ATK / DEF ROM3:57A0 E1 pop hl ROM3:57A1 C1 pop bc ROM3:57A2 F1 pop af ROM3:57A3 C9 ret
0xD7A4-0xD7B9
- Addresses called by function at 0xD777, depending on type of damage.
3:57BA - No Damage (ret) 3:57BB 3:582F 3:588E 3:58EE - Direct Attack vs CPU 3:588F 3:590F 3:5930 3:5940 3:5957 - Spell Damage vs CPU 3:596E
Direct Attack vs CPU
0xD8EE-0xD90E
- Player's monster attacks directly the opponent.
ROM3:58EE F5 push af ROM3:58EF C5 push bc ROM3:58F0 D5 push de ROM3:58F1 CD F8 22 call 22F8 ;Copies 0x00 in (C8A7) ROM3:58F4 FA BD C7 ld a,(C7BD) ROM3:58F7 4F ld c,a ROM3:58F8 FA BE C7 ld a,(C7BE) ROM3:58FB 47 ld b,a ;Copies Player's monster ATK in register bc ROM3:58FC CD 70 5B call 5B70 ;Inflict damage to CPU's Life Points ROM3:58FF FE 02 cp a,02 ROM3:5901 28 03 jr z,5906 ;If Direct Attack damage ≤ CPU's Life Points, jump to 3:5906 ROM3:5903 CD 92 5A call 5A92 ;(C7C5) | 0x08 ROM3:5906 3E 0A ld a,0A ROM3:5908 CD 00 23 call 2300 ;Copies 0x0A in (C8A7) ROM3:590B D1 pop de ROM3:590C C1 pop bc ROM3:590D F1 pop af ROM3:590E C9 ret
Spell Damage vs CPU
ROM3:5957 F5 push af ROM3:5958 C5 push bc ROM3:5959 FA BF C7 ld a,(C7BF) ROM3:595C 4F ld c,a ROM3:595D FA C0 C7 ld a,(C7C0) ROM3:5960 47 ld b,a ;Copies Player's Spell Damage in register bc ROM3:5961 CD 70 5B call 5B70 ;Inflict damage to CPU's Life Points ROM3:5964 FE 02 cp a,02 ROM3:5966 28 03 jr z,596B ;If Spell Damage ≤ CPU's Life Points, jump to 3:596B ROM3:5968 CD 92 5A call 5A92 ;(C7C5) | 0x08 ROM3:596B C1 pop bc ROM3:596C F1 pop af ROM3:596D C9 ret
Stores damage type
0xD99D-0xD9A0
- Stores damage type in0xC7B2
ROM3:599D EA B2 C7 ld (C7B2),a ROM3:59A0 C9 ret
Loads Player's Monster data
0xD9A1-0xD9CD
- Loads Player's monster ATK / DEF / Alignment
ROM3:59A1 F5 push af ROM3:59A2 FA B3 C6 ld a,(C6B3) ROM3:59A5 EA B3 C7 ld (C7B3),a ROM3:59A8 FA B4 C6 ld a,(C6B4) ROM3:59AB EA B4 C7 ld (C7B4),a ;Stores Card ID in (C7B3) ROM3:59AE FA B7 C6 ld a,(C6B7) ROM3:59B1 EA BD C7 ld (C7BD),a ROM3:59B4 FA B8 C6 ld a,(C6B8) ROM3:59B7 EA BE C7 ld (C7BE),a ;Stores Card ATK in (C7BD) ROM3:59BA FA B9 C6 ld a,(C6B9) ROM3:59BD EA C1 C7 ld (C7C1),a ROM3:59C0 FA BA C6 ld a,(C6BA) ROM3:59C3 EA C2 C7 ld (C7C2),a ;Stores Card DEF in (C7C1) ROM3:59C6 FA BE C6 ld a,(C6BE) ROM3:59C9 EA B7 C7 ld (C7B7),a ;Stores Card Alignment in (C7B7) ROM3:59CC F1 pop af ROM3:59CD C9 ret
Loads CPU's Monster data
0xD9CE-0xD9FA
- Loads CPU's monster ATK / DEF / Alignment
ROM3:59CE F5 push af ROM3:59CF FA B3 C6 ld a,(C6B3) ROM3:59D2 EA B5 C7 ld (C7B5),a ROM3:59D5 FA B4 C6 ld a,(C6B4) ROM3:59D8 EA B6 C7 ld (C7B6),a ;Stores Card ID in (C7B5) ROM3:59DB FA B7 C6 ld a,(C6B7) ROM3:59DE EA BF C7 ld (C7BF),a ROM3:59E1 FA B8 C6 ld a,(C6B8) ROM3:59E4 EA C0 C7 ld (C7C0),a ;Stores Card ATK in (C7BF) ROM3:59E7 FA B9 C6 ld a,(C6B9) ROM3:59EA EA C3 C7 ld (C7C3),a ROM3:59ED FA BA C6 ld a,(C6BA) ROM3:59F0 EA C4 C7 ld (C7C4),a ;Stores Card DEF in (C7C3) ROM3:59F3 FA BE C6 ld a,(C6BE) ROM3:59F6 EA B8 C7 ld (C7B8),a ;Stores Card Alignment in (C7B8) ROM3:59F9 F1 pop af ROM3:59FA C9 ret
Copies Player's Life Points
0xD9FB-0xDA0F
- Copies Player's Life Points in (C7B9) and (C893)
ROM3:59FB F5 push af ROM3:59FC FA C7 C5 ld a,(C5C7) ;Player's Life Points ROM3:59FF EA B9 C7 ld (C7B9),a ROM3:5A02 EA 93 C8 ld (C893),a ROM3:5A05 FA C8 C5 ld a,(C5C8) ROM3:5A08 EA BA C7 ld (C7BA),a ROM3:5A0B EA 94 C8 ld (C894),a ROM3:5A0E F1 pop af ROM3:5A0F C9 ret
Copies CPU's Life Points
0xD9FB-0xDA0F
- Copies CPU's Life Points in (C7BB) and (C89E)
ROM3:5A10 F5 push af ROM3:5A11 FA CA C5 ld a,(C5CA) ;CPU's Life Points ROM3:5A14 EA BB C7 ld (C7BB),a ROM3:5A17 EA 9E C8 ld (C89E),a ROM3:5A1A FA CB C5 ld a,(C5CB) ROM3:5A1D EA BC C7 ld (C7BC),a ROM3:5A20 EA 9F C8 ld (C89F),a ROM3:5A23 F1 pop af ROM3:5A24 C9 ret
3:5A92
0xDA92-0xDA9C
- (C7C5) | 0x08
ROM3:5A92 F5 push af ROM3:5A93 FA C5 C7 ld a,(C7C5) ROM3:5A96 F6 08 or a,08 ROM3:5A98 EA C5 C7 ld (C7C5),a ROM3:5A9B F1 pop af ROM3:5A9C C9 ret
Copies Player's and CPU's Life Points
0xDA9D-0xDAC3
- Copies Player's and CPU's Life Points for damage calculation
ROM3:5A9D F5 push af ROM3:5A9E FA B9 C7 ld a,(C7B9) ROM3:5AA1 EA C7 C5 ld (C5C7),a ROM3:5AA4 EA 95 C8 ld (C895),a ROM3:5AA7 FA BA C7 ld a,(C7BA) ROM3:5AAA EA C8 C5 ld (C5C8),a ROM3:5AAD EA 96 C8 ld (C896),a ;Copies Player's Life Points in (C5C7) and (C895) ROM3:5AB0 FA BB C7 ld a,(C7BB) ROM3:5AB3 EA CA C5 ld (C5CA),a ROM3:5AB6 EA A0 C8 ld (C8A0),a ROM3:5AB9 FA BC C7 ld a,(C7BC) ROM3:5ABC EA CB C5 ld (C5CB),a ROM3:5ABF EA A1 C8 ld (C8A1),a ;Copies CPU's Life Points in (C5CA) and (C8A0) ROM3:5AC2 F1 pop af ROM3:5AC3 C9 ret
Copies Player's and CPU's Monsters data
0xDAC4-DB1A
- Copies Player's and CPU's monsters IDs / Alignment / ATK / DEF
ROM3:5AC4 F5 push af ROM3:5AC5 FA B3 C7 ld a,(C7B3) ROM3:5AC8 EA 91 C8 ld (C891),a ROM3:5ACB FA B4 C7 ld a,(C7B4) ROM3:5ACE EA 92 C8 ld (C892),a ;Copies Player's monster ID in (C891) ROM3:5AD1 FA B7 C7 ld a,(C7B7) ROM3:5AD4 EA 9B C8 ld (C89B),a ;Copies Player's monster Alignment in (C89B) ROM3:5AD7 FA BD C7 ld a,(C7BD) ROM3:5ADA EA 97 C8 ld (C897),a ROM3:5ADD FA BE C7 ld a,(C7BE) ROM3:5AE0 EA 98 C8 ld (C898),a ;Copies Player's monster ATK in (C897) ROM3:5AE3 FA C1 C7 ld a,(C7C1) ROM3:5AE6 EA 99 C8 ld (C899),a ROM3:5AE9 FA C2 C7 ld a,(C7C2) ROM3:5AEC EA 9A C8 ld (C89A),a ;Copies Player's monster DEF in (C897) ROM3:5AEF FA B5 C7 ld a,(C7B5) ROM3:5AF2 EA 9C C8 ld (C89C),a ROM3:5AF5 FA B6 C7 ld a,(C7B6) ROM3:5AF8 EA 9D C8 ld (C89D),a ;Copies CPU's monster ID in (C89C) ROM3:5AFB FA B8 C7 ld a,(C7B8) ROM3:5AFE EA A6 C8 ld (C8A6),a ;Copies CPU's monster Alignment in (C8A6) ROM3:5B01 FA BF C7 ld a,(C7BF) ROM3:5B04 EA A2 C8 ld (C8A2),a ROM3:5B07 FA C0 C7 ld a,(C7C0) ROM3:5B0A EA A3 C8 ld (C8A3),a ;Copies CPU's monster ATK in (C8A2) ROM3:5B0D FA C3 C7 ld a,(C7C3) ROM3:5B10 EA A4 C8 ld (C8A4),a ROM3:5B13 FA C4 C7 ld a,(C7C4) ROM3:5B16 EA A5 C8 ld (C8A5),a ;Copies CPU's monster DEF in (C8A4) ROM3:5B19 F1 pop af ROM3:5B1A C9 ret
Inflict damage to CPU's Life Points
0xDB70-0xDB90
- Inflict damage to CPU's Life Points
ROM3:5B70 C5 push bc ROM3:5B71 D5 push de ROM3:5B72 FA BB C7 ld a,(C7BB) ROM3:5B75 5F ld e,a ROM3:5B76 FA BC C7 ld a,(C7BC) ROM3:5B79 57 ld d,a ;Copies CPU's Life Points in register de ROM3:5B7A CD 92 14 call 1492 ;Substracts damage from CPU's Life Points ROM3:5B7D 7B ld a,e ROM3:5B7E FE 00 cp a,00 ROM3:5B80 20 03 jr nz,5B85 ROM3:5B82 01 00 00 ld bc,0000 ;If CPU's Life Points are negative, set them to 0 instead ROM3:5B85 79 ld a,c ROM3:5B86 EA BB C7 ld (C7BB),a ROM3:5B89 78 ld a,b ROM3:5B8A EA BC C7 ld (C7BC),a ;Copies updated CPU's Life Points in (C7BB) ROM3:5B8D 7B ld a,e ROM3:5B8E D1 pop de ROM3:5B8F C1 pop bc ROM3:5B90 C9 ret
Stores damage type and Life Points
0xDB91-0xDB9E
- Store damage type, Player's Life Points and CPU's Life Points
ROM3:5B91 F5 push af ROM3:5B92 3E 00 ld a,00 ROM3:5B94 CD 9D 59 call 599D ;Store damage type in (C7B2) ROM3:5B97 CD FB 59 call 59FB ;Store Player's Life Points in (C7B9) and (C893) ROM3:5B9A CD 10 5A call 5A10 ;Store CPU's Life Points in (C7BB) and (C89E) ROM3:5B9D F1 pop af ROM3:5B9E C9 ret
Stores direct damage or healing
0xDC77-0xDCB6
- Stores direct attack ATK, direct damage, or healing in(C7BD)
or(C7BF)
ROM3:5C77 F5 push af /* Player's Monster vs CPU's Monster */ ROM3:5C78 79 ld a,c ROM3:5C79 EA BD C7 ld (C7BD),a ROM3:5C7C 78 ld a,b ROM3:5C7D EA BE C7 ld (C7BE),a ROM3:5C80 3E 07 ld a,07 ;Type of Damage ROM3:5C82 CD 9D 59 call 599D ;Stores damage type in (C7B2) ROM3:5C85 F1 pop af ROM3:5C86 C9 ret
ROM3:5C87 F5 push af /* Player's Direct Attack */ ROM3:5C88 79 ld a,c ROM3:5C89 EA BD C7 ld (C7BD),a ROM3:5C8C 78 ld a,b ROM3:5C8D EA BE C7 ld (C7BE),a ROM3:5C90 3E 08 ld a,08 ;Type of Damage ROM3:5C92 CD 9D 59 call 599D ;Stores damage type in (C7B2) ROM3:5C95 F1 pop af ROM3:5C96 C9 ret
ROM3:5C97 F5 push af /* CPU's Direct Attack */ ROM3:5C98 79 ld a,c ROM3:5C99 EA BF C7 ld (C7BF),a ROM3:5C9C 78 ld a,b ROM3:5C9D EA C0 C7 ld (C7C0),a ROM3:5CA0 3E 0A ld a,0A ;Type of Damage ROM3:5CA2 CD 9D 59 call 599D ;Stores damage type in (C7B2) ROM3:5CA5 F1 pop af ROM3:5CA6 C9 ret
ROM3:5CA7 F5 push af /* CPU's Monster vs Player's Monster, or Spell Damage */ ROM3:5CA8 79 ld a,c ROM3:5CA9 EA BF C7 ld (C7BF),a ROM3:5CAC 78 ld a,b ROM3:5CAD EA C0 C7 ld (C7C0),a ROM3:5CB0 3E 09 ld a,09 ;Type of Damage ROM3:5CB2 CD 9D 59 call 599D ;Stores damage type in (C7B2) ROM3:5CB5 F1 pop af ROM3:5CB6 C9 ret
Checks if SoRL restrains Player, then does Damage Calculation
0xDCB7-0xDCC8
-
ROM3:5CB7 F5 push af ROM3:5CB8 FA B1 C7 ld a,(C7B1) ;a = Current Menu ID ROM3:5CBB FE 02 cp a,02 ROM3:5CBD 20 05 jr nz,5CC4 ;if(Menu ID ≠ Versus), jump to 3:5CC4 ROM3:5CBF CD 08 5D call 5D08 ROM3:5CC2 18 03 jr 5CC7 ROM3:5CC4 CD C9 5C call 5CC9 ;checks if SoRL restrains Player, then does Damage Calculation ROM3:5CC7 F1 pop af ROM3:5CC8 C9 ret
Checks if Attack is possible
0xDCC9-0xDCF3
-
ROM3:5CC9 F5 push af ROM3:5CCA C5 push bc ROM3:5CCB CD 9A 2C call 2C9A ;Checks Swords of Revealing Light ROM3:5CCE FE 00 cp a,00 ROM3:5CD0 20 0B jr nz,5CDD ;If Swords of Revealing Light is not active, jump to 3:5CDD ROM3:5CD2 CD 68 41 call 4168 ROM3:5CD5 CD 8E 48 call 488E ROM3:5CD8 CD AD 12 call 12AD ROM3:5CDB 18 28 jr 5D05 ROM3:5CDD FA D1 C8 ld a,(C8D1) ROM3:5CE0 FE 00 cp a,00 ROM3:5CE2 28 18 jr z,5CFC ;If this is the first turn (attack is disabled), jump to 3:5CFC ROM3:5CE4 CD 77 57 call 5777 ;Damage Calculation ROM3:5CE7 CD 54 5D call 5D54 ;Win condition : Life Points ROM3:5CEA CD 58 11 call 1158 ;Waits for graphics being updated ROM3:5CED CD 58 11 call 1158 ;Waits for graphics being updated ROM3:5CF0 CD 58 11 call 1158 ;Waits for graphics being updated ROM3:5CF3 CF rst 08
3:5CF9
0xDCF9-0xDD07
-
ROM3:5CF9 CD 59 2A call 2A59 ;Duel Music subroutine ROM3:5CFC CD 68 41 call 4168 ROM3:5CFF CD 8E 48 call 488E ROM3:5D02 CD AD 12 call 12AD ROM3:5D05 C1 pop bc ROM3:5D06 F1 pop af ROM3:5D07 C9 ret
3:5D08 (Checks SoRL, and ?)
0xDD08-0xDD29
-
ROM3:5D08 F5 push af ROM3:5D09 C5 push bc ROM3:5D0A CD 9A 2C call 2C9A ;Checks Swords of Revealing Light ROM3:5D0D FE 00 cp a,00 ROM3:5D0F 20 0B jr nz,5D1C ROM3:5D11 CD 68 41 call 4168 ROM3:5D14 CD 8E 48 call 488E ROM3:5D17 CD AD 12 call 12AD ROM3:5D1A 18 20 jr 5D3C ROM3:5D1C FA D1 C8 ld a,(C8D1) ROM3:5D1F FE 00 cp a,00 ROM3:5D21 28 09 jr z,5D2C ROM3:5D23 CD 77 57 call 5777 ;Damage Calculation ROM3:5D26 CD 54 5D call 5D54 ;Win condition : Life Points ROM3:5D29 CF rst 08
3:5D4A (Check win condition : Life Points)
ROM3:5D4A CD 77 57 call 5777 ;Damage Calculation ROM3:5D4D CD 54 5D call 5D54 ;Win condition : Life Points ROM3:5D50 CD 68 41 call 4168 ROM3:5D53 C9 ret
Win conditions
0xDD54-0xDD98
- Win condition : Life Points
ROM3:5D54 F5 push af ROM3:5D55 FA C5 C7 ld a,(C7C5) ;(C7C5 is or'd with 0x08 when doing more damage than CPU's remaining Life Points) ROM3:5D58 E6 01 and a,01 ROM3:5D5A 28 0B jr z,5D67 ;Jump to 3:5D67 if (C7C5)&1=0 ROM3:5D5C FA C6 C7 ld a,(C7C6) ROM3:5D5F 47 ld b,a ROM3:5D60 FA C7 C7 ld a,(C7C7) ROM3:5D63 4F ld c,a ROM3:5D64 CD 6D 20 call 206D ;Remove selected card from the field ROM3:5D67 FA C5 C7 ld a,(C7C5) ROM3:5D6A E6 02 and a,02 ROM3:5D6C 28 0B jr z,5D79 ;If((C7C5) && 2 == 0), jump to 3:5D79 ROM3:5D6E FA C8 C7 ld a,(C7C8) ROM3:5D71 47 ld b,a ROM3:5D72 FA C9 C7 ld a,(C7C9) ROM3:5D75 4F ld c,a ROM3:5D76 CD 86 20 call 2086 ;Remove selected card from the field ROM3:5D79 FA C5 C7 ld a,(C7C5) ROM3:5D7C E6 04 and a,04 ROM3:5D7E 28 08 jr z,5D88 ;If((C7C5) && 4 == 0), jump to 3:5D88 ROM3:5D80 CD 63 24 call 2463 ;Player loses ROM3:5D83 3E 01 ld a,01 ROM3:5D85 EA 04 C7 ld (C704),a ROM3:5D88 FA C5 C7 ld a,(C7C5) ROM3:5D8B E6 08 and a,08 ROM3:5D8D 28 08 jr z,5D97 ;If (opponent's Life Points > 0), jump to 3:5D97 ROM3:5D8F CD 6B 24 call 246B ;Player wins ROM3:5D92 3E 01 ld a,01 ROM3:5D94 EA 04 C7 ld (C704),a ROM3:5D97 F1 pop af ROM3:5D98 C9 ret
Trap Cards handling
Put Player's Trap card into play
ROM3:5E9F F5 push af ROM3:5EA0 C5 push bc ROM3:5EA1 FA 00 C7 ld a,(C700) ;Column to check ROM3:5EA4 47 ld b,a ROM3:5EA5 0E 03 ld c,03 ;Row 3 ROM3:5EA7 CD D0 19 call 19D0 ;Column (C700), Row 3 ROM3:5EAA CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:5EAD 01 03 00 ld bc,0003 ROM3:5EB0 CD D0 19 call 19D0 ;Column 0, Row 3 ROM3:5EB3 CD 25 20 call 2025 ;Hide Player's Card, reset Level ROM3:5EB6 CD FB 19 call 19FB ;Updates selected card ID and status ROM3:5EB9 FA 00 C7 ld a,(C700) ;Column of the card in the hand ROM3:5EBC 47 ld b,a ROM3:5EBD 0E 03 ld c,03 ;Row 3 ROM3:5EBF CD D0 19 call 19D0 ;Column (C700), Row 3 ROM3:5EC2 CD E6 19 call 19E6 ;Removes card from the hand ROM3:5EC5 C1 pop bc ROM3:5EC6 F1 pop af ROM3:5EC7 C9 ret
Remove Player's Trap Card
ROM3:5EC8 F5 push af ROM3:5EC9 C5 push bc ROM3:5ECA 01 03 00 ld bc,0003 ROM3:5ECD CD D0 19 call 19D0 ;Column 0, Row 3 ROM3:5ED0 CD E6 19 call 19E6 ;Removes card from the field ROM3:5ED3 C1 pop bc ROM3:5ED4 F1 pop af ROM3:5ED5 C9 ret
Remove CPU's Trap Card
ROM3:5ED6 F5 push af ROM3:5ED7 C5 push bc ROM3:5ED8 01 00 05 ld bc,0500 ROM3:5EDB CD D0 19 call 19D0 ;Column 5, Row 0 ROM3:5EDE CD E6 19 call 19E6 ;Removes card from the field ROM3:5EE1 C1 pop bc ROM3:5EE2 F1 pop af ROM3:5EE3 C9 ret
Fusion Summon
0xDEE4-0xDF19
- Fusion Summon
ROM3:5EE4 F5 push af ROM3:5EE5 C5 push bc ROM3:5EE6 FA 00 C7 ld a,(C700) ;Column to check ROM3:5EE9 47 ld b,a ROM3:5EEA FA 01 C7 ld a,(C701) ;Row to check ROM3:5EED 4F ld c,a ROM3:5EEE CD D0 19 call 19D0 ;Update Column and Row ROM3:5EF1 FA 8F C8 ld a,(C88F) ROM3:5EF4 EA A3 C7 ld (C7A3),a ROM3:5EF7 FA 90 C8 ld a,(C890) ROM3:5EFA EA A4 C7 ld (C7A4),a ;Copy Fusion Monster ID in (C7A3) (Card being processed) ROM3:5EFD CD 25 20 call 2025 ;Hide Player's Card, reset Level ROM3:5F00 CD DF 1F call 1FDF ;Freezes Card ROM3:5F03 CD 12 50 call 5012 ;Stores monster ID in bc, and reveal monster card ROM3:5F06 CD 2B 1A call 1A2B ;Remove card played from hand ? ROM3:5F09 FA 02 C7 ld a,(C702) ROM3:5F0C 47 ld b,a ROM3:5F0D FA 03 C7 ld a,(C703) ROM3:5F10 4F ld c,a ROM3:5F11 CD D0 19 call 19D0 ;Update Column and Row ROM3:5F14 CD E6 19 call 19E6 ;Remove selected card from the field ROM3:5F17 C1 pop bc ROM3:5F18 F1 pop af ROM3:5F19 C9 ret
Removes a card from Player's Hand
ROM3:5F7F F5 push af ROM3:5F80 C5 push bc ROM3:5F81 FA 00 C7 ld a,(C700) ;Cursor Column ROM3:5F84 47 ld b,a ROM3:5F85 0E 03 ld c,03 ROM3:5F87 CD D0 19 call 19D0 ;Column (C700), Row 3 ROM3:5F8A CD E6 19 call 19E6 ;Remove card from selected card zone on the field ROM3:5F8D CF rst 08 ... ROM3:5F90 C1 pop bc ROM3:5F91 F1 pop af ROM3:5F92 C9 ret
Removes selected card
ROM3:5F93 F5 push af ROM3:5F94 C5 push bc ROM3:5F95 FA 02 C7 ld a,(C702) ;Selected Column ROM3:5F98 47 ld b,a ROM3:5F99 0E 03 ld c,03 ROM3:5F9B CD D0 19 call 19D0 ;Column (C702), Row 3 ROM3:5F9E CD E6 19 call 19E6 ;Remove card from selected card zone on the field ROM3:5FA1 C1 pop bc ROM3:5FA2 F1 pop af ROM3:5FA3 C9 ret
List of Magic / Trap / Ritual effect IDs
0xDFA5-0xE07C
- List of Magic / Trap / Ritual effect IDs,0x2F
and0x36
are special values
3:612C
0xE12C-0xE12F
-
ROM3:612C CD 68 41 call 4168 ROM3:612F CF rst 08
Player's card effects
No effect (ret)
ROM3:6181 C9 ret
3:6182
ROM3:6182 C5 push bc ROM3:6183 CD 99 2A call 2A99 ROM3:6186 CF rst 08 ROM3:6187 5D 01 => Pointer 01:405D ROM3:6189 C1 pop bc ROM3:618A C9 ret
3:618B
ROM3:618B CD 99 2A call 2A99 ROM3:618E CF rst 08 ROM3:618F 5D 01 => Pointer 01:405D ROM3:6191 C9 ret
3:6192
ROM3:6192 CD 14 7B call 7B14 ROM3:6195 3E 02 ld a,02 ROM3:6197 EA 4C C8 ld (C84C),a ROM3:619A 3E 01 ld a,01 ROM3:619C EA AF C8 ld (C8AF),a ROM3:619F FA 8B C8 ld a,(C88B) ROM3:61A2 EA A9 C8 ld (C8A9),a ROM3:61A5 FA 8C C8 ld a,(C88C) ROM3:61A8 EA AA C8 ld (C8AA),a ROM3:61AB FA 8D C8 ld a,(C88D) ROM3:61AE EA AB C8 ld (C8AB),a ROM3:61B1 FA 8E C8 ld a,(C88E) ROM3:61B4 EA AC C8 ld (C8AC),a ROM3:61B7 FA 8F C8 ld a,(C88F) ROM3:61BA EA AD C8 ld (C8AD),a ROM3:61BD FA 90 C8 ld a,(C890) ROM3:61C0 EA AE C8 ld (C8AE),a ROM3:61C3 CF rst 08
Summon Monster card from hand
ROM3:61CA F5 push af ROM3:61CB CD 42 21 call 2142 ;Fusion subroutine ROM3:61CE FE 00 cp a,00 ROM3:61D0 20 05 jr nz,61D7 ;if the Fusion failed, jump to 3:61D7 ROM3:61D2 CD 92 61 call 6192 ROM3:61D5 18 0F jr 61E6 ROM3:61D7 CD A9 2A call 2AA9 ;SE: Failed Fusion ROM3:61DA CD 3E 5E call 5E3E ROM3:61DD CD 14 7B call 7B14 ROM3:61E0 CD 91 79 call 7991 ROM3:61E3 CD AD 79 call 79AD ;Freeze Monster card in Hand if a Monster has already been summoned this turn ROM3:61E6 F1 pop af ROM3:61E7 C9 ret
Field Spell
Forest
0xE1E8-0xE1F8
- Forest
ROM3:61E8 F5 push af ROM3:61E9 CD 38 41 call 4138 ;Change the Field to Forest ROM3:61EC CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:61EF CD 68 41 call 4168 ROM3:61F2 3E 1D ld a,1D ROM3:61F4 CF rst 08 ROM3:61F5 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x1D) ROM3:61F7 F1 pop af ROM3:61F8 C9 ret
Wasteland
0xE1F9-0xE209
- Wasteland
ROM3:61F9 F5 push af ROM3:61FA CD 40 41 call 4140 ;Change the Field to Wasteland ROM3:61FD CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6200 CD 68 41 call 4168 ROM3:6203 3E 1E ld a,1E ROM3:6205 CF rst 08 ROM3:6206 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x1E) ROM3:6208 F1 pop af ROM3:6209 C9 ret
Mountain
0xE20A-0xE21A
- Mountain
ROM3:620A F5 push af ROM3:620B CD 48 41 call 4148 ;Change the Field to Mountain ROM3:620E CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6211 CD 68 41 call 4168 ROM3:6214 3E 1F ld a,1F ROM3:6216 CF rst 08 ROM3:6217 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x1F) ROM3:6219 F1 pop af ROM3:621A C9 ret
Sogen
0xE21B-0xE22B
- Sogen
ROM3:621B F5 push af ROM3:621C CD 50 41 call 4150 ;Change the Field to Sogen ROM3:621F CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6222 CD 68 41 call 4168 ROM3:6225 3E 20 ld a,20 ROM3:6227 CF rst 08 ROM3:6228 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x20) ROM3:622A F1 pop af ROM3:622B C9 ret
Umi
0xE22C-0xE23C
- Umi
ROM3:622C F5 push af ROM3:622D CD 58 41 call 4158 ;Change the Field to Umi ROM3:6230 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6233 CD 68 41 call 4168 ROM3:6236 3E 21 ld a,21 ROM3:6238 CF rst 08 ROM3:6239 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x21) ROM3:623B F1 pop af ROM3:623C C9 ret
Yami
0xE23D-0xE24D
- Yami
ROM3:623D F5 push af ROM3:623E CD 60 41 call 4160 ;Change the Field to Yami ROM3:6241 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6244 CD 68 41 call 4168 ROM3:6247 3E 22 ld a,22 ROM3:6249 CF rst 08 ROM3:624A 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x22) ROM3:624C F1 pop af ROM3:624D C9 ret
Healing Spell
Mooyan Curry
0xE24E-0xE27B
- Mooyan Curry
ROM3:624E F5 push af ROM3:624F C5 push bc ROM3:6250 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:6253 01 00 02 ld bc,0200 ;200 LP ROM3:6256 CF rst 08 ROM3:6257 0D 0A => Pointer 0A:400D ROM3:6259 FE 00 cp a,00 ROM3:625B 20 10 jr nz,626D ROM3:625D CD 77 5C call 5C77 ;Store damage or healing ROM3:6260 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6263 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:6266 3E 25 ld a,25 ROM3:6268 CF rst 08 ;Loads Sound Effect and Text 0x25 ROM3:6269 0B 06 => Pointer 06:400B ROM3:626B 18 0C jr 6279 ROM3:626D CF rst 08 ROM3:626E 0F 0A => Pointer 0A:400F ROM3:6270 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6273 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:6276 CF rst 08 ROM3:6277 07 06 => Pointer 06:4007 ROM3:6279 C1 pop bc ROM3:627A F1 pop af ROM3:627B C9 ret
Red Medicine
0xE27C-0xE2A9
- Red Medicine
ROM3:627C F5 push af ROM3:627D C5 push bc ROM3:627E CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:6281 01 00 05 ld bc,0500 ;500 LP ROM3:6284 CF rst 08 ROM3:6285 0D 0A => Pointer 0A:400D ROM3:6287 FE 00 cp a,00 ROM3:6289 20 10 jr nz,629B ROM3:628B CD 77 5C call 5C77 ;Store damage or healing ROM3:628E CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6291 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:6294 3E 26 ld a,26 ROM3:6296 CF rst 08 ;Loads Sound Effect and Text 0x26 ROM3:6297 0B 06 => Pointer 06:400B ROM3:6299 18 0C jr 62A7 ROM3:629B CF rst 08 ROM3:629C 0F 0A => Pointer 0A:400F ROM3:629E CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:62A1 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:62A4 CF rst 08 ROM3:63A5 07 06 => Pointer 06:4007 ROM3:63A7 C1 pop bc ROM3:62A8 F1 pop af ROM3:62A9 C9 ret
Goblin's Secret Remedy
0xE2AA-0xE2D7
- Goblin's Secret Remedy
ROM3:62AA F5 push af ROM3:62AB C5 push bc ROM3:62AC CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:62AF 01 00 10 ld bc,1000 ;1000 LP ROM3:62B2 CF rst 08 ROM3:62B3 0D 0A => Pointer 0A:400D ROM3:62B5 FE 00 cp a,00 ROM3:62B7 20 10 jr nz,62C9 ROM3:62B9 CD 77 5C call 5C77 ;Store damage or healing ROM3:62BC CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:62BF CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:62C2 3E 27 ld a,27 ROM3:62C4 CF rst 08 ;Loads Sound Effect and Text 0x27 ROM3:62C5 0B 06 => Pointer 06:400B ROM3:62C7 18 0C jr 62D5 ROM3:62C9 CF rst 08 ROM3:62CA 0F 0A => Pointer 0A:400F ROM3:62CC CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:62CF CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:62D2 CF rst 08 ROM3:62D3 07 06 => Pointer 06:4007 ROM3:62D5 C1 pop bc ROM3:62D6 F1 pop af ROM3:62D7 C9 ret
Soul of the Pure
0xE2D8-0xE305
- Soul of the Pure
ROM3:62D8 F5 push af ROM3:62D9 C5 push bc ROM3:62DA CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:62DD 01 00 20 ld bc,2000 ;2000 LP ROM3:62E0 CF rst 08 ROM3:62E1 0D 0A => Pointer 0A:400D ROM3:62E3 FE 00 cp a,00 ROM3:62E5 20 10 jr nz,62F7 ROM3:62E7 CD 77 5C call 5C77 ;Store damage or healing ROM3:62EA CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:62ED CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:62F0 3E 28 ld a,28 ROM3:62F2 CF rst 08 ;Loads Sound Effect and Text 0x28 ROM3:62F3 0B 06 => Pointer 06:400B ROM3:62F5 18 0C jr 6303 ROM3:62F7 CF rst 08 ROM3:62F8 0F 0A => Pointer 0A:400F ROM3:62FA CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:62FD CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:6300 CF rst 08 ROM3:6301 07 06 => Pointer 06:4007 ROM3:6303 C1 pop bc ROM3:6304 F1 pop af ROM3:6305 C9 ret
Dian Keto the Cure Master
0xE306-0xE333
- Dian Keto the Cure Master
ROM3:6306 F5 push af ROM3:6307 C5 push bc ROM3:6308 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:630B 01 00 50 ld bc,5000 ;5000 LP ROM3:630E CF rst 08 ROM3:630F 0D 0A => Pointer 0A:400D ROM3:6311 FE 00 cp a,00 ROM3:6313 20 10 jr nz,6325 ROM3:6315 CD 77 5C call 5C77 ;Store damage or healing ROM3:6318 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:631B CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:631E 3E 29 ld a,29 ROM3:6320 CF rst 08 ;Loads Sound Effect and Text 0x29 ROM3:6321 0B 06 => Pointer 06:400B ROM3:6323 18 0C jr 6331 ROM3:6325 CF rst 08 ROM3:6326 0F 0A => Pointer 0A:400F ROM3:6328 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:632B CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:632E CF rst 08 ROM3:632F 07 06 => Pointer 06:4007 ROM3:6331 C1 pop bc ROM3:6332 F1 pop af ROM3:6333 C9 ret
Damage Spell
Sparks
0xE334-0xE361
- Sparks
ROM3:6334 F5 push af ROM3:6335 C5 push bc ROM3:6336 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:6339 01 50 00 ld bc,0050 ;50 damage ROM3:633C CF rst 08 ROM3:633D 0D 0A => Pointer 0A:400D ROM3:633F FE 00 cp a,00 ROM3:6341 20 10 jr nz,6353 ROM3:6343 CD A7 5C call 5CA7 ;Spell Damage ROM3:6346 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6349 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:634C 3E 2A ld a,2A ROM3:634E CF rst 08 ;Loads Sound Effect and Text 0x2A ROM3:634F 0B 06 => Pointer 06:400B ROM3:6351 18 0C jr 635F ROM3:6353 CF rst 08 ROM3:6354 0F 0A => Pointer 0A:400F ROM3:6356 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6359 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:635C CF rst 08 ROM3:635D 07 06 => Pointer 06:4007 ROM3:635F C1 pop bc ROM3:6360 F1 pop af ROM3:6361 C9 ret
Hinotama
0xE362-0xE391
- Hinotama
ROM3:6362 F5 push af ROM3:6363 C5 push bc ROM3:6364 D5 push de ROM3:6365 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:6368 01 00 01 ld bc,0100 ;100 damage ROM3:636B CF rst 08 ROM3:636C 0D 0A => Pointer 0A:400D ROM3:636E FE 00 cp a,00 ROM3:6370 20 10 jr nz,6382 ROM3:6372 CD A7 5C call 5CA7 ;Spell Damage ROM3:6375 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6378 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:637B 3E 2B ld a,2B ROM3:637D CF rst 08 ;Loads Sound Effect and Text 0x2B ROM3:637E 0B 06 => Pointer 06:400B ROM3:637F 18 0C jr 638D ROM3:6382 CF rst 08 ROM3:6383 0F 0A => Pointer 0A:400F ROM3:6385 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6388 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:638B CF rst 08 ROM3:638C 07 06 => Pointer 06:4007 ROM3:638D D1 pop de ROM3:638F C1 pop bc ROM3:6390 F1 pop af ROM3:6391 C9 ret
Final Flame
0xE392-0xE3C1
- Final Flame
ROM3:6392 F5 push af ROM3:6393 C5 push bc ROM3:6394 D5 push de ROM3:6395 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:6398 01 00 02 ld bc,0200 ;200 damage ROM3:639B CF rst 08 ROM3:639C 0D 0A => Pointer 0A:400D ROM3:639E FE 00 cp a,00 ROM3:63A0 20 10 jr nz,63B2 ROM3:63A2 CD A7 5C call 5CA7 ;Spell Damage ROM3:63A5 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:63A8 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:63AB 3E 2C ld a,2C ROM3:63AD CF rst 08 ;Loads Sound Effect and Text 0x2C ROM3:63AE 0B 06 => Pointer 06:400B ROM3:63AF 18 0C jr 63BD ROM3:63B2 CF rst 08 ROM3:63B3 0F 0A => Pointer 0A:400F ROM3:63B5 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:63B8 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:63BB CF rst 08 ROM3:63BC 07 06 => Pointer 06:4007 ROM3:63BD D1 pop de ROM3:63BF C1 pop bc ROM3:63C0 F1 pop af ROM3:63C1 C9 ret
Ookazi
0xE3C2-0xE3F1
- Ookazi
ROM3:63C2 F5 push af ROM3:63C3 C5 push bc ROM3:63C4 D5 push de ROM3:63C5 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:63C8 01 00 05 ld bc,0500 ;500 damage ROM3:63CB CF rst 08 ROM3:63CC 0D 0A => Pointer 0A:400D ROM3:63CE FE 00 cp a,00 ROM3:63D0 20 10 jr nz,63E2 ROM3:63D2 CD A7 5C call 5CA7 ;Spell Damage ROM3:63D5 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:63D8 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:63DB 3E 2D ld a,2D ROM3:63DD CF rst 08 ;Loads Sound Effect and Text 0x2D ROM3:63DE 0B 06 => Pointer 06:400B ROM3:63DF 18 0C jr 63ED ROM3:63E2 CF rst 08 ROM3:63E3 0F 0A => Pointer 0A:400F ROM3:63E5 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:63E8 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:63EB CF rst 08 ROM3:63EC 07 06 => Pointer 06:4007 ROM3:63ED D1 pop de ROM3:63EF C1 pop bc ROM3:63F0 F1 pop af ROM3:63F1 C9 ret
Tremendous Fire
0xE3F2-0xE421
- Tremendous Fire
ROM3:63F2 F5 push af ROM3:63F3 C5 push bc ROM3:63F4 D5 push de ROM3:63F5 CD 91 5B call 5B91 ;Store damage type, Player's Life Points and CPU's Life Points ROM3:63F8 01 00 10 ld bc,1000 ;1000 damage ROM3:63FB CF rst 08 ROM3:63FC 0D 0A => Pointer 0A:400D ROM3:63FE FE 00 cp a,00 ROM3:6400 20 10 jr nz,6412 ROM3:6402 CD A7 5C call 5CA7 ;Spell Damage ROM3:6405 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6408 CD 4A 5D call 5D4A ;Supposed to test Win condition : Life Points (but doesn't due to a glitch) ROM3:640B 3E 2E ld a,2E ROM3:640D CF rst 08 ;Loads Sound Effect and Text 0x2E ROM3:640E 0B 06 => Pointer 06:400B ROM3:640F 18 0C jr 641D ROM3:6412 CF rst 08 ROM3:6413 0F 0A => Pointer 0A:400F ROM3:6415 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6418 CD 4A 5D call 5D4A ;Win condition : Life Points ROM3:641B CF rst 08 ROM3:641C 07 06 => Pointer 06:4007 ROM3:641D D1 pop de ROM3:641F C1 pop bc ROM3:6420 F1 pop af ROM3:6421 C9 ret
Dark Hole
0xE422-0xE454
- Dark Hole effect
ROM3:6422 F5 push af ROM3:6423 C5 push bc ROM3:6424 D5 push de ROM3:6425 E5 push hl ROM3:6426 01 01 00 ld bc,0001 ROM3:6429 78 ld a,b ROM3:642A FE 05 cp a,05 ROM3:642C 30 06 jr nc,6434 ROM3:642E CD 86 20 call 2086 ;Remove selected card from the field ROM3:6431 04 inc b ROM3:6432 18 F5 jr 6429 ;Loop 5 times ROM3:6434 01 02 01 ld bc,0102 ROM3:6437 78 ld a,b ROM3:6438 FE 06 cp a,06 ROM3:643A 30 06 jr nc,6442 ROM3:643C CD 6D 20 call 206D ;Remove selected card from the field ROM3:643F 04 inc b ROM3:6440 18 F5 jr 6437 ;Loop 5 times ROM3:6442 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6445 CD F1 2A call 2AF1 ;Does nothing, should call the Sound Effect 0x1B but it has been removed ROM3:6448 CD 68 41 call 4168 ROM3:644B 3E 23 ld a,23 ROM3:644D CF rst 08 ROM3:644E 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x23) ROM3:6450 F1 pop hl ROM3:6451 D1 pop de ROM3:6452 C1 pop bc ROM3:6453 F1 pop af ROM3:6454 C9 ret
Raigeki
0xE455-0xE492
- Raigeki handling
ROM3:6455 F5 push af ROM3:6456 C5 push bc ROM3:6457 D5 push de ROM3:6458 E5 push hl ROM3:6459 CF rst 08 => 0D 0A ROM3:645C FE 00 cp a,00 ROM3:645E 20 1F jr nz,647F ROM3:6460 0E 01 ld c,01 ROM3:6462 06 00 ld b,00 ROM3:6464 78 ld a,b ROM3:6465 FE 05 cp a,05 ROM3:6467 30 06 jr nc,646F ROM3:6469 CD 86 20 call 2086 ;Remove selected card from the field ROM3:646C 04 inc b ROM3:646D 18 F5 jr 6464 ;Loop 5 times ROM3:646F CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6472 CD F1 2A call 2AF1 ;Does nothing, should call the Sound Effect 0x1B but it has been removed ROM3:6475 CD 68 41 call 4168 ROM3:6478 3E 24 ld a,24 ROM3:647A CF rst 08 ROM3:647B 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x24) ROM3:647D 18 0F jr 648F ;Get out of this function ROM3:647F CF rst 08 => 0F 0A ROM3:6482 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6485 CD D9 2A call 2AD9 ;Does nothing, should call the Sound Effect 0x20 but it has been removed ROM3:6488 CD 4A 5D call 5D4A ROM3:648B CF rst 08 => 07 06 ROM3:648E E1 pop hl ROM3:648F D1 pop de ROM3:6490 C1 pop bc ROM3:6491 F1 pop af ROM3:6492 C9 ret
Equip Spells 1
Legendary Sword
ROM3:6493 F5 push af ROM3:6494 C5 push bc ROM3:6495 D5 push de ROM3:6496 FA 8B C8 ld a,(C88B) ROM3:6499 4F ld c,a ROM3:649A FA 8C C8 ld a,(C88C) ROM3:649D 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:649E 16 00 ld d,00 ROM3:64A0 CF rst 08 ROM3:64A1 0D dec c ROM3:64A2 07 rlca ROM3:64A3 FE 01 cp a,01 ROM3:64A5 20 26 jr nz,64CD ROM3:64A7 CF rst 08 ROM3:64A8 0D dec c ROM3:64A9 0A ld a,(bc) ROM3:64AA FE 00 cp a,00 ROM3:64AC 20 16 jr nz,64C4 ROM3:64AE FA 00 C7 ld a,(C700) ROM3:64B1 47 ld b,a ROM3:64B2 FA 01 C7 ld a,(C701) ROM3:64B5 4F ld c,a ROM3:64B6 CD C7 50 call 50C7 ROM3:64B9 CD 93 5F call 5F93 ROM3:64BC 01 2D 01 ld bc,012D ROM3:64BF CD 5D 61 call 615D ROM3:64C2 18 09 jr 64CD ROM3:64C4 CF rst 08 ROM3:64C5 0F rrca ROM3:64C6 0A ld a,(bc) ROM3:64C7 CD 93 5F call 5F93 ROM3:64CA CF rst 08 ROM3:64CB 07 rlca ROM3:64CC 06 D1 ld b,D1 ROM3:64CE C1 pop bc ROM3:64CF F1 pop af ROM3:64D0 C9 ret
Sword of Ruin
ROM3:64D1 F5 push af ROM3:64D2 C5 push bc ROM3:64D3 D5 push de ROM3:64D4 FA 8B C8 ld a,(C88B) ROM3:64D7 4F ld c,a ROM3:64D8 FA 8C C8 ld a,(C88C) ROM3:64DB 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:64DC 16 01 ld d,01 ROM3:64DE CF rst 08 ROM3:64DF 0D dec c ROM3:64E0 07 rlca ROM3:64E1 FE 01 cp a,01 ROM3:64E3 20 26 jr nz,650B ROM3:64E5 CF rst 08 ROM3:64E6 0D dec c ROM3:64E7 0A ld a,(bc) ROM3:64E8 FE 00 cp a,00 ROM3:64EA 20 16 jr nz,6502 ROM3:64EC FA 00 C7 ld a,(C700) ROM3:64EF 47 ld b,a ROM3:64F0 FA 01 C7 ld a,(C701) ROM3:64F3 4F ld c,a ROM3:64F4 CD C7 50 call 50C7 ROM3:64F7 CD 93 5F call 5F93 ROM3:64FA 01 2E 01 ld bc,012E ROM3:64FD CD 5D 61 call 615D ROM3:6500 18 09 jr 650B ROM3:6502 CF rst 08 ROM3:6503 0F rrca ROM3:6504 0A ld a,(bc) ROM3:6505 CD 93 5F call 5F93 ROM3:6508 CF rst 08 ROM3:6509 07 rlca ROM3:650A 06 D1 ld b,D1 ROM3:650C C1 pop bc ROM3:650D F1 pop af ROM3:650E C9 ret
Dark Energy
ROM3:650F F5 push af ROM3:6510 C5 push bc ROM3:6511 D5 push de ROM3:6512 FA 8B C8 ld a,(C88B) ROM3:6515 4F ld c,a ROM3:6516 FA 8C C8 ld a,(C88C) ROM3:6519 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:651A 16 02 ld d,02 ROM3:651C CF rst 08 ROM3:651D 0D dec c ROM3:651E 07 rlca ROM3:651F FE 01 cp a,01 ROM3:6521 20 26 jr nz,6549 ROM3:6523 CF rst 08 ROM3:6524 0D dec c ROM3:6525 0A ld a,(bc) ROM3:6526 FE 00 cp a,00 ROM3:6528 20 16 jr nz,6540 ROM3:652A FA 00 C7 ld a,(C700) ROM3:652D 47 ld b,a ROM3:652E FA 01 C7 ld a,(C701) ROM3:6531 4F ld c,a ROM3:6532 CD C7 50 call 50C7 ROM3:6535 CD 93 5F call 5F93 ROM3:6538 01 2F 01 ld bc,012F ROM3:653B CD 5D 61 call 615D ROM3:653E 18 09 jr 6549 ROM3:6540 CF rst 08 ROM3:6541 0F rrca ROM3:6542 0A ld a,(bc) ROM3:6543 CD 93 5F call 5F93 ROM3:6546 CF rst 08 ROM3:6547 07 rlca ROM3:6548 06 D1 ld b,D1 ROM3:654A C1 pop bc ROM3:654B F1 pop af ROM3:654C C9 ret
Axe of Despair
ROM3:654D F5 push af ROM3:654E C5 push bc ROM3:654F D5 push de ROM3:6550 FA 8B C8 ld a,(C88B) ROM3:6553 4F ld c,a ROM3:6554 FA 8C C8 ld a,(C88C) ROM3:6557 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6558 16 03 ld d,03 ROM3:655A CF rst 08 ROM3:655B 0D dec c ROM3:655C 07 rlca ROM3:655D FE 01 cp a,01 ROM3:655F 20 26 jr nz,6587 ROM3:6561 CF rst 08 ROM3:6562 0D dec c ROM3:6563 0A ld a,(bc) ROM3:6564 FE 00 cp a,00 ROM3:6566 20 16 jr nz,657E ROM3:6568 FA 00 C7 ld a,(C700) ROM3:656B 47 ld b,a ROM3:656C FA 01 C7 ld a,(C701) ROM3:656F 4F ld c,a ROM3:6570 CD C7 50 call 50C7 ROM3:6573 CD 93 5F call 5F93 ROM3:6576 01 30 01 ld bc,0130 ROM3:6579 CD 5D 61 call 615D ROM3:657C 18 09 jr 6587 ROM3:657E CF rst 08 ROM3:657F 0F rrca ROM3:6580 0A ld a,(bc) ROM3:6581 CD 93 5F call 5F93 ROM3:6584 CF rst 08 ROM3:6585 07 rlca ROM3:6586 06 D1 ld b,D1 ROM3:6588 C1 pop bc ROM3:6589 F1 pop af ROM3:658A C9 ret
Lazer Cannon Armor
ROM3:658B F5 push af ROM3:658C C5 push bc ROM3:658D D5 push de ROM3:658E FA 8B C8 ld a,(C88B) ROM3:6591 4F ld c,a ROM3:6592 FA 8C C8 ld a,(C88C) ROM3:6595 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6596 16 04 ld d,04 ROM3:6598 CF rst 08 ROM3:6599 0D dec c ROM3:659A 07 rlca ROM3:659B FE 01 cp a,01 ROM3:659D 20 26 jr nz,65C5 ROM3:659F CF rst 08 ROM3:65A0 0D dec c ROM3:65A1 0A ld a,(bc) ROM3:65A2 FE 00 cp a,00 ROM3:65A4 20 16 jr nz,65BC ROM3:65A6 FA 00 C7 ld a,(C700) ROM3:65A9 47 ld b,a ROM3:65AA FA 01 C7 ld a,(C701) ROM3:65AD 4F ld c,a ROM3:65AE CD C7 50 call 50C7 ROM3:65B1 CD 93 5F call 5F93 ROM3:65B4 01 31 01 ld bc,0131 ROM3:65B7 CD 5D 61 call 615D ROM3:65BA 18 09 jr 65C5 ROM3:65BC CF rst 08 ROM3:65BD 0F rrca ROM3:65BE 0A ld a,(bc) ROM3:65BF CD 93 5F call 5F93 ROM3:65C2 CF rst 08 ROM3:65C3 07 rlca ROM3:65C4 06 D1 ld b,D1 ROM3:65C6 C1 pop bc ROM3:65C7 F1 pop af ROM3:65C8 C9 ret
Insect Armor with Laser Cannon
ROM3:65C9 F5 push af ROM3:65CA C5 push bc ROM3:65CB D5 push de ROM3:65CC FA 8B C8 ld a,(C88B) ROM3:65CF 4F ld c,a ROM3:65D0 FA 8C C8 ld a,(C88C) ROM3:65D3 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:65D4 16 05 ld d,05 ROM3:65D6 CF rst 08 ROM3:65D7 0D dec c ROM3:65D8 07 rlca ROM3:65D9 FE 01 cp a,01 ROM3:65DB 20 26 jr nz,6603 ROM3:65DD CF rst 08 ROM3:65DE 0D dec c ROM3:65DF 0A ld a,(bc) ROM3:65E0 FE 00 cp a,00 ROM3:65E2 20 16 jr nz,65FA ROM3:65E4 FA 00 C7 ld a,(C700) ROM3:65E7 47 ld b,a ROM3:65E8 FA 01 C7 ld a,(C701) ROM3:65EB 4F ld c,a ROM3:65EC CD C7 50 call 50C7 ROM3:65EF CD 93 5F call 5F93 ROM3:65F2 01 32 01 ld bc,0132 ROM3:65F5 CD 5D 61 call 615D ROM3:65F8 18 09 jr 6603 ROM3:65FA CF rst 08 ROM3:65FB 0F rrca ROM3:65FC 0A ld a,(bc) ROM3:65FD CD 93 5F call 5F93 ROM3:6600 CF rst 08 ROM3:6601 07 rlca ROM3:6602 06 D1 ld b,D1 ROM3:6604 C1 pop bc ROM3:6605 F1 pop af ROM3:6606 C9 ret
Elf's Light
ROM3:6607 F5 push af ROM3:6608 C5 push bc ROM3:6609 D5 push de ROM3:660A FA 8B C8 ld a,(C88B) ROM3:660D 4F ld c,a ROM3:660E FA 8C C8 ld a,(C88C) ROM3:6611 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6612 16 06 ld d,06 ROM3:6614 CF rst 08 ROM3:6615 0D dec c ROM3:6616 07 rlca ROM3:6617 FE 01 cp a,01 ROM3:6619 20 26 jr nz,6641 ROM3:661B CF rst 08 ROM3:661C 0D dec c ROM3:661D 0A ld a,(bc) ROM3:661E FE 00 cp a,00 ROM3:6620 20 16 jr nz,6638 ROM3:6622 FA 00 C7 ld a,(C700) ROM3:6625 47 ld b,a ROM3:6626 FA 01 C7 ld a,(C701) ROM3:6629 4F ld c,a ROM3:662A CD C7 50 call 50C7 ROM3:662D CD 93 5F call 5F93 ROM3:6630 01 33 01 ld bc,0133 ROM3:6633 CD 5D 61 call 615D ROM3:6636 18 09 jr 6641 ROM3:6638 CF rst 08 ROM3:6639 0F rrca ROM3:663A 0A ld a,(bc) ROM3:663B CD 93 5F call 5F93 ROM3:663E CF rst 08 ROM3:663F 07 rlca ROM3:6640 06 D1 ld b,D1 ROM3:6642 C1 pop bc ROM3:6643 F1 pop af ROM3:6644 C9 ret
Beast Fangs
ROM3:6645 F5 push af ROM3:6646 C5 push bc ROM3:6647 D5 push de ROM3:6648 FA 8B C8 ld a,(C88B) ROM3:664B 4F ld c,a ROM3:664C FA 8C C8 ld a,(C88C) ROM3:664F 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6650 16 07 ld d,07 ROM3:6652 CF rst 08 ROM3:6653 0D dec c ROM3:6654 07 rlca ROM3:6655 FE 01 cp a,01 ROM3:6657 20 26 jr nz,667F ROM3:6659 CF rst 08 ROM3:665A 0D dec c ROM3:665B 0A ld a,(bc) ROM3:665C FE 00 cp a,00 ROM3:665E 20 16 jr nz,6676 ROM3:6660 FA 00 C7 ld a,(C700) ROM3:6663 47 ld b,a ROM3:6664 FA 01 C7 ld a,(C701) ROM3:6667 4F ld c,a ROM3:6668 CD C7 50 call 50C7 ROM3:666B CD 93 5F call 5F93 ROM3:666E 01 34 01 ld bc,0134 ROM3:6671 CD 5D 61 call 615D ROM3:6674 18 09 jr 667F ROM3:6676 CF rst 08 ROM3:6677 0F rrca ROM3:6678 0A ld a,(bc) ROM3:6679 CD 93 5F call 5F93 ROM3:667C CF rst 08 ROM3:667D 07 rlca ROM3:667E 06 D1 ld b,D1 ROM3:6680 C1 pop bc ROM3:6681 F1 pop af ROM3:6682 C9 ret
Steel Shell
ROM3:6683 F5 push af ROM3:6684 C5 push bc ROM3:6685 D5 push de ROM3:6686 FA 8B C8 ld a,(C88B) ROM3:6689 4F ld c,a ROM3:668A FA 8C C8 ld a,(C88C) ROM3:668D 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:668E 16 08 ld d,08 ROM3:6690 CF rst 08 ROM3:6691 0D dec c ROM3:6692 07 rlca ROM3:6693 FE 01 cp a,01 ROM3:6695 20 26 jr nz,66BD ROM3:6697 CF rst 08 ROM3:6698 0D dec c ROM3:6699 0A ld a,(bc) ROM3:669A FE 00 cp a,00 ROM3:669C 20 16 jr nz,66B4 ROM3:669E FA 00 C7 ld a,(C700) ROM3:66A1 47 ld b,a ROM3:66A2 FA 01 C7 ld a,(C701) ROM3:66A5 4F ld c,a ROM3:66A6 CD C7 50 call 50C7 ROM3:66A9 CD 93 5F call 5F93 ROM3:66AC 01 35 01 ld bc,0135 ROM3:66AF CD 5D 61 call 615D ROM3:66B2 18 09 jr 66BD ROM3:66B4 CF rst 08 ROM3:66B5 0F rrca ROM3:66B6 0A ld a,(bc) ROM3:66B7 CD 93 5F call 5F93 ROM3:66BA CF rst 08 ROM3:66BB 07 rlca ROM3:66BC 06 D1 ld b,D1 ROM3:66BE C1 pop bc ROM3:66BF F1 pop af ROM3:66C0 C9 ret
Vile Germs
ROM3:66C1 F5 push af ROM3:66C2 C5 push bc ROM3:66C3 D5 push de ROM3:66C4 FA 8B C8 ld a,(C88B) ROM3:66C7 4F ld c,a ROM3:66C8 FA 8C C8 ld a,(C88C) ROM3:66CB 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:66CC 16 09 ld d,09 ROM3:66CE CF rst 08 ROM3:66CF 0D dec c ROM3:66D0 07 rlca ROM3:66D1 FE 01 cp a,01 ROM3:66D3 20 26 jr nz,66FB ROM3:66D5 CF rst 08 ROM3:66D6 0D dec c ROM3:66D7 0A ld a,(bc) ROM3:66D8 FE 00 cp a,00 ROM3:66DA 20 16 jr nz,66F2 ROM3:66DC FA 00 C7 ld a,(C700) ROM3:66DF 47 ld b,a ROM3:66E0 FA 01 C7 ld a,(C701) ROM3:66E3 4F ld c,a ROM3:66E4 CD C7 50 call 50C7 ROM3:66E7 CD 93 5F call 5F93 ROM3:66EA 01 36 01 ld bc,0136 ROM3:66ED CD 5D 61 call 615D ROM3:66F0 18 09 jr 66FB ROM3:66F2 CF rst 08 ROM3:66F3 0F rrca ROM3:66F4 0A ld a,(bc) ROM3:66F5 CD 93 5F call 5F93 ROM3:66F8 CF rst 08 ROM3:66F9 07 rlca ROM3:66FA 06 D1 ld b,D1 ROM3:66FC C1 pop bc ROM3:66FD F1 pop af ROM3:66FE C9 ret
Black Pendant
ROM3:66FF F5 push af ROM3:6700 C5 push bc ROM3:6701 D5 push de ROM3:6702 FA 8B C8 ld a,(C88B) ROM3:6705 4F ld c,a ROM3:6706 FA 8C C8 ld a,(C88C) ROM3:6709 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:670A 16 0A ld d,0A ROM3:670C CF rst 08 ROM3:670D 0D dec c ROM3:670E 07 rlca ROM3:670F FE 01 cp a,01 ROM3:6711 20 26 jr nz,6739 ROM3:6713 CF rst 08 ROM3:6714 0D dec c ROM3:6715 0A ld a,(bc) ROM3:6716 FE 00 cp a,00 ROM3:6718 20 16 jr nz,6730 ROM3:671A FA 00 C7 ld a,(C700) ROM3:671D 47 ld b,a ROM3:671E FA 01 C7 ld a,(C701) ROM3:6721 4F ld c,a ROM3:6722 CD C7 50 call 50C7 ROM3:6725 CD 93 5F call 5F93 ROM3:6728 01 37 01 ld bc,0137 ROM3:672B CD 5D 61 call 615D ROM3:672E 18 09 jr 6739 ROM3:6730 CF rst 08 ROM3:6731 0F rrca ROM3:6732 0A ld a,(bc) ROM3:6733 CD 93 5F call 5F93 ROM3:6736 CF rst 08 ROM3:6737 07 rlca ROM3:6738 06 D1 ld b,D1 ROM3:673A C1 pop bc ROM3:673B F1 pop af ROM3:673C C9 ret
Silver Bow & Arrow
ROM3:673D F5 push af ROM3:673E C5 push bc ROM3:673F D5 push de ROM3:6740 FA 8B C8 ld a,(C88B) ROM3:6743 4F ld c,a ROM3:6744 FA 8C C8 ld a,(C88C) ROM3:6747 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6748 16 0B ld d,0B ROM3:674A CF rst 08 ROM3:674B 0D dec c ROM3:674C 07 rlca ROM3:674D FE 01 cp a,01 ROM3:674F 20 26 jr nz,6777 ROM3:6751 CF rst 08 ROM3:6752 0D dec c ROM3:6753 0A ld a,(bc) ROM3:6754 FE 00 cp a,00 ROM3:6756 20 16 jr nz,676E ROM3:6758 FA 00 C7 ld a,(C700) ROM3:675B 47 ld b,a ROM3:675C FA 01 C7 ld a,(C701) ROM3:675F 4F ld c,a ROM3:6760 CD C7 50 call 50C7 ROM3:6763 CD 93 5F call 5F93 ROM3:6766 01 38 01 ld bc,0138 ROM3:6769 CD 5D 61 call 615D ROM3:676C 18 09 jr 6777 ROM3:676E CF rst 08 ROM3:676F 0F rrca ROM3:6770 0A ld a,(bc) ROM3:6771 CD 93 5F call 5F93 ROM3:6774 CF rst 08 ROM3:6775 07 rlca ROM3:6776 06 D1 ld b,D1 ROM3:6778 C1 pop bc ROM3:6779 F1 pop af ROM3:677A C9 ret
Horn of Light
ROM3:677B F5 push af ROM3:677C C5 push bc ROM3:677D D5 push de ROM3:677E FA 8B C8 ld a,(C88B) ROM3:6781 4F ld c,a ROM3:6782 FA 8C C8 ld a,(C88C) ROM3:6785 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6786 16 0C ld d,0C ROM3:6788 CF rst 08 ROM3:6789 0D dec c ROM3:678A 07 rlca ROM3:678B FE 01 cp a,01 ROM3:678D 20 26 jr nz,67B5 ROM3:678F CF rst 08 ROM3:6790 0D dec c ROM3:6791 0A ld a,(bc) ROM3:6792 FE 00 cp a,00 ROM3:6794 20 16 jr nz,67AC ROM3:6796 FA 00 C7 ld a,(C700) ROM3:6799 47 ld b,a ROM3:679A FA 01 C7 ld a,(C701) ROM3:679D 4F ld c,a ROM3:679E CD C7 50 call 50C7 ROM3:67A1 CD 93 5F call 5F93 ROM3:67A4 01 39 01 ld bc,0139 ROM3:67A7 CD 5D 61 call 615D ROM3:67AA 18 09 jr 67B5 ROM3:67AC CF rst 08 ROM3:67AD 0F rrca ROM3:67AE 0A ld a,(bc) ROM3:67AF CD 93 5F call 5F93 ROM3:67B2 CF rst 08 ROM3:67B3 07 rlca ROM3:67B4 06 D1 ld b,D1 ROM3:67B6 C1 pop bc ROM3:67B7 F1 pop af ROM3:67B8 C9 ret
Horn of the Unicorn
ROM3:67B9 F5 push af ROM3:67BA C5 push bc ROM3:67BB D5 push de ROM3:67BC FA 8B C8 ld a,(C88B) ROM3:67BF 4F ld c,a ROM3:67C0 FA 8C C8 ld a,(C88C) ROM3:67C3 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:67C4 16 0D ld d,0D ROM3:67C6 CF rst 08 ROM3:67C7 0D dec c ROM3:67C8 07 rlca ROM3:67C9 FE 01 cp a,01 ROM3:67CB 20 26 jr nz,67F3 ROM3:67CD CF rst 08 ROM3:67CE 0D dec c ROM3:67CF 0A ld a,(bc) ROM3:67D0 FE 00 cp a,00 ROM3:67D2 20 16 jr nz,67EA ROM3:67D4 FA 00 C7 ld a,(C700) ROM3:67D7 47 ld b,a ROM3:67D8 FA 01 C7 ld a,(C701) ROM3:67DB 4F ld c,a ROM3:67DC CD C7 50 call 50C7 ROM3:67DF CD 93 5F call 5F93 ROM3:67E2 01 3A 01 ld bc,013A ROM3:67E5 CD 5D 61 call 615D ROM3:67E8 18 09 jr 67F3 ROM3:67EA CF rst 08 ROM3:67EB 0F rrca ROM3:67EC 0A ld a,(bc) ROM3:67ED CD 93 5F call 5F93 ROM3:67F0 CF rst 08 ROM3:67F1 07 rlca ROM3:67F2 06 D1 ld b,D1 ROM3:67F4 C1 pop bc ROM3:67F5 F1 pop af ROM3:67F6 C9 ret
Dragon Treasure
ROM3:67F7 F5 push af ROM3:67F8 C5 push bc ROM3:67F9 D5 push de ROM3:67FA FA 8B C8 ld a,(C88B) ROM3:67FD 4F ld c,a ROM3:67FE FA 8C C8 ld a,(C88C) ROM3:6801 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6802 16 0E ld d,0E ROM3:6804 CF rst 08 ROM3:6805 0D dec c ROM3:6806 07 rlca ROM3:6807 FE 01 cp a,01 ROM3:6809 20 26 jr nz,6831 ROM3:680B CF rst 08 ROM3:680C 0D dec c ROM3:680D 0A ld a,(bc) ROM3:680E FE 00 cp a,00 ROM3:6810 20 16 jr nz,6828 ROM3:6812 FA 00 C7 ld a,(C700) ROM3:6815 47 ld b,a ROM3:6816 FA 01 C7 ld a,(C701) ROM3:6819 4F ld c,a ROM3:681A CD C7 50 call 50C7 ROM3:681D CD 93 5F call 5F93 ROM3:6820 01 3B 01 ld bc,013B ROM3:6823 CD 5D 61 call 615D ROM3:6826 18 09 jr 6831 ROM3:6828 CF rst 08 ROM3:6829 0F rrca ROM3:682A 0A ld a,(bc) ROM3:682B CD 93 5F call 5F93 ROM3:682E CF rst 08 ROM3:682F 07 rlca ROM3:6830 06 D1 ld b,D1 ROM3:6832 C1 pop bc ROM3:6833 F1 pop af ROM3:6834 C9 ret
Electro-whip
ROM3:6835 F5 push af ROM3:6836 C5 push bc ROM3:6837 D5 push de ROM3:6838 FA 8B C8 ld a,(C88B) ROM3:683B 4F ld c,a ROM3:683C FA 8C C8 ld a,(C88C) ROM3:683F 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6840 16 0F ld d,0F ROM3:6842 CF rst 08 ROM3:6843 0D dec c ROM3:6844 07 rlca ROM3:6845 FE 01 cp a,01 ROM3:6847 20 26 jr nz,686F ROM3:6849 CF rst 08 ROM3:684A 0D dec c ROM3:684B 0A ld a,(bc) ROM3:684C FE 00 cp a,00 ROM3:684E 20 16 jr nz,6866 ROM3:6850 FA 00 C7 ld a,(C700) ROM3:6853 47 ld b,a ROM3:6854 FA 01 C7 ld a,(C701) ROM3:6857 4F ld c,a ROM3:6858 CD C7 50 call 50C7 ROM3:685B CD 93 5F call 5F93 ROM3:685E 01 3C 01 ld bc,013C ROM3:6861 CD 5D 61 call 615D ROM3:6864 18 09 jr 686F ROM3:6866 CF rst 08 ROM3:6867 0F rrca ROM3:6868 0A ld a,(bc) ROM3:6869 CD 93 5F call 5F93 ROM3:686C CF rst 08 ROM3:686D 07 rlca ROM3:686E 06 D1 ld b,D1 ROM3:6870 C1 pop bc ROM3:6871 F1 pop af ROM3:6872 C9 ret
Cyber Shield
ROM3:6873 F5 push af ROM3:6874 C5 push bc ROM3:6875 D5 push de ROM3:6876 FA 8B C8 ld a,(C88B) ROM3:6879 4F ld c,a ROM3:687A FA 8C C8 ld a,(C88C) ROM3:687D 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:687E 16 10 ld d,10 ROM3:6880 CF rst 08 ROM3:6881 0D dec c ROM3:6882 07 rlca ROM3:6883 FE 01 cp a,01 ROM3:6885 20 26 jr nz,68AD ROM3:6887 CF rst 08 ROM3:6888 0D dec c ROM3:6889 0A ld a,(bc) ROM3:688A FE 00 cp a,00 ROM3:688C 20 16 jr nz,68A4 ROM3:688E FA 00 C7 ld a,(C700) ROM3:6891 47 ld b,a ROM3:6892 FA 01 C7 ld a,(C701) ROM3:6895 4F ld c,a ROM3:6896 CD C7 50 call 50C7 ROM3:6899 CD 93 5F call 5F93 ROM3:689C 01 3D 01 ld bc,013D ROM3:689F CD 5D 61 call 615D ROM3:68A2 18 09 jr 68AD ROM3:68A4 CF rst 08 ROM3:68A5 0F rrca ROM3:68A6 0A ld a,(bc) ROM3:68A7 CD 93 5F call 5F93 ROM3:68AA CF rst 08 ROM3:68AB 07 rlca ROM3:68AC 06 D1 ld b,D1 ROM3:68AE C1 pop bc ROM3:68AF F1 pop af ROM3:68B0 C9 ret
Mystical Moon
ROM3:68B1 F5 push af ROM3:68B2 C5 push bc ROM3:68B3 D5 push de ROM3:68B4 FA 8B C8 ld a,(C88B) ROM3:68B7 4F ld c,a ROM3:68B8 FA 8C C8 ld a,(C88C) ROM3:68BB 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:68BC 16 11 ld d,11 ROM3:68BE CF rst 08 ROM3:68BF 0D dec c ROM3:68C0 07 rlca ROM3:68C1 FE 01 cp a,01 ROM3:68C3 20 26 jr nz,68EB ROM3:68C5 CF rst 08 ROM3:68C6 0D dec c ROM3:68C7 0A ld a,(bc) ROM3:68C8 FE 00 cp a,00 ROM3:68CA 20 16 jr nz,68E2 ROM3:68CC FA 00 C7 ld a,(C700) ROM3:68CF 47 ld b,a ROM3:68D0 FA 01 C7 ld a,(C701) ROM3:68D3 4F ld c,a ROM3:68D4 CD C7 50 call 50C7 ROM3:68D7 CD 93 5F call 5F93 ROM3:68DA 01 3F 01 ld bc,013F ROM3:68DD CD 5D 61 call 615D ROM3:68E0 18 09 jr 68EB ROM3:68E2 CF rst 08 ROM3:68E3 0F rrca ROM3:68E4 0A ld a,(bc) ROM3:68E5 CD 93 5F call 5F93 ROM3:68E8 CF rst 08 ROM3:68E9 07 rlca ROM3:68EA 06 D1 ld b,D1 ROM3:68EC C1 pop bc ROM3:68ED F1 pop af ROM3:68EE C9 ret
Malevolent Nuzzler
ROM3:68EF F5 push af ROM3:68F0 C5 push bc ROM3:68F1 D5 push de ROM3:68F2 FA 8B C8 ld a,(C88B) ROM3:68F5 4F ld c,a ROM3:68F6 FA 8C C8 ld a,(C88C) ROM3:68F9 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:68FA 16 12 ld d,12 ROM3:68FC CF rst 08 ROM3:68FD 0D dec c ROM3:68FE 07 rlca ROM3:68FF FE 01 cp a,01 ROM3:6901 20 26 jr nz,6929 ROM3:6903 CF rst 08 ROM3:6904 0D dec c ROM3:6905 0A ld a,(bc) ROM3:6906 FE 00 cp a,00 ROM3:6908 20 16 jr nz,6920 ROM3:690A FA 00 C7 ld a,(C700) ROM3:690D 47 ld b,a ROM3:690E FA 01 C7 ld a,(C701) ROM3:6911 4F ld c,a ROM3:6912 CD C7 50 call 50C7 ROM3:6915 CD 93 5F call 5F93 ROM3:6918 01 41 01 ld bc,0141 ROM3:691B CD 5D 61 call 615D ROM3:691E 18 09 jr 6929 ROM3:6920 CF rst 08 ROM3:6921 0F rrca ROM3:6922 0A ld a,(bc) ROM3:6923 CD 93 5F call 5F93 ROM3:6926 CF rst 08 ROM3:6927 07 rlca ROM3:6928 06 D1 ld b,D1 ROM3:692A C1 pop bc ROM3:692B F1 pop af ROM3:692C C9 ret
Violet Crystal
ROM3:692D F5 push af ROM3:692E C5 push bc ROM3:692F D5 push de ROM3:6930 FA 8B C8 ld a,(C88B) ROM3:6933 4F ld c,a ROM3:6934 FA 8C C8 ld a,(C88C) ROM3:6937 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6938 16 13 ld d,13 ROM3:693A CF rst 08 ROM3:693B 0D dec c ROM3:693C 07 rlca ROM3:693D FE 01 cp a,01 ROM3:693F 20 26 jr nz,6967 ROM3:6941 CF rst 08 ROM3:6942 0D dec c ROM3:6943 0A ld a,(bc) ROM3:6944 FE 00 cp a,00 ROM3:6946 20 16 jr nz,695E ROM3:6948 FA 00 C7 ld a,(C700) ROM3:694B 47 ld b,a ROM3:694C FA 01 C7 ld a,(C701) ROM3:694F 4F ld c,a ROM3:6950 CD C7 50 call 50C7 ROM3:6953 CD 93 5F call 5F93 ROM3:6956 01 42 01 ld bc,0142 ROM3:6959 CD 5D 61 call 615D ROM3:695C 18 09 jr 6967 ROM3:695E CF rst 08 ROM3:695F 0F rrca ROM3:6960 0A ld a,(bc) ROM3:6961 CD 93 5F call 5F93 ROM3:6964 CF rst 08 ROM3:6965 07 rlca ROM3:6966 06 D1 ld b,D1 ROM3:6968 C1 pop bc ROM3:6969 F1 pop af ROM3:696A C9 ret
Book of Secret Art
ROM3:696B F5 push af ROM3:696C C5 push bc ROM3:696D D5 push de ROM3:696E FA 8B C8 ld a,(C88B) ROM3:6971 4F ld c,a ROM3:6972 FA 8C C8 ld a,(C88C) ROM3:6975 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6976 16 14 ld d,14 ROM3:6978 CF rst 08 ROM3:6979 0D dec c ROM3:697A 07 rlca ROM3:697B FE 01 cp a,01 ROM3:697D 20 26 jr nz,69A5 ROM3:697F CF rst 08 ROM3:6980 0D dec c ROM3:6981 0A ld a,(bc) ROM3:6982 FE 00 cp a,00 ROM3:6984 20 16 jr nz,699C ROM3:6986 FA 00 C7 ld a,(C700) ROM3:6989 47 ld b,a ROM3:698A FA 01 C7 ld a,(C701) ROM3:698D 4F ld c,a ROM3:698E CD C7 50 call 50C7 ROM3:6991 CD 93 5F call 5F93 ROM3:6994 01 43 01 ld bc,0143 ROM3:6997 CD 5D 61 call 615D ROM3:699A 18 09 jr 69A5 ROM3:699C CF rst 08 ROM3:699D 0F rrca ROM3:699E 0A ld a,(bc) ROM3:699F CD 93 5F call 5F93 ROM3:69A2 CF rst 08 ROM3:69A3 07 rlca ROM3:69A4 06 D1 ld b,D1 ROM3:69A6 C1 pop bc ROM3:69A7 F1 pop af ROM3:69A8 C9 ret
Invigoration
ROM3:69A9 F5 push af ROM3:69AA C5 push bc ROM3:69AB D5 push de ROM3:69AC FA 8B C8 ld a,(C88B) ROM3:69AF 4F ld c,a ROM3:69B0 FA 8C C8 ld a,(C88C) ROM3:69B3 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:69B4 16 15 ld d,15 ROM3:69B6 CF rst 08 ROM3:69B7 0D dec c ROM3:69B8 07 rlca ROM3:69B9 FE 01 cp a,01 ROM3:69BB 20 26 jr nz,69E3 ROM3:69BD CF rst 08 ROM3:69BE 0D dec c ROM3:69BF 0A ld a,(bc) ROM3:69C0 FE 00 cp a,00 ROM3:69C2 20 16 jr nz,69DA ROM3:69C4 FA 00 C7 ld a,(C700) ROM3:69C7 47 ld b,a ROM3:69C8 FA 01 C7 ld a,(C701) ROM3:69CB 4F ld c,a ROM3:69CC CD C7 50 call 50C7 ROM3:69CF CD 93 5F call 5F93 ROM3:69D2 01 44 01 ld bc,0144 ROM3:69D5 CD 5D 61 call 615D ROM3:69D8 18 09 jr 69E3 ROM3:69DA CF rst 08 ROM3:69DB 0F rrca ROM3:69DC 0A ld a,(bc) ROM3:69DD CD 93 5F call 5F93 ROM3:69E0 CF rst 08 ROM3:69E1 07 rlca ROM3:69E2 06 D1 ld b,D1 ROM3:69E4 C1 pop bc ROM3:69E5 F1 pop af ROM3:69E6 C9 ret
Machine Conversion
ROM3:69E7 F5 push af ROM3:69E8 C5 push bc ROM3:69E9 D5 push de ROM3:69EA FA 8B C8 ld a,(C88B) ROM3:69ED 4F ld c,a ROM3:69EE FA 8C C8 ld a,(C88C) ROM3:69F1 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:69F2 16 16 ld d,16 ROM3:69F4 CF rst 08 ROM3:69F5 0D dec c ROM3:69F6 07 rlca ROM3:69F7 FE 01 cp a,01 ROM3:69F9 20 26 jr nz,6A21 ROM3:69FB CF rst 08 ROM3:69FC 0D dec c ROM3:69FD 0A ld a,(bc) ROM3:69FE FE 00 cp a,00 ROM3:6A00 20 16 jr nz,6A18 ROM3:6A02 FA 00 C7 ld a,(C700) ROM3:6A05 47 ld b,a ROM3:6A06 FA 01 C7 ld a,(C701) ROM3:6A09 4F ld c,a ROM3:6A0A CD C7 50 call 50C7 ROM3:6A0D CD 93 5F call 5F93 ROM3:6A10 01 45 01 ld bc,0145 ROM3:6A13 CD 5D 61 call 615D ROM3:6A16 18 09 jr 6A21 ROM3:6A18 CF rst 08 ROM3:6A19 0F rrca ROM3:6A1A 0A ld a,(bc) ROM3:6A1B CD 93 5F call 5F93 ROM3:6A1E CF rst 08 ROM3:6A1F 07 rlca ROM3:6A20 06 D1 ld b,D1 ROM3:6A22 C1 pop bc ROM3:6A23 F1 pop af ROM3:6A24 C9 ret
Raise Body Heat
ROM3:6A25 F5 push af ROM3:6A26 C5 push bc ROM3:6A27 D5 push de ROM3:6A28 FA 8B C8 ld a,(C88B) ROM3:6A2B 4F ld c,a ROM3:6A2C FA 8C C8 ld a,(C88C) ROM3:6A2F 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6A30 16 17 ld d,17 ROM3:6A32 CF rst 08 ROM3:6A33 0D dec c ROM3:6A34 07 rlca ROM3:6A35 FE 01 cp a,01 ROM3:6A37 20 26 jr nz,6A5F ROM3:6A39 CF rst 08 ROM3:6A3A 0D dec c ROM3:6A3B 0A ld a,(bc) ROM3:6A3C FE 00 cp a,00 ROM3:6A3E 20 16 jr nz,6A56 ROM3:6A40 FA 00 C7 ld a,(C700) ROM3:6A43 47 ld b,a ROM3:6A44 FA 01 C7 ld a,(C701) ROM3:6A47 4F ld c,a ROM3:6A48 CD C7 50 call 50C7 ROM3:6A4B CD 93 5F call 5F93 ROM3:6A4E 01 46 01 ld bc,0146 ROM3:6A51 CD 5D 61 call 615D ROM3:6A54 18 09 jr 6A5F ROM3:6A56 CF rst 08 ROM3:6A57 0F rrca ROM3:6A58 0A ld a,(bc) ROM3:6A59 CD 93 5F call 5F93 ROM3:6A5C CF rst 08 ROM3:6A5D 07 rlca ROM3:6A5E 06 D1 ld b,D1 ROM3:6A60 C1 pop bc ROM3:6A61 F1 pop af ROM3:6A62 C9 ret
Follow Wind
ROM3:6A63 F5 push af ROM3:6A64 C5 push bc ROM3:6A65 D5 push de ROM3:6A66 FA 8B C8 ld a,(C88B) ROM3:6A69 4F ld c,a ROM3:6A6A FA 8C C8 ld a,(C88C) ROM3:6A6D 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6A6E 16 18 ld d,18 ROM3:6A70 CF rst 08 ROM3:6A71 0D dec c ROM3:6A72 07 rlca ROM3:6A73 FE 01 cp a,01 ROM3:6A75 20 26 jr nz,6A9D ROM3:6A77 CF rst 08 ROM3:6A78 0D dec c ROM3:6A79 0A ld a,(bc) ROM3:6A7A FE 00 cp a,00 ROM3:6A7C 20 16 jr nz,6A94 ROM3:6A7E FA 00 C7 ld a,(C700) ROM3:6A81 47 ld b,a ROM3:6A82 FA 01 C7 ld a,(C701) ROM3:6A85 4F ld c,a ROM3:6A86 CD C7 50 call 50C7 ROM3:6A89 CD 93 5F call 5F93 ROM3:6A8C 01 47 01 ld bc,0147 ROM3:6A8F CD 5D 61 call 615D ROM3:6A92 18 09 jr 6A9D ROM3:6A94 CF rst 08 ROM3:6A95 0F rrca ROM3:6A96 0A ld a,(bc) ROM3:6A97 CD 93 5F call 5F93 ROM3:6A9A CF rst 08 ROM3:6A9B 07 rlca ROM3:6A9C 06 D1 ld b,D1 ROM3:6A9E C1 pop bc ROM3:6A9F F1 pop af ROM3:6AA0 C9 ret
Power of Kaishin
ROM3:6AA1 F5 push af ROM3:6AA2 C5 push bc ROM3:6AA3 D5 push de ROM3:6AA4 FA 8B C8 ld a,(C88B) ROM3:6AA7 4F ld c,a ROM3:6AA8 FA 8C C8 ld a,(C88C) ROM3:6AAB 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6AAC 16 19 ld d,19 ROM3:6AAE CF rst 08 ROM3:6AAF 0D dec c ROM3:6AB0 07 rlca ROM3:6AB1 FE 01 cp a,01 ROM3:6AB3 20 26 jr nz,6ADB ROM3:6AB5 CF rst 08 ROM3:6AB6 0D dec c ROM3:6AB7 0A ld a,(bc) ROM3:6AB8 FE 00 cp a,00 ROM3:6ABA 20 16 jr nz,6AD2 ROM3:6ABC FA 00 C7 ld a,(C700) ROM3:6ABF 47 ld b,a ROM3:6AC0 FA 01 C7 ld a,(C701) ROM3:6AC3 4F ld c,a ROM3:6AC4 CD C7 50 call 50C7 ROM3:6AC7 CD 93 5F call 5F93 ROM3:6ACA 01 48 01 ld bc,0148 ROM3:6ACD CD 5D 61 call 615D ROM3:6AD0 18 09 jr 6ADB ROM3:6AD2 CF rst 08 ROM3:6AD3 0F rrca ROM3:6AD4 0A ld a,(bc) ROM3:6AD5 CD 93 5F call 5F93 ROM3:6AD8 CF rst 08 ROM3:6AD9 07 rlca ROM3:6ADA 06 D1 ld b,D1 ROM3:6ADC C1 pop bc ROM3:6ADD F1 pop af ROM3:6ADE C9 ret
Stop Defense
ROM3:6ADF F5 push af ROM3:6AE0 C5 push bc ROM3:6AE1 CD 3A 2C call 2C3A ROM3:6AE4 0E 01 ld c,01 ROM3:6AE6 06 00 ld b,00 ROM3:6AE8 78 ld a,b ROM3:6AE9 FE 05 cp a,05 ROM3:6AEB 30 13 jr nc,6B00 ROM3:6AED CD CB 4E call 4ECB ROM3:6AF0 FE 00 cp a,00 ROM3:6AF2 20 09 jr nz,6AFD ROM3:6AF4 CD 12 50 call 5012 ROM3:6AF7 CD 25 20 call 2025 ROM3:6AFA CD FB 19 call 19FB ROM3:6AFD 04 inc b ROM3:6AFE 18 E8 jr 6AE8 ROM3:6B00 CD 7F 5F call 5F7F ROM3:6B03 CD 68 41 call 4168 ROM3:6B06 3E 13 ld a,13 ROM3:6B08 CF rst 08 ROM3:6B09 0B dec bc ROM3:6B0A 06 C1 ld b,C1 ROM3:6B0C F1 pop af ROM3:6B0D C9 ret
Dragon Capture Jar
ROM3:6B0E F5 push af ROM3:6B0F C5 push bc ROM3:6B10 D5 push de ROM3:6B11 1E 01 ld e,01 ROM3:6B13 0E 01 ld c,01 ROM3:6B15 06 00 ld b,00 ROM3:6B17 78 ld a,b ROM3:6B18 FE 05 cp a,05 ROM3:6B1A 30 11 jr nc,6B2D ROM3:6B1C 3E 00 ld a,00 ROM3:6B1E CD 36 51 call 5136 ROM3:6B21 FE 00 cp a,00 ROM3:6B23 20 05 jr nz,6B2A ROM3:6B25 CD 86 20 call 2086 ROM3:6B28 1E 00 ld e,00 ROM3:6B2A 04 inc b ROM3:6B2B 18 EA jr 6B17 ROM3:6B2D CD 7F 5F call 5F7F ROM3:6B30 CD 68 41 call 4168 ROM3:6B33 3E 1C ld a,1C ROM3:6B35 CF rst 08 ROM3:6B36 0B dec bc ROM3:6B37 06 D1 ld b,D1 ROM3:6B39 C1 pop bc ROM3:6B3A F1 pop af ROM3:6B3B C9 ret
Swords of Revealing Light
ROM3:6B3C F5 push af ROM3:6B3D C5 push bc ROM3:6B3E D5 push de ROM3:6B3F CD 76 2C call 2C76 ;Set CPU's SoRL counter to 4 ROM3:6B42 0E 01 ld c,01 ROM3:6B44 06 00 ld b,00 ROM3:6B46 78 ld a,b ROM3:6B47 FE 05 cp a,05 ROM3:6B49 30 0F jr nc,6B5A ROM3:6B4B CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:6B4E CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:6B51 CD 12 50 call 5012 ROM3:6B54 CD FB 19 call 19FB ;Update selected card ID and status ROM3:6B57 04 inc b ROM3:6B58 18 EC jr 6B46 ROM3:6B5A 0E 02 ld c,02 ROM3:6B5C 06 01 ld b,01 ROM3:6B5E 78 ld a,b ROM3:6B5F FE 06 cp a,06 ROM3:6B61 30 0F jr nc,6B72 ROM3:6B63 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:6B66 CD 13 1A call 1A13 ;Stores selected card ID and status ROM3:6B69 CD 12 50 call 5012 ROM3:6B6C CD FB 19 call 19FB ;Update selected card ID and status ROM3:6B6F 04 inc b ROM3:6B70 18 EC jr 6B5E ROM3:6B72 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6B75 CD 68 41 call 4168 ROM3:6B78 3E 2F ld a,2F ROM3:6B7A CF rst 08 ROM3:6B7B 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x2F) ROM3:6B7D D1 pop de ROM3:6B7E C1 pop bc ROM3:6B7F F1 pop af ROM3:6B80 C9 ret
Dark-Piercing Light
ROM3:6B81 F5 push af ROM3:6B82 C5 push bc ROM3:6B83 D5 push de ROM3:6B84 0E 01 ld c,01 ROM3:6B86 06 00 ld b,00 ROM3:6B88 78 ld a,b ROM3:6B89 FE 05 cp a,05 ROM3:6B8B 30 0F jr nc,6B9C ROM3:6B8D CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:6B90 CD 13 1A call 1A13 ;Store selected card ID and status ROM3:6B93 CD 12 50 call 5012 ROM3:6B96 CD FB 19 call 19FB ;Update selected card ID and status ROM3:6B99 04 inc b ROM3:6B9A 18 EC jr 6B88 ROM3:6B9C 0E 02 ld c,02 ROM3:6B9E 06 01 ld b,01 ROM3:6BA0 78 ld a,b ROM3:6BA1 FE 06 cp a,06 ROM3:6BA3 30 0F jr nc,6BB4 ROM3:6BA5 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:6BA8 CD 13 1A call 1A13 ;Store selected card ID and status ROM3:6BAB CD 12 50 call 5012 ROM3:6BAE CD FB 19 call 19FB ;Update selected card ID and status ROM3:6BB1 04 inc b ROM3:6BB2 18 EC jr 6BA0 ROM3:6BB4 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6BB7 CD 68 41 call 4168 ROM3:6BBA 3E 31 ld a,31 ROM3:6BBC CF rst 08 ROM3:6BBD 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x31) ROM3:6BBF D1 pop de ROM3:6BC0 C1 pop bc ROM3:6BC1 F1 pop af ROM3:6BC2 C9 ret
Spellbinding Circle
ROM3:6BC3 F5 push af ROM3:6BC4 C5 push bc ROM3:6BC5 D5 push de ROM3:6BC6 0E 01 ld c,01 ROM3:6BC8 06 00 ld b,00 ROM3:6BCA 78 ld a,b ROM3:6BCB FE 05 cp a,05 ROM3:6BCD 30 10 jr nc,6BDF ROM3:6BCF CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:6BD2 FE 00 cp a,00 ROM3:6BD4 20 06 jr nz,6BDC ROM3:6BD6 CD 92 1F call 1F92 ;Decrease Card Level ROM3:6BD9 CD FB 19 call 19FB ;Update selected card ID and status ROM3:6BDC 04 inc b ROM3:6BDD 18 EB jr 6BCA ROM3:6BDF CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6BE2 CD 68 41 call 4168 ROM3:6BE5 3E 30 ld a,30 ROM3:6BE7 CF rst 08 ROM3:6BE8 0B 06 => Pointer 06:400B (loads Sound Effect and Text 0x30) ROM3:6BEA D1 pop de ROM3:6BEB C1 pop bc ROM3:6BEC F1 pop af ROM3:6BED C9 ret
Elegant Egotist
ROM3:6BEE F5 push af ROM3:6BEF C5 push bc ROM3:6BF0 D5 push de ROM3:6BF1 CD 93 5F call 5F93 ;Removes selected card ROM3:6BF4 FA 8B C8 ld a,(C88B) ROM3:6BF7 4F ld c,a ;bc = Monster Card targeted ROM3:6BF8 FA 8C C8 ld a,(C88C) ROM3:6BFB 47 ld b,a ROM3:6BFC 11 3E 00 ld de,003E ;de = Harpie Lady ID ROM3:6BFF CD 14 1B call 1B14 ;Checks if Monster ≠ Harpie Lady ROM3:6C02 FE 00 cp a,00 ROM3:6C04 20 35 jr nz,6C3B ;If(Monster ID ≠ Harpie Lady), get out of this function ROM3:6C06 CD D9 2A call 2AD9 ;Does nothing, there is no Sound Effect with the ID 0x20 ROM3:6C09 FA 00 C7 ld a,(C700) ;Column to check ROM3:6C0C 47 ld b,a ROM3:6C0D FA 01 C7 ld a,(C701) ;Row to check ROM3:6C10 4F ld c,a ROM3:6C11 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:6C14 CD E6 19 call 19E6 ;Remove selected card from the field ROM3:6C17 01 3F 00 ld bc,003F ;Harpie Lady Sisters ID ROM3:6C1A C5 push bc ROM3:6C1B CF rst 08 9B 01 => to 1:409B, pointer to 1:4ADF - Returns offset for selected card ID ROM3:6C1E CF rst 08 0B 01 => 1:5292, (Try to) check if card ID is valid, store it to wC5FC ROM3:6C21 CF rst 08 17 01 => to 1:4017, pointer to 1:5319 (register card if not owned) ROM3:6C24 C1 pop bc ROM3:6C25 79 ld a,c ROM3:6C26 EA A3 C7 ld (C7A3),a ROM3:6C29 78 ld a,b ROM3:6C2A EA A4 C7 ld (C7A4),a ;Card being processed = Harpie Lady Sisters ROM3:6C2D CD 25 20 call 2025 ;Hide Player's Card, reset Level ROM3:6C30 CD C9 1F call 1FC9 ;Reveal Card ROM3:6C33 CD FB 19 call 19FB ;Updates Card status ROM3:6C36 3E 11 ld a,11 ROM3:6C38 CF rst 08 ;Loads Sound Effect and Text 0x11 ... ROM3:6C3B D1 pop de ROM3:6C3C C1 pop bc ROM3:6C3D F1 pop af ROM3:6C3E C9 ret
Trap Cards 1 (set)
Widespread Ruin
ROM3:6C3F F5 push af ROM3:6C40 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C43 CD 9F 5E call 5E9F ROM3:6C46 CD 68 41 call 4168 ROM3:6C49 F1 pop af ROM3:6C4A C9 ret
House of Adhesive Trap
ROM3:6C4B F5 push af ROM3:6C4C CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C4F CD 9F 5E call 5E9F ROM3:6C52 CD 68 41 call 4168 ROM3:6C55 F1 pop af ROM3:6C56 C9 ret
Eatgaboon
ROM3:6C57 F5 push af ROM3:6C58 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C5B CD 9F 5E call 5E9F ROM3:6C5E CD 68 41 call 4168 ROM3:6C61 F1 pop af ROM3:6C62 C9 ret
Bear Trap
ROM3:6C63 F5 push af ROM3:6C64 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C67 CD 9F 5E call 5E9F ROM3:6C6A CD 68 41 call 4168 ROM3:6C6D F1 pop af ROM3:6C6E C9 ret
Invisible Wire
ROM3:6C6F F5 push af ROM3:6C70 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C73 CD 9F 5E call 5E9F ROM3:6C76 CD 68 41 call 4168 ROM3:6C79 F1 pop af ROM3:6C7A C9 ret
Acid Trap Hole
ROM3:6C7B F5 push af ROM3:6C7C CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C7F CD 9F 5E call 5E9F ROM3:6C82 CD 68 41 call 4168 ROM3:6C85 F1 pop af ROM3:6C86 C9 ret
Goblin Fan
ROM3:6C87 F5 push af ROM3:6C88 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C8B CD 9F 5E call 5E9F ROM3:6C8E CD 68 41 call 4168 ROM3:6C91 F1 pop af ROM3:6C92 C9 ret
Simochi Allergy
ROM3:6C93 F5 push af ROM3:6C94 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6C97 CD 9F 5E call 5E9F ROM3:6C9A CD 68 41 call 4168 ROM3:6C9D F1 pop af ROM3:6C9E C9 ret
Reverse Trap
ROM3:6C9F F5 push af ROM3:6CA0 CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6CA3 CD 9F 5E call 5E9F ROM3:6CA6 CD 68 41 call 4168 ROM3:6CA9 F1 pop af ROM3:6CAA C9 ret
Fake Trap
ROM3:6CAB F5 push af ROM3:6CAC CD A9 2A call 2AA9 ;SE: Set Trap card ROM3:6CAF CD 9F 5E call 5E9F ROM3:6CB2 CD 68 41 call 4168 ROM3:6CB5 F1 pop af ROM3:6CB6 C9 ret
Rituals 1
Black Luster Ritual
ROM3:6CB7 F5 push af ROM3:6CB8 C5 push bc ROM3:6CB9 D5 push de ROM3:6CBA 01 00 00 ld bc,0000 ROM3:6CBD CF rst 08 ROM3:6CBE 25 dec h ROM3:6CBF 08 50 59 ld (5950),sp ROM3:6CC2 0E 02 ld c,02 ROM3:6CC4 06 01 ld b,01 ROM3:6CC6 78 ld a,b ROM3:6CC7 FE 06 cp a,06 ROM3:6CC9 30 0A jr nc,6CD5 ROM3:6CCB CD 0D 52 call 520D ROM3:6CCE FE 00 cp a,00 ROM3:6CD0 28 03 jr z,6CD5 ROM3:6CD2 04 inc b ROM3:6CD3 18 F1 jr 6CC6 ROM3:6CD5 78 ld a,b ROM3:6CD6 FE 06 cp a,06 ROM3:6CD8 28 0A jr z,6CE4 ROM3:6CDA 3E 00 ld a,00 ROM3:6CDC CF rst 08 ROM3:6CDD 23 inc hl ROM3:6CDE 08 3E 45 ld (453E),sp ROM3:6CE1 CF rst 08 ROM3:6CE2 0B dec bc ROM3:6CE3 06 CD ld b,CD ROM3:6CE5 7F ld a,a ROM3:6CE6 5F ld e,a ROM3:6CE7 CD 68 41 call 4168 ROM3:6CEA D1 pop de ROM3:6CEB C1 pop bc ROM3:6CEC F1 pop af ROM3:6CED C9 ret
Zera Ritual
ROM3:6CEE F5 push af ROM3:6CEF C5 push bc ROM3:6CF0 D5 push de ROM3:6CF1 01 00 01 ld bc,0100 ROM3:6CF4 CF rst 08 ROM3:6CF5 25 dec h ROM3:6CF6 08 50 59 ld (5950),sp ROM3:6CF9 0E 02 ld c,02 ROM3:6CFB 06 01 ld b,01 ROM3:6CFD 78 ld a,b ROM3:6CFE FE 06 cp a,06 ROM3:6D00 30 0A jr nc,6D0C ROM3:6D02 CD 0D 52 call 520D ROM3:6D05 FE 00 cp a,00 ROM3:6D07 28 03 jr z,6D0C ROM3:6D09 04 inc b ROM3:6D0A 18 F1 jr 6CFD ROM3:6D0C 78 ld a,b ROM3:6D0D FE 06 cp a,06 ROM3:6D0F 28 0A jr z,6D1B ROM3:6D11 3E 01 ld a,01 ROM3:6D13 CF rst 08 ROM3:6D14 23 inc hl ROM3:6D15 08 3E 46 ld (463E),sp ROM3:6D18 CF rst 08 ROM3:6D19 0B dec bc ROM3:6D1A 06 CD ld b,CD ROM3:6D1C 7F ld a,a ROM3:6D1D 5F ld e,a ROM3:6D1E CD 68 41 call 4168 ROM3:6D21 D1 pop de ROM3:6D22 C1 pop bc ROM3:6D23 F1 pop af ROM3:6D24 C9 ret
War-lion Ritual
ROM3:6D25 F5 push af ROM3:6D26 C5 push bc ROM3:6D27 D5 push de ROM3:6D28 01 00 02 ld bc,0200 ROM3:6D2B CF rst 08 ROM3:6D2C 25 dec h ROM3:6D2D 08 50 59 ld (5950),sp ROM3:6D30 0E 02 ld c,02 ROM3:6D32 06 01 ld b,01 ROM3:6D34 78 ld a,b ROM3:6D35 FE 06 cp a,06 ROM3:6D37 30 0A jr nc,6D43 ROM3:6D39 CD 0D 52 call 520D ROM3:6D3C FE 00 cp a,00 ROM3:6D3E 28 03 jr z,6D43 ROM3:6D40 04 inc b ROM3:6D41 18 F1 jr 6D34 ROM3:6D43 78 ld a,b ROM3:6D44 FE 06 cp a,06 ROM3:6D46 28 0A jr z,6D52 ROM3:6D48 3E 02 ld a,02 ROM3:6D4A CF rst 08 ROM3:6D4B 23 inc hl ROM3:6D4C 08 3E 48 ld (483E),sp ROM3:6D4F CF rst 08 ROM3:6D50 0B dec bc ROM3:6D51 06 CD ld b,CD ROM3:6D53 7F ld a,a ROM3:6D54 5F ld e,a ROM3:6D55 CD 68 41 call 4168 ROM3:6D58 D1 pop de ROM3:6D59 C1 pop bc ROM3:6D5A F1 pop af ROM3:6D5B C9 ret
Beastly Mirror Ritual
ROM3:6D5C F5 push af ROM3:6D5D C5 push bc ROM3:6D5E D5 push de ROM3:6D5F 01 00 03 ld bc,0300 ROM3:6D62 CF rst 08 ROM3:6D63 25 dec h ROM3:6D64 08 50 59 ld (5950),sp ROM3:6D67 0E 02 ld c,02 ROM3:6D69 06 01 ld b,01 ROM3:6D6B 78 ld a,b ROM3:6D6C FE 06 cp a,06 ROM3:6D6E 30 0A jr nc,6D7A ROM3:6D70 CD 0D 52 call 520D ROM3:6D73 FE 00 cp a,00 ROM3:6D75 28 03 jr z,6D7A ROM3:6D77 04 inc b ROM3:6D78 18 F1 jr 6D6B ROM3:6D7A 78 ld a,b ROM3:6D7B FE 06 cp a,06 ROM3:6D7D 28 0A jr z,6D89 ROM3:6D7F 3E 03 ld a,03 ROM3:6D81 CF rst 08 ROM3:6D82 23 inc hl ROM3:6D83 08 3E 49 ld (493E),sp ROM3:6D86 CF rst 08 ROM3:6D87 0B dec bc ROM3:6D88 06 CD ld b,CD ROM3:6D8A 7F ld a,a ROM3:6D8B 5F ld e,a ROM3:6D8C CD 68 41 call 4168 ROM3:6D8F D1 pop de ROM3:6D90 C1 pop bc ROM3:6D91 F1 pop af ROM3:6D92 C9 ret
Ultimate Dragon
ROM3:6D93 F5 push af ROM3:6D94 C5 push bc ROM3:6D95 3E 04 ld a,04 ROM3:6D97 CF rst 08 ROM3:6D98 27 daa ROM3:6D99 08 FE 01 ld (01FE),sp ROM3:6D9C 20 0D jr nz,6DAB ROM3:6D9E CD D1 2A call 2AD1 ROM3:6DA1 3E 04 ld a,04 ROM3:6DA3 CF rst 08 ROM3:6DA4 21 08 3E ld hl,3E08 ROM3:6DA7 4A ld c,d ROM3:6DA8 CF rst 08 ROM3:6DA9 0B dec bc ROM3:6DAA 06 CD ld b,CD ROM3:6DAC 7F ld a,a ROM3:6DAD 5F ld e,a ROM3:6DAE CD 68 41 call 4168 ROM3:6DB1 C1 pop bc ROM3:6DB2 F1 pop af ROM3:6DB3 C9 ret
Commencement Dance
ROM3:6DB4 F5 push af ROM3:6DB5 C5 push bc ROM3:6DB6 D5 push de ROM3:6DB7 01 00 08 ld bc,0800 ROM3:6DBA CF rst 08 ROM3:6DBB 25 dec h ROM3:6DBC 08 50 59 ld (5950),sp ROM3:6DBF 0E 02 ld c,02 ROM3:6DC1 06 01 ld b,01 ROM3:6DC3 78 ld a,b ROM3:6DC4 FE 06 cp a,06 ROM3:6DC6 30 0A jr nc,6DD2 ROM3:6DC8 CD 0D 52 call 520D ROM3:6DCB FE 00 cp a,00 ROM3:6DCD 28 03 jr z,6DD2 ROM3:6DCF 04 inc b ROM3:6DD0 18 F1 jr 6DC3 ROM3:6DD2 78 ld a,b ROM3:6DD3 FE 06 cp a,06 ROM3:6DD5 28 0A jr z,6DE1 ROM3:6DD7 3E 08 ld a,08 ROM3:6DD9 CF rst 08 ROM3:6DDA 23 inc hl ROM3:6DDB 08 3E 4B ld (4B3E),sp ROM3:6DDE CF rst 08 ROM3:6DDF 0B dec bc ROM3:6DE0 06 CD ld b,CD ROM3:6DE2 7F ld a,a ROM3:6DE3 5F ld e,a ROM3:6DE4 CD 68 41 call 4168 ROM3:6DE7 D1 pop de ROM3:6DE8 C1 pop bc ROM3:6DE9 F1 pop af ROM3:6DEA C9 ret
Hamburger Recipe
ROM3:6DEB F5 push af ROM3:6DEC C5 push bc ROM3:6DED D5 push de ROM3:6DEE 01 00 09 ld bc,0900 ROM3:6DF1 CF rst 08 ROM3:6DF2 25 dec h ROM3:6DF3 08 50 59 ld (5950),sp ROM3:6DF6 0E 02 ld c,02 ROM3:6DF8 06 01 ld b,01 ROM3:6DFA 78 ld a,b ROM3:6DFB FE 06 cp a,06 ROM3:6DFD 30 0A jr nc,6E09 ROM3:6DFF CD 0D 52 call 520D ROM3:6E02 FE 00 cp a,00 ROM3:6E04 28 03 jr z,6E09 ROM3:6E06 04 inc b ROM3:6E07 18 F1 jr 6DFA ROM3:6E09 78 ld a,b ROM3:6E0A FE 06 cp a,06 ROM3:6E0C 28 0A jr z,6E18 ROM3:6E0E 3E 09 ld a,09 ROM3:6E10 CF rst 08 ROM3:6E11 23 inc hl ROM3:6E12 08 3E 4C ld (4C3E),sp ROM3:6E15 CF rst 08 ROM3:6E16 0B dec bc ROM3:6E17 06 CD ld b,CD ROM3:6E19 7F ld a,a ROM3:6E1A 5F ld e,a ROM3:6E1B CD 68 41 call 4168 ROM3:6E1E D1 pop de ROM3:6E1F C1 pop bc ROM3:6E20 F1 pop af ROM3:6E21 C9 ret
Revival of Sennen Genjin
ROM3:6E22 F5 push af ROM3:6E23 C5 push bc ROM3:6E24 D5 push de ROM3:6E25 01 00 0A ld bc,0A00 ROM3:6E28 CF rst 08 ROM3:6E29 25 dec h ROM3:6E2A 08 50 59 ld (5950),sp ROM3:6E2D 0E 02 ld c,02 ROM3:6E2F 06 01 ld b,01 ROM3:6E31 78 ld a,b ROM3:6E32 FE 06 cp a,06 ROM3:6E34 30 0A jr nc,6E40 ROM3:6E36 CD 0D 52 call 520D ROM3:6E39 FE 00 cp a,00 ROM3:6E3B 28 03 jr z,6E40 ROM3:6E3D 04 inc b ROM3:6E3E 18 F1 jr 6E31 ROM3:6E40 78 ld a,b ROM3:6E41 FE 06 cp a,06 ROM3:6E43 28 0A jr z,6E4F ROM3:6E45 3E 0A ld a,0A ROM3:6E47 CF rst 08 ROM3:6E48 23 inc hl ROM3:6E49 08 3E 4D ld (4D3E),sp ROM3:6E4C CF rst 08 ROM3:6E4D 0B dec bc ROM3:6E4E 06 CD ld b,CD ROM3:6E50 7F ld a,a ROM3:6E51 5F ld e,a ROM3:6E52 CD 68 41 call 4168 ROM3:6E55 D1 pop de ROM3:6E56 C1 pop bc ROM3:6E57 F1 pop af ROM3:6E58 C9 ret
Novox's Prayer
ROM3:6E59 F5 push af ROM3:6E5A C5 push bc ROM3:6E5B D5 push de ROM3:6E5C 01 00 0B ld bc,0B00 ROM3:6E5F CF rst 08 ROM3:6E60 25 dec h ROM3:6E61 08 50 59 ld (5950),sp ROM3:6E64 0E 02 ld c,02 ROM3:6E66 06 01 ld b,01 ROM3:6E68 78 ld a,b ROM3:6E69 FE 06 cp a,06 ROM3:6E6B 30 0A jr nc,6E77 ROM3:6E6D CD 0D 52 call 520D ROM3:6E70 FE 00 cp a,00 ROM3:6E72 28 03 jr z,6E77 ROM3:6E74 04 inc b ROM3:6E75 18 F1 jr 6E68 ROM3:6E77 78 ld a,b ROM3:6E78 FE 06 cp a,06 ROM3:6E7A 28 0A jr z,6E86 ROM3:6E7C 3E 0B ld a,0B ROM3:6E7E CF rst 08 ROM3:6E7F 23 inc hl ROM3:6E80 08 3E 4E ld (4E3E),sp ROM3:6E83 CF rst 08 ROM3:6E84 0B dec bc ROM3:6E85 06 CD ld b,CD ROM3:6E87 7F ld a,a ROM3:6E88 5F ld e,a ROM3:6E89 CD 68 41 call 4168 ROM3:6E8C D1 pop de ROM3:6E8D C1 pop bc ROM3:6E8E F1 pop af ROM3:6E8F C9 ret
Curse of Tri-Horned Dragon
ROM3:6E90 F5 push af ROM3:6E91 C5 push bc ROM3:6E92 D5 push de ROM3:6E93 01 00 0C ld bc,0C00 ROM3:6E96 CF rst 08 ROM3:6E97 25 dec h ROM3:6E98 08 50 59 ld (5950),sp ROM3:6E9B 0E 02 ld c,02 ROM3:6E9D 06 01 ld b,01 ROM3:6E9F 78 ld a,b ROM3:6EA0 FE 06 cp a,06 ROM3:6EA2 30 0A jr nc,6EAE ROM3:6EA4 CD 0D 52 call 520D ROM3:6EA7 FE 00 cp a,00 ROM3:6EA9 28 03 jr z,6EAE ROM3:6EAB 04 inc b ROM3:6EAC 18 F1 jr 6E9F ROM3:6EAE 78 ld a,b ROM3:6EAF FE 06 cp a,06 ROM3:6EB1 28 0A jr z,6EBD ROM3:6EB3 3E 0C ld a,0C ROM3:6EB5 CF rst 08 ROM3:6EB6 23 inc hl ROM3:6EB7 08 3E 4F ld (4F3E),sp ROM3:6EBA CF rst 08 ROM3:6EBB 0B dec bc ROM3:6EBC 06 CD ld b,CD ROM3:6EBE 7F ld a,a ROM3:6EBF 5F ld e,a ROM3:6EC0 CD 68 41 call 4168 ROM3:6EC3 D1 pop de ROM3:6EC4 C1 pop bc ROM3:6EC5 F1 pop af ROM3:6EC6 C9 ret
Revived Serpent Night Dragon
ROM3:6EC7 F5 push af ROM3:6EC8 C5 push bc ROM3:6EC9 D5 push de ROM3:6ECA 01 00 0D ld bc,0D00 ;That's Darkfire Dragon, not Blackland Fire Dragon ROM3:6ECD CF rst 08 ROM3:6ECE 25 08 => 8:4025 ;Points to 8:4901, Read Ritual Monster Material ROM3:6ECF 50 ld d,b ROM3:6ED0 59 ld e,c ROM3:6ED1 0E 02 ld c,02 ROM3:6ED4 06 01 ld b,01 ROM3:6ED6 78 ld a,b ROM3:6ED7 FE 06 cp a,06 ROM3:6ED9 30 0A jr nc,6EE5 ROM3:6EDB CD 0D 52 call 520D ROM3:6EDE FE 00 cp a,00 ROM3:6EE0 28 03 jr z,6EE5 ROM3:6EE2 04 inc b ROM3:6EE3 18 F1 jr 6ED6 ROM3:6EE5 78 ld a,b ROM3:6EE6 FE 06 cp a,06 ROM3:6EE8 28 0A jr z,6EF4 ROM3:6EEA 3E 0D ld a,0D ROM3:6EEC CF rst 08 ROM3:6EED 23 inc hl ROM3:6EEE 08 3E 5A ld (5A3E),sp ROM3:6EF1 CF rst 08 ROM3:6EF2 0B dec bc ROM3:6EF3 06 CD ld b,CD ROM3:6EF5 7F ld a,a ROM3:6EF6 5F ld e,a ROM3:6EF7 CD 68 41 call 4168 ROM3:6EFA D1 pop de ROM3:6EFB C1 pop bc ROM3:6EFC F1 pop af ROM3:6EFD C9 ret
Harpie's Feather Duster
ROM3:6EFE F5 push af ROM3:6EFF CF rst 08 ROM3:6F00 17 0A => Pointer 0A:4017 ROM3:6F02 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:6F05 CD 68 41 call 4168 ROM3:6F08 3E 47 ld a,47 ROM3:6F0A CF rst 08 ;Loads Sound Effect and Text 0x47 ROM3:6F0B 0B 06 => Pointer 06:400B ROM3:6F0C F1 pop af ROM3:6F0E C9 ret
Equip Spells 2
Magical Labyrinth
ROM3:6F0F F5 push af ROM3:6F10 C5 push bc ROM3:6F11 D5 push de ROM3:6F12 FA 8B C8 ld a,(C88B) ROM3:6F15 4F ld c,a ROM3:6F16 FA 8C C8 ld a,(C88C) ROM3:6F19 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6F1A 16 1A ld d,1A ROM3:6F1C CF rst 08 ROM3:6F1D 0D 07 => Pointer 07:400D ROM3:6F1F FE 01 cp a,01 ROM3:6F21 20 26 jr nz,6F49 ROM3:6F23 CF rst 08 ROM3:6F24 0D 0A => Pointer 0A:400D ROM3:6F26 FE 00 cp a,00 ROM3:6F28 20 16 jr nz,6F40 ROM3:6F2A FA 00 C7 ld a,(C700) ;Column to check ROM3:6F2D 47 ld b,a ROM3:6F2E FA 01 C7 ld a,(C701) ;Row to check ROM3:6F31 4F ld c,a ROM3:6F32 CD C7 50 call 50C7 ROM3:6F35 CD 93 5F call 5F93 ;Removes selected card ROM3:6F38 01 8C 02 ld bc,028C ROM3:6F3B CD 5D 61 call 615D ROM3:6F3E 18 09 jr 6F49 ROM3:6F40 CF rst 08 ROM3:6F41 0F 0A => Pointer 0A:400F ROM3:6F43 CD 93 5F call 5F93 ;Removes selected card ROM3:6F46 CF rst 08 ROM3:6F47 07 06 => Pointer 06:4007 ROM3:6F49 D1 pop de ROM3:6F4A C1 pop bc ROM3:6F4B F1 pop af ROM3:6F4C C9 ret
Salamandra
ROM3:6F4D F5 push af ROM3:6F4E C5 push bc ROM3:6F4F D5 push de ROM3:6F50 FA 8B C8 ld a,(C88B) ROM3:6F53 4F ld c,a ROM3:6F54 FA 8C C8 ld a,(C88C) ROM3:6F57 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6F58 16 1B ld d,1B ROM3:6F5A CF rst 08 ROM3:6F5B 0D 07 => Pointer 07:400D ROM3:6F5D FE 01 cp a,01 ROM3:6F5F 20 26 jr nz,6F87 ROM3:6F61 CF rst 08 ROM3:6F62 0D 0A => Pointer 0A:400D ROM3:6F64 FE 00 cp a,00 ROM3:6F66 20 16 jr nz,6F7E ROM3:6F68 FA 00 C7 ld a,(C700) ;Column to check ROM3:6F6B 47 ld b,a ROM3:6F6C FA 01 C7 ld a,(C701) ;Row to check ROM3:6F6F 4F ld c,a ROM3:6F70 CD C7 50 call 50C7 ROM3:6F73 CD 93 5F call 5F93 ;Removes selected card ROM3:6F76 01 8E 02 ld bc,028E ROM3:6F79 CD 5D 61 call 615D ROM3:6F7C 18 09 jr 6F87 ROM3:6F7E CF rst 08 ROM3:6F7F 0F 0A => Pointer 0A:400F ROM3:6F81 CD 93 5F call 5F93 ;Removes selected card ROM3:6F84 CF rst 08 ROM3:6F85 07 06 => Pointer 06:4007 ROM3:6F86 D1 pop de ROM3:6F88 C1 pop bc ROM3:6F89 F1 pop af ROM3:6F8A C9 ret
Kunai with Chain
ROM3:6F8B F5 push af ROM3:6F8C C5 push bc ROM3:6F8D D5 push de ROM3:6F8E FA 8B C8 ld a,(C88B) ROM3:6F91 4F ld c,a ROM3:6F92 FA 8C C8 ld a,(C88C) ROM3:6F95 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6F96 16 1C ld d,1C ROM3:6F98 CF rst 08 ROM3:6F99 0D dec c ROM3:6F9A 07 rlca ROM3:6F9B FE 01 cp a,01 ROM3:6F9D 20 26 jr nz,6FC5 ROM3:6F9F CF rst 08 ROM3:6FA0 0D dec c ROM3:6FA1 0A ld a,(bc) ROM3:6FA2 FE 00 cp a,00 ROM3:6FA4 20 16 jr nz,6FBC ROM3:6FA6 FA 00 C7 ld a,(C700) ;Column to check ROM3:6FA9 47 ld b,a ROM3:6FAA FA 01 C7 ld a,(C701) ;Row to check ROM3:6FAD 4F ld c,a ROM3:6FAE CD C7 50 call 50C7 ROM3:6FB1 CD 93 5F call 5F93 ;Removes selected card ROM3:6FB4 01 8B 02 ld bc,028B ROM3:6FB7 CD 5D 61 call 615D ROM3:6FBA 18 09 jr 6FC5 ROM3:6FBC CF rst 08 ROM3:6FBD 0F rrca ROM3:6FBE 0A ld a,(bc) ROM3:6FBF CD 93 5F call 5F93 ;Removes selected card ROM3:6FC2 CF rst 08 ROM3:6FC3 07 rlca ROM3:6FC4 06 D1 ld b,D1 ROM3:6FC6 C1 pop bc ROM3:6FC7 F1 pop af ROM3:6FC8 C9 ret
Bright Castle
ROM3:6FC9 F5 push af ROM3:6FCA C5 push bc ROM3:6FCB D5 push de ROM3:6FCC FA 8B C8 ld a,(C88B) ROM3:6FCF 4F ld c,a ROM3:6FD0 FA 8C C8 ld a,(C88C) ROM3:6FD3 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:6FD4 16 1D ld d,1D ROM3:6FD6 CF rst 08 ROM3:6FD7 0D dec c ROM3:6FD8 07 rlca ROM3:6FD9 FE 01 cp a,01 ROM3:6FDB 20 26 jr nz,7003 ROM3:6FDD CF rst 08 ROM3:6FDE 0D dec c ROM3:6FDF 0A ld a,(bc) ROM3:6FE0 FE 00 cp a,00 ROM3:6FE2 20 16 jr nz,6FFA ROM3:6FE4 FA 00 C7 ld a,(C700) ;Column to check ROM3:6FE7 47 ld b,a ROM3:6FE8 FA 01 C7 ld a,(C701) ;Row to check ROM3:6FEB 4F ld c,a ROM3:6FEC CD C7 50 call 50C7 ROM3:6FEF CD 93 5F call 5F93 ;Removes selected card ROM3:6FF2 01 9C 02 ld bc,029C ROM3:6FF5 CD 5D 61 call 615D ROM3:6FF8 18 09 jr 7003 ROM3:6FFA CF rst 08 ROM3:6FFB 0F rrca ROM3:6FFC 0A ld a,(bc) ROM3:6FFD CD 93 5F call 5F93 ;Removes selected card ROM3:7000 CF rst 08 ROM3:7001 07 rlca ROM3:7002 06 D1 ld b,D1 ROM3:7004 C1 pop bc ROM3:7005 F1 pop af ROM3:7006 C9 ret
Crush Card
0xF007-0xF041
- Crush Card effect
ROM3:7007 F5 push af ROM3:7008 C5 push bc ROM3:7009 0E 01 ld c,01 ROM3:700B 06 00 ld b,00 ROM3:700D 78 ld a,b ROM3:700E FE 05 cp a,05 ROM3:7010 30 24 jr nc,7036 ROM3:7012 CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:7015 FE 00 cp a,00 ROM3:7017 20 1A jr nz,7033 ROM3:7019 CF rst 08 ROM3:701A 0B dec bc ROM3:701B 07 rlca ROM3:701C C5 push bc ROM3:701D FA B7 C6 ld a,(C6B7) ROM3:7020 4F ld c,a ROM3:7021 FA B8 C6 ld a,(C6B8) ROM3:7024 47 ld b,a ROM3:7025 11 00 15 ld de,1500 ;1500 ATK ROM3:7028 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM3:702B C1 pop bc ROM3:702C FE 02 cp a,02 ROM3:702E 28 03 jr z,7033 ;If the Monster has less than 1500 ATK, jump to 3:7033 ROM3:7030 CD 86 20 call 2086 ;Remove selected card from the field ROM3:7033 04 inc b ;Next monster ROM3:7034 18 D7 jr 700D ROM3:7036 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:7039 CD F1 2A call 2AF1 ROM3:703C CD 68 41 call 4168 ROM3:703F 3E 3C ld a,3C ROM3:7041 CF rst 08 ;Loads Sound Effect and Text 0x3C ROM3:7042 0B dec bc ROM3:7043 06 C1 ld b,C1 ROM3:7045 F1 pop af ROM3:7046 C9 ret
Shadow Spell
0xF047-0xF06D
- Shadow Spell effect
ROM3:7047 F5 push af ROM3:7048 C5 push bc ROM3:7049 0E 01 ld c,01 ;Row 1 ROM3:704B 06 00 ld b,00 ;Column 0 ROM3:704D 78 ld a,b ROM3:704E FE 05 cp a,05 ROM3:7050 30 13 jr nc,7065 ;If the effect has been applied to every CPU's Monsters, jump to 3:7065 ROM3:7052 CD CB 4E call 4ECB ;Check if there's a Monster Card in this column ROM3:7055 FE 00 cp a,00 ROM3:7057 20 09 jr nz,7062 ;If there's no Monster Card, loop to next column ROM3:7059 CD 92 1F call 1F92 ;Decrease Card Level ROM3:705C CD 92 1F call 1F92 ;Decrease Card Level ROM3:705F CD FB 19 call 19FB ;Updates Card status ROM3:7062 04 inc b ;Next column ROM3:7063 18 E8 jr 704D ;Loop ROM3:7065 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:7068 CD 68 41 call 4168 ROM3:706B 3E 44 ld a,44 ROM3:706D CF rst 08 ;Loads Sound Effect and Text 0x44 ROM3:706E 0B dec bc ROM3:706F 06 C1 ld b,C1 ROM3:7071 F1 pop af ROM3:7072 C9 ret
Rituals 2
Turtle Oath
ROM3:7073 F5 push af ROM3:7074 C5 push bc ROM3:7075 D5 push de ROM3:7076 01 00 0E ld bc,0E00 ROM3:7079 CF rst 08 ROM3:707A 25 dec h ROM3:707B 08 50 59 ld (5950),sp ROM3:707E 0E 02 ld c,02 ROM3:7080 06 01 ld b,01 ROM3:7082 78 ld a,b ROM3:7083 FE 06 cp a,06 ROM3:7085 30 0A jr nc,7091 ROM3:7087 CD 0D 52 call 520D ROM3:708A FE 00 cp a,00 ROM3:708C 28 03 jr z,7091 ROM3:708E 04 inc b ROM3:708F 18 F1 jr 7082 ROM3:7091 78 ld a,b ROM3:7092 FE 06 cp a,06 ROM3:7094 28 0A jr z,70A0 ROM3:7096 3E 0E ld a,0E ROM3:7098 CF rst 08 ROM3:7099 23 inc hl ROM3:709A 08 3E 5B ld (5B3E),sp ROM3:709D CF rst 08 ROM3:709E 0B dec bc ROM3:709F 06 CD ld b,CD ROM3:70A1 7F ld a,a ROM3:70A2 5F ld e,a ROM3:70A3 CD 68 41 call 4168 ROM3:70A6 D1 pop de ROM3:70A7 C1 pop bc ROM3:70A8 F1 pop af ROM3:70A9 C9 ret
Contract of Mask
ROM3:70AA F5 push af ROM3:70AB C5 push bc ROM3:70AC D5 push de ROM3:70AD 01 00 0F ld bc,0F00 ROM3:70B0 CF rst 08 ROM3:70B1 25 dec h ROM3:70B2 08 50 59 ld (5950),sp ROM3:70B5 0E 02 ld c,02 ROM3:70B7 06 01 ld b,01 ROM3:70B9 78 ld a,b ROM3:70BA FE 06 cp a,06 ROM3:70BC 30 0A jr nc,70C8 ROM3:70BE CD 0D 52 call 520D ROM3:70C1 FE 00 cp a,00 ROM3:70C3 28 03 jr z,70C8 ROM3:70C5 04 inc b ROM3:70C6 18 F1 jr 70B9 ROM3:70C8 78 ld a,b ROM3:70C9 FE 06 cp a,06 ROM3:70CB 28 0A jr z,70D7 ROM3:70CD 3E 0F ld a,0F ROM3:70CF CF rst 08 ROM3:70D0 23 inc hl ROM3:70D1 08 3E 5C ld (5C3E),sp ROM3:70D4 CF rst 08 ROM3:70D5 0B dec bc ROM3:70D6 06 CD ld b,CD ROM3:70D8 7F ld a,a ROM3:70D9 5F ld e,a ROM3:70DA CD 68 41 call 4168 ROM3:70DD D1 pop de ROM3:70DE C1 pop bc ROM3:70DF F1 pop af ROM3:70E0 C9 ret
Resurrection of Chakra
ROM3:70E1 F5 push af ROM3:70E2 C5 push bc ROM3:70E3 D5 push de ROM3:70E4 01 00 10 ld bc,1000 ROM3:70E7 CF rst 08 ROM3:70E8 25 dec h ROM3:70E9 08 50 59 ld (5950),sp ROM3:70EC 0E 02 ld c,02 ROM3:70EE 06 01 ld b,01 ROM3:70F0 78 ld a,b ROM3:70F1 FE 06 cp a,06 ROM3:70F3 30 0A jr nc,70FF ROM3:70F5 CD 0D 52 call 520D ROM3:70F8 FE 00 cp a,00 ROM3:70FA 28 03 jr z,70FF ROM3:70FC 04 inc b ROM3:70FD 18 F1 jr 70F0 ROM3:70FF 78 ld a,b ROM3:7100 FE 06 cp a,06 ROM3:7102 28 0A jr z,710E ROM3:7104 3E 10 ld a,10 ROM3:7106 CF rst 08 ROM3:7107 23 inc hl ROM3:7108 08 3E 5D ld (5D3E),sp ROM3:710B CF rst 08 ROM3:710C 0B dec bc ROM3:710D 06 CD ld b,CD ROM3:710F 7F ld a,a ROM3:7110 5F ld e,a ROM3:7111 CD 68 41 call 4168 ROM3:7114 D1 pop de ROM3:7115 C1 pop bc ROM3:7116 F1 pop af ROM3:7117 C9 ret
Puppet Ritual
ROM3:7118 F5 push af ROM3:7119 C5 push bc ROM3:711A D5 push de ROM3:711B 01 00 11 ld bc,1100 ROM3:711E CF rst 08 ROM3:711F 25 dec h ROM3:7120 08 50 59 ld (5950),sp ROM3:7123 0E 02 ld c,02 ROM3:7125 06 01 ld b,01 ROM3:7127 78 ld a,b ROM3:7128 FE 06 cp a,06 ROM3:712A 30 0A jr nc,7136 ROM3:712C CD 0D 52 call 520D ROM3:712F FE 00 cp a,00 ROM3:7131 28 03 jr z,7136 ROM3:7133 04 inc b ROM3:7134 18 F1 jr 7127 ROM3:7136 78 ld a,b ROM3:7137 FE 06 cp a,06 ROM3:7139 28 0A jr z,7145 ROM3:713B 3E 11 ld a,11 ROM3:713D CF rst 08 ROM3:713E 23 inc hl ROM3:713F 08 3E 5E ld (5E3E),sp ROM3:7142 CF rst 08 ROM3:7143 0B dec bc ROM3:7144 06 CD ld b,CD ROM3:7146 7F ld a,a ROM3:7147 5F ld e,a ROM3:7148 CD 68 41 call 4168 ROM3:714B D1 pop de ROM3:714C C1 pop bc ROM3:714D F1 pop af ROM3:714E C9 ret
Javelin Beetle Pact
ROM3:714F F5 push af ROM3:7150 C5 push bc ROM3:7151 D5 push de ROM3:7152 01 00 12 ld bc,1200 ROM3:7155 CF rst 08 ROM3:7156 25 dec h ROM3:7157 08 50 59 ld (5950),sp ROM3:715A 0E 02 ld c,02 ROM3:715C 06 01 ld b,01 ROM3:715E 78 ld a,b ROM3:715F FE 06 cp a,06 ROM3:7161 30 0A jr nc,716D ROM3:7163 CD 0D 52 call 520D ROM3:7166 FE 00 cp a,00 ROM3:7168 28 03 jr z,716D ROM3:716A 04 inc b ROM3:716B 18 F1 jr 715E ROM3:716D 78 ld a,b ROM3:716E FE 06 cp a,06 ROM3:7170 28 0A jr z,717C ROM3:7172 3E 12 ld a,12 ROM3:7174 CF rst 08 ROM3:7175 23 inc hl ROM3:7176 08 3E 5F ld (5F3E),sp ROM3:7179 CF rst 08 ROM3:717A 0B dec bc ROM3:717B 06 CD ld b,CD ROM3:717D 7F ld a,a ROM3:717E 5F ld e,a ROM3:717F CD 68 41 call 4168 ROM3:7182 D1 pop de ROM3:7183 C1 pop bc ROM3:7184 F1 pop af ROM3:7185 C9 ret
Garma Sword Oath
ROM3:7186 F5 push af ROM3:7187 C5 push bc ROM3:7188 D5 push de ROM3:7189 01 00 13 ld bc,1300 ROM3:718C CF rst 08 ROM3:718D 25 dec h ROM3:718E 08 50 59 ld (5950),sp ROM3:7191 0E 02 ld c,02 ROM3:7193 06 01 ld b,01 ROM3:7195 78 ld a,b ROM3:7196 FE 06 cp a,06 ROM3:7198 30 0A jr nc,71A4 ROM3:719A CD 0D 52 call 520D ROM3:719D FE 00 cp a,00 ROM3:719F 28 03 jr z,71A4 ROM3:71A1 04 inc b ROM3:71A2 18 F1 jr 7195 ROM3:71A4 78 ld a,b ROM3:71A5 FE 06 cp a,06 ROM3:71A7 28 0A jr z,71B3 ROM3:71A9 3E 13 ld a,13 ROM3:71AB CF rst 08 ROM3:71AC 23 inc hl ROM3:71AD 08 3E 60 ld (603E),sp ROM3:71B0 CF rst 08 ROM3:71B1 0B dec bc ROM3:71B2 06 CD ld b,CD ROM3:71B4 7F ld a,a ROM3:71B5 5F ld e,a ROM3:71B6 CD 68 41 call 4168 ROM3:71B9 D1 pop de ROM3:71BA C1 pop bc ROM3:71BB F1 pop af ROM3:71BC C9 ret
Cosmo Queen's Prayer
ROM3:71BD F5 push af ROM3:71BE C5 push bc ROM3:71BF D5 push de ROM3:71C0 01 00 14 ld bc,1400 ROM3:71C3 CF rst 08 ROM3:71C4 25 dec h ROM3:71C5 08 50 59 ld (5950),sp ROM3:71C8 0E 02 ld c,02 ROM3:71CA 06 01 ld b,01 ROM3:71CC 78 ld a,b ROM3:71CD FE 06 cp a,06 ROM3:71CF 30 0A jr nc,71DB ROM3:71D1 CD 0D 52 call 520D ROM3:71D4 FE 00 cp a,00 ROM3:71D6 28 03 jr z,71DB ROM3:71D8 04 inc b ROM3:71D9 18 F1 jr 71CC ROM3:71DB 78 ld a,b ROM3:71DC FE 06 cp a,06 ROM3:71DE 28 0A jr z,71EA ROM3:71E0 3E 14 ld a,14 ROM3:71E2 CF rst 08 ROM3:71E3 23 inc hl ROM3:71E4 08 3E 61 ld (613E),sp ROM3:71E7 CF rst 08 ROM3:71E8 0B dec bc ROM3:71E9 06 CD ld b,CD ROM3:71EB 7F ld a,a ROM3:71EC 5F ld e,a ROM3:71ED CD 68 41 call 4168 ROM3:71F0 D1 pop de ROM3:71F1 C1 pop bc ROM3:71F2 F1 pop af ROM3:71F3 C9 ret
Revival of Skeleton
ROM3:71F4 F5 push af ROM3:71F5 C5 push bc ROM3:71F6 D5 push de ROM3:71F7 01 00 15 ld bc,1500 ROM3:71FA CF rst 08 ROM3:71FB 25 dec h ROM3:71FC 08 50 59 ld (5950),sp ROM3:71FF 0E 02 ld c,02 ROM3:7201 06 01 ld b,01 ROM3:7203 78 ld a,b ROM3:7204 FE 06 cp a,06 ROM3:7206 30 0A jr nc,7212 ROM3:7208 CD 0D 52 call 520D ROM3:720B FE 00 cp a,00 ROM3:720D 28 03 jr z,7212 ROM3:720F 04 inc b ROM3:7210 18 F1 jr 7203 ROM3:7212 78 ld a,b ROM3:7213 FE 06 cp a,06 ROM3:7215 28 0A jr z,7221 ROM3:7217 3E 15 ld a,15 ROM3:7219 CF rst 08 ROM3:721A 23 inc hl ROM3:721B 08 3E 62 ld (623E),sp ROM3:721E CF rst 08 ROM3:721F 0B dec bc ROM3:7220 06 CD ld b,CD ROM3:7222 7F ld a,a ROM3:7223 5F ld e,a ROM3:7224 CD 68 41 call 4168 ROM3:7227 D1 pop de ROM3:7228 C1 pop bc ROM3:7229 F1 pop af ROM3:722A C9 ret
Fortress Whale's Oath
ROM3:722B F5 push af ROM3:722C C5 push bc ROM3:722D D5 push de ROM3:722E 01 00 16 ld bc,1600 ROM3:7231 CF rst 08 ROM3:7232 25 dec h ROM3:7233 08 50 59 ld (5950),sp ROM3:7236 0E 02 ld c,02 ROM3:7238 06 01 ld b,01 ROM3:723A 78 ld a,b ROM3:723B FE 06 cp a,06 ROM3:723D 30 0A jr nc,7249 ROM3:723F CD 0D 52 call 520D ROM3:7242 FE 00 cp a,00 ROM3:7244 28 03 jr z,7249 ROM3:7246 04 inc b ROM3:7247 18 F1 jr 723A ROM3:7249 78 ld a,b ROM3:724A FE 06 cp a,06 ROM3:724C 28 0A jr z,7258 ROM3:724E 3E 16 ld a,16 ROM3:7250 CF rst 08 ROM3:7251 23 inc hl ROM3:7252 08 3E 63 ld (633E),sp ROM3:7255 CF rst 08 ROM3:7256 0B dec bc ROM3:7257 06 CD ld b,CD ROM3:7259 7F ld a,a ROM3:725A 5F ld e,a ROM3:725B CD 68 41 call 4168 ROM3:725E D1 pop de ROM3:725F C1 pop bc ROM3:7260 F1 pop af ROM3:7261 C9 ret
Curse of Millennium Shield
ROM3:7262 F5 push af ROM3:7263 C5 push bc ROM3:7264 D5 push de ROM3:7265 01 00 05 ld bc,0500 ROM3:7268 CF rst 08 ROM3:7269 25 dec h ROM3:726A 08 50 59 ld (5950),sp ROM3:726D 0E 02 ld c,02 ROM3:726F 06 01 ld b,01 ROM3:7271 78 ld a,b ROM3:7272 FE 06 cp a,06 ROM3:7274 30 0A jr nc,7280 ROM3:7276 CD 0D 52 call 520D ROM3:7279 FE 00 cp a,00 ROM3:727B 28 03 jr z,7280 ROM3:727D 04 inc b ROM3:727E 18 F1 jr 7271 ROM3:7280 78 ld a,b ROM3:7281 FE 06 cp a,06 ROM3:7283 28 0A jr z,728F ROM3:7285 3E 05 ld a,05 ROM3:7287 CF rst 08 ROM3:7288 23 inc hl ROM3:7289 08 3E 40 ld (403E),sp ROM3:728C CF rst 08 ROM3:728D 0B dec bc ROM3:728E 06 CD ld b,CD ROM3:7290 7F ld a,a ROM3:7291 5F ld e,a ROM3:7292 CD 68 41 call 4168 ROM3:7295 D1 pop de ROM3:7296 C1 pop bc ROM3:7297 F1 pop af ROM3:7298 C9 ret
Yamadron Ritual
ROM3:7299 F5 push af ROM3:729A C5 push bc ROM3:729B D5 push de ROM3:729C 01 00 06 ld bc,0600 ROM3:729F CF rst 08 ROM3:72A0 25 dec h ROM3:72A1 08 50 59 ld (5950),sp ROM3:72A4 0E 02 ld c,02 ROM3:72A6 06 01 ld b,01 ROM3:72A8 78 ld a,b ROM3:72A9 FE 06 cp a,06 ROM3:72AB 30 0A jr nc,72B7 ROM3:72AD CD 0D 52 call 520D ROM3:72B0 FE 00 cp a,00 ROM3:72B2 28 03 jr z,72B7 ROM3:72B4 04 inc b ROM3:72B5 18 F1 jr 72A8 ROM3:72B7 78 ld a,b ROM3:72B8 FE 06 cp a,06 ROM3:72BA 28 0A jr z,72C6 ROM3:72BC 3E 06 ld a,06 ROM3:72BE CF rst 08 ROM3:72BF 23 inc hl ROM3:72C0 08 3E 41 ld (413E),sp ROM3:72C3 CF rst 08 ROM3:72C4 0B dec bc ROM3:72C5 06 CD ld b,CD ROM3:72C7 7F ld a,a ROM3:72C8 5F ld e,a ROM3:72C9 CD 68 41 call 4168 ROM3:72CC D1 pop de ROM3:72CD C1 pop bc ROM3:72CE F1 pop af ROM3:72CF C9 ret
Gate Guardian Ritual
ROM3:72D0 F5 push af ROM3:72D1 C5 push bc ROM3:72D2 3E 07 ld a,07 ROM3:72D4 CF rst 08 ROM3:72D5 27 daa ROM3:72D6 08 FE 01 ld (01FE),sp ROM3:72D9 20 0D jr nz,72E8 ROM3:72DB CD D1 2A call 2AD1 ROM3:72DE 3E 07 ld a,07 ROM3:72E0 CF rst 08 ROM3:72E1 21 08 3E ld hl,3E08 ROM3:72E4 42 ld b,d ROM3:72E5 CF rst 08 ROM3:72E6 0B dec bc ROM3:72E7 06 CD ld b,CD ROM3:72E9 7F ld a,a ROM3:72EA 5F ld e,a ROM3:72EB CD 68 41 call 4168 ROM3:72EE C1 pop bc ROM3:72EF F1 pop af ROM3:72F0 C9 ret
Warrior Elimination
ROM3:72F1 F5 push af ROM3:72F2 C5 push bc ROM3:72F3 D5 push de ROM3:72F4 1E 01 ld e,01 ROM3:72F6 0E 01 ld c,01 ROM3:72F8 06 00 ld b,00 ROM3:72FA 78 ld a,b ROM3:72FB FE 05 cp a,05 ROM3:72FD 30 11 jr nc,7310 ROM3:72FF 3E 03 ld a,03 ROM3:7301 CD 36 51 call 5136 ROM3:7304 FE 00 cp a,00 ROM3:7306 20 05 jr nz,730D ROM3:7308 CD 86 20 call 2086 ;Remove selected card from the field ROM3:730B 1E 00 ld e,00 ROM3:730D 04 inc b ROM3:730E 18 EA jr 72FA ROM3:7310 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:7313 CD F1 2A call 2AF1 ROM3:7316 CD 68 41 call 4168 ROM3:7319 3E 34 ld a,34 ROM3:731B CF rst 08 ;Loads Sound Effect and Text 0x34 ROM3:731C 0B dec bc ROM3:731D 06 D1 ld b,D1 ROM3:731F C1 pop bc ROM3:7320 F1 pop af ROM3:7321 C9 ret
Cursebreaker
ROM3:7322 F5 push af ROM3:7323 C5 push bc ROM3:7324 0E 02 ld c,02 ROM3:7326 06 01 ld b,01 ROM3:7328 78 ld a,b ROM3:7329 FE 06 cp a,06 ROM3:732B 30 16 jr nc,7343 ROM3:732D CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:7330 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:7333 CD 7C 51 call 517C ROM3:7336 FE 00 cp a,00 ROM3:7338 20 06 jr nz,7340 ROM3:733A CD B4 1F call 1FB4 ;Reset Card Level ROM3:733D CD FB 19 call 19FB ;Update selected card ID and status ROM3:7340 04 inc b ROM3:7341 18 E5 jr 7328 ROM3:7343 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:7346 CD 68 41 call 4168 ROM3:7349 3E 36 ld a,36 ROM3:734B CF rst 08 ;Loads Sound Effect and Text 0x36 ROM3:734C 0B dec bc ROM3:734D 06 C1 ld b,C1 ROM3:734F F1 pop af ROM3:7350 C9 ret
Eternal Rest
ROM3:7351 F5 push af ROM3:7352 C5 push bc ROM3:7353 D5 push de ROM3:7354 1E 01 ld e,01 ROM3:7356 0E 01 ld c,01 ROM3:7358 06 00 ld b,00 ROM3:735A 78 ld a,b ROM3:735B FE 05 cp a,05 ROM3:735D 30 11 jr nc,7370 ROM3:735F 3E 02 ld a,02 ROM3:7361 CD 36 51 call 5136 ROM3:7364 FE 00 cp a,00 ROM3:7366 20 05 jr nz,736D ROM3:7368 CD 86 20 call 2086 ;Remove selected card from the field ROM3:736B 1E 00 ld e,00 ROM3:736D 04 inc b ROM3:736E 18 EA jr 735A ROM3:7370 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:7373 CD 68 41 call 4168 ROM3:7376 3E 37 ld a,37 ROM3:7378 CF rst 08 ;Loads Sound Effect and Text 0x37 ROM3:7379 0B dec bc ROM3:737A 06 D1 ld b,D1 ROM3:737C C1 pop bc ROM3:737D F1 pop af ROM3:737E C9 ret
Equip Spells 3
Megamorph
ROM3:737F F5 push af ROM3:7380 C5 push bc ROM3:7381 D5 push de ROM3:7382 FA 8B C8 ld a,(C88B) ROM3:7385 4F ld c,a ROM3:7386 FA 8C C8 ld a,(C88C) ROM3:7389 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:738A 16 1E ld d,1E ROM3:738C CF rst 08 ROM3:738D 0D 07 => Pointer 07:400D ROM3:738F FE 01 cp a,01 ROM3:7391 20 26 jr nz,73B9 ROM3:7393 CF rst 08 ROM3:7394 0D 0A => Pointer 0A:400D ROM3:7396 FE 00 cp a,00 ROM3:7398 20 16 jr nz,73B0 ROM3:739A FA 00 C7 ld a,(C700) ;Column to check ROM3:739D 47 ld b,a ROM3:739E FA 01 C7 ld a,(C701) ;Row to check ROM3:73A1 4F ld c,a ROM3:73A2 CD C7 50 call 50C7 ROM3:73A5 CD 93 5F call 5F93 ;Removes selected card ROM3:73A8 01 91 02 ld bc,0291 ROM3:73AB CD 5D 61 call 615D ROM3:73AE 18 09 jr 73B9 ROM3:73B0 CF rst 08 ROM3:73B1 0F 0A => Pointer 0A:400F ROM3:73B3 CD 93 5F call 5F93 ;Removes selected card ROM3:73B6 CF rst 08 ROM3:73B7 07 06 => Pointer 06:4007 ROM3:73B9 D1 pop de ROM3:73BA C1 pop bc ROM3:73BB F1 pop af ROM3:73BC C9 ret
Metalmorph
ROM3:73BD F5 push af ROM3:73BE C5 push bc ROM3:73BF D5 push de ROM3:73C0 CD 93 5F call 5F93 ;Removes selected card ROM3:73C3 FA 8B C8 ld a,(C88B) ROM3:73C6 4F ld c,a ROM3:73C7 FA 8C C8 ld a,(C88C) ROM3:73CA 47 ld b,a ROM3:73CB 11 87 01 ld de,0187 ;Zoa ROM3:73CE CD 14 1B call 1B14 ROM3:73D1 FE 00 cp a,00 ROM3:73D3 20 37 jr nz,740C ROM3:73D5 CD D9 2A call 2AD9 ;Does nothing, there is no Sound Effect with the ID 0x20 ROM3:73D8 FA 00 C7 ld a,(C700) ROM3:73DB 47 ld b,a ROM3:73DC FA 01 C7 ld a,(C701) ROM3:73DF 4F ld c,a ROM3:73E0 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:73E3 CD E6 19 call 19E6 ;Remove selected card from the field ROM3:73E6 01 88 01 ld bc,0188 ;Metalzoa ROM3:73E9 C5 push bc ROM3:73EA CF rst 08 ROM3:73EB 9B sbc e ROM3:73EC 01 CF 0B ld bc,0BCF ROM3:73EF 01 CF 17 ld bc,17CF ROM3:73F2 01 C1 79 ld bc,79C1 ROM3:73F5 EA A3 C7 ld (C7A3),a ROM3:73F8 78 ld a,b ROM3:73F9 EA A4 C7 ld (C7A4),a ROM3:73FC CD 25 20 call 2025 ;Hide Card, reset Level ROM3:73FF CD C9 1F call 1FC9 ;Reveal Card ROM3:7402 CD FB 19 call 19FB ;Update selected card ID and status ROM3:7405 3E 39 ld a,39 ROM3:7407 CF rst 08 ;Loads Sound Effect and Text 0x39 ROM3:7408 0B dec bc ROM3:7409 06 18 ld b,18 ROM3:740B 41 ld b,c ROM3:740C 11 52 00 ld de,0052 ;Red-Eyes Black Dragon ROM3:740F CD 14 1B call 1B14 ROM3:7412 FE 00 cp a,00 ROM3:7414 20 37 jr nz,744D ROM3:7416 CD D9 2A call 2AD9 ;Does nothing, there is no Sound Effect with the ID 0x20 ROM3:7419 FA 00 C7 ld a,(C700) ROM3:741C 47 ld b,a ROM3:741D FA 01 C7 ld a,(C701) ROM3:7420 4F ld c,a ROM3:7421 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:7424 CD E6 19 call 19E6 ;Remove selected card from the field ROM3:7427 01 E6 02 ld bc,02E6 ;Red-Eyes Black Metal Dragon ROM3:742A C5 push bc ROM3:742B CF rst 08 ROM3:742C 9B sbc e ROM3:742D 01 CF 0B ld bc,0BCF ROM3:7430 01 CF 17 ld bc,17CF ROM3:7433 01 C1 79 ld bc,79C1 ROM3:7436 EA A3 C7 ld (C7A3),a ROM3:7439 78 ld a,b ROM3:743A EA A4 C7 ld (C7A4),a ROM3:743D CD 25 20 call 2025 ;Hide Card, reset Level ROM3:7440 CD C9 1F call 1FC9 ;Reveal Card ROM3:7443 CD FB 19 call 19FB ;Update selected card ID and status ROM3:7446 3E 39 ld a,39 ROM3:7448 CF rst 08 ;Loads Sound Effect and Text 0x39 ROM3:7449 0B dec bc ROM3:744A 06 18 ld b,18 ROM3:744C 00 nop ROM3:744D D1 pop de ROM3:744E C1 pop bc ROM3:744F F1 pop af ROM3:7450 C9 ret
Winged Trumpeter
ROM3:7451 F5 push af ROM3:7452 C5 push bc ROM3:7453 D5 push de ROM3:7454 FA 8B C8 ld a,(C88B) ROM3:7457 4F ld c,a ROM3:7458 FA 8C C8 ld a,(C88C) ROM3:745B 47 ld b,a ;bc = Monster Card targeted by Equip Card ROM3:745C 16 1F ld d,1F ROM3:745E CF rst 08 ROM3:745F 0D dec c ROM3:7460 07 rlca ROM3:7461 FE 01 cp a,01 ROM3:7463 20 26 jr nz,748B ROM3:7465 CF rst 08 ROM3:7466 0D 0A => Pointer 0A:400D ROM3:7468 FE 00 cp a,00 ROM3:746A 20 16 jr nz,7482 ROM3:746C FA 00 C7 ld a,(C700) ROM3:746F 47 ld b,a ROM3:7470 FA 01 C7 ld a,(C701) ROM3:7473 4F ld c,a ROM3:7474 CD C7 50 call 50C7 ROM3:7477 CD 93 5F call 5F93 ;Removes selected card ROM3:747A 01 93 02 ld bc,0293 ROM3:747D CD 5D 61 call 615D ROM3:7480 18 09 jr 748B ROM3:7482 CF rst 08 ROM3:7483 0F 0A => Pointer 0A:400F ROM3:7485 CD 93 5F call 5F93 ;Removes selected card ROM3:7488 CF rst 08 ROM3:7489 07 0A => Pointer 0A:4007 ROM3:748B D1 pop de ROM3:748C C1 pop bc ROM3:748D F1 pop af ROM3:748E C9 ret
Stain Storm
ROM3:748F F5 push af ROM3:7490 C5 push bc ROM3:7491 D5 push de ROM3:7492 1E 01 ld e,01 ROM3:7494 0E 01 ld c,01 ROM3:7496 06 00 ld b,00 ROM3:7498 78 ld a,b ROM3:7499 FE 05 cp a,05 ROM3:749B 30 11 jr nc,74AE ROM3:749D 3E 0E ld a,0E ROM3:749F CD 36 51 call 5136 ROM3:74A2 FE 00 cp a,00 ROM3:74A4 20 05 jr nz,74AB ROM3:74A6 CD 86 20 call 2086 ;Remove selected card from the field ROM3:74A9 1E 00 ld e,00 ROM3:74AB 04 inc b ROM3:74AC 18 EA jr 7498 ROM3:74AE CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:74B1 CD 68 41 call 4168 ROM3:74B4 3E 3B ld a,3B ROM3:74B6 CF rst 08 ;Loads Sound Effect and Text 0x3B ROM3:74B7 0B dec bc ROM3:74B8 06 D1 ld b,D1 ROM3:74BA C1 pop bc ROM3:74BB F1 pop af ROM3:74BC C9 ret
Eradicating Aerosol
ROM3:74BD F5 push af ROM3:74BE C5 push bc ROM3:74BF D5 push de ROM3:74C0 1E 01 ld e,01 ROM3:74C2 0E 01 ld c,01 ROM3:74C4 06 00 ld b,00 ROM3:74C6 78 ld a,b ROM3:74C7 FE 05 cp a,05 ROM3:74C9 30 11 jr nc,74DC ROM3:74CB 3E 09 ld a,09 ROM3:74CD CD 36 51 call 5136 ROM3:74D0 FE 00 cp a,00 ROM3:74D2 20 05 jr nz,74D9 ROM3:74D4 CD 86 20 call 2086 ;Remove selected card from the field ROM3:74D7 1E 00 ld e,00 ROM3:74D9 04 inc b ROM3:74DA 18 EA jr 74C6 ROM3:74DC CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:74DF CD 68 41 call 4168 ROM3:74E2 3E 3D ld a,3D ROM3:74E4 CF rst 08 ;Loads Sound Effect and Text 0x3D ROM3:74E5 0B dec bc ROM3:74E6 06 D1 ld b,D1 ROM3:74E8 C1 pop bc ROM3:74E9 F1 pop af ROM3:74EA C9 ret
Breath of Light
ROM3:74EB F5 push af ROM3:74EC C5 push bc ROM3:74ED D5 push de ROM3:74EE 1E 01 ld e,01 ROM3:74F0 0E 01 ld c,01 ROM3:74F2 06 00 ld b,00 ROM3:74F4 78 ld a,b ROM3:74F5 FE 05 cp a,05 ROM3:74F7 30 11 jr nc,750A ROM3:74F9 3E 12 ld a,12 ROM3:74FB CD 36 51 call 5136 ROM3:74FE FE 00 cp a,00 ROM3:7500 20 05 jr nz,7507 ROM3:7502 CD 86 20 call 2086 ;Remove selected card from the field ROM3:7505 1E 00 ld e,00 ROM3:7507 04 inc b ROM3:7508 18 EA jr 74F4 ROM3:750A CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:750D CD 68 41 call 4168 ROM3:7510 3E 3E ld a,3E ROM3:7512 CF rst 08 ;Loads Sound Effect and Text 0x3E ROM3:7513 0B dec bc ROM3:7514 06 D1 ld b,D1 ROM3:7516 C1 pop bc ROM3:7517 F1 pop af ROM3:7518 C9 ret
Eternal Drought
ROM3:7519 F5 push af ROM3:751A C5 push bc ROM3:751B D5 push de ROM3:751C 1E 01 ld e,01 ROM3:751E 0E 01 ld c,01 ROM3:7520 06 00 ld b,00 ROM3:7522 78 ld a,b ROM3:7523 FE 05 cp a,05 ROM3:7525 30 11 jr nc,7538 ROM3:7527 3E 0C ld a,0C ROM3:7529 CD 36 51 call 5136 ROM3:752C FE 00 cp a,00 ROM3:752E 20 05 jr nz,7535 ROM3:7530 CD 86 20 call 2086 ;Remove selected card from the field ROM3:7533 1E 00 ld e,00 ROM3:7535 04 inc b ROM3:7536 18 EA jr 7522 ROM3:7538 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:753B CD 68 41 call 4168 ROM3:753E 3E 3F ld a,3F ROM3:7540 CF rst 08 ;Loads Sound Effect and Text 0x3F ROM3:7541 0B dec bc ROM3:7542 06 D1 ld b,D1 ROM3:7544 C1 pop bc ROM3:7545 F1 pop af ROM3:7546 C9 ret
Inexperienced Spy
ROM3:7547 F5 push af ROM3:7548 C5 push bc ROM3:7549 01 00 00 ld bc,0000 ROM3:754C 78 ld a,b ROM3:754D FE 05 cp a,05 ROM3:754F 30 0F jr nc,7560 ROM3:7551 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:7554 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:7557 CD 12 50 call 5012 ROM3:755A CD FB 19 call 19FB ;Update selected card ID and status ROM3:755D 04 inc b ROM3:755E 18 EC jr 754C ROM3:7560 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:7563 CD 68 41 call 4168 ROM3:7566 3E 66 ld a,66 ROM3:7568 CF rst 08 ;Loads Sound Effect and Text 0x66 ROM3:7569 0B dec bc ROM3:756A 06 C1 ld b,C1 ROM3:756C F1 pop af ROM3:756D C9 ret
Rituals 3
Dark Magic Ritual
ROM3:756E F5 push af ROM3:756F C5 push bc ROM3:7570 D5 push de ROM3:7571 01 00 17 ld bc,1700 ROM3:7574 CF rst 08 ROM3:7575 25 dec h ROM3:7576 08 50 59 ld (5950),sp ROM3:7579 0E 02 ld c,02 ROM3:757B 06 01 ld b,01 ROM3:757D 78 ld a,b ROM3:757E FE 06 cp a,06 ROM3:7580 30 0A jr nc,758C ROM3:7582 CD 0D 52 call 520D ROM3:7585 FE 00 cp a,00 ROM3:7587 28 03 jr z,758C ROM3:7589 04 inc b ROM3:758A 18 F1 jr 757D ROM3:758C 78 ld a,b ROM3:758D FE 06 cp a,06 ROM3:758F 28 0A jr z,759B ROM3:7591 3E 17 ld a,17 ROM3:7593 CF rst 08 ;Loads Sound Effect and Text 0x17 ROM3:7594 23 inc hl ROM3:7595 08 3E 64 ld (643E),sp ROM3:7598 CF rst 08 ROM3:7599 0B dec bc ROM3:759A 06 CD ld b,CD ROM3:759C 7F ld a,a ROM3:759D 5F ld e,a ROM3:759E CD 68 41 call 4168 ROM3:75A1 D1 pop de ROM3:75A2 C1 pop bc ROM3:75A3 F1 pop af ROM3:75A4 C9 ret
Pot of Greed
ROM3:75A5 F5 push af ROM3:75A6 CD 2B 45 call 452B ;Player draws a card ROM3:75A9 CD 2B 45 call 452B ;Player draws a card ROM3:75AC CD AD 79 call 79AD ;Freeze Monster card in Hand if a Monster has already been summoned this turn ROM3:75AF CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:75B2 3E 65 ld a,65 ROM3:75B4 CF rst 08 ;Loads Sound Effect and Text 0x65 ROM3:75B5 0B dec bc ROM3:75B6 06 F1 ld b,F1 ROM3:75B8 C9 ret
Restructer Revolution
0xF5B9-0xF5D9
- Restructer Revolution effect
ROM3:75B9 F5 push af ROM3:75BA C5 push bc ROM3:75BB E5 push hl ROM3:75BC CD 91 5B call 5B91 ROM3:75BF CD 18 4F call 4F18 ROM3:75C2 06 00 ld b,00 ROM3:75C4 4F ld c,a ROM3:75C5 CB 21 sla c ;c = Enemy monsters × 2 ROM3:75C7 21 E0 75 ld hl,75E0 ROM3:75CA 09 add hl,bc ROM3:75CB 2A ldi a,(hl) ROM3:75CC 46 ld b,(hl) ROM3:75CD 4F ld c,a ;bc = Enemy monsters × 200 ROM3:75CE CD A7 5C call 5CA7 ROM3:75D1 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:75D4 CD 4A 5D call 5D4A ROM3:75D7 3E 67 ld a,67 ROM3:75D9 CF rst 08 ;Loads Sound Effect and Text 0x67 ROM3:75DA 0B dec bc ROM3:75DB 06 E1 ld b,E1 ROM3:75DD C1 pop bc ROM3:75DE F1 pop af ROM3:75DF C9 ret
0xF5E0-0xF5EB
- Restructer Revolution damage array
ROM3:75E0 00 00 - 0 monsters 00 02 - 1 monster 00 04 - 2 monsters 00 06 - 3 monsters 00 08 - 4 monsters 00 10 - 5 monsters
Last Day of Witch
ROM3:75EC F5 push af ROM3:75ED C5 push bc ROM3:75EE D5 push de ROM3:75EF E5 push hl ROM3:75F0 1E 01 ld e,01 ROM3:75F2 0E 01 ld c,01 ROM3:75F4 06 00 ld b,00 ROM3:75F6 78 ld a,b ROM3:75F7 FE 05 cp a,05 ROM3:75F9 30 11 jr nc,760C ROM3:75FB 3E 01 ld a,01 ROM3:75FD CD 36 51 call 5136 ROM3:7600 FE 00 cp a,00 ROM3:7602 20 05 jr nz,7609 ROM3:7604 CD 86 20 call 2086 ;Remove selected card from the field ROM3:7607 1E 00 ld e,00 ROM3:7609 04 inc b ROM3:760A 18 EA jr 75F6 ROM3:760C CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:760F CD 68 41 call 4168 ROM3:7612 3E 68 ld a,68 ROM3:7614 CF rst 08 ;Loads Sound Effect and Text 0x68 ROM3:7615 0B dec bc ROM3:7616 06 E1 ld b,E1 ROM3:7618 D1 pop de ROM3:7619 C1 pop bc ROM3:761A F1 pop af ROM3:761B C9 ret
Exile of the Wicked
ROM3:761C F5 push af ROM3:761D C5 push bc ROM3:761E D5 push de ROM3:761F E5 push hl ROM3:7620 1E 01 ld e,01 ROM3:7622 0E 01 ld c,01 ROM3:7624 06 00 ld b,00 ROM3:7626 78 ld a,b ROM3:7627 FE 05 cp a,05 ROM3:7629 30 11 jr nc,763C ROM3:762B 3E 07 ld a,07 ROM3:762D CD 36 51 call 5136 ROM3:7630 FE 00 cp a,00 ROM3:7632 20 05 jr nz,7639 ROM3:7634 CD 86 20 call 2086 ;Remove selected card from the field ROM3:7637 1E 00 ld e,00 ROM3:7639 04 inc b ROM3:763A 18 EA jr 7626 ROM3:763C CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:763F CD 68 41 call 4168 ROM3:7642 3E 69 ld a,69 ;Loads Sound Effect and Text 0x69 ROM3:7644 CF rst 08 ROM3:7645 0B dec bc ROM3:7646 06 E1 ld b,E1 ROM3:7648 D1 pop de ROM3:7649 C1 pop bc ROM3:764A F1 pop af ROM3:764B C9 ret
Multiply
0xF64C-0xF68D
- Multiply: Summon a Kuriboh in every empty Monster Card Zone if there is a Kuriboh on the field
ROM3:764C F5 push af ROM3:764D C5 push bc ROM3:764E D5 push de ROM3:764F 0E 02 ld c,02 ROM3:7651 11 3A 00 ld de,003A ;Kuriboh ID ROM3:7654 CD 2C 52 call 522C ;Checks if a specific Monster card is on the field ROM3:7657 FE 00 cp a,00 ROM3:7659 20 2D jr nz,7688 ;If there is no Kuriboh on the field, jump to 3:7688 ROM3:765B 01 02 01 ld bc,0102 ;Column 1, Row 2 ROM3:765E 78 ld a,b ROM3:765F FE 06 cp a,06 ROM3:7661 30 25 jr nc,7688 ;If Kuriboh has been summoned in every free Monster Card Zone, jump to 3:7688 ROM3:7663 CD CB 4E call 4ECB ;Check if there's a card in the selected card zone ROM3:7666 FE 01 cp a,01 ROM3:7668 20 1B jr nz,7685 ;If the Monster Card Zone isn't free, jump to 3:7685 ROM3:766A C5 push bc ROM3:766B 01 3A 00 ld bc,003A ;Kuriboh ID ROM3:766E 79 ld a,c ROM3:766F EA A3 C7 ld (C7A3),a ROM3:7672 78 ld a,b ROM3:7673 EA A4 C7 ld (C7A4),a ;Card being processed = Kuriboh ROM3:7676 3E 10 ld a,10 ROM3:7678 EA A5 C7 ld (C7A5),a ;Card status = Set, Level 0 ROM3:767B CD 25 20 call 2025 ;Hide Card, reset Level ROM3:767E CD C9 1F call 1FC9 ;Reveal Card ROM3:7681 CD FB 19 call 19FB ;Update selected card ID and status ROM3:7684 C1 pop bc ROM3:7685 04 inc b ROM3:7686 18 D6 jr 765E ;Loop to 3:765E ROM3:7688 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:768B 3E 6A ld a,6A ROM3:768D CF rst 08 ;Loads Sound Effect and Text 0x6A ROM3:768E 0B 06 => Pointer 06:400B ROM3:7690 D1 pop de ROM3:7691 C1 pop bc ROM3:7692 F1 pop af ROM3:7693 C9 ret
Change of Heart
0xF694-0xF6D4
- Change of Heart effect
ROM3:7694 F5 push af ROM3:7695 C5 push bc ROM3:7696 E5 push hl ROM3:7697 CD EB 50 call 50EB ROM3:769A FE 06 cp a,06 ROM3:769C 28 28 jr z,76C6 ROM3:769E 6F ld l,a ROM3:769F CD B1 51 call 51B1 ;Retrieves "strongest" monster card ID from CPU's field ROM3:76A2 FE 00 cp a,00 ROM3:76A4 20 20 jr nz,76C6 ROM3:76A6 0E 01 ld c,01 ROM3:76A8 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:76AB CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:76AE CD E6 19 call 19E6 ;Remove selected card from the field ROM3:76B1 45 ld b,l ROM3:76B2 0E 02 ld c,02 ROM3:76B4 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:76B7 CD EA 1F call 1FEA ;Unfreezes Card ROM3:76BA CD 25 20 call 2025 ;Hide Card, reset Level ROM3:76BD CD C9 1F call 1FC9 ;Reveal Card ROM3:76C0 CD 00 20 call 2000 ROM3:76C3 CD FB 19 call 19FB ;Update selected card ID and status ROM3:76C6 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:76C9 CD 68 41 call 4168 ROM3:76CC 3E 6B ld a,6B ROM3:76CE CF rst 08 ;Loads Sound Effect and Text 0x6B ROM3:76CF 0B 06 => Pointer 06:400B ROM3:76D1 E1 pop bc ROM3:76D2 C1 pop bc ROM3:76D3 F1 pop af ROM3:76D4 C9 ret
Rituals 4
Black Illusion Ritual
ROM3:76D5 F5 push af ROM3:76D6 C5 push bc ROM3:76D7 D5 push de ROM3:76D8 01 00 18 ld bc,1800 ROM3:76DB CF rst 08 ROM3:76DC 25 dec h ROM3:76DD 08 50 59 ld (5950),sp ROM3:76E0 0E 02 ld c,02 ROM3:76E2 06 01 ld b,01 ROM3:76E4 78 ld a,b ROM3:76E5 FE 06 cp a,06 ROM3:76E7 30 0A jr nc,76F3 ROM3:76E9 CD 0D 52 call 520D ROM3:76EC FE 00 cp a,00 ROM3:76EE 28 03 jr z,76F3 ROM3:76F0 04 inc b ROM3:76F1 18 F1 jr 76E4 ROM3:76F3 78 ld a,b ROM3:76F4 FE 06 cp a,06 ROM3:76F6 28 0A jr z,7702 ROM3:76F8 3E 18 ld a,18 ROM3:76FA CF rst 08 ROM3:76FB 23 inc hl ROM3:76FC 08 3E 6C ld (6C3E),sp ROM3:76FF CF rst 08 ROM3:7700 0B dec bc ROM3:7701 06 CD ld b,CD ROM3:7703 7F ld a,a ROM3:7704 5F ld e,a ROM3:7705 CD 68 41 call 4168 ROM3:7708 D1 pop de ROM3:7709 C1 pop bc ROM3:770A F1 pop af ROM3:770B C9 ret
Trap Cards 2 (set)
Anti Raigeki
ROM3:770C CD A9 2A call 2AA9 ROM3:770F CD 9F 5E call 5E9F ROM3:7712 CD 68 41 call 4168 ROM3:7715 C9 ret
Brain Control
ROM3:7716 F5 push af ROM3:7717 C5 push bc ROM3:7718 E5 push hl ROM3:7719 CD EB 50 call 50EB ROM3:771C FE 06 cp a,06 ROM3:771E 28 28 jr z,7748 ROM3:7720 6F ld l,a ROM3:7721 CD B1 51 call 51B1 ROM3:7724 FE 00 cp a,00 ROM3:7726 20 20 jr nz,7748 ROM3:7728 0E 01 ld c,01 ROM3:772A CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:772D CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM3:7730 CD E6 19 call 19E6 ;Remove selected card from the field ROM3:7733 45 ld b,l ROM3:7734 0E 02 ld c,02 ROM3:7736 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM3:7739 CD EA 1F call 1FEA ;Unfreezes Card ROM3:773C CD 25 20 call 2025 ;Hide Card, reset Level ROM3:773F CD C9 1F call 1FC9 ;Reveal Card ROM3:7742 CD F5 1F call 1FF5 ROM3:7745 CD FB 19 call 19FB ;Update selected card ID and status ROM3:7748 CD 7F 5F call 5F7F ;Removes card from Player's Hand ROM3:774B CD 68 41 call 4168 ROM3:774E 3E 6E ld a,6E ROM3:7750 CF rst 08 ;Loads Sound Effect and Text 0x6E ROM3:7751 0B dec bc ROM3:7752 06 E1 ld b,E1 ROM3:7754 C1 pop bc ROM3:7755 F1 pop af ROM3:7756 C9 ret
Loads cards effects pointers
0xF757-0xF76E
- Loads the pointer corresponding to the card effect
ROM3:7757 C5 push bc ROM3:7758 E5 push hl ROM3:7759 06 00 ld b,00 ROM3:775B 4F ld c,a ROM3:775C CB 21 sla c ROM3:775E CB 10 rl b ;bc = Card Effect ID × 2 ROM3:7760 21 6F 77 ld hl,776F ROM3:7763 09 add hl,bc ROM3:7764 2A ldi a,(hl) ROM3:7765 66 ld h,(hl) ROM3:7766 6F ld l,a ;hl = Pointer to the selected Card Effect function ROM3:7767 01 6C 77 ld bc,776C ROM3:776A C5 push bc ROM3:776B E9 jp hl ;Jump to the selected Card Effect function ROM3:776C E1 pop hl ROM3:776D C1 pop bc ROM3:776E C9 ret
0xF76F-0xF856
- List of pointers to each card effect code
81 61 - 92 61 - CA 61 - (Summon a Monster Card) E8 61 - Forest F9 61 - Wasteland 0A 62 - Mountain 1B 62 - Sogen 2C 62 - Umi 3D 62 - Yami 4E 62 - Mooyan Curry 7C 62 - Red Medicine AA 62 - Goblin's Secret Remedy D8 62 - Soul of the Pure 06 63 - Dian Keto the Cure Master 34 63 - Sparks 62 63 - Hinotama 92 63 - Final Flame C2 63 - Ookazi F2 63 - Tremendous Fire 22 64 - Dark Hole 55 64 - Raigeki 93 64 - Legendary Sword D1 64 - Sword of Ruin 0F 65 - Dark Energy 4D 65 - Axe of Despair 8B 65 - Lazer Cannon Armor C9 65 - Insect Armor with Laser Cannon 07 66 - Elf's Light 45 66 - Beast Fangs 83 66 - Steel Shell C1 66 - Vile Germs FF 66 - Black Pendant 3D 67 - Silver Bow & Arrow 7B 67 - Horn of Light B9 67 - Horn of the Unicorn F7 67 - Dragon Treasure 35 68 - Electro-whip 73 68 - Cyber Shield B1 68 - Mystical Moon EF 68 - Malevolent Nuzzler 2D 69 - Violet Crystal 6B 69 - Book of Secret Art A9 69 - Invigoration E7 69 - Machine Conversion 25 6A - Raise Body Heat 63 6A - Follow Wind A1 6A - Power of Kaishin 82 61 - (Play a Monster card from hand) DF 6A - Stop Defense 0E 6B - Dragon Capture Jar 3C 6B - Swords of Revealing Light 81 6B - Dark-Piercing Light C3 6B - Spellbinding Circle EE 6B - Elegant Egotist 8B 61 - (Play a Monster card from hand) 3F 6C - Widespread Ruin 4B 6C - House of Adhesive Trap 57 6C - Eatgaboon 63 6C - Bear Trap 6F 6C - Invisible Wire 7B 6C - Acid Trap Hole 87 6C - Goblin Fan 93 6C - Simochi Allergy 9F 6C - Reverse Trap AB 6C - Fake Trap B7 6C - Black Luster Ritual EE 6C - Zera Ritual 25 6D - War-lion Ritual 5C 6D - Beastly Mirror Ritual 93 6D - Ultimate Dragon B4 6D - Commencement Dance EB 6D - Hamburger Recipe 22 6E - Revival of Sennen Genjin 59 6E - Novox's Prayer 90 6E - Curse of Tri-Horned Dragon C7 6E - Revived Serpent Night Dragon FE 6E - Harpie's Feather Duster 0F 6F - Magical Labyrinth 4D 6F - Salamandra 8B 6F - Kunai with Chain C9 6F - Bright Castle 07 70 - Crush Card 47 70 - Shadow Spell 73 70 - Turtle Oath AA 70 - Contract of Mask E1 70 - Resurrection of Chakra 18 71 - Puppet Ritual 4F 71 - Javelin Beetle Pact 86 71 - Garma Sword Oath BD 71 - Cosmo Queen's Prayer F4 71 - Revival of Skeleton 2B 72 - Fortress Whale's Oath 62 72 - Curse of Millennium Shield 99 72 - Yamadron Ritual D0 72 - Gate Guardian Ritual F1 72 - Warrior Elimination 22 73 - Cursebreaker 51 73 - Eternal Rest 7F 73 - Megamorph BD 73 - Metalmorph 51 74 - Winged Trumpeter 8F 74 - Stain Storm BD 74 - Eradicating Aerosol EB 74 - Breath of Light 19 75 - Eternal Drought 47 75 - Inexperienced Spy 6E 75 - Dark Magic Ritual A5 75 - Pot of Greed B9 75 - Restructer Revolution EC 75 - Last Day of Witch 1C 76 - Exile of the Wicked 4C 76 - Multiply 94 76 - Change of Heart D5 76 - Black Illusion Ritual 0C 77 - Anti Raigeki 16 77 - Brain Control
Has a Monster been summoned this turn ?
- Output:
- No Monster summoned this turn = 0
- Monster summoned this turn = 1
ROM3:799F FA 44 CA ld a,(CA44) ;a = Did the player play a monster this turn ? ROM3:79A2 FE 01 cp a,01 ROM3:79A4 30 04 jr nc,79AA ;if a Monster has been summoned this turn, skip to 3:79AA (a = 1) ROM3:79A6 3E 00 ld a,00 ;else a = 0 ROM3:79A8 18 02 jr 79AC ROM3:79AA 3E 01 ld a,01 ROM3:79AC C9 ret
Freeze Monster card in Hand if a Monster has already been summoned this turn
ROM3:79AD F5 push af ROM3:79AE CD 9F 79 call 799F ROM3:79B1 FE 00 cp a,00 ROM3:79B3 28 03 jr z,79B8 ;if a Monster has not been summoned this turn, skip next instruction ROM3:79B5 CD EC 4F call 4FEC ;Freeze card in Hand ROM3:79B8 F1 pop af ROM3:79B9 C9 ret
Tribute Summon
0xFB3F-0xFB7D
- Tribute Summon
ROM3:7B3F 0E 00 ld c,00 ROM3:7B41 FA BF C6 ld a,(C6BF) ;Effect ID (magic trap ritual) ROM3:7B44 FE 02 cp a,02 ROM3:7B46 20 18 jr nz,7B60 ;if it is not a Monster Card, jump to 3:7B60 ROM3:7B48 0E 02 ld c,02 ;2 Sacrifice required ROM3:7B4A FA BD C6 ld a,(C6BD) ;Monster Level ROM3:7B4D FE 05 cp a,05 ROM3:7B4F 30 04 jr nc,7B55 ;if(Monster Level ≥ 5), jump to 3:7B55 ROM3:7B51 0E 00 ld c,00 ;No Sacrifice required ROM3:7B53 18 09 jr 7B5E ROM3:7B55 FA BD C6 ld a,(C6BD) ROM3:7B58 FE 07 cp a,07 ROM3:7B5A 30 02 jr nc,7B5E ;if(Monster Level ≥ 7), jump to 3:7B5E ROM3:7B5C 0E 01 ld c,01 ;1 Sacrifice required ROM3:7B5E 18 1B jr 7B7B ;Exit this function ROM3:7B60 FA BB C6 ld a,(C6BB) ;Card Type ROM3:7B63 FE 16 cp a,16 ROM3:7B65 20 14 jr nz,7B7B ;if it is not a Ritual, exit this function ROM3:7B67 0E 02 ld c,02 ;2 Sacrifice required ROM3:7B69 FA BF C6 ld a,(C6BF) ;Effect ID (magic trap ritual) ROM3:7B6C FE 45 cp a,45 ROM3:7B6E 20 02 jr nz,7B72 ;if(Effect ID ≠ Ultimate Dragon), jump to 3:7B72 ROM3:7B70 0E 00 ld c,00 ;No Sacrifice required ROM3:7B72 FA BF C6 ld a,(C6BF) ;Effect ID (magic trap ritual) ROM3:7B75 FE 5E cp a,5E ROM3:7B77 20 02 jr nz,7B7B ;if(Effect ID ≠ Gate Guardian Ritual), exit this function ROM3:7B79 0E 00 ld c,00 ;No Sacrifice required ROM3:7B7B 79 ld a,c ROM3:7B7C C1 pop bc ROM3:7B7D C9 ret
Bank 4
Battle Operation 3
Loads Player's Life Points
0x10124-0x1012C
- Loads Player's Life Points in register bc
ROM4:4124 FA C7 C5 ld a,(C5C7) ROM4:4127 4F ld c,a ROM4:4128 FA C8 C5 ld a,(C5C8) ROM4:412B 47 ld b,a ROM4:412C CF rst 08
Main Menu
0x1041C-0x1042D
- Loads RAM0xC85C
(current menu ID), and increases it. If it is equal to 7, it is set to 0.
ROM4:441C F5 push af ROM4:441D CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:4420 FA 5C C8 ld a,(C85C) ROM4:4423 3C inc a ROM4:4424 FE 08 cp a,07 ROM4:4426 20 01 jr nz,4429 ROM4:4428 AF xor a ROM4:4429 EA 5C C8 ld (C85C),a ROM4:442C F1 pop af
0x1042E-0x10440
- Loads RAM0xC85C
(current menu ID), and decreases it. If it is equal to 0, it is set to 6.
ROM4:442E F5 push af ROM4:442F CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:4432 FA 5C C8 ld a,(C85C) ROM4:4435 3D dec a ROM4:4436 FE FF cp a,FF ROM4:4438 20 02 jr nz,443C ROM4:443A 3E 07 ld a,06 ROM4:443C EA 5C C8 ld (C85C),a ROM4:443F F1 pop af
Campaign Menu
Loads Stage
0x108FC-0x1095E
- Loads Stage corresponding to Stage ID in RAM0xC85D
ROM4:48FC F5 push af ROM4:48FD C5 push bc ROM4:48FE 0E 01 ld c,01 ROM4:4900 3E 02 ld a,02 ROM4:4902 EA 5D C8 ld (C85D),a ROM4:4905 FA 5D C8 ld a,(C85D) ROM4:4908 FE 02 cp a,02 ROM4:490A 20 12 jr nz,491E ;If (Stage ID ≠ 2), jump to 4:491E ROM4:490C CD 70 59 call 5970 ROM4:490F 79 ld a,c ROM4:4910 FE 00 cp a,00 ROM4:4912 28 05 jr z,4919 ROM4:4914 CD 19 2A call 2A19 ROM4:4917 0E 00 ld c,00 ROM4:4919 CD A0 59 call 59A0 ROM4:491C 18 35 jr 4953 ROM4:491E FE 03 cp a,03 ROM4:4920 20 08 jr nz,492A ;If (Stage ID ≠ 3), jump to 4:492A ROM4:4922 CD EF 51 call 51EF ROM4:4925 CD 1F 52 call 521F ROM4:4928 18 29 jr 4953 ROM4:492A FE 04 cp a,04 ROM4:492C 20 08 jr nz,4936 ;If (Stage ID ≠ 4), jump to 4:4936 ROM4:492E CD 9E 5E call 5E9E ROM4:4931 CD CE 5E call 5ECE ROM4:4934 18 1D jr 4953 ROM4:4936 FE 05 cp a,05 ROM4:4938 20 08 jr nz,4942 ;If (Stage ID ≠ 5), jump to 4:4942 ROM4:493A CD 69 61 call 6169 ROM4:493D CD 96 61 call 6196 ROM4:4940 18 11 jr 4953 ROM4:4942 FE 06 cp a,06 ROM4:4944 20 05 jr nz,494B ;If (Stage ID ≠ 6), jump to 4:494B ROM4:4946 CD 1E 4A call 4A1E ROM4:4949 18 08 jr 4953 ROM4:494B FE 00 cp a,00 ROM4:494D 28 06 jr z,4955 ;If (Stage ID == 0), jump to 4:4955 ROM4:494F FE 01 cp a,01 ROM4:4951 28 02 jr z,4955 ;If (Stage ID == 1), jump to 4:4955 ROM4:4953 18 B0 jr 4905 ROM4:4955 FE 01 cp a,01 ROM4:4957 20 03 jr nz,495C ;If (Stage ID ≠ 1), jump to 4:495C ROM4:4959 CD 5F 49 call 495F ROM4:495C C1 pop bc ROM4:495D F1 pop af ROM4:495E C9 ret
Loads CPU opponent
0x1095F-0x10962
- Load selected CPU opponent
ROM4:495F F5 push af ROM4:4960 3E 00 ld a,00 ;To make 2:6F60 call subroutine Stores CPU Character ID and Text ID ROM4:4962 CF rst 08 => 05 02 Text display subroutine ROM4:4965 3E 03 ld a,03 ROM4:4967 CF rst 08 => 1F 01 ROM4:496A CF rst 08 => 33 01 ROM4:496D CF rst 08 => 35 01 ROM4:4970 CD E9 29 call 29E9 ROM4:4973 CF rst 08 => 39 01 ROM4:4976 FE 00 cp a,00 ROM4:4978 20 0D jr nz,4987 ROM4:497A CD 81 2A call 2A81 ROM4:497D CD 89 49 call 4989 ROM4:4980 FA AD C6 ld a,(C6AD) ROM4:4983 FE 01 cp a,01 ROM4:4985 20 00 jr nz,4987 ;... what ? ROM4:4987 F1 pop af ROM4:4988 C9 ret
CPU turn start
ROM4:4BCB CD 73 24 call 2473 ;Duel Win and Loss subroutine ROM4:4BCE FE 01 cp a,01 ROM4:4BD0 28 27 jr z,4BF9 ;If the CPU won, get out of this function ROM4:4BD2 CF rst 08 ... ROM4:4BD5 CF rst 08 ... ROM4:4BD8 CF rst 08 ... ROM4:4BDB CF rst 08 ... ROM4:4BDE CF rst 08 ... ROM4:4BE1 CF rst 08 ... ROM4:4BE4 CD 28 4C call 4C28 ;Switches to WRAM Bank 4, and rst 08 ROM4:4BE7 CF rst 08 ... ROM4:4BEA CD 45 2C call 2C45 ;(C998) & 0xFE ROM4:4BED CD 8C 2C call 2C8C ;Decrease CPU's Swords of Revealing Light counter ROM4:4BF0 CF rst 08 ... ROM4:4BF3 CF rst 08 ... ROM4:4BF6 CF rst 08 ... ROM4:4BF9 C9 ret
Switches to WRAM Bank 4, and rst 08
ROM4:4C28 F5 push af ROM4:4C29 3E 04 ld a,04 ROM4:4C2B CD 24 12 call 1224 ;Switches to WRAM Bank 4 ROM4:4C2E CF rst 08 ... ROM4:4C31 CD 48 12 call 1248 ;WRAM Bank restore ROM4:4C34 F1 pop af ROM4:4C35 C9 ret
Loads Pre-Duel and Duel musics
0x10FC2-0x10FF5
- Loads Pre-Duel and Duel musics for the selected opponent
ROM4:4FC2 F5 push af ROM4:4FC3 C5 push bc ROM4:4FC4 D5 push de ROM4:4FC5 E5 push hl ROM4:4FC6 16 00 ld d,00 ROM4:4FC8 58 ld e,b ROM4:4FC9 CB 23 sla e ROM4:4FCB 21 F6 4F ld hl,4FF6 ROM4:4FCE 19 add hl,de ROM4:4FCF 2A ldi a,(hl) ROM4:4FD0 66 ld h,(hl) ROM4:4FD1 6F ld l,a ROM4:4FD2 06 00 ld b,00 ROM4:4FD4 09 add hl,bc ROM4:4FD5 7E ld a,(hl) ROM4:4FD6 EA CC C8 ld (C8CC),a ROM4:4FD9 21 15 50 ld hl,5015 ROM4:4FDC 19 add hl,de ;hl = Pre-Duel musics IDs pointer ROM4:4FDD 2A ldi a,(hl) ROM4:4FDE 66 ld h,(hl) ROM4:4FDF 6F ld l,a ROM4:4FE0 09 add hl,bc ROM4:4FE1 7E ld a,(hl) ROM4:4FE2 EA CD C8 ld (C8CD),a ;Sets the Pre-Duel music to be played ROM4:4FE5 21 34 50 ld hl,5034 ROM4:4FE8 19 add hl,de ;hl = Duel musics IDs pointer ROM4:4FE9 2A ldi a,(hl) ROM4:4FEA 66 ld h,(hl) ROM4:4FEB 6F ld l,a ROM4:4FEC 09 add hl,bc ROM4:4FED 7E ld a,(hl) ROM4:4FEE EA CE C8 ld (C8CE),a ;Sets the Duel Music to be played ROM4:4FF1 E1 pop hl ROM4:4FF2 D1 pop de ROM4:4FF3 C1 pop bc ROM4:4FF4 F1 pop af ROM4:4FF5 C9 ret
Opponent IDs pointers
0x10FF6-0x10FFF
- Opponent IDs pointers corresponding to the selected Stage
ROM4:4FF6 00 50 - Stage 1 05 50 - Stage 2 0B 50 - Stage 3 0F 50 - Stage 4 10 50 - Stage 5
Opponent ID list
0x11000-0x11014
- List of Opponent IDs, in the order they are displayed in Campaign mode. Look at the Characters IDs if you want to modify this.
0A - Tristan Taylor 05 - Yugi Muto 03 - Mako Tsunami 01 - Mai Valentine 07 - Joey Wheeler 09 - Espa Roba 02 - Rex Raptor 00 - Weevil Underwood 0B - Rare Hunter 0C - Pandora 08 - Seto Kaiba 10 - Simon Muran 17 - Ishizu Ishtar 0E - Heishin 0F - P. Seto 15 - DarkNite 04 - Yami Yugi 13 - Yami Bakura 16 - Nitemare 14 - Shadi 0D - Marik Ishtar
Pre-Duel music Pointers
0x11015-0x1101E
- Pre-Duel music pointers corresponding to each Stage
ROM4:5015 1F 50 - Stage 1 24 50 - Stage 2 2A 50 - Stage 3 2E 50 - Stage 4 2F 50 - Stage 5
Pre-Duel music IDs
0x1101F
- Tristan Taylor pre-duel0x11020
- Yugi Muto pre-duel0x11021
- Mako Tsunami pre-duel0x11022
- Mai Valentine pre-duel0x11023
- Joey Wheeler pre-duel0x11024
- Espa Roba pre-duel0x11025
- Rex Raptor pre-duel0x11026
- Weevil Underwood pre-duel0x11027
- Rare Hunter pre-duel0x11028
- Pandora pre-duel0x11029
- Seto Kaiba pre-duel0x1102A
- Simon Muran pre-duel0x1102B
- Isis Ishtar pre-duel0x1102C
- Heishin pre-duel0x1102D
- P. Seto pre-duel0x1102E
- DarkNite pre-duel0x1102F
- Yami Yugi pre-duel0x11030
- Yami Bakura pre-duel0x11031
- Nitemare pre-duel0x11032
- Shadi pre-duel0x11033
- Marik Ishtar pre-duel
Duel music Pointers
0x11034-0x1103D
- Duel music pointers corresponding to each Stage
ROM4:5034 3E 50 - Stage 1 43 50 - Stage 2 49 50 - Stage 3 4D 50 - Stage 4 4E 50 - Stage 5
Duel music IDs
0x1103E
- Tristan Taylor duel0x1103F
- Yugi Muto duel0x11040
- Mako Tsunami duel0x11041
- Mai Valentine duel0x11042
- Joey Wheeler duel0x11043
- Espa Roba duel0x11044
- Rex Raptor duel0x11045
- Weevil Underwood duel0x11046
- Rare Hunter duel0x11047
- Pandora duel0x11048
- Seto Kaiba duel0x11049
- Simon Muran duel0x1104A
- Isis Ishtar duel0x1104B
- Heishin duel0x1104C
- P. Seto duel0x1104D
- DarkNite duel0x1104E
- Yami Yugi duel0x1104F
- Yami Bakura duel0x11050
- Nitemare duel0x11051
- Shadi duel0x11052
- Marik Ishtar duel
4:5053
ROM4:5053 F5 push af ROM4:5054 C5 push bc ROM4:5055 D5 push de ROM4:5056 E5 push hl ROM4:5057 1E 00 ld e,00 ROM4:5059 CD 7F 1E call 1E7F ROM4:505C CD 7F 50 call 507F ROM4:505F 06 00 ld b,00 ROM4:5061 4F ld c,a ROM4:5062 21 77 50 ld hl,5077 ROM4:5065 09 add hl,bc ROM4:5066 2A ldi a,(hl) ROM4:5067 66 ld h,(hl) ROM4:5068 6F ld l,a ROM4:5069 01 6E 50 ld bc,506E ROM4:506C C5 push bc ROM4:506D E9 jp hl ROM4:506E FE 01 cp a,01 ROM4:5070 20 E7 jr nz,5059 ROM4:5072 E1 pop hl ROM4:5073 D1 pop de ROM4:5074 C1 pop bc ROM4:5075 F1 pop af ROM4:5076 C9 ret
4:5077 (pointers array)
ROM4:5077 A5 50 AF 50 C8 50 20 51
4:507F
ROM4:507F C5 push bc ROM4:5080 D5 push de ROM4:5081 E5 push hl ROM4:5082 16 00 ld d,00 ROM4:5084 FA A8 C5 ld a,(C5A8) ROM4:5087 E6 FF and a,FF ROM4:5089 28 0D jr z,5098 ROM4:508B 0E 08 ld c,08 ROM4:508D 0D dec c ROM4:508E 07 rlca ROM4:508F 30 FC jr nc,508D ROM4:5091 06 00 ld b,00 ROM4:5093 21 9D 50 ld hl,509D ROM4:5096 09 add hl,bc ROM4:5097 56 ld d,(hl) ROM4:5098 7A ld a,d ROM4:5099 E1 pop hl ROM4:509A D1 pop de ROM4:509B C1 pop bc ROM4:509C C9 ret
4:50A5
ROM4:50A5 3E 02 ld a,02 ROM4:50A7 CD E3 0E call 0EE3 ;Related to display ROM4:50AA CD C1 10 call 10C1 ROM4:50AD AF xor a ROM4:50AE C9 ret
4:50AF
ROM4:50AF CD 5C 51 call 515C ROM4:50B2 3E 02 ld a,02 ROM4:50B4 CD E3 0E call 0EE3 ;Related to display ROM4:50B7 CD C1 10 call 10C1 ROM4:50BA FA CF C8 ld a,(C8CF) ROM4:50BD FE 00 cp a,00 ROM4:50BF 20 04 jr nz,50C5 ROM4:50C1 3E 00 ld a,00 ROM4:50C3 18 02 jr 50C7 ROM4:50C5 3E 01 ld a,01 ROM4:50C7 C9 ret
4:50C8
ROM4:50C8 FA CF C8 ld a,(C8CF) ROM4:50CB FE 01 cp a,01 ROM4:50CD 20 05 jr nz,50D4 ROM4:50CF CD 30 51 call 5130 ROM4:50D2 18 4B jr 511F ROM4:50D4 FA D0 C8 ld a,(C8D0) ROM4:50D7 FE 01 cp a,01 ROM4:50D9 20 05 jr nz,50E0 ROM4:50DB CD 30 51 call 5130 ROM4:50DE 18 3F jr 511F ROM4:50E0 CD DA 29 call 29DA ROM4:50E3 CF rst 08 ... ROM4:50E9 FE 00 cp a,00 ROM4:50EB 20 23 jr nz,5110 ROM4:50ED CD 16 05 call 0516 ROM4:50F0 CF rst 08 ... ROM4:50F3 CD E1 29 call 29E1 ROM4:50F6 CD 53 50 call 5053 ROM4:50F9 CD 15 44 call 4415 ROM4:50FC CD 02 42 call 4202 ROM4:50FF CD F1 29 call 29F1 ROM4:5102 3E 00 ld a,00 ROM4:5104 EA AD C6 ld (C6AD),a ROM4:5107 CD 89 42 call 4289 ROM4:510A 18 FB jr 5107 ROM4:510C 18 FE jr 510C ROM4:510E 18 0F jr 511F ROM4:5110 FA D0 C8 ld a,(C8D0) ROM4:5113 FE 01 cp a,01 ROM4:5115 20 08 jr nz,511F ROM4:5117 3E 00 ld a,00 ROM4:5119 EA D0 C8 ld (C8D0),a ROM4:511C CD 30 51 call 5130 ROM4:511F C9 ret
4:5120
ROM4:5120 CD 6F 51 call 516F ROM4:5123 CD 81 51 call 5181 ROM4:5126 3E 04 ld a,04 ROM4:5128 CD E3 0E call 0EE3 ;Related to display ROM4:512B CD C1 10 call 10C1 ROM4:512E AF xor a ROM4:512F C9 ret
4:5130
ROM4:5130 CD 46 51 call 5146 ROM4:5133 3E 04 ld a,04 ROM4:5135 CD E3 0E call 0EE3 ROM4:5138 CD C1 10 call 10C1 ROM4:513B 3E 01 ld a,01 ROM4:513D C9 ret
4:513E
ROM4:513E F5 push af ROM4:513F 3E 01 ld a,01 ROM4:5141 EA CF C8 ld (C8CF),a ROM4:5144 F1 pop af ROM4:5145 C9 ret
4:5146
ROM4:5146 F5 push af ROM4:5147 CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM4:514A FA CF C8 ld a,(C8CF) ROM4:514D FE 00 cp a,00 ROM4:514F 20 03 jr nz,5154 ROM4:5151 CD 02 58 call 5802 ROM4:5154 CD 3C 56 call 563C ROM4:5157 CD FF 56 call 56FF ROM4:515A F1 pop af ROM4:515B C9 ret
4:515C
ROM4:515C F5 push af ROM4:515D FA CF C8 ld a,(C8CF) ROM4:5160 FE 01 cp a,01 ROM4:5162 20 09 jr nz,516D ROM4:5164 CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM4:5167 CD 3C 56 call 563C ROM4:516A CD FF 56 call 56FF ROM4:516D F1 pop af ROM4:516E C9 ret
4:516F
ROM4:516F F5 push af ROM4:5170 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:5173 FA CF C8 ld a,(C8CF) ROM4:5176 3C inc a ROM4:5177 FE 02 cp a,02 ROM4:5179 20 01 jr nz,517C ROM4:517B AF xor a ROM4:517C EA CF C8 ld (C8CF),a ROM4:517F F1 pop af ROM4:5180 C9 ret
4:5181 (Card Illustration)
ROM4:5181 F5 push af ROM4:5182 C5 push bc ROM4:5183 D5 push de ROM4:5184 E5 push hl ROM4:5185 CD BD 12 call 12BD ;Blanks card illustration ROM4:5188 06 00 ld b,00 ROM4:518A FA CF C8 ld a,(C8CF) ROM4:518D 4F ld c,a ROM4:518E CB 21 sla c ROM4:5190 21 B1 51 ld hl,51B1 ROM4:5193 09 add hl,bc ROM4:5194 2A ldi a,(hl) ROM4:5195 66 ld h,(hl) ROM4:5196 6F ld l,a ROM4:5197 11 00 C5 ld de,C500 ;Card Illustration color data ROM4:519A 2A ldi a,(hl) ROM4:519B 47 ld b,a ROM4:519C 78 ld a,b ROM4:519D FE 00 cp a,00 ROM4:519F 28 0B jr z,51AC ;If(a == 0), get out of this function ROM4:51A1 0E 04 ld c,04 ROM4:51A3 2A ldi a,(hl) ROM4:51A4 12 ld (de),a ROM4:51A5 13 inc de ROM4:51A6 0D dec c ROM4:51A7 20 FA jr nz,51A3 ;Loop 4 times to 4:51A3 ROM4:51A9 05 dec b ROM4:51AA 18 F0 jr 519C ROM4:51AC E1 pop hl ROM4:51AD D1 pop de ROM4:51AE C1 pop bc ROM4:51AF F1 pop af ROM4:51B0 C9 ret
4:51B1 (pointers array)
ROM4:51B1 B5 51 CE 51
Campaign - Stage 1
0x112C2-0x112D4
- Loads Stage 1
ROM4:52C2 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:52C5 3E 02 ld a,02 ROM4:52C7 CD E3 0E call 0EE3 ROM4:52CA CD C1 10 call 10C1 ROM4:52CD 3E 02 ld a,02 ;Stage 1 ROM4:52CF EA 5D C8 ld (C85D),a ROM4:52D2 3E 01 ld a,01 ROM4:52D4 C9 ret
SRAM management
Enable MBC5 RAM
0x1162D-0x11634
- Enable MBC5 battery RAM
ROM4:562D F5 push af ROM4:562E 3E 0A ld a,0A ROM4:5630 EA 00 00 ld (0000),a ROM4:5633 F1 pop af ROM4:5634 C9 ret
Disable MBC5 RAM
0x11635-0x1163B
- Disable MBC5 battery RAM
ROM4:5635 F5 push af ROM4:5636 AF xor a ROM4:5637 EA 00 00 ld (0000),a ROM4:563A F1 pop af ROM4:563B C9 ret
Save file sanity check
0x1163C-0x11698
- Save file sanity check, creates a new save file if the current save is corrupted, checks Debug value
ROM4:563C F5 push af ROM4:563D C5 push bc ROM4:563E CD 2D 56 call 562D ;Enable MBC5 RAM ROM4:5641 FA FF B7 ld a,(B7FF) ;Debug ROM4:5644 EA D6 C8 ld (C8D6),a ;Copy Debug value to (C8D6) ROM4:5647 3E 00 ld a,00 ROM4:5649 EA D8 C8 ld (C8D8),a ;New Game = false ROM4:564C CD 9C 58 call 589C ;SRAM KONAMI check ROM4:564F FE 01 cp a,01 ROM4:5651 20 1B jr nz,566E ;If the « KONAMI » string is correct, jump to 4:566E ROM4:5653 CD D1 65 call 65D1 ;No KONAMI string in SRAM ? Erase SRAM and create a new save file ! ROM4:5656 0E 3C ld c,3C ROM4:5658 3E 02 ld a,02 ROM4:565A CD E3 0E call 0EE3 ROM4:565D CD C1 10 call 10C1 ROM4:5660 0D dec c ROM4:5661 20 F5 jr nz,5658 ROM4:5663 CD DA 29 call 29DA ROM4:5666 CD 99 56 call 5699 ROM4:5669 3E 01 ld a,01 ROM4:566B EA D8 C8 ld (C8D8),a ;Set (C8D8) to 1, to indicate this is a New Game file ROM4:566E CD C0 57 call 57C0 ;Check SRAM Block and Checksum ROM4:5671 FE 01 cp a,01 ROM4:5673 20 1B jr nz,5690 ;If the save file is not corrupted, jump to 4:5690 ROM4:5675 CD D1 65 call 65D1 ;If the save file is corrupted, erase SRAM and create a new save file ROM4:5678 0E 3C ld c,3C ROM4:567A 3E 02 ld a,02 ROM4:567C CD E3 0E call 0EE3 ROM4:567F CD C1 10 call 10C1 ROM4:5682 0D dec c ROM4:5683 20 F5 jr nz,567A ROM4:5685 CD DA 29 call 29DA ROM4:5688 CD 99 56 call 5699 ROM4:568B 3E 01 ld a,01 ROM4:568D EA D8 C8 ld (C8D8),a ;New Game = true ROM4:5690 CD 0F 57 call 570F ;Clones SRAM if SRAM block 2 ROM4:5693 CD 35 56 call 5635 ;Disable MBC5 RAM ROM4:5696 C1 pop bc ROM4:5697 F1 pop af ROM4:5698 C9 ret
SRAM blocks management
Checks SRAM current block
0x1170F-0x1171B
- Checks SRAM block, and clones it if it's a temporary block
ROM4:570F F5 push af ROM4:5710 FA F0 B9 ld a,(B9F0) ROM4:5713 FE 02 cp a,02 ROM4:5715 20 03 jr nz,571A ;If(SRAM block ≠ 2), jump to 4:571A ROM4:5717 CD 1C 57 call 571C ;Copies block 1 into SRAM block 2 ROM4:571A F1 pop af ROM4:571B C9 ret
Copies SRAM block 1 into SRAM block 2
0x1171C-0x1173F
- Clones SRAM0xA000-0xABF8
ROM4:571C F5 push af ROM4:571D C5 push bc ROM4:571E D5 push de ROM4:571F E5 push hl ROM4:5720 21 00 A0 ld hl,A000 ROM4:5723 11 F8 AC ld de,ACF8 ROM4:5726 0E F8 ld c,F8 ROM4:5728 2A ldi a,(hl) ROM4:5729 12 ld (de),a ROM4:572A 13 inc de ROM4:572B 0D dec c ROM4:572C 20 FA jr nz,5728 ROM4:572E 06 0C ld b,0C ROM4:5730 0E 00 ld c,00 ROM4:5732 2A ldi a,(hl) ROM4:5733 12 ld (de),a ROM4:5734 13 inc de ROM4:5735 0D dec c ROM4:5736 20 FA jr nz,5732 ROM4:5738 05 dec b ROM4:5739 20 F5 jr nz,5730 ROM4:573B E1 pop hl ROM4:573C D1 pop de ROM4:573D C1 pop bc ROM4:573E F1 pop af ROM4:573F C9 ret
Copies SRAM block 2 into SRAM block 1
ROM4:5740 F5 push af ROM4:5741 C5 push bc ROM4:5742 D5 push de ROM4:5743 E5 push hl ROM4:5744 21 00 A0 ld hl,A000 ROM4:5747 11 F8 AC ld de,ACF8 ROM4:574A 0E F8 ld c,F8 ROM4:574C 1A ld a,(de) ROM4:574D 22 ldi (hl),a ROM4:574E 13 inc de ROM4:574F 0D dec c ROM4:5750 20 FA jr nz,574C ROM4:5752 06 0C ld b,0C ROM4:5754 0E 00 ld c,00 ROM4:5756 1A ld a,(de) ROM4:5757 22 ldi (hl),a ROM4:5758 13 inc de ROM4:5759 0D dec c ROM4:575A 20 FA jr nz,5756 ROM4:575C 05 dec b ROM4:575D 20 F5 jr nz,5754 ROM4:575F E1 pop hl ROM4:5760 D1 pop de ROM4:5761 C1 pop bc ROM4:5762 F1 pop af ROM4:5763 C9 ret
4:5764
ROM4:5764 F5 push af ROM4:5765 C5 push bc ROM4:5766 D5 push de ROM4:5767 E5 push hl ROM4:5768 CD 86 57 call 5786 ROM4:576B 06 00 ld b,00 ROM4:576D FA D7 C8 ld a,(C8D7) ROM4:5770 4F ld c,a ROM4:5771 CB 21 sla c ROM4:5773 21 82 57 ld hl,5782 ROM4:5776 09 add hl,bc ROM4:5777 2A ldi a,(hl) ROM4:5778 66 ld h,(hl) ROM4:5779 6F ld l,a ROM4:577A 7B ld a,e ROM4:577B 22 ldi (hl),a ROM4:577C 72 ld (hl),d ROM4:577D E1 pop hl ROM4:577E D1 pop de ROM4:577F C1 pop bc ROM4:5780 F1 pop af ROM4:5781 C9 ret
4:5786
4:5786 subroutine
ROM4:5786 F5 push af ROM4:5787 C5 push bc ROM4:5788 E5 push hl ROM4:5789 06 00 ld b,00 ROM4:578B FA D7 C8 ld a,(C8D7) ROM4:578E 4F ld c,a ROM4:578F CB 21 sla c ROM4:5791 21 BC 57 ld hl,57BC ROM4:5794 09 add hl,bc ROM4:5795 2A ldi a,(hl) ROM4:5796 66 ld h,(hl) ROM4:5797 6F ld l,a ;hl = SRAM block location ROM4:5798 11 00 00 ld de,0000 ROM4:579B 0E F6 ld c,F6 ROM4:579D 2A ldi a,(hl) ROM4:579E 83 add e ROM4:579F 5F ld e,a ROM4:57A0 3E 00 ld a,00 ROM4:57A2 8A adc d ROM4:57A3 57 ld d,a ROM4:57A4 0D dec c ROM4:57A5 20 F6 jr nz,579D ROM4:57A7 06 0C ld b,0C ROM4:57A9 0E 00 ld c,00 ROM4:57AB 2A ldi a,(hl) ROM4:57AC 83 add e ROM4:57AD 5F ld e,a ROM4:57AE 3E 00 ld a,00 ROM4:57B0 8A adc d ROM4:57B1 57 ld d,a ROM4:57B2 0D dec c ROM4:57B3 20 F6 jr nz,57AB ROM4:57B5 05 dec b ROM4:57B6 20 F1 jr nz,57A9 ROM4:57B8 E1 pop hl ROM4:57B9 C1 pop bc ROM4:57BA F1 pop af ROM4:57BB C9 ret
4:5786 data array - SRAM block locations
00 A0 F8 AC A000 - SRAM block 1 ACF8 - SRAM block 2
Check SRAM Block and Checksum
ROM4:57C0 C5 push bc ROM4:57C1 D5 push de ROM4:57C2 E5 push hl ROM4:57C3 FA F0 B9 ld a,(B9F0) ;a = SRAM block currently used ROM4:57C6 FE 03 cp a,03 ROM4:57C8 38 04 jr c,57CE ROM4:57CA 3E 01 ld a,01 ROM4:57CC 18 2D jr 57FB ROM4:57CE 06 00 ld b,00 ROM4:57D0 FA F0 B9 ld a,(B9F0) ROM4:57D3 4F ld c,a ROM4:57D4 21 FF 57 ld hl,57FF ROM4:57D7 09 add hl,bc ROM4:57D8 7E ld a,(hl) ROM4:57D9 EA D7 C8 ld (C8D7),a ROM4:57DC CD 86 57 call 5786 ROM4:57DF 06 00 ld b,00 ROM4:57E1 FA D7 C8 ld a,(C8D7) ROM4:57E4 4F ld c,a ROM4:57E5 CB 21 sla c ROM4:57E7 21 82 57 ld hl,5782 ROM4:57EA 09 add hl,bc ROM4:57EB 2A ldi a,(hl) ROM4:57EC 66 ld h,(hl) ROM4:57ED 6F ld l,a ROM4:57EE 2A ldi a,(hl) ROM4:57EF BB cp e ROM4:57F0 28 02 jr z,57F4 ROM4:57F2 06 01 ld b,01 ROM4:57F4 7E ld a,(hl) ROM4:57F5 BA cp d ROM4:57F6 28 02 jr z,57FA ROM4:57F8 06 01 ld b,01 ROM4:57FA 78 ld a,b ROM4:57FB E1 pop hl ROM4:57FC D1 pop de ROM4:57FD C1 pop bc ROM4:57FE C9 ret
Normal New Game
0x117FF-0x11814
- Sets0xB7F1
to 0xAA and0xB7FF
to 0x00.
ROM4:57FF 01 01 00 ld bc,0001 ROM4:5802 F5 push af ROM4:5803 CD 2D 56 call 562D ROM4:5806 3E AA ld a,AA ROM4:5808 EA F1 B7 ld (B7F1),a ROM4:580B 3E 00 ld a,00 ROM4:580D EA FF B7 ld (B7FF),a ROM4:5810 CD 35 56 call 5635 ROM4:5813 F1 pop af ROM4:5814 C9 ret
Debug New Game
0x11815-0x11827
- Sets0xB7F1
to 0xAA and0xB7FF
to 0x01.
ROM4:5815 F5 push af ROM4:5816 CD 2D 56 call 562D ROM4:5819 3E AA ld a,AA ROM4:581B EA F1 B7 ld (B7F1),a ROM4:581E 3E 01 ld a,01 ROM4:5820 EA FF B7 ld (B7FF),a ROM4:5823 CD 35 56 call 5635 ROM4:5826 F1 pop af ROM4:5827 C9 ret
0x11828-0x11832
- Enables Debug features if RAM0xC8D6
≠ 0 (copy from SRAM0xB7FF
), and thexor a
is removed
ROM4:5828 FA D6 C8 ld a,(C8D6) ROM4:582B FE 00 cp a,00 ROM4:582D 28 02 jr z,5831 ROM4:582F 3E 01 ld a,01 ;If debug value ≠ 0, set accumulator to 1 ROM4:5831 AF xor a ;...then set accumulator to 0. lolwut ? ROM4:5832 C9 ret
SRAM KONAMI check
0x11891-0x1189B
- « 99 12 25 KONAMI » string used to check SRAM existence in function 4:589C.
99 12 25 00 00 4B 4F 4E 41 4D 49 December 25, 1999 - KONAMI
0x1189C-0x118B8
- Control the presence of date of build and « KONAMI » string in SRAM at 0xB9F1-0xB9FB, to determine if save data exists.
ROM4:589C C5 push bc ROM4:589D D5 push de ROM4:589E E5 push hl ROM4:589F 06 00 ld b,00 ROM4:58A1 21 F1 B9 ld hl,B9F1 ROM4:58A4 11 91 58 ld de,5891 ROM4:58A7 0E 0B ld c,0B ROM4:58A9 1A ld a,(de) ROM4:58AA BE cp (hl) ROM4:58AB 28 02 jr z,58AF ;If the current character is ok, jump to 4:58AF ROM4:58AD 06 01 ld b,01 ;Else b = 1 ROM4:58AF 23 inc hl ROM4:58B0 13 inc de ROM4:58B1 0D dec c ROM4:58B2 20 F5 jr nz,58A9 ;Loops 11 times to see if « 99 12 25 KONAMI » is present in SRAM at (B9F1)-(B9FB). ROM4:58B4 78 ld a,b ROM4:58B5 E1 pop hl ROM4:58B6 D1 pop de ROM4:58B7 C1 pop bc ROM4:58B8 C9 ret
Copy data to SRAM after a Duel
0x118D7-0x118EF
- Updates Duel Records wins in SRAM
ROM4:58D7 0A ld a,(bc) ROM4:58D8 4F ld c,a ROM4:58D9 2A ldi a,(hl) ;Loads CPU Duel Record wins in accumulator ROM4:58DA 12 ld (de),a ;Writes the updated Duel record in SRAM (A71C) + (CPU opponent ID × 2) ROM4:58DB 13 inc de ROM4:58DC 0D dec c ROM4:58DD 20 FA jr nz,58D9 ;Jump once to 4:58D9 to read the two bytes ROM4:58DF C1 pop bc ROM4:58E0 03 inc bc ROM4:58E1 18 E0 jr 58C3 ROM4:58E3 3E 01 ld a,01 ROM4:58E5 E0 70 ld (ff00+70),a ;WRAM Bank 1 ROM4:58E7 CD 64 57 call 5764 ROM4:58EA E1 pop hl ROM4:58EB D1 pop de ROM4:58EC C1 pop bc ROM4:58ED F1 pop af
Reads Deck Capacity from SRAM
0x118EF-0x11921
- Copies the current Deck Capacity to0xFFD9
when the save file is loaded.
ROM4:58EF F5 push af ROM4:58F0 C5 push bc ROM4:58F1 D5 push de ROM4:58F2 E5 push hl ROM4:58F3 11 00 A0 ld de,A000 ROM4:58F6 01 22 59 ld bc,5922 ROM4:58F9 0A ld a,(bc) ROM4:58FA 6F ld l,a ROM4:58FB 03 inc bc ROM4:58FC 0A ld a,(bc) ROM4:58FD 67 ld h,a ROM4:58FE 03 inc bc ROM4:58FF FE 00 cp a,00 ROM4:5901 20 05 jr nz,5908 ROM4:5903 7D ld a,l ROM4:5904 FE 00 cp a,00 ROM4:5906 28 11 jr z,5919 ROM4:5908 0A ld a,(bc) ROM4:5909 E0 70 ld (ff00+70),a ;WRAM Bank switch ROM4:590B 03 inc bc ROM4:590C C5 push bc ROM4:590D 0A ld a,(bc) ROM4:590E 4F ld c,a ROM4:590F 1A ld a,(de) ROM4:5910 22 ldi (hl),a ROM4:5911 13 inc de ROM4:5912 0D dec c ROM4:5913 20 FA jr nz,590F ROM4:5915 C1 pop bc ROM4:5916 03 inc bc ROM4:5917 18 E0 jr 58F9 ROM4:5919 3E 01 ld a,01 ROM4:591B E0 70 ld (ff00+70),a ;WRAM Bank 1 ROM4:591D E1 pop hl ROM4:591E D1 pop de ROM4:591F C1 pop bc ROM4:5920 F1 pop af ROM4:5921 C9 ret
Campaign Mode
Campaign - Stage 2
0x11A45-0x11A61
- Loads Stage 2
ROM4:5A45 3E 02 ld a,02 ROM4:5A47 CD E3 0E call 0EE3 ROM4:5A4A CD C1 10 call 10C1 ROM4:5A4D CD C5 28 call 28C5 ROM4:5A50 FE 01 cp a,01 ROM4:5A52 38 0C jr c,5A60 ROM4:5A54 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:5A57 3E 03 ld a,03 ROM4:5A59 EA 5D C8 ld (C85D),a ;Stage 2 ROM4:5A5C 3E 01 ld a,01 ROM4:5A5E 18 01 jr 5A61 ROM4:5A60 AF xor a ROM4:5A61 C9 ret
Campaign - Stage 1
Opponent selection
0x11C62-0x11C87
- Stage 1 menu management; ensures the cursor goes from 0 to 4 and 4 to 0
ROM4:5C62 F5 push af ROM4:5C64 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:5C67 FA 70 C9 ld a,(C970) ROM4:5C6A 3C inc a ROM4:5C6B FE 05 cp a,05 ROM4:5C6D 20 01 jr nz,5C70 ROM4:5C6F AF xor a ROM4:5C70 EA 70 C9 ld (C970),a ROM4:5C73 F1 pop af ROM4:5C74 C9 ret ROM4:5C75 F5 push af ROM4:5C76 CD 89 2A call 2A89 ;Sound Effect: Cursor ROM4:5C79 FA 70 C9 ld a,(C970) ROM4:5C7C 3D dec a ROM4:5C7D FE FF cp a,FF ROM4:5C7F 20 02 jr nz,5C83 ROM4:5C81 3E 04 ld a,04 ROM4:5C83 EA 70 C9 ld (C970),a ROM4:5C86 F1 pop af ROM4:5C87 C9 ret
Loads Opponent music IDs
0x11C88-0x11C98
- Calls 4:4FC2, which loads the pre-duel and duel musics for the selected opponent
ROM4:5C88 F5 push af ROM4:5C89 C5 push bc ROM4:5C8A CD 81 2A call 2A81 ;Sound Effect: Validate (Menu) ROM4:5C8D 06 00 ld b,00 ROM4:5C8F FA 70 C9 ld a,(C970) ROM4:5C92 4F ld c,a ROM4:5C93 CD C2 4F call 4FC2 ROM4:5C96 C1 pop bc ROM4:5C97 F1 pop af ROM4:5C98 C9 ret
Battle Display
0x11DDA-0x11E08
-
ROM4:5DDA F5 push af ROM4:5DDB C5 push bc ROM4:5DDC D5 push de ROM4:5DDD E5 push hl ROM4:5DDE 3E 10 ld a,10 ROM4:5DE0 CD E3 0E call 0EE3 ;Related to display ROM4:5DE3 21 0A 5E ld hl,5E0A ROM4:5DE6 01 01 9C ld bc,9C01 ROM4:5DE9 16 05 ld d,05 ROM4:5DEB CD D2 10 call 10D2 ;Related to display ROM4:5DEE 1E 12 ld e,12 ROM4:5DF0 2A ldi a,(hl) ROM4:5DF1 CD 13 11 call 1113 ;Updates characters displayed on screen ROM4:5DF4 1D dec e ROM4:5DF5 20 F9 jr nz,5DF0 ROM4:5DF7 E5 push hl ROM4:5DF8 21 20 00 ld hl,0020 ROM4:5DFB 09 add hl,bc ROM4:5DFC 44 ld b,h ROM4:5DFD 4D ld c,l ROM4:5DFE E1 pop hl ROM4:5DFF 15 dec d ROM4:5E00 20 E9 jr nz,5DEB ROM4:5E02 CD C1 10 call 10C1 ;Related to display ROM4:5E05 E1 pop hl ROM4:5E06 D1 pop de ROM4:5E07 C1 pop bc ROM4:5E08 F1 pop af
0x11E0A-0x11E1B
- Filled with 0xD30x11E1C-0x11E84
- Filled with 0x000x11E85-0x11E8F
- Define window XY coordinates
ROM4:5E85 F5 push af ROM4:5E86 3E 90 ld a,90 ROM4:5E88 E0 4A ld (ff00+4A),a ;window Y ROM4:5E8A 3E 07 ld a,07 ROM4:5E8C E0 4B ld (ff00+4B),a ;window X (leftmost) ROM4:5E8E F1 pop af
0x11E90-0x119ED
- Define window XY coordinates for Battle Display
ROM4:5E90 F5 push af ROM4:5E91 3E 90 ld a,90 ROM4:5E93 E0 4A ld (ff00+4A),a ;window Y ROM4:5E95 3E 07 ld a,07 ROM4:5E97 E0 4B ld (ff00+4B),a ;window X (leftmost) ROM4:5E99 CD DA 5D call 5DDA ROM4:5E9C F1 pop af
Array: blank name
ROM4:6519 00 00 00 00 00 00 00 00
Initialize the Player's name
0x12521-0x12537
- Sets the Player's name to 0
ROM4:6521 F5 push af ROM4:6522 C5 push bc ROM4:6523 D5 push de ROM4:6524 E5 push hl ROM4:6525 21 7C C9 ld hl,C97C ROM4:6528 11 19 65 ld de,6519 ROM4:652B 0E 08 ld c,08 ROM4:652D 1A ld a,(de) ROM4:652E 22 ldi (hl),a ROM4:652F 13 inc de ROM4:6530 0D dec c ROM4:6531 20 FA jr nz,652D ROM4:6533 E1 pop hl ROM4:6534 D1 pop de ROM4:6535 C1 pop bc ROM4:6536 F1 pop af ROM4:6537 C9 ret
Check if the character ID in Player's name is 0x00
ROM4:6538 C5 push bc ROM4:6539 D5 push de ROM4:653A E5 push hl ROM4:653B 21 7C C9 ld hl,C97C ROM4:653E 11 19 65 ld de,6519 ROM4:6541 06 01 ld b,01 ROM4:6543 0E 08 ld c,08 ROM4:6545 1A ld a,(de) ROM4:6546 BE cp (hl) ROM4:6547 28 02 jr z,654B ;If the character is equal to the blank character at 4:6519, jump to 4:654B ROM4:6549 06 00 ld b,00 ROM4:654B 13 inc de ROM4:654C 23 inc hl ROM4:654D 0D dec c ROM4:654E 20 F5 jr nz,6545 ROM4:6550 78 ld a,b ROM4:6551 E1 pop hl ROM4:6552 D1 pop de ROM4:6553 C1 pop bc ROM4:6554 C9 ret
Player's name stored temporarily in PRNG before copy to SRAM
ROM4:6555 F5 push af ROM4:6556 C5 push bc ROM4:6557 E5 push hl ROM4:6558 0E 00 ld c,00 ROM4:655A 21 55 C8 ld hl,C855 ROM4:655D FA 74 C9 ld a,(C974) ROM4:6560 86 add (hl) ROM4:6561 47 ld b,a ROM4:6562 FA 78 C9 ld a,(C978) ROM4:6565 88 adc b ROM4:6566 22 ldi (hl),a ;(C855) = 1st character in Player's name + 5th character in Player's name ROM4:6567 28 01 jr z,656A ROM4:6569 0C inc c ROM4:656A FA 75 C9 ld a,(C975) ROM4:656D 86 add (hl) ROM4:656E 47 ld b,a ROM4:656F FA 79 C9 ld a,(C979) ROM4:6572 88 adc b ROM4:6573 22 ldi (hl),a ;(C856) = 2st character in Player's name + 6th character in Player's name ROM4:6574 28 01 jr z,6577 ROM4:6576 0C inc c ROM4:6577 FA 76 C9 ld a,(C976) ROM4:657A 86 add (hl) ROM4:657B 47 ld b,a ROM4:657C FA 7A C9 ld a,(C97A) ROM4:657F 88 adc b ROM4:6580 22 ldi (hl),a ;(C857) = 3rd character in Player's name + 7th character in Player's name ROM4:6581 28 01 jr z,6584 ROM4:6583 0C inc c ROM4:6584 FA 77 C9 ld a,(C977) ROM4:6587 86 add (hl) ROM4:6588 47 ld b,a ROM4:6589 FA 7B C9 ld a,(C97B) ROM4:658C 88 adc b ROM4:658D 22 ldi (hl),a ;(C858) = 4th character in Player's name + 8th character in Player's name ROM4:658E 28 01 jr z,6591 ROM4:6590 0C inc c ROM4:6591 79 ld a,c ROM4:6592 FE 00 cp a,00 ROM4:6594 20 05 jr nz,659B ROM4:6596 3E 01 ld a,01 ROM4:6598 EA 55 C8 ld (C855),a ;If for whatever reason the name is empty, seed the PRNG to 1 ROM4:659B E1 pop hl ROM4:659C C1 pop bc ROM4:659D F1 pop af ROM4:659E C9 ret
4:65D1
0x125D1-0x125F2
-
ROM4:65D1 F5 push af ROM4:65D2 CD 21 65 call 6521 ;Sets (C97C) to (C984) to 0 ROM4:65D5 CD F4 66 call 66F4 ;Sets (C986)(C987)(C989) to 0, sets (C988) to 1 ROM4:65D8 3E 08 ld a,08 ROM4:65DA CF rst 08 ROM4:65DB 05 dec b ROM4:65DC 02 ld (bc),a ROM4:65DD 3E 00 ld a,00 ROM4:65DF EA 84 C9 ld (C984),a ROM4:65E2 FA 86 C9 ld a,(C986) ROM4:65E5 FE 03 cp a,03 ROM4:65E7 28 08 jr z,65F1 ROM4:65E9 CD 15 66 call 6615 ROM4:65EC CD DA 6C call 6CDA ROM4:65EF 18 F1 jr 65E2 ROM4:65F1 F1 pop af ROM4:65F2 C9 ret
4:6615
0x12615-0x12620
-
ROM4:6615 F5 push af ROM4:6616 E5 push hl ROM4:6617 CD 64 12 call 1264 ROM4:661A 21 45 66 ld hl,6645 ROM4:661D CD 82 12 call 1282 ROM4:6620 CF rst 08
4:66F4
0x126F4-0x12709
- Sets (C986)(C987)(C989) to 0, sets (C988) to 1
ROM4:66F4 F5 push af ROM4:66F5 3E 00 ld a,00 ROM4:66F7 EA 86 C9 ld (C986),a ROM4:66FA 3E 00 ld a,00 ROM4:66FC EA 87 C9 ld (C987),a ROM4:66FF 3E 01 ld a,01 ROM4:6701 EA 88 C9 ld (C988),a ROM4:6704 3E 00 ld a,00 ROM4:6706 EA 89 C9 ld (C989),a ROM4:6709 F1 pop af ROM4:670A C9 ret
4:6954 (Name Entry)
ROM4:6954 C5 push bc ROM4:6955 D5 push de ROM4:6956 E5 push hl ROM4:6957 FA 88 C9 ld a,(C988) ROM4:695A FE 05 cp a,05 ROM4:695C 20 37 jr nz,6995 ROM4:695E CD 38 65 call 6538 ROM4:6961 FE 00 cp a,00 ROM4:6963 20 1D jr nz,6982 ;If the character is equal to the one in the array at 4:6519 (Character ID == 0x00), jump to 4:6982 ROM4:6965 06 00 ld b,00 ROM4:6967 FA 84 C9 ld a,(C984) ROM4:696A 4F ld c,a ROM4:696B CB 21 sla c ROM4:696D 21 C2 69 ld hl,69C2 ROM4:6970 09 add hl,bc ROM4:6971 2A ldi a,(hl) ROM4:6972 66 ld h,(hl) ROM4:6973 6F ld l,a ROM4:6974 11 79 69 ld de,6979 ROM4:6977 D5 push de ROM4:6978 E9 jp hl ROM4:6979 3E 03 ld a,03 ROM4:697B EA 86 C9 ld (C986),a ROM4:697E 3E 01 ld a,01 ROM4:6980 18 11 jr 6993 ROM4:6982 3E 00 ld a,00 ROM4:6984 EA 86 C9 ld (C986),a ROM4:6987 CD 85 5E call 5E85 ROM4:698A 3E 06 ld a,06 ROM4:698C EA 88 C9 ld (C988),a ROM4:698F CD 14 6A call 6A14 ROM4:6992 AF xor a ROM4:6993 18 1D jr 69B2 ROM4:6995 06 00 ld b,00 ROM4:6997 FA 84 C9 ld a,(C984) ROM4:699A 4F ld c,a ROM4:699B CB 21 sla c ROM4:699D 21 C8 69 ld hl,69C8 ROM4:69A0 09 add hl,bc ROM4:69A1 2A ldi a,(hl) ROM4:69A2 66 ld h,(hl) ROM4:69A3 6F ld l,a ROM4:69A4 11 A9 69 ld de,69A9 ROM4:69A7 D5 push de ROM4:69A8 E9 jp hl ROM4:69A9 FA 84 C9 ld a,(C984) ROM4:69AC 4F ld c,a ROM4:69AD 21 CE 69 ld hl,69CE ROM4:69B0 09 add hl,bc ROM4:69B1 7E ld a,(hl) ROM4:69B2 FE 00 cp a,00 ROM4:69B4 20 05 jr nz,69BB ROM4:69B6 CD 79 2A call 2A79 ROM4:69B9 18 03 jr 69BE ROM4:69BB CD 81 2A call 2A81 ROM4:69BE E1 pop hl ROM4:69BF D1 pop de ROM4:69C0 C1 pop bc ROM4:69C1 C9 ret
4:6A14 (Name Entry)
ROM4:6A14 F5 push af ROM4:6A15 C5 push bc ROM4:6A16 E5 push hl ROM4:6A17 3E 0E ld a,0E ROM4:6A19 CD E3 0E call 0EE3 ;Related to display ROM4:6A1C 01 06 98 ld bc,9806 ROM4:6A1F CD D2 10 call 10D2 ;Related to display ROM4:6A22 21 7C C9 ld hl,C97C ROM4:6A25 0E 08 ld c,08 ROM4:6A27 2A ldi a,(hl) ;a = Character ID ROM4:6A28 CF rst 08 ... ROM4:6A2B FA E6 C5 ld a,(C5E6) ROM4:6A2E CD 13 11 call 1113 ;Updates characters displayed on screen ROM4:6A31 0D dec c ROM4:6A32 20 F3 jr nz,6A27 ROM4:6A34 01 26 98 ld bc,9826 ROM4:6A37 CD D2 10 call 10D2 ;Related to display ROM4:6A3A 21 7C C9 ld hl,C97C ROM4:6A3D 0E 08 ld c,08 ROM4:6A3F 2A ldi a,(hl) ;a = Character ID ROM4:6A40 CF rst 08 ... ROM4:6A43 FA E7 C5 ld a,(C5E7) ROM4:6A46 CD 13 11 call 1113 ;Updates characters displayed on screen ROM4:6A49 0D dec c ROM4:6A4A 20 F3 jr nz,6A3F ;Loop 8 times to 4:6A3F (8 characters in name) ROM4:6A4C CD 37 6C call 6C37 ROM4:6A4F CD C1 10 call 10C1 ;Related to display ROM4:6A52 E1 pop hl ROM4:6A53 C1 pop bc ROM4:6A54 F1 pop af ROM4:6A55 C9 ret
Copies Player's name, initialize flags
ROM4:6DAC F5 push af ROM4:6DAD C5 push bc ROM4:6DAE D5 push de ROM4:6DAF E5 push hl ROM4:6DB0 21 55 C8 ld hl,C855 ;PRNG (temporary storage for Player's name) ROM4:6DB3 11 8A C9 ld de,C98A ;Player's name ROM4:6DB6 0E 04 ld c,04 ;Player's name is 4 bytes long ROM4:6DB8 2A ldi a,(hl) ROM4:6DB9 12 ld (de),a ROM4:6DBA 13 inc de ROM4:6DBB 0D dec c ROM4:6DBC 20 FA jr nz,6DB8 ROM4:6DBE 3E 00 ld a,00 ROM4:6DC0 E0 DC ld (ff00+DC),a ;Set ? Flag to 0 ROM4:6DC2 3E 00 ld a,00 ROM4:6DC4 E0 DB ld (ff00+DB),a ;Set Grandpa flag to 0 ROM4:6DC6 E1 pop hl ROM4:6DC7 D1 pop de ROM4:6DC8 C1 pop bc ROM4:6DC9 F1 pop af ROM4:6DCA C9 ret
Check if Grandpa flag is set
0x12DCB - 0x12DD8
- Returns 0 if Grandpa flag is set, 1 otherwise.
ROM4:6DCB C5 push bc ROM4:6DCC 0E 01 ld c,01 ROM4:6DCE F0 DB ld a,(ff00+DB) ROM4:6DD0 E6 80 and a,80 ROM4:6DD2 28 02 jr z,6DD6 ROM4:6DD4 0E 00 ld c,00 ROM4:6DD6 79 ld a,c ROM4:6DD7 C1 pop bc ROM4:6DD8 C9 ret
Set Grandpa flag
ROM4:6DD9 F5 push af ROM4:6DDA F0 DB ld a,(ff00+DB) ROM4:6DDC F6 80 or a,80 ROM4:6DDE E0 DB ld (ff00+DB),a ;hFFDB |= 0x80 ROM4:6DE0 F1 pop af ROM4:6DE1 C9 ret
Game text 2
0x132E8
- « BATTLES »0x132EF
- « WIN »0x13C76
- « lower body1 »0x13C81
- « upper body1 »0x13C8C
- « lower body2 »0x13C97
- « upper body2 »
Bank 5
Card display
Card display subroutine
0x1408C-0x140B2
- Card display subroutine
ROM5:408C 3E 06 ld a,06 ROM5:408E CD 24 12 call 1224 ;Switches to WRAM Bank 6 ROM5:4091 CD 1C 41 call 411C ;Display Level ROM5:4094 CD 90 41 call 4190 ROM5:4097 CD D0 41 call 41D0 ;Display Card ID ROM5:409A CD 3C 42 call 423C ;Display ATK ROM5:409D CD 6E 42 call 426E ;Display DEF ROM5:40A0 CD A0 42 call 42A0 ;Display Type ROM5:40A3 CD 0B 42 call 420B ROM5:40A6 CD E2 42 call 42E2 ROM5:40A9 CD CC 40 call 40CC ROM5:40AC CD 48 12 call 1248 ;WRAM Bank restore ROM5:40AF CD 3E 30 call 303E ROM5:40B2 CF rst 08
5:40CC
ROM5:40CC F5 push af ROM5:40CD C5 push bc ROM5:40CE D5 push de ROM5:40CF E5 push hl ROM5:40D0 16 00 ld d,00 ROM5:40D2 21 FC 40 ld hl,40FC ROM5:40D5 19 add hl,de ROM5:40D6 7E ld a,(hl) ROM5:40D7 FE 00 cp a,00 ROM5:40D9 20 19 jr nz,40F4 ROM5:40DB FA B3 C6 ld a,(C6B3) ;bc = Current Card ID ROM5:40DE 4F ld c,a ROM5:40DF FA B4 C6 ld a,(C6B4) ROM5:40E2 47 ld b,a ROM5:40E3 CD 84 1A call 1A84 ;Checks Card ID validity ROM5:40E6 FE 01 cp a,01 ROM5:40E8 20 05 jr nz,40EF ;If(Card ID > 800), jump to 5:40EF ROM5:40EA CD 67 29 call 2967 ROM5:40ED 18 03 jr 40F2 ROM5:40EF CD 97 43 call 4397 ROM5:40F2 18 03 jr 40F7 ROM5:40F4 CD 27 43 call 4327 ROM5:40F7 E1 pop hl ROM5:40F8 D1 pop de ROM5:40F9 C1 pop bc ROM5:40FA F1 pop af ROM5:40FB C9 ret
Display Level
0x1411C-0x14147
- Card Level display, stores Levels to display at (6:D04A)
ROM5:411C F5 push af ROM5:411D C5 push bc ROM5:411E D5 push de ROM5:411F E5 push hl ROM5:4120 06 00 ld b,00 ROM5:4122 FA BD C6 ld a,(C6BD) ;Current card Level ROM5:4125 4F ld c,a ROM5:4126 CB 21 sla c ROM5:4128 CB 10 rl b ROM5:412A CB 21 sla c ROM5:412C CB 10 rl b ROM5:412E CB 21 sla c ROM5:4130 CB 10 rl b ROM5:4132 21 48 41 ld hl,4148 ROM5:4135 09 add hl,bc ;hl = Pointer to Card Levels array ROM5:4136 54 ld d,h ROM5:4137 5D ld e,l ROM5:4138 21 4A D0 ld hl,D04A ROM5:413B 0E 08 ld c,08 ROM5:413D 1A ld a,(de) ROM5:413E 22 ldi (hl),a ;Store Card Levels to display to (6:D04A) ROM5:413F 13 inc de ROM5:4140 0D dec c ROM5:4141 20 FA jr nz,413D ;Loop 8 times ROM5:4143 E1 pop hl ROM5:4144 D1 pop de ROM5:4145 C1 pop bc ROM5:4146 F1 pop af ROM5:4147 C9 ret
Card Levels display array
ROM5:4148 00 for blank, 7F for star
Display Card ID
ROM5:4190 F5 push af ROM5:4191 C5 push bc ROM5:4192 D5 push de ROM5:4193 E5 push hl ROM5:4194 21 01 D0 ld hl,D001 ROM5:4197 FA B3 C6 ld a,(C6B3) ;bc = Card ID ROM5:419A 4F ld c,a ROM5:419B FA B4 C6 ld a,(C6B4) ROM5:419E 47 ld b,a ROM5:419F CD AC 16 call 16AC ROM5:41A2 CF rst 08
Display Card ID
ROM5:41D0 F5 push af ROM5:41D1 C5 push bc ROM5:41D2 E5 push hl ROM5:41D3 3E 00 ld a,00 ROM5:41D5 CF rst 08 ... ROM5:41D8 FA B3 C6 ld a,(C6B3) ;Card ID ROM5:41DB 4F ld c,a ROM5:41DC FA B4 C6 ld a,(C6B4) ROM5:41DF 47 ld b,a ROM5:41E0 CD 84 1A call 1A84 ;Checks Card ID validity ROM5:41E3 FE 01 cp a,01 ROM5:41E5 20 20 jr nz,4207 ;If(Card ID > 800), get out of this function ROM5:41E7 79 ld a,c ROM5:41E8 EA F6 C5 ld (C5F6),a ;Card ID displayed ROM5:41EB 78 ld a,b ROM5:41EC EA F7 C5 ld (C5F7),a ROM5:41EF CD 03 15 call 1503 ;Converts in decimal ROM5:41F2 CF rst 08 ... ROM5:41FB FA D1 C5 ld a,(C5D1) ROM5:41FE 22 ldi (hl),a ROM5:41FF FA D2 C5 ld a,(C5D2) ROM5:4202 22 ldi (hl),a ROM5:4203 FA D3 C5 ld a,(C5D3) ROM5:4206 22 ldi (hl),a ROM5:4207 E1 pop hl ROM5:4208 C1 pop bc ROM5:4209 F1 pop af ROM5:420A C9 ret
Display ATK
ROM5:423C F5 push af ROM5:423D C5 push bc ROM5:423E E5 push hl ROM5:423F 21 AE D0 ld hl,D0AE ROM5:4242 3E 00 ld a,00 ROM5:4244 CF rst 08 ... ROM5:4247 FA B7 C6 ld a,(C6B7) ;Card ATK ROM5:424A 4F ld c,a ROM5:424B FA B8 C6 ld a,(C6B8) ROM5:424E 47 ld b,a ROM5:424F 78 ld a,b ROM5:4250 FE FF cp a,FF ROM5:4252 28 16 jr z,426A ROM5:4254 CF rst 08 ... ROM5:425C C5 push bc ROM5:425D 22 ldi (hl),a ROM5:425E FA D1 C5 ld a,(C5D1) ROM5:4261 22 ldi (hl),a ROM5:4262 FA D2 C5 ld a,(C5D2) ROM5:4265 22 ldi (hl),a ROM5:4266 FA D3 C5 ld a,(C5D3) ROM5:4269 22 ldi (hl),a ROM5:426A E1 pop hl ROM5:426B C1 pop bc ROM5:426C F1 pop af ROM5:426D C9 ret
Display DEF
ROM5:426E F5 push af ROM5:426F C5 push bc ROM5:4270 E5 push hl ROM5:4271 21 CE D0 ld hl,D0CE ROM5:4274 3E 00 ld a,00 ROM5:4276 CF rst 08
...
ROM5:4278 FA B9 C6 ld a,(C6B9) ;Card DEF ROM5:427B 4F ld c,a ROM5:427D FA BA C6 ld a,(C6BA) ROM5:4280 47 ld b,a ROM5:4281 78 ld a,b ROM5:4282 FE FF cp a,FF ROM5:4284 28 16 jr z,429C ROM5:4286 CF rst 08
...
ROM5:428E C5 push bc ROM5:428F 22 ldi (hl),a ROM5:4290 FA D1 C5 ld a,(C5D1) ROM5:4293 22 ldi (hl),a ROM5:4294 FA D2 C5 ld a,(C5D2) ROM5:4297 22 ldi (hl),a ROM5:4298 FA D3 C5 ld a,(C5D3) ROM5:429B 22 ldi (hl),a ROM5:429C E1 pop hl ROM5:429D C1 pop bc ROM5:429E F1 pop af ROM5:429F C9 ret
Display Type
ROM5:42A0 F5 push af ROM5:42A1 C5 push bc ROM5:42A2 D5 push de ROM5:42A3 E5 push hl ROM5:42A4 3E 0E ld a,0E ROM5:42A6 CF rst 08 ... ROM5:42AB FA BB C6 ld a,(C6BB) ;Card Type ROM5:42AE 4F ld c,a ROM5:42AF CF rst 08 ... ROM5:42B7 C5 push bc ROM5:42B8 11 EB D0 ld de,D0EB ROM5:42BB 0E 08 ld c,08 ROM5:42BD 2A ldi a,(hl) ROM5:42BE CF rst 08 ... ROM5:42C7 20 F4 jr nz,42BD ROM5:42C9 21 D0 C5 ld hl,C5D0 ROM5:42CC 11 0B D1 ld de,D10B ROM5:42CF 0E 08 ld c,08 ROM5:42D1 2A ldi a,(hl) ROM5:42D2 CF rst 08 ... ROM5:42DB 20 F4 jr nz,42D1 ROM5:42DD E1 pop hl ROM5:42DE D1 pop de ROM5:42DF C1 pop bc ROM5:42E0 F1 pop af ROM5:42E1 C9 ret
Duelist level text
0x14370
- « Can't use card due to duelist level. »
Duel text
5:4A64
ROM5:4A64 F5 push af ROM5:4A65 3E 01 ld a,01 ROM5:4A67 EA 0A C9 ld (C90A),a ;(C90A) = 1 ROM5:4A6A F1 pop af ROM5:4A6B C9 ret
5:4A6C
ROM5:4A6C F5 push af ROM5:4A6D C5 push bc ROM5:4A6E E5 push hl ROM5:4A6F FA FF C8 ld a,(C8FF) ROM5:4A72 FE 01 cp a,01 ROM5:4A74 20 03 jr nz,4A79 ROM5:4A76 CD 7D 4A call 4A7D ;Duel text subroutine ROM5:4A79 E1 pop hl ROM5:4A7A C1 pop bc ROM5:4A7B F1 pop af ROM5:4A7C C9 ret
Duel text subroutine
ROM5:4A7D C5 push bc ROM5:4A7E E5 push hl ROM5:4A7F FA 0A C9 ld a,(C90A) ROM5:4A82 FE 01 cp a,01 ROM5:4A84 20 08 jr nz,4A8E ROM5:4A86 CD E3 4A call 4AE3 ROM5:4A89 EA 00 C9 ld (C900),a ;Character to display in text box ROM5:4A8C 18 16 jr 4AA4 ROM5:4A8E CD A7 4A call 4AA7 ;Load duel text ROM5:4A91 EA 00 C9 ld (C900),a ;Character to display in text box ROM5:4A94 CD D4 4A call 4AD4 ;Load special text from pointer (Character ID ≥ 0xB5) ROM5:4A97 FE 00 cp a,00 ROM5:4A99 20 09 jr nz,4AA4 ;If no special text has been requested, get out of this function ROM5:4A9B CD 64 4A call 4A64 ;(C90A) = 1 ROM5:4A9E CD E3 4A call 4AE3 ROM5:4AA1 EA 00 C9 ld (C900),a ;Character to display in text box ROM5:4AA4 E1 pop hl ROM5:4AA5 C1 pop bc ROM5:4AA6 C9 ret
Load duel text
ROM5:4AA7 C5 push bc ROM5:4AA8 E5 push hl ROM5:4AA9 06 00 ld b,00 ROM5:4AAB FA 05 C9 ld a,(C905) ROM5:4AAE 4F ld c,a ROM5:4AAF CB 21 sla c ROM5:4AB1 CB 10 rl b ROM5:4AB3 21 F3 4A ld hl,4AF3 ROM5:4AB6 09 add hl,bc ROM5:4AB7 2A ldi a,(hl) ROM5:4AB8 66 ld h,(hl) ROM5:4AB9 6F ld l,a ROM5:4ABA FA 02 C9 ld a,(C902) ROM5:4ABD 47 ld b,a ROM5:4ABE FA 01 C9 ld a,(C901) ROM5:4AC1 4F ld c,a ROM5:4AC2 3C inc a ROM5:4AC3 EA 01 C9 ld (C901),a ROM5:4AC6 20 07 jr nz,4ACF ROM5:4AC8 FA 02 C9 ld a,(C902) ROM5:4ACB 3C inc a ROM5:4ACC EA 02 C9 ld (C902),a ROM5:4ACF 09 add hl,bc ;hl = Pointer to current character in duel text ROM5:4AD0 7E ld a,(hl) ;a = Character ID ROM5:4AD1 E1 pop hl ROM5:4AD2 C1 pop bc ROM5:4AD3 C9 ret
Load special text from pointer
ROM5:4AD4 FE B5 cp a,B5 ROM5:4AD6 38 08 jr c,4AE0 ;If it is not a pointer, get out of this function ROM5:4AD8 D6 B5 sub a,B5 ROM5:4ADA CD 81 2D call 2D81 ;Set special text pointer offset ROM5:4ADD AF xor a ROM5:4ADE 18 02 jr 4AE2 ROM5:4AE0 3E 01 ld a,01 ROM5:4AE2 C9 ret
5:4AE3 (Special text ?)
ROM5:4AE3 C5 push bc ROM5:4AE4 CD 09 2D call 2D09 ROM5:4AE7 F5 push af ROM5:4AE8 78 ld a,b ROM5:4AE9 FE 01 cp a,01 ROM5:4AEB 20 03 jr nz,4AF0 ROM5:4AED CD 5C 4A call 4A5C ROM5:4AF0 F1 pop af ROM5:4AF1 C1 pop bc ROM5:4AF2 C9 ret
Duel text strings
0x14BF4
- « [Player]'s Turn »0x14BFE
- « [Opponent]'s Turn »0x14C09
- « COMM in progress »0x14C1C
- « End of Turn » (Unused)0x14C45
- « Your deck is short 40 cards! » (Unused ?)0x14C63
- « Trade Complete »0x14C73
- « Opponent's Turn »0x14C84
- « COMM fusion triggered.[Card Name] created. »0x14CA7
- « [Petit Moth] evolved to [Larvae Moth] »0x14CB7
- « [Larvae Moth] evolved to [Cocoon of Evolution] »0x14CC7
- « [Cocoon of Evolution] evolved to [Great Moth] »0x14CD7
- « [Great Moth] evolved to [Perfectly Ultimate Great Moth] »0x14CE7
- « Swords of Revealing Light still in effect »0x14D13
- « Swords of Revealing Light has stopped »0x14D3A
- Legendary Sword0x14D5E
- « Used [Card Name] [Card Name] splits and becomes [Card Name] »0x14D7F
- Stop Defense0x14DAC
- Dragon Capture Jar0x14DED
- Forest / Wasteland / Mountain / Sogen / Umi / Yami0x15041
- Dark Hole0x15074
- Raigeki0x150A7
- Mooyan Curry / Red Medicine / Goblin's Secret Remedy / Soul of the Pure / Dian Keto the Cure Master0x15170
- Sparks / Hinotama / Final Flame / Ookazi / Tremendous Fire0x1523E
- Swords of Revealing Light0x152A0
- Spellbinding Circle0x152E0
- Dark-Piercing Light0x1532F
- « Fusion of [Card Name] and [Card Name] created [Card Name] »0x1534C
- « Used [Card Name] Power-up [Card Name] »0x15360
- « Used [Card Name] Power-up was unsuccessful. » (Unused)0x15384
- Types-specific power-ups and removal cards0x15401
- Cursebreaker0x1542D
- Types-specific power-ups and removal cards0x15455
- « Used Megamorph Level increases by 2! » (Unused, should be used by Megamorph but isn't)0x15474
- Metalmorph0x1549F
- Types-specific power-ups and removal cards0x154F2
- Crush Card0x15520
- Types-specific power-ups and removal cards0x155C3
- Shadow Spell0x155F9
- Harpie's Feather Duster0x1561B
- House of Adhesive Tape / Eatgaboon / Bear Trap / Invisible Wire / Acid Trap Hole / Widespread Ruin0x15634
- Goblin Fan0x15652
- Bad Reaction to Simochi0x15680
- Reverse Trap0x156A8
- Tribute Summon0x156D6
- Monster has no effect / Effect has already been activated0x15724
- Pot of Greed0x15754
- The Inexperienced Spy0x1577A
- Restructer Revolution0x157C9
- Types-specific power-ups and removal cards0x15828
- Multiply0x1583F
- Change of Heart0x15862
- Anti Raigeki0x15897
- Brain Control0x158C7-0x162DB
- Effect Monsters
Deck Capacity
Initial Deck Capacity
0x167E7-0x167FE
- Initial Deck Capacity
ROM5:67E7 FE 00 cp a,00 ROM5:67E9 20 0A jr nz,67F5 ;If debug, jump to 5:67F5 ROM5:67EB 3E 90 ld a,90 ROM5:67ED E0 D9 ld (ff00+D9),a ROM5:67EF 3E 01 ld a,01 ROM5:67F1 E0 DA ld (ff00+DA),a ;Set Deck Capacity to 400 ROM5:67F3 18 08 jr 67FD ROM5:67F5 3E 0F ld a,0F ROM5:67F7 E0 D9 ld (ff00+D9),a ROM5:67F9 3E 27 ld a,27 ROM5:67FB E0 DA ld (ff00+DA),a ;Set Deck Capacity to 9999 ROM5:67FD F1 pop af ROM5:67FE C9 ret
Retrieves Deck Capacity
0x167FF-0x16807
- Retrieves Deck Capacity
ROM5:67FF F5 push af ROM5:6800 F0 D9 ld a,(ff00+D9) ROM5:6802 4F ld c,a ROM5:6803 F0 DA ld a,(ff00+DA) ROM5:6805 47 ld b,a ;bc = Deck Capacity ROM5:6806 F1 pop af ROM5:6807 C9 ret
Duelist Level subroutine
0x16808-0x16813
- Duelist Level subroutine
ROM5:6808 C5 push bc ROM5:6809 F0 D9 ld a,(ff00+D9) ROM5:680B 4F ld c,a ROM5:680C F0 DA ld a,(ff00+DA) ROM5:680E 47 ld b,a ;bc = Deck Capacity ROM5:680F CD 19 68 call 6819 ;Duelist Level calculation ROM5:6812 C1 pop bc ROM5:6813 C9 ret
5:6814
ROM5:6814 C5 push bc ROM5:6815 3E 0D ld a,0D ROM5:6817 C1 pop bc ROM5:6818 C9 ret
Duelist Level calculation
0x16819
- Duelist Level calculation
((Deck Capacity - 400) ÷ 3) + 15 A Deck Capacity of 1120 is required to get a Duelist Level of 255
ROM5:6819 C5 push bc ROM5:681A D5 push de ROM5:681B 79 ld a,c ROM5:681C D6 90 sub a,90 ROM5:681E 5F ld e,a ROM5:681F 78 ld a,b ROM5:6820 DE 01 sbc a,01 ROM5:6822 57 ld d,a ;de = Deck Capacity - 400 ROM5:6823 01 03 00 ld bc,0003 ROM5:6826 CD 32 14 call 1432 ;de ÷ 3 ROM5:6829 7B ld a,e ROM5:682A C6 0F add a,0F ROM5:682C 5F ld e,a ;Duelist Level += 15 ROM5:682D 7A ld a,d ROM5:682E CE 00 adc a,00 ROM5:6830 57 ld d,a ROM5:6831 7A ld a,d ROM5:6832 FE 00 cp a,00 ROM5:6834 28 02 jr z,6838 ;If(Duelist Level ≤ 255), jump to 5:6838 ROM5:6836 1E FF ld e,FF ;Else Duelist Level = 255 ROM5:6838 7B ld a,e ROM5:6839 D1 pop de ROM5:683A C1 pop bc ROM5:683B C9 ret
Increment Deck Capacity
0x1683C
- Increments Deck Capacity
ROM5:683C F5 push af ROM5:683D C5 push bc ROM5:683E D5 push de ROM5:683F F0 D9 ld a,(ff00+D9) ROM5:6841 C6 01 add a,01 ROM5:6843 4F ld c,a ROM5:6844 F0 DA ld a,(ff00+DA) ROM5:6846 CE 00 adc a,00 ROM5:6848 47 ld b,a ;bc = Deck Capacity + 1 ROM5:6849 11 0F 27 ld de,270F ROM5:684C CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM5:684F FE 00 cp a,00 ROM5:6851 20 02 jr nz,6855 ;If(Deck Capacity < 9999), jump to 5:6855 ROM5:6853 42 ld b,d ROM5:6854 4B ld c,e ;Else Deck Capacity = 9999 ROM5:6855 79 ld a,c ROM5:6856 E0 D9 ld (ff00+D9),a ROM5:6858 78 ld a,b ROM5:6859 E0 DA ld (ff00+DA),a ;Copy updated Deck Capacity to (FFD9) ROM5:685B D1 pop de ROM5:685C C1 pop bc ROM5:685D F1 pop af ROM5:685E C9 ret
Decrement Deck Capacity (unused)
0x1683C
- Decrements Deck Capacity (unused)
ROM5:685F F5 push af ROM5:6860 C5 push bc ROM5:6861 D5 push de ROM5:6862 F0 D9 ld a,(ff00+D9) ROM5:6864 D6 01 sub a,01 ROM5:6866 4F ld c,a ;bc = Deck Capacity - 1 ROM5:6867 F0 DA ld a,(ff00+DA) ROM5:6869 DE 00 sbc a,00 ROM5:686B 47 ld b,a ROM5:686C 11 90 01 ld de,0190 ROM5:686F CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM5:6872 FE 02 cp a,02 ROM5:6874 20 02 jr nz,6878 ;If(Deck Capacity > 400), jump to 5:6878 ROM5:6876 42 ld b,d ROM5:6877 4B ld c,e ;Else Deck Capacity = 400 ROM5:6878 79 ld a,c ROM5:6879 E0 D9 ld (ff00+D9),a ROM5:687B 78 ld a,b ROM5:687C E0 DA ld (ff00+DA),a ;Copy updated Deck Capacity to (FFD9) ROM5:687E D1 pop de ROM5:687F C1 pop bc ROM5:6880 F1 pop af ROM5:6881 C9 ret
Deck Capacity - CPU duel win
0x16882-0x1688C
- Deck Capacity increase after winning a CPU Duel
ROM5:6882 F5 push af ROM5:6883 3E 05 ld a,05 ROM5:6885 CD 3C 68 call 683C ;Increment Deck Capacity ROM5:6888 3D dec a ROM5:6889 20 FA jr nz,6885 ;Loop 5 times ROM5:688B F1 pop af ROM5:688C C9 ret
Deck Capacity - CPU duel loss
0x1688D-0x16897
- Deck Capacity increase after losing a CPU Duel
ROM5:688D F5 push af ROM5:688E 3E 05 ld a,05 ROM5:6890 CD 3C 68 call 683C ;Increment Deck Capacity ROM5:6893 3D dec a ROM5:6894 20 FA jr nz,6890 ;Loop 5 times ROM5:6896 F1 pop af ROM5:6897 C9 ret
Deck Capacity - Link Duel win
0x16898-0x168A2
- Deck Capacity increase after winning a Link Duel
ROM5:6898 F5 push af ROM5:6899 3E 14 ld a,14 ROM5:689B CD 3C 68 call 683C ;Increment Deck Capacity ROM5:689E 3D dec a ROM5:689F 20 FA jr nz,689B ;Loop 20 times ROM5:68A1 F1 pop af ROM5:68A2 C9 ret
Deck Capacity - Link Duel loss
0x168A3-0x168AD
- Deck Capacity increase after losing a Link Duel
ROM5:68A3 F5 push af ROM5:68A4 3E 0A ld a,0A ROM5:68A6 CD 3C 68 call 683C ;Increment Deck Capacity ROM5:68A9 3D dec a ROM5:68AA 20 FA jr nz,68A6 ;Loop 10 times ROM5:68AC F1 pop af ROM5:68AD C9 ret
Deck Capacity - Trade
0x168AE-0x168B8
- Deck Capacity increase after a Trade
ROM5:68AE F5 push af ROM5:68AF 3E 02 ld a,02 ROM5:68B1 CD 3C 68 call 683C ;Increment Deck Capacity ROM5:68B4 3D dec a ROM5:68B5 20 FA jr nz,68B1 ;Loop 2 times ROM5:68B7 F1 pop af ROM5:68B8 C9 ret
Ensures Deck Capacity is not exceeded
0x168B9-0x168D4
- Ensures Deck Capacity is not exceeded. Returns 0 if the Deck Capacity is valid, 1 otherwise
ROM5:68B9 C5 push bc ROM5:68BA D5 push de ROM5:68BB E5 push hl ROM5:68BC 2E 00 ld l,00 ROM5:68BE CF rst 08 ... ROM5:68C1 F0 D9 ld a,(ff00+D9) ROM5:68C3 5F ld e,a ROM5:68C4 F0 DA ld a,(ff00+DA) ROM5:68C6 57 ld d,a ;de = Deck Capacity ROM5:68C7 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM5:68CA FE 00 cp a,00 ROM5:68CC 20 02 jr nz,68D0 ;If(Deck Points total ≤ Deck Capacity), jump to 5:68D0 and return 0 ROM5:68CE 2E 01 ld l,01 ;Else return 1 ROM5:68D0 7D ld a,l ROM5:68D1 E1 pop hl ROM5:68D2 D1 pop de ROM5:68D3 C1 pop bc ROM5:68D4 C9 ret
Bank 6
rst 08 pointers
ROM6:4002 D5 52 CE 52 0E 40 - Display text box & changes music 34 41 B4 41 C6 5A
Display text box & changes music
ROM6:400E F5 push af ROM6:400F FA 4C C8 ld a,(C84C) ROM6:4012 FE 01 cp a,01 ROM6:4014 20 03 jr nz,4019 ROM6:4016 CD 22 40 call 4022 ROM6:4019 FE 02 cp a,02 ROM6:401B 20 03 jr nz,4020 ROM6:401D CD 46 40 call 4046 ROM6:4020 F1 pop af ROM6:4021 C9 ret
6:4022 (Duel Music ?)
ROM6:4022 F5 push af ROM6:4023 FA B1 C7 ld a,(C7B1) ROM6:4026 FE 01 cp a,01 ROM6:4028 20 0B jr nz,4035 ;If this is not Campaign mode, jump to 6:4035 ROM6:402A CD CE 52 call 52CE ROM6:402D CF rst 08 ROM6:402E 03 inc bc ROM6:402F 04 inc b ROM6:4030 CD 59 2A call 2A59 ;Duel Music subroutine ROM6:4033 18 0F jr 4044 ROM6:4035 CF rst 08 ROM6:4036 67 ld h,a ROM6:4037 03 inc bc ROM6:4038 CD CE 52 call 52CE ROM6:403B CF rst 08 ROM6:403C 65 ld h,l ROM6:403D 03 inc bc ROM6:403E CF rst 08 ... ROM6:4041 CD 59 2A call 2A59 ;Duel Music subroutine ROM6:4044 F1 pop af ROM6:4045 C9 ret
Display text box
ROM6:4046 F5 push af ROM6:4047 FA B1 C7 ld a,(C7B1) ;Menu ID ROM6:404A FE 01 cp a,01 ROM6:404C 20 3E jr nz,408C ;If not Campaign mode, jump to 6:408C ROM6:404E CD E5 40 call 40E5 ROM6:4051 FE 00 cp a,00 ROM6:4053 20 06 jr nz,405B ROM6:4055 CD 8D 44 call 448D ROM6:4058 CF rst 08 ROM6:4059 55 ld d,l ROM6:405A 03 inc bc ROM6:405B FE 01 cp a,01 ROM6:405D 20 06 jr nz,4065 ROM6:405F CD 69 41 call 4169 ROM6:4062 CF rst 08 ROM6:4063 55 ld d,l ROM6:4064 03 inc bc ROM6:4065 FE 02 cp a,02 ROM6:4067 20 06 jr nz,406F ROM6:4069 CD 18 46 call 4618 ROM6:406C CF rst 08 ROM6:406D 55 ld d,l ROM6:406E 03 inc bc ROM6:406F FE 03 cp a,03 ROM6:4071 20 06 jr nz,4079 ROM6:4073 CD 33 4C call 4C33 ROM6:4076 CF rst 08 ROM6:4077 55 ld d,l ROM6:4078 03 inc bc ROM6:4079 FE 04 cp a,04 ROM6:407B 20 06 jr nz,4083 ROM6:407D CD 75 4F call 4F75 ROM6:4080 CF rst 08 ROM6:4081 55 ld d,l ROM6:4082 03 inc bc ROM6:4083 FE 05 cp a,05 ROM6:4085 20 03 jr nz,408A ROM6:4087 CD AC 41 call 41AC ROM6:408A 18 57 jr 40E3 ROM6:408C CD E5 40 call 40E5 ROM6:408F FE 00 cp a,00 ROM6:4091 20 03 jr nz,4096 ROM6:4093 CF rst 08 ROM6:4094 55 ld d,l ROM6:4095 03 inc bc ROM6:4096 FE 01 cp a,01 ROM6:4098 20 0C jr nz,40A6 ROM6:409A CF rst 08 ROM6:409B 69 ld l,c ROM6:409C 03 inc bc ROM6:409D CD 69 41 call 4169 ROM6:40A0 CF rst 08 ROM6:40A1 65 ld h,l ROM6:40A2 03 inc bc ROM6:40A3 CF rst 08 ROM6:40A4 55 ld d,l ROM6:40A5 03 inc bc ROM6:40A6 FE 02 cp a,02 ROM6:40A8 20 0C jr nz,40B6 ROM6:40AA CF rst 08 ROM6:40AB 69 ld l,c ROM6:40AC 03 inc bc ROM6:40AD CD 18 46 call 4618 ROM6:40B0 CF rst 08 ROM6:40B1 65 ld h,l ROM6:40B2 03 inc bc ROM6:40B3 CF rst 08 ROM6:40B4 55 ld d,l ROM6:40B5 03 inc bc ROM6:40B6 FE 03 cp a,03 ROM6:40B8 20 0C jr nz,40C6 ROM6:40BA CF rst 08 ROM6:40BB 69 ld l,c ROM6:40BC 03 inc bc ROM6:40BD CD 33 4C call 4C33 ROM6:40C0 CF rst 08 ROM6:40C1 65 ld h,l ROM6:40C2 03 inc bc ROM6:40C3 CF rst 08 ROM6:40C4 55 ld d,l ROM6:40C5 03 inc bc ROM6:40C6 FE 04 cp a,04 ROM6:40C8 20 0C jr nz,40D6 ROM6:40CA CF rst 08 ROM6:40CB 69 ld l,c ROM6:40CC 03 inc bc ROM6:40CD CD 75 4F call 4F75 ROM6:40D0 CF rst 08 ROM6:40D1 65 ld h,l ROM6:40D2 03 inc bc ROM6:40D3 CF rst 08 ROM6:40D4 55 ld d,l ROM6:40D5 03 inc bc ROM6:40D6 FE 05 cp a,05 ROM6:40D8 20 09 jr nz,40E3 ROM6:40DA CF rst 08 ROM6:40DB 6B ld l,e ROM6:40DC 03 inc bc ROM6:40DD CD AC 41 call 41AC ROM6:40E0 CF rst 08 ROM6:40E1 65 ld h,l ROM6:40E2 03 inc bc ROM6:40E3 F1 pop af ROM6:40E4 C9 ret
6:40E5
ROM6:40E5 C5 push bc ROM6:40E6 D5 push de ROM6:40E7 1E 00 ld e,00 ROM6:40E9 FA A9 C8 ld a,(C8A9) ROM6:40EC 4F ld c,a ROM6:40ED FA AA C8 ld a,(C8AA) ROM6:40F0 47 ld b,a ;bc = Card being processed ROM6:40F1 CF rst 08 ROM6:40F2 03 07 => Pointer 7:4002 ROM6:40F4 FA AF C8 ld a,(C8AF) ROM6:40F7 FE 03 cp a,03 ROM6:40F9 20 04 jr nz,40FF ROM6:40FB 3E 03 ld a,03 ROM6:40FD 18 32 jr 4131 ROM6:40FF FA AF C8 ld a,(C8AF) ROM6:4102 FE 04 cp a,04 ROM6:4104 20 04 jr nz,410A ROM6:4106 3E 04 ld a,04 ROM6:4108 18 27 jr 4131 ROM6:410A FA AF C8 ld a,(C8AF) ROM6:410D FE 05 cp a,05 ROM6:410F 20 04 jr nz,4115 ROM6:4111 3E 05 ld a,05 ROM6:4113 18 1C jr 4131 ROM6:4115 FA BF C6 ld a,(C6BF) ;Card Effect ID (magic trap ritual) ROM6:4118 FE 02 cp a,02 ROM6:411A 20 0B jr nz,4127 ;If(Monster Card), jump to 6:4127 ROM6:411C FA AF C8 ld a,(C8AF) ROM6:411F FE 01 cp a,01 ROM6:4121 20 02 jr nz,4125 ROM6:4123 1E 01 ld e,01 ROM6:4125 18 09 jr 4130 ROM6:4127 FA AF C8 ld a,(C8AF) ROM6:412A FE 02 cp a,02 ROM6:412C 28 02 jr z,4130 ROM6:412E 1E 02 ld e,02 ROM6:4130 7B ld a,e ROM6:4131 D1 pop de ROM6:4132 C1 pop bc ROM6:4133 C9 ret
6:4134
ROM6:4134 F5 push af ROM6:4135 CD E5 40 call 40E5 ROM6:4138 FE 01 cp a,01 ROM6:413A 20 06 jr nz,4142 ROM6:413C CD 69 41 call 4169 ROM6:413F CF rst 08 ROM6:4140 55 ld d,l ROM6:4141 03 inc bc ROM6:4142 FE 02 cp a,02 ROM6:4144 20 06 jr nz,414C ROM6:4146 CD 18 46 call 4618 ROM6:4149 CF rst 08 ROM6:414A 55 ld d,l ROM6:414B 03 inc bc ROM6:414C FE 03 cp a,03 ROM6:414E 20 06 jr nz,4156 ROM6:4150 CD 33 4C call 4C33 ROM6:4153 CF rst 08 ROM6:4154 55 ld d,l ROM6:4155 03 inc bc ROM6:4156 FE 04 cp a,04 ROM6:4158 20 06 jr nz,4160 ROM6:415A CD 75 4F call 4F75 ROM6:415D CF rst 08 ROM6:415E 55 ld d,l ROM6:415F 03 inc bc ROM6:4160 FE 05 cp a,05 ROM6:4162 20 03 jr nz,4167 ROM6:4164 CD AC 41 call 41AC ROM6:4167 F1 pop af ROM6:4168 C9 ret
6:4169
ROM6:4169 F5 push af ROM6:416A C5 push bc ROM6:416B D5 push de ROM6:416C E5 push hl ROM6:416D 3E 00 ld a,00 ROM6:416F EA D9 C8 ld (C8D9),a ROM6:4172 3E 29 ld a,29 ROM6:4174 EA 05 C9 ld (C905),a ROM6:4177 CD D8 2C call 2CD8 ROM6:417A 1E 04 ld e,04 ROM6:417C FA A9 C8 ld a,(C8A9) ROM6:417F 4F ld c,a ROM6:4180 FA AA C8 ld a,(C8AA) ROM6:4183 47 ld b,a ROM6:4184 CD 8B 2D call 2D8B ROM6:4187 1E 04 ld e,04 ROM6:4189 FA AB C8 ld a,(C8AB) ROM6:418C 4F ld c,a ROM6:418D FA AC C8 ld a,(C8AC) ROM6:4190 47 ld b,a ROM6:4191 CD 9A 2D call 2D9A ROM6:4194 1E 04 ld e,04 ROM6:4196 FA AD C8 ld a,(C8AD) ROM6:4199 4F ld c,a ROM6:419A FA AE C8 ld a,(C8AE) ROM6:419D 47 ld b,a ROM6:419E CD A9 2D call 2DA9 ROM6:41A1 CD D1 2A call 2AD1 ROM6:41A4 CF rst 08 ROM6:41A5 19 add hl,de ROM6:41A6 05 dec b ROM6:41A7 E1 pop hl ROM6:41A8 D1 pop de ROM6:41A9 C1 pop bc ROM6:41AA F1 pop af ROM6:41AB C9 ret
6:41AC
ROM6:41AC F5 push af ROM6:41AD 3E 07 ld a,07 ROM6:41AF CF rst 08 ROM6:41B0 05 dec b ROM6:41B1 02 ld (bc),a ROM6:41B2 F1 pop af ROM6:41B3 C9 ret
6:41B4
ROM6:41B4 F5 push af ROM6:41B5 C5 push bc ROM6:41B6 E5 push hl ROM6:41B7 F5 push af ROM6:41B8 3E 02 ld a,02 ROM6:41BA EA 4C C8 ld (C84C),a ROM6:41BD 3E 00 ld a,00 ROM6:41BF EA AF C8 ld (C8AF),a ROM6:41C2 F1 pop af ROM6:41C3 06 00 ld b,00 ROM6:41C5 4F ld c,a ROM6:41C6 CB 21 sla c ROM6:41C8 21 F3 41 ld hl,41F3 ROM6:41CB 09 add hl,bc ROM6:41CC 2A ldi a,(hl) ROM6:41CD EA A9 C8 ld (C8A9),a ROM6:41D0 2A ldi a,(hl) ROM6:41D1 EA AA C8 ld (C8AA),a ROM6:41D4 21 D1 42 ld hl,42D1 ROM6:41D7 09 add hl,bc ROM6:41D8 2A ldi a,(hl) ROM6:41D9 EA AB C8 ld (C8AB),a ROM6:41DC 2A ldi a,(hl) ROM6:41DD EA AC C8 ld (C8AC),a ROM6:41E0 21 AF 43 ld hl,43AF ROM6:41E3 09 add hl,bc ROM6:41E4 2A ldi a,(hl) ROM6:41E5 EA AD C8 ld (C8AD),a ROM6:41E8 2A ldi a,(hl) ROM6:41E9 EA AE C8 ld (C8AE),a ROM6:41EC CD 0E 40 call 400E ROM6:41EF E1 pop hl ROM6:41F0 C1 pop bc ROM6:41F1 F1 pop af ROM6:41F2 C9 ret
6:448D
ROM6:448D F5 push af ROM6:448E C5 push bc ROM6:448F E5 push hl ROM6:4490 06 00 ld b,00 ROM6:4492 FA A8 C8 ld a,(C8A8) ROM6:4495 4F ld c,a ROM6:4496 21 AF 44 ld hl,44AF ROM6:4499 09 add hl,bc ROM6:449A 7E ld a,(hl) ROM6:449B FE 01 cp a,01 ROM6:449D 20 05 jr nz,44A4 ROM6:449F CD A9 2A call 2AA9 ;SE: Set Trap card / Failed Fusion ROM6:44A2 18 07 jr 44AB ROM6:44A4 FE 02 cp a,02 ROM6:44A6 20 03 jr nz,44AB ROM6:44A8 CD 99 2A call 2A99 ;Sound Effect: Validate (Duel) ROM6:44AB E1 pop hl ROM6:44AC C1 pop bc ROM6:44AD F1 pop af ROM6:44AE C9 ret
6:45DF (Text box display)
ROM6:45DF F5 push af ROM6:45E0 C5 push bc ROM6:45E1 D5 push de ROM6:45E2 7F ld a,a ;[sic] ROM6:45E3 EA 05 C9 ld (C905),a ;Text box ID ROM6:45E6 3E 00 ld a,00 ROM6:45E8 EA D9 C8 ld (C8D9),a ROM6:45EB CD D8 2C call 2CD8 ROM6:45EE 1E 04 ld e,04 ROM6:45F0 FA A9 C8 ld a,(C8A9) ROM6:45F3 4F ld c,a ROM6:45F4 FA AA C8 ld a,(C8AA) ROM6:45F7 47 ld b,a ;bc = Card being processed ROM6:45F8 CD 8B 2D call 2D8B ;(C9AF) = Card being processed, and (C9B1) = 4 ROM6:45FB FA AB C8 ld a,(C8AB) ROM6:45FE 4F ld c,a ROM6:45FF FA AC C8 ld a,(C8AC) ROM6:4602 47 ld b,a ;bc = Targeted card ID ROM6:4603 CD 9A 2D call 2D9A ;(C9B2) = Targeted card ID, and (C9B4) = 4 ROM6:4606 FA AD C8 ld a,(C8AD) ROM6:4609 4F ld c,a ROM6:460A FA AE C8 ld a,(C8AE) ROM6:460D 47 ld b,a ROM6:460E CD A9 2D call 2DA9 ROM6:4611 CF rst 08 ROM6:4612 19 05 => Pointer 5:4019 ROM6:4614 D1 pop de ROM6:4615 C1 pop bc ROM6:4616 F1 pop af ROM6:4617 C9 ret
Effect Monsters text box subroutine
ROM6:4F75 F5 push af ROM6:4F76 C5 push bc ROM6:4F77 E5 push hl ROM6:4F78 FA A9 C8 ld a,(C8A9) ROM6:4F7B 4F ld c,a ROM6:4F7C FA AA C8 ld a,(C8AA) ROM6:4F7F 47 ld b,a ;bc = Card being processed ROM6:4F80 CF rst 08 ROM6:4F81 03 07 => Pointer 7:4002, checks if the card ID is valid ROM6:4F83 06 00 ld b,00 ROM6:4F85 FA C0 C6 ld a,(C6C0) ROM6:4F88 4F ld c,a ROM6:4F89 CB 21 sla c ;bc = (Card Effect ID (monster)) × 2 ROM6:4F8B 21 9B 4F ld hl,4F9B ROM6:4F8E 09 add hl,bc ;hl = 0x4F9B + ((Card Effect ID (monster)) × 2) ROM6:4F8F 2A ldi a,(hl) ROM6:4F90 66 ld h,(hl) ROM6:4F91 6F ld l,a ;hl = ROM6:4F92 01 97 4F ld bc,4F97 ROM6:4F95 C5 push bc ROM6:4F96 E9 jp hl ROM6:4F97 E1 pop hl ROM6:4F98 C1 pop bc ROM6:4F99 F1 pop af ROM6:4F9A C9 ret
Effect Monsters text box functions pointers
ROM6:4F9B 03 50 - No Effect 04 50 - Reaper of the Card 12 50 - Fairy's Gift 20 50 - Relinquished 2E 50 - Thousand-eyes Restrict 3C 50 - Skelengel 4A 50 - Harpie Lady 58 50 - Harpie Lady Sisters 66 50 - Time Wizard 74 50 - Castle of D. Magic 82 50 - Mystical Elf 90 50 - Curse of Dragon 9E 50 - Flame Swordsman AC 50 - Giant Rock Soldier BA 50 - Battle Ox C8 50 - Monster Tamer D6 50 - Pumpking the King E4 50 - Mammoth Graveyard F2 50 - Catapult Turtle 00 51 - Goddess of Whim 0E 51 - Spirit of the Mountain 1C 51 - Dragon Seeker 2A 51 - Trap Master 38 51 - Fiend's Hand 46 51 - Faceless Mage 54 51 - Electric Lizard 62 51 - D. Magician Girl 70 51 - Wodan the Resident 7E 51 - M-warrior #1 8C 51 - M-warrior #2 9A 51 - Red Archery Girl A8 51 - Lady of Faith B6 51 - Fire Reaper C4 51 - Kairyu-shin D2 51 - Gyakutenno Megami E0 51 - Monster Eye EE 51 - Doron FC 51 - Swamp Battleguard 0A 52 - Lava Battleguard 18 52 - Trent 26 52 - Labyrinth Tank 34 52 - Spirit of the Book 42 52 - Hourglass of Life 50 52 - Beastking of the Swamp 5E 52 - Nemuriko 6C 52 - Toad Master 7A 52 - Hoshiningen 88 52 - Invitation to a Dark Sleep 96 52 - Witch's Apprentice A4 52 - Mystic Lamp B2 52 - Leghul C0 52 - Insect Queen
Cards data pointers ?
0x181F3-0x182D0
- Magic / Trap / Ritual cards (determines which card has which effect)0x18351-0x1839A
- Devine Monster cards (determines which monster is summoned by Ritual cards)
Battle Operation 4
0x19910-0x199A4
- Loads Player's Life Points (temporary copy) in register bc, and ?
ROM6:5910 F5 push af ROM6:5911 C5 push bc ROM6:5912 D5 push de ROM6:5913 E5 push hl ROM6:5914 FA 93 C8 ld a,(C893) ;Copy Player's Life Points in (C7A6) ROM6:5917 EA A6 C7 ld (C7A6),a ROM6:591A FA 94 C8 ld a,(C894) ROM6:591D EA A7 C7 ld (C7A7),a ROM6:5920 3E 00 ld a,00 ROM6:5922 EA A8 C7 ld (C7A8),a ROM6:5925 FA 95 C8 ld a,(C895) ;Copy P2's Life Points in (C7A9) ROM6:5928 EA A9 C7 ld (C7A9),a ROM6:592B FA 96 C8 ld a,(C896) ROM6:592E EA AA C7 ld (C7AA),a ROM6:5931 3E 00 ld a,00 ROM6:5933 EA AB C7 ld (C7AB),a ROM6:5936 CD 3E 1B call 1B3E ROM6:5939 FE 01 cp a,01 ROM6:593B 28 63 jr z,59A0 ROM6:593D FA 93 C8 ld a,(C893) ;Loads Player's Life Points (temporary copy) in register bc ROM6:5940 4F ld c,a ROM6:5941 FA 94 C8 ld a,(C894) ROM6:5944 47 ld b,a ROM6:5945 16 00 ld d,00 ROM6:5947 2E 00 ld l,00 ROM6:5949 7D ld a,l ROM6:594A FE 00 cp a,00 ROM6:594C 20 05 jr nz,5953 ROM6:594E CD E9 2A call 2AE9 ;Sound Effect: Cursor (Duel) ROM6:5951 2E 05 ld l,05 ROM6:5953 2D dec l ROM6:5954 1E 64 ld e,64 ROM6:5956 79 ld a,c ROM6:5957 EA A6 C7 ld (C7A6),a ROM6:595A 78 ld a,b ROM6:595B EA A7 C7 ld (C7A7),a ROM6:595E CD 3E 1B call 1B3E ;Copy (C7A6)-(C7AB) to (C5F6)-(C5FB) ROM6:5961 FE 00 cp a,00 ROM6:5963 28 02 jr z,5967 ROM6:5965 16 01 ld d,01 ROM6:5967 7A ld a,d ROM6:5968 FE 01 cp a,01 ROM6:596A 28 2C jr z,5998 ROM6:596C 3E 01 ld a,01 ROM6:596E EA F6 C5 ld (C5F6),a ROM6:5971 3E 00 ld a,00 ROM6:5973 EA F7 C5 ld (C5F7),a ROM6:5976 3E 00 ld a,00 ROM6:5978 EA F8 C5 ld (C5F8),a ROM6:597B 79 ld a,c ROM6:597C EA F9 C5 ld (C5F9),a ROM6:597F 78 ld a,b ROM6:5980 EA FA C5 ld (C5FA),a ROM6:5983 3E 00 ld a,00 ROM6:5985 EA FB C5 ld (C5FB),a ROM6:5988 D5 push de ROM6:5989 CD B2 14 call 14B2 ROM6:598C D1 pop de ROM6:598D FA F6 C5 ld a,(C5F6) ROM6:5990 4F ld c,a ROM6:5991 FA F7 C5 ld a,(C5F7) ROM6:5994 47 ld b,a ROM6:5995 1D dec e ROM6:5996 20 BE jr nz,5956 ROM6:5998 CD A5 59 call 59A5 ROM6:599B 7A ld a,d ROM6:599C FE 00 cp a,00 ROM6:599E 28 A9 jr z,5949 ROM6:59A0 E1 pop hl ROM6:59A1 D1 pop de ROM6:59A2 C1 pop bc ROM6:59A3 F1 pop af ROM6:59A4 C9 ret
Graphics 1
0x019B40
- « This game is designed for use on GAME BOY ® COLOR only »
Bank 7
rst 08 pointers
ROM7:4002 A0 40 - Card Stats routine 44 40 - Calculate ATK and DEF (card ID must be submitted in bc) 3C 40 - Updates current Field 40 40 - Updates current Stat Level 56 40 - Calculate current ATK and DEF (retrieves card ID from (C7A3) ) 69 64 - Monster Equip subroutine
Initialize selected card data
ROM7:400E F5 push af ROM7:400F AF xor a ;a = 0 ROM7:4010 EA B3 C6 ld (C6B3),a ;Current Card ID ROM7:4013 EA B4 C6 ld (C6B4),a ROM7:4016 EA B5 C6 ld (C6B5),a ;Field Column ROM7:4019 EA B6 C6 ld (C6B6),a ;Field Row ROM7:401C EA B7 C6 ld (C6B7),a ;Current card ATK ROM7:401F EA B8 C6 ld (C6B8),a ROM7:4022 EA B9 C6 ld (C6B9),a ;Current card DEF ROM7:4025 EA BA C6 ld (C6BA),a ROM7:4028 EA BB C6 ld (C6BB),a ;Current card Type ROM7:402B EA BC C6 ld (C6BC),a ;Current card Cost ROM7:402E EA BD C6 ld (C6BD),a ;Current card Level ROM7:4031 EA BE C6 ld (C6BE),a ;Current card Alignment ROM7:4034 EA BF C6 ld (C6BF),a ;Current card Effect ID (magic trap ritual) ROM7:4037 EA C0 C6 ld (C6C0),a ;Current card Effect ID (monster) ROM7:403A F1 pop af ROM7:403B C9 ret
Updates current Field
ROM7:403C EA B1 C6 ld (C6B1),a ;Current Field ROM7:403F C9 ret
Updates current Stat Level
ROM7:4040 EA B2 C6 ld (C6B2),a ;Current Stat Level ROM7:4043 C9 ret
Calculate ATK and DEF
0x1C044-0x1C055
- Calculate ATK and DEF (Card ID must be set in bc before calling this function)
ROM7:4044 F5 push af ROM7:4045 CD A0 40 call 40A0 ;Card Stats routine ROM7:4048 FA B1 C6 ld a,(C6B1) ;Current Field ID ROM7:404B CD 81 40 call 4081 ;Apply Field effect ROM7:404E FA B2 C6 ld a,(C6B2) ;Current Stat Level ROM7:4051 CD 29 42 call 4229 ;Apply Stat Level ROM7:4054 F1 pop af ROM7:4055 C9 ret
Calculate current ATK and DEF
ROM7:4056 F5 push af ROM7:4057 C5 push bc ROM7:4058 FA A3 C7 ld a,(C7A3) ROM7:405B 4F ld c,a ROM7:405C FA A4 C7 ld a,(C7A4) ROM7:405F 47 ld b,a ;bc = Current Card ID ROM7:4060 CD A0 40 call 40A0 ;Card Stats routine ROM7:4063 C5 push bc ROM7:4064 CD DB 19 call 19DB ;Retrieves field Column and Row ROM7:4067 CD 95 40 call 4095 ;Updates current field Column and Row ROM7:406A C1 pop bc ROM7:406B CD ED 1A call 1AED ;checks card validity in Trunk ? ROM7:406E FE 03 cp a,03 ROM7:4070 28 0C jr z,407E ;if(card_ID == 1080) ,jump to 7:407E (skips Field effect for construction card 3 69) ROM7:4072 FA E8 C5 ld a,(C5E8) ;a = Field ID ROM7:4075 CD 81 40 call 4081 ;Apply Field effect ROM7:4078 CD C1 1F call 1FC1 ;Retrieve Card Stat Level ROM7:407B CD 29 42 call 4229 ;Apply Stat Level ROM7:407E C1 pop bc ROM7:407F F1 pop af ROM7:4080 C9 ret
Apply Field effect
ROM7:4081 F5 push af ROM7:4082 C5 push bc ROM7:4083 47 ld b,a ROM7:4084 FA BB C6 ld a,(C6BB) ROM7:4087 4F ld c,a ;c = Current card Type ROM7:4088 CD 53 44 call 4453 ;Field - load load Bonus / Penalty to card Type ROM7:408B 4F ld c,a ;c = bonus / panalty - 01: penalty; 02: neutral; 03: bonus ROM7:408C CD F5 43 call 43F5 ROM7:408F CD 29 44 call 4429 ROM7:4092 C1 pop bc ROM7:4093 F1 pop af ROM7:4094 C9 ret
Updates current field Column and Row
ROM7:4095 F5 push af ROM7:4096 78 ld a,b ROM7:4097 EA B5 C6 ld (C6B5),a ;Field Column ROM7:409A 79 ld a,c ROM7:409B EA B6 C6 ld (C6B6),a ;Field Row ROM7:409E F1 pop af ROM7:409F C9 ret
Card Stats functions
Card Stats routine
ROM7:40A0 F5 push af ROM7:40A1 C5 push bc ROM7:40A2 CD 84 1A call 1A84 ;Checks Card ID validity ROM7:40A5 FE 01 cp a,01 ROM7:40A7 20 05 jr nz,40AE ;if(card_ID > 800), jump to 7:40AE ROM7:40A9 CD C6 40 call 40C6 ;Retrieve card data ROM7:40AC 18 15 jr 40C3 ROM7:40AE FE 02 cp a,02 ROM7:40B0 20 05 jr nz,40B7 ;if(card_ID > 5700), jump to 7:40B7 ROM7:40B2 CD 29 41 call 4129 ;Retrieve Construction card data ROM7:40B5 18 0C jr 40C3 ROM7:40B7 FE 03 cp a,03 ROM7:40B9 20 05 jr nz,40C0 ;if(card_ID == 0), jump to 7:40C0 ROM7:40BB CD 29 41 call 4129 ;Retrieve Construction card data, no fail-safe ! ROM7:40BE 18 03 jr 40C3 ROM7:40C0 CD F6 41 call 41F6 ;Initialize current card data ROM7:40C3 C1 pop bc ROM7:40C4 F1 pop af ROM7:40C5 C9 ret
Retrieve card data
ROM7:40C6 F5 push af ROM7:40C7 C5 push bc ROM7:40C8 D5 push de ROM7:40C9 E5 push hl ROM7:40CA 79 ld a,c ROM7:40CB EA B3 C6 ld (C6B3),a ;(C6B3) = Current card ID ROM7:40CE 78 ld a,b ROM7:40CF EA B4 C6 ld (C6B4),a ROM7:40D2 21 A4 51 ld hl,51A4 ROM7:40D5 09 add hl,bc ROM7:40D6 7E ld a,(hl) ROM7:40D7 EA BB C6 ld (C6BB),a ;(C6BB) = Current card Type ROM7:40DA 21 C5 54 ld hl,54C5 ROM7:40DD 09 add hl,bc ROM7:40DE 7E ld a,(hl) ROM7:40DF EA BC C6 ld (C6BC),a ;(C6BC) = Current card Cost ROM7:40E2 21 E6 57 ld hl,57E6 ROM7:40E5 09 add hl,bc ROM7:40E6 7E ld a,(hl) ROM7:40E7 EA BE C6 ld (C6BE),a ;(C6BE) = Current card Alignment ROM7:40EA 21 07 5B ld hl,5B07 ROM7:40ED 09 add hl,bc ROM7:40EE 7E ld a,(hl) ROM7:40EF EA BF C6 ld (C6BF),a ;(C6BF) = Current card Effect ID (magic trap ritual) ROM7:40F2 21 28 5E ld hl,5E28 ROM7:40F5 09 add hl,bc ROM7:40F6 7E ld a,(hl) ROM7:40F7 EA C0 C6 ld (C6C0),a ;(C6C0) = Current card Effect ID (monster) ROM7:40FA 21 48 61 ld hl,6148 ROM7:40FD 09 add hl,bc ROM7:40FE 7E ld a,(hl) ROM7:40FF EA BD C6 ld (C6BD),a ;(C6BD) = Current card Level ROM7:4102 CB 21 sla c ROM7:4104 CB 10 rl b ROM7:4106 21 78 44 ld hl,4478 ROM7:4109 09 add hl,bc ROM7:410A 2A ldi a,(hl) ROM7:410B 56 ld d,(hl) ROM7:410C 5F ld e,a ROM7:410D 7B ld a,e ROM7:410E EA B7 C6 ld (C6B7),a ;(C6B7) = Current card ATK ROM7:4111 7A ld a,d ROM7:4112 EA B8 C6 ld (C6B8),a ROM7:4115 21 BA 4A ld hl,4ABA ROM7:4118 09 add hl,bc ROM7:4119 2A ldi a,(hl) ROM7:411A 56 ld d,(hl) ROM7:411B 5F ld e,a ROM7:411C 7B ld a,e ROM7:411D EA B9 C6 ld (C6B9),a ;(C6B9) = Current card DEF ROM7:4120 7A ld a,d ROM7:4121 EA BA C6 ld (C6BA),a ROM7:4124 E1 pop hl ROM7:4125 D1 pop de ROM7:4126 C1 pop bc ROM7:4127 F1 pop af ROM7:4128 C9 ret
Retrieve Construction card data
0x1C13A-0x1C1E0
- Retrieves Construction cards data
ROM7:4129 F5 push af ROM7:412A C5 push bc ROM7:412B E5 push hl ROM7:412C 79 ld a,c ROM7:412D EA B3 C6 ld (C6B3),a ;store card_id in wC6B3 ROM7:4130 78 ld a,b ROM7:4131 EA B4 C6 ld (C6B4),a ROM7:4134 CD B5 1E call 1EB5 ;Fixed PRNG - uses card_id as seed ROM7:4137 CF rst 08 ROM7:4138 9D 01 => pointer 1:409D, function 1:4B41 ROM7:413A 3E 00 ld a,00 ROM7:413C EA 59 C8 ld (C859),a ROM7:413F 3E 13 ld a,13 ROM7:4141 EA 5A C8 ld (C85A),a ;Type ID is between 0x00 and 0x13 ROM7:4144 CD 48 1F call 1F48 ;Generates Construction Card data ROM7:4147 FA 5B C8 ld a,(C85B) ROM7:414A EA BB C6 ld (C6BB),a ;Card Type ROM7:414D 3E 14 ld a,14 ROM7:414F EA 59 C8 ld (C859),a ROM7:4152 3E 28 ld a,28 ROM7:4154 EA 5A C8 ld (C85A),a ;Cost is between 20 and 40 ROM7:4157 CD 48 1F call 1F48 ;Generates Construction Card data ROM7:415A FA 5B C8 ld a,(C85B) ROM7:415D EA BC C6 ld (C6BC),a ;Card Cost ROM7:4160 3E 00 ld a,00 ROM7:4162 EA 59 C8 ld (C859),a ROM7:4165 3E 09 ld a,09 ROM7:4167 EA 5A C8 ld (C85A),a ;Alignment ID is between 0 and 9 ROM7:416A CD 48 1F call 1F48 ;Generates Construction Card data ROM7:416D FA 5B C8 ld a,(C85B) ROM7:4170 EA BE C6 ld (C6BE),a ;Card Alignment ROM7:4173 3E 02 ld a,02 ROM7:4175 EA BF C6 ld (C6BF),a ;Card Effect ID (Magic Trap) ROM7:4178 3E 00 ld a,00 ROM7:417A EA C0 C6 ld (C6C0),a ;Card Effect ID (Monster) ROM7:417D 3E 00 ld a,00 ROM7:417F EA B7 C6 ld (C6B7),a ;Card ATK - last two decimals ROM7:4182 3E 00 ld a,00 ROM7:4184 EA 59 C8 ld (C859),a ROM7:4187 3E 11 ld a,11 ROM7:4189 EA 5A C8 ld (C85A),a ;There are 18 values in the ATK / Def array ROM7:418C CD 48 1F call 1F48 ;Generates Construction Card data ROM7:418F 06 00 ld b,00 ROM7:4191 FA 5B C8 ld a,(C85B) ROM7:4194 4F ld c,a ROM7:4195 21 E1 41 ld hl,41E1 ROM7:4198 09 add hl,bc ;hl = pointer to the selected ATK ROM7:4199 7E ld a,(hl) ROM7:419A EA B8 C6 ld (C6B8),a ;Card ATK - first two decimals ROM7:419D 3E 00 ld a,00 ROM7:419F EA B9 C6 ld (C6B9),a ;Card DEF - last two decimals ROM7:41A2 3E 00 ld a,00 ROM7:41A4 EA 59 C8 ld (C859),a ROM7:41A7 3E 11 ld a,11 ROM7:41A9 EA 5A C8 ld (C85A),a ROM7:41AC CD 48 1F call 1F48 ;Generates Construction Card data ROM7:41AF 06 00 ld b,00 ROM7:41B1 FA 5B C8 ld a,(C85B) ROM7:41B4 4F ld c,a ROM7:41B5 21 E1 41 ld hl,41E1 ROM7:41B8 09 add hl,bc ;hl = pointer to the selected DEF ROM7:41B9 7E ld a,(hl) ROM7:41BA EA BA C6 ld (C6BA),a ;Card DEF - first two decimals ROM7:41BD 3E 00 ld a,00 ROM7:41BF EA B9 C6 ld (C6B9),a ;Card DEF - last two decimals (sic) ROM7:41C2 3E 00 ld a,00 ROM7:41C4 EA 59 C8 ld (C859),a ROM7:41C7 3E 02 ld a,02 ROM7:41C9 EA 5A C8 ld (C85A),a ;There are 3 values in the Level array ROM7:41CC CD 48 1F call 1F48 ;Generates Construction Card data ROM7:41CF 06 00 ld b,00 ROM7:41D1 FA 5B C8 ld a,(C85B) ROM7:41D4 4F ld c,a ROM7:41D5 21 F3 41 ld hl,41F3 ROM7:41D8 09 add hl,bc ;hl = pointer to the selected card Level ROM7:41D9 7E ld a,(hl) ROM7:41DA EA BD C6 ld (C6BD),a ;Card Level ROM7:41DD E1 pop hl ROM7:41DE C1 pop bc ROM7:41DF F1 pop af ROM7:41E0 C9 ret
0x1C1E1-0x1C1F2
- Construction cards ATK / DEF
7:41E1 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
0x1C1F3-0x1C1F5
- Construction cards Levels
7:41F3 03 04 05
Initialize current card data
ROM7:41F6 F5 push af ROM7:41F7 79 ld a,c ROM7:41F8 EA B3 C6 ld (C6B3),a ;card_ID = bc ROM7:41FB 78 ld a,b ROM7:41FC EA B4 C6 ld (C6B4),a ROM7:41FF 3E 17 ld a,17 ROM7:4201 EA BB C6 ld (C6BB),a ;card_Type = 0x17 (none) ROM7:4204 3E 00 ld a,00 ROM7:4206 EA BC C6 ld (C6BC),a ;card_Cost = 0 ROM7:4209 3E 0B ld a,0B ROM7:420B EA BE C6 ld (C6BE),a ;card_Alignment = 0xB (non-monster) ROM7:420E 3E 02 ld a,02 ROM7:4210 EA BF C6 ld (C6BF),a ;card_Effect_magic = 0x2 (non-magic) ROM7:4213 3E FF ld a,FF ROM7:4215 EA B7 C6 ld (C6B7),a ;card_ATK = 0xFFFF ROM7:4218 3E FF ld a,FF ROM7:421A EA B8 C6 ld (C6B8),a ROM7:421D 3E FF ld a,FF ROM7:421F EA B9 C6 ld (C6B9),a ;card_DEF = 0xFFFF ROM7:4222 3E FF ld a,FF ROM7:4224 EA BA C6 ld (C6BA),a ROM7:4227 F1 pop af ROM7:4228 C9 ret
Stat Level
Apply Stat Level
ROM7:4229 F5 push af ROM7:422A C5 push bc ROM7:422B E5 push hl ROM7:422C 06 00 ld b,00 ROM7:422E 4F ld c,a ROM7:422F CB 21 sla c ROM7:4231 21 41 42 ld hl,4241 ROM7:4234 09 add hl,bc ROM7:4235 2A ldi a,(hl) ROM7:4236 66 ld h,(hl) ROM7:4237 6F ld l,a ROM7:4238 01 3D 42 ld bc,423D ROM7:423B C5 push bc ROM7:423C E9 jp hl ROM7:423D E1 pop hl ROM7:423E C1 pop bc ROM7:423F F1 pop af ROM7:4240 C9 ret
Pointers to Stat Levels
ROM7:4241 49 42 - Stat Level -1 74 42 - Stat Level 0 75 42 - Stat Level +1 A0 42 - Stat Level +2
Stat Level -1
ROM7:4249 F5 push af ROM7:424A C5 push bc ROM7:424B FA B7 C6 ld a,(C6B7) ROM7:424E 4F ld c,a ROM7:424F FA B8 C6 ld a,(C6B8) ROM7:4252 47 ld b,a ;bc = card_ATK ROM7:4253 CD E3 43 call 43E3 ;ATK -500 ROM7:4256 79 ld a,c ROM7:4257 EA B7 C6 ld (C6B7),a ;card_ATK ROM7:425A 78 ld a,b ROM7:425B EA B8 C6 ld (C6B8),a ROM7:425E FA B9 C6 ld a,(C6B9) ROM7:4261 4F ld c,a ROM7:4262 FA BA C6 ld a,(C6BA) ROM7:4265 47 ld b,a ;bc = card_DEF ROM7:4266 CD E3 43 call 43E3 ;DEF -500 ROM7:4269 79 ld a,c ROM7:426A EA B9 C6 ld (C6B9),a ROM7:426D 78 ld a,b ROM7:426E EA BA C6 ld (C6BA),a ;card_DEF ROM7:4271 C1 pop bc ROM7:4272 F1 pop af ROM7:4273 C9 ret
Stat Level 0
ROM7:4274 C9 ret
Stat Level +1
ROM7:4275 F5 push af ROM7:4276 C5 push bc ROM7:4277 FA B7 C6 ld a,(C6B7) ROM7:427A 4F ld c,a ROM7:427B FA B8 C6 ld a,(C6B8) ROM7:427E 47 ld b,a ;bc = card_ATK ROM7:427F CD CF 43 call 43CF ;ATK +500 ROM7:4282 79 ld a,c ROM7:4283 EA B7 C6 ld (C6B7),a ;card_ATK ROM7:4286 78 ld a,b ROM7:4287 EA B8 C6 ld (C6B8),a ROM7:428A FA B9 C6 ld a,(C6B9) ROM7:428D 4F ld c,a ROM7:428E FA BA C6 ld a,(C6BA) ROM7:4291 47 ld b,a ;bc = card_DEF ROM7:4292 CD CF 43 call 43CF ;DEF +500 ROM7:4295 79 ld a,c ROM7:4296 EA B9 C6 ld (C6B9),a ;card_DEF ROM7:4299 78 ld a,b ROM7:429A EA BA C6 ld (C6BA),a ROM7:429D C1 pop bc ROM7:429E F1 pop af ROM7:429F C9 ret
Stat Level +2
ROM7:42A0 F5 push af ROM7:42A1 C5 push bc ROM7:42A2 FA B7 C6 ld a,(C6B7) ROM7:42A5 4F ld c,a ROM7:42A6 FA B8 C6 ld a,(C6B8) ROM7:42A9 47 ld b,a ;bc = card_ATK ROM7:42AA CD CF 43 call 43CF ;ATK +500 ROM7:42AD CD CF 43 call 43CF ;ATK +500 ROM7:42B0 79 ld a,c ROM7:42B1 EA B7 C6 ld (C6B7),a ;card_ATK ROM7:42B4 78 ld a,b ROM7:42B5 EA B8 C6 ld (C6B8),a ROM7:42B8 FA B9 C6 ld a,(C6B9) ROM7:42BB 4F ld c,a ROM7:42BC FA BA C6 ld a,(C6BA) ROM7:42BF 47 ld b,a ;bc = card_DEF ROM7:42C0 CD CF 43 call 43CF ;DEF +500 ROM7:42C3 CD CF 43 call 43CF ;DEF +500 ROM7:42C6 79 ld a,c ROM7:42C7 EA B9 C6 ld (C6B9),a ;card_DEF ROM7:42CA 78 ld a,b ROM7:42CB EA BA C6 ld (C6BA),a ROM7:42CE C1 pop bc ROM7:42CF F1 pop af ROM7:42D0 C9 ret
Stats bonus / malus
7:42D1
ROM7:42D1 F5 push af ROM7:42D2 D5 push de ROM7:42D3 E5 push hl ROM7:42D4 1E 04 ld e,04 ROM7:42D6 CB 38 srl b ROM7:42D8 CB 19 rr c ROM7:42DA 1D dec e ROM7:42DB 20 F9 jr nz,42D6 ;bc >> 4 ROM7:42DD 79 ld a,c ROM7:42DE 81 add c ROM7:42DF 27 daa ROM7:42E0 5F ld e,a ROM7:42E1 78 ld a,b ROM7:42E2 88 adc b ROM7:42E3 27 daa ROM7:42E4 57 ld d,a ROM7:42E5 7B ld a,e ROM7:42E6 81 add c ROM7:42E7 27 daa ROM7:42E8 4F ld c,a ROM7:42E9 7A ld a,d ROM7:42EA 88 adc b ROM7:42EB 27 daa ROM7:42EC 47 ld b,a ;bc × 3 ROM7:42ED 60 ld h,b ROM7:42EE 69 ld l,c ROM7:42EF 7D ld a,l ROM7:42F0 81 add c ROM7:42F1 27 daa ROM7:42F2 4F ld c,a ROM7:42F3 7C ld a,h ROM7:42F4 88 adc b ROM7:42F5 27 daa ROM7:42F6 47 ld b,a ;bc × 2 ROM7:42F7 E1 pop hl ROM7:42F8 D1 pop de ROM7:42F9 F1 pop af ROM7:42FA C9 ret
7:42FB
ROM7:42FB F5 push af ROM7:42FC D5 push de ROM7:42FD E5 push hl ROM7:42FE 1E 04 ld e,04 ROM7:4300 CB 38 srl b ROM7:4302 CB 19 rr c ROM7:4304 1D dec e ROM7:4305 20 F9 jr nz,4300 ;bc >> 4 ROM7:4307 50 ld d,b ROM7:4308 59 ld e,c ROM7:4309 2E 03 ld l,03 ROM7:430B 7B ld a,e ROM7:430C 83 add e ROM7:430D 27 daa ROM7:430E 5F ld e,a ROM7:430F 7A ld a,d ROM7:4310 8A adc d ROM7:4311 27 daa ROM7:4312 57 ld d,a ROM7:4313 2D dec l ROM7:4314 20 F5 jr nz,430B ROM7:4316 62 ld h,d ROM7:4317 6B ld l,e ROM7:4318 7D ld a,l ROM7:4319 91 sub c ROM7:431A 27 daa ROM7:431B 4F ld c,a ROM7:431C 7C ld a,h ROM7:431D 98 sbc b ROM7:431E 27 daa ROM7:431F 47 ld b,a ;bc × 7 ROM7:4320 E1 pop hl ROM7:4321 D1 pop de ROM7:4322 F1 pop af ROM7:4323 C9 ret
Stat NOP
ROM7:4324 C9 ret
7:4325
ROM7:4325 F5 push af ROM7:4326 D5 push de ROM7:4327 E5 push hl ROM7:4328 E8 FD add sp,FD ROM7:432A F8 00 ld hl,sp+00 ROM7:432C AF xor a ROM7:432D 22 ldi (hl),a ;free 3 bytes in stack ROM7:432E 22 ldi (hl),a ROM7:432F 77 ld (hl),a ROM7:4330 50 ld d,b ROM7:4331 59 ld e,cc ;de = bc ROM7:4332 2E 04 ld l,04 ROM7:4334 CB 38 srl b ROM7:4336 CB 19 rr c ROM7:4338 2D dec l ROM7:4339 20 F9 jr nz,4334 ;bc >> 4 ROM7:433B F8 00 ld hl,sp+00 ROM7:433D 79 ld a,c ROM7:433E 81 add c ROM7:433F 27 daa ROM7:4340 22 ldi (hl),a ROM7:4341 78 ld a,b ROM7:4342 88 adc b ROM7:4343 27 daa ROM7:4344 22 ldi (hl),a ROM7:4345 3E 00 ld a,00 ROM7:4347 CE 00 adc a,00 ROM7:4349 27 daa ROM7:434A 22 ldi (hl),a ROM7:434B F8 00 ld hl,sp+00 ROM7:434D 7E ld a,(hl) ROM7:434E 81 add c ROM7:434F 27 daa ROM7:4350 22 ldi (hl),a ROM7:4351 7E ld a,(hl) ROM7:4352 88 adc b ROM7:4353 27 daa ROM7:4354 22 ldi (hl),a ROM7:4355 7E ld a,(hl) ROM7:4356 CE 00 adc a,00 ROM7:4358 27 daa ROM7:4359 22 ldi (hl),a ROM7:435A F8 00 ld hl,sp+00 ROM7:435C 2A ldi a,(hl) ROM7:435D 83 add e ROM7:435E 27 daa ROM7:435F 4F ld c,a ROM7:4360 2A ldi a,(hl) ROM7:4361 8A adc d ROM7:4362 27 daa ROM7:4363 47 ld b,a ROM7:4364 2A ldi a,(hl) ROM7:4365 CE 00 adc a,00 ROM7:4367 27 daa ROM7:4368 FE 00 cp a,00 ROM7:436A 28 03 jr z,436F ROM7:436C 01 99 99 ld bc,9999 ;Max Stat is 9999 ROM7:436F E8 03 add sp,03 ROM7:4371 E1 pop hl ROM7:4372 D1 pop de ROM7:4373 F1 pop af ROM7:4374 C9 ret
7:4375
ROM7:4375 F5 push af ROM7:4376 D5 push de ROM7:4377 E5 push hl ROM7:4378 E8 FD add sp,FD ROM7:437A F8 00 ld hl,sp+00 ROM7:437C AF xor a ROM7:437D 22 ldi (hl),a ;free 3 bytes in stack ROM7:437E 22 ldi (hl),a ROM7:437F 77 ld (hl),a ROM7:4380 50 ld d,b ROM7:4381 59 ld e,c ;de = bc ROM7:4382 2E 04 ld l,04 ;l = 4 ROM7:4384 CB 38 srl b ROM7:4386 CB 19 rr c ROM7:4388 2D dec l ROM7:4389 20 F9 jr nz,4384 ;bc >> 4 ROM7:438B F8 00 ld hl,sp+00 ROM7:438D 79 ld a,c ROM7:438E 81 add c ROM7:438F 27 daa ROM7:4390 4F ld c,a ROM7:4391 78 ld a,b ROM7:4392 88 adc b ROM7:4393 27 daa ROM7:4394 47 ld b,a ROM7:4395 F8 00 ld hl,sp+00 ROM7:4397 79 ld a,c ROM7:4398 81 add c ROM7:4399 27 daa ROM7:439A 22 ldi (hl),a ROM7:439B 78 ld a,b ROM7:439C 88 adc b ROM7:439D 27 daa ROM7:439E 22 ldi (hl),a ROM7:439F 3E 00 ld a,00 ROM7:43A1 CE 00 adc a,00 ROM7:43A3 27 daa ROM7:43A4 22 ldi (hl),a ROM7:43A5 F8 00 ld hl,sp+00 ROM7:43A7 7E ld a,(hl) ROM7:43A8 81 add c ROM7:43A9 27 daa ROM7:43AA 22 ldi (hl),a ROM7:43AB 7E ld a,(hl) ROM7:43AC 88 adc b ROM7:43AD 27 daa ROM7:43AE 22 ldi (hl),a ROM7:43AF 7E ld a,(hl) ROM7:43B0 CE 00 adc a,00 ROM7:43B2 27 daa ROM7:43B3 22 ldi (hl),a ROM7:43B4 F8 00 ld hl,sp+00 ROM7:43B6 2A ldi a,(hl) ROM7:43B7 83 add e ROM7:43B8 27 daa ROM7:43B9 4F ld c,a ROM7:43BA 2A ldi a,(hl) ROM7:43BB 8A adc d ROM7:43BC 27 daa ROM7:43BD 47 ld b,a ROM7:43BE 2A ldi a,(hl) ROM7:43BF CE 00 adc a,00 ROM7:43C1 27 daa ROM7:43C2 FE 00 cp a,00 ROM7:43C4 28 03 jr z,43C9 ROM7:43C6 01 99 99 ld bc,9999 ROM7:43C9 E8 03 add sp,03 ROM7:43CB E1 pop hl ROM7:43CC D1 pop de ROM7:43CD F1 pop af ROM7:43CE C9 ret
ATK and DEF +500
ROM7:43CF F5 push af ROM7:43D0 79 ld a,c ROM7:43D1 C6 00 add a,00 ROM7:43D3 27 daa ROM7:43D4 4F ld c,a ROM7:43D5 78 ld a,b ROM7:43D6 CE 05 adc a,05 ROM7:43D8 27 daa ROM7:43D9 47 ld b,a ;ATK +500, DEF +500 ROM7:43DA FE 00 cp a,00 ROM7:43DC 20 03 jr nz,43E1 ROM7:43DE 01 99 99 ld bc,9999 ;ATK / DEF can't go over 9999 ROM7:43E1 F1 pop af ROM7:43E2 C9 ret
ATK and DEF -500
ROM7:43E3 F5 push af ROM7:43E4 79 ld a,c ROM7:43E5 D6 00 sub a,00 ROM7:43E7 27 daa ROM7:43E8 4F ld c,a ROM7:43E9 78 ld a,b ROM7:43EA DE 05 sbc a,05 ROM7:43EC 27 daa ROM7:43ED 47 ld b,a ;ATK -500, DEF -500 ROM7:43EE 30 03 jr nc,43F3 ROM7:43F0 01 00 00 ld bc,0000 ;ATK / DEF can't go below 0 ROM7:43F3 F1 pop af ROM7:43F4 C9 ret
Field ATK bonus
0x1C3F5-0x1C41E
- Apply Field effect to the ATK and stock it in RAM at 0xC6B7
ROM7:43F5 F5 push af ROM7:43F6 C5 push bc ROM7:43F7 D5 push de ROM7:43F8 E5 push hl ROM7:43F9 5F ld e,a ROM7:43FA FA B7 C6 ld a,(C6B7) ROM7:43FD 4F ld c,a ROM7:43FE FA B8 C6 ld a,(C6B8) ROM7:4401 47 ld b,a ;bc = Original ATK ROM7:4402 16 00 ld d,00 ROM7:4404 CB 23 sla e ROM7:4406 21 1F 44 ld hl,441F ROM7:4409 19 add hl,de ROM7:440A 2A ldi a,(hl) ROM7:440B 66 ld h,(hl) ROM7:440C 6F ld l,a ROM7:440D 11 12 44 ld de,4412 ROM7:4410 D5 push de ROM7:4411 E9 jp hl ;Jump to -30% or +30% ROM7:4412 79 ld a,c ROM7:4413 EA B7 C6 ld (C6B7),a ;Stores updated ATK to (C6B7) ROM7:4416 78 ld a,b ROM7:4417 EA B8 C6 ld (C6B8),a ROM7:441A E1 pop hl ROM7:441B D1 pop de ROM7:441C C1 pop bc ROM7:441D F1 pop af ROM7:441E C9 ret
Field bonus pointers
0x1C41F-0x1C428
- Field bonus pointers
ROM7:441F FB 42 FB 42 24 43 25 43 25 43
Field DEF bonus
0x1C429-0x1C452
- Apply Field effect to the DEF and stock it in RAM at 0xC6B9
ROM7:4429 F5 push af ROM7:442A C5 push bc ROM7:442B D5 push de ROM7:442C E5 push hl ROM7:442D 5F ld e,a ROM7:442E FA B9 C6 ld a,(C6B9) ROM7:4431 4F ld c,a ROM7:4432 FA BA C6 ld a,(C6BA) ROM7:4435 47 ld b,a ;bc = Original DEF ROM7:4436 16 00 ld d,00 ROM7:4438 CB 23 sla e ROM7:443A 21 1F 44 ld hl,441F ROM7:443D 19 add hl,de ROM7:443E 2A ldi a,(hl) ROM7:443F 66 ld h,(hl) ROM7:4440 6F ld l,a ROM7:4441 11 46 44 ld de,4446 ROM7:4444 D5 push de ROM7:4445 E9 jp hl ;Jump to -30% or +30% ROM7:4446 79 ld a,c ROM7:4447 EA B9 C6 ld (C6B9),a ;Stores updated DEF to (C6B7) ROM7:444A 78 ld a,b ROM7:444B EA BA C6 ld (C6BA),a ROM7:444E E1 pop hl ROM7:444F D1 pop de ROM7:4450 C1 pop bc ROM7:4451 F1 pop af ROM7:4452 C9 ret
Field - load load Bonus / Penalty to card Type
ROM7:4453 C5 push bc ROM7:4454 E5 push hl ROM7:4455 C5 push bc ROM7:4456 48 ld c,b ROM7:4457 06 00 ld b,00 ROM7:4459 CB 21 sla c ROM7:445B 21 6A 44 ld hl,446A ROM7:445E 09 add hl,bc ROM7:445F 2A ldi a,(hl) ROM7:4460 66 ld h,(hl) ROM7:4461 6F ld l,a ROM7:4462 C1 pop bc ROM7:4463 06 00 ld b,00 ROM7:4465 09 add hl,bc ROM7:4466 7E ld a,(hl) ROM7:4467 E1 pop hl ROM7:4468 C1 pop bc ROM7:4469 C9 ret
7:446A pointers array
ROM7:446A 50FC - 5114 - 512C - 5144 - 515C - 5174 - 518C -
Cards effects AI
0x1C466
- Copy the effect cards pointer of the card currently tested by the CPU0x1C46A-0x1C477
- Effect cards pointers
Cards data
Cards ATK
0x1C47A-0x1CAB9
- Cards ATK
Cards DEF
0x1CABC-0x1D0FB
- Cards DEF
Field type bonus arrays
0x1D0FC-0x1D1A3
- Field type bonus arrays
Arena bonus
02 - Dragon 02 - Magician 02 - Zombie 02 - Warrior 02 - BeastWar 02 - Beast 02 - WngBeast 02 - Fiend 02 - Fairy 02 - Insect 02 - Dinosaur 02 - Reptile 02 - Fish 02 - SeaDragn 02 - Machine 02 - Thunder 02 - Aqua 02 - Pyro 02 - Rock 02 - Plant 02 - Magic 02 - Trap 02 - Ritual 02 -
Forest bonus
02 - Dragon 02 - Magician 02 - Zombie 02 - Warrior 03 - BeastWar 03 - Beast 02 - WngBeast 02 - Fiend 02 - Fairy 03 - Insect 02 - Dinosaur 02 - Reptile 02 - Fish 02 - SeaDragn 02 - Machine 02 - Thunder 02 - Aqua 02 - Pyro 02 - Rock 03 - Plant 02 - Magic 02 - Trap 02 - Ritual 02 -
Wasteland bonus
02 - 02 - 03 - Zombie 02 - 02 - 02 - 02 - 02 - 02 - 02 - 03 - Dinosaur 02 - 02 - 02 - 02 - 02 - 02 - 02 - 03 - Rock 02 - 02 - 02 - 02 - 02 -
Mountain bonus
03 - Dragon 02 - 02 - 02 - 02 - 02 - 03 - WngBeast 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 03 - Thunder 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 -
Sogen bonus
02 - 02 - 02 - 03 - Warrior 03 - BeastWar 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 -
Umi bonus
02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 03 - Fish 03 - SeaDragn 01 - Machine 03 - Thunder 03 - Aqua 01 - Pyro 02 - 02 - 02 - 02 - 02 - 02 -
Yami bonus
0x1D18C-0x1D1A3
02 - 03 - Magician 02 - 02 - 02 - 02 - 02 - 03 - Fiend 01 - Fairy 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 - 02 -
Cards Types
0x1D1A5-0x1D4C4
- Cards Types
Cards Costs
0x1D4C6-0x1D7E5
- Cards Costs
Cards Alignments
0x1D7E7-0x1DB06
- Card Alignments
Cards Effects IDs (Magic, Rituals and Traps)
0x1DB08-0x1DE27
- Cards Effects IDs (Magic, Rituals and Traps)
Cards Effects IDs (Effect Monsters)
0x1DE29-0x1E148
- Cards Effects IDs (Effect Monsters)
Cards Levels
0x1E149-0x1E468
- Cards Levels
Monster Equipment
Monster Equip subroutine
0x1E469-0x1E480
- Equip a Monster
ROM7:6469 D5 push de ROM7:646A E5 push hl ROM7:646B 5A ld e,d ROM7:646C 16 00 ld d,00 ;de = Equip ID ROM7:646E CB 23 sla e ROM7:6470 CB 12 rl d ROM7:6472 21 81 64 ld hl,6481 ROM7:6475 19 add hl,de ROM7:6476 2A ldi a,(hl) ROM7:6477 66 ld h,(hl) ROM7:6478 6F ld l,a ROM7:6479 11 7E 64 ld de,647E ROM7:647C D5 push de ROM7:647D E9 jp hl ROM7:647E E1 pop hl ROM7:647F D1 pop de ROM7:6480 C9 ret
Monster Equip functions pointers
ROM7:6481 C1 64 - Legendary Sword CA 64 - Sword of Ruin D3 64 - Dark Energy DC 64 - Axe of Despair E5 64 - Lazer Cannon Armor EE 64 - Insect Armor with Laser Cannon F7 64 - Elf's Light 00 65 - Beast Fangs 09 65 - Steel Shell 12 65 - Vile Germs 1B 65 - Black Pendant 24 65 - Silver Bow & Arrow 2D 65 - Horn of Light 36 65 - Horn of the Unicorn 3F 65 - Dragon Treasure 48 65 - Electro-whip 51 65 - Cyber Shield 5A 65 - Mystical Moon 63 65 - Malevolent Nuzzler 6C 65 - Violet Crystal 75 65 - Book of Secret Art 7E 65 - Invigoration 87 65 - Machine Conversion 90 65 - Raise Body Heat 99 65 - Follow Wind A2 65 - Power of Kaishin AB 65 - Magical Labyrinth B4 65 - Salamandra BD 65 - Kunai with Chain C6 65 - Bright Castle D9 65 - Megamorph F2 65 - Winged Trumpeter
Equip Legendary Sword
ROM7:64C1 E5 push hl ROM7:64C2 21 2E 66 ld hl,662E ROM7:64C5 CD 05 66 call 6605 ROM7:64C8 E1 pop hl ROM7:64C9 C9 ret
Equip Sword of Ruin
ROM7:64CA E5 push hl ROM7:64CB 21 C4 66 ld hl,66C4 ROM7:64CE CD 05 66 call 6605 ROM7:64D1 E1 pop hl ROM7:64D2 C9 ret
Equip Dark Energy
ROM7:64D3 E5 push hl ROM7:64D4 21 50 67 ld hl,6750 ROM7:64D7 CD 05 66 call 6605 ROM7:64DA E1 pop hl ROM7:64DB C9 ret
Equip Axe of Despair
ROM7:64DC E5 push hl ROM7:64DD 21 D6 69 ld hl,69D6 ROM7:64E0 CD 05 66 call 6605 ROM7:64E3 E1 pop hl ROM7:64E4 C9 ret
Equip Lazer Cannon Armor
ROM7:64E5 E5 push hl ROM7:64E6 21 86 6A ld hl,6A86 ROM7:64E9 CD 05 66 call 6605 ROM7:64EC E1 pop hl ROM7:64ED C9 ret
Equip Insect Armor with Laser Cannon
ROM7:64EE E5 push hl ROM7:64EF 21 BC 6B ld hl,6BBC ROM7:64F2 CD 05 66 call 6605 ROM7:64F5 E1 pop hl ROM7:64F6 C9 ret
Equip Elf's Light
ROM7:64F7 E5 push hl ROM7:64F8 21 AC 6C ld hl,6CAC ROM7:64FB CD 05 66 call 6605 ROM7:64FE E1 pop hl ROM7:64FF C9 ret
Equip Beast Fangs
ROM7:6500 E5 push hl ROM7:6501 21 58 6D ld hl,6D58 ROM7:6504 CD 05 66 call 6605 ROM7:6507 E1 pop hl ROM7:6508 C9 ret
Equip Steel Shell
ROM7:6509 E5 push hl ROM7:650A 21 36 6F ld hl,6F36 ROM7:650D CD 05 66 call 6605 ROM7:6510 E1 pop hl ROM7:6511 C9 ret
Equip Vile Germs
ROM7:6512 E5 push hl ROM7:6513 21 5E 6F ld hl,6F5E ROM7:6516 CD 05 66 call 6605 ROM7:6519 E1 pop hl ROM7:651A C9 ret
Equip Black Pendant
ROM7:651B E5 push hl ROM7:651C 21 9C 6F ld hl,6F9C ROM7:651F CD 05 66 call 6605 ROM7:6522 E1 pop hl ROM7:6523 C9 ret
Equip Silver Bow & Arrow
ROM7:6524 E5 push hl ROM7:6525 21 B0 70 ld hl,70B0 ROM7:6528 CD 05 66 call 6605 ROM7:652B E1 pop hl ROM7:652C C9 ret
Equip Horn of Light
ROM7:652D E5 push hl ROM7:652E 21 42 71 ld hl,7142 ROM7:6531 CD 05 66 call 6605 ROM7:6534 E1 pop hl ROM7:6535 C9 ret
Equip Horn of the Unicorn
ROM7:6536 E5 push hl ROM7:6537 21 C2 71 ld hl,71C2 ROM7:653A CD 05 66 call 6605 ROM7:653D E1 pop hl ROM7:653E C9 ret
Equip Dragon Treasure
ROM7:653F E5 push hl ROM7:6540 21 8E 72 ld hl,728E ROM7:6543 CD 05 66 call 6605 ROM7:6546 E1 pop hl ROM7:6547 C9 ret
Equip Electro-whip
ROM7:6548 E5 push hl ROM7:6549 21 36 73 ld hl,7336 ROM7:654C CD 05 66 call 6605 ROM7:654F E1 pop hl ROM7:6550 C9 ret
Equip Cyber Shield
ROM7:6551 E5 push hl ROM7:6552 21 14 74 ld hl,7414 ROM7:6555 CD 05 66 call 6605 ROM7:6558 E1 pop hl ROM7:6559 C9 ret
Equip Mystical Moon
ROM7:655A E5 push hl ROM7:655B 21 92 74 ld hl,7492 ROM7:655E CD 05 66 call 6605 ROM7:6561 E1 pop hl ROM7:6562 C9 ret
Equip Malevolent Nuzzler
ROM7:6563 E5 push hl ROM7:6564 21 62 75 ld hl,7562 ROM7:6567 CD 05 66 call 6605 ROM7:656A E1 pop hl ROM7:656B C9 ret
Equip Violet Crystal
ROM7:656C E5 push hl ROM7:656D 21 98 76 ld hl,7698 ROM7:6570 CD 05 66 call 6605 ROM7:6573 E1 pop hl ROM7:6574 C9 ret
Equip Book of Secret Art
ROM7:6575 E5 push hl ROM7:6576 21 4A 77 ld hl,774A ROM7:6579 CD 05 66 call 6605 ROM7:657C E1 pop hl ROM7:657D C9 ret
Equip Invigoration
ROM7:657E E5 push hl ROM7:657F 21 08 78 ld hl,7808 ROM7:6582 CD 05 66 call 6605 ROM7:6585 E1 pop hl ROM7:6586 C9 ret
Equip Machine Conversion
ROM7:6587 E5 push hl ROM7:6588 21 06 79 ld hl,7906 ROM7:658B CD 05 66 call 6605 ROM7:658E E1 pop hl ROM7:658F C9 ret
Equip Raise Body Heat
ROM7:6590 E5 push hl ROM7:6591 21 94 79 ld hl,7994 ROM7:6594 CD 05 66 call 6605 ROM7:6597 E1 pop hl ROM7:6598 C9 ret
Equip Follow Wind
ROM7:6599 E5 push hl ROM7:659A 21 7C 7A ld hl,7A7C ROM7:659D CD 05 66 call 6605 ROM7:65A0 E1 pop hl ROM7:65A1 C9 ret
Equip Power of Kaishin
ROM7:65A2 E5 push hl ROM7:65A3 21 A4 7B ld hl,7BA4 ROM7:65A6 CD 05 66 call 6605 ROM7:65A9 E1 pop hl ROM7:65AA C9 ret
Equip Magical Labyrinth
ROM7:65AB E5 push hl ROM7:65AC 21 92 7C ld hl,7C92 ROM7:65AF CD 05 66 call 6605 ROM7:65B2 E1 pop hl ROM7:65B3 C9 ret
Equip Salamandra
ROM7:65B4 E5 push hl ROM7:65B5 21 AA 7D ld hl,7DAA ROM7:65B8 CD 05 66 call 6605 ROM7:65BB E1 pop hl ROM7:65BC C9 ret
Equip Kunai with Chain
ROM7:65BD E5 push hl ROM7:65BE 21 96 7C ld hl,7C96 ROM7:65C1 CD 05 66 call 6605 ROM7:65C4 E1 pop hl ROM7:65C5 C9 ret
Equip Bright Castle
ROM7:65C6 D5 push de ROM7:65C7 1E 00 ld e,00 ROM7:65C9 CD A0 40 call 40A0 ;Card Stats routine ROM7:65CC 16 01 ld d,01 ;Light ROM7:65CE FA BE C6 ld a,(C6BE) ;Current card Alignment ROM7:65D1 BA cp d ROM7:65D2 20 02 jr nz,65D6 ;If(Alignment ≠ Light), jump to 7:65D6 ROM7:65D4 1E 01 ld e,01 ROM7:65D6 7B ld a,e ROM7:65D7 D1 pop de ROM7:65D8 C9 ret
Equip Megamorph
ROM7:65D9 D5 push de ROM7:65DA 1E 00 ld e,00 ROM7:65DC CD 72 1A call 1A72 ROM7:65DF FE 00 cp a,00 ROM7:65E1 20 0C jr nz,65EF ROM7:65E3 CD A0 40 call 40A0 ;Card Stats routine ROM7:65E6 FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROM7:65E9 FE 02 cp a,02 ROM7:65EB 20 02 jr nz,65EF ;If not a Monster, jump to 7:65EF ROM7:65ED 1E 01 ld e,01 ROM7:65EF 7B ld a,e ROM7:65F0 D1 pop de ROM7:65F1 C9 ret
Equip Winged Trumpeter
ROM7:65F2 D5 push de ROM7:65F3 1E 00 ld e,00 ROM7:65F5 CD A0 40 call 40A0 ;Card Stats routine ROM7:65F8 16 08 ld d,08 ;Fairy ROM7:65FA FA BB C6 ld a,(C6BB) ;Current card Type ROM7:65FD BA cp d ROM7:65FE 20 02 jr nz,6602 ;If(Type ≠ Fairy), jump to 7:6602 ROM7:6600 1E 01 ld e,01 ROM7:6602 7B ld a,e ROM7:6603 D1 pop de ROM7:6604 C9 ret
7:6605
ROM7:6605 C5 push bc ROM7:6606 D5 push de ROM7:6607 E5 push hl ROM7:6608 2A ldi a,(hl) ROM7:6609 5F ld e,a ROM7:660A 2A ldi a,(hl) ROM7:660B 57 ld d,a ROM7:660C C5 push bc ROM7:660D 01 FF FF ld bc,FFFF ROM7:6610 CD 14 1B call 1B14 ;Checks if 0xFFFF ≠ de ROM7:6613 C1 pop bc ROM7:6614 FE 00 cp a,00 ROM7:6616 20 04 jr nz,661C ROM7:6618 1E 00 ld e,00 ROM7:661A 18 0D jr 6629 ROM7:661C CD 14 1B call 1B14 ;Checks if bc ≠ de ROM7:661F FE 00 cp a,00 ROM7:6621 20 04 jr nz,6627 ROM7:6623 1E 01 ld e,01 ROM7:6625 18 02 jr 6629 ROM7:6627 18 DF jr 6608 ROM7:6629 7B ld a,e ROM7:662A E1 pop hl ROM7:662B D1 pop de ROM7:662C C1 pop bc ROM7:662D C9 ret
Equip Monster IDs arrays
0x1E62E-0x1FE5F
- Equip Monster IDs arrays, separated byFF FF
Legendary Sword array
Sword of Ruin array
Dark Energy array
Axe of Despair array
Lazer Cannon Armor array
Insect Armor with Laser Cannon array
Elf's Light array
Beast Fangs array
Steel Shell array
Vile Germs array
Black Pendant array
Silver Bow & Arrow array
Horn of Light array
Horn of the Unicorn array
Dragon Treasure array
Electro-whip array
Cyber Shield array
Mystical Moon array
Malevolent Nuzzler array
Violet Crystal array
Book of Secret Art array
Invigoration array
Machine Conversion array
Raise Body Heat array
Follow Wind array
Power of Kaishin array
Magical Labyrinth array
Kunai with Chain array
Salamandra array
Bright Castle old DM2 array (Unused)
01 00 02 00 21 00 29 00 2C 00 5A 00 6D 00 72 00 7D 00 7E 00 80 00 82 00 86 00 A5 00 AA 00 B7 00 C0 00 C6 00 D0 00 E5 00 04 01 08 01 14 01 1B 01 22 01 25 01 2B 01 66 01 7C 01 85 01 8B 01 8C 01 AB 01 AC 01 AD 01 B1 01 E6 01 EC 01 ED 01 EF 01 01 02 14 02 1C 02 46 02 48 02 50 02 59 02 5B 02 60 02 64 02 68 02 6E 02 79 02 BD 02 C0 02 C7 02 FF FF
Bank 8
rst 08 pointers
ROM8:4002 2C 40 47 40 7D 40 98 40 D8 40 15 45 45 45 1D 45 25 45 2D 45 35 45 3D 45 23 49 F8 52 18 53 8D 48 DF 48 01 49 EF 46 0B 46 25 46
8:402C
ROM8:402C F5 push af ROM8:402D C5 push bc ROM8:402E D5 push de ROM8:402F E5 push hl ROM8:4030 21 00 90 ld hl,9000 ROM8:4033 11 10 00 ld de,0010 ROM8:4036 3E 00 ld a,00 ROM8:4038 06 80 ld b,80 ROM8:403A CD 98 40 call 4098 ROM8:403D 19 add hl,de ROM8:403E 3C inc a ROM8:403F 05 dec b ROM8:4040 20 F8 jr nz,403A ROM8:4042 E1 pop hl ROM8:4043 D1 pop de ROM8:4044 C1 pop bc ROM8:4045 F1 pop af ROM8:4046 C9 ret
8:4047
ROM8:4047 F5 push af ROM8:4048 C5 push bc ROM8:4049 D5 push de ROM8:404A E5 push hl ROM8:404B 3E 05 ld a,05 ROM8:404D CD 24 12 call 1224 ;Switches to WRAM Bank 5 ROM8:4050 3E 7F ld a,7F ROM8:4052 CD 0F 11 call 110F ROM8:4055 3E 1E ld a,1E ROM8:4057 CD E3 0E call 0EE3 ROM8:405A 01 00 90 ld bc,9000 ROM8:405D CD D2 10 call 10D2 ROM8:4060 21 00 D0 ld hl,D000 ROM8:4063 11 10 00 ld de,0010 ROM8:4066 3E 00 ld a,00 ROM8:4068 06 80 ld b,80 ROM8:406A CD 98 40 call 4098 ROM8:406D 19 add hl,de ROM8:406E 3C inc a ROM8:406F 05 dec b ROM8:4070 20 F8 jr nz,406A ROM8:4072 CD C1 10 call 10C1 ROM8:4075 CD 48 12 call 1248 ROM8:4078 E1 pop hl ROM8:4079 D1 pop de ROM8:407A C1 pop bc ROM8:407B F1 pop af ROM8:407C C9 ret
8:407D
ROM8:407D F5 push af ROM8:407E C5 push bc ROM8:407F D5 push de ROM8:4080 E5 push hl ROM8:4081 21 60 8C ld hl,8C60 ROM8:4084 3E 01 ld a,01 ROM8:4086 11 10 00 ld de,0010 ROM8:4089 06 0A ld b,0A ROM8:408B CD 98 40 call 4098 ROM8:408E 19 add hl,de ROM8:408F 3C inc a ROM8:4090 05 dec b ROM8:4091 20 F8 jr nz,408B ROM8:4093 E1 pop hl ROM8:4094 D1 pop de ROM8:4095 C1 pop bc ROM8:4096 F1 pop af ROM8:4097 C9 ret
8:4098
ROM8:4098 F5 push af ROM8:4099 C5 push bc ROM8:409A D5 push de ROM8:409B E5 push hl ROM8:409C FE 7D cp a,7D ROM8:409E 30 1A jr nc,40BA ROM8:40A0 E5 push hl ROM8:40A1 6F ld l,a ROM8:40A2 26 00 ld h,00 ROM8:40A4 29 add hl,hl ROM8:40A5 29 add hl,hl ROM8:40A6 29 add hl,hl ROM8:40A7 11 FD 40 ld de,40FD ROM8:40AA 19 add hl,de ROM8:40AB 54 ld d,h ROM8:40AC 5D ld e,l ROM8:40AD E1 pop hl ROM8:40AE 0E 08 ld c,08 ROM8:40B0 1A ld a,(de) ROM8:40B1 22 ldi (hl),a ROM8:40B2 1A ld a,(de) ROM8:40B3 22 ldi (hl),a ROM8:40B4 13 inc de ROM8:40B5 0D dec c ROM8:40B6 20 F8 jr nz,40B0 ROM8:40B8 18 19 jr 40D3 ROM8:40BA E5 push hl ROM8:40BB D6 7D sub a,7D ROM8:40BD 6F ld l,a ROM8:40BE 26 00 ld h,00 ROM8:40C0 29 add hl,hl ROM8:40C1 29 add hl,hl ROM8:40C2 29 add hl,hl ROM8:40C3 29 add hl,hl ROM8:40C4 11 E5 44 ld de,44E5 ROM8:40C7 19 add hl,de ROM8:40C8 54 ld d,h ROM8:40C9 5D ld e,l ROM8:40CA E1 pop hl ROM8:40CB 0E 10 ld c,10 ROM8:40CD 1A ld a,(de) ROM8:40CE 22 ldi (hl),a ROM8:40CF 13 inc de ROM8:40D0 0D dec c ROM8:40D1 20 FA jr nz,40CD ROM8:40D3 E1 pop hl ROM8:40D4 D1 pop de ROM8:40D5 C1 pop bc ROM8:40D6 F1 pop af ROM8:40D7 C9 ret
8:40D8
ROM8:40D8 F5 push af ROM8:40D9 C5 push bc ROM8:40DA D5 push de ROM8:40DB E5 push hl ROM8:40DC E5 push hl ROM8:40DD 6F ld l,a ROM8:40DE 26 00 ld h,00 ROM8:40E0 29 add hl,hl ROM8:40E1 29 add hl,hl ROM8:40E2 29 add hl,hl ROM8:40E3 11 FD 40 ld de,40FD ROM8:40E6 19 add hl,de ROM8:40E7 54 ld d,h ROM8:40E8 5D ld e,l ROM8:40E9 E1 pop hl ROM8:40EA 0E 08 ld c,08 ROM8:40EC 1A ld a,(de) ROM8:40ED CD 13 11 call 1113 ROM8:40F0 1A ld a,(de) ROM8:40F1 CD 13 11 call 1113 ROM8:40F4 13 inc de ROM8:40F5 0D dec c ROM8:40F6 20 F4 jr nz,40EC ROM8:40F8 E1 pop hl ROM8:40F9 D1 pop de ROM8:40FA C1 pop bc ROM8:40FB F1 pop af ROM8:40FC C9 ret
Graphics 2
0x20100-0x20510
- Character table
8:4545 (Player's Name)
ROM8:4545 F5 push af ROM8:4546 C5 push bc ROM8:4547 D5 push de ROM8:4548 E5 push hl ROM8:4549 1E 00 ld e,00 ROM8:454B 57 ld d,a ROM8:454C FE 7D cp a,7D ROM8:454E 38 0D jr c,455D ;If(Character ID < 0x7D), jump to 8:455D ROM8:4550 06 00 ld b,00 ROM8:4552 D6 7D sub a,7D ;Character ID - 0x7D (No Japanese character allowed) ROM8:4554 07 rlca ROM8:4555 4F ld c,a ROM8:4556 21 A5 45 ld hl,45A5 ROM8:4559 09 add hl,bc ROM8:455A 2A ldi a,(hl) ROM8:455B 5F ld e,a ROM8:455C 56 ld d,(hl) ROM8:455D 7A ld a,d ROM8:455E FE 00 cp a,00 ROM8:4560 20 0B jr nz,456D ;If(Character ID ≠ 0x00), jump to 8:456D ROM8:4562 06 00 ld b,00 ROM8:4564 FA E5 C5 ld a,(C5E5) ROM8:4567 4F ld c,a ROM8:4568 21 85 45 ld hl,4585 ROM8:456B 09 add hl,bc ROM8:456C 56 ld d,(hl) ROM8:456D 7A ld a,d ROM8:456E EA E7 C5 ld (C5E7),a ;Store Character ID in (C5E7) ROM8:4571 FA E5 C5 ld a,(C5E5) ROM8:4574 83 add e ROM8:4575 5F ld e,a ROM8:4576 16 00 ld d,00 ROM8:4578 21 8D 45 ld hl,458D ROM8:457B 19 add hl,de ROM8:457C 7E ld a,(hl) ROM8:457D EA E6 C5 ld (C5E6),a ROM8:4580 E1 pop hl ROM8:4581 D1 pop de ROM8:4582 C1 pop bc ROM8:4583 F1 pop af ROM8:4584 C9 ret
CPU Exodia
CPU Exodia subroutine
ROM8:4625 F5 push af ROM8:4626 CD 71 46 call 4671 ;CPU Exodia subroutine ROM8:4629 FE 00 cp a,00 ROM8:462B 20 10 jr nz,463D ;If no Exodia win, jump to 8:463D ROM8:462D 3E 02 ld a,02 ROM8:462F EA 4C C8 ld (C84C),a ;(C84C) = 2 ROM8:4632 3E 05 ld a,05 ROM8:4634 EA AF C8 ld (C8AF),a ;(C8AF) = 5 ROM8:4637 CF rst 08 ... ROM8:463D F1 pop af ROM8:463E C9 ret
Checks CPU Exodia win
ROM8:4671 C5 push bc ROM8:4672 D5 push de ROM8:4673 06 00 ld b,00 ROM8:4675 0E 00 ld c,00 ROM8:4677 1E 00 ld e,00 ROM8:4679 78 ld a,b ROM8:467A FE 05 cp a,05 ROM8:467C 30 18 jr nc,4696 ROM8:467E CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4681 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:4684 C5 push bc ROM8:4685 FA A3 C7 ld a,(C7A3) ;Copy card being processed in bc ROM8:4688 4F ld c,a ROM8:4689 FA A4 C7 ld a,(C7A4) ROM8:468C 47 ld b,a ROM8:468D CD A3 46 call 46A3 ;Checks if Exodia parts are in CPU Hand ROM8:4690 B3 or e ROM8:4691 5F ld e,a ROM8:4692 C1 pop bc ROM8:4693 04 inc b ROM8:4694 18 E3 jr 4679 ROM8:4696 7B ld a,e ROM8:4697 FE 1F cp a,1F ROM8:4699 20 03 jr nz,469E ROM8:469B AF xor a ;If Exodia win, a = 0 ROM8:469C 18 02 jr 46A0 ROM8:469E 3E 01 ld a,01 ;Else a = 1 ROM8:46A0 D1 pop de ROM8:46A1 C1 pop bc ROM8:46A2 C9 ret
Checks if Exodia parts are in CPU Hand
ROM8:46A3 C5 push bc ROM8:46A4 D5 push de ROM8:46A5 E5 push hl ROM8:46A6 16 00 ld d,00 ROM8:46A8 1E 00 ld e,00 ROM8:46AA 21 D2 46 ld hl,46D2 ROM8:46AD 7B ld a,e ROM8:46AE FE 05 cp a,05 ROM8:46B0 30 1B jr nc,46CD ;Loop 5 times (for each card in Hand) ROM8:46B2 D5 push de ROM8:46B3 2A ldi a,(hl) ROM8:46B4 5F ld e,a ROM8:46B5 2A ldi a,(hl) ROM8:46B6 57 ld d,a ROM8:46B7 CD 14 1B call 1B14 ;Checks if card ID ≠ Exodia part ROM8:46BA D1 pop de ROM8:46BB FE 00 cp a,00 ROM8:46BD 20 0B jr nz,46CA ;If it's not an Exodia part, jump to 8:46CA ROM8:46BF E5 push hl ROM8:46C0 21 DC 46 ld hl,46DC ROM8:46C3 19 add hl,de ROM8:46C4 7E ld a,(hl) ROM8:46C5 E8 02 add sp,02 ROM8:46C7 18 05 jr 46CE ;If it is an Exodia part, a = Exodia part flag, and get out of this function ROM8:46C9 E1 pop hl ROM8:46CA 1C inc e ;Next card in hand ROM8:46CB 18 E0 jr 46AD ;Loop to 8:46AD ROM8:46CD AF xor a ;If no Exodia part in hand, a = 0 and get out of this function ROM8:46CE E1 pop hl ROM8:46CF D1 pop de ROM8:46D0 C1 pop bc ROM8:46D1 C9 ret
Exodia parts IDs array
ROM8:46D2 11 00 12 00 13 00 14 00 15 00
Exodia victory flags array
ROM8:46DC 01 02 04 08 10
Ritual Summon
Ritual Materials array
0x207BD-0x20884
- Ritual materials array, Monsters materials IDs and resulting Ritual Monster ID, in this order.
26 00 - 1B 00 - 3A 00 - 6C 01 - Black Luster Soldier 79 01 - 2A 01 - 55 00 - 68 01 - Zera the Mant 93 01 - C9 00 - E3 01 - 64 01 - Super War-lion 53 02 - 05 01 - BA 00 - 6D 01 - Fiend's Mirror 01 00 - Blue Eyes White Dragon 01 00 - Blue Eyes White Dragon 01 00 - Blue Eyes White Dragon 7C 01 - Blue Eyes Ultra Dragon 28 01 - FF 00 - 75 02 - 6A 01 - Millennium Shield 1D 00 - 1F 00 - 65 00 - 65 01 - Yamadron 73 01 - Sanga of the Thunder 74 01 - Kazejin 75 01 - Suijin 76 01 - Gate Guardian F9 00 - 8B 01 - FF 01 - BD 02 - Performance of Swords 27 01 - 0E 00 - 23 02 - BE 02 - Hungry Burger 03 00 - 40 00 - C5 01 - BF 02 - Sengenjin A0 00 - A1 00 - 17 02 - C0 02 - Skull Guardian 3B 02 - 2F 00 - 06 00 - C1 02 - Tri-Horned Dragon A8 00 - Darkfire Dragon 26 01 - (Unused) Dragoness the Wicked 5C 02 - (Unused) Obese Marmot of Nefariousness C2 02 - Serpent Night Dragon C1 01 - 59 00 - C3 01 - C6 02 - Crab Turtle 66 00 - B6 00 - DC 00 - D0 02 - Mask of Shine & Darkness 0D 01 - B2 00 - 20 01 - C5 02 - Chakra A6 00 - 95 01 - A0 01 - CB 02 - Psycho-Puppet 34 00 - E0 01 - 15 02 - CD 02 - Javelin Beetle 6D 02 - 7A 01 - EF 00 - CC 02 - Garma Sword 7E 02 - 7B 02 - 0A 01 - C4 02 - Cosmo Queen 92 00 - DF 01 - E5 01 - CF 02 - Dokurorider B9 01 - Mech Bass B4 01 - 1E 02 - CE 02 - Fortress Whale 23 00 - Dark Magician 07 00 - (Unused) Winged Dragon #1 DC 02 - (Unused) Jigen Bakudan D1 02 - Magician of Black Chaos DA 02 - Dark-eyes Illusionist DA 02 - (Unused) Dark-eyes Illusionist DA 02 - (Unused) Dark-eyes Illusionist DB 02 - Relinquished
Read Ritual Monster Material
ROM8:4901 F5 push af ROM8:4902 D5 push de ROM8:4903 E5 push hl ROM8:4904 16 00 ld d,00 ROM8:4906 58 ld e,b ROM8:4907 CB 23 sla e ROM8:4909 CB 12 rl d ROM8:490B CB 23 sla e ROM8:490D CB 12 rl d ROM8:490F CB 23 sla e ROM8:4911 CB 12 rl d ROM8:4913 21 BD 47 ld hl,47BD ROM8:4916 19 add hl,de ROM8:4917 06 00 ld b,00 ROM8:4919 CB 21 sla c ROM8:491B 09 add hl,bc ;hl = 0x47BD + offset ROM8:491C 2A ldi a,(hl) ;Load Monster ID from the Ritual Materials array ROM8:491D 46 ld b,(hl) ROM8:491E 4F ld c,a ;bc = Ritual Material ID ROM8:491F E1 pop hl ROM8:4920 D1 pop de ROM8:4921 F1 pop af ROM8:4922 C9 ret
Player's Effect Monsters
Display card effect text
ROM8:4961 F5 push af ROM8:4962 C5 push bc ROM8:4963 3E 02 ld a,02 ROM8:4965 EA 4C C8 ld (C84C),a ;(C84C) = 2 ROM8:4968 3E 04 ld a,04 ROM8:496A EA AF C8 ld (C8AF),a ;(C8AF) = 4 ROM8:496D FA DA CA ld a,(CADA) ;Column being processed ROM8:4970 47 ld b,a ROM8:4971 FA DB CA ld a,(CADB) ;Row being processed ROM8:4974 4F ld c,a ROM8:4975 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4978 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:497B FA A3 C7 ld a,(C7A3) ROM8:497E EA A9 C8 ld (C8A9),a ;Copy card being processed to (C8A9) ROM8:4981 FA A4 C7 ld a,(C7A4) ROM8:4984 EA AA C8 ld (C8AA),a ROM8:4987 CF rst 08 => to 6:4007, pointer to 6:400E ROM8:4989 C1 pop bc ROM8:498B F1 pop af ROM8:498C C9 ret
Freeze card in selected card zone
ROM8:498D F5 push af ROM8:498E C5 push bc ROM8:498F FA DA CA ld a,(CADA) ;Column being processed ROM8:4992 47 ld b,a ROM8:4993 FA DB CA ld a,(CADB) ;Row being processed ROM8:4996 4F ld c,a ROM8:4997 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:499A CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:499D CD DF 1F call 1FDF ;Freezes Card ROM8:49A0 CD FB 19 call 19FB ;Update selected card ID and status ROM8:49A3 C1 pop bc ROM8:49A4 F1 pop af ROM8:49A5 C9 ret
Effect Monster subroutine
ROM8:49A6 F5 push af ROM8:49A7 C5 push bc ROM8:49A8 E5 push hl ROM8:49A9 FA DA CA ld a,(CADA) ;Column being processed ROM8:49AC 47 ld b,a ROM8:49AD FA DB CA ld a,(CADB) ;Row being processed ROM8:49B0 4F ld c,a ROM8:49B1 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:49B4 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:49B7 FA A3 C7 ld a,(C7A3) ROM8:49BA 4F ld c,a ;bc = Card being processed ROM8:49BB FA A4 C7 ld a,(C7A4) ROM8:49BE 47 ld b,a ROM8:49BF CF rst 08 ... ROM8:49C2 3E 00 ld a,00 ROM8:49C4 47 ld b,a ROM8:49C5 FA C0 C6 ld a,(C6C0) ;Effect Monster ID ROM8:49C8 4F ld c,a ROM8:49C9 CB 21 sla c ROM8:49CB 21 DB 49 ld hl,49DB ROM8:49CE 09 add hl,bc ;hl = 0x49DB + (Effect Monster ID × 2) ROM8:49CF 2A ldi a,(hl) ROM8:49D0 66 ld h,(hl) ROM8:49D1 6F ld l,a ;hl = Pointer to the Monster Effect ROM8:49D2 01 D7 49 ld bc,49D7 ;Address to go back to once the Monster Effect has been resolved ROM8:49D5 C5 push bc ROM8:49D6 E9 jp hl ROM8:49D7 E1 pop hl ROM8:49D8 C1 pop bc ROM8:49D9 F1 pop af ROM8:49DA C9 ret
Effect Monsters pointers
0x209DB-0x20A42
- Effect Monsters pointers. This follow the Effect Monster IDs.
ROM8:49DB 43 4A - No Effect 4B 4A - Reaper of the Card 5C 4A - Fairy's Gift 70 4A - Relinquished A7 4A - Thousand-eyes Restrict E7 4A - Skelengel F7 4A - Harpie Lady 25 4B - Harpie Lady Sister 59 4B - Time Wizard 9D 4B - Castle of D. Magic E7 4B - Mystical Elf 15 4C - Curse of Dragon 22 4C - Flame Swordsman 48 4C - Giant Rock Soldier 55 4C - Battle Ox 7B 4C - Monster Tamer A9 4C - Pumpking the King E9 4C - Mammoth Graveyard 10 4D - Catapult Turtle 62 4D - Goddess of Whim 87 4D - Spirit of the Mountain 94 4D - Dragon Seeker BA 4D - Trap Master EC 4D - Fiend's Hand 1D 4E - Faceless Mage 4A 4E - Electric Lizard 6D 4E - D. Magician Girl A5 4E - Wodan the Resident D2 4E - M-warrior #1 00 4F - M-warrior #2 2E 4F - Red Archery Girl 56 4F - Lady of Faith 6A 4F - Fire Reaper 7E 4F - Kairyu-shin 8B 4F - Gyakutenno Megami C5 4F - Monster Eye EA 4F - Doron 25 50 - Swamp Battleguard 53 50 - Lava Battleguard 81 50 - Trent 8E 50 - Labyrinth Tank C6 50 - Spirit of the Book 10 51 - Hourglass of Life 39 51 - Beastking of the Swamp 63 51 - Nemuriko 9F 51 - Toad Master E6 51 - Hoshiningen 1E 52 - Invitation to a Dark Sleep 4B 52 - Witch's Apprentice 83 52 - Mystic Lamp A7 52 - Leghul CB 52 - Insect Queen
Effect Monsters
No Effect
0x20A43-0x20A4A
- No Effect : Reveal the card, and display a message informing the Player that this card has no Monster Effect.
ROM8:4A43 F5 push af ROM8:4A44 3E 01 ld a,01 ROM8:4A46 CF rst 08 => 2F 05 ROM8:4A49 F1 pop af ROM8:4A4A C9 ret
Reaper of the Card
0x20A4B-0x20A5B
- Reaper of the Card : Destroys opponent's Trap.
ROM8:4A4B F5 push af ROM8:4A4C C5 push bc ROM8:4A4D CD 61 49 call 4961 ;Displays card effect text ROM8:4A50 CD 8D 49 call 498D ;Freezes this card ROM8:4A53 CF rst 08 => 17 0A ROM8:4A56 CF rst 08 => 59 03 ROM8:4A59 C1 pop bc ROM8:4A5A F1 pop af ROM8:4A5B C9 ret
Fairy's Gift
0x20A5C-0x20A6F
- Fairy's Gift : Heals 1000 LP.
ROM8:4A5C F5 push af ROM8:4A5D C5 push bc ROM8:4A5E CD 61 49 call 4961 ;Displays card effect text ROM8:4A61 CD 8D 49 call 498D ;Freezes this card ROM8:4A64 01 00 10 ld bc,1000 ;Heal 1000 LP ROM8:4A67 CF rst 08 => 43 03 ROM8:4A6A CF rst 08 => 59 03 ROM8:4A6D C1 pop bc ROM8:4A6E F1 pop af ROM8:4A6F C9 ret
Relinquished
0x20A70-0x20AA6
- Relinquished : Steals an opponent's monster.
ROM8:4A70 F5 push af ROM8:4A71 C5 push bc ROM8:4A72 CD 61 49 call 4961 ;Displays card effect text ROM8:4A75 CD 8D 49 call 498D ;Freezes this card ROM8:4A78 CF rst 08 => 17 03 ROM8:4A7B FE 00 cp a,00 ROM8:4A7D 20 25 jr nz,4AA4 ROM8:4A7F 0E 01 ld c,01 ROM8:4A81 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4A84 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:4A87 CD E6 19 call 19E6 ;Remove selected card from the field ROM8:4A8A FA DA CA ld a,(CADA) ;Column being processed ROM8:4A8D 47 ld b,a ROM8:4A8E FA DB CA ld a,(CADB) ;Row being processed ROM8:4A91 4F ld c,a ROM8:4A92 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4A95 CD EA 1F call 1FEA ;Unfreezes Card ROM8:4A98 CD 25 20 call 2025 ;Hide Card, reset Level ROM8:4A9B CD C9 1F call 1FC9 ;Reveal Card ROM8:4A9E CD FB 19 call 19FB ;Update selected card ID and status ROM8:4AA1 CF rst 08 => 59 03 ROM8:4AA4 C1 pop bc ROM8:4AA5 F1 pop af ROM8:4AA6 C9 ret
Thousand-eyes Restrict
0x20AA7-0x20AE6
- Thousand-eyes Restrict : Steals an opponent's monster, and maximize its Level.
ROM8:4AA7 F5 push af ROM8:4AA8 C5 push bc ROM8:4AA9 CD 61 49 call 4961 ;Displays card effect text ROM8:4AAC CD 8D 49 call 498D ;Freezes this card ROM8:4AAF CF rst 08 => 17 03 ROM8:4AB2 FE 00 cp a,00 ROM8:4AB4 20 2E jr nz,4AE4 ROM8:4AB6 0E 01 ld c,01 ROM8:4AB8 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4ABB CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:4ABE CD E6 19 call 19E6 ;Remove selected card from the field ROM8:4AC1 FA DA CA ld a,(CADA) ;Column being processed ROM8:4AC4 47 ld b,a ROM8:4AC5 FA DB CA ld a,(CADB) ;Row being processed ROM8:4AC8 4F ld c,a ROM8:4AC9 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4ACC CD EA 1F call 1FEA ;Unfreezes Card ROM8:4ACF CD 25 20 call 2025 ;Hide Card, reset Level ROM8:4AD2 CD C9 1F call 1FC9 ;Reveal Card ROM8:4AD5 CD 70 1F call 1F70 ;Increase Card Level ROM8:4AD8 CD 70 1F call 1F70 ;Increase Card Level ROM8:4ADB CD 70 1F call 1F70 ;Increase Card Level ROM8:4ADE CD FB 19 call 19FB ;Update selected card ID and status ROM8:4AE1 CF rst 08 => 59 03 ROM8:4AE4 C1 pop bc ROM8:4AE5 F1 pop af ROM8:4AE6 C9 ret
Skelengel
0x20AE7-0x20AF6
- Skelengel : Draw 1 card.
ROM8:4AE7 CD 61 49 call 4961 ;Displays card effect text ROM8:4AEA CD 8D 49 call 498D ;Freezes this card ROM8:4AED CF rst 08 => 7D 03 ROM8:4AF0 CF rst 08 => 63 03 ROM8:4AF3 CF rst 08 => 59 03 ROM8:4AF6 C9 ret
Harpie Lady
0x20AF7-0x20B24
- Harpie Lady : +1 Level for Harpie's Pet Dragon.
ROM8:4AF7 F5 push af ROM8:4AF8 C5 push bc ROM8:4AF9 D5 push de ROM8:4AFA 11 82 01 ld de,0182 ;Harpie's Pet Dragon ROM8:4AFD 7B ld a,e ROM8:4AFE EA AB C8 ld (C8AB),a ;Monster to target = Harpie's Pet Dragon ROM8:4B01 7A ld a,d ROM8:4B02 EA AC C8 ld (C8AC),a ROM8:4B05 CD 61 49 call 4961 ;Displays card effect text ROM8:4B08 CD 8D 49 call 498D ;Freezes this card ROM8:4B0B 01 02 01 ld bc,0102 ROM8:4B0E CF rst 08 => 1F 03 ROM8:4B11 FE 00 cp a,00 ROM8:4B13 20 03 jr nz,4B18 ROM8:4B15 CF rst 08 => 21 03 ROM8:4B18 04 inc b ROM8:4B19 78 ld a,b ROM8:4B1A FE 06 cp a,06 ROM8:4B1C 38 F0 jr c,4B0E ;If all the Monster card zones have not been checked, loop to 8:4B0E ROM8:4B1E CF rst 08 => 59 03 ROM8:4B21 D1 pop de ROM8:4B22 C1 pop bc ROM8:4B23 F1 pop af ROM8:4B24 C9 ret
Harpie Lady Sisters
0x20B25-0x20B58
- Harpie Lady Sisters : Max Level for Harpie's Pet Dragon.
ROM8:4B25 F5 push af ROM8:4B26 C5 push bc ROM8:4B27 D5 push de ROM8:4B28 11 82 01 ld de,0182 ;Harpie's Pet Dragon ROM8:4B2B 7B ld a,e ROM8:4B2C EA AB C8 ld (C8AB),a ;Monster to target = Harpie's Pet Dragon ROM8:4B2F 7A ld a,d ROM8:4B30 EA AC C8 ld (C8AC),a ROM8:4B33 CD 61 49 call 4961 ;Displays card effect text ROM8:4B36 CD 8D 49 call 498D ;Freezes this card ROM8:4B39 01 02 01 ld bc,0102 ROM8:4B3C CF rst 08 => 1F 03 ROM8:4B3F FE 00 cp a,00 ROM8:4B41 20 09 jr nz,4B4C ROM8:4B43 CF rst 08 => 21 03 ROM8:4B46 CF rst 08 => 21 03 ROM8:4B49 CF rst 08 => 21 03 ROM8:4B4C 04 inc b ROM8:4B4D 78 ld a,b ROM8:4B4E FE 06 cp a,06 ROM8:4B50 38 EA jr c,4B3C ;If all the Monster card zones have not been checked, loop to 8:4B3C ROM8:4B52 CF rst 08 => 59 03 ROM8:4B55 D1 pop de ROM8:4B56 C1 pop bc ROM8:4B57 F1 pop af ROM8:4B58 C9 ret
Time Wizard
0x20B59-0x20B9C
- Time Wizard : Transforms any Baby Dragon on the field to Thousand Dragon.
ROM8:4B59 F5 push af ROM8:4B5A C5 push bc ROM8:4B5B D5 push de ROM8:4B5C 11 04 00 ld de,0004 ;Baby Dragon ROM8:4B5F 7B ld a,e ROM8:4B60 EA AB C8 ld (C8AB),a ;Monster to target = Baby Dragon ROM8:4B63 7A ld a,d ROM8:4B64 EA AC C8 ld (C8AC),a ROM8:4B67 CD 61 49 call 4961 ;Displays card effect text ROM8:4B6A CD 8D 49 call 498D ;Freezes this card ROM8:4B6D 01 02 01 ld bc,0102 ROM8:4B70 CF rst 08 => 1F 03 ROM8:4B73 FE 00 cp a,00 ROM8:4B75 20 19 jr nz,4B90 ;If that's not Baby Dragon, jump to 8:4B90 ROM8:4B77 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4B7A 3E 45 ld a,45 ROM8:4B7C EA A3 C7 ld (C7A3),a ;Thousand Dragon ROM8:4B7F 3E 00 ld a,00 ROM8:4B81 EA A4 C7 ld (C7A4),a ROM8:4B84 CD 25 20 call 2025 ;Hide Card, reset Level ROM8:4B87 CD B4 1F call 1FB4 ;Reset Card Level ROM8:4B8A CD C9 1F call 1FC9 ;Reveal Card ROM8:4B8D CD FB 19 call 19FB ;Update selected card ID and status ROM8:4B90 04 inc b ROM8:4B91 78 ld a,b ROM8:4B92 FE 06 cp a,06 ROM8:4B94 38 DA jr c,4B70 ;If all the Monster card zones have not been checked, loop to 8:4B70 ROM8:4B96 CF rst 08 => 59 03 ROM8:4B99 D1 pop de ROM8:4B9A C1 pop bc ROM8:4B9B F1 pop af ROM8:4B9C C9 ret
Castle of D. Magic
0x20B9D-0x20BE6
- Castle of D. Magic : Changes the field to Yami, then sets Player's Monsters face down, then reveals any Castle of D. Magic on Player's field.
ROM8:4B9D CD 61 49 call 4961 ;Displays card effect text ROM8:4BA0 CD 8D 49 call 498D ;Freezes this card ROM8:4BA3 CF rst 08 => 87 03 ROM8:4BA6 01 02 01 ld bc,0102 ROM8:4BA9 78 ld a,b ROM8:4BAA FE 06 cp a,06 ROM8:4BAC 30 16 jr nc,4BC4 ;If all the Monster card zones have been checked, loop to 8:4BC4 ROM8:4BAE CF rst 08 => 11 03 ROM8:4BB1 FE 00 cp a,00 ROM8:4BB3 20 0C jr nz,4BC1 ;If there's no Monster in the selected card zone, jump to 8:4BC1 ROM8:4BB5 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4BB8 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:4BBB CD D4 1F call 1FD4 ;Hide Card ROM8:4BBE CD FB 19 call 19FB ;Update selected card ID and status ROM8:4BC1 04 inc b ROM8:4BC2 18 E5 jr 4BA9 ;Loop to 8:4BA9 ROM8:4BC4 11 53 00 ld de,0053 ;Castle of D. Magic ROM8:4BC7 01 02 01 ld bc,0102 ROM8:4BCA CF rst 08 => 1F 03 ROM8:4BCD FE 00 cp a,00 ROM8:4BCF 20 0C jr nz,4BDD ;If it's not Castle of D. Magic, jump to 8:4BDD ROM8:4BD1 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4BD4 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:4BD7 CD C9 1F call 1FC9 ;Reveal Card ROM8:4BDA CD FB 19 call 19FB ;Update selected card ID and status ROM8:4BDD 04 inc b ROM8:4BDE 78 ld a,b ROM8:4BDF FE 06 cp a,06 ROM8:4BE1 38 E7 jr c,4BCA ;If all the Monster card zones have not been checked, loop to 8:4BCA ROM8:4BE3 CF rst 08 => 59 03 ROM8:4BE6 C9 ret
Mystical Elf
0x20BE7-0x20C14
- Mystical Elf : +1 Level for Blue-Eyes White Dragon.
ROM8:4BE7 F5 push af ROM8:4BE8 C5 push bc ROM8:4BE9 D5 push de ROM8:4BEA 11 01 00 ld de,0001 ;Blue-Eyes White Dragon ROM8:4BED 7B ld a,e ROM8:4BEE EA AB C8 ld (C8AB),a ;Monster to target = Blue-Eyes White Dragon ROM8:4BF1 7A ld a,d ROM8:4BF2 EA AC C8 ld (C8AC),a ROM8:4BF5 CD 61 49 call 4961 ;Displays card effect text ROM8:4BF8 CD 8D 49 call 498D ;Freezes this card ROM8:4BFB 01 02 01 ld bc,0102 ROM8:4BFE CF rst 08 => 1F 03 ROM8:4C01 FE 00 cp a,00 ROM8:4C03 20 03 jr nz,4C08 ROM8:4C05 CF rst 08 => 21 03 ROM8:4C08 04 inc b ROM8:4C09 78 ld a,b ROM8:4C0A FE 06 cp a,06 ROM8:4C0C 38 F0 jr c,4BFE ;If all the Monster card zones have not been checked, loop to 8:4BFE ROM8:4C0E CF rst 08 => 59 03 ROM8:4C11 D1 pop de ROM8:4C12 C1 pop bc ROM8:4C13 F1 pop af ROM8:4C14 C9 ret
Curse of Dragon
0x20C15-0x20C21
- Curse of Dragon : Changes the field to Desert.
ROM8:4C15 CD 61 49 call 4961 ;Displays card effect text ROM8:4C18 CD 8D 49 call 498D ;Freezes this card ROM8:4C1B CF rst 08 => 89 03 ROM8:4C1E CF rst 08 => 59 03 ROM8:4C21 C9 ret
Flame Swordsman
0x20C22-0x20C47
- Flame Swordsman : Destroys every Dinosaur monsters on the field.
ROM8:4C22 F5 push af ROM8:4C23 C5 push bc ROM8:4C24 CD 61 49 call 4961 ;Displays card effect text ROM8:4C27 CD 8D 49 call 498D ;Freezes this card ROM8:4C2A 0E 01 ld c,01 ROM8:4C2C 06 00 ld b,00 ROM8:4C2E 78 ld a,b ROM8:4C2F FE 05 cp a,05 ROM8:4C31 30 0F jr nc,4C42 ROM8:4C33 3E 0A ld a,0A ;Dinosaur (Type) ROM8:4C35 CF rst 08 ROM8:4C36 23 03 => Pointer 03:4023 ROM8:4C38 FE 00 cp a,00 ROM8:4C3A 20 03 jr nz,4C3F ROM8:4C3C CD 86 20 call 2086 ;Remove selected card from the field ROM8:4C3F 04 inc b ROM8:4C40 18 EC jr 4C2E ROM8:4C42 CF rst 08 => 59 03 ROM8:4C45 C1 pop bc ROM8:4C46 F1 pop af ROM8:4C47 C9 ret
Giant Rock Soldier
0x20C48-0x20C54
- Giant Rock Soldier : Reverts the field to Arena.
ROM8:4C48 CD 61 49 call 4961 ;Displays card effect text ROM8:4C4B CD 8D 49 call 498D ;Freezes this card ROM8:4C4E CF rst 08 ... ROM8:4C51 CF rst 08 => 59 03 ROM8:4C54 C9 ret
Battle Ox
0x20C55-0x20C7A
- Destroys every Pyro monsters on the field.
ROM8:4C55 F5 push af ROM8:4C56 C5 push bc ROM8:4C57 CD 61 49 call 4961 ;Displays card effect text ROM8:4C5A CD 8D 49 call 498D ;Freezes this card ROM8:4C2A 0E 01 ld c,01 ROM8:4C5D 0E 01 ld c,01 ROM8:4C5F 06 00 ld b,00 ROM8:4C61 78 ld a,b ROM8:4C62 FE 05 cp a,05 ROM8:4C64 30 0F jr nc,4C75 ROM8:4C66 3E 04 ld a,04 ;Pyro (Alignment) ROM8:4C68 CF rst 08 ... ROM8:4C6B FE 00 cp a,00 ROM8:4C6D 20 03 jr nz,4C72 ROM8:4C6F CD 86 20 call 2086 ;Remove selected card from the field ROM8:4C72 04 inc b ROM8:4C73 18 EC jr 4C61 ROM8:4C75 CF rst 08 => 59 03 ROM8:4C78 C1 pop bc ROM8:4C79 F1 pop af ROM8:4C7A C9 ret
Monster Tamer
0x20C7B-0x20CA8
- Monster Tamer : +1 Level for Dungeon Worm.
ROM8:4C7B F5 push af ROM8:4C7C C5 push bc ROM8:4C7D D5 push de ROM8:4C7E 11 77 01 ld de,0177 ;Dungeon Worm ROM8:4C81 7B ld a,e ROM8:4C82 EA AB C8 ld (C8AB),a ;Monster to target = Dungeon Worm ROM8:4C85 7A ld a,d ROM8:4C86 EA AC C8 ld (C8AC),a ROM8:4C89 CD 61 49 call 4961 ;Displays card effect text ROM8:4C8C CD 8D 49 call 498D ;Freezes this card ROM8:4C8F 01 02 01 ld bc,0102 ROM8:4C92 CF rst 08 ... ROM8:4C95 FE 00 cp a,00 ROM8:4C97 20 03 jr nz,4C9C ROM8:4C99 CF rst 08 ... ROM8:4C9C 04 inc b ROM8:4C9D 78 ld a,b ROM8:4C9E FE 06 cp a,06 ROM8:4CA0 38 F0 jr c,4C92 ROM8:4CA2 CF rst 08 => 59 03 ROM8:4CA5 D1 pop de ROM8:4CA6 C1 pop bc ROM8:4CA7 F1 pop af ROM8:4CA8 C9 ret
Pumpking the King
0x20CA9-0x20CE8
- Pumpking the King : +1 Level for Armored Zombie, Dragon Zombie, and Clown Zombie.
ROM8:4CA9 F5 push af ROM8:4CAA C5 push bc ROM8:4CAB D5 push de ROM8:4CAC CD 61 49 call 4961 ;Displays card effect text ROM8:4CAF CD 8D 49 call 498D ;Freezes this card ROM8:4CB2 01 02 01 ld bc,0102 ROM8:4CB5 11 60 00 ld de,0060 ;Armored Zombie ROM8:4CB8 CF rst 08 ... ROM8:4CBB FE 00 cp a,00 ROM8:4CBD 20 03 jr nz,4CC2 ROM8:4CBF CF rst 08 ROM8:4CC2 11 61 00 ld de,0061 ;Dragon Zombie ROM8:4CC5 CF rst 08 ... ROM8:4CC8 FE 00 cp a,00 ROM8:4CCA 20 03 jr nz,4CCF ROM8:4CCC CF rst 08 ROM8:4CCF 11 62 00 ld de,0062 ;Clown Zombie ROM8:4CD2 CF rst 08 ... ROM8:4CD5 FE 00 cp a,00 ROM8:4CD7 20 03 jr nz,4CDC ROM8:4CD9 CF rst 08 ... ROM8:4CDC 04 inc b ROM8:4CDD 78 ld a,b ROM8:4CDE FE 06 cp a,06 ROM8:4CE0 38 D3 jr c,4CB5 ROM8:4CE2 CF rst 08 => 59 03 ROM8:4CE5 D1 pop de ROM8:4CE6 C1 pop bc ROM8:4CE7 F1 pop af ROM8:4CE8 C9 ret
Mammoth Graveyard
ROM8:4CE9 F5 push af ROM8:4CEA C5 push bc ROM8:4CEB CD 61 49 call 4961 ;Displays card effect text ROM8:4CEE CD 8D 49 call 498D ;Freezes this card ROM8:4CF1 0E 01 ld c,01 ROM8:4CF3 06 00 ld b,00 ROM8:4CF5 78 ld a,b ROM8:4CF6 FE 05 cp a,05 ROM8:4CF8 30 10 jr nc,4D0A ROM8:4CFA CF rst 08 ... ROM8:4CFC FE 00 cp a,00 ROM8:4CFF 20 06 jr nz,4D07 ROM8:4D01 CD 92 1F call 1F92 ROM8:4D04 CD FB 19 call 19FB ROM8:4D07 04 inc b ROM8:4D08 18 EB jr 4CF5 ROM8:4D0A CF rst 08 => 59 03 ROM8:4D0D C1 pop bc ROM8:4D0E F1 pop af ROM8:4D0F C9 ret
Catapult Turtle
ROM8:4D10 F5 push af ROM8:4D11 C5 push bc ROM8:4D12 D5 push de ROM8:4D13 CD 61 49 call 4961 ;Displays card effect text ROM8:4D16 CD 8D 49 call 498D ;Freezes this card ROM8:4D19 11 00 00 ld de,0000 ROM8:4D1C 01 02 01 ld bc,0102 ROM8:4D1F 78 ld a,b ROM8:4D20 FE 06 cp a,06 ROM8:4D22 30 32 jr nc,4D56 ROM8:4D24 FA DA CA ld a,(CADA) ROM8:4D27 B8 cp b ROM8:4D28 28 29 jr z,4D53 ROM8:4D2A CF rst 08 ... ROM8:4D2D FE 00 cp a,00 ROM8:4D2F 20 22 jr nz,4D53 ROM8:4D31 CD 4F 20 call 204F ;Retrieve Card Frozen status ROM8:4D34 FE 00 cp a,00 ROM8:4D36 20 1B jr nz,4D53 ROM8:4D38 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:4D3B CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:4D3E CF rst 08 ... ROM8:4D41 CD E6 19 call 19E6 ;Remove selected card from the field ROM8:4D44 C5 push bc ROM8:4D45 FA B7 C6 ld a,(C6B7) ;Current card ATK ROM8:4D48 4F ld c,a ROM8:4D49 FA B8 C6 ld a,(C6B8) ROM8:4D4C 47 ld b,a ROM8:4D4D CD 82 14 call 1482 ;daa addtion ROM8:4D50 50 ld d,b ROM8:4D51 59 ld e,c ROM8:4D52 C1 pop bc ROM8:4D53 04 inc b ROM8:4D54 18 C9 jr 4D1F ROM8:4D56 42 ld b,d ROM8:4D57 4B ld c,e ROM8:4D58 CF rst 08 ... ROM8:4D5B CF rst 08 => 59 03 ROM8:4D5E D1 pop de ROM8:4D5F C1 pop bc ROM8:4D60 F1 pop af ROM8:4D61 C9 ret
Goddess of Whim
ROM8:4D62 F5 push af ROM8:4D63 C5 push bc ROM8:4D64 CD 61 49 call 4961 ;Displays card effect text ROM8:4D67 CD 8D 49 call 498D ;Freezes this card ROM8:4D6A CF rst 08 ROM8:4D6B 73 ld (hl),e ROM8:4D6C 03 inc bc ROM8:4D6D CF rst 08 ROM8:4D6E 63 ld h,e ROM8:4D6F 03 inc bc ROM8:4D70 FA DA CA ld a,(CADA) ROM8:4D73 47 ld b,a ROM8:4D74 FA DB CA ld a,(CADB) ROM8:4D77 4F ld c,a ROM8:4D78 CD D0 19 call 19D0 ROM8:4D7B CD 13 1A call 1A13 ROM8:4D7E CD E6 19 call 19E6 ROM8:4D81 CF rst 08 => 59 03 ROM8:4D84 C1 pop bc ROM8:4D85 F1 pop af ROM8:4D86 C9 ret
Spirit of the Mountain
ROM8:4D87 CD 61 49 call 4961 ;Displays card effect text ROM8:4D8A CD 8D 49 call 498D ;Freezes this card ROM8:4D8D CF rst 08 ROM8:4D8E 8B adc e ROM8:4D8F 03 inc bc ROM8:4D90 CF rst 08 => 59 03 ROM8:4D93 C9 ret
Dragon Seeker
ROM8:4D94 F5 push af ROM8:4D95 C5 push bc ROM8:4D96 CD 61 49 call 4961 ;Displays card effect text ROM8:4D99 CD 8D 49 call 498D ;Freezes this card ROM8:4D9C 0E 01 ld c,01 ROM8:4D9E 06 00 ld b,00 ROM8:4DA0 78 ld a,b ROM8:4DA1 FE 05 cp a,05 ROM8:4DA3 30 0F jr nc,4DB4 ROM8:4DA5 3E 00 ld a,00 ROM8:4DA7 CF rst 08 ROM8:4DA8 23 inc hl ROM8:4DA9 03 inc bc ROM8:4DAA FE 00 cp a,00 ROM8:4DAC 20 03 jr nz,4DB1 ROM8:4DAE CD 86 20 call 2086 ROM8:4DB1 04 inc b ROM8:4DB2 18 EC jr 4DA0 ROM8:4DB4 CF rst 08 => 59 03 ROM8:4DB7 C1 pop bc ROM8:4DB8 F1 pop af ROM8:4DB9 C9 ret
Trap Master
ROM8:4DBA F5 push af ROM8:4DBB C5 push bc ROM8:4DBC D5 push de ROM8:4DBD 11 AD 02 ld de,02AD ROM8:4DC0 7B ld a,e ROM8:4DC1 EA AB C8 ld (C8AB),a ROM8:4DC4 7A ld a,d ROM8:4DC5 EA AC C8 ld (C8AC),a ROM8:4DC8 CD 61 49 call 4961 ;Displays card effect text ROM8:4DCB CD 8D 49 call 498D ;Freezes this card ROM8:4DCE 01 03 00 ld bc,0003 ROM8:4DD1 CD D0 19 call 19D0 ROM8:4DD4 7B ld a,e ROM8:4DD5 EA A3 C7 ld (C7A3),a ROM8:4DD8 7A ld a,d ROM8:4DD9 EA A4 C7 ld (C7A4),a ROM8:4DDC CD D4 1F call 1FD4 ROM8:4DDF CD B4 1F call 1FB4 ROM8:4DE2 CD FB 19 call 19FB ROM8:4DE5 CF rst 08 => 59 03 ROM8:4DE8 D1 pop de ROM8:4DE9 C1 pop bc ROM8:4DEA F1 pop af ROM8:4DEB C9 ret
Fiend's Hand
ROM8:4DEC F5 push af ROM8:4DED C5 push bc ROM8:4DEE CD 61 49 call 4961 ;Displays card effect text ROM8:4DF1 CD 8D 49 call 498D ;Freezes this card ROM8:4DF4 CF rst 08 ROM8:4DF5 17 rla ROM8:4DF6 03 inc bc ROM8:4DF7 FE 00 cp a,00 ROM8:4DF9 20 0B jr nz,4E06 ROM8:4DFB 0E 01 ld c,01 ROM8:4DFD CD D0 19 call 19D0 ROM8:4E00 CD 13 1A call 1A13 ROM8:4E03 CD E6 19 call 19E6 ROM8:4E06 FA DA CA ld a,(CADA) ROM8:4E09 47 ld b,a ROM8:4E0A FA DB CA ld a,(CADB) ROM8:4E0D 4F ld c,a ROM8:4E0E CD D0 19 call 19D0 ROM8:4E11 CD 13 1A call 1A13 ROM8:4E14 CD E6 19 call 19E6 ROM8:4E17 CF rst 08 => 59 03 ROM8:4E1A C1 pop bc ROM8:4E1B F1 pop af ROM8:4E1C C9 ret
Faceless Mage
ROM8:4E1D F5 push af ROM8:4E1E C5 push bc ROM8:4E1F CD 61 49 call 4961 ;Displays card effect text ROM8:4E22 CD 8D 49 call 498D ;Freezes this card ROM8:4E25 0E 01 ld c,01 ROM8:4E27 06 00 ld b,00 ROM8:4E29 78 ld a,b ROM8:4E2A FE 05 cp a,05 ROM8:4E2C 30 16 jr nc,4E44 ROM8:4E2E CF rst 08 ROM8:4E2F 11 03 FE ld de,FE03 ROM8:4E32 00 nop ROM8:4E33 20 0C jr nz,4E41 ROM8:4E35 CD D0 19 call 19D0 ROM8:4E38 CD 13 1A call 1A13 ROM8:4E3B CD DF 1F call 1FDF ;Freezes Card ROM8:4E3E CD FB 19 call 19FB ROM8:4E41 04 inc b ROM8:4E42 18 E5 jr 4E29 ROM8:4E44 CF rst 08 => 59 03 ROM8:4E47 C1 pop bc ROM8:4E48 F1 pop af ROM8:4E49 C9 ret
Electric Lizard
ROM8:4E4A F5 push af ROM8:4E4B C5 push bc ROM8:4E4C CD 61 49 call 4961 ;Displays card effect text ROM8:4E4F CD 8D 49 call 498D ;Freezes this card ROM8:4E52 CF rst 08 ... ROM8:4E55 FE 00 cp a,00 ROM8:4E57 20 0E jr nz,4E67 ROM8:4E59 0E 01 ld c,01 ROM8:4E5B CD D0 19 call 19D0 ROM8:4E5E CD 13 1A call 1A13 ROM8:4E61 CD DF 1F call 1FDF ;Freezes Card ROM8:4E64 CD FB 19 call 19FB ROM8:4E67 CF rst 08 => 59 03 ROM8:4E6A C1 pop bc ROM8:4E6B F1 pop af ROM8:4E6C C9 ret
D. Magician Girl
ROM8:4E6D F5 push af ROM8:4E6E C5 push bc ROM8:4E6F D5 push de ROM8:4E70 11 23 00 ld de,0023 ROM8:4E73 7B ld a,e ROM8:4E74 EA AB C8 ld (C8AB),a ROM8:4E77 7A ld a,d ROM8:4E78 EA AC C8 ld (C8AC),a ROM8:4E7B CD 61 49 call 4961 ;Displays card effect text ROM8:4E7E CD 8D 49 call 498D ;Freezes this card ROM8:4E81 01 03 01 ld bc,0103 ROM8:4E84 CF rst 08 ... ROM8:4E87 FE 00 cp a,00 ROM8:4E89 20 0D jr nz,4E98 ROM8:4E8B C5 push bc ROM8:4E8C FA DA CA ld a,(CADA) ROM8:4E8F 47 ld b,a ROM8:4E90 FA DB CA ld a,(CADB) ROM8:4E93 4F ld c,a ROM8:4E94 CF rst 08 ROM8:4E95 21 03 C1 ld hl,C103 ROM8:4E98 04 inc b ROM8:4E99 78 ld a,b ROM8:4E9A FE 06 cp a,06 ROM8:4E9C 38 E6 jr c,4E84 ROM8:4E9E CF rst 08 => 59 03 ROM8:4EA1 D1 pop de ROM8:4EA2 C1 pop bc ROM8:4EA3 F1 pop af ROM8:4EA4 C9 ret
Wodan the Resident of the Forest
ROM8:4EA5 F5 push af ROM8:4EA6 C5 push bc ROM8:4EA7 CD 61 49 call 4961 ;Displays card effect text ROM8:4EAA CD 8D 49 call 498D ;Freezes this card ROM8:4EAD 01 02 01 ld bc,0102 ROM8:4EB0 3E 13 ld a,13 ROM8:4EB2 CF rst 08 ... ROM8:4EB5 FE 00 cp a,00 ROM8:4EB7 20 0D jr nz,4EC6 ROM8:4EB9 C5 push bc ROM8:4EBA FA DA CA ld a,(CADA) ROM8:4EBD 47 ld b,a ROM8:4EBE FA DB CA ld a,(CADB) ROM8:4EC1 4F ld c,a ROM8:4EC2 CF rst 08 ROM8:4EC3 21 03 C1 ld hl,C103 ROM8:4EC6 04 inc b ROM8:4EC7 78 ld a,b ROM8:4EC8 FE 06 cp a,06 ROM8:4ECA 38 E4 jr c,4EB0 ROM8:4ECC CF rst 08 => 59 03 ROM8:4ECF C1 pop bc ROM8:4ED0 F1 pop af ROM8:4ED1 C9 ret
M-warrior #1
ROM8:4ED2 F5 push af ROM8:4ED3 C5 push bc ROM8:4ED4 D5 push de ROM8:4ED5 11 A1 00 ld de,00A1 ROM8:4ED8 7B ld a,e ROM8:4ED9 EA AB C8 ld (C8AB),a ROM8:4EDC 7A ld a,d ROM8:4EDD EA AC C8 ld (C8AC),a ROM8:4EE0 CD 61 49 call 4961 ;Displays card effect text ROM8:4EE3 CD 8D 49 call 498D ;Freezes this card ROM8:4EE6 01 02 01 ld bc,0102 ROM8:4EE9 CF rst 08 ROM8:4EEA 1F rra ROM8:4EEB 03 inc bc ROM8:4EEC FE 00 cp a,00 ROM8:4EEE 20 03 jr nz,4EF3 ROM8:4EF0 CF rst 08 ROM8:4EF1 21 03 04 ld hl,0403 ROM8:4EF4 78 ld a,b ROM8:4EF5 FE 06 cp a,06 ROM8:4EF7 38 F0 jr c,4EE9 ROM8:4EF9 CF rst 08 => 59 03 ROM8:4EFC D1 pop de ROM8:4EFD C1 pop bc ROM8:4EFE F1 pop af ROM8:4EFF C9 ret
M-warrior #2
ROM8:4F00 F5 push af ROM8:4F01 C5 push bc ROM8:4F02 D5 push de ROM8:4F03 11 A0 00 ld de,00A0 ROM8:4F06 7B ld a,e ROM8:4F07 EA AB C8 ld (C8AB),a ROM8:4F0A 7A ld a,d ROM8:4F0B EA AC C8 ld (C8AC),a ROM8:4F0E CD 61 49 call 4961 ;Displays card effect text ROM8:4F11 CD 8D 49 call 498D ;Freezes this card ROM8:4F14 01 02 01 ld bc,0102 ROM8:4F17 CF rst 08 ROM8:4F18 1F rra ROM8:4F19 03 inc bc ROM8:4F1A FE 00 cp a,00 ROM8:4F1C 20 03 jr nz,4F21 ROM8:4F1E CF rst 08 ROM8:4F1F 21 03 04 ld hl,0403 ROM8:4F22 78 ld a,b ROM8:4F23 FE 06 cp a,06 ROM8:4F25 38 F0 jr c,4F17 ROM8:4F27 CF rst 08 => 59 03 ROM8:4F2A D1 pop de ROM8:4F2B C1 pop bc ROM8:4F2C F1 pop af ROM8:4F2D C9 ret
Red Archery Girl
ROM8:4F2E F5 push af ROM8:4F2F C5 push bc ROM8:4F30 D5 push de ROM8:4F31 CD 61 49 call 4961 ;Displays card effect text ROM8:4F34 CD 8D 49 call 498D ;Freezes this card ROM8:4F37 CF rst 08 ROM8:4F38 17 rla ROM8:4F39 03 inc bc ROM8:4F3A FE 00 cp a,00 ROM8:4F3C 20 11 jr nz,4F4F ROM8:4F3E 0E 01 ld c,01 ROM8:4F40 CD D0 19 call 19D0 ROM8:4F43 CD 13 1A call 1A13 ROM8:4F46 CD 92 1F call 1F92 ROM8:4F49 CD DF 1F call 1FDF ;Freezes Card ROM8:4F4C CD FB 19 call 19FB ROM8:4F4F CF rst 08 => 59 03 ROM8:4F52 D1 pop de ROM8:4F53 C1 pop bc ROM8:4F54 F1 pop af ROM8:4F55 C9 ret
Lady of Faith
ROM8:4F56 F5 push af ROM8:4F57 C5 push bc ROM8:4F58 CD 61 49 call 4961 ;Displays card effect text ROM8:4F5B CD 8D 49 call 498D ;Freezes this card ROM8:4F5E 01 00 05 ld bc,0500 ROM8:4F61 CF rst 08 ROM8:4F62 43 ld b,e ROM8:4F63 03 inc bc ROM8:4F64 CF rst 08 => 59 03 ROM8:4F67 C1 pop bc ROM8:4F68 F1 pop af ROM8:4F69 C9 ret
Fire Reaper
ROM8:4F6A F5 push af ROM8:4F6B C5 push bc ROM8:4F6C CD 61 49 call 4961 ;Displays card effect text ROM8:4F6F CD 8D 49 call 498D ;Freezes this card ROM8:4F72 01 50 00 ld bc,0050 ROM8:4F75 CF rst 08 ROM8:4F76 49 ld c,c ROM8:4F77 03 inc bc ROM8:4F78 CF rst 08 => 59 03 ROM8:4F7B C1 pop bc ROM8:4F7C F1 pop af ROM8:4F7D C9 ret
Kairyu-shin
ROM8:4F7E CD 61 49 call 4961 ;Displays card effect text ROM8:4F81 CD 8D 49 call 498D ;Freezes this card ROM8:4F84 CF rst 08 ROM8:4F85 8D adc l ROM8:4F86 03 inc bc ROM8:4F87 CF rst 08 => 59 03 ROM8:4F8A C9 ret
Gyakutenno Megami
ROM8:4F8B F5 push af ROM8:4F8C C5 push bc ROM8:4F8D D5 push de ROM8:4F8E CD 61 49 call 4961 ;Displays card effect text ROM8:4F91 CD 8D 49 call 498D ;Freezes this card ROM8:4F94 01 02 01 ld bc,0102 ROM8:4F97 CF rst 08 ROM8:4F98 11 03 FE ld de,FE03 ROM8:4F9B 00 nop ROM8:4F9C 20 1A jr nz,4FB8 ROM8:4F9E CF rst 08 ROM8:4F9F 0B dec bc ROM8:4FA0 07 rlca ROM8:4FA1 C5 push bc ROM8:4FA2 FA B7 C6 ld a,(C6B7) ROM8:4FA5 4F ld c,a ROM8:4FA6 FA B8 C6 ld a,(C6B8) ROM8:4FA9 47 ld b,a ;bc = ATK ROM8:4FAA 11 00 05 ld de,0500 ROM8:4FAD CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM8:4FB0 C1 pop bc ROM8:4FB1 FE 00 cp a,00 ROM8:4FB3 28 03 jr z,4FB8 ROM8:4FB5 CF rst 08 ROM8:4FB6 21 03 04 ld hl,0403 ROM8:4FB9 78 ld a,b ROM8:4FBA FE 06 cp a,06 ROM8:4FBC 38 D9 jr c,4F97 ROM8:4FBE CF rst 08 => 59 03 ROM8:4FC1 D1 pop de ROM8:4FC2 C1 pop bc ROM8:4FC3 F1 pop af ROM8:4FC4 C9 ret
Monster Eye
ROM8:4FC5 F5 push af ROM8:4FC6 C5 push bc ROM8:4FC7 D5 push de ROM8:4FC8 CD 61 49 call 4961 ;Displays card effect text ROM8:4FCB CD 8D 49 call 498D ;Freezes this card ROM8:4FCE 01 00 00 ld bc,0000 ROM8:4FD1 CD D0 19 call 19D0 ROM8:4FD4 CD 13 1A call 1A13 ROM8:4FD7 CF rst 08 ROM8:4FD8 2F cpl ROM8:4FD9 03 inc bc ROM8:4FDA CD FB 19 call 19FB ROM8:4FDD 04 inc b ROM8:4FDE 78 ld a,b ROM8:4FDF FE 05 cp a,05 ROM8:4FE1 38 EE jr c,4FD1 ROM8:4FE3 CF rst 08 => 59 03 ROM8:4FE6 D1 pop de ROM8:4FE7 C1 pop bc ROM8:4FE8 F1 pop af ROM8:4FE9 C9 ret
Doron
ROM8:4FEA F5 push af ROM8:4FEB C5 push bc ROM8:4FEC D5 push de ROM8:4FED CD 61 49 call 4961 ;Displays card effect text ROM8:4FF0 CD 8D 49 call 498D ;Freezes this card ROM8:4FF3 01 02 01 ld bc,0102 ROM8:4FF6 CF rst 08 ROM8:4FF7 11 03 FE ld de,FE03 ROM8:4FFA 01 28 06 ld bc,0628 ROM8:4FFD 04 inc b ROM8:4FFE 78 ld a,b ROM8:4FFF FE 06 cp a,06 ROM8:5001 38 F3 jr c,4FF6 ROM8:5003 78 ld a,b ROM8:5004 FE 06 cp a,06 ROM8:5006 28 16 jr z,501E ROM8:5008 C5 push bc ROM8:5009 FA DA CA ld a,(CADA) ROM8:500C 47 ld b,a ROM8:500D FA DB CA ld a,(CADB) ROM8:5010 4F ld c,a ROM8:5011 CD D0 19 call 19D0 ROM8:5014 CD 13 1A call 1A13 ROM8:5017 C1 pop bc ROM8:5018 CD D0 19 call 19D0 ROM8:501B CD FB 19 call 19FB ROM8:501E CF rst 08 => 59 03 ROM8:5021 D1 pop de ROM8:5022 C1 pop bc ROM8:5023 F1 pop af ROM8:5024 C9 ret
Swamp Battleguard
ROM8:5025 F5 push af ROM8:5026 C5 push bc ROM8:5027 D5 push de ROM8:5028 11 2A 02 ld de,022A ROM8:502B 7B ld a,e ROM8:502C EA AB C8 ld (C8AB),a ROM8:502F 7A ld a,d ROM8:5030 EA AC C8 ld (C8AC),a ROM8:5033 CD 61 49 call 4961 ;Displays card effect text ROM8:5036 CD 8D 49 call 498D ;Freezes this card ROM8:5039 01 02 01 ld bc,0102 ROM8:503C CF rst 08 ROM8:503D 1F rra ROM8:503E 03 inc bc ROM8:503F FE 00 cp a,00 ROM8:5041 20 03 jr nz,5046 ROM8:5043 CF rst 08 ROM8:5044 21 03 04 ld hl,0403 ROM8:5047 78 ld a,b ROM8:5048 FE 06 cp a,06 ROM8:504A 38 F0 jr c,503C ROM8:504C CF rst 08 => 59 03 ROM8:504F D1 pop de ROM8:5050 C1 pop bc ROM8:5051 F1 pop af ROM8:5052 C9 ret
Lava Battleguard
ROM8:5053 F5 push af ROM8:5054 C5 push bc ROM8:5055 D5 push de ROM8:5056 11 0C 00 ld de,000C ROM8:5059 7B ld a,e ROM8:505A EA AB C8 ld (C8AB),a ROM8:505D 7A ld a,d ROM8:505E EA AC C8 ld (C8AC),a ROM8:5061 CD 61 49 call 4961 ;Displays card effect text ROM8:5064 CD 8D 49 call 498D ;Freezes this card ROM8:5067 01 02 01 ld bc,0102 ROM8:506A CF rst 08 ROM8:506B 1F rra ROM8:506C 03 inc bc ROM8:506D FE 00 cp a,00 ROM8:506F 20 03 jr nz,5074 ROM8:5071 CF rst 08 ROM8:5072 21 03 04 ld hl,0403 ROM8:5075 78 ld a,b ROM8:5076 FE 06 cp a,06 ROM8:5078 38 F0 jr c,506A ROM8:507A CF rst 08 => 59 03 ROM8:507D D1 pop de ROM8:507E C1 pop bc ROM8:507F F1 pop af ROM8:5080 C9 ret
Trent
ROM8:5081 CD 61 49 call 4961 ;Displays card effect text ROM8:5084 CD 8D 49 call 498D ;Freezes this card ROM8:5087 CF rst 08 ROM8:5088 8F adc a ROM8:5089 03 inc bc ROM8:508A CF rst 08 => 59 03 ROM8:508D C9 ret
Labyrinth Tank
ROM8:508E F5 push af ROM8:508F C5 push bc ROM8:5090 D5 push de ROM8:5091 11 6E 01 ld de,016E ROM8:5094 7B ld a,e ROM8:5095 EA AB C8 ld (C8AB),a ROM8:5098 7A ld a,d ROM8:5099 EA AC C8 ld (C8AC),a ROM8:509C CD 61 49 call 4961 ;Displays card effect text ROM8:509F CD 8D 49 call 498D ;Freezes this card ROM8:50A2 01 02 01 ld bc,0102 ROM8:50A5 CF rst 08 ROM8:50A6 1F rra ROM8:50A7 03 inc bc ROM8:50A8 FE 00 cp a,00 ROM8:50AA 20 0D jr nz,50B9 ROM8:50AC C5 push bc ROM8:50AD FA DA CA ld a,(CADA) ROM8:50B0 47 ld b,a ROM8:50B1 FA DB CA ld a,(CADB) ROM8:50B4 4F ld c,a ROM8:50B5 CF rst 08 ROM8:50B6 21 03 C1 ld hl,C103 ROM8:50B9 04 inc b ROM8:50BA 78 ld a,b ROM8:50BB FE 06 cp a,06 ROM8:50BD 38 E6 jr c,50A5 ROM8:50BF CF rst 08 => 59 03 ROM8:50C2 D1 pop de ROM8:50C3 C1 pop bc ROM8:50C4 F1 pop af ROM8:50C5 C9 ret
Spirit of the Book
0x210C6-0x2110F
- Spirit of the Book : Summons a Boo Koo on the field, and freezes it.
ROM8:50C6 F5 push af ROM8:50C7 C5 push bc ROM8:50C8 D5 push de ROM8:50C9 11 E6 01 ld de,01E6 ;Boo Koo ROM8:50CC 7B ld a,e ROM8:50CD EA AB C8 ld (C8AB),a ;Monster to Special Summon = Boo Koo ROM8:50D0 7A ld a,d ROM8:50D1 EA AC C8 ld (C8AC),a ROM8:50D4 CD 61 49 call 4961 ;Displays card effect text ROM8:50D7 CD 8D 49 call 498D ;Freezes this card ROM8:50DA 01 02 01 ld bc,0102 ROM8:50DD CF rst 08 => 11 03 ROM8:50E0 FE 01 cp a,01 ROM8:50E2 28 06 jr z,50EA ;If the selected card zone is free, jump to 8:50EA ROM8:50E4 04 inc b ROM8:50E5 78 ld a,b ROM8:50E6 FE 06 cp a,06 ROM8:50E8 38 F3 jr c,50DD ;If all the Monster card zones have not been checked, loop to 8:50DD ROM8:50EA 78 ld a,b ROM8:50EB FE 06 cp a,06 ROM8:50ED 28 1A jr z,5109 ROM8:50EF CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:50F2 7B ld a,e ROM8:50F3 EA A3 C7 ld (C7A3),a ;Card being processed ROM8:50F6 7A ld a,d ROM8:50F7 EA A4 C7 ld (C7A4),a ROM8:50FA CD 25 20 call 2025 ;Hide Card, reset Level ROM8:50FD CD B4 1F call 1FB4 ;Reset Card Level ROM8:5100 CD C9 1F call 1FC9 ;Reveal Card ROM8:5103 CD DF 1F call 1FDF ;Freezes Card ROM8:5106 CD FB 19 call 19FB ;Update selected card ID and status ROM8:5109 CF rst 08 => 59 03 ROM8:510C D1 pop de ROM8:510D C1 pop bc ROM8:510E F1 pop af ROM8:510F C9 ret
Hourglass of Life
0x21110-0x21138
- Hourglass of Life : Pay 1000 LP to increase own Monsters by 1 Level (+500 ATK).
ROM8:5110 F5 push af ROM8:5111 C5 push bc ROM8:5112 D5 push de ROM8:5113 CD 61 49 call 4961 ;Displays card effect text ROM8:5116 CD 8D 49 call 498D ;Freezes this card ROM8:5119 01 02 01 ld bc,0102 ;Column 1, Row 2 ROM8:511C CF rst 08 ... ROM8:511F FE 00 cp a,00 ROM8:5121 20 03 jr nz,5126 ROM8:5123 CF rst 08 ... ROM8:5126 04 inc b ROM8:5127 78 ld a,b ROM8:5128 FE 06 cp a,06 ROM8:512A 38 F0 jr c,511C ;Loop to 8:511C until every Monster card zone has been checked ROM8:512C 01 00 10 ld bc,1000 ;Cost 1000 LP ROM8:512F CF rst 08 ... ROM8:5132 CF rst 08 => 59 03 ROM8:5135 D1 pop de ROM8:5136 C1 pop bc ROM8:5137 F1 pop af ROM8:5138 C9 ret
Beastking of the Swamp
0x21139-0x21162
- Beastking of the Swamp : Destroys every Monster on the field.
ROM8:5139 F5 push af ROM8:513A C5 push bc ROM8:513B CD 61 49 call 4961 ;Displays card effect text ROM8:513E CD 8D 49 call 498D ;Freezes this card ROM8:5141 01 01 00 ld bc,0001 ROM8:5144 78 ld a,b ROM8:5145 FE 05 cp a,05 ROM8:5147 30 06 jr nc,514F ROM8:5149 CD 86 20 call 2086 ;Remove selected card from the field ROM8:514C 04 inc b ROM8:514D 18 F5 jr 5144 ROM8:514F 01 02 01 ld bc,0102 ROM8:5152 78 ld a,b ROM8:5153 FE 06 cp a,06 ROM8:5155 30 06 jr nc,515D ROM8:5157 CD 6D 20 call 206D ;Remove selected card from the field, and copies it to to (CAD6) ROM8:515A 04 inc b ROM8:515B 18 F5 jr 5152 ROM8:515D CF rst 08 => 59 03 ROM8:5160 C1 pop bc ROM8:5161 F1 pop af ROM8:5162 C9 ret
Nemuriko
0x21139-0x21162
- Nemuriko : Freezes every monster on the field.
ROM8:5163 F5 push af ROM8:5164 C5 push bc ROM8:5165 CD 61 49 call 4961 ;Displays card effect text ROM8:5168 CD 8D 49 call 498D ;Freezes this card ROM8:516B 01 01 00 ld bc,0001 ROM8:516E 78 ld a,b ROM8:516F FE 05 cp a,05 ROM8:5171 30 0F jr nc,5182 ROM8:5173 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:5176 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:5179 CD DF 1F call 1FDF ;Freezes Card ROM8:517C CD FB 19 call 19FB ;Update selected card ID and status ROM8:517F 04 inc b ROM8:5180 18 EC jr 516E ROM8:5182 01 02 01 ld bc,0102 ROM8:5185 78 ld a,b ROM8:5186 FE 06 cp a,06 ROM8:5188 30 0F jr nc,5199 ROM8:518A CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:518D CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROM8:5190 CD DF 1F call 1FDF ;Freezes Card ROM8:5193 CD FB 19 call 19FB ;Update selected card ID and status ROM8:5196 04 inc b ROM8:5197 18 EC jr 5185 ROM8:5199 CF rst 08 => 59 03 ROM8:519C C1 pop bc ROM8:519D F1 pop af ROM8:519E C9 ret
Toad Master
0x210C6-0x2110F
- Toad Master : Summons a Frog the Jam on the field, and freezes it.
ROM8:519F F5 push af ROM8:51A0 C5 push bc ROM8:51A1 D5 push de ROM8:51A2 11 25 02 ld de,0225 ;Frog The Jam ROM8:51A5 7B ld a,e ROM8:51A6 EA AB C8 ld (C8AB),a ;Monster to Special Summon = Frog The Jam ROM8:51A9 7A ld a,d ROM8:51AA EA AC C8 ld (C8AC),a ROM8:51AD CD 61 49 call 4961 ;Displays card effect text ROM8:51B0 CD 8D 49 call 498D ;Freezes this card ROM8:51B3 01 02 01 ld bc,0102 ROM8:51B6 CF rst 08 ... ROM8:51B9 FE 01 cp a,01 ROM8:51BB 28 06 jr z,51C3 ;If the selected card zone is free, jump to 8:51C3 ROM8:51BD 04 inc b ROM8:51BE 78 ld a,b ROM8:51BF FE 06 cp a,06 ROM8:51C1 38 F3 jr c,51B6 ;If all the Monster card zones have not been checked, loop to 8:51B6 ROM8:51C3 78 ld a,b ROM8:51C4 FE 06 cp a,06 ROM8:51C6 28 1A jr z,51E2 ROM8:51C8 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROM8:51CB 7B ld a,e ROM8:51CC EA A3 C7 ld (C7A3),a ROM8:51CF 7A ld a,d ROM8:51D0 EA A4 C7 ld (C7A4),a ROM8:51D3 CD 25 20 call 2025 ;Hide Card, reset Level ROM8:51D6 CD B4 1F call 1FB4 ;Reset Card Level ROM8:51D9 CD C9 1F call 1FC9 ;Reveal Card ROM8:51DC CD DF 1F call 1FDF ;Freezes Card ROM8:51DF CD FB 19 call 19FB ;Update selected card ID and status ROM8:51E2 D1 pop de ROM8:51E3 C1 pop bc ROM8:51E4 F1 pop af ROM8:51E5 C9 ret
Bank 9
Card Drops
Checks Debug mode and Grandpa flag
0x24037-0x24046
- Grandpa gives a card if either Debug mode or Grandpa flag is set
ROM9:4037 FE 00 cp a,00 ROM9:4039 20 07 jr nz,4042 ;If debug, jump to 9:4042 ROM9:403B CF rst 08 25 04 => 4:6DCB, Check if Grandpa flag is set ROM9:403E FE 00 cp a,00 ROM9:4040 20 11 jr nz,4053 ;If Grandpa flag is not set, exit this function ROM9:4042 CD 96 40 call 4096 ;Grandpa gives a card ROM9:4045 C5 push bc ROM9:4046 CF rst 08 9B 01 => 1:4ADF, Returns offset for card ID ROM9:4049 CF rst 08 0B 01 => 1:5292, (Try to) check if card ID is valid, store it to wC5FC ROM9:404C CF rst 08 13 01 => 1: ROM9:404F C1 pop bc ROM9:4050 CF rst 08 0D 02 => 2: ROM9:4053 C1 pop bc ROM9:4054 F1 pop af ROM9:4055 C9 ret
Card drop subroutine
ROM9:4056 F5 push af ROM9:4057 C5 push bc ROM9:4058 D5 push de ROM9:4059 CD B8 24 call 24B8 ;Did the player win ? ROM9:405C FE 00 cp a,00 ROM9:405E 28 26 jr z,4086 ;If the duel was lost, get out of this function ROM9:4060 3E 00 ld a,00 ROM9:4062 EA 59 C8 ld (C859),a ROM9:4065 3E FF ld a,FF ROM9:4067 EA 5A C8 ld (C85A),a ROM9:406A CD 20 1F call 1F20 ;PRN between 0 and 255 ROM9:406D FA 5B C8 ld a,(C85B) ROM9:4070 5F ld e,a ROM9:4071 CD 20 1F call 1F20 ;PRN between 0 and 255 ROM9:4074 FA 5B C8 ld a,(C85B) ROM9:4077 57 ld d,a ;de = [0;65535] ROM9:4078 01 18 01 ld bc,0118 ROM9:407B CD 0A 14 call 140A ROM9:407E 42 ld b,d ROM9:407F 4B ld c,e ROM9:4080 CF rst 08 ... ROM9:4086 D1 pop de ROM9:4087 C1 pop bc ROM9:4088 F1 pop af ROM9:4089 C9 ret
Gives a card to the Player
ROM9:408A F5 push af ROM9:408B 06 00 ld b,00 ROM9:408D FA CC C8 ld a,(C8CC) ;Current CPU opponent ROM9:4090 4F ld c,a ROM9:4091 CD A8 26 call 26A8 ;Gives a card to the Player ROM9:4094 F1 pop af ROM9:4095 C9 ret
Grandpa gives a card
ROM9:4096 F5 push af ROM9:4097 06 00 ld b,00 ROM9:4099 0E 12 ld c,12 ;c = Grandpa ROM9:409B CD A8 26 call 26A8 ;Gives a card to the Player ROM9:409E F1 pop af ROM9:409F C9 ret
If duel was won, Grandpa gives a card
ROM9:40A0 F5 push af ROM9:40A1 C5 push bc ROM9:40A2 CD B8 24 call 24B8 ;Did the player win ? ROM9:40A5 FE 00 cp a,00 ROM9:40A7 28 11 jr z,40BA ;If duel was lost, jump to 9:40BA ROM9:40A9 CD 96 40 call 4096 ;Grandpa gives a card ROM9:40AC C5 push bc ROM9:40AD CF rst 08
ROM9:40BA C1 pop bc ROM9:40BB F1 pop af ROM9:40BC C9 ret
Password mode
Password mode - Main
ROM9:41AF F5 push af ROM9:41B0 C5 push bc ROM9:41B1 D5 push de ROM9:41B2 E5 push hl ROM9:41B3 E8 E8 add sp,E8 ROM9:41B5 F8 00 ld hl,sp+00 ROM9:41B7 54 ld d,h ROM9:41B8 5D ld e,l ROM9:41B9 3E 18 ld a,18 ROM9:41BB CF rst 08 ROM9:41BC 05 dec b ROM9:41BD 02 ld (bc),a ROM9:41BE CD 83 41 call 4183 ROM9:41C1 CD BD 40 call 40BD ROM9:41C4 CD 80 42 call 4280 ROM9:41C7 F8 12 ld hl,sp+12 ROM9:41C9 7E ld a,(hl) ROM9:41CA FE 01 cp a,01 ROM9:41CC 20 25 jr nz,41F3 ROM9:41CE CD 92 44 call 4492 ;Password check subroutine ROM9:41D1 F8 13 ld hl,sp+13 ROM9:41D3 7E ld a,(hl) ROM9:41D4 FE 0A cp a,0A ROM9:41D6 20 05 jr nz,41DD ;If the password is not valid, jump to 9:41D6 ROM9:41D8 CD 33 54 call 5433 ;Check password type ROM9:41DB 18 16 jr 41F3 ROM9:41DD CD E7 44 call 44E7 ;Checks unused passwords ROM9:41E0 F8 13 ld hl,sp+13 ROM9:41E2 7E ld a,(hl) ROM9:41E3 FE 0C cp a,0C ROM9:41E5 20 07 jr nz,41EE ROM9:41E7 3E 19 ld a,19 ROM9:41E9 CF rst 08 ... ROM9:41EC 18 05 jr 41F3 ROM9:41EE 3E 17 ld a,17 ROM9:41F0 CF rst 08 ... ROM9:41F3 E8 18 add sp,18 ROM9:41F5 E1 pop hl ROM9:41F6 D1 pop de ROM9:41F7 C1 pop bc ROM9:41F8 F1 pop af ROM9:41F9 C9 ret
Password screen management
0x243B6-0x243D8
- Password screen management
ROM9:43B6 E5 push hl ROM9:43B7 21 16 00 ld hl,0016 ROM9:43BA 19 add hl,de ROM9:43BB 7E ld a,(hl) ROM9:43BC FE 00 cp a,00 ROM9:43BE 20 05 jr nz,43C5 ROM9:43C0 CD D9 43 call 43D9 ROM9:43C3 18 03 jr 43C8 ROM9:43C5 CD F6 43 call 43F6 ROM9:43C8 3E 06 ld a,06 ROM9:43CA CD E3 0E call 0EE3 ROM9:43CD CD FA 41 call 41FA ROM9:43D0 CD 60 44 call 4460 ROM9:43D3 CD C1 10 call 10C1 ROM9:43D6 AF xor a ROM9:43D7 E1 pop hl ROM9:43D8 C9 ret
Stores password digits in WRAM
0x243D9-0x243F5
- Stores password digits at (CFBC)
ROM9:43D9 F5 push af ROM9:43DA C5 push bc ROM9:43DB E5 push hl ROM9:43DC CD 89 2A call 2A89 ;Sound Effect: Cursor ROM9:43DF 21 11 00 ld hl,0011 ROM9:43E2 19 add hl,de ROM9:43E3 06 00 ld b,00 ROM9:43E5 4E ld c,(hl) ROM9:43E6 62 ld h,d ROM9:43E7 6B ld l,e ROM9:43E8 09 add hl,bc ROM9:43E9 7E ld a,(hl) ROM9:43EA C6 01 add a,01 ROM9:43EC FE 0A cp a,0A ;Password digits are between 0 and 9 ROM9:43EE 20 01 jr nz,43F1 ROM9:43F0 AF xor a ROM9:43F1 77 ld (hl),a ROM9:43F2 E1 pop hl ROM9:43F3 C1 pop bc ROM9:43F4 F1 pop af ROM9:43F5 C9 ret
Stores password digits to display in WRAM
0x24460-0x24485
- Stores digits to display at (C102)
ROM9:4460 F5 push af ROM9:4461 C5 push bc ROM9:4462 E5 push hl ROM9:4463 01 E5 98 ld bc,98E5 ROM9:4466 CD D2 10 call 10D2 ROM9:4469 62 ld h,d ROM9:446A 6B ld l,e ROM9:446B 0E 08 ld c,08 ROM9:446D 2A ldi a,(hl) ROM9:446E C6 01 add a,01 ROM9:4470 CD 13 11 call 1113 ROM9:4473 0D dec c ROM9:4474 20 F7 jr nz,446D ROM9:4476 21 86 44 ld hl,4486 ROM9:4479 0E 0C ld c,0C ROM9:447B 2A ldi a,(hl) ROM9:447C CD 13 11 call 1113 ROM9:447F 0D dec c ROM9:4480 20 F9 jr nz,447B ROM9:4482 E1 pop hl ROM9:4483 C1 pop bc ROM9:4484 F1 pop af ROM9:4485 C9 ret
Password check subroutine
0x24492-0x244D5
- Password check subroutine
ROM9:4492 F5 push af ROM9:4493 C5 push bc ROM9:4494 E5 push hl ROM9:4495 21 14 00 ld hl,0014 ROM9:4498 19 add hl,de ROM9:4499 3E FF ld a,FF ROM9:449B 22 ldi (hl),a ROM9:449C 36 FF ld (hl),FF ROM9:449E 21 13 00 ld hl,0013 ROM9:44A1 19 add hl,de ROM9:44A2 36 0B ld (hl),0B ROM9:44A4 21 08 00 ld hl,0008 ROM9:44A7 19 add hl,de ROM9:44A8 44 ld b,h ROM9:44A9 4D ld c,l ROM9:44AA 62 ld h,d ROM9:44AB 6B ld l,e ROM9:44AC CD D6 44 call 44D6 ;Loads current Password ID being checked ROM9:44AF CD 78 45 call 4578 ;Copies valid password in WRAM ROM9:44B2 CD 2B 45 call 452B ;Checks if the card has no password or if it is the last password ROM9:44B5 FE 01 cp a,01 ROM9:44B7 28 F3 jr z,44AC ;If card checked has no password, loop to 9:44AC ROM9:44B9 FE 00 cp a,00 ROM9:44BB 28 0B jr z,44C8 ;If no more password to check, get out of this function ROM9:44BD D5 push de ROM9:44BE 54 ld d,h ROM9:44BF 5D ld e,l ROM9:44C0 CD 5D 45 call 455D ;Checks password entered ROM9:44C3 D1 pop de ROM9:44C4 FE 0A cp a,0A ROM9:44C6 20 E4 jr nz,44AC ROM9:44C8 FE 00 cp a,00 ROM9:44CA 28 06 jr z,44D2 ROM9:44CC 21 13 00 ld hl,0013 ROM9:44CF 19 add hl,de ROM9:44D0 36 0A ld (hl),0A ROM9:44D2 E1 pop hl ROM9:44D3 C1 pop bc ROM9:44D4 F1 pop af ROM9:44D5 C9 ret
Loads current Password ID being checked
ROM9:44D6 F5 push af ROM9:44D7 E5 push hl ROM9:44D8 21 14 00 ld hl,0014 ROM9:44DB 19 add hl,de ROM9:44DC 7E ld a,(hl) ROM9:44DD C6 01 add a,01 ROM9:44DF 22 ldi (hl),a ROM9:44E0 7E ld a,(hl) ROM9:44E1 CE 00 adc a,00 ROM9:44E3 77 ld (hl),a ROM9:44E4 E1 pop hl ROM9:44E5 F1 pop af ROM9:44E6 C9 ret
Checks unused passwords
ROM9:44E7 F5 push af ROM9:44E8 C5 push bc ROM9:44E9 E5 push hl ROM9:44EA 21 14 00 ld hl,0014 ROM9:44ED 19 add hl,de ROM9:44EE 3E FF ld a,FF ROM9:44F0 22 ldi (hl),a ROM9:44F1 36 FF ld (hl),FF ROM9:44F3 21 13 00 ld hl,0013 ROM9:44F6 19 add hl,de ROM9:44F7 36 0B ld (hl),0B ROM9:44F9 21 08 00 ld hl,0008 ROM9:44FC 19 add hl,de ROM9:44FD 44 ld b,h ROM9:44FE 4D ld c,l ROM9:44FF 62 ld h,d ROM9:4500 6B ld l,e ROM9:4501 CD D6 44 call 44D6 ROM9:4504 CD 49 52 call 5249 ROM9:4507 CD 2B 45 call 452B ;Checks if the card has no password or if it is the last password ROM9:450A FE 01 cp a,01 ROM9:450C 28 F3 jr z,4501 ;If card checked has no password, loop to 9:4501 ROM9:450E FE 00 cp a,00 ROM9:4510 28 0B jr z,451D ;If no more password to check, jump to 9:451D ROM9:4512 D5 push de ROM9:4513 54 ld d,h ROM9:4514 5D ld e,l ROM9:4515 CD 5D 45 call 455D ;Checks password ROM9:4518 D1 pop de ROM9:4519 FE 0A cp a,0A ROM9:451B 20 E4 jr nz,4501 ;If(Entered_password ≠ Card_password), loop to 9:4501 ROM9:451D FE 00 cp a,00 ROM9:451F 28 06 jr z,4527 ROM9:4521 21 13 00 ld hl,0013 ROM9:4524 19 add hl,de ROM9:4525 36 0C ld (hl),0C ROM9:4527 E1 pop hl ROM9:4528 C1 pop bc ROM9:4529 F1 pop af ROM9:452A C9 ret
Checks if the card has no password
ROM9:452B C5 push bc ROM9:452C D5 push de ROM9:452D E5 push hl ROM9:452E 2E 02 ld l,02 ROM9:4530 11 4D 45 ld de,454D ;No more password, 0xFFFFFFFF ROM9:4533 CD 5D 45 call 455D ;Checks password ROM9:4536 FE 0A cp a,0A ROM9:4538 20 02 jr nz,453C ;If(Card_password ≠ 0xFFFFFFFF), a = 2 ROM9:453A 2E 00 ld l,00 ;Else a = 0 ROM9:453C 11 55 45 ld de,4555 ;Card has no password, 0xFFFFFFFE ROM9:453F CD 5D 45 call 455D ;Checks password ROM9:4542 FE 0A cp a,0A ROM9:4544 20 02 jr nz,4548 ;If(Card_password ≠ 0xFFFFFFFE), a = 2 ROM9:4546 2E 01 ld l,01 ;Else a = 1 ROM9:4548 7D ld a,l ROM9:4549 E1 pop hl ROM9:454A D1 pop de ROM9:454B C1 pop bc ROM9:454C C9 ret
« No Password » array
0x2454D-0x2455C
- No passwords array.
0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0E
Checks password entered
0x2455D-0x24577
- Checks if the password entered is valid, and which card to give, which Stage 5 opponent to load, or activate Grandpa giveaways
ROM9:455D C5 push bc ROM9:455E D5 push de ROM9:455F E5 push hl ROM9:4560 60 ld h,b ROM9:4561 69 ld l,c ROM9:4562 06 0A ld b,0A ROM9:4564 0E 08 ld c,08 ;8 digits in a password ROM9:4566 1A ld a,(de) ROM9:4567 BE cp (hl) ;Compares entered password at (CFBC) with valid password at (CFC4) ROM9:4568 28 04 jr z,456E ;If the character is valid, jump to 9:456E ROM9:456A 06 0B ld b,0B ROM9:456C 18 05 jr 4573 ;Else get out of this function ROM9:456E 13 inc de ROM9:456F 23 inc hl ROM9:4570 0D dec c ROM9:4571 20 F3 jr nz,4566 ;Loop 8 times ROM9:4573 78 ld a,b ;b = 0xA if the password is valid, else b = 0xB ROM9:4574 E1 pop hl ROM9:4575 D1 pop de ROM9:4576 C1 pop bc ROM9:4577 C9 ret
Copies valid password in WRAM
0x24578-0x245A4
- Copies valid password in(CFC4)
ROM9:4578 F5 push af ROM9:4579 C5 push bc ROM9:457A D5 push de ROM9:457B E5 push hl ROM9:457C 21 14 00 ld hl,0014 ROM9:457F 19 add hl,de ROM9:4580 2A ldi a,(hl) ROM9:4581 5F ld e,a ROM9:4582 56 ld d,(hl) ROM9:4583 CB 23 sla e ROM9:4585 CB 12 rl d ROM9:4587 CB 23 sla e ROM9:4589 CB 12 rl d ROM9:458B 21 A5 45 ld hl,45A5 ROM9:458E 19 add hl,de ROM9:458F 1E 04 ld e,04 ROM9:4591 7E ld a,(hl) ROM9:4592 E6 F0 and a,F0 ROM9:4594 CB 37 swap a ROM9:4596 02 ld (bc),a ;Copies password in WRAM ROM9:4597 03 inc bc ROM9:4598 2A ldi a,(hl) ROM9:4599 E6 0F and a,0F ROM9:459B 02 ld (bc),a ROM9:459C 03 inc bc ROM9:459D 1D dec e ROM9:459E 20 F1 jr nz,4591 ROM9:45A0 E1 pop hl ROM9:45A1 D1 pop de ROM9:45A2 C1 pop bc ROM9:45A3 F1 pop af ROM9:45A4 C9 ret
Passwords
0x245A9-0x25228
- Cards Passwords0x25229-0x25244
- Grandpa / Stage 5 / Credits Passwords0x25276-0x2541D
- Unusable Passwords
Compares password entered with unusable password list
ROM9:5249 F5 push af ROM9:524A C5 push bc ROM9:524B D5 push de ROM9:524C E5 push hl ROM9:524D 21 14 00 ld hl,0014 ROM9:5250 19 add hl,de ROM9:5251 2A ldi a,(hl) ROM9:5252 5F ld e,a ROM9:5253 56 ld d,(hl) ROM9:5254 CB 23 sla e ROM9:5256 CB 12 rl d ROM9:5258 CB 23 sla e ROM9:525A CB 12 rl d ROM9:525C 21 76 52 ld hl,5276 ;Unusable Passwords array ROM9:525F 19 add hl,de ROM9:5260 1E 04 ld e,04 ROM9:5262 7E ld a,(hl) ROM9:5263 E6 F0 and a,F0 ROM9:5265 CB 37 swap a ROM9:5267 02 ld (bc),a ROM9:5268 03 inc bc ROM9:5269 2A ldi a,(hl) ROM9:526A E6 0F and a,0F ROM9:526C 02 ld (bc),a ROM9:526D 03 inc bc ROM9:526E 1D dec e ROM9:526F 20 F1 jr nz,5262 ROM9:5271 E1 pop hl ROM9:5272 D1 pop de ROM9:5273 C1 pop bc ROM9:5274 F1 pop af ROM9:5275 C9 ret
Special passwords handling
9:5422
ROM9:5422 F5 push af ROM9:5423 C5 push bc ROM9:5424 E5 push hl ROM9:5425 21 49 CA ld hl,CA49 ROM9:5428 AF xor a ROM9:5429 0E 7D ld c,7D ROM9:542B 22 ldi (hl),a ROM9:542C 0D dec c ROM9:542D 20 FC jr nz,542B ROM9:542F E1 pop hl ROM9:5430 C1 pop bc ROM9:5431 F1 pop af ROM9:5432 C9 ret
Check password type
ROM9:5433 F5 push af ROM9:5434 C5 push bc ROM9:5435 E5 push hl ROM9:5436 21 14 00 ld hl,0014 ROM9:5439 19 add hl,de ROM9:543A 2A ldi a,(hl) ROM9:543B 4F ld c,a ROM9:543C 46 ld b,(hl) ROM9:543D CD 6A 55 call 556A ROM9:5440 FE 00 cp a,00 ROM9:5442 20 13 jr nz,5457 ;if it is a special password, jump to 9:5457 ROM9:5444 CD 7F 55 call 557F ROM9:5447 FE 00 cp a,00 ROM9:5449 20 05 jr nz,5450 ROM9:544B CD 5E 54 call 545E ROM9:544E 18 05 jr 5455 ROM9:5450 3E 16 ld a,16 ;To make 2:6F60 call subroutine Text: Yami Yugi - Password already entered ROM9:5452 CF rst 08 => 05 02 Text display subroutine ROM9:5455 18 03 jr 545A ROM9:5457 CD 86 54 call 5486 ;Loads subroutine for the entered special password ROM9:545A E1 pop hl ROM9:545B C1 pop bc ROM9:545C F1 pop af ROM9:545D C9 ret
9:545E
ROM9:545E F5 push af ROM9:545F C5 push bc ROM9:5460 D5 push de ROM9:5461 E5 push hl ROM9:5462 11 20 03 ld de,0320 ROM9:5465 CD 6D 54 call 546D ROM9:5468 E1 pop hl ROM9:5469 D1 pop de ROM9:546A C1 pop bc ROM9:546B F1 pop af ROM9:546C C9 ret
9:546D
ROM9:546D F5 push af ROM9:546E C5 push bc ROM9:546F CD A9 55 call 55A9 ROM9:5472 C5 push bc ROM9:5473 CF rst 08 ROM9:5474 9B sbc e ROM9:5475 01 CF 0B ld bc,0BCF ROM9:5478 01 CF 13 ld bc,13CF ROM9:547B 01 C1 CF ld bc,CFC1 ROM9:547E 09 add hl,bc ROM9:547F 04 inc b ROM9:5480 CF rst 08 => 0F 02 ROM9:5483 C1 pop bc ROM9:5484 F1 pop af ROM9:5485 C9 ret
Loads subroutine for the entered special password
ROM9:5486 F5 push af ROM9:5487 C5 push bc ROM9:5488 E5 push hl ROM9:5489 06 00 ld b,00 ROM9:548B 4F ld c,a ROM9:548C CB 21 sla c ROM9:548E 21 9E 54 ld hl,549E ROM9:5491 09 add hl,bc ROM9:5492 2A ldi a,(hl) ROM9:5493 66 ld h,(hl) ROM9:5494 6F ld l,a ROM9:5495 01 9A 54 ld bc,549A ROM9:5498 C5 push bc ROM9:5499 E9 jp hl ROM9:549A E1 pop hl ROM9:549B C1 pop bc ROM9:549C F1 pop af ROM9:549D C9 ret
Pointers to subroutines
0x2549E
- Pointers to special password subroutines
ROM9:549E B0 54 - 00 - Fail-safe (ret) B1 54 - 01 - Grandpa password entered BF 54 - 02 - Yami Yugi - Stage 5 password entered DD 54 - 03 - Yami Bakura - Stage 5 password entered FB 54 - 04 - Nitemare - Stage 5 password entered 19 55 - 05 - Shadi - Stage 5 password entered 37 55 - 06 - Marik Ishtar - Stage 5 password entered 55 55 - 07 - Credits 5C 55 - 08 - Legendary card password (Unused)
Fail-safe (ret)
ROM9:54B0 C9 ret
Grandpa password entered
ROM9:54B1 F5 push af ROM9:54B2 CF rst 08 => 27 04 ROM9:54B5 CF rst 08 => 09 04 ROM9:54B8 3E 21 ld a,21 ;To make 2:6F60 call subroutine Text: Grandpa - Grandpa password entered ROM9:54BA CF rst 08 => 05 02 Text display subroutine ROM9:54BD F1 pop af ROM9:54BE C9 ret
Yami Yugi - Stage 5 password entered
ROM9:54BF F5 push af ROM9:54C0 CD C5 28 call 28C5 ROM9:54C3 FE 04 cp a,04 ROM9:54C5 20 0F jr nz,54D6 ;if Stage 5 has not been unlocked, jump to 9:54D6 ROM9:54C7 3E 00 ld a,00 ROM9:54C9 CF rst 08 => 23 04 ROM9:54CC CF rst 08 => 09 04 ROM9:54CF 3E 1C ld a,1C ;To make 2:6F60 call subroutine Text: Yami Yugi - Stage 5 password entered ROM9:54D1 CF rst 08 => 05 02 Text display subroutine ROM9:54D4 18 05 jr 54DB ROM9:54D6 3E 23 ld a,23 ;To make 2:6F60 call subroutine Text: Yami Yugi - Password can't be used yet ROM9:54D8 CF rst 08 => 05 02 Text display subroutine ROM9:54DB F1 pop af ROM9:54DC C9 ret
Yami Bakura - Stage 5 password entered
ROM9:54DD F5 push af ROM9:54DE CD C5 28 call 28C5 ROM9:54E1 FE 04 cp a,04 ROM9:54E3 20 0F jr nz,54F4 ROM9:54E5 3E 01 ld a,01 ROM9:54E7 CF rst 08 ROM9:54E8 23 inc hl ROM9:54E9 04 inc b ROM9:54EA CF rst 08 ROM9:54EB 09 add hl,bc ROM9:54EC 04 inc b ROM9:54ED 3E 1D ld a,1D ROM9:54EF CF rst 08 => 05 02 Text display subroutine ROM9:54F2 18 05 jr 54F9 ROM9:54F4 3E 23 ld a,23 ROM9:54F6 CF rst 08 => 05 02 Text display subroutine ROM9:54F9 F1 pop af ROM9:54FA C9 ret
Nitemare - Stage 5 password entered
ROM9:54FB F5 push af ROM9:54FC CD C5 28 call 28C5 ROM9:54FF FE 04 cp a,04 ROM9:5501 20 0F jr nz,5512 ROM9:5503 3E 02 ld a,02 ROM9:5505 CF rst 08 ROM9:5506 23 inc hl ROM9:5507 04 inc b ROM9:5508 CF rst 08 ROM9:5509 09 add hl,bc ROM9:550A 04 inc b ROM9:550B 3E 1E ld a,1E ROM9:550D CF rst 08 => 05 02 Text display subroutine ROM9:5510 18 05 jr 5517 ROM9:5512 3E 23 ld a,23 ROM9:5514 CF rst 08 => 05 02 Text display subroutine ROM9:5517 F1 pop af ROM9:5518 C9 ret
Shadi - Stage 5 password entered
ROM9:5519 F5 push af ROM9:551A CD C5 28 call 28C5 ROM9:551D FE 04 cp a,04 ROM9:551F 20 0F jr nz,5530 ROM9:5521 3E 03 ld a,03 ROM9:5523 CF rst 08 ROM9:5524 23 inc hl ROM9:5525 04 inc b ROM9:5526 CF rst 08 ROM9:5527 09 add hl,bc ROM9:5528 04 inc b ROM9:5529 3E 1F ld a,1F ROM9:552B CF rst 08 => 05 02 Text display subroutine ROM9:552E 18 05 jr 5535 ROM9:5530 3E 23 ld a,23 ROM9:5532 CF rst 08 => 05 02 Text display subroutine ROM9:5535 F1 pop af ROM9:5536 C9 ret
Marik Ishtar - Stage 5 password entered
ROM9:5537 F5 push af ROM9:5538 CD C5 28 call 28C5 ROM9:553B FE 04 cp a,04 ROM9:553D 20 0F jr nz,554E ROM9:553F 3E 04 ld a,04 ROM9:5541 CF rst 08 ROM9:5542 23 inc hl ROM9:5543 04 inc b ROM9:5544 CF rst 08 ROM9:5545 09 add hl,bc ROM9:5546 04 inc b ROM9:5547 3E 20 ld a,20 ROM9:5549 CF rst 08 => 05 02 Text display subroutine ROM9:554C 18 05 jr 5553 ROM9:554E 3E 23 ld a,23 ROM9:5550 CF rst 08 => 05 02 Text display subroutine ROM9:5553 F1 pop af ROM9:5554 C9 ret
Credits
ROM9:5555 CD 51 2A call 2A51 ;Credits music ROM9:5558 CF rst 08 => 03 11 ROM9:555B C9 ret
Legendary card password (Unused)
ROM9:555C F5 push af ROM9:555D 3E 22 ld a,22 ;To make 2:6F60 call subroutine Text: Simon Muran - Legendary card password (Unused) ROM9:555F CF rst 08 => 05 02 Text display subroutine ROM9:5562 CF rst 08 => 19 0A ROM9:5565 CF rst 08 => 1B 0A ROM9:5568 F1 pop af ROM9:5569 C9 ret
9:556A
ROM9:556A C5 push bc ROM9:556B D5 push de ROM9:556C 11 20 03 ld de,0320 ;de = 0d800 ROM9:556F CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROM9:5572 FE 00 cp a,00 ROM9:5574 28 04 jr z,557A ;if (current_card_ID > 800), jump to 9:557A ROM9:5576 3E 00 ld a,00 ROM9:5578 18 02 jr 557C ROM9:557A 79 ld a,c ;a = c ; special_password_ID ROM9:557B 93 sub e ROM9:557C D1 pop de ROM9:557D C1 pop bc ROM9:557E C9 ret
9:557F
ROM9:557F C5 push bc ROM9:5580 D5 push de ROM9:5581 E5 push hl ROM9:5582 1E 01 ld e,01 ;e = 1 ROM9:5584 AF xor a ;a = 0 ROM9:5585 CB 38 srl b ROM9:5587 CB 19 rr c ROM9:5589 1F rra ROM9:558A CB 38 srl b ROM9:558C CB 19 rr c ROM9:558E 1F rra ROM9:558F CB 38 srl b ROM9:5591 CB 19 rr c ROM9:5593 1F rra ROM9:5594 1F rra ROM9:5595 CB 37 swap a ROM9:5597 21 49 CA ld hl,CA49 ROM9:559A 09 add hl,bc ;hl = pointer to array at wCA49 + bc ROM9:559B CD 7B 16 call 167B ROM9:559E FE 00 cp a,00 ROM9:55A0 20 02 jr nz,55A4 ROM9:55A2 1E 00 ld e,00 ROM9:55A4 7B ld a,e ROM9:55A5 E1 pop hl ROM9:55A6 D1 pop de ROM9:55A7 C1 pop bc ROM9:55A8 C9 ret
Bank A
rst 08 pointers
ROMA:4002 1C 40 3A 40 19 47 1A 47 2B 47 A1 47 06 4A 1B 47 - Remove Player's Trap at turn start 1F 47 - Remove CPU's Trap at turn start 23 47 - Remove Player's Trap 27 47 - Remove CPU's Trap DF 4C CE 4D
Copy CPU deck to (C65A)
ROMA:401C F5 push af ROMA:401D C5 push bc ROMA:401E D5 push de ROMA:401F E5 push hl ROMA:4020 1E 00 ld e,00 ROMA:4022 7B ld a,e ROMA:4023 FE 28 cp a,28 ;40 cards in a deck ROMA:4025 30 0E jr nc,4035 ;If the deck is fully loaded, get out of this function ROMA:4027 7B ld a,e ROMA:4028 CF rst 08 ROMA:4029 7D 03 => Pointer 03:407D (Writes value in CPU's deck counter) ROMA:402B 2A ldi a,(hl) ROMA:402C 4F ld c,a ROMA:402D 2A ldi a,(hl) ROMA:402E 47 ld b,a ROMA:402F CF rst 08 ROMA:4030 7F 03 => Pointer 03:407F (Writes next card in CPU's deck) ROMA:4032 1C inc e ROMA:4033 18 ED jr 4022 ROMA:4035 E1 pop hl ROMA:4036 D1 pop de ROMA:4037 C1 pop bc ROMA:4038 F1 pop af ROMA:4039 C9 ret
Load CPU deck
ROMA:403A F5 push af ROMA:403B D5 push de ROMA:403C E5 push hl ROMA:403D 5F ld e,a ROMA:403E 06 00 ld b,00 ROMA:4040 FA CC C8 ld a,(C8CC) ROMA:4043 4F ld c,a ROMA:4044 CB 21 sla c ROMA:4046 21 59 40 ld hl,4059 ;CPU decks pointers ROMA:4049 09 add hl,bc ROMA:404A 2A ldi a,(hl) ROMA:404B 66 ld h,(hl) ROMA:404C 6F ld l,a ROMA:404D 16 00 ld d,00 ROMA:404F CB 23 sla e ROMA:4051 19 add hl,de ;hl = CPU decks pointer + (current position × 2) ROMA:4052 2A ldi a,(hl) ROMA:4053 46 ld b,(hl) ROMA:4054 4F ld c,a ;bc = Card ID ROMA:4055 E1 pop hl ROMA:4056 D1 pop de ROMA:4057 F1 pop af ROMA:4058 C9 ret
CPU Decks pointers
ROMA:4059 89 40 - Weevil D9 40 - Mai Valentine 29 41 - Rex Raptor 79 41 - Mako Tsunami C9 41 - Yami Yugi 19 42 - Yugi Muto 69 42 - Tea Gardner (No Deck) 69 42 - Joey Wheeler B9 42 - Seto Kaiba 09 43 - Espa Roba 59 43 - Tristan Taylor A9 43 - Rare Hunter F9 43 - Pandora 49 44 - Marik Ishtar 99 44 - Heishin E9 44 - P. Seto 39 45 - Simon Muran 89 45 - Exosha 89 45 - Grandpa 89 45 - Yami Bakura D9 45 - Shadi 29 46 - DarkNite 79 46 - Nitemare C9 46 - Ishizu Ishtar
CPU Decks
0x28089
- Weevil0x280D9
- Mai Valentine0x28129
- Rex Raptor0x28179
- Mako Tsunami0x281C9
- Yami Yugi0x28219
- Yugi Muto0x28269
- Joey Wheeler0x282B9
- Seto Kaiba0x28309
- Espa Roba0x28359
- Tristan Taylor0x283A9
- Rare Hunter0x283F9
- Pandora0x28449
- Marik Ishtar0x28499
- Heishin0x284E9
- P. Seto0x28539
- Simon Muran0x28589
- Yami Bakura0x285D9
- Shadi0x28629
- DarkNite0x28679
- Nitemare0x286C9
- Isis Ishtar
Traps mechanics
Trap removal
Remove Player's Trap at turn start
0x2871B-0x2871E
- Remove Player's Trap at turn start
ROMA:471B CF rst 08 ROMA:471C 4D 03 => Pointer 03:404D (Remove Player's Trap) ROMA:471E C9 ret
Remove CPU's Trap at turn start
0x2871F-0x28722
- Remove CPU's Trap at turn start
ROMA:471F CF rst 08 ROMA:4720 4F 03 => Pointer 03:404F (Remove CPU's Trap) ROMA:4722 C9 ret
Remove Player's Trap
0x28723-0x28726
- Remove Player's Trap
ROMA:4723 CF rst 08 ROMA:4724 4D 03 => Pointer 03:404D (Remove Player's Trap) ROMA:4726 C9 ret
Remove CPU's Trap
0x28727-0x2872A
- Remove CPU's Trap
ROMA:4727 CF rst 08 ROMA:4728 4F 03 => Pointer 03:404F (Remove P2's Trap) ROMA:472A C9 ret
A:472B (stores register bc in (CA47))
ROMA:472B F5 push af ROMA:472C 78 ld a,b ROMA:472D EA 47 CA ld (CA47),a ROMA:4730 79 ld a,c ROMA:4731 EA 48 CA ld (CA48),a ROMA:4734 F1 pop af ROMA:4735 C9 ret
Trap card position
0x28736-0x28755
- Reinitializes Duel cursor position
ROMA:4736 C5 push bc ROMA:4737 FA B0 C7 ld a,(C7B0) ROMA:473A FE 01 cp a,01 ROMA:473C 20 06 jr nz,4744 ;If(current turn ≠ Player's turn), jump to A:4744 ROMA:473E 0E 00 ld c,00 ;Row = 0 ROMA:4740 06 05 ld b,05 ;Column = 5 ROMA:4742 18 04 jr 4748 ROMA:4744 0E 03 ld c,03 ;Row = 3 ROMA:4746 06 00 ld b,00 ;Column = 0 ROMA:4748 CD D0 19 call 19D0 ;Updates field Column and Row ROMA:474B CD 13 1A call 1A13 ;Stores selected card ID and status ROMA:474E CF rst 08 ROMA:474F 0B 07 => 7:400B ROMA:4751 CD 56 47 call 4756 ROMA:4754 C1 pop bc ROMA:4755 C9 ret
Trap activation routine
ROMA:4756 C5 push bc ROMA:4757 0E 00 ld c,00 ROMA:4759 FA BF C6 ld a,(C6BF) ;Effect ID (magic trap ritual) ROMA:475C FE 37 cp a,37 ;Widespread Ruin ROMA:475E 20 02 jr nz,4762 ROMA:4760 0E 01 ld c,01 ROMA:4762 FE 38 cp a,38 ;House of Adhesive Trap ROMA:4764 20 02 jr nz,4768 ROMA:4766 0E 02 ld c,02 ROMA:4768 FE 39 cp a,39 ;Eatgaboon ROMA:476A 20 02 jr nz,476E ROMA:476C 0E 03 ld c,03 ROMA:476E FE 3A cp a,3A ;Bear Trap ROMA:4770 20 02 jr nz,4774 ROMA:4772 0E 04 ld c,04 ROMA:4774 FE 3B cp a,3B ;Invisible Wire ROMA:4776 20 02 jr nz,477A ROMA:4778 0E 05 ld c,05 ROMA:477A FE 3C cp a,3C ;Acid Trap Hole ROMA:477C 20 02 jr nz,4780 ROMA:477E 0E 06 ld c,06 ROMA:4780 FE 3D cp a,3D ;Goblin Fan ROMA:4782 20 02 jr nz,4786 ROMA:4784 0E 07 ld c,07 ROMA:4786 FE 3E cp a,3E ;Simochi Allergy ROMA:4788 20 02 jr nz,478C ROMA:478A 0E 08 ld c,08 ROMA:478C FE 3F cp a,3F ;Reverse Trap ROMA:478E 20 02 jr nz,4792 ROMA:4790 0E 09 ld c,09 ROMA:4792 FE 40 cp a,40 ;Fake Trap ROMA:4794 20 02 jr nz,4798 ROMA:4796 0E 0A ld c,0A ROMA:4798 FE 72 cp a,72 ;Anti Raigeki ROMA:479A 20 02 jr nz,479E ROMA:479C 0E 0B ld c,0B ROMA:479E 79 ld a,c ROMA:479F C1 pop bc ROMA:47A0 C9 ret
Load appropriate Trap pointer to hl
ROMA:47A1 C5 push bc ROMA:47A2 E5 push hl ROMA:47A3 06 00 ld b,00 ROMA:47A5 CD 36 47 call 4736 ;Trap card position ROMA:47A8 4F ld c,a ROMA:47A9 CB 21 sla c ROMA:47AB 21 BA 47 ld hl,47BA ROMA:47AE 09 add hl,bc ROMA:47AF 2A ldi a,(hl) ROMA:47B0 66 ld h,(hl) ROMA:47B1 6F ld l,a ROMA:47B2 01 B7 47 ld bc,47B7 ROMA:47B5 C5 push bc ROMA:47B6 E9 jp hl ROMA:47B7 E1 pop hl ROMA:47B8 C1 pop bc ROMA:47B9 C9 ret
Trap pointers
ROMA:47BA E4 47 - No Trap E7 47 - Widespread Ruin 09 48 - House of Adhesive Trap 3F 48 - Eatgaboon 75 48 - Bear Trap AB 48 - Invisible Wire E1 48 - Acid Trap Hole 17 49 - Goblin Fan 4B 49 - Simochi Allergy 7F 49 - Reverse Trap CC 49 - Fake Trap CF 49 - Anti Raigeki FD 49 - ret FE 49 - ret FF 49 - ret 00 4A - ret 01 4A - ret 02 4A - ret 03 4A - ret 04 4A - ret 05 4A - ret
No Trap
ROMA:47E4 3E 00 ld a,00 ROMA:47E6 C9 ret
Widespread Ruin
ROMA:47E7 C5 push bc ROMA:47E8 E5 push hl ROMA:47E9 FA 47 CA ld a,(CA47) ROMA:47EC 47 ld b,a ROMA:47ED FA 48 CA ld a,(CA48) ROMA:47F0 4F ld c,a ROMA:47F1 CD D0 19 call 19D0 ROMA:47F4 CD 13 1A call 1A13 ROMA:47F7 CF rst 08 ROMA:47F8 0B dec bc ROMA:47F9 07 rlca ROMA:47FA 2E 00 ld l,00 ROMA:47FC FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:47FF FE 02 cp a,02 ROMA:4801 20 02 jr nz,4805 ;if not a Monster Card, exit this function ROMA:4803 2E 01 ld l,01 ROMA:4805 7D ld a,l ROMA:4806 E1 pop hl ROMA:4807 C1 pop bc ROMA:4808 C9 ret
House of Adhesive Trap
ROMA:4809 C5 push bc ROMA:480A D5 push de ROMA:480B E5 push hl ROMA:480C FA 47 CA ld a,(CA47) ROMA:480F 47 ld b,a ROMA:4810 FA 48 CA ld a,(CA48) ROMA:4813 4F ld c,a ROMA:4814 CD D0 19 call 19D0 ROMA:4817 CD 13 1A call 1A13 ROMA:481A CF rst 08 ROMA:481B 0B dec bc ROMA:481C 07 rlca ROMA:481D 2E 00 ld l,00 ROMA:481F FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:4822 FE 02 cp a,02 ROMA:4824 20 14 jr nz,483A ;if not a Monster Card, exit this function ROMA:4826 FA B7 C6 ld a,(C6B7) ROMA:4829 4F ld c,a ROMA:482A FA B8 C6 ld a,(C6B8) ROMA:482D 47 ld b,a ;bc = Current card ATK ROMA:482E 11 00 05 ld de,0500 ROMA:4831 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROMA:4834 FE 00 cp a,00 ROMA:4836 28 02 jr z,483A ;if(ATK > 500), exit this function ROMA:4838 2E 01 ld l,01 ROMA:483A 7D ld a,l ROMA:483B E1 pop hl ROMA:483C D1 pop de ROMA:483D C1 pop bc ROMA:483E C9 ret
Eatgaboon
ROMA:483F C5 push bc ROMA:4840 D5 push de ROMA:4841 E5 push hl ROMA:4842 FA 47 CA ld a,(CA47) ROMA:4845 47 ld b,a ROMA:4846 FA 48 CA ld a,(CA48) ROMA:4849 4F ld c,a ROMA:484A CD D0 19 call 19D0 ROMA:484D CD 13 1A call 1A13 ROMA:4850 CF rst 08 ROMA:4851 0B dec bc ROMA:4852 07 rlca ROMA:4853 2E 00 ld l,00 ROMA:4855 FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:4858 FE 02 cp a,02 ROMA:485A 20 14 jr nz,4870 ;if not a Monster Card, exit this function ROMA:485C FA B7 C6 ld a,(C6B7) ROMA:485F 4F ld c,a ROMA:4860 FA B8 C6 ld a,(C6B8) ROMA:4863 47 ld b,a ;bc = Current card ATK ROMA:4864 11 00 10 ld de,1000 ROMA:4867 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROMA:486A FE 00 cp a,00 ROMA:486C 28 02 jr z,4870 ;if(ATK > 1000), exit this function ROMA:486E 2E 01 ld l,01 ROMA:4870 7D ld a,l ROMA:4871 E1 pop hl ROMA:4872 D1 pop de ROMA:4873 C1 pop bc ROMA:4874 C9 ret
Bear Trap
ROMA:4875 C5 push bc ROMA:4876 D5 push de ROMA:4877 E5 push hl ROMA:4878 FA 47 CA ld a,(CA47) ROMA:487B 47 ld b,a ROMA:487C FA 48 CA ld a,(CA48) ROMA:487F 4F ld c,a ROMA:4880 CD D0 19 call 19D0 ROMA:4883 CD 13 1A call 1A13 ROMA:4886 CF rst 08 ROMA:4887 0B dec bc ROMA:4888 07 rlca ROMA:4889 2E 00 ld l,00 ROMA:488B FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:488E FE 02 cp a,02 ROMA:4890 20 14 jr nz,48A6 ;if not a Monster Card, exit this function ROMA:4892 FA B7 C6 ld a,(C6B7) ROMA:4895 4F ld c,a ROMA:4896 FA B8 C6 ld a,(C6B8) ROMA:4899 47 ld b,a ;bc = Current card ATK ROMA:489A 11 00 15 ld de,1500 ROMA:489D CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROMA:48A0 FE 00 cp a,00 ROMA:48A2 28 02 jr z,48A6 ;if(ATK > 1500), exit this function ROMA:48A4 2E 01 ld l,01 ROMA:48A6 7D ld a,l ROMA:48A7 E1 pop hl ROMA:48A8 D1 pop de ROMA:48A9 C1 pop bc ROMA:48AA C9 ret
Invisible Wire
ROMA:48AB C5 push bc ROMA:48AC D5 push de ROMA:48AD E5 push hl ROMA:48AE FA 47 CA ld a,(CA47) ROMA:48B1 47 ld b,a ROMA:48B2 FA 48 CA ld a,(CA48) ROMA:48B5 4F ld c,a ROMA:48B6 CD D0 19 call 19D0 ROMA:48B9 CD 13 1A call 1A13 ROMA:48BC CF rst 08 ROMA:48BD 0B dec bc ROMA:48BE 07 rlca ROMA:48BF 2E 00 ld l,00 ROMA:48C1 FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:48C4 FE 02 cp a,02 ROMA:48C6 20 14 jr nz,48DC ;if not a Monster Card, exit this function ROMA:48C8 FA B7 C6 ld a,(C6B7) ROMA:48CB 4F ld c,a ROMA:48CC FA B8 C6 ld a,(C6B8) ROMA:48CF 47 ld b,a ;bc = Current card ATK ROMA:48D0 11 00 20 ld de,2000 ROMA:48D3 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROMA:48D6 FE 00 cp a,00 ROMA:48D8 28 02 jr z,48DC ;if(ATK > 2000), exit this function ROMA:48DA 2E 01 ld l,01 ROMA:48DC 7D ld a,l ROMA:48DD E1 pop hl ROMA:48DE D1 pop de ROMA:48DF C1 pop bc ROMA:48E0 C9 ret
Acid Trap Hole
ROMA:48E1 C5 push bc ROMA:48E2 D5 push de ROMA:48E3 E5 push hl ROMA:48E4 FA 47 CA ld a,(CA47) ;Column ROMA:48E7 47 ld b,a ROMA:48E8 FA 48 CA ld a,(CA48) ;Row ROMA:48EB 4F ld c,a ROMA:48EC CD D0 19 call 19D0 ROMA:48EF CD 13 1A call 1A13 ROMA:48F2 CF rst 08 ROMA:48F3 0B dec bc ROMA:48F4 07 rlca ROMA:48F5 2E 00 ld l,00 ROMA:48F7 FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:48FA FE 02 cp a,02 ROMA:48FC 20 14 jr nz,4912 ;if not a Monster Card, exit this function ROMA:48FE FA B7 C6 ld a,(C6B7) ROMA:4901 4F ld c,a ROMA:4902 FA B8 C6 ld a,(C6B8) ROMA:4905 47 ld b,a ;bc = Current card ATK ROMA:4906 11 00 30 ld de,3000 ROMA:4909 CD 23 1B call 1B23 ;Checks if bc is less than, equal to, or greater than de ROMA:490C FE 00 cp a,00 ROMA:490E 28 02 jr z,4912 ;if(ATK > 3000), exit this function ROMA:4910 2E 01 ld l,01 ROMA:4912 7D ld a,l ROMA:4913 E1 pop hl ROMA:4914 D1 pop de ROMA:4915 C1 pop bc ROMA:4916 C9 ret
Goblin Fan
ROMA:4917 C5 push bc ROMA:4918 D5 push de ROMA:4919 E5 push hl ROMA:491A FA 47 CA ld a,(CA47) ;Column ROMA:491D 47 ld b,a ROMA:491E FA 48 CA ld a,(CA48) ;Row ROMA:4921 4F ld c,a ROMA:4922 CD D0 19 call 19D0 ROMA:4925 CD 13 1A call 1A13 ROMA:4928 CF rst 08 ROMA:4929 0B dec bc ROMA:492A 07 rlca ROMA:492B 16 00 ld d,00 ROMA:492D FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMA:4930 5F ld e,a ROMA:4931 21 45 49 ld hl,4945 ROMA:4934 2A ldi a,(hl) ROMA:4935 FE FF cp a,FF ROMA:4937 28 07 jr z,4940 ROMA:4939 BB cp e ROMA:493A 20 02 jr nz,493E ROMA:493C 16 01 ld d,01 ROMA:493E 18 F4 jr 4934 ROMA:4940 7A ld a,d ROMA:4941 E1 pop hl ROMA:4942 D1 pop de ROMA:4943 C1 pop bc ROMA:4944 C9 ret 0E - Sparks 0F - Hinotama 10 - Final Flame 11 - Ookazi 12 - Tremendous Fire FF
Simochi Allergy
ROMA:494B C5 push bc ROMA:494C D5 push de ROMA:494D E5 push hl ROMA:494E FA 47 CA ld a,(CA47) ROMA:4951 47 ld b,a ROMA:4952 FA 48 CA ld a,(CA48) ROMA:4955 4F ld c,a ROMA:4956 CD D0 19 call 19D0 ROMA:4959 CD 13 1A call 1A13 ROMA:495C CF rst 08 ROMA:495D 0B dec bc ROMA:495E 07 rlca ROMA:495F 16 00 ld d,00 ROMA:4961 FA BF C6 ld a,(C6BF) ROMA:4964 5F ld e,a ROMA:4965 21 79 49 ld hl,4979 ROMA:4968 2A ldi a,(hl) ROMA:4969 FE FF cp a,FF ROMA:496B 28 07 jr z,4974 ROMA:496D BB cp e ROMA:496E 20 02 jr nz,4972 ROMA:4970 16 01 ld d,01 ROMA:4972 18 F4 jr 4968 ROMA:4974 7A ld a,d ROMA:4975 E1 pop hl ROMA:4976 D1 pop de ROMA:4977 C1 pop bc ROMA:4978 C9 ret 09 - Mooyan Curry 0A - Red Medicine 0B - Goblin's Secret Remedy 0C - Soul of the Pure 0D - Dian Keto the Cure Master FF
Reverse Trap
ROMA:497F C5 push bc ROMA:4980 D5 push de ROMA:4981 FA 47 CA ld a,(CA47) ROMA:4984 47 ld b,a ROMA:4985 FA 48 CA ld a,(CA48) ROMA:4988 4F ld c,a ROMA:4989 CD D0 19 call 19D0 ROMA:498C CD 13 1A call 1A13 ROMA:498F CF rst 08 ROMA:4990 0B dec bc ROMA:4991 07 rlca ROMA:4992 16 00 ld d,00 ROMA:4994 FA BF C6 ld a,(C6BF) ROMA:4997 5F ld e,a ROMA:4998 21 AB 49 ld hl,49AB ROMA:499B 2A ldi a,(hl) ROMA:499C FE FF cp a,FF ROMA:499E 28 07 jr z,49A7 ROMA:49A0 BB cp e ROMA:49A1 20 02 jr nz,49A5 ROMA:49A3 16 01 ld d,01 ROMA:49A5 18 F4 jr 499B ROMA:49A7 7A ld a,d ROMA:49A8 D1 pop de ROMA:49A9 C1 pop bc ROMA:49AA C9 ret
15 - Legendary Sword 16 - Sword of Ruin 17 - Dark Energy 18 - Axe of Despair 19 - Lazer Cannon Armor 1A - Insect Armor with Fire 1B - Elf's Light 1C - Beast Fangs 1D - Steel Shell 1E - Vile Germs 1F - Black Pendant 20 - Silver Bow & Arrow 21 - Horn of Light 22 - Horn of the Unicorn 23 - Dragon Treasure 24 - Electro-whip 25 - Cyber Shield 26 - Mystical Moon 27 - Malevolent Nuzzler 28 - Violet Crystal 29 - Book of Secret Art 2A - Invigoration 2B - Machine Conversion 2C - Raise Body Heat 2D - Follow Wind 2E - Power of Kaishin 4D - Magical Labyrinth 4E - Salamandra 4F - Kunai with Chain 50 - Bright Castle 62 - Megamorph 64 - Winged Trumpeter FF
Fake Trap
ROMA:49CC 3E 00 ld a,00 ROMA:49CE C9 ret
Anti Raigeki
ROMA:49CF C5 push bc ROMA:49D0 D5 push de ROMA:49D1 FA 47 CA ld a,(CA47) ROMA:49D4 47 ld b,a ROMA:49D5 FA 48 CA ld a,(CA48) ROMA:49D8 4F ld c,a ROMA:49D9 CD D0 19 call 19D0 ROMA:49DC CD 13 1A call 1A13 ROMA:49DF CF rst 08 ROMA:49E0 0B dec bc ROMA:49E1 07 rlca ROMA:49E2 16 00 ld d,00 ROMA:49E4 FA BF C6 ld a,(C6BF) ROMA:49E7 5F ld e,a ROMA:49E8 21 FB 49 ld hl,49FB ROMA:49EB 2A ldi a,(hl) ROMA:49EC FE FF cp a,FF ROMA:49EE 28 07 jr z,49F7 ROMA:49F0 BB cp e ROMA:49F1 20 02 jr nz,49F5 ROMA:49F3 16 01 ld d,01 ROMA:49F5 18 F4 jr 49EB ROMA:49F7 7A ld a,d ROMA:49F8 D1 pop de ROMA:49F9 C1 pop bc ROMA:49FA C9 ret
14 - Raigeki FF
Fail-safes (ret)
ROMA:49FD C9 ret ROMA:49FE C9 ret ROMA:49FF C9 ret ROMA:4A00 C9 ret ROMA:4A01 C9 ret ROMA:4A02 C9 ret ROMA:4A03 C9 ret ROMA:4A04 C9 ret ROMA:4A05 C9 ret
Legendary card password handling, after validation
A:4CDF - called by "Legendary card password" routine
ROMA:4CDF F5 push af ROMA:4CE0 E5 push hl ROMA:4CE1 CF rst 08 => 1D 0B ROMA:4CE4 21 FB 4C ld hl,4CFB ROMA:4CE7 CD 82 12 call 1282 ;LCD Control ROMA:4CEA 3E 24 ld a,24 ;a = 0x24 ; 0d36 ROMA:4CEC CF rst 08 => 07 0F ROMA:4CEF CD 05 4D call 4D05 ROMA:4CF2 CD 3E 30 call 303E ROMA:4CF5 CF rst 08 => 21 0B; updates characters displayed on screen ? ROMA:4CF8 E1 pop hl ROMA:4CF9 F1 pop af ROMA:4CFA C9 ret
A:4CFB - array used by "Legendary card password" subroutine at A:4CDF
ROMA:4CFB 87 00 00 00 20 00 00 00 90 A6
A:4D05
ROMA:4D05 F5 push af ROMA:4D06 C5 push bc ROMA:4D07 D5 push de ROMA:4D08 E5 push hl ROMA:4D09 CD BD 12 call 12BD ;Blanks card illustration ROMA:4D0C 21 31 4D ld hl,4D31 ROMA:4D0F 11 00 C5 ld de,C500 ;pointer to wC500, Illustration data / colors (?) ROMA:4D12 2A ldi a,(hl) ROMA:4D13 47 ld b,a ROMA:4D14 78 ld a,b ROMA:4D15 FE 00 cp a,00 ROMA:4D17 28 0B jr z,4D24 ROMA:4D19 0E 04 ld c,04 ROMA:4D1B 2A ldi a,(hl) ROMA:4D1C 12 ld (de),a ROMA:4D1D 13 inc de ROMA:4D1E 0D dec c ROMA:4D1F 20 FA jr nz,4D1B ROMA:4D21 05 dec b ROMA:4D22 18 F0 jr 4D14 ROMA:4D24 3E 04 ld a,04 ROMA:4D26 CD E3 0E call 0EE3 ;Related to display ROMA:4D29 CD C1 10 call 10C1 ;Related to display ROMA:4D2C E1 pop hl ROMA:4D2D D1 pop de ROMA:4D2E C1 pop bc ROMA:4D2F F1 pop af ROMA:4D30 C9 ret
A:4D31 - illustration data / color (?) used by A:4D05
27 80 60 1E 01 65 58 1C 01 65 40 1A 01 60 1F 18 01 28 98 16 01 28 90 14 01 28 88 12 01 18 60 10 01 18 58 0E 01 90 58 0C 03 7F 58 0A 03 7F 50 08 03 7F 48 06 03 7F 40 04 03 7F 38 02 03 7F 30 00 03 80 60 4C 02 68 58 4A 02 68 50 48 02 70 48 46 02 70 40 44 02 70 38 42 02 68 28 40 02 68 20 3E 02 60 18 3C 02 60 10 3A 02 30 A0 38 02 28 98 36 02 28 90 34 02 28 88 32 02 20 78 30 02 20 70 2E 02 18 68 2C 02 18 60 2A 02 18 58 28 02 18 50 26 02 40 08 24 02 28 10 22 02 18 18 20 02
A:4DCE routine group
A:4DCE
ROMA:4DCE F5 push af ROMA:4DCF C5 push bc ROMA:4DD0 D5 push de ROMA:4DD1 E5 push hl ROMA:4DD2 CD F1 4D call 4DF1 ROMA:4DD5 06 00 ld b,00 ROMA:4DD7 4F ld c,a ROMA:4DD8 21 ED 4D ld hl,4DED ROMA:4DDB 09 add hl,bc ROMA:4DDC 2A ldi a,(hl) ROMA:4DDD 66 ld h,(hl) ROMA:4DDE 6F ld l,a ROMA:4DDF 01 E4 4D ld bc,4DE4 ROMA:4DE2 C5 push bc ROMA:4DE3 E9 jp hl ROMA:4DE4 FE 01 cp a,01 ROMA:4DE6 20 EA jr nz,4DD2 ;I think it proceeds only after the A button is pressed ROMA:4DE8 E1 pop hl ROMA:4DE9 D1 pop de ROMA:4DEA C1 pop bc ROMA:4DEB F1 pop af ROMA:4DEC C9 ret
Pointer array used by A:4DCE
ROMA:4DED 2B 4E - 35 4E -
A:4DF1
ROMA:4DF1 C5 push bc ROMA:4DF2 D5 push de ROMA:4DF3 E5 push hl ROMA:4DF4 16 00 ld d,00 ROMA:4DF6 FA A8 C5 ld a,(C5A8) ROMA:4DF9 E6 03 and a,03 ROMA:4DFB 28 0D jr z,4E0A ROMA:4DFD 0E 08 ld c,08 ROMA:4DFF 0D dec c ROMA:4E00 07 rlca ROMA:4E01 30 FC jr nc,4DFF ROMA:4E03 06 00 ld b,00 ROMA:4E05 21 23 4E ld hl,4E23 ROMA:4E08 09 add hl,bc ROMA:4E09 56 ld d,(hl) ROMA:4E0A FA A9 C5 ld a,(C5A9) ROMA:4E0D E6 00 and a,00 ROMA:4E0F 28 0D jr z,4E1E ROMA:4E11 0E 08 ld c,08 ROMA:4E13 0D dec c ROMA:4E14 07 rlca ROMA:4E15 30 FC jr nc,4E13 ROMA:4E17 06 00 ld b,00 ROMA:4E19 21 23 4E ld hl,4E23 ROMA:4E1C 09 add hl,bc ROMA:4E1D 56 ld d,(hl) ROMA:4E1E 7A ld a,d ROMA:4E1F E1 pop hl ROMA:4E20 D1 pop de ROMA:4E21 C1 pop bc ROMA:4E22 C9 ret
Array used by A:4DF1
ROMA:4E23 02 02 00 00 00 00 00 00
A:4E2B
ROMA:4E2B 3E 02 ld a,02 ROMA:4E2D CD E3 0E call 0EE3 ROMA:4E30 CD C1 10 call 10C1 ROMA:4E33 AF xor a ROMA:4E34 C9 ret
A:4E35
ROMA:4E35 3E 02 ld a,02 ROMA:4E37 CD E3 0E call 0EE3 ROMA:4E3A CD C1 10 call 10C1 ROMA:4E3D 3E 01 ld a,01 ROMA:4E3F C9 ret
Bank B - Prolly Display
Card Color
Read Card Color data
0x2C13E-0x2C160
- Read the Card Color data, depending on the Card Type
ROMB:413E F5 push af ROMB:413F C5 push bc ROMB:4140 D5 push de ROMB:4141 E5 push hl ROMB:4142 CD 6D 44 call 446D ;Select Card Color ROMB:4145 06 00 ld b,00 ROMB:4147 4F ld c,a ROMB:4148 CB 21 sla c ;bc = Color ID × 2 ROMB:414A 21 61 41 ld hl,4161 ROMB:414D 09 add hl,bc ;hl = Pointer to Color pointers ROMB:414E 2A ldi a,(hl) ROMB:414F 66 ld h,(hl) ROMB:4150 6F ld l,a ROMB:4151 11 B8 C9 ld de,C9B8 ROMB:4154 0E 08 ld c,08 ROMB:4156 2A ldi a,(hl) ;Read next byte ROMB:4157 12 ld (de),a ;Stores it in (C9B8) + current iteration ROMB:4158 13 inc de ROMB:4159 0D dec c ROMB:415A 20 FA jr nz,4156 ;Loop 8 times ROMB:415C E1 pop hl ROMB:415D D1 pop de ROMB:415E C1 pop bc ROMB:415F F1 pop af ROMB:4160 C9 ret
Card Color pointers array
ROMB:4161 6D 41 - Normal Monster ED 41 - Effect Monster 6D 42 - Unused ED 42 - Ritual 6D 43 - Magic ED 43 - Trap
Card Color data arrays
Card Color - Normal Monster
ROMB:416D 82 00 4A 15 D6 36 FF 53
Card Color - Effect Monster
ROMB:41ED 04 00 12 00 1B 01 FF 26
Card Color - Fusion Monster ? (Unused)
ROMB:426D 42 2C 0C 7C F7 7C F9 7E
Card Color - Ritual
ROMB:42ED 80 38 40 7D 80 7E EE 7F
Card Color - Magic
ROMB:436D C0 00 C0 01 40 03 F4 0F
Card Color - Trap
ROMB:43ED 06 08 0F 1C 1F 54 BF 71
Select Card Color
0x2C46D-0x2C48B
- Select the appropriate Card Color:
Green for Magic, Pink for Trap, Blue for Ritual, Orange for Effect Monster, White for Normal Monster
ROMB:446D C5 push bc ROMB:446E E5 push hl ROMB:446F 06 00 ld b,00 ROMB:4471 FA BB C6 ld a,(C6BB) ;Current card Type ROMB:4474 4F ld c,a ROMB:4475 21 8C 44 ld hl,448C ROMB:4478 09 add hl,bc ;hl = Pointer to Colors offsets array ROMB:4479 4E ld c,(hl) ROMB:447A 79 ld a,c ;a = Color offset ROMB:447B FE 00 cp a,00 ROMB:447D 20 09 jr nz,4488 ;if (a ≠ 0), get out of this function ROMB:447F FA C0 C6 ld a,(C6C0) ;Current card Effect ID (monster) ROMB:4482 FE 00 cp a,00 ROMB:4484 28 02 jr z,4488 ;if(Normal Monster), offset = 0 ROMB:4486 0E 01 ld c,01 ;if(Effect Monster), offset = 1 ROMB:4488 79 ld a,c ;a = Color offset ROMB:4489 E1 pop hl ROMB:448A C1 pop bc ROMB:448B C9 ret
Card Color offsets array
ROMB:448B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 05 03
B:45CD routine group
B:45CD (rst 08'd by unused Legendary Password at func_F:4EC0)
ROMB:45CD F5 push af ROMB:45CE C6 19 add a,19 ROMB:45D0 EA AE C6 ld (C6AE),a ROMB:45D3 3E 00 ld a,00 ROMB:45D5 EA AF C6 ld (C6AF),a ROMB:45D8 3E 06 ld a,06 ROMB:45DA EA B0 C6 ld (C6B0),a ROMB:45DD CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROMB:45E0 E5 push hl ROMB:45E1 CD E6 45 call 45E6 ROMB:45E4 F1 pop af ROMB:45E5 C9 ret
B:45E6
ROMB:45E6 F5 push af ROMB:45E7 C5 push bc ROMB:45E8 E5 push hl ROMB:45E9 21 B8 C9 ld hl,C9B8 ;Card Color data and ? ROMB:45EC 06 08 ld b,08 ROMB:45EE 0E 10 ld c,10 ROMB:45F0 CD 3E 02 call 023E ROMB:45F3 22 ldi (hl),a ROMB:45F4 0D dec c ROMB:45F5 20 F9 jr nz,45F0 ROMB:45F7 05 dec b ROMB:45F8 20 F4 jr nz,45EE ;Loop 128 times ROMB:45FA E1 pop hl ROMB:45FB C1 pop bc ROMB:45FC F1 pop af ROMB:45FD C9 ret
B:469E (updates colors and characters displayed on screen ?)
ROMB:469E F5 push af ROMB:469F C5 push bc ROMB:46A0 E5 push hl ROMB:46A1 3E 18 ld a,18 ROMB:46A3 CD E3 0E call 0EE3 ;set wC5AE (used to manage display) to 0x18, then idk what, then set wC5AD (used to manage display) to 0 ROMB:46A6 21 B8 C9 ld hl,C9B8 ;pointer to Screen BG color and other display data ROMB:46A9 06 02 ld b,02 ROMB:46AB 0E 80 ld c,80 ROMB:46AD 2A ldi a,(hl) ;a = wC9B8 + offset ROMB:46AE CD 13 11 call 1113 ;Updates characters displayed on screen ROMB:46B1 0D dec c ROMB:46B2 20 F9 jr nz,46AD ROMB:46B4 05 dec b ROMB:46B5 20 F4 jr nz,46AB ;Loop 384 times ROMB:46B7 CD C1 10 call 10C1 ;Call subroutine waiting for graphics update interrupt to happen and to resolve. Display: (C5AF) = (C5AE), then (C5AE) = 0 ROMB:46BA E1 pop hl ROMB:46BB C1 pop bc ROMB:46BC F1 pop af ROMB:46BD C9 ret
B:4807
ROMB:4807 F5 push af ROMB:4808 C5 push bc ROMB:4809 D5 push de ROMB:480A E5 push hl ROMB:480B 7E ld a,(hl) ROMB:480C E6 1F and a,1F ROMB:480E 47 ld b,a ROMB:480F 1A ld a,(de) ROMB:4810 E6 1F and a,1F ROMB:4812 4F ld c,a ROMB:4813 CD 44 48 call 4844 ROMB:4816 F5 push af ROMB:4817 2A ldi a,(hl) ROMB:4818 E6 E0 and a,E0 ROMB:481A 4F ld c,a ROMB:481B 3A ldd a,(hl) ROMB:481C E6 03 and a,03 ROMB:481E 47 ld b,a ROMB:481F E5 push hl ROMB:4820 1A ld a,(de) ROMB:4821 E6 E0 and a,E0 ROMB:4823 6F ld l,a ROMB:4824 13 inc de ROMB:4825 1A ld a,(de) ROMB:4826 E6 03 and a,03 ROMB:4828 67 ld h,a ROMB:4829 CD 53 48 call 4853 ROMB:482C E1 pop hl ROMB:482D F1 pop af ROMB:482E B1 or c ROMB:482F 22 ldi (hl),a ROMB:4830 C5 push bc ROMB:4831 7E ld a,(hl) ROMB:4832 E6 7C and a,7C ROMB:4834 47 ld b,a ROMB:4835 1A ld a,(de) ROMB:4836 E6 7C and a,7C ROMB:4838 4F ld c,a ROMB:4839 CD 7D 48 call 487D ROMB:483C C1 pop bc ROMB:483D B0 or b ROMB:483E 77 ld (hl),a ROMB:483F E1 pop hl ROMB:4840 D1 pop de ROMB:4841 C1 pop bc ROMB:4842 F1 pop af ROMB:4843 C9 ret
B:4844
ROMB:4844 D5 push de ROMB:4845 78 ld a,b ROMB:4846 E6 1F and a,1F ROMB:4848 1E 02 ld e,02 ROMB:484A B9 cp c ROMB:484B 30 01 jr nc,484E ROMB:484D 3C inc a ROMB:484E 1D dec e ROMB:484F 20 F9 jr nz,484A ROMB:4851 D1 pop de ROMB:4852 C9 ret
B:4853
ROMB:4853 F5 push af ROMB:4854 D5 push de ROMB:4855 E5 push hl ROMB:4856 1E 03 ld e,03 ROMB:4858 CB 21 sla c ROMB:485A CB 10 rl b ROMB:485C CB 25 sla l ROMB:485E CB 14 rl h ROMB:4860 1D dec e ROMB:4861 20 F5 jr nz,4858 ROMB:4863 1E 02 ld e,02 ROMB:4865 78 ld a,b ROMB:4866 BC cp h ROMB:4867 30 01 jr nc,486A ROMB:4869 04 inc b ROMB:486A 1D dec e ROMB:486B 20 F8 jr nz,4865 ROMB:486D CB 38 srl b ROMB:486F CB 19 rr c ROMB:4871 CB 38 srl b ROMB:4873 CB 19 rr c ROMB:4875 CB 38 srl b ROMB:4877 CB 19 rr c ROMB:4879 E1 pop hl ROMB:487A D1 pop de ROMB:487B F1 pop af ROMB:487C C9 ret
B:487D
ROMB:487D D5 push de ROMB:487E 78 ld a,b ROMB:487F E6 7C and a,7C ROMB:4881 1E 02 ld e,02 ROMB:4883 B9 cp c ROMB:4884 30 02 jr nc,4888 ROMB:4886 C6 04 add a,04 ROMB:4888 1D dec e ROMB:4889 20 F8 jr nz,4883 ROMB:488B D1 pop de ROMB:488C C9 ret
B:488D (0xFF Card Color data and other stuff, called by unused Legendary Password subroutine)
ROMB:488D F5 push af ROMB:488E C5 push bc ROMB:488F D5 push de ROMB:4890 E5 push hl ROMB:4891 21 B8 C9 ld hl,C9B8 ROMB:4894 11 BE C9 ld de,C9BE ROMB:4897 06 10 ld b,10 ROMB:4899 0E 04 ld c,04 ROMB:489B 3E FF ld a,FF ROMB:489D 22 ldi (hl),a ROMB:489E 3E FF ld a,FF ROMB:48A0 22 ldi (hl),a ;0xFF wC9B8-wC9F8, card color data in the first 8 bytes, then ? ROMB:48A1 0D dec c ROMB:48A2 20 F7 jr nz,489B ROMB:48A4 05 dec b ROMB:48A5 20 F2 jr nz,4899 ;Loop 40 times ROMB:48A7 CD 9E 46 call 469E ;blanks / 0xFFs characters displayed on screen ? ROMB:48AA E1 pop hl ROMB:48AB D1 pop de ROMB:48AC C1 pop bc ROMB:48AD F1 pop af ROMB:48AE C9 ret
Fail-safe (ret)
ROMB:48AF C9 ret
Bank C
rst 08 pointers
ROMC:4002 06 40 - Illustrations ? 42 69 - Characters illustrations ?
C:4006 (Illustrations ?)
ROMC:4006 F5 push af ROMC:4007 C5 push bc ROMC:4008 D5 push de ROMC:4009 E5 push hl ROMC:400A 16 00 ld d,00 ;d = 0 ROMC:400C 58 ld e,b ROMC:400D CB 23 sla e ;e = b << 1; ROMC:400F 21 33 40 ld hl,4033 ;hl = 0x4033 ROMC:4012 19 add hl,de ;hl += de ROMC:4013 2A ldi a,(hl) ROMC:4014 66 ld h,(hl) ROMC:4015 6F ld l,a ;hl = (hl) ROMC:4016 06 00 ld b,00 ;b = 0 ROMC:4018 CB 21 sla c ROMC:401A 09 add hl,bc ;hl += c << 1 ROMC:401B 2A ldi a,(hl) ROMC:401C 66 ld h,(hl) ROMC:401D 6F ld l,a ;hl = (hl) ROMC:401E 11 08 C5 ld de,C508 ;de = 0xC508 ROMC:4021 2A ldi a,(hl) ROMC:4022 47 ld b,a ;b = (hl) ROMC:4023 0E 04 ld c,04 ;c = 4 ROMC:4025 2A ldi a,(hl) ROMC:4026 12 ld (de),a ;Copies (hl) to (de) ROMC:4027 13 inc de ;de++ ROMC:4028 0D dec c ;c-- ROMC:4029 20 FA jr nz,4025 ;if(c ≠ 0), loop to C:4025 ROMC:402B 05 dec b ;b-- ROMC:402C 20 F5 jr nz,4023 ;if(b ≠ 0), loop to C:4023 ROMC:402E E1 pop hl ROMC:402F D1 pop de ROMC:4030 C1 pop bc ROMC:4031 F1 pop af ROMC:4032 C9 ret
C:4033 (Pointers)
ROMC:4033 65 40 6B 40 71 40 77 40 7D 40 83 40 89 40 8F 40 95 40 9B 40 A1 40 A7 40 AD 40 B3 40 B9 40 BF 40 C5 40 CB 40 D1 40 D7 40 DD 40 E3 40 E9 40 EF 40 F5 40 FB 40 84 41 0D 42 96 42 0F 43 88 43 01 44 8E 44 1B 45 A8 45 41 46 DA 46 73 47 04 48 95 48 26 49 B3 49 40 4A CD 4A 5A 4B E7 4B 74 4C F5 4C 76 4D F7 4D 80 4E 09 4F 92 4F 0B 50 84 50 FD 50 96 51 2F 52 C8 52 55 53 E2 53 6F 54 00 55 91 55 22 56 BB 56 54 57 ED 57 72 58 F7 58 7C 59 05 5A 8E 5A 17 5B 90 5B 09 5C 82 5C 07 5D 8C 5D 11 5E A6 5E 3B 5F D0 5F 41 60 B2 60 23 61 A0 61 1D 62 9A 62 2F 63 C4 63 59 64 F2 64 8B 65 24 66 BD 66 56 67 EF 67 60 68 D1 68
C:6942 (Characters illustrations ?)
ROMC:6942 F5 push af ROMC:6943 C5 push bc ROMC:6944 D5 push de ROMC:6945 E5 push hl ROMC:6946 16 00 ld d,00 ROMC:6948 58 ld e,b ROMC:6949 CB 23 sla e ROMC:694B 21 6F 69 ld hl,696F ROMC:694E 19 add hl,de ROMC:694F 2A ldi a,(hl) ROMC:6950 66 ld h,(hl) ROMC:6951 6F ld l,a ROMC:6952 06 00 ld b,00 ROMC:6954 CB 21 sla c ROMC:6956 09 add hl,bc ROMC:6957 2A ldi a,(hl) ROMC:6958 66 ld h,(hl) ROMC:6959 6F ld l,a ROMC:695A 11 00 C5 ld de,C500 ;de = pointer to illustration_colors ROMC:695D 2A ldi a,(hl) ROMC:695E 47 ld b,a ROMC:695F 0E 04 ld c,04 ROMC:6961 2A ldi a,(hl) ROMC:6962 12 ld (de),a ROMC:6963 13 inc de ROMC:6964 0D dec c ROMC:6965 20 FA jr nz,6961 ROMC:6967 05 dec b ROMC:6968 20 F5 jr nz,695F ROMC:696A E1 pop hl ROMC:696B D1 pop de ROMC:696C C1 pop bc ROMC:696D F1 pop af ROMC:696E C9 ret
Bank D - CPU AI program
D:4004
ROMD:4004 C5 push bc ROMD:4005 D5 push de ROMD:4006 E5 push hl ROMD:4007 CD 19 59 call 5919 ROMD:400A CD 32 74 call 7432 ROMD:400D CD 23 76 call 7623 ROMD:4010 CD 93 47 call 4793 ROMD:4013 CD A4 60 call 60A4 ROMD:4016 CD 2B 59 call 592B ROMD:4019 5F ld e,a ROMD:401A 06 00 ld b,00 ROMD:401C 4F ld c,a ROMD:401D CB 27 sla a ROMD:401F CB 10 rl b ROMD:4021 81 add c ROMD:4022 4F ld c,a ROMD:4023 3E 00 ld a,00 ROMD:4025 88 adc b ROMD:4026 47 ld b,a ROMD:4027 79 ld a,c ROMD:4028 85 add l ROMD:4029 6F ld l,a ROMD:402A 78 ld a,b ROMD:402B 8C adc h ROMD:402C 67 ld h,a ROMD:402D 2A ldi a,(hl) ROMD:402E 4F ld c,a ROMD:402F CD 9B 60 call 609B ROMD:4032 79 ld a,c ROMD:4033 FE 00 cp a,00 ROMD:4035 28 46 jr z,407D ROMD:4037 FE 01 cp a,01 ROMD:4039 28 42 jr z,407D ROMD:403B FE 02 cp a,02 ROMD:403D 28 3E jr z,407D ROMD:403F FE 0C cp a,0C ROMD:4041 28 3A jr z,407D ROMD:4043 FE 0D cp a,0D ROMD:4045 28 36 jr z,407D ROMD:4047 FE 0E cp a,0E ROMD:4049 28 32 jr z,407D ROMD:404B FE 0F cp a,0F ROMD:404D 28 2E jr z,407D ROMD:404F CD F6 44 call 44F6 ROMD:4052 CD 4A 64 call 644A ROMD:4055 FE 01 cp a,01 ROMD:4057 20 24 jr nz,407D ROMD:4059 3E 55 ld a,55 ROMD:405B 83 add e ROMD:405C CD 2F 59 call 592F ROMD:405F CD A4 60 call 60A4 ROMD:4062 CD 2B 59 call 592B ROMD:4065 06 00 ld b,00 ROMD:4067 4F ld c,a ROMD:4068 CB 27 sla a ROMD:406A CB 10 rl b ROMD:406C 81 add c ROMD:406D 4F ld c,a ROMD:406E 3E 00 ld a,00 ROMD:4070 88 adc b ROMD:4071 47 ld b,a ROMD:4072 79 ld a,c ROMD:4073 85 add l ROMD:4074 6F ld l,a ROMD:4075 78 ld a,b ROMD:4076 8C adc h ROMD:4077 67 ld h,a ROMD:4078 2A ldi a,(hl) ROMD:4079 4F ld c,a ROMD:407A CD 9B 60 call 609B ROMD:407D 21 9D 40 ld hl,409D ROMD:4080 06 00 ld b,00 ROMD:4082 CB 21 sla c ROMD:4084 CB 10 rl b ROMD:4086 79 ld a,c ROMD:4087 85 add l ROMD:4088 6F ld l,a ROMD:4089 78 ld a,b ROMD:408A 8C adc h ROMD:408B 67 ld h,a ROMD:408C 2A ldi a,(hl) ROMD:408D 4F ld c,a ROMD:408E 7E ld a,(hl) ROMD:408F 67 ld h,a ROMD:4090 69 ld l,c ROMD:4091 01 96 40 ld bc,4096 ROMD:4094 C5 push bc ROMD:4095 E9 jp hl ROMD:4096 CD 86 60 call 6086 ROMD:4099 E1 pop hl ROMD:409A D1 pop de ROMD:409B C1 pop bc ROMD:409C C9 ret
D:409D (pointers)
ROMD:409D BD 40 - ret DF 40 7A 42 AF 42 48 43 42 44 BD 40 - ret 5E 44 82 44 98 44 AE 44 D2 44 B2 41 F7 41 BD 40 - ret BE 40
D:40BD (ret)
ROMD:40BD C9 ret
D:40BE
ROMD:40BE C5 push bc ROMD:40BF E5 push hl ROMD:40C0 3E 02 ld a,02 ROMD:40C2 CD 80 75 call 7580 ROMD:40C5 CD 2B 59 call 592B ROMD:40C8 CD 8C 75 call 758C ROMD:40CB 3E 00 ld a,00 ROMD:40CD CD 90 75 call 7590 ROMD:40D0 CD A8 60 call 60A8 ROMD:40D3 CD AD 5F call 5FAD ROMD:40D6 CD D0 19 call 19D0 ROMD:40D9 CD E6 19 call 19E6 ROMD:40DC E1 pop hl ROMD:40DD C1 pop bc ROMD:40DE C9 ret
CPU AI
ROMD:40DF C5 push bc ROMD:40E0 E5 push hl ROMD:40E1 3E 02 ld a,02 ROMD:40E3 CD 80 75 call 7580 ;(D4FC) = 2 ROMD:40E6 CD 2B 59 call 592B ROMD:40E9 CD 8C 75 call 758C ;(D4FD) = a ROMD:40EC CD A8 60 call 60A8 ROMD:40EF CD AD 5F call 5FAD ROMD:40F2 CD D0 19 call 19D0 ;Update Column and Row ROMD:40F5 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:40F8 FA A3 C7 ld a,(C7A3) ROMD:40FB 4F ld c,a ROMD:40FC FA A4 C7 ld a,(C7A4) ROMD:40FF 47 ld b,a ROMD:4100 CD 02 76 call 7602 ROMD:4103 CD FD 20 call 20FD ;Copies Card played by CPU in (C88B) ROMD:4106 CD AC 60 call 60AC ROMD:4109 CD AD 5F call 5FAD ROMD:410C CD D0 19 call 19D0 ;Update Column and Row ROMD:410F CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:4112 FA A3 C7 ld a,(C7A3) ;bc = Card being processed ROMD:4115 4F ld c,a ROMD:4116 FA A4 C7 ld a,(C7A4) ROMD:4119 47 ld b,a ROMD:411A CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:411D FE 01 cp a,01 ROMD:411F 28 59 jr z,417A ROMD:4121 CD 0D 76 call 760D ROMD:4124 CD 0F 21 call 210F ROMD:4127 CD 42 21 call 2142 ;Fusion subroutine ROMD:412A FE 00 cp a,00 ROMD:412C 20 4C jr nz,417A ROMD:412E CF rst 08 ROMD:412F 2D dec l ROMD:4130 04 inc b ROMD:4131 FE 00 cp a,00 ROMD:4133 20 45 jr nz,417A ROMD:4135 3E 01 ld a,01 ROMD:4137 CD 90 75 call 7590 ;Updates (D504) ROMD:413A CD AC 60 call 60AC ROMD:413D CD AD 5F call 5FAD ROMD:4140 CD D0 19 call 19D0 ;Update Column and Row ROMD:4143 FA 8F C8 ld a,(C88F) ROMD:4146 EA A3 C7 ld (C7A3),a ROMD:4149 FA 90 C8 ld a,(C890) ROMD:414C EA A4 C7 ld (C7A4),a ;Copy Fusion Monster ID in (C7A3) (Card being processed) ROMD:414F FA 8F C8 ld a,(C88F) ROMD:4152 4F ld c,a ROMD:4153 FA 90 C8 ld a,(C890) ROMD:4156 47 ld b,a ;Copy Fusion Monster ID in register bc ROMD:4157 CD 18 76 call 7618 ROMD:415A CD 25 20 call 2025 ;Hide Card, reset Level ROMD:415D CD C9 1F call 1FC9 ;Reveal Card ROMD:4160 CD DF 1F call 1FDF ;Freezes Card ROMD:4163 CD B4 1F call 1FB4 ;Reset Card Level ROMD:4166 CD 00 20 call 2000 ;Card controlled by its owner ROMD:4169 CD FB 19 call 19FB ;Update selected card ID and status ROMD:416C CD A8 60 call 60A8 ROMD:416F CD AD 5F call 5FAD ROMD:4172 CD D0 19 call 19D0 ;Update Column and Row ROMD:4175 CD E6 19 call 19E6 ;Remove selected card from the field ROMD:4178 18 35 jr 41AF ROMD:417A 3E 00 ld a,00 ROMD:417C CD 90 75 call 7590 ;Updates (D504) ROMD:417F CD A8 60 call 60A8 ROMD:4182 CD AD 5F call 5FAD ROMD:4185 CD D0 19 call 19D0 ;Update Column and Row ROMD:4188 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:418B CD 25 20 call 2025 ;Hide Card, reset Level ROMD:418E CD D4 1F call 1FD4 ;Hide Card ROMD:4191 CD 00 20 call 2000 ;Card controlled by its owner ROMD:4194 CD AC 60 call 60AC ROMD:4197 CD AD 5F call 5FAD ROMD:419A CD D0 19 call 19D0 ;Update Column and Row ROMD:419D CD FB 19 call 19FB ;Updates selected card ID and status ROMD:41A0 CD A8 60 call 60A8 ROMD:41A3 CD AD 5F call 5FAD ROMD:41A6 CD D0 19 call 19D0 ;Update Column and Row ROMD:41A9 CD E6 19 call 19E6 ;Remove selected card from the field ROMD:41AC CD B0 60 call 60B0 ROMD:41AF E1 pop hl ROMD:41B0 C1 pop bc ROMD:41B1 C9 ret
CPU AI - Damage Calculation
0x34407-0x34441
- Damage calculation
ROMD:4407 39 add hl,sp ROMD:4408 03 inc bc ROMD:4409 FA C7 C5 ld a,(C5C7) ROMD:440C 4F ld c,a ROMD:440D FA C8 C5 ld a,(C5C8) ROMD:4410 47 ld b,a ;bc = Player's Life Points ROMD:4411 CD 9F 75 call 759F ;Stores Player's Life Points for damage calculation ROMD:4414 FA CA C5 ld a,(C5CA) ROMD:4417 4F ld c,a ROMD:4418 FA CB C5 ld a,(C5CB) ROMD:441B 47 ld b,a ;bc = CPU's Life Points ROMD:441C CD D6 75 call 75D6 ;Stores CPU's Life Points for damage calculation ROMD:441F CF rst 08 ROMD:4420 31 03 => 03:4031 ROMD:4422 CD 20 59 call 5920 ROMD:4425 CD 5F 60 call 605F ROMD:4428 FA C7 C5 ld a,(C5C7) ROMD:442B 4F ld c,a ROMD:442C FA C8 C5 ld a,(C5C8) ROMD:442F 47 ld b,a ;bc = Player's Life Points ROMD:4430 CD AA 75 call 75AA ROMD:4433 FA CA C5 ld a,(C5CA) ROMD:4436 4F ld c,a ROMD:4437 FA CB C5 ld a,(C5CB) ROMD:443A 47 ld b,a ;bc = CPU's Life Points ROMD:443B CD E1 75 call 75E1 ROMD:443E E1 pop hl ROMD:443F D1 pop de ROMD:4440 C1 pop bc ROMD:4441 C9 ret
D:4442
ROMD:4442 C5 push bc ROMD:4443 D5 push de ROMD:4444 E5 push hl ROMD:4445 CD A8 60 call 60A8 ROMD:4448 CD AD 5F call 5FAD ROMD:444B CD 76 64 call 6476 ROMD:444E CD AC 60 call 60AC ROMD:4451 CD AD 5F call 5FAD ROMD:4454 CD 81 64 call 6481 ROMD:4457 CD 61 67 call 6761 ROMD:445A E1 pop hl ROMD:445B D1 pop de ROMD:445C C1 pop bc ROMD:445D C9 ret
D:445E
ROMD:445E C5 push bc ROMD:445F E5 push hl ROMD:4460 CD A8 60 call 60A8 ROMD:4463 CD AD 5F call 5FAD ROMD:4466 78 ld a,b ROMD:4467 EA 01 D0 ld (D001),a ROMD:446A 79 ld a,c ROMD:446B EA 02 D0 ld (D002),a ROMD:446E CD AC 60 call 60AC ROMD:4471 CD AD 5F call 5FAD ROMD:4474 78 ld a,b ROMD:4475 EA 03 D0 ld (D003),a ROMD:4478 79 ld a,c ROMD:4479 EA 04 D0 ld (D004),a ROMD:447C CD 29 45 call 4529 ROMD:447F E1 pop hl ROMD:4480 C1 pop bc ROMD:4481 C9 ret
D:4482
ROMD:4482 C5 push bc ROMD:4483 E5 push hl ROMD:4484 CD A8 60 call 60A8 ROMD:4487 CD AD 5F call 5FAD ROMD:448A 78 ld a,b ROMD:448B EA 01 D0 ld (D001),a ROMD:448E 79 ld a,c ROMD:448F EA 02 D0 ld (D002),a ROMD:4492 CD AA 45 call 45AA ROMD:4495 E1 pop hl ROMD:4496 C1 pop bc ROMD:4497 C9 ret
D:4498
ROMD:4498 C5 push bc ROMD:4499 E5 push hl ROMD:449A CD A8 60 call 60A8 ROMD:449D CD AD 5F call 5FAD ROMD:44A0 78 ld a,b ROMD:44A1 EA 01 D0 ld (D001),a ROMD:44A4 79 ld a,c ROMD:44A5 EA 02 D0 ld (D002),a ROMD:44A8 CD DB 45 call 45DB ROMD:44AB E1 pop hl ROMD:44AC C1 pop bc ROMD:44AD C9 ret
AI - Attack Phase
ROMD:4678 C5 push bc ROMD:4679 FA 05 D0 ld a,(D005) ROMD:467C FE 01 cp a,01 ROMD:467E 20 3C jr nz,46BC ROMD:4680 3E 02 ld a,02 ROMD:4682 CD 80 75 call 7580 ROMD:4685 CD 2B 59 call 592B ROMD:4688 CD 8C 75 call 758C ROMD:468B 3E 03 ld a,03 ROMD:468D CD 90 75 call 7590 ROMD:4690 FA 01 D0 ld a,(D001) ROMD:4693 47 ld b,a ROMD:4694 FA 02 D0 ld a,(D002) ROMD:4697 4F ld c,a ROMD:4698 CD D0 19 call 19D0 ;Updates field Column and Row ROMD:469B CD 13 1A call 1A13 ;Stores selected card ID and status ROMD:469E FA A3 C7 ld a,(C7A3) ROMD:46A1 4F ld c,a ROMD:46A2 FA A4 C7 ld a,(C7A4) ROMD:46A5 47 ld b,a ;bc = Card being processed ROMD:46A6 CD 02 76 call 7602 ROMD:46A9 CD E6 19 call 19E6 ;Remove selected card from the field ROMD:46AC FA 06 D0 ld a,(D006) ROMD:46AF 4F ld c,a ROMD:46B0 FA 07 D0 ld a,(D007) ROMD:46B3 47 ld b,a ROMD:46B4 CD 0D 76 call 760D ROMD:46B7 CF rst 08 ROMD:46B8 15 0A => A:4015 - Remove Player's Trap ROMD:46BA 18 7F jr 473B ROMD:46BC FA 01 D0 ld a,(D001) ROMD:46BF 47 ld b,a ROMD:46C0 FA 02 D0 ld a,(D002) ROMD:46C3 4F ld c,a ROMD:46C4 CD D0 19 call 19D0 ;Updates field Column and Row ROMD:46C7 CD 13 1A call 1A13 ;Stores selected card ID and status ROMD:46CA FA A5 C7 ld a,(C7A5) ROMD:46CD E6 30 and a,30 ROMD:46CF CB 37 swap a ;a = Stat Level ROMD:46D1 CF rst 08 ROMD:46D2 09 07 => 7:4009 - Updates current Stat Level ROMD:46D4 CD 25 20 call 2025 ROMD:46D7 CD C9 1F call 1FC9 ;Reveal Card ROMD:46DA CD DF 1F call 1FDF ;Freezes Card ROMD:46DD CD FB 19 call 19FB ;Update selected card ID and status ROMD:46E0 FA A3 C7 ld a,(C7A3) ROMD:46E3 4F ld c,a ROMD:46E4 FA A4 C7 ld a,(C7A4) ROMD:46E7 47 ld b,a ROMD:46E8 CF rst 08 ROMD:46E9 05 07 => 7:4005 - Calculate ATK and DEF ROMD:46EB CF rst 08 ROMD:46EC 35 dec (hl) ROMD:46ED 03 inc bc ROMD:46EE FA 03 D0 ld a,(D003) ROMD:46F1 47 ld b,a ROMD:46F2 FA 04 D0 ld a,(D004) ROMD:46F5 4F ld c,a ROMD:46F6 CD D0 19 call 19D0 ;Updates field Column and Row ROMD:46F9 CD 13 1A call 1A13 ;Stores selected card ID and status ROMD:46FC FA A5 C7 ld a,(C7A5) ROMD:46FF E6 30 and a,30 ROMD:4701 CB 37 swap a ;a = Stat Level ROMD:4703 CF rst 08 ROMD:4704 09 07 => 7:4009 - Updates current Stat Level ROMD:4706 CD C9 1F call 1FC9 ;Reveal Card ROMD:4709 CD FB 19 call 19FB ;Update selected card ID and status ROMD:470C FA A5 C7 ld a,(C7A5) ROMD:470F E6 07 and a,07 ROMD:4711 FE 03 cp a,03 ROMD:4713 20 04 jr nz,4719 ;If not in no-Frozen Attack mode, jump to D:4719 ROMD:4715 3E 05 ld a,05 ROMD:4717 18 02 jr 471B ROMD:4719 3E 01 ld a,01 ROMD:471B CF rst 08 ROMD:471C 3B dec sp ROMD:471D 03 inc bc ROMD:471E FA A3 C7 ld a,(C7A3) ROMD:4721 4F ld c,a ROMD:4722 FA A4 C7 ld a,(C7A4) ROMD:4725 47 ld b,a ;bc = Card being processed ROMD:4726 CF rst 08 ROMD:4727 05 07 => 7:4005 - Calculate ATK and DEF ROMD:4729 CF rst 08 ROMD:472A 33 03 => 3:4033 ROMD:472C CF rst 08 ROMD:472D 37 03 => 3:4037 ROMD:472F CF rst 08 ROMD:4730 39 03 => 3:4039 ROMD:4732 CF rst 08 ROMD:4733 31 03 => 3:4031 ROMD:4735 CD 20 59 call 5920 ROMD:4738 CD 6A 47 call 476A ROMD:473B C1 pop bc ROMD:473C C9 ret
CPU AI - Retrieve opponent's Trap ID
ROMD:4F0E C5 push bc ROMD:4F0F 06 00 ld b,00 ROMD:4F11 0E 03 ld c,03 ;column 0, row 3: Player's Trap card zone ROMD:4F13 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:4F16 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:4F19 FA A3 C7 ld a,(C7A3) ROMD:4F1C 4F ld c,a ROMD:4F1D FA A4 C7 ld a,(C7A4) ROMD:4F20 47 ld b,a ;bc = opponent's Trap card ID ROMD:4F21 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:4F24 FE 01 cp a,01 ROMD:4F26 20 05 jr nz,4F2D ;if a Monster is in the Trap zone, get out of this function ROMD:4F28 3E 80 ld a,80 ROMD:4F2A EA 67 D0 ld (D067),a ;(D067) = 0x80 ROMD:4F2D C1 pop bc ROMD:4F2E C9 ret
ROMD:5919
ROMD:5919 3E 00 ld a,00 ROMD:591B EA 14 D0 ld (D014),a ROMD:591E C9 ret
ROMD:591F (ret)
ROMD:591F C9 ret
ROMD:5920
ROMD:5920 FA C5 C7 ld a,(C7C5) ROMD:5923 EA 14 D0 ld (D014),a ROMD:5926 C9 ret
ROMD:5927
ROMD:5927 FA 14 D0 ld a,(D014) ROMD:592A C9 ret
ROMD:592B
ROMD:592B FA 13 D0 ld a,(D013) ROMD:592E C9 ret
ROMD:592F
ROMD:592F EA 13 D0 ld (D013),a ROMD:5932 C9 ret
ROMD:5933
ROMD:5933 FA 16 D0 ld a,(D016) ROMD:5936 C6 01 add a,01 ROMD:5938 EA 16 D0 ld (D016),a ROMD:593B FA 17 D0 ld a,(D017) ROMD:593E CE 00 adc a,00 ROMD:5940 EA 17 D0 ld (D017),a ROMD:5943 FA 18 D0 ld a,(D018) ROMD:5946 C6 01 add a,01 ROMD:5948 EA 18 D0 ld (D018),a ROMD:594B FA 19 D0 ld a,(D019) ROMD:594E CE 00 adc a,00 ROMD:5950 EA 19 D0 ld (D019),a ROMD:5953 C9 ret
ROMD:5954
ROMD:5954 C5 push bc ROMD:5955 01 78 05 ld bc,0578 ROMD:5958 FA 16 D0 ld a,(D016) ROMD:595B 81 add c ROMD:595C EA 16 D0 ld (D016),a ROMD:595F FA 17 D0 ld a,(D017) ROMD:5962 88 adc b ROMD:5963 EA 17 D0 ld (D017),a ROMD:5966 FA 18 D0 ld a,(D018) ROMD:5969 81 add c ROMD:596A EA 18 D0 ld (D018),a ROMD:596D FA 19 D0 ld a,(D019) ROMD:5970 88 adc b ROMD:5971 EA 19 D0 ld (D019),a ROMD:5974 C1 pop bc ROMD:5975 C9 ret
ROMD:5976
ROMD:5976 C5 push bc ROMD:5977 FA B7 C6 ld a,(C6B7) ROMD:597A EA F6 C5 ld (C5F6),a ROMD:597D FA B8 C6 ld a,(C6B8) ROMD:5980 EA F7 C5 ld (C5F7),a ROMD:5983 CD C1 15 call 15C1 ROMD:5986 79 ld a,c ROMD:5987 EA 16 D0 ld (D016),a ROMD:598A 78 ld a,b ROMD:598B EA 17 D0 ld (D017),a ROMD:598E FA B9 C6 ld a,(C6B9) ROMD:5991 EA F6 C5 ld (C5F6),a ROMD:5994 FA BA C6 ld a,(C6BA) ROMD:5997 EA F7 C5 ld (C5F7),a ROMD:599A CD C1 15 call 15C1 ROMD:599D 79 ld a,c ROMD:599E EA 18 D0 ld (D018),a ROMD:59A1 78 ld a,b ROMD:59A2 EA 19 D0 ld (D019),a ROMD:59A5 C1 pop bc ROMD:59A6 C9 ret
ROMD:59A7
ROMD:59A7 3E 0F ld a,0F ROMD:59A9 91 sub c ROMD:59AA 4F ld c,a ROMD:59AB 3E 27 ld a,27 ROMD:59AD 98 sbc b ROMD:59AE 47 ld b,a ROMD:59AF C9 ret
ROMD:59B0
ROMD:59B0 F5 push af ROMD:59B1 C5 push bc ROMD:59B2 D5 push de ROMD:59B3 E5 push hl ROMD:59B4 CD 41 61 call 6141 ROMD:59B7 CD D6 59 call 59D6 ROMD:59BA CD E3 57 call 57E3 ROMD:59BD FE 00 cp a,00 ROMD:59BF 28 10 jr z,59D1 ROMD:59C1 CD 04 40 call 4004 ROMD:59C4 CD AF 74 call 74AF ROMD:59C7 CF rst 08 ROMD:59C8 07 rlca ROMD:59C9 06 CD ld b,CD ROMD:59CB 73 ld (hl),e ROMD:59CC 24 inc h ROMD:59CD FE 00 cp a,00 ROMD:59CF 28 E6 jr z,59B7 ROMD:59D1 E1 pop hl ROMD:59D2 D1 pop de ROMD:59D3 C1 pop bc ROMD:59D4 F1 pop af ROMD:59D5 C9 ret
CPU AI main subroutine
ROMD:59D6 C5 push bc ROMD:59D7 E5 push hl ROMD:59D8 CD C3 5F call 5FC3 ;Copies CPU's hand, Life Points and SoRL status for AI decision ROMD:59DB CD 22 5A call 5A22 ;CPU AI - Play a Monster card ROMD:59DE CD 19 59 call 5919 ROMD:59E1 CD FE 58 call 58FE ROMD:59E4 CD 09 4C call 4C09 ROMD:59E7 CD C7 57 call 57C7 ROMD:59EA CD FE 58 call 58FE ROMD:59ED 21 49 61 ld hl,6149 ROMD:59F0 06 00 ld b,00 ROMD:59F2 CD 22 5A call 5A22 ;CPU AI - Play a Monster card ROMD:59F5 CD 19 59 call 5919 ROMD:59F8 CD 32 74 call 7432 ROMD:59FB 2A ldi a,(hl) ROMD:59FC 4F ld c,a ROMD:59FD CD 2F 59 call 592F ROMD:5A00 2A ldi a,(hl) ROMD:5A01 EA C2 D4 ld (D4C2),a ROMD:5A04 2A ldi a,(hl) ROMD:5A05 EA C3 D4 ld (D4C3),a ROMD:5A08 79 ld a,c ROMD:5A09 CD 9B 5A call 5A9B ROMD:5A0C FE 00 cp a,00 ROMD:5A0E 20 06 jr nz,5A16 ROMD:5A10 CD 09 4C call 4C09 ROMD:5A13 CD 81 57 call 5781 ROMD:5A16 CD 11 60 call 6011 ROMD:5A19 04 inc b ROMD:5A1A 3E FF ld a,FF ROMD:5A1C B8 cp b ROMD:5A1D 20 D3 jr nz,59F2 ROMD:5A1F E1 pop hl ROMD:5A20 C1 pop bc ROMD:5A21 C9 ret
CPU AI - Play a Monster card
ROMD:5A22 C5 push bc ROMD:5A23 D5 push de ROMD:5A24 E5 push hl ROMD:5A25 3E 00 ld a,00 ROMD:5A27 EA C5 D4 ld (D4C5),a ROMD:5A2A EA C6 D4 ld (D4C6),a ROMD:5A2D 26 00 ld h,00 ROMD:5A2F 44 ld b,h ROMD:5A30 0E 01 ld c,01 ROMD:5A32 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:5A35 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5A38 FA A3 C7 ld a,(C7A3) ROMD:5A3B 4F ld c,a ROMD:5A3C FA A4 C7 ld a,(C7A4) ROMD:5A3F 47 ld b,a ;bc = Card being processed ROMD:5A40 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:5A43 FE 01 cp a,01 ROMD:5A45 28 3F jr z,5A86 ;if it is not a Monster card, jump to D:5A86 ROMD:5A47 CD 4F 20 call 204F ;Retrieve Card Frozen status ROMD:5A4A FE 00 cp a,00 ROMD:5A4C 20 38 jr nz,5A86 ;if the card is Frozen, jump to D:5A86 ROMD:5A4E FA E8 C5 ld a,(C5E8) ;a = Field ID ROMD:5A51 CF rst 08 ROMD:5A52 07 07 => 07:4007 - Updates current Field ROMD:5A54 CD DB 60 call 60DB ROMD:5A57 CF rst 08 ROMD:5A58 09 07 => 07:4009 - Updates (C6B2) ROMD:5A5A CF rst 08 ROMD:5A5B 05 07 => 07:4005 - to 7:4044 ROMD:5A5D FA B7 C6 ld a,(C6B7) ROMD:5A60 4F ld c,a ROMD:5A61 FA B8 C6 ld a,(C6B8) ROMD:5A64 47 ld b,a ;bc = Selected Player's card ATK ROMD:5A65 FA C5 D4 ld a,(D4C5) ROMD:5A68 5F ld e,a ROMD:5A69 FA C6 D4 ld a,(D4C6) ROMD:5A6C 57 ld d,a ;de = Selected CPU's card ATK ROMD:5A6D B8 cp b ROMD:5A6E 38 08 jr c,5A78 ;if(CPU's card ATK < Player's card ATK), jump to D:5A78 ROMD:5A70 20 14 jr nz,5A86 ROMD:5A72 7B ld a,e ROMD:5A73 B9 cp c ROMD:5A74 38 02 jr c,5A78 ROMD:5A76 18 0E jr 5A86 ROMD:5A78 79 ld a,c ROMD:5A79 D6 01 sub a,01 ROMD:5A7B 27 daa ROMD:5A7C EA C5 D4 ld (D4C5),a ROMD:5A7F 78 ld a,b ROMD:5A80 DE 00 sbc a,00 ROMD:5A82 27 daa ROMD:5A83 EA C6 D4 ld (D4C6),a ROMD:5A86 24 inc h ROMD:5A87 7C ld a,h ROMD:5A88 FE 05 cp a,05 ROMD:5A8A 20 A3 jr nz,5A2F ;Loop to D:5A2F until the entire CPU's hand has been checked ROMD:5A8C FA C5 D4 ld a,(D4C5) ROMD:5A8F 4F ld c,a ROMD:5A90 FA C6 D4 ld a,(D4C6) ROMD:5A93 47 ld b,a ROMD:5A94 CD 38 52 call 5238 ROMD:5A97 E1 pop hl ROMD:5A98 D1 pop de ROMD:5A99 C1 pop bc ROMD:5A9A C9 ret
CPU card played subroutine
0x35B0F-0x35C0D
- CPU turn AI ?
ROMD:5B0F C5 push bc ROMD:5B10 D5 push de ROMD:5B11 E5 push hl ROMD:5B12 1E 01 ld e,01 ROMD:5B14 21 C2 D4 ld hl,D4C2 ROMD:5B17 CD AD 5F call 5FAD ROMD:5B1A CD D0 19 call 19D0 ;Update Column and Row ROMD:5B1D CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5B20 FA A3 C7 ld a,(C7A3) ROMD:5B23 4F ld c,a ROMD:5B24 FA A4 C7 ld a,(C7A4) ROMD:5B27 47 ld b,a ;Copy Card being processed in register bc ROMD:5B28 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:5B2B FE 00 cp a,00 ROMD:5B2D C2 09 5C jp nz,5C09 ROMD:5B30 CD 4F 20 call 204F ;Retrieve Card Frozen status ROMD:5B33 FE 00 cp a,00 ROMD:5B35 C2 09 5C jp nz,5C09 ;If the card is Frozen, get out of this function ROMD:5B38 CF rst 08 ROMD:5B39 83 add e ROMD:5B3A 03 inc bc ROMD:5B3B FE 00 cp a,00 ROMD:5B3D C2 09 5C jp nz,5C09 ROMD:5B40 21 C3 D4 ld hl,D4C3 ROMD:5B43 CD AD 5F call 5FAD ROMD:5B46 CD D0 19 call 19D0 ;Update Column and Row ROMD:5B49 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5B4C FA A3 C7 ld a,(C7A3) ROMD:5B4F 4F ld c,a ROMD:5B50 FA A4 C7 ld a,(C7A4) ROMD:5B53 47 ld b,a ;Copy Card being processed in register bc ROMD:5B54 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:5B57 FE 01 cp a,01 ROMD:5B59 28 7C jr z,5BD7 ROMD:5B5B CD 4F 20 call 204F ;Retrieve Card Frozen status ROMD:5B5E FE 00 cp a,00 ROMD:5B60 C2 09 5C jp nz,5C09 ;If the card is Frozen, get out of this function ROMD:5B63 CD DC 20 call 20DC ROMD:5B66 21 C2 D4 ld hl,D4C2 ROMD:5B69 CD AD 5F call 5FAD ROMD:5B6C CD D0 19 call 19D0 ;Update Column and Row ROMD:5B6F CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5B72 FA A3 C7 ld a,(C7A3) ROMD:5B75 4F ld c,a ROMD:5B76 FA A4 C7 ld a,(C7A4) ROMD:5B79 47 ld b,a ;Copy Card being processed in register bc ROMD:5B7A CD FD 20 call 20FD ROMD:5B7D 21 C3 D4 ld hl,D4C3 ROMD:5B80 CD AD 5F call 5FAD ROMD:5B83 CD D0 19 call 19D0 ;Update Column and Row ROMD:5B86 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5B89 FA A3 C7 ld a,(C7A3) ROMD:5B8C 4F ld c,a ROMD:5B8D FA A4 C7 ld a,(C7A4) ROMD:5B90 47 ld b,a ;Copy Card being processed in register bc ROMD:5B91 CD 0F 21 call 210F ROMD:5B94 CD 42 21 call 2142 ROMD:5B97 FE 00 cp a,00 ROMD:5B99 20 3C jr nz,5BD7 ROMD:5B9B CF rst 08 ROMD:5B9C 2D dec l ROMD:5B9D 04 inc b ROMD:5B9E FE 00 cp a,00 ROMD:5BA0 20 35 jr nz,5BD7 ROMD:5BA2 21 C3 D4 ld hl,D4C3 ROMD:5BA5 CD AD 5F call 5FAD ROMD:5BA8 CD D0 19 call 19D0 ;Update Column and Row ROMD:5BAB FA 8F C8 ld a,(C88F) ROMD:5BAE EA A3 C7 ld (C7A3),a ROMD:5BB1 FA 90 C8 ld a,(C890) ROMD:5BB4 EA A4 C7 ld (C7A4),a ;Copy Fusion Monster ID in (C7A3) (Card being processed) ROMD:5BB7 CD 25 20 call 2025 ;Hide Card, reset Level ROMD:5BBA CD C9 1F call 1FC9 ;Reveal Card ROMD:5BBD CD DF 1F call 1FDF ;Freezes Card ROMD:5BC0 CD B4 1F call 1FB4 ;Reset Card Level ROMD:5BC3 CD 00 20 call 2000 ;Card controlled by its owner ROMD:5BC6 CD FB 19 call 19FB ;Update selected card ID and status ROMD:5BC9 21 C2 D4 ld hl,D4C2 ROMD:5BCC CD AD 5F call 5FAD ROMD:5BCF CD D0 19 call 19D0 ;Update Column and Row ROMD:5BD2 CD E6 19 call 19E6 ;Remove selected card from the field ROMD:5BD5 18 30 jr 5C07 ROMD:5BD7 21 C2 D4 ld hl,D4C2 ROMD:5BDA CD AD 5F call 5FAD ROMD:5BDD CD D0 19 call 19D0 ;Update Column and Row ROMD:5BE0 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5BE3 CD 25 20 call 2025 ;Hide Card, reset Level ROMD:5BE6 CD D4 1F call 1FD4 ;Hide Card ROMD:5BE9 CD 00 20 call 2000 ;Card controlled by its owner ROMD:5BEC 21 C3 D4 ld hl,D4C3 ROMD:5BEF CD AD 5F call 5FAD ROMD:5BF2 CD D0 19 call 19D0 ;Update Column and Row ROMD:5BF5 CD FB 19 call 19FB ;Update selected card ID and status ROMD:5BF8 21 C2 D4 ld hl,D4C2 ROMD:5BFB CD AD 5F call 5FAD ROMD:5BFE CD D0 19 call 19D0 ;Update Column and Row ROMD:5C01 CD E6 19 call 19E6 ;Remove selected card from the field or hand ROMD:5C04 CD B0 60 call 60B0 ROMD:5C07 1E 00 ld e,00 ROMD:5C09 7B ld a,e ROMD:5C0A E1 pop hl ROMD:5C0B D1 pop de ROMD:5C0C C1 pop bc ROMD:5C0D C9 ret
Copies CPU's hand, Life Points and SoRL status for AI decision
ROMD:5FC3 C5 push bc ROMD:5FC4 D5 push de ROMD:5FC5 E5 push hl ROMD:5FC6 21 72 D4 ld hl,D472 ;CPU's hand - copy ROMD:5FC9 1E 00 ld e,00 ROMD:5FCB 16 00 ld d,00 ROMD:5FCD 4B ld c,e ROMD:5FCE 42 ld b,d ROMD:5FCF CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:5FD2 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:5FD5 FA A3 C7 ld a,(C7A3) ROMD:5FD8 22 ldi (hl),a ;Copy the card being processed in (D472) ROMD:5FD9 FA A4 C7 ld a,(C7A4) ROMD:5FDC 22 ldi (hl),a ROMD:5FDD FA A5 C7 ld a,(C7A5) ROMD:5FE0 22 ldi (hl),a ;Copy the card status as well ROMD:5FE1 14 inc d ROMD:5FE2 3E 06 ld a,06 ROMD:5FE4 BA cp d ROMD:5FE5 20 E7 jr nz,5FCE ROMD:5FE7 1C inc e ROMD:5FE8 3E 04 ld a,04 ROMD:5FEA BB cp e ROMD:5FEB 20 DE jr nz,5FCB ROMD:5FED FA CA C5 ld a,(C5CA) ;CPU's Life Points - copy ROMD:5FF0 22 ldi (hl),a ROMD:5FF1 FA CB C5 ld a,(C5CB) ROMD:5FF4 22 ldi (hl),a ROMD:5FF5 FA C7 C5 ld a,(C5C7) ;Player's Life Points - copy ROMD:5FF8 22 ldi (hl),a ROMD:5FF9 FA C8 C5 ld a,(C5C8) ROMD:5FFC 22 ldi (hl),a ROMD:5FFD FA E8 C5 ld a,(C5E8) ;Field ID ROMD:6000 22 ldi (hl),a ROMD:6001 FA 99 C9 ld a,(C999) ;Player's Swords of Revealing Light flag copy ROMD:6004 22 ldi (hl),a ROMD:6005 FA 9A C9 ld a,(C99A) ;CPU's Swords of Revealing Light flag copy ROMD:6008 22 ldi (hl),a ROMD:6009 FA 97 C9 ld a,(C997) ;(C997) copy ROMD:600C 22 ldi (hl),a ROMD:600D E1 pop hl ROMD:600E D1 pop de ROMD:600F C1 pop bc ROMD:6010 C9 ret
D:6011 (CPU AI)
0x36011
- Reads the cards in CPU's hand, from working RAM at0xD472
, then stores it at0xC7A3
and determines whether or not it should be played with the value at0xC7A5
0x36031
- Maximum number of cards in hand + 1 (0x06
). The game will read the next card as long as this number has not been reached.0x36037
- It's done 5 times each time after a monster attacked or defended ; for example in case card #4 was activated on the first check and that it changed the playability of card #2
ROMD:6011 C5 push bc ROMD:6012 D5 push de ROMD:6013 E5 push hl ROMD:6014 21 72 D4 ld hl,D472 ROMD:6017 1E 00 ld e,00 ROMD:6019 16 00 ld d,00 ROMD:601B 4B ld c,e ROMD:601C 42 ld b,d ROMD:601D CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6020 2A ldi a,(hl) ROMD:6021 EA A3 C7 ld (C7A3),a ROMD:6024 2A ldi a,(hl) ROMD:6025 EA A4 C7 ld (C7A4),a ROMD:6028 2A ldi a,(hl) ROMD:6029 EA A5 C7 ld (C7A5),a ;Copy card ID + card status in currently processed card at (C7A3) ROMD:602C CD FB 19 call 19FB ;Updates selected card ID and status ROMD:602F 14 inc d ROMD:6030 3E 06 ld a,06 ROMD:6032 BA cp d ROMD:6033 20 E7 jr nz,601C ;Loop until all the cards in the current row have been checked ROMD:6035 1C inc e ROMD:6036 3E 04 ld a,04 ROMD:6038 BB cp e ROMD:6039 20 DE jr nz,6019 ;Loop until the 4 rows have been checked ROMD:603B 2A ldi a,(hl) ROMD:603C EA CA C5 ld (C5CA),a ROMD:603F 2A ldi a,(hl) ROMD:6040 EA CB C5 ld (C5CB),a ;CPU's Life Points ROMD:6043 2A ldi a,(hl) ROMD:6044 EA C7 C5 ld (C5C7),a ROMD:6047 2A ldi a,(hl) ROMD:6048 EA C8 C5 ld (C5C8),a ;Player's Life Points ROMD:604B 2A ldi a,(hl) ROMD:604C EA E8 C5 ld (C5E8),a ;Field ID ROMD:604F 2A ldi a,(hl) ROMD:6050 EA 99 C9 ld (C999),a ;CPU's Swords of Revealing Light ROMD:6053 2A ldi a,(hl) ROMD:6054 EA 9A C9 ld (C99A),a ;Player's Swords of Revealing Light ROMD:6057 2A ldi a,(hl) ROMD:6058 EA 97 C9 ld (C997),a ROMD:605B E1 pop hl ROMD:605C D1 pop de ROMD:605D C1 pop bc ROMD:605E C9 ret
D:605F
ROMD:605F CD 27 59 call 5927 ROMD:6062 E6 01 and a,01 ROMD:6064 28 0C jr z,6072 ROMD:6066 CD AC 60 call 60AC ROMD:6069 CD AD 5F call 5FAD ROMD:606C CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:606F CD E6 19 call 19E6 ;Remove selected card from the field ROMD:6072 CD 27 59 call 5927 ROMD:6075 E6 02 and a,02 ROMD:6077 28 0C jr z,6085 ROMD:6079 CD A8 60 call 60A8 ROMD:607C CD AD 5F call 5FAD ROMD:607F CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6082 CD E6 19 call 19E6 ;Remove selected card from the field ROMD:6085 C9 ret
D:6085
ROMD:6085 C9 ret ROMD:6086 CD 27 59 call 5927 ROMD:6089 E6 04 and a,04 ROMD:608B 28 03 jr z,6090 ROMD:608D CD 63 24 call 2463 ROMD:6090 CD 27 59 call 5927 ROMD:6093 E6 08 and a,08 ROMD:6095 28 03 jr z,609A ROMD:6097 CD 6B 24 call 246B ROMD:609A C9 ret
D:609B
ROMD:609B 2A ldi a,(hl) ROMD:609C EA C2 D4 ld (D4C2),a ROMD:609F 7E ld a,(hl) ROMD:60A0 EA C3 D4 ld (D4C3),a ROMD:60A3 C9 ret
D:60A4
ROMD:60A4 21 49 61 ld hl,6149 ROMD:60A7 C9 ret
D:60A8
ROMD:60A8 21 C2 D4 ld hl,D4C2 ROMD:60AB C9 ret
D:60AC
ROMD:60AC 21 C3 D4 ld hl,D4C3 ROMD:60AF C9 ret
D:60B0
ROMD:60B0 C5 push bc ROMD:60B1 D5 push de ROMD:60B2 16 00 ld d,00 ROMD:60B4 42 ld b,d ROMD:60B5 0E 00 ld c,00 ROMD:60B7 CD D0 19 call 19D0 ROMD:60BA CD 13 1A call 1A13 ROMD:60BD FA A3 C7 ld a,(C7A3) ROMD:60C0 4F ld c,a ROMD:60C1 FA A4 C7 ld a,(C7A4) ROMD:60C4 47 ld b,a ;bc = Card being processed ROMD:60C5 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:60C8 FE 00 cp a,00 ROMD:60CA 20 06 jr nz,60D2 ROMD:60CC CD DF 1F call 1FDF ;Freezes Card ROMD:60CF CD FB 19 call 19FB ROMD:60D2 14 inc d ROMD:60D3 3E 05 ld a,05 ROMD:60D5 BA cp d ROMD:60D6 20 DC jr nz,60B4 ROMD:60D8 D1 pop de ROMD:60D9 C1 pop bc ROMD:60DA C9 ret
D:60DB
ROMD:60DB FA A5 C7 ld a,(C7A5) ;Card Status ROMD:60DE E6 30 and a,30 ROMD:60E0 CB 37 swap a ROMD:60E2 C9 ret
D:60E3 - Retrieves Field ID, then checks if card is not a Monster
0x360E3-0x3610E
- Retrieves Field ID, then checks if card ID submitted as a parameter is not a Monster card
ROMD:60E3 D5 push de ROMD:60E4 1E 01 ld e,01 ROMD:60E6 78 ld a,b ROMD:60E7 FE 00 cp a,00 ROMD:60E9 20 07 jr nz,60F2 ROMD:60EB 79 ld a,c ROMD:60EC FE 00 cp a,00 ROMD:60EE 20 02 jr nz,60F2 ROMD:60F0 18 1A jr 610C ;If no card is being processed, jump to D:610C ROMD:60F2 1E 00 ld e,00 ROMD:60F4 FA E8 C5 ld a,(C5E8) ;Field ID ROMD:60F7 CF rst 08 ROMD:60F8 07 07 => Pointer 07:4007 ROMD:60FA CD DB 60 call 60DB ROMD:60FD CF rst 08 ROMD:60FE 09 07 => Pointer 07:4009 ROMD:6100 CF rst 08 ROMD:6101 05 07 => Pointer 07:4005 ROMD:6103 FA BF C6 ld a,(C6BF) ;Current card Effect ID (magic trap ritual) ROMD:6106 FE 02 cp a,02 ROMD:6108 28 02 jr z,610C ;If it is a Monster card, jump to D:610C ROMD:610A 1E 02 ld e,02 ROMD:610C 7B ld a,e ROMD:610D D1 pop de ROMD:610E C9 ret
Retrieves Card ID in selected card zone, and stores it in (D500)
ROMD:6504 C5 push bc ROMD:6505 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6508 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:650B FA A3 C7 ld a,(C7A3) ROMD:650E 4F ld c,a ROMD:650F FA A4 C7 ld a,(C7A4) ROMD:6512 47 ld b,a ;bc = Card being processed ROMD:6513 CD 0D 76 call 760D ;Store Card being processed in (D500) ROMD:6516 CF rst 08 ROMD:6517 0D 07 => Pointer 07:400D ROMD:6519 C1 pop bc ROMD:651A C9 ret
AI - Equip a Monster
ROMD:651B C5 push bc ROMD:651C D5 push de ROMD:651D 57 ld d,a ROMD:651E FA CA D4 ld a,(D4CA) ROMD:6521 47 ld b,a ;Column ROMD:6522 FA CB D4 ld a,(D4CB) ROMD:6525 4F ld c,a ;Row ROMD:6526 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6529 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:652C CD 4F 20 call 204F ;Retrieve Card Frozen status ROMD:652F FE 00 cp a,00 ROMD:6531 20 38 jr nz,656B ;If the card is Frozen, get out of this function ROMD:6533 3E 00 ld a,00 ROMD:6535 EA CE D4 ld (D4CE),a ROMD:6538 FA CA D4 ld a,(D4CA) ROMD:653B 47 ld b,a ;Column ROMD:653C FA CB D4 ld a,(D4CB) ROMD:653F 4F ld c,a ;Row ROMD:6540 CD 04 65 call 6504 ;Retrieves Card ID in selected card zone, and stores it in (D500) ROMD:6543 FE 00 cp a,00 ROMD:6545 20 0C jr nz,6553 ROMD:6547 3E 0A ld a,0A ROMD:6549 CD BE 73 call 73BE ;Update (D4D5) ROMD:654C 3E 02 ld a,02 ROMD:654E CD 90 75 call 7590 ;Update (D504) ROMD:6551 18 18 jr 656B ROMD:6553 CD DD 73 call 73DD ROMD:6556 FA C7 D4 ld a,(D4C7) ROMD:6559 FE 01 cp a,01 ROMD:655B 20 09 jr nz,6566 ROMD:655D 3E 03 ld a,03 ROMD:655F CD 90 75 call 7590 ;Update (D504) ROMD:6562 3E 09 ld a,09 ROMD:6564 18 02 jr 6568 ROMD:6566 3E 02 ld a,02 ROMD:6568 CD BE 73 call 73BE ;Update (D4D5) ROMD:656B D1 pop de ROMD:656C C1 pop bc ROMD:656D C9 ret
CPU Card Effects
AI Field Spell
AI - Forest
0x367D1-0x367E0
- Forest
ROMD:67D1 3E 01 ld a,01 ROMD:67D3 CD BE 73 call 73BE ;Updates (D4D5) ROMD:67D6 3E 01 ld a,01 ROMD:67D8 CD 28 74 call 7428 ;Changes AI Field ID ROMD:67DB 3E 00 ld a,00 ROMD:67DD EA CE D4 ld (D4CE),a ROMD:67E0 C9 ret
AI - Wasteland
0x367E1-0x367F0
- Wasteland
ROMD:67E1 3E 01 ld a,01 ROMD:67E3 CD BE 73 call 73BE ;Updates (D4D5) ROMD:67E6 3E 02 ld a,02 ROMD:67E8 CD 28 74 call 7428 ;Changes AI Field ID ROMD:67EB 3E 00 ld a,00 ROMD:67ED EA CE D4 ld (D4CE),a ROMD:67F0 C9 ret
AI - Mountain
0x367F1-0x36800
- Mountain
ROMD:67F1 3E 01 ld a,01 ROMD:67F3 CD BE 73 call 73BE ;Updates (D4D5) ROMD:67F6 3E 03 ld a,03 ROMD:67F8 CD 28 74 call 7428 ;Changes AI Field ID ROMD:67FB 3E 00 ld a,00 ROMD:67FD EA CE D4 ld (D4CE),a ROMD:6800 C9 ret
AI - Sogen
0x36801-0x3681
- Sogen
ROMD:6801 3E 01 ld a,01 ROMD:6803 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6806 3E 04 ld a,04 ROMD:6808 CD 28 74 call 7428 ;Changes AI Field ID ROMD:680B 3E 00 ld a,00 ROMD:680D EA CE D4 ld (D4CE),a ROMD:6810 C9 ret
AI - Umi
0x36811-0x36820
- Umi
ROMD:6811 3E 01 ld a,01 ROMD:6813 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6816 3E 05 ld a,05 ROMD:6818 CD 28 74 call 7428 ;Changes AI Field ID ROMD:681B 3E 00 ld a,00 ROMD:681D EA CE D4 ld (D4CE),a ROMD:6820 C9 ret
AI - Yami
0x36821-0x36830
- Yami
ROMD:6821 3E 01 ld a,01 ROMD:6823 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6826 3E 06 ld a,06 ROMD:6828 CD 28 74 call 7428 ;Changes AI Field ID ROMD:682B 3E 00 ld a,00 ROMD:682D EA CE D4 ld (D4CE),a ROMD:6830 C9 ret
AI Healing Spell
AI - Mooyan Curry
0x36831-0x36856
- Mooyan Curry
ROMD:6831 C5 push bc ROMD:6832 01 00 02 ld bc,0200 ROMD:6835 CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:6838 CD 52 64 call 6452 ROMD:683B FA C7 D4 ld a,(D4C7) ROMD:683E FE 01 cp a,01 ROMD:6840 20 09 jr nz,684B ROMD:6842 3E 03 ld a,03 ROMD:6844 CD 90 75 call 7590 ;Updates (D504) ROMD:6847 3E 06 ld a,06 ROMD:6849 18 02 jr 684D ROMD:684B 3E 05 ld a,05 ROMD:684D CD BE 73 call 73BE ;Updates (D4D5) ROMD:6850 3E 00 ld a,00 ROMD:6852 EA CE D4 ld (D4CE),a ROMD:6855 C1 pop bc ROMD:6856 C9 ret
AI - Red Medicine
0x36857-0x3687C
- Red Medicine
ROMD:6857 C5 push bc ROMD:6858 01 00 05 ld bc,0500 ROMD:685B CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:685E CD 52 64 call 6452 ROMD:6861 FA C7 D4 ld a,(D4C7) ROMD:6864 FE 01 cp a,01 ROMD:6866 20 09 jr nz,6871 ROMD:6868 3E 03 ld a,03 ROMD:686A CD 90 75 call 7590 ;Updates (D504) ROMD:686D 3E 06 ld a,06 ROMD:686F 18 02 jr 6873 ROMD:6871 3E 05 ld a,05 ROMD:6873 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6876 3E 00 ld a,00 ROMD:6878 EA CE D4 ld (D4CE),a ROMD:687B C1 pop bc ROMD:687C C9 ret
AI - Goblin's Secret Remedy
0x3687D-0x368A2
- Goblin's Secret Remedy
ROMD:687D C5 push bc ROMD:687E 01 00 10 ld bc,1000 ROMD:6881 CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:6884 CD 52 64 call 6452 ROMD:6887 FA C7 D4 ld a,(D4C7) ROMD:688A FE 01 cp a,01 ROMD:688C 20 09 jr nz,6897 ROMD:688E 3E 03 ld a,03 ROMD:6890 CD 90 75 call 7590 ;Updates (D504) ROMD:6893 3E 06 ld a,06 ROMD:6895 18 02 jr 6899 ROMD:6897 3E 05 ld a,05 ROMD:6899 CD BE 73 call 73BE ;Updates (D4D5) ROMD:689C 3E 00 ld a,00 ROMD:689E EA CE D4 ld (D4CE),a ROMD:68A1 C1 pop bc ROMD:68A2 C9 ret
AI - Soul of the Pure
0x368A3-0x368C8
- Soul of the Pure
ROMD:68A3 C5 push bc ROMD:68A4 01 00 20 ld bc,2000 ROMD:68A7 CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:68AA CD 52 64 call 6452 ROMD:68AD FA C7 D4 ld a,(D4C7) ROMD:68B0 FE 01 cp a,01 ROMD:68B2 20 09 jr nz,68BD ROMD:68B4 3E 03 ld a,03 ROMD:68B6 CD 90 75 call 7590 ;Updates (D504) ROMD:68B9 3E 06 ld a,06 ROMD:68BB 18 02 jr 68BF ROMD:68BD 3E 05 ld a,05 ROMD:68BF CD BE 73 call 73BE ;Updates (D4D5) ROMD:68C2 3E 00 ld a,00 ROMD:68C4 EA CE D4 ld (D4CE),a ROMD:68C7 C1 pop bc ROMD:68C8 C9 ret
AI - Dian Keto the Cure Master
0x368C9-0x368EE
- Dian Keto the Cure Master
ROMD:68C9 C5 push bc ROMD:68CA 01 00 50 ld bc,5000 ROMD:68CD CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:68D0 CD 52 64 call 6452 ROMD:68D3 FA C7 D4 ld a,(D4C7) ROMD:68D6 FE 01 cp a,01 ROMD:68D8 20 09 jr nz,68E3 ROMD:68DA 3E 03 ld a,03 ROMD:68DC CD 90 75 call 7590 ;Updates (D504) ROMD:68DF 3E 06 ld a,06 ROMD:68E1 18 02 jr 68E5 ROMD:68E3 3E 05 ld a,05 ROMD:68E5 CD BE 73 call 73BE ;Updates (D4D5) ROMD:68E8 3E 00 ld a,00 ROMD:68EA EA CE D4 ld (D4CE),a ROMD:68ED C1 pop bc ROMD:68EE C9 ret
AI Damage Spell
AI - Sparks
0x368EF-0x36915
- Sparks
ROMD:68EF C5 push bc ROMD:68F0 01 50 00 ld bc,0050 ROMD:68F3 CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:68F6 FA C7 D4 ld a,(D4C7) ROMD:68F9 FE 01 cp a,01 ROMD:68FB 20 0A jr nz,6907 ROMD:68FD 3E 03 ld a,03 ROMD:68FF CD 90 75 call 7590 ;Updates (D504) ROMD:6902 CD 52 64 call 6452 ROMD:6905 18 03 jr 690A ROMD:6907 CD 5C 64 call 645C ROMD:690A 3E 06 ld a,06 ROMD:690C CD BE 73 call 73BE ;Updates (D4D5) ROMD:690F 3E 00 ld a,00 ROMD:6911 EA CE D4 ld (D4CE),a ROMD:6914 C1 pop bc ROMD:6915 C9 ret
AI - Hinotama
0x36916-0x3693C
- Hinotama
ROMD:6916 C5 push bc ROMD:6917 01 00 01 ld bc,0100 ROMD:691A CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:691D FA C7 D4 ld a,(D4C7) ROMD:6920 FE 01 cp a,01 ROMD:6922 20 0A jr nz,692E ROMD:6924 3E 03 ld a,03 ROMD:6926 CD 90 75 call 7590 ;Updates (D504) ROMD:6929 CD 52 64 call 6452 ROMD:692C 18 03 jr 6931 ROMD:692E CD 5C 64 call 645C ROMD:6931 3E 06 ld a,06 ROMD:6933 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6936 3E 00 ld a,00 ROMD:6938 EA CE D4 ld (D4CE),a ROMD:693B C1 pop bc ROMD:693C C9 ret
AI - Final Flame
0x3693D-0x36963
- Final Flame
ROMD:693D C5 push bc ROMD:693E 01 00 02 ld bc,0200 ROMD:6941 CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:6944 FA C7 D4 ld a,(D4C7) ROMD:6947 FE 01 cp a,01 ROMD:6949 20 0A jr nz,6955 ROMD:694B 3E 03 ld a,03 ROMD:694D CD 90 75 call 7590 ;Updates (D504) ROMD:6950 CD 52 64 call 6452 ROMD:6953 18 03 jr 6958 ROMD:6955 CD 5C 64 call 645C ROMD:6958 3E 06 ld a,06 ROMD:695A CD BE 73 call 73BE ;Updates (D4D5) ROMD:695D 3E 00 ld a,00 ROMD:695F EA CE D4 ld (D4CE),a ROMD:6962 C1 pop bc ROMD:6963 C9 ret
AI - Ookazi
0x36964-0x3698A
- Ookazi
ROMD:6964 C5 push bc ROMD:6965 01 00 05 ld bc,0500 ROMD:6968 CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:696B FA C7 D4 ld a,(D4C7) ROMD:696E FE 01 cp a,01 ROMD:6970 20 0A jr nz,697C ROMD:6972 3E 03 ld a,03 ROMD:6974 CD 90 75 call 7590 ;Updates (D504) ROMD:6977 CD 52 64 call 6452 ROMD:697A 18 03 jr 697F ROMD:697C CD 5C 64 call 645C ROMD:697F 3E 06 ld a,06 ROMD:6981 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6984 3E 00 ld a,00 ROMD:6986 EA CE D4 ld (D4CE),a ROMD:6989 C1 pop bc ROMD:698A C9 ret
AI - Tremendous Fire
0x3698B-0x369B1
- Tremendous Fire
ROMD:698B C5 push bc ROMD:698C 01 00 10 ld bc,1000 ROMD:698F CD 18 74 call 7418 ;Stores Direct Damage or Healing to (D4F8) ROMD:6992 FA C7 D4 ld a,(D4C7) ROMD:6995 FE 01 cp a,01 ROMD:6997 20 0A jr nz,69A3 ROMD:6999 3E 03 ld a,03 ROMD:699B CD 90 75 call 7590 ;Updates (D504) ROMD:699E CD 52 64 call 6452 ROMD:69A1 18 03 jr 69A6 ROMD:69A3 CD 5C 64 call 645C ROMD:69A6 3E 06 ld a,06 ROMD:69A8 CD BE 73 call 73BE ;Updates (D4D5) ROMD:69AB 3E 00 ld a,00 ROMD:69AD EA CE D4 ld (D4CE),a ROMD:69B0 C1 pop bc ROMD:69B1 C9 ret
AI - Dark Hole
ROMD:69B2 C5 push bc ROMD:69B3 3E 07 ld a,07 ROMD:69B5 CD BE 73 call 73BE ;Updates (D4D5) ROMD:69B8 3E 00 ld a,00 ROMD:69BA CD 09 74 call 7409 ROMD:69BD CD FF 65 call 65FF ROMD:69C0 3E 00 ld a,00 ROMD:69C2 EA CE D4 ld (D4CE),a ROMD:69C5 C1 pop bc ROMD:69C6 C9 ret
AI - Raigeki
ROMD:69C7 C5 push bc ROMD:69C8 3E 07 ld a,07 ROMD:69CA CD BE 73 call 73BE ;Updates (D4D5) ROMD:69CD FA C7 D4 ld a,(D4C7) ROMD:69D0 FE 01 cp a,01 ROMD:69D2 20 0A jr nz,69DE ROMD:69D4 3E 03 ld a,03 ROMD:69D6 CD 90 75 call 7590 ;Updates (D504) ROMD:69D9 CD 52 64 call 6452 ROMD:69DC 18 03 jr 69E1 ROMD:69DE CD 5C 64 call 645C ROMD:69E1 FA CC D4 ld a,(D4CC) ROMD:69E4 FE 00 cp a,00 ROMD:69E6 20 05 jr nz,69ED ROMD:69E8 CD 31 66 call 6631 ROMD:69EB 18 03 jr 69F0 ROMD:69ED CD 06 66 call 6606 ROMD:69F0 3E 00 ld a,00 ROMD:69F2 EA CE D4 ld (D4CE),a ROMD:69F5 C1 pop bc ROMD:69F6 C9 ret
AI Equip Spells 1
AI - Legendary Sword
ROMD:69F7 3E 00 ld a,00 ROMD:69F9 CD 1B 65 call 651B ROMD:69FC 3E 01 ld a,01 ROMD:69FE CD 23 74 call 7423 ROMD:6A01 C9 ret
AI - Sword of Ruin
ROMD:6A02 3E 01 ld a,01 ROMD:6A04 CD 1B 65 call 651B ROMD:6A07 3E 01 ld a,01 ROMD:6A09 CD 23 74 call 7423 ROMD:6A0C C9 ret
AI - Dark Energy
ROMD:6A0D 3E 02 ld a,02 ROMD:6A0F CD 1B 65 call 651B ROMD:6A12 3E 01 ld a,01 ROMD:6A14 CD 23 74 call 7423 ROMD:6A17 C9 ret
AI - Axe of Despair
ROMD:6A18 3E 03 ld a,03 ROMD:6A1A CD 1B 65 call 651B ROMD:6A1D 3E 01 ld a,01 ROMD:6A1F CD 23 74 call 7423 ROMD:6A22 C9 ret
AI - Lazer Cannon Armor
ROMD:6A23 3E 04 ld a,04 ROMD:6A25 CD 1B 65 call 651B ROMD:6A28 3E 01 ld a,01 ROMD:6A2A CD 23 74 call 7423 ROMD:6A2D C9 ret
AI - Insect Armor with Laser Cannon
ROMD:6A2E 3E 05 ld a,05 ROMD:6A30 CD 1B 65 call 651B ROMD:6A33 3E 01 ld a,01 ROMD:6A35 CD 23 74 call 7423 ROMD:6A38 C9 ret
AI - Elf's Light
ROMD:6A39 3E 06 ld a,06 ROMD:6A3B CD 1B 65 call 651B ROMD:6A3E 3E 01 ld a,01 ROMD:6A40 CD 23 74 call 7423 ROMD:6A43 C9 ret
AI - Beast Fangs
ROMD:6A44 3E 07 ld a,07 ROMD:6A46 CD 1B 65 call 651B ROMD:6A49 3E 01 ld a,01 ROMD:6A4B CD 23 74 call 7423 ROMD:6A4E C9 ret
AI - Steel Shell
ROMD:6A4F 3E 08 ld a,08 ROMD:6A51 CD 1B 65 call 651B ROMD:6A54 3E 01 ld a,01 ROMD:6A56 CD 23 74 call 7423 ROMD:6A59 C9 ret
AI - Vile Germs
ROMD:6A5A 3E 09 ld a,09 ROMD:6A5C CD 1B 65 call 651B ROMD:6A5F 3E 01 ld a,01 ROMD:6A61 CD 23 74 call 7423 ROMD:6A64 C9 ret
AI - Black Pendant
ROMD:6A65 3E 0A ld a,0A ROMD:6A67 CD 1B 65 call 651B ROMD:6A6A 3E 01 ld a,01 ROMD:6A6C CD 23 74 call 7423 ROMD:6A6F C9 ret
AI - Silver Bow & Arrow
ROMD:6A70 3E 0B ld a,0B ROMD:6A72 CD 1B 65 call 651B ROMD:6A75 3E 01 ld a,01 ROMD:6A77 CD 23 74 call 7423 ROMD:6A7A C9 ret
AI - Horn of Light
ROMD:6A7B 3E 0C ld a,0C ROMD:6A7D CD 1B 65 call 651B ROMD:6A80 3E 01 ld a,01 ROMD:6A82 CD 23 74 call 7423 ROMD:6A85 C9 ret
AI - Horn of the Unicorn
ROMD:6A86 3E 0D ld a,0D ROMD:6A88 CD 1B 65 call 651B ROMD:6A8B 3E 01 ld a,01 ROMD:6A8D CD 23 74 call 7423 ROMD:6A90 C9 ret
AI - Dragon Treasure
ROMD:6A91 3E 0E ld a,0E ROMD:6A93 CD 1B 65 call 651B ROMD:6A96 3E 01 ld a,01 ROMD:6A98 CD 23 74 call 7423 ROMD:6A9B C9 ret
AI - Electro-whip
ROMD:6A9C 3E 0F ld a,0F ROMD:6A9E CD 1B 65 call 651B ROMD:6AA1 3E 01 ld a,01 ROMD:6AA3 CD 23 74 call 7423 ROMD:6AA6 C9 ret
AI - Cyber Shield
ROMD:6AA7 3E 10 ld a,10 ROMD:6AA9 CD 1B 65 call 651B ROMD:6AAC 3E 01 ld a,01 ROMD:6AAE CD 23 74 call 7423 ROMD:6AB1 C9 ret
AI - Mystical Moon
ROMD:6AB2 3E 11 ld a,11 ROMD:6AB4 CD 1B 65 call 651B ROMD:6AB7 3E 01 ld a,01 ROMD:6AB9 CD 23 74 call 7423 ROMD:6ABC C9 ret
AI - Malevolent Nuzzler
ROMD:6ABD 3E 12 ld a,12 ROMD:6ABF CD 1B 65 call 651B ROMD:6AC2 3E 01 ld a,01 ROMD:6AC4 CD 23 74 call 7423 ROMD:6AC7 C9 ret
AI - Violet Crystal
ROMD:6AC8 3E 13 ld a,13 ROMD:6ACA CD 1B 65 call 651B ROMD:6ACD 3E 01 ld a,01 ROMD:6ACF CD 23 74 call 7423 ROMD:6AD2 C9 ret
AI - Book of Secret Art
ROMD:6AD3 3E 14 ld a,14 ROMD:6AD5 CD 1B 65 call 651B ROMD:6AD8 3E 01 ld a,01 ROMD:6ADA CD 23 74 call 7423 ROMD:6ADD C9 ret
AI - Invigoration
ROMD:6ADE 3E 15 ld a,15 ROMD:6AE0 CD 1B 65 call 651B ROMD:6AE3 3E 01 ld a,01 ROMD:6AE5 CD 23 74 call 7423 ROMD:6AE8 C9 ret
AI - Machine Conversion
ROMD:6AE9 3E 16 ld a,16 ROMD:6AEB CD 1B 65 call 651B ROMD:6AEE 3E 01 ld a,01 ROMD:6AF0 CD 23 74 call 7423 ROMD:6AF3 C9 ret
AI - Raise Body Heat
ROMD:6AF4 3E 17 ld a,17 ROMD:6AF6 CD 1B 65 call 651B ROMD:6AF9 3E 01 ld a,01 ROMD:6AFB CD 23 74 call 7423 ROMD:6AFE C9 ret
AI - Follow Wind
ROMD:6AFF 3E 18 ld a,18 ROMD:6B01 CD 1B 65 call 651B ROMD:6B04 3E 01 ld a,01 ROMD:6B06 CD 23 74 call 7423 ROMD:6B09 C9 ret
AI - Power of Kaishin
ROMD:6B0A 3E 19 ld a,19 ROMD:6B0C CD 1B 65 call 651B ROMD:6B0F 3E 01 ld a,01 ROMD:6B11 CD 23 74 call 7423 ROMD:6B14 C9 ret
AI - Fail-safe (ret)
ROMD:6B15 C9 ret
AI - Stop Defense
ROMD:6B16 3E 0C ld a,0C ROMD:6B18 CD BE 73 call 73BE ; Updates (D4D5) ROMD:6B1B CD 5C 64 call 645C ROMD:6B1E FA CC D4 ld a,(D4CC) ROMD:6B21 FE 00 cp a,00 ROMD:6B23 20 28 jr nz,6B4D ROMD:6B25 16 01 ld d,01 ROMD:6B27 1E 02 ld e,02 ROMD:6B29 42 ld b,d ROMD:6B2A 4B ld c,e ROMD:6B2B CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6B2E CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:6B31 FA A3 C7 ld a,(C7A3) ROMD:6B34 4F ld c,a ROMD:6B35 FA A4 C7 ld a,(C7A4) ROMD:6B38 47 ld b,a ;bc = Card being processed ROMD:6B39 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:6B3C FE 00 cp a,00 ROMD:6B3E 20 05 jr nz,6B45 ;If no Monster card in this card zone, jump to D:6B45 ROMD:6B40 42 ld b,d ROMD:6B41 4B ld c,e ROMD:6B42 CD DD 73 call 73DD ROMD:6B45 14 inc d ROMD:6B46 3E 06 ld a,06 ROMD:6B48 BA cp d ROMD:6B49 20 DE jr nz,6B29 ;Loop to D:6B29 until every card zone has been checked ROMD:6B4B 18 26 jr 6B73 ROMD:6B4D 16 00 ld d,00 ROMD:6B4F 1E 01 ld e,01 ROMD:6B51 42 ld b,d ROMD:6B52 4B ld c,e ROMD:6B53 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6B56 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:6B59 FA A3 C7 ld a,(C7A3) ROMD:6B5C 4F ld c,a ROMD:6B5D FA A4 C7 ld a,(C7A4) ROMD:6B60 47 ld b,a ;bc = Card being processed ROMD:6B61 CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:6B64 FE 00 cp a,00 ROMD:6B66 20 05 jr nz,6B6D ;if no Monster card in this card zone, jump to D:6B6D ROMD:6B68 42 ld b,d ROMD:6B69 4B ld c,e ROMD:6B6A CD DD 73 call 73DD ROMD:6B6D 14 inc d ROMD:6B6E 3E 05 ld a,05 ROMD:6B70 BA cp d ROMD:6B71 20 DE jr nz,6B51 ;Loop to D:6B51 until every card zone has been checked ROMD:6B73 3E 00 ld a,00 ROMD:6B75 EA CE D4 ld (D4CE),a ROMD:6B78 C9 ret
AI - Dragon Capture Jar
ROMD:6B79 CD 5C 64 call 645C ROMD:6B7C 3E 00 ld a,00 ROMD:6B7E CD 98 65 call 6598 ROMD:6B81 3E 00 ld a,00 ROMD:6B83 EA CE D4 ld (D4CE),a ROMD:6B86 C9 ret
AI - Swords of Revealing Light
ROMD:6B87 CD 5C 64 call 645C ROMD:6B8A 3E 0D ld a,0D ROMD:6B8C CD BE 73 call 73BE ;Updates (D4D5) ROMD:6B8F CD FF 65 call 65FF ROMD:6B92 3E 00 ld a,00 ROMD:6B94 EA CE D4 ld (D4CE),a ROMD:6B97 C9 ret
AI - Dark-Piercing Light
ROMD:6B98 3E 0E ld a,0E ROMD:6B9A CD BE 73 call 73BE ;Updates (D4D5) ROMD:6B9D CD FF 65 call 65FF ROMD:6BA0 3E 00 ld a,00 ROMD:6BA2 EA CE D4 ld (D4CE),a ROMD:6BA5 C9 ret
AI - Spellbinding Circle
ROMD:6BA6 3E 09 ld a,09 ROMD:6BA8 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6BAB CD 5C 64 call 645C ROMD:6BAE 3E 01 ld a,01 ROMD:6BB0 CD 23 74 call 7423 ROMD:6BB3 FA CC D4 ld a,(D4CC) ROMD:6BB6 FE 00 cp a,00 ROMD:6BB8 20 05 jr nz,6BBF ROMD:6BBA CD 31 66 call 6631 ROMD:6BBD 18 03 jr 6BC2 ROMD:6BBF CD 06 66 call 6606 ROMD:6BC2 3E 00 ld a,00 ROMD:6BC4 EA CE D4 ld (D4CE),a ROMD:6BC7 C9 ret
AI - Elegant Egotist
ROMD:6BC8 FA CA D4 ld a,(D4CA) ROMD:6BCB 47 ld b,a ROMD:6BCC FA CB D4 ld a,(D4CB) ROMD:6BCF 4F ld c,a ROMD:6BD0 CD DD 73 call 73DD ROMD:6BD3 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:6BD6 CD 13 1A call 1A13 ;Loads card ID from the selected card zone + card status in (C7A3) ROMD:6BD9 CD 4F 20 call 204F ;Retrieve Card Frozen status ROMD:6BDC FE 00 cp a,00 ROMD:6BDE 20 34 jr nz,6C14 ;If the card is Frozen, get out of this function ROMD:6BE0 3E 00 ld a,00 ROMD:6BE2 EA CE D4 ld (D4CE),a ROMD:6BE5 FA A3 C7 ld a,(C7A3) ROMD:6BE8 4F ld c,a ROMD:6BE9 FA A4 C7 ld a,(C7A4) ROMD:6BEC 47 ld b,a ;bc = Card being processed ROMD:6BED 11 3E 00 ld de,003E ROMD:6BF0 CD 14 1B call 1B14 ;Checks if Card ID ≠ Harpie Lady ROMD:6BF3 FE 00 cp a,00 ROMD:6BF5 20 13 jr nz,6C0A ;If this isn't Harpie Lady, jump to D:6C0A ROMD:6BF7 CD 0D 76 call 760D ROMD:6BFA 3E 0F ld a,0F ROMD:6BFC CD BE 73 call 73BE ;Updates (D4D5) ROMD:6BFF 01 3F 00 ld bc,003F ;Harpie Lady Sisters ROMD:6C02 CD 18 76 call 7618 ROMD:6C05 CD 0D 74 call 740D ROMD:6C08 18 0A jr 6C14 ROMD:6C0A 3E 02 ld a,02 ROMD:6C0C CD 90 75 call 7590 ;Updates (D504) ROMD:6C0F 3E 0A ld a,0A ROMD:6C11 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6C14 C9 ret
AI - Fail-safe (ret)
ROMD:6C15 C9 ret
AI Traps cards 1 (set)
AI - Widespread Ruin
ROMD:6C16 3E 01 ld a,01 ROMD:6C18 CD 6E 65 call 656E ROMD:6C1B 3E 00 ld a,00 ROMD:6C1D EA CE D4 ld (D4CE),a ROMD:6C20 C9 ret
AI - House of Adhesive Trap
ROMD:6C21 3E 02 ld a,02 ROMD:6C23 CD 6E 65 call 656E ROMD:6C26 3E 00 ld a,00 ROMD:6C28 EA CE D4 ld (D4CE),a ROMD:6C2B C9 ret
AI - Eatgaboon
ROMD:6C2C 3E 03 ld a,03 ROMD:6C2E CD 6E 65 call 656E ROMD:6C31 3E 00 ld a,00 ROMD:6C33 EA CE D4 ld (D4CE),a ROMD:6C36 C9 ret
AI - Bear Trap
ROMD:6C37 3E 04 ld a,04 ROMD:6C39 CD 6E 65 call 656E ROMD:6C3C 3E 00 ld a,00 ROMD:6C3E EA CE D4 ld (D4CE),a ROMD:6C41 C9 ret
AI - Invisible Wire
ROMD:6C42 3E 05 ld a,05 ROMD:6C44 CD 6E 65 call 656E ROMD:6C47 3E 00 ld a,00 ROMD:6C49 EA CE D4 ld (D4CE),a ROMD:6C4C C9 ret
AI - Acid Trap Hole
ROMD:6C4D 3E 06 ld a,06 ROMD:6C4F CD 6E 65 call 656E ROMD:6C52 3E 00 ld a,00 ROMD:6C54 EA CE D4 ld (D4CE),a ROMD:6C57 C9 ret
AI - Goblin Fan
ROMD:6C58 3E 07 ld a,07 ROMD:6C5A CD 6E 65 call 656E ROMD:6C5D 3E 00 ld a,00 ROMD:6C5F EA CE D4 ld (D4CE),a ROMD:6C62 C9 ret
AI - Simochi Allergy
ROMD:6C63 3E 08 ld a,08 ROMD:6C65 CD 6E 65 call 656E ROMD:6C68 3E 00 ld a,00 ROMD:6C6A EA CE D4 ld (D4CE),a ROMD:6C6D C9 ret
AI - Reverse Trap
ROMD:6C6E 3E 09 ld a,09 ROMD:6C70 CD 6E 65 call 656E ROMD:6C73 3E 00 ld a,00 ROMD:6C75 EA CE D4 ld (D4CE),a ROMD:6C78 C9 ret
AI - Fake Trap
ROMD:6C79 3E 0A ld a,0A ROMD:6C7B CD 6E 65 call 656E ROMD:6C7E 3E 00 ld a,00 ROMD:6C80 EA CE D4 ld (D4CE),a ROMD:6C83 C9 ret
AI Rituals 1
AI cannot play Black Luster Ritual
ROMD:6C84 C9 ret
AI cannot play Zera Ritual
ROMD:6C85 C9 ret
AI cannot play War-lion Ritual
ROMD:6C86 C9 ret
AI cannot play Beastly Mirror Ritual
ROMD:6C87 C9 ret
AI cannot play Ultimate Dragon
ROMD:6C88 C9 ret
AI cannot play Commencement Dance
ROMD:6C89 C9 ret
AI cannot play Hamburger Recipe
ROMD:6C8A C9 ret
AI cannot play Revival of Sennen Genjin
ROMD:6C8B C9 ret
AI cannot play Novox's Prayer
ROMD:6C8C C9 ret
AI cannot play Curse of Tri-Horned Dragon
ROMD:6C8D C9 ret
AI cannot play Revived Serpent Night Dragon
ROMD:6C8E C9 ret
AI - Harpie's Feather Duster
ROMD:6C8F 3E 08 ld a,08 ROMD:6C91 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6C94 CD 5C 64 call 645C ROMD:6C97 3E 00 ld a,00 ROMD:6C99 EA CE D4 ld (D4CE),a ROMD:6C9C C9 ret
AI Equip Spells 2
AI - Magical Labyrinth
ROMD:6C9D 3E 1A ld a,1A ROMD:6C9F CD 1B 65 call 651B ROMD:6CA2 3E 01 ld a,01 ROMD:6CA4 CD 23 74 call 7423 ROMD:6CA7 C9 ret
AI - Salamandra
ROMD:6CA8 3E 1B ld a,1B ROMD:6CAA CD 1B 65 call 651B ROMD:6CAD 3E 01 ld a,01 ROMD:6CAF CD 23 74 call 7423 ROMD:6CB2 C9 ret
AI - Kunai with Chain
ROMD:6CB3 3E 1C ld a,1C ROMD:6CB5 CD 1B 65 call 651B ROMD:6CB8 3E 01 ld a,01 ROMD:6CBA CD 23 74 call 7423 ROMD:6CBD C9 ret
AI - Bright Castle
ROMD:6CBE 3E 1D ld a,1D ROMD:6CC0 CD 1B 65 call 651B ROMD:6CC3 3E 01 ld a,01 ROMD:6CC5 CD 23 74 call 7423 ROMD:6CC8 C9 ret
AI - Crush Card
ROMD:6CC9 3E 07 ld a,07 ROMD:6CCB CD BE 73 call 73BE ;Updates (D4D5) ROMD:6CCE CD 5C 64 call 645C ROMD:6CD1 FA CC D4 ld a,(D4CC) ROMD:6CD4 FE 00 cp a,00 ROMD:6CD6 20 08 jr nz,6CE0 ROMD:6CD8 11 00 15 ld de,1500 ;1500 ATK ROMD:6CDB CD C0 66 call 66C0 ROMD:6CDE 18 06 jr 6CE6 ROMD:6CE0 11 00 15 ld de,1500 ROMD:6CE3 CD FC 66 call 66FC ROMD:6CE6 3E 00 ld a,00 ROMD:6CE8 EA CE D4 ld (D4CE),a ROMD:6CEB C9 ret
AI - Shadow Spell
ROMD:6CEC 3E 09 ld a,09 ROMD:6CEE CD BE 73 call 73BE ;Updates (D4D5) ROMD:6CF1 CD 5C 64 call 645C ROMD:6CF4 3E 02 ld a,02 ROMD:6CF6 CD 23 74 call 7423 ROMD:6CF9 FA CC D4 ld a,(D4CC) ROMD:6CFC FE 00 cp a,00 ROMD:6CFE 20 05 jr nz,6D05 ROMD:6D00 CD 31 66 call 6631 ROMD:6D03 18 03 jr 6D08 ROMD:6D05 CD 06 66 call 6606 ROMD:6D08 3E 00 ld a,00 ROMD:6D0A EA CE D4 ld (D4CE),a ROMD:6D0D C9 ret
AI Rituals 2
AI cannot play Turtle Oath
ROMD:6D0E C9 ret
AI cannot play Contract of Mask
ROMD:6D0F C9 ret
AI cannot play Resurrection of Chakra
ROMD:6D10 C9 ret
AI cannot play Puppet Ritual
ROMD:6D11 C9 ret
AI cannot play Javelin Beetle Pact
ROMD:6D12 C9 ret
AI cannot play Garma Sword Oath
ROMD:6D13 C9 ret
AI cannot play Cosmo Queen's Prayer
ROMD:6D14 C9 ret
AI cannot play Revival of Skeleton
ROMD:6D15 C9 ret
AI cannot play Fortress Whale's Oath
ROMD:6D16 C9 ret
AI cannot play Curse of Millennium Shield
ROMD:6D17 C9 ret
AI cannot play Yamadron Ritual
ROMD:6D18 C9 ret
AI cannot play Gate Guardian Ritual
ROMD:6D19 C9 ret
AI - Warrior Elimination
ROMD:6D1A CD 5C 64 call 645C ROMD:6D1D 3E 03 ld a,03 ROMD:6D1F CD 98 65 call 6598 ROMD:6D22 3E 00 ld a,00 ROMD:6D24 EA CE D4 ld (D4CE),a ROMD:6D27 C9 ret
AI - Cursebreaker
ROMD:6D28 CD 52 64 call 6452 ROMD:6D2B CD B6 64 call 64B6 ROMD:6D2E 3E 00 ld a,00 ROMD:6D30 EA CE D4 ld (D4CE),a ROMD:6D33 C9 ret
AI - Eternal Rest
ROMD:6D34 CD 5C 64 call 645C ROMD:6D37 3E 02 ld a,02 ROMD:6D39 CD 98 65 call 6598 ROMD:6D3C 3E 00 ld a,00 ROMD:6D3E EA CE D4 ld (D4CE),a ROMD:6D41 C9 ret
AI Equip Spells 3
AI - Megamorph
ROMD:6D42 3E 1E ld a,1E ROMD:6D44 CD 1B 65 call 651B ROMD:6D47 3E 01 ld a,01 ROMD:6D49 CD 23 74 call 7423 ROMD:6D4C C9 ret
AI - Metalmorph
ROMD:6D4D 3E 0F ld a,0F ROMD:6D4F CD BE 73 call 73BE ;Updates (D4D5) ROMD:6D52 FA CA D4 ld a,(D4CA) ROMD:6D55 47 ld b,a ROMD:6D56 FA CB D4 ld a,(D4CB) ROMD:6D59 4F ld c,a ROMD:6D5A CD DD 73 call 73DD ROMD:6D5D CD D0 19 call 19D0 ROMD:6D60 CD 13 1A call 1A13 ROMD:6D63 CD 4F 20 call 204F ROMD:6D66 FE 00 cp a,00 ROMD:6D68 20 47 jr nz,6DB1 ROMD:6D6A 3E 00 ld a,00 ROMD:6D6C EA CE D4 ld (D4CE),a ROMD:6D6F FA A3 C7 ld a,(C7A3) ROMD:6D72 4F ld c,a ROMD:6D73 FA A4 C7 ld a,(C7A4) ROMD:6D76 47 ld b,a ROMD:6D77 11 87 01 ld de,0187 ROMD:6D7A CD 14 1B call 1B14 ROMD:6D7D FE 00 cp a,00 ROMD:6D7F 20 0E jr nz,6D8F ROMD:6D81 CD 0D 76 call 760D ROMD:6D84 01 88 01 ld bc,0188 ROMD:6D87 CD 18 76 call 7618 ROMD:6D8A CD 0D 74 call 740D ROMD:6D8D 18 22 jr 6DB1 ROMD:6D8F 11 52 00 ld de,0052 ROMD:6D92 CD 14 1B call 1B14 ROMD:6D95 FE 00 cp a,00 ROMD:6D97 20 0E jr nz,6DA7 ROMD:6D99 CD 0D 76 call 760D ROMD:6D9C 01 E6 02 ld bc,02E6 ROMD:6D9F CD 18 76 call 7618 ROMD:6DA2 CD 0D 74 call 740D ROMD:6DA5 18 0A jr 6DB1 ROMD:6DA7 3E 02 ld a,02 ROMD:6DA9 CD 90 75 call 7590 ;Updates (D504) ROMD:6DAC 3E 0A ld a,0A ROMD:6DAE CD BE 73 call 73BE ;Updates (D4D5) ROMD:6DB1 C9 ret
AI - Winged Trumpeter
ROMD:6DB2 3E 1F ld a,1F ROMD:6DB4 CD 1B 65 call 651B ROMD:6DB7 3E 01 ld a,01 ROMD:6DB9 CD 23 74 call 7423 ROMD:6DBC C9 ret
AI - Stain Storm
ROMD:6DBD CD 5C 64 call 645C ROMD:6DC0 3E 0E ld a,0E ;Machine ROMD:6DC2 CD 98 65 call 6598 ROMD:6DC5 3E 00 ld a,00 ROMD:6DC7 EA CE D4 ld (D4CE),a ROMD:6DCA C9 ret
AI - Eradicating Aerosol
ROMD:6DCB CD 5C 64 call 645C ROMD:6DCE 3E 09 ld a,09 ;Insect ROMD:6DD0 CD 98 65 call 6598 ROMD:6DD3 3E 00 ld a,00 ROMD:6DD5 EA CE D4 ld (D4CE),a ROMD:6DD8 C9 ret
AI - Breath of Light
ROMD:6DD9 CD 5C 64 call 645C ROMD:6DDC 3E 12 ld a,12 ;Rock ROMD:6DDE CD 98 65 call 6598 ROMD:6DE1 3E 00 ld a,00 ROMD:6DE3 EA CE D4 ld (D4CE),a ROMD:6DE6 C9 ret
AI - Eternal Drought
ROMD:6DE7 CD 5C 64 call 645C ROMD:6DEA 3E 0C ld a,0C ;Fish ROMD:6DEC CD 98 65 call 6598 ROMD:6DEF 3E 00 ld a,00 ROMD:6DF1 EA CE D4 ld (D4CE),a ROMD:6DF4 C9 ret
AI cannot use Inexperienced Spy
ROMD:6DF5 C9 ret
AI Rituals 3
AI cannot use Dark Magic Ritual
ROMD:6DF6 C9 ret
AI cannot use Pot of Greed
ROMD:6DF7 C9 ret
AI - Restructer Revolution
0x36DF8-0x36E32
- Restructer Revolution effect
ROMD:6DF8 C5 push bc ROMD:6DF9 E5 push hl ROMD:6DFA CD 38 67 call 6738 ROMD:6DFD 06 00 ld b,00 ROMD:6DFF 4F ld c,a ROMD:6E00 CB 21 sla c ROMD:6E02 CB 10 rl b ROMD:6E04 21 33 6E ld hl,6E33 ROMD:6E07 79 ld a,c ROMD:6E08 85 add l ROMD:6E09 6F ld l,a ROMD:6E0A 78 ld a,b ROMD:6E0B 8C adc h ROMD:6E0C 67 ld h,a ROMD:6E0D 2A ldi a,(hl) ROMD:6E0E 4F ld c,a ROMD:6E0F 7E ld a,(hl) ROMD:6E10 47 ld b,a ROMD:6E11 CD 18 74 call 7418 ROMD:6E14 FA C7 D4 ld a,(D4C7) ROMD:6E17 FE 01 cp a,01 ROMD:6E19 20 08 jr nz,6E23 ROMD:6E1B 3E 03 ld a,03 ROMD:6E1D CD 90 75 call 7590 ;Updates (D504) ROMD:6E20 CD 52 64 call 6452 ROMD:6E23 CD 5C 64 call 645C ROMD:6E26 3E 06 ld a,06 ROMD:6E28 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6E2B 3E 00 ld a,00 ROMD:6E2D EA CE D4 ld (D4CE),a ROMD:6E30 E1 pop hl ROMD:6E31 C1 pop bc ROMD:6E32 C9 ret
0x36E33-0x36E3E
- Restructer Revolution damage array
ROMD:6E33 00 00 - 0 monsters 00 02 - 1 monsters 00 04 - 2 monsters 00 06 - 3 monsters 00 08 - 4 monsters 00 10 - 5 monsters
AI - Last Day of Witch
ROMD:6E3F CD 5C 64 call 645C ROMD:6E42 3E 01 ld a,01 ;Magician ROMD:6E44 CD 98 65 call 6598 ROMD:6E47 3E 00 ld a,00 ROMD:6E49 EA CE D4 ld (D4CE),a ROMD:6E4C C9 ret
AI - Exile of the Wicked
ROMD:6E4D CD 5C 64 call 645C ROMD:6E50 3E 07 ld a,07 ;Fiend ROMD:6E52 CD 98 65 call 6598 ROMD:6E55 3E 00 ld a,00 ROMD:6E57 EA CE D4 ld (D4CE),a ROMD:6E5A C9 ret
AI - Multiply
ROMD:6E5B C5 push bc ROMD:6E5C 01 3A 00 ld bc,003A ROMD:6E5F CD 87 66 call 6687 ROMD:6E62 FE 00 cp a,00 ROMD:6E64 28 0D jr z,6E73 ROMD:6E66 CD 0D 76 call 760D ROMD:6E69 CD 0D 74 call 740D ROMD:6E6C CD 5C 66 call 665C ROMD:6E6F 3E 13 ld a,13 ROMD:6E71 18 07 jr 6E7A ROMD:6E73 3E 02 ld a,02 ROMD:6E75 CD 90 75 call 7590 ;Updates (D504) ROMD:6E78 3E 0A ld a,0A ROMD:6E7A CD BE 73 call 73BE ;Updates (D4D5) ROMD:6E7D 3E 00 ld a,00 ROMD:6E7F EA CE D4 ld (D4CE),a ROMD:6E82 C1 pop bc ROMD:6E83 C9 ret
AI - Change of Heart
ROMD:6E84 F5 push af ROMD:6E85 C5 push bc ROMD:6E86 E5 push hl ROMD:6E87 FA CD D4 ld a,(D4CD) ROMD:6E8A FE 01 cp a,01 ROMD:6E8C 20 40 jr nz,6ECE ROMD:6E8E CF rst 08 ROMD:6E8F 29 add hl,hl ROMD:6E90 03 inc bc ROMD:6E91 FE 05 cp a,05 ROMD:6E93 28 39 jr z,6ECE ROMD:6E95 6F ld l,a ROMD:6E96 FA CA D4 ld a,(D4CA) ROMD:6E99 47 ld b,a ROMD:6E9A 04 inc b ROMD:6E9B 0E 02 ld c,02 ROMD:6E9D CD D0 19 call 19D0 ROMD:6EA0 CD 13 1A call 1A13 ROMD:6EA3 FA A3 C7 ld a,(C7A3) ROMD:6EA6 4F ld c,a ROMD:6EA7 FA A4 C7 ld a,(C7A4) ROMD:6EAA 47 ld b,a ;bc = Card being processed ROMD:6EAB CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:6EAE FE 00 cp a,00 ROMD:6EB0 20 1C jr nz,6ECE ROMD:6EB2 CD 0D 76 call 760D ROMD:6EB5 FA CA D4 ld a,(D4CA) ROMD:6EB8 47 ld b,a ROMD:6EB9 04 inc b ROMD:6EBA 0E 02 ld c,02 ROMD:6EBC CD DD 73 call 73DD ROMD:6EBF 45 ld b,l ROMD:6EC0 0E 01 ld c,01 ROMD:6EC2 CD DD 73 call 73DD ROMD:6EC5 3E 00 ld a,00 ROMD:6EC7 EA CE D4 ld (D4CE),a ROMD:6ECA 3E 11 ld a,11 ROMD:6ECC 18 07 jr 6ED5 ROMD:6ECE 3E 02 ld a,02 ROMD:6ED0 CD 90 75 call 7590 ;Updates (D504) ROMD:6ED3 3E 0A ld a,0A ROMD:6ED5 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6ED8 E1 pop hl ROMD:6ED9 C1 pop bc ROMD:6EDA F1 pop af ROMD:6EDB C9 ret
AI Rituals 4
AI cannot use Black Illusion Ritual
ROMD:6EDC C9 ret
AI Trap cards 2 (set)
AI - Anti Raigeki
ROMD:6EDD 3E 0B ld a,0B ROMD:6EDF CD 6E 65 call 656E ROMD:6EE2 3E 00 ld a,00 ROMD:6EE4 EA CE D4 ld (D4CE),a ROMD:6EE7 C9 ret
AI - Brain Control
ROMD:6EE8 F5 push af ROMD:6EE9 C5 push bc ROMD:6EEA E5 push hl ROMD:6EEB FA CD D4 ld a,(D4CD) ROMD:6EEE FE 01 cp a,01 ROMD:6EF0 20 40 jr nz,6F32 ROMD:6EF2 CF rst 08 ROMD:6EF3 29 add hl,hl ROMD:6EF4 03 inc bc ROMD:6EF5 FE 05 cp a,05 ROMD:6EF7 28 39 jr z,6F32 ROMD:6EF9 6F ld l,a ROMD:6EFA FA CA D4 ld a,(D4CA) ROMD:6EFD 47 ld b,a ROMD:6EFE 04 inc b ROMD:6EFF 0E 02 ld c,02 ROMD:6F01 CD D0 19 call 19D0 ROMD:6F04 CD 13 1A call 1A13 ROMD:6F07 FA A3 C7 ld a,(C7A3) ROMD:6F0A 4F ld c,a ROMD:6F0B FA A4 C7 ld a,(C7A4) ROMD:6F0E 47 ld b,a ;bc = Card being processed ROMD:6F0F CD E3 60 call 60E3 ;Retrieves Field ID, then checks if card is not a Monster ROMD:6F12 FE 00 cp a,00 ROMD:6F14 20 1C jr nz,6F32 ROMD:6F16 CD 0D 76 call 760D ROMD:6F19 FA CA D4 ld a,(D4CA) ROMD:6F1C 47 ld b,a ROMD:6F1D 04 inc b ROMD:6F1E 0E 02 ld c,02 ROMD:6F20 CD DD 73 call 73DD ROMD:6F23 45 ld b,l ROMD:6F24 0E 01 ld c,01 ROMD:6F26 CD DD 73 call 73DD ROMD:6F29 3E 00 ld a,00 ROMD:6F2B EA CE D4 ld (D4CE),a ROMD:6F2E 3E 10 ld a,10 ROMD:6F30 18 07 jr 6F39 ROMD:6F32 3E 02 ld a,02 ROMD:6F34 CD 90 75 call 7590 ;Updates (D504) ROMD:6F37 3E 0A ld a,0A ROMD:6F39 CD BE 73 call 73BE ;Updates (D4D5) ROMD:6F3C E1 pop hl ROMD:6F3D C1 pop bc ROMD:6F3E F1 pop af ROMD:6F3F C9 ret
CPU's cards effects pointers
0x36F40-0x37027
- List of pointers to each card effect code
CE 67 - (ret) CF 67 - (ret) D0 67 - (ret) D1 67 - Forest E1 67 - Wasteland F1 67 - Mountain 01 68 - Sogen 11 68 - Umi 21 68 - Yami 31 68 - Mooyan Curry 57 68 - Red Medicine 7D 68 - Goblin's Secret Remedy A3 68 - Soul of the Pure C9 68 - Dian Keto the Cure Master EF 68 - Sparks 16 69 - Hinotama 3D 69 - Final Flame 64 69 - Ookazi 8B 69 - Tremendous Fire B2 69 - Dark Hole C7 69 - Raigeki F7 69 - Legendary Sword 02 6A - Sword of Ruin 0D 6A - Dark Energy 18 6A - Axe of Despair 23 6A - Lazer Cannon Armor 2E 6A - Insect Armor with Laser Cannon 39 6A - Elf's Light 44 6A - Beast Fangs 4F 6A - Steel Shell 5A 6A - Vile Germs 65 6A - Black Pendant 70 6A - Silver Bow & Arrow 7B 6A - Horn of Light 86 6A - Horn of the Unicorn 91 6A - Dragon Treasure 9C 6A - Electro-whip A7 6A - Cyber Shield B2 6A - Mystical Moon BD 6A - Malevolent Nuzzler C8 6A - Violet Crystal D3 6A - Book of Secret Art DE 6A - Invigoration E9 6A - Machine Conversion F4 6A - Raise Body Heat FF 6A - Follow Wind 0A 6B - Power of Kaishin 15 6B - (ret) 16 6B - Stop Defense 79 6B - Dragon Capture Jar 87 6B - Swords of Revealing Light 98 6B - Dark-Piercing Light A6 6B - Spellbinding Circle C8 6B - Elegant Egotist 15 6C - (ret) 16 6C - Widespread Ruin 21 6C - House of Adhesive Trap 2C 6C - Eatgaboon 37 6C - Bear Trap 42 6C - Invisible Wire 4D 6C - Acid Trap Hole 58 6C - Goblin Fan 63 6C - Simochi Allergy 6E 6C - Reverse Trap 79 6C - Fake Trap 84 6C - (ret) 85 6C - (ret) 86 6C - (ret) 87 6C - (ret) 88 6C - (ret) 89 6C - (ret) 8A 6C - (ret) 8B 6C - (ret) 8C 6C - (ret) 8D 6C - (ret) 8E 6C - (ret) 8F 6C - Harpie's Feather Duster 9D 6C - Magical Labyrinth A8 6C - Salamandra B3 6C - Kunai with Chain BE 6C - Bright Castle C9 6C - Crush Card EC 6C - Shadow Spell 0E 6D - (ret) 0F 6D - (ret) 10 6D - (ret) 11 6D - (ret) 12 6D - (ret) 13 6D - (ret) 14 6D - (ret) 15 6D - (ret) 16 6D - (ret) 17 6D - (ret) 18 6D - (ret) 19 6D - (ret) 1A 6D - Warrior Elimination 28 6D - Cursebreaker 34 6D - Eternal Rest 42 6D - Megamorph 4D 6D - Metalmorph B2 6D - Winged Trumpeter BD 6D - Stain Storm CB 6D - Eradicating Aerosol D9 6D - Breath of Light E7 6D - Eternal Drought F5 6D - (ret) F6 6D - (ret) F7 6D - (ret) F8 6D - Restructer Revolution 3F 6E - Last Day of Witch 4D 6E - Exile of the Wicked 5B 6E - Multiply 84 6E - Change of Heart DC 6E - (ret) DD 6E - Anti Raigeki E8 6E - Brain Control
CPU Battle Process
Initialize Trap cards
ROMD:71EE C5 push bc ROMD:71EF FA F3 D4 ld a,(D4F3) ROMD:71F2 FE 00 cp a,00 ROMD:71F4 20 10 jr nz,7206 ROMD:71F6 06 00 ld b,00 ROMD:71F8 3E 03 ld a,03 ROMD:71FA 4F ld c,a ROMD:71FB CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:71FE CD E6 19 call 19E6 ;Remove selected card from the field ROMD:7201 CF rst 08 ... ROMD:7204 18 0E jr 7214 ROMD:7206 06 05 ld b,05 ROMD:7208 3E 00 ld a,00 ROMD:720A 4F ld c,a ROMD:720B CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:720E CD E6 19 call 19E6 ;Remove selected card from the field ROMD:7211 CF rst 08 ... ROMD:7214 CD AC 73 call 73AC ;Removes a card from the field ROMD:7217 C1 pop bc ROMD:7218 C9 ret
CPU removes a card from the field
ROMD:73AC C5 push bc ROMD:73AD FA D6 D4 ld a,(D4D6) ;AI - Column to check ROMD:73B0 47 ld b,a ROMD:73B1 FA D7 D4 ld a,(D4D7) ;AI - Row to check ROMD:73B4 4F ld c,a ROMD:73B5 CD D0 19 call 19D0 ;Updates field Column and Row to value in bc ROMD:73B8 CD E6 19 call 19E6 ;Remove selected card from the field ROMD:73BB C1 pop bc ROMD:73BC C9 ret
Fail-safe (ret)
ROMD:73BD C9 ret
D:73BE (updates (D4D5))
ROMD:73BE EA D5 D4 ld (D4D5),a ROMD:73C1 C9 ret
Updates Column and Row to check
ROMD:73C2 F5 push af ROMD:73C3 78 ld a,b ROMD:73C4 EA D6 D4 ld (D4D6),a ;AI - Column to check ROMD:73C7 79 ld a,c ROMD:73C8 EA D7 D4 ld (D4D7),a ;AI - Row to check ROMD:73CB F1 pop af ROMD:73CC C9 ret
D:73CD
ROMD:73CD F5 push af ROMD:73CE E5 push hl ROMD:73CF 21 D8 D4 ld hl,D4D8 ROMD:73D2 85 add l ROMD:73D3 6F ld l,a ROMD:73D4 7C ld a,h ROMD:73D5 CE 00 adc a,00 ROMD:73D7 67 ld h,a ROMD:73D8 78 ld a,b ROMD:73D9 77 ld (hl),a ROMD:73DA E1 pop hl ROMD:73DB F1 pop af ROMD:73DC C9 ret
D:73DD
ROMD:73DD F5 push af ROMD:73DE D5 push de ROMD:73DF E5 push hl ROMD:73E0 FA DE D4 ld a,(D4DE) ROMD:73E3 FE FF cp a,FF ROMD:73E5 20 02 jr nz,73E9 ROMD:73E7 3E 00 ld a,00 ROMD:73E9 FE 0A cp a,0A ROMD:73EB 28 18 jr z,7405 ROMD:73ED 5F ld e,a ROMD:73EE 16 00 ld d,00 ROMD:73F0 21 DF D4 ld hl,D4DF ROMD:73F3 CB 27 sla a ROMD:73F5 CB 12 rl d ROMD:73F7 85 add l ROMD:73F8 6F ld l,a ROMD:73F9 7A ld a,d ROMD:73FA 8C adc h ROMD:73FB 67 ld h,a ROMD:73FC 78 ld a,b ROMD:73FD 22 ldi (hl),a ROMD:73FE 79 ld a,c ROMD:73FF 77 ld (hl),a ROMD:7400 1C inc e ROMD:7401 7B ld a,e ROMD:7402 EA DE D4 ld (D4DE),a ROMD:7405 E1 pop hl ROMD:7406 D1 pop de ROMD:7407 F1 pop af ROMD:7408 C9 ret
D:7409 (updates (D4F3))
ROMD:7409 EA F3 D4 ld (D4F3),a ROMD:740C C9 ret
D:740D (updates (D4F6))
ROMD:740D F5 push af ROMD:740E 79 ld a,c ROMD:740F EA F6 D4 ld (D4F6),a ROMD:7412 78 ld a,b ROMD:7413 EA F7 D4 ld (D4F7),a ROMD:7416 F1 pop af ROMD:7417 C9 ret
Stores Direct Damage or Healing to (D4F8)
ROMD:7418 F5 push af ROMD:7419 79 ld a,c ROMD:741A EA F8 D4 ld (D4F8),a ROMD:741D 78 ld a,b ROMD:741E EA F9 D4 ld (D4F9),a ROMD:7421 F1 pop af ROMD:7422 C9 ret
D:7423 (updates (D4FA))
ROMD:7423 7F ld a,a ROMD:7424 EA FA D4 ld (D4FA),a ROMD:7427 C9 ret
Changes AI Field ID
ROMD:7428 7F ld a,a ROMD:7429 EA F4 D4 ld (D4F4),a ;AI - Field ID ROMD:742C C9 ret
D:742D (updates (D4F5))
ROMD:742D 7F ld a,a ROMD:742E EA F5 D4 ld (D4F5),a ROMD:7431 C9 ret
Initialize some AI values
ROMD:7432 F5 push af ROMD:7433 3E 00 ld a,00 ROMD:7435 EA D5 D4 ld (D4D5),a ;AI - Effect triggered ROMD:7438 EA F8 D4 ld (D4F8),a ;AI - Direct Damage or Healing ROMD:743B EA F9 D4 ld (D4F9),a ;AI - Direct Damage or Healing ROMD:743E EA FA D4 ld (D4FA),a ROMD:7441 3E FF ld a,FF ROMD:7443 EA D6 D4 ld (D4D6),a ;AI - Column to check ROMD:7446 EA D7 D4 ld (D4D7),a ;AI - Row to check ROMD:7449 EA D8 D4 ld (D4D8),a ROMD:744C EA D9 D4 ld (D4D9),a ROMD:744F EA DA D4 ld (D4DA),a ROMD:7452 EA DB D4 ld (D4DB),a ROMD:7455 EA DC D4 ld (D4DC),a ROMD:7458 EA DD D4 ld (D4DD),a ROMD:745B EA F3 D4 ld (D4F3),a ROMD:745E EA F4 D4 ld (D4F4),a ;AI - Field ID ROMD:7461 EA F5 D4 ld (D4F5),a ROMD:7464 EA DE D4 ld (D4DE),a ROMD:7467 EA DF D4 ld (D4DF),a ROMD:746A EA E0 D4 ld (D4E0),a ROMD:746D EA E1 D4 ld (D4E1),a ROMD:7470 EA E2 D4 ld (D4E2),a ROMD:7473 EA E3 D4 ld (D4E3),a ROMD:7476 EA E4 D4 ld (D4E4),a ROMD:7479 EA E5 D4 ld (D4E5),a ROMD:747C EA E6 D4 ld (D4E6),a ROMD:747F EA E7 D4 ld (D4E7),a ROMD:7482 EA E8 D4 ld (D4E8),a ROMD:7485 EA E9 D4 ld (D4E9),a ROMD:7488 EA EA D4 ld (D4EA),a ROMD:748B EA EB D4 ld (D4EB),a ROMD:748E EA EC D4 ld (D4EC),a ROMD:7491 EA ED D4 ld (D4ED),a ROMD:7494 EA EE D4 ld (D4EE),a ROMD:7497 EA EF D4 ld (D4EF),a ROMD:749A EA F0 D4 ld (D4F0),a ROMD:749D EA F1 D4 ld (D4F1),a ROMD:74A0 EA F2 D4 ld (D4F2),a ROMD:74A3 3E 00 ld a,00 ROMD:74A5 EA F6 D4 ld (D4F6),a ROMD:74A8 3E 00 ld a,00 ROMD:74AA EA F7 D4 ld (D4F7),a ROMD:74AD F1 pop af ROMD:74AE C9 ret
D:74AF
ROMD:74AF C5 push bc ROMD:74B0 E5 push hl ROMD:74B1 FA FC D4 ld a,(D4FC) ROMD:74B4 EA 4C C8 ld (C84C),a ROMD:74B7 FE 01 cp a,01 ROMD:74B9 20 05 jr nz,74C0 ROMD:74BB CD CA 74 call 74CA ;AI - Retrieves Attack Phase data ROMD:74BE 18 07 jr 74C7 ROMD:74C0 FE 02 cp a,02 ROMD:74C2 20 03 jr nz,74C7 ROMD:74C4 CD 4F 75 call 754F ROMD:74C7 E1 pop hl ROMD:74C8 C1 pop bc ROMD:74C9 C9 ret
AI - Retrieves Attack Phase data
ROMD:74CA FA FD D4 ld a,(D4FD) ROMD:74CD EA 91 C8 ld (C891),a ;Player's Monster ID (Attack Phase) ROMD:74D0 FA FE D4 ld a,(D4FE) ROMD:74D3 EA 92 C8 ld (C892),a ;Player's Monster ID (Attack Phase) ROMD:74D6 FA 08 D5 ld a,(D508) ROMD:74D9 EA 9C C8 ld (C89C),a ;CPU's Monster ID (Attack Phase) ROMD:74DC FA 09 D5 ld a,(D509) ROMD:74DF EA 9D C8 ld (C89D),a ;CPU's Monster ID (Attack Phase) ROMD:74E2 FA FF D4 ld a,(D4FF) ROMD:74E5 EA 93 C8 ld (C893),a ;Player's Life Points (Attack Phase) ROMD:74E8 FA 00 D5 ld a,(D500) ROMD:74EB EA 94 C8 ld (C894),a ;Player's Life Points (Attack Phase) ROMD:74EE FA 0A D5 ld a,(D50A) ROMD:74F1 EA 9E C8 ld (C89E),a ;CPU's Life Points (Attack Phase) ROMD:74F4 FA 0B D5 ld a,(D50B) ROMD:74F7 EA 9F C8 ld (C89F),a ;CPU's Life Points (Attack Phase) ROMD:74FA FA 01 D5 ld a,(D501) ROMD:74FD EA 95 C8 ld (C895),a ;Player's Life Points (Attack Phase) ROMD:7500 FA 02 D5 ld a,(D502) ROMD:7503 EA 96 C8 ld (C896),a ;Player's Life Points (Attack Phase) ROMD:7506 FA 0C D5 ld a,(D50C) ROMD:7509 EA A0 C8 ld (C8A0),a ;CPU's Life Points (Attack Phase) ROMD:750C FA 0D D5 ld a,(D50D) ROMD:750F EA A1 C8 ld (C8A1),a ;CPU's Life Points (Attack Phase) ROMD:7512 FA 03 D5 ld a,(D503) ROMD:7515 EA 97 C8 ld (C897),a ;Player's Monster ATK ROMD:7518 FA 04 D5 ld a,(D504) ROMD:751B EA 98 C8 ld (C898),a ;Player's Monster ATK ROMD:751E FA 0E D5 ld a,(D50E) ROMD:7521 EA A2 C8 ld (C8A2),a ;CPU's Monster ATK ROMD:7524 FA 0F D5 ld a,(D50F) ROMD:7527 EA A3 C8 ld (C8A3),a ;CPU's Monster ATK ROMD:752A FA 05 D5 ld a,(D505) ROMD:752D EA 99 C8 ld (C899),a ;Player's Monster DEF ROMD:7530 FA 06 D5 ld a,(D506) ROMD:7533 EA 9A C8 ld (C89A),a ;Player's Monster DEF ROMD:7536 FA 10 D5 ld a,(D510) ROMD:7539 EA A4 C8 ld (C8A4),a ;CPU's Monster DEF ROMD:753C FA 11 D5 ld a,(D511) ROMD:753F EA A5 C8 ld (C8A5),a ;CPU's Monster DEF ROMD:7542 FA 07 D5 ld a,(D507) ROMD:7545 EA 9B C8 ld (C89B),a ;Player's Monster Alignment ROMD:7548 FA 12 D5 ld a,(D512) ROMD:754B EA A6 C8 ld (C8A6),a ;CPU's Monster Alignment ROMD:754E C9 ret
D:754F
ROMD:754F FA FD D4 ld a,(D4FD) ROMD:7552 EA A8 C8 ld (C8A8),a ROMD:7555 FA FE D4 ld a,(D4FE) ROMD:7558 EA A9 C8 ld (C8A9),a ROMD:755B FA FF D4 ld a,(D4FF) ROMD:755E EA AA C8 ld (C8AA),a ROMD:7561 FA 00 D5 ld a,(D500) ROMD:7564 EA AB C8 ld (C8AB),a ROMD:7567 FA 01 D5 ld a,(D501) ROMD:756A EA AC C8 ld (C8AC),a ROMD:756D FA 02 D5 ld a,(D502) ROMD:7570 EA AD C8 ld (C8AD),a ROMD:7573 FA 03 D5 ld a,(D503) ROMD:7576 EA AE C8 ld (C8AE),a ROMD:7579 FA 04 D5 ld a,(D504) ROMD:757C EA AF C8 ld (C8AF),a ROMD:757F C9 ret
D:7580
ROMD:7580 EA FC D4 ld (D4FC),a ROMD:7583 C9 ret
D:7584
ROMD:7584 EA 07 D5 ld (D507),a ROMD:7587 C9 ret
D:7588
ROMD:7588 EA 12 D5 ld (D512),a ROMD:758B C9 ret
D:758C
ROMD:758C EA FD D4 ld (D4FD),a ROMD:758F C9 ret
D:7590
ROMD:7590 EA 04 D5 ld (D504),a ROMD:7593 C9 ret
D:7594
ROMD:7594 F5 push af ROMD:7595 79 ld a,c ROMD:7596 EA FD D4 ld (D4FD),a ROMD:7599 78 ld a,b ROMD:759A EA FE D4 ld (D4FE),a ROMD:759D F1 pop af ROMD:759E C9 ret
Stores Player's Life Points
0x3759F-0x375A9
- Stores Player's Life Points
ROMD:759F F5 push af ROMD:75A0 79 ld a,c ROMD:75A1 EA FF D4 ld (D4FF),a ROMD:75A4 78 ld a,b ROMD:75A5 EA 00 D5 ld (D500),a ROMD:75A8 F1 pop af ROMD:75A9 C9 ret
0x375AA-0x375B4
- Stores Player's Life Points
ROMD:75AA F5 push af ROMD:75AB 79 ld a,c ROMD:75AC EA 01 D5 ld (D501),a ROMD:75AF 78 ld a,b ROMD:75B0 EA 02 D5 ld (D502),a ROMD:75B3 F1 pop af ROMD:75B4 C9 ret
D:75B5
ROMD:75B5 F5 push af ROMD:75B6 79 ld a,c ROMD:75B7 EA 03 D5 ld (D503),a ROMD:75BA 78 ld a,b ROMD:75BB EA 04 D5 ld (D504),a ROMD:75BE F1 pop af ROMD:75BF C9 ret
D:75C0
ROMD:75C0 F5 push af ROMD:75C1 79 ld a,c ROMD:75C2 EA 05 D5 ld (D505),a ROMD:75C5 78 ld a,b ROMD:75C6 EA 06 D5 ld (D506),a ROMD:75C9 F1 pop af ROMD:75CA C9 ret
D:75CB
ROMD:75CB F5 push af ROMD:75CC 79 ld a,c ROMD:75CD EA 08 D5 ld (D508),a ROMD:75D0 78 ld a,b ROMD:75D1 EA 09 D5 ld (D509),a ROMD:75D4 F1 pop af ROMD:75D5 C9 ret
Stores CPU's Life Points
0x375D6-0x375E0
- Stores CPU's Life Points for damage calculation
ROMD:75D6 F5 push af ROMD:75D7 79 ld a,c ROMD:75D8 EA 0A D5 ld (D50A),a ROMD:75DB 78 ld a,b ROMD:75DC EA 0B D5 ld (D50B),a ROMD:75DF F1 pop af ROMD:75E0 C9 ret
D:75E1
ROMD:75E1 F5 push af ROMD:75E2 79 ld a,c ROMD:75E3 EA 0C D5 ld (D50C),a ROMD:75E6 78 ld a,b ROMD:75E7 EA 0D D5 ld (D50D),a ROMD:75EA F1 pop af ROMD:75EB C9 ret
D:75EC
ROMD:75EC F5 push af ROMD:75ED 79 ld a,c ROMD:75EE EA 0E D5 ld (D50E),a ROMD:75F1 78 ld a,b ROMD:75F2 EA 0F D5 ld (D50F),a ROMD:75F5 F1 pop af ROMD:75F6 C9 ret
D:75F7
ROMD:75F7 F5 push af ROMD:75F8 79 ld a,c ROMD:75F9 EA 10 D5 ld (D510),a ROMD:75FC 78 ld a,b ROMD:75FD EA 11 D5 ld (D511),a ROMD:7600 F1 pop af ROMD:7601 C9 ret
D:7602
ROMD:7602 F5 push af ROMD:7603 79 ld a,c ROMD:7604 EA FE D4 ld (D4FE),a ROMD:7607 78 ld a,b ROMD:7608 EA FF D4 ld (D4FF),a ROMD:760B F1 pop af ROMD:760C C9 ret
D:760D
ROMD:760D F5 push af ROMD:760E 79 ld a,c ROMD:760F EA 00 D5 ld (D500),a ROMD:7612 78 ld a,b ROMD:7613 EA 01 D5 ld (D501),a ROMD:7616 F1 pop af ROMD:7617 C9 ret
D:7618
ROMD:7618 F5 push af ROMD:7619 79 ld a,c ROMD:761A EA 02 D5 ld (D502),a ROMD:761D 78 ld a,b ROMD:761E EA 03 D5 ld (D503),a ROMD:7621 F1 pop af ROMD:7622 C9 ret
Bank E
Game text 3
Fields names
0x380E2-0x38116
- Fields names
Read selected card's name
0x38117-0x38151
- Read selected card's name or Construction card's name
ROME:4117 F5 push af ROME:4118 C5 push bc ROME:4119 D5 push de ROME:411A E5 push hl ROME:411B CD 19 40 call 4019 ROME:411E 11 52 41 ld de,4152 ROME:4121 FA CD C5 ld a,(C5CD) ROME:4124 6F ld l,a ROME:4125 FA CE C5 ld a,(C5CE) ROME:4128 67 ld h,a ROME:4129 29 add hl,hl ROME:412A 44 ld b,h ROME:412B 4D ld c,l ROME:412C 19 add hl,de ;hl = Pointer to card name pointer ROME:412D 2A ldi a,(hl) ROME:412E 66 ld h,(hl) ROME:412F 6F ld l,a ROME:4130 E5 push hl ROME:4131 03 inc bc ROME:4132 03 inc bc ROME:4133 60 ld h,b ROME:4134 69 ld l,c ROME:4135 19 add hl,de ROME:4136 2A ldi a,(hl) ROME:4137 46 ld b,(hl) ROME:4138 4F ld c,a ROME:4139 E1 pop hl ROME:413A 11 D0 C5 ld de,C5D0 ROME:413D 06 00 ld b,00 ROME:413F 79 ld a,c ROME:4140 BD cp l ROME:4141 28 06 jr z,4149 ROME:4143 2A ldi a,(hl) ROME:4144 12 ld (de),a ROME:4145 13 inc de ROME:4146 04 inc b ROME:4147 18 F6 jr 413F ROME:4149 78 ld a,b ROME:414A EA E4 C5 ld (C5E4),a ROME:414D E1 pop hl ROME:414E D1 pop de ROME:414F C1 pop bc ROME:4150 F1 pop af ROME:4151 C9 ret
Card names pointers
0x38152-0x389C5
- Card names and Construction card names pointers
ROME:4152
Cards names
0x389D8-0x3B2E8
- Cards names
Construction Parts names
0x3B2E9-0x3BABA
- Construction Parts names
Cards Types names
0x3BB48-0x3BBFD
- Cards Types
CPU Opponents names
0x3BC37-0x3BE08
- CPU Opponents names
Records screen text
0x3BE17-0x3BE6E
- Records screen text
Alignments names
0x3BECC-0x3BF22
- Alignments names
Name Creation confirmation / Save Deletion confirmation
0x3C412-0x3C4AE
- Name Creation confirmation / Save Deletion confirmation
Duel text
0x3C692
- « Opponent's Turn »
Bank F
F:471F (Copy array at F:4737 to start of VRAM)
ROMF:471F F5 push af ROMF:4720 C5 push bc ROMF:4721 D5 push de ROMF:4722 E5 push hl ROMF:4723 11 37 47 ld de,4737 ROMF:4726 21 00 80 ld hl,8000 ROMF:4729 0E 10 ld c,10 ROMF:472B 1A ld a,(de) ROMF:472C 22 ldi (hl),a ROMF:472D 22 ldi (hl),a ROMF:472E 13 inc de ROMF:472F 0D dec c ROMF:4730 20 F9 jr nz,472B ;Loop 16 times ROMF:4732 E1 pop hl ROMF:4733 D1 pop de ROMF:4734 C1 pop bc ROMF:4735 F1 pop af ROMF:4736 C9 ret
Array used by F:471F
0x3C737-0x3C746
ROMF:4737 00 10 18 1C 1E 1C 18 10 00 10 18 14 12 14 18 10
Graphics 3
0x3C760-0x3C890
- Cursors (Main menu and Campaign mode)0x3C960-0x3CBF0
- Duel area
F:4D0E
ROMF:4D0E F5 push af ROMF:4D0F 3E 1B ld a,1B ROMF:4D11 CD 14 41 call 4114 ROMF:4D14 CD 1F 47 call 471F ;Copy array at F:4737 to start of VRAM ROMF:4D17 CF rst 08 ROMF:4D18 03 inc bc ROMF:4D19 08 CD A2 ld (A2CD),sp ROMF:4D1C 41 ld b,c ROMF:4D1D CF rst 08 ROMF:4D1E 05 dec b ROMF:4D1F 0B dec bc ROMF:4D20 F1 pop af ROMF:4D21 C9 ret
F:4D22
ROMF:4D22 F5 push af ROMF:4D23 3E 1C ld a,1C ROMF:4D25 CD 14 41 call 4114 ROMF:4D28 CD 42 41 call 4142 ROMF:4D2B CD A2 41 call 41A2 ROMF:4D2E CF rst 08 ROMF:4D2F 05 dec b ROMF:4D30 0B dec bc ROMF:4D31 F1 pop af ROMF:4D32 C9 ret
F:4D33
ROMF:4D33 F5 push af ROMF:4D34 3E 1D ld a,1D ROMF:4D36 CD 14 41 call 4114 ROMF:4D39 CF rst 08 ROMF:4D3A 03 inc bc ROMF:4D3B 08 CD A2 ld (A2CD),sp ROMF:4D3E 41 ld b,c ROMF:4D3F CF rst 08 ROMF:4D40 05 dec b ROMF:4D41 0B dec bc ROMF:4D42 F1 pop af ROMF:4D43 C9 ret
Fail-safe (ret)
ROMF:4D44 C9 ret
Fail-safe (ret)
ROMF:4D45 C9 ret
F:4D46
ROMF:4D46 F5 push af ROMF:4D47 3E 1F ld a,1F ROMF:4D49 CD 14 41 call 4114 ROMF:4D4C CD 42 41 call 4142 ROMF:4D4F CD A2 41 call 41A2 ROMF:4D52 CF rst 08 => 05 08 ROMF:4D55 F1 pop af ROMF:4D56 C9 ret
F:4D57
ROMF:4D57 F5 push af ROMF:4D58 3E 20 ld a,20 ROMF:4D5A CD 14 41 call 4114 ROMF:4D5D CF rst 08 => 03 08 ROMF:4D60 CD A2 41 call 41A2 ROMF:4D63 CF rst 08 ROMF:4D64 05 dec b ROMF:4D65 0B dec bc ROMF:4D66 F1 pop af ROMF:4D67 C9 ret
F:4D68
ROMF:4D68 F5 push af ROMF:4D69 3E 21 ld a,21 ROMF:4D6B CD 14 41 call 4114 ROMF:4D6E CD 1F 47 call 471F ;Copy array at F:4737 to start of VRAM ROMF:4D71 CF rst 08 => 03 08 ROMF:4D74 CD A2 41 call 41A2 ROMF:4D77 CF rst 08 ROMF:4D78 05 dec b ROMF:4D79 0B dec bc ROMF:4D7A F1 pop af ROMF:4D7B C9 ret
F:4D7C (rst 08'd by unused Legendary Password routine with a = 0x24)
ROMF:4D7C F5 push af ROMF:4D7D C5 push bc ROMF:4D7E E5 push hl ROMF:4D7F 06 00 ld b,00 ROMF:4D81 4F ld c,a ROMF:4D82 CB 21 sla c ROMF:4D84 21 94 4D ld hl,4D94 ROMF:4D87 09 add hl,bc ROMF:4D88 2A ldi a,(hl) ROMF:4D89 66 ld h,(hl) ROMF:4D8A 6F ld l,a ROMF:4D8B 01 90 4D ld bc,4D90 ROMF:4D8E C5 push bc ROMF:4D8F E9 jp hl ROMF:4D90 E1 pop hl ROMF:4D91 C1 pop bc ROMF:4D92 F1 pop af ROMF:4D93 C9 ret
Pointer array used by F:4D7C
0x3CD94-0x3CDDD
ROMF:4D94 AA 50 - 00 - Returns Fusion data ROM Bank AA 50 - 01 - Returns Fusion data ROM Bank AA 50 - 02 - Returns Fusion data ROM Bank 03 4E - 03 - 2B 4E - 04 - AA 50 - 05 - Returns Fusion data ROM Bank AA 50 - 06 - Returns Fusion data ROM Bank AA 50 - 07 - Returns Fusion data ROM Bank AA 50 - 08 - Returns Fusion data ROM Bank AA 50 - 09 - Returns Fusion data ROM Bank AA 50 - 0A - Returns Fusion data ROM Bank 3F 4E - 0B - AA 50 - 0C - Returns Fusion data ROM Bank AA 50 - 0D - Returns Fusion data ROM Bank AA 50 - 0E - Returns Fusion data ROM Bank AA 50 - 0F - Returns Fusion data ROM Bank AA 50 - 10 - Returns Fusion data ROM Bank AA 50 - 11 - Returns Fusion data ROM Bank AA 50 - 12 - Returns Fusion data ROM Bank AA 50 - 13 - Returns Fusion data ROM Bank AA 50 - 14 - Returns Fusion data ROM Bank AA 50 - 15 - Returns Fusion data ROM Bank AA 50 - 16 - Returns Fusion data ROM Bank AA 50 - 17 - Returns Fusion data ROM Bank AA 50 - 18 - Returns Fusion data ROM Bank AA 50 - 19 - Returns Fusion data ROM Bank 67 4E - 1A - AA 50 - 1B - Returns Fusion data ROM Bank AA 50 - 1C - Returns Fusion data ROM Bank AA 50 - 1D - Returns Fusion data ROM Bank F2 4D - 1E - AA 50 - 1F - Returns Fusion data ROM Bank 17 4E - 20 - 53 4E - 21 - DE 4D - 22 - AA 50 - 23 - Returns Fusion data ROM Bank C0 4E - 24 - (Called by unused Legendary Password)
F:4DDE
ROMF:4DDE F5 push af ROMF:4DDF 3E 22 ld a,22 ROMF:4DE1 CD 19 4F call 4F19 ROMF:4DE4 CF rst 08 ROMF:4DE5 05 dec b ROMF:4DE6 08 CD EB ld (EBCD),sp ROMF:4DE9 4F ld c,a ROMF:4DEA CD 27 50 call 5027 ROMF:4DED CF rst 08 ROMF:4DEE 07 rlca ROMF:4DEF 0B dec bc ROMF:4DF0 F1 pop af ROMF:4DF1 C9 ret C0 4E - 24 -
F:4DF2
ROMF:4DF2 F5 push af ROMF:4DF3 3E 1E ld a,1E ROMF:4DF5 CD 19 4F call 4F19 ROMF:4DF8 CF rst 08 ROMF:4DF9 05 dec b ROMF:4DFA 08 CD 27 ld (27CD),sp ROMF:4DFD 50 ld d,b ROMF:4DFE CF rst 08 ROMF:4DFF 07 rlca ROMF:4E00 0B dec bc ROMF:4E01 F1 pop af ROMF:4E02 C9 ret C0 4E - 24 -
F:4E03
ROMF:4E03 F5 push af ROMF:4E04 3E 03 ld a,03 ROMF:4E06 CD 19 4F call 4F19 ROMF:4E09 CF rst 08 ROMF:4E0A 05 dec b ROMF:4E0B 08 CD 27 ld (27CD),sp ROMF:4E0E 50 ld d,b ROMF:4E0F CF rst 08 ROMF:4E10 07 rlca ROMF:4E11 0B dec bc ROMF:4E12 CF rst 08 ROMF:4E13 17 rla ROMF:4E14 0B dec bc ROMF:4E15 F1 pop af ROMF:4E16 C9 ret
F:4EC0 routine group
F:4EC0 (Called by unused Legendary Password)
ROMF:4EC0 F5 push af ROMF:4EC1 3E 24 ld a,24 ROMF:4EC3 CD 19 4F call 4F19 ;set wC6AE to 0x24, set wC6AF to 0, set view_type to 2 ROMF:4EC6 CD 80 4F call 4F80 ROMF:4EC9 CD D4 4E call 4ED4 ROMF:4ECC CD 27 50 call 5027 ROMF:4ECF CF rst 08 => 07 0B; to B:45CD ROMF:4ED2 F1 pop af ROMF:4ED3 C9 ret
F:4ED4
ROMF:4ED4 F5 push af ROMF:4ED5 C5 push bc ROMF:4ED6 D5 push de ROMF:4ED7 E5 push hl ROMF:4ED8 3E 01 ld a,01 ROMF:4EDA EA AE C6 ld (C6AE),a ROMF:4EDD 3E 00 ld a,00 ROMF:4EDF EA AF C6 ld (C6AF),a ROMF:4EE2 3E 0C ld a,0C ROMF:4EE4 EA B0 C6 ld (C6B0),a ;view_type = 0xC ROMF:4EE7 CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROMF:4EEA E5 push hl ROMF:4EEB 3E 1F ld a,1F ROMF:4EED CD 0F 11 call 110F ;Set wC5B4 to 0x1F ROMF:4EF0 01 00 80 ld bc,8000 ROMF:4EF3 1E 04 ld e,04 ROMF:4EF5 3E 1A ld a,1A ROMF:4EF7 CD E3 0E call 0EE3 ;Set wC5AE to 0x1A, then ? (related to Display) ROMF:4EFA CD D2 10 call 10D2 ROMF:4EFD C5 push bc ROMF:4EFE 01 00 C1 ld bc,C100 ROMF:4F01 CD 04 11 call 1104 ;Set wC5B0-wC5B1 to 0xC100 ROMF:4F04 C1 pop bc ROMF:4F05 21 00 02 ld hl,0200 ROMF:4F08 09 add hl,bc ROMF:4F09 44 ld b,h ROMF:4F0A 4D ld c,l ROMF:4F0B CD 37 11 call 1137 ROMF:4F0E CD C1 10 call 10C1 ROMF:4F11 1D dec e ROMF:4F12 20 E1 jr nz,4EF5 ROMF:4F14 E1 pop hl ROMF:4F15 D1 pop de ROMF:4F16 C1 pop bc ROMF:4F17 F1 pop af ROMF:4F18 C9 ret
F:4F19 (Update wC6AE, set wC6AF to 0, set view_type to 2)
ROMF:4F19 F5 push af ROMF:4F1A C5 push bc ROMF:4F1B D5 push de ROMF:4F1C E5 push hl ROMF:4F1D EA AE C6 ld (C6AE),a ;Card currently viewed ROMF:4F20 3E 00 ld a,00 ROMF:4F22 EA AF C6 ld (C6AF),a ROMF:4F25 3E 02 ld a,02 ROMF:4F27 EA B0 C6 ld (C6B0),a ;view_type = 2 (?) ROMF:4F2A CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROMF:4F2D E5 push hl ROMF:4F2E 3E 1F ld a,1F ROMF:4F30 CD 0F 11 call 110F ;Set wC5B4 to 0x1F ROMF:4F33 01 00 90 ld bc,9000 ROMF:4F36 1E 04 ld e,04 ROMF:4F38 3E 1A ld a,1A ROMF:4F3A CD E3 0E call 0EE3 ROMF:4F3D CD D2 10 call 10D2 ROMF:4F40 C5 push bc ROMF:4F41 01 00 C1 ld bc,C100 ROMF:4F44 CD 04 11 call 1104 ;Set wC5B0-wC5B1 to 0xC100 ROMF:4F47 C1 pop bc ROMF:4F48 21 00 02 ld hl,0200 ROMF:4F4B 09 add hl,bc ROMF:4F4C 44 ld b,h ROMF:4F4D 4D ld c,l ROMF:4F4E CD 37 11 call 1137 ROMF:4F51 CD C1 10 call 10C1 ROMF:4F54 1D dec e ROMF:4F55 20 E1 jr nz,4F38 ROMF:4F57 01 00 88 ld bc,8800 ROMF:4F5A 1E 04 ld e,04 ROMF:4F5C 3E 1A ld a,1A ROMF:4F5E CD E3 0E call 0EE3 ROMF:4F61 CD D2 10 call 10D2 ROMF:4F64 C5 push bc ROMF:4F65 01 00 C1 ld bc,C100 ROMF:4F68 CD 04 11 call 1104 ;Set wC5B0-wC5B1 to 0xC100 ROMF:4F6B C1 pop bc ROMF:4F6C 21 00 02 ld hl,0200 ROMF:4F6F 09 add hl,bc ROMF:4F70 44 ld b,h ROMF:4F71 4D ld c,l ROMF:4F72 CD 37 11 call 1137 ROMF:4F75 CD C1 10 call 10C1 ROMF:4F78 1D dec e ROMF:4F79 20 E1 jr nz,4F5C ROMF:4F7B E1 pop hl ROMF:4F7C D1 pop de ROMF:4F7D C1 pop bc ROMF:4F7E F1 pop af ROMF:4F7F C9 ret
F:4F80
ROMF:4F80 F5 push af ROMF:4F81 C5 push bc ROMF:4F82 E5 push hl ROMF:4F83 EA AE C6 ld (C6AE),a ROMF:4F86 3E 00 ld a,00 ROMF:4F88 EA AF C6 ld (C6AF),a ROMF:4F8B 3E 0B ld a,0B ROMF:4F8D EA B0 C6 ld (C6B0),a ROMF:4F90 CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROMF:4F93 E5 push hl ROMF:4F94 CD 17 12 call 1217 ;VRAM Bank switch to 1 ROMF:4F97 3E 1F ld a,1F ROMF:4F99 CD 0F 11 call 110F ;Set wC5B4 to 0x1F ROMF:4F9C 01 00 90 ld bc,9000 ROMF:4F9F 1E 04 ld e,04 ROMF:4FA1 3E 1A ld a,1A ROMF:4FA3 CD E3 0E call 0EE3 ROMF:4FA6 CD D2 10 call 10D2 ROMF:4FA9 C5 push bc ROMF:4FAA 01 00 C1 ld bc,C100 ROMF:4FAD CD 04 11 call 1104 ;Set wC5B0-wC5B1 to 0xC100 ROMF:4FB0 C1 pop bc ROMF:4FB1 21 00 02 ld hl,0200 ROMF:4FB4 09 add hl,bc ROMF:4FB5 44 ld b,h ROMF:4FB6 4D ld c,l ROMF:4FB7 CD 37 11 call 1137 ROMF:4FBA CD C1 10 call 10C1 ROMF:4FBD 1D dec e ROMF:4FBE 20 E1 jr nz,4FA1 ROMF:4FC0 01 00 88 ld bc,8800 ROMF:4FC3 1E 04 ld e,04 ROMF:4FC5 3E 1A ld a,1A ROMF:4FC7 CD E3 0E call 0EE3 ROMF:4FCA CD D2 10 call 10D2 ROMF:4FCD C5 push bc ROMF:4FCE 01 00 C1 ld bc,C100 ROMF:4FD1 CD 04 11 call 1104 ;Set wC5B0-wC5B1 to 0xC100 ROMF:4FD4 C1 pop bc ROMF:4FD5 21 00 02 ld hl,0200 ROMF:4FD8 09 add hl,bc ROMF:4FD9 44 ld b,h ROMF:4FDA 4D ld c,l ROMF:4FDB CD 37 11 call 1137 ROMF:4FDE CD C1 10 call 10C1 ROMF:4FE1 1D dec e ROMF:4FE2 20 E1 jr nz,4FC5 ROMF:4FE4 CD 1E 12 call 1217 ;VRAM Bank switch to 0 ROMF:4FE7 E1 pop hl ROMF:4FE8 C1 pop bc ROMF:4FE9 F1 pop af ROMF:4FEA C9 ret
F:5027
ROMF:5027 F5 push af ROMF:5028 C5 push bc ROMF:5029 06 01 ld b,01 ROMF:502B 4F ld c,a ROMF:502C CD 6E 50 call 506E ROMF:502F CD 35 50 call 5035 ROMF:5032 C1 pop bc ROMF:5033 F1 pop af ROMF:5034 C9 ret
F:5035
ROMF:5035 F5 push af ROMF:5036 C5 push bc ROMF:5037 D5 push de ROMF:5038 E5 push hl ROMF:5039 CB 21 sla c ROMF:503B 79 ld a,c ROMF:503C EA AE C6 ld (C6AE),a ;wC6AE = c ROMF:503F 3E 00 ld a,00 ROMF:5041 EA AF C6 ld (C6AF),a ;wC6AF = 0 ROMF:5044 78 ld a,b ROMF:5045 EA B0 C6 ld (C6B0),a ;view_type = b ROMF:5048 CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching ROMF:504B E5 push hl ROMF:504C 3E 06 ld a,06 ROMF:504E CD 24 12 call 1224 ;Switches to WRAM Bank 6 ROMF:5051 21 00 D0 ld hl,D000 ROMF:5054 11 0C 00 ld de,000C ROMF:5057 06 12 ld b,12 ROMF:5059 0E 14 ld c,14 ROMF:505B CD 3E 02 call 023E ROMF:505E 22 ldi (hl),a ROMF:505F 0D dec c ROMF:5060 20 F9 jr nz,505B ROMF:5062 19 add hl,de ROMF:5063 05 dec b ROMF:5064 20 F3 jr nz,5059 ROMF:5066 CD 48 12 call 1248 ROMF:5069 E1 pop hl ROMF:506A D1 pop de ROMF:506B C1 pop bc ROMF:506C F1 pop af ROMF:506D C9 ret
Fusion ROM Bank and pointer
Returns Fusion data ROM Bank
0x3D0AA-0x3D0B1
- Returns Fusion data ROM Bank for the Fusion material card ID
ROMF:50AA E5 push hl ROMF:50AB 21 C2 50 ld hl,50C2 ROMF:50AE 09 add hl,bc ;hl = 0x50C2 + Fusion material card ID ROMF:50AF 7E ld a,(hl) ROMF:50B0 E1 pop hl ROMF:50B1 C9 ret
Returns Fusion data pointer
ROMF:50B2 F5 push af ROMF:50B3 E5 push hl ROMF:50B4 CB 21 sla c ;Fusion_Material_ID × 2 ROMF:50B6 CB 10 rl b ROMF:50B8 21 E4 53 ld hl,53E4 ROMF:50BB 09 add hl,bc ;hl = 0x53E4 + Fusion_Material_ID × 2 ROMF:50BC 2A ldi a,(hl) ROMF:50BD 46 ld b,(hl) ROMF:50BE 4F ld c,a ROMF:50BF E1 pop hl ROMF:50C0 F1 pop af ROMF:50C1 C9 ret
Fusion materials ROM Banks
0x3D0C2-0x3D3E3
- ROM Banks for each Fusion material
ROMF:50C2
Fusion materials pointers
0x3D3E4-0x3DA27
- Pointers for each Fusion material
ROMF:53E4
Bank 10
Debug Character Viewer
Display selected Character
RO10:4101 C5 push bc RO10:4102 E5 push hl RO10:4103 3E 02 ld a,02 ;a = 2 RO10:4105 CD E3 0E call 0EE3 ;Related to display RO10:4108 CD C1 10 call 10C1 ;Related to display RO10:410B FA 3A CA ld a,(CA3A) ;a = Debug Character Viewer - Character ID RO10:410E FE 18 cp a,18 RO10:4110 30 10 jr nc,4122 ;if (character_id ≥ 24), jump to 10:4122 RO10:4112 FA 3A CA ld a,(CA3A) ;Character ID selected RO10:4115 EA F9 C6 ld (C6F9),a ;CPU Character ID displayed = (CA3A) RO10:4118 AF xor a RO10:4119 EA FA C6 ld (C6FA),a ;Text ID displayed = 0 (Weevil) RO10:411C CF rst 08 ;rst 08 to blank screen ... RO10:411F CF rst 08 ;rst 08 to picture display ... RO10:4122 3E 01 ld a,01 ;a = 1 RO10:4124 E1 pop hl RO10:4125 C1 pop bc RO10:4126 C9 ret
Increment Character ID
RO10:4136 FA 3A CA ld a,(CA3A) ;Character ID RO10:4139 C6 01 add a,01 RO10:413B EA 3A CA ld (CA3A),a RO10:413E 3E 06 ld a,06 RO10:4140 CD E3 0E call 0EE3 ;Related to display RO10:4143 CD 60 41 call 4160 RO10:4146 CD C1 10 call 10C1 ;Related to display RO10:4149 AF xor a RO10:414A C9 ret
Decrement Character ID
RO10:414B FA 3A CA ld a,(CA3A) ;Character ID RO10:414E D6 01 sub a,01 RO10:4150 EA 3A CA ld (CA3A),a RO10:4153 3E 06 ld a,06 RO10:4155 CD E3 0E call 0EE3 ;Related to display RO10:4158 CD 60 41 call 4160 RO10:415B CD C1 10 call 10C1 ;Related to display RO10:415E AF xor a RO10:415F C9 ret
10:4160
RO10:4160 F5 push af RO10:4161 C5 push bc RO10:4162 01 46 98 ld bc,9846 RO10:4165 CD D2 10 call 10D2 RO10:4168 FA 3A CA ld a,(CA3A) ;Character ID RO10:416B EA F6 C5 ld (C5F6),a RO10:416E 3E 00 ld a,00 RO10:4170 EA F7 C5 ld (C5F7),a RO10:4173 CD 03 15 call 1503 ;Converts in decimal RO10:4176 78 ld a,b RO10:4177 E6 0F and a,0F RO10:4179 3C inc a RO10:417A CD 13 11 call 1113 ;Related to display RO10:417D 79 ld a,c RO10:417E E6 F0 and a,F0 RO10:4180 CB 37 swap a RO10:4182 3C inc a RO10:4183 CD 13 11 call 1113 RO10:4186 79 ld a,c RO10:4187 E6 0F and a,0F RO10:4189 3C inc a RO10:418A CD 13 11 call 1113 RO10:418D AF xor a RO10:418E 0E 11 ld c,11 RO10:4190 CD 13 11 call 1113 RO10:4193 0D dec c RO10:4194 20 FA jr nz,4190 RO10:4196 C1 pop bc RO10:4197 F1 pop af RO10:4198 C9 ret
Bank 11
Credits display and softlock
0x44004-0x44021
- Display the credits, and locks the game
RO11:4004 F5 push af RO11:4005 C5 push bc RO11:4006 D5 push de RO11:4007 E5 push hl RO11:4008 CD 27 40 call 4027 RO11:400B 3E 1C ld a,1C RO11:400D CD E3 0E call 0EE3 RO11:4010 CD 6D 40 call 406D RO11:4013 CD C1 10 call 10C1 RO11:4016 FE 00 cp a,00 RO11:4018 28 F1 jr z,400B RO11:401A CF rst 08 RO11:401B 19 add hl,de RO11:401C 0A ld a,(bc) RO11:401D CF rst 08 RO11:401E 1B dec de RO11:401F 0A ld a,(bc) RO11:4020 18 FE jr 4020 ;Lock the game
pop in registers
RO11:4022 E1 pop hl RO11:4023 D1 pop de RO11:4024 C1 pop bc RO11:4025 F1 pop af RO11:4026 C9 ret
Disable LCD Display
RO11:4027 F0 40 ld a,(ff00+40) ;LCD display RO11:4029 CB BF res 7,a ;LCD Display OFF RO11:402B E0 40 ld (ff00+40),a RO11:402D CF rst 08
11:402E (Scroll X / Y, and ?)
RO11:402E 03 inc bc RO11:402F 08 3E 00 ld (003E),sp RO11:4032 E0 42 ld (ff00+42),a RO11:4034 E0 43 ld (ff00+43),a RO11:4036 EA C8 CA ld (CAC8),a RO11:4039 EA C9 CA ld (CAC9),a RO11:403C 01 00 04 ld bc,0400 RO11:403F 21 00 98 ld hl,9800 RO11:4042 16 00 ld d,00 RO11:4044 CD AE 41 call 41AE RO11:4047 FA 38 CA ld a,(CA38) RO11:404A FE 04 cp a,04 RO11:404C 20 14 jr nz,4062 RO11:404E CF rst 08 RO11:404F 13 inc de RO11:4050 0B dec bc RO11:4051 CD 17 12 call 1217 RO11:4054 01 00 04 ld bc,0400 RO11:4057 21 00 98 ld hl,9800 RO11:405A 16 00 ld d,00 RO11:405C CD AE 41 call 41AE RO11:405F CD 1E 12 call 121E RO11:4062 F0 40 ld a,(ff00+40) RO11:4064 CB 8F res 1,a RO11:4066 CB AF res 5,a RO11:4068 CB FF set 7,a RO11:406A E0 40 ld (ff00+40),a RO11:406C C9 ret
Credits text
0x441BB-0x447F9
- Credits
Original Character Design Original Monster Design KAZUKI TAKAHASHI Game Design & Direction NOBUHIRO YAMADA Program NOBUHIRO YAMADA TAKURI CHIDA Graphics Direction KANAKO KOYAMA Graphics KANAKO KOYAMA YUKIKO HATANAKA Sound ARY NAOKO ISHII Monster Notes KEITA SHIMOMURA TAKURI CHIDA NOBUHIRO YAMADA Special Thanks KAZUHIKO TORISHIMA TOSHIMASA TAKAHASHI YOSHIHISA HEISHI TOMOYUKI SHIMA HIDEO YOSHIKURA TAKESHI NOMURA MUNEHARU MACHIDA SEIICHI SHIMIZU I.T.L KONAMI SOFTWARE SHANGHAI, INC. MANAMI MIYAZAKI SCOTT DOLPH AKIO MASUDA MASAYUKI TAKAHASHI MORIKUNI KUBO TSUTOMU WATANABE MASANORI TAKABAYASHI TAKASHI KINBARA SHOJI DEWA AKIHIRO TAKATOKU MASAKI YAMADA TAKASHI NUMAZAWA KATSUHIRO NAKAYAMA SEIJI AKAGI TAKAO HIYOSHI SHIGEYUKI TAMURA HIROAKI KAMATA KANAKO NAKAHARA MASATO SAKAI Producer SATOSHI SHIMOMURA General Producer MOTOYUKI YOSHIOKA
Bank 12
Debug Sound Test
RO12:4125 FA D2 CA ld a,(CAD2) ;Music or Sound Effect ? RO12:4128 FE 00 cp a,00 RO12:412A 20 08 jr nz,4134 ;If it's a Sound Effect, jump to 12:4134 RO12:412C FA D3 CA ld a,(CAD3) ;Selected Music track RO12:412F CD 52 2B call 2B52 ;Loads Music ROM Bank and pointer RO12:4132 18 06 jr 413A RO12:4134 FA D4 CA ld a,(CAD4) ;Selected Sound Effect RO12:4137 CD FC 2B call 2BFC ;Loads Sound Effect Bank and pointer RO12:413A 3E 02 ld a,02 RO12:413C CD E3 0E call 0EE3 RO12:413F CD C1 10 call 10C1 RO12:4142 AF xor a RO12:4143 C9 ret
Bank 13
Cards Orders
0x4C03B-0x4C67A
- Number0x4C67B-0x4CCBA
- Alphabetical0x4CCBB-0x4D2FA
- ATK0x4D2FB-0x4D93A
- DEF0x4D93B-0x4DF7A
- Alignment0x4DF7B-0x4E5BA
- Type
Bank 14 - 1C
Blank.
Bank 1D - 23
Fusions list
0x74004-0x8FA6F
- Fusion list
xx xx yy yy xx - Fusion material #2 yy - Fusion result For the Fusion material #1, refer to the ROM Banks and pointers arrays at 0x3D0C2.
Bank 24 - 25
Card drops list
0x90002-0x96A4D
- Card drops probabilities
aa ab bb cc cd dd ee ef ff gg gh hh ii ij jj
Each probability is [0;2047], and written on 12 bits
For the address list, refer to the ROM Banks and pointers arrays at 0xFB338
.
Bank 28 - 37
Graphics 4
0xA0000-0xC8D40
- ?0xD0000-0xDD3A0
- Title Screen + control routines to check if the Title Screen has been altered
Bank 3D
3D:4004
RO3D:4004 CD 98 17 call 1798 RO3D:4007 CD D1 01 call 01D1 ;ROM Bank + WRAM Bank switching RO3D:400A E0 db E0 RO3D:400B 18 F7 jr 4004
Fail-safe (ret)
RO3D:400D C9 ret
Bank 3E
Returns card drop address
0xFB1E8-0xFB1FC
- Returns the ROM Bank and pointer containing the card drop list
RO3E:71E8 F5 push af RO3E:71E9 E5 push hl RO3E:71EA 21 38 73 ld hl,7338 RO3E:71ED 09 add hl,bc RO3E:71EE 56 ld d,(hl) RO3E:71EF CB 21 sla c RO3E:71F1 CB 10 rl b RO3E:71F3 21 50 73 ld hl,7350 RO3E:71F6 09 add hl,bc RO3E:71F7 2A ldi a,(hl) RO3E:71F8 46 ld b,(hl) RO3E:71F9 4F ld c,a RO3E:71FA E1 pop hl RO3E:71FB F1 pop af RO3E:71FC C9 ret
Card drop ROM Banks
0xFB338
- Card drop ROM Banks
RO3E:7338 24 24 24 24 24 24 24 24 24 24 24 24 24 24 25 25 25 25 25 25 25 25 25 25
Card drop pointers
0xFB350
- Card drop pointers
RO3E:7350 02 40 - Weevil Underwood B5 44 - Mai Valentine 68 49 - Rex Raptor 1B 4E - Mako Tsunami CE 52 - Yami Yugi 81 57 - Yugi Muto 34 5C - Tea Gardner (No drop) 34 5C - Joey Wheeler E7 60 - Seto Kaiba 9A 65 - Espa Roba 4D 6A - Tristan Taylor 00 6F - Rare Hunter B3 73 - Pandora 66 78 - Marik Ishtar 02 40 - Heishin B5 44 - P. Seto 68 49 - Simon Muran 1B 4E - Exosha (no drop) 1B 4E - Grandpa CE 52 - Yami Bakura 81 57 - Shadi 34 5C - DarkNite E7 60 - Nitemare 9A 65 - Ishizu Ishtar
3E:742B (Legendary Password ?)
RO3E:742B F5 push af RO3E:742C E5 push hl RO3E:742D 21 BC 74 ld hl,74BC RO3E:7430 09 add hl,bc RO3E:7431 56 ld d,(hl) RO3E:7432 CB 21 sla c RO3E:7434 CB 10 rl b RO3E:7436 21 40 74 ld hl,7440 RO3E:7439 09 add hl,bc RO3E:743A 2A ldi a,(hl) RO3E:743B 46 ld b,(hl) RO3E:743C 4F ld c,a RO3E:743D E1 pop hl RO3E:743E F1 pop af RO3E:743F C9 ret
Pointer array used by 3E:742B
0xFB440-0xFB4BB
RO3E:7440 02 40 - 70 40 - E3 40 - 5B 41 - C5 41 - 37 42 - A3 42 - 13 43 - 7F 43 - E5 43 - 37 44 - A1 44 - 0B 45 - 79 45 - E6 45 - 4F 46 - BA 46 - 3B 47 - 8A 47 - F1 47 - 4B 48 - B2 48 - 17 49 - 6A 49 - DF 49 - 51 4A - 74 4A - 88 4A - 9C 4A - AF 4A - F8 4A - 44 4B - C0 4B - 3C 4C - 4E 4C - 69 4C - 84 4C - CA 4C - 11 4D - 35 4D - A2 4D - 19 4E - 8B 4E - A7 4E - C3 4E - DE 4E - 1F 4F - 7E 4F - CF 4F - 30 50 - A2 50 - E3 50 - 24 51 - 3F 51 - B1 51 - CD 51 - E0 51 - 56 52 - 9C 52 - E2 52 - 28 53 - 63 53 -
Data array (3E:74BC, used by func_3E:742B)
0xFB4BC-0xFB4FA
- A ton of 0xD5s, followed by many 00s, used by func_3E:742B
RO3E:74BC D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 D5 00 00
Bank 40
Sound Effects management
Loads Sound Effect pointer
0x100002-0x100018
- Loads Sound Effect pointer
RO40:4002 06 00 ld b,00 RO40:4004 4F ld c,a RO40:4005 CB 21 sla c RO40:4007 CB 10 rl b RO40:4009 CB 21 sla c RO40:400B CB 10 rl b RO40:400D 21 19 40 ld hl,4019 RO40:4010 09 add hl,bc RO40:4011 2A ldi a,(hl) RO40:4012 5F ld e,a RO40:4013 2A ldi a,(hl) RO40:4014 57 ld d,a RO40:4015 2A ldi a,(hl) RO40:4016 66 ld h,(hl) RO40:4017 6F ld l,a RO40:4018 C9 ret
Sound Effects pointers
0x100019-0x0x10006C
- Sound Effects pointers
RO40:4019 40 00 6D 40 - Trap Activated 40 00 F6 40 - Card Set 40 00 1B 41 - Cursor 1 40 00 B5 41 - Selected 40 00 94 42 - Level increases 40 00 8A 45 - Level decreases 40 00 80 48 - Cancel 40 00 7C 4A - 40 00 72 4D - Healing 40 00 D6 4E - Life Points diminishing 40 00 70 4F - 40 00 66 52 - End of turn 40 00 AE 53 - 40 00 A4 56 - 40 00 9A 59 - Cursor 2 40 00 34 5A - Exodia 40 00 32 5B - Direct Damage Spell 40 00 9D 5B - Swords of Revealing Light 40 00 61 5D - Dark Hole 40 00 3F 5E - Raigeki 40 00 C3 5E - Field Spell
Sound Effects
0x10006D
- Sound Effects
Bank 41 - 53
Music tracks
0x104002 - 0x14F2D8
- Music tracks
Bank 70 - C3
Graphics 5
0x1C0000-0x30DB00
- Cards illustrations, CPU opponents illustrations...
Bank D0
Menu texts
0x3401E4
- « CHEST »0x340203
- « DETAILS »0x340214
- « ADD TO DECK »0x34078B
- « VERSUS »0x3407C6
- « CHEST »0x3407E5
- « DETAILS »0x3407F6
- « TO EXCHANGE »0x34082C
- « DECK »0x340848
- « DETAILS »0x34085C
- « RETURN TO CHEST »0x340896
- « CHECK CARDS »0x3408B9
- « DETAIL »0x3408C8
- « RETURN TO »0x340E7B
- « END »0x340EA8
- « INPUT 8-DIGIT NUMBER »0x34196C
- « DECK OF OPPONENT »0x341990
- « DETAILS »0x34199D
- « DISCARD »0x3419AA
- « END TURN »0x341C54
- « COST »0x341E49
- « PARTS »0x341E93
- « CHEST »0x341EAF
- « DETAILS »0x341EC0
- « DISASSEMBLE »0x341EF8
- « GxH » (Debug Sound Test)0x341F00
- « ET » (Debug Sound Test)
Bank FE - FF
Cards texts
0x3F8002-0x3FF085
- Cards texts
Internal Data for Yu-Gi-Oh! Dark Duel Stories
| |
---|---|