Yu-Gi-Oh! Duel Monsters/ROM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
 
m (Xkeeper moved page Yu-Gi-Oh! Duel Monsters:ROM map to Yu-Gi-Oh! Duel Monsters/ROM map: normalize subpages and titles)
(No difference)

Revision as of 02:42, 24 January 2024

Chip tiny.png The following article is a ROM map for Yu-Gi-Oh! Duel Monsters.

Bank 0

rst

rst 00

ROM0:0000 F3               di
ROM0:0001 C3 8F 16         jp   168F          ;Checks input at Title Screen for password

rst 08

ROM0:0008 C3 33 10         jp   1033          ;rst 08 instructions

rst 10 (error trap)

ROM0:0010 18 FE            jr   0010

rst 18 (error trap)

ROM0:0018 18 FE            jr   0018

rst 20 (error trap)

ROM0:0020 18 FE            jr   0020

rst 28 (error trap)

ROM0:0028 18 FE            jr   0028

rst 30 (error trap)

ROM0:0030 18 FE            jr   0030

rst 38 (error trap)

ROM0:0038 18 FE            jr   0038

rst 40 (vblank)

ROM0:0040 C3 1A 04         jp   041A          ;Load pointer to OAM subroutine

rst 48 (LCD)

ROM0:0048 18 FE            jr   0048

rst 50 (timer)

ROM0:0050 C3 1A 16         jp   161A

rst 58 (serial)

ROM0:0058 C3 D0 01         jp   01D0

rst 60 (joypad)

ROM0:0060 18 FE            jr   0060

ROM start

ROM0:0100 00               nop  
ROM0:0101 C3 50 01         jp   0150
ROM0:0150 E0 DD            ld   (ff00+DD),a
ROM0:0152 21 00 E0         ld   hl,E000
ROM0:0155 F9               ld   sp,hl
ROM0:0156 CD 90 10         call 1090
ROM0:0159 CF               rst  08
ROM0:015A 05               dec  b
ROM0:015B 04               inc  b
ROM0:015C 3E 00            ld   a,00
ROM0:015E CF               rst  08
ROM0:015F 03               inc  bc
ROM0:0160 3F               ccf  
ROM0:0161 CF               rst  08
ROM0:0162 03               inc  bc
ROM0:0163 3E CD            ld   a,CD
ROM0:0165 EA 14 CD         ld   (CD14),a
ROM0:0168 96               sub  (hl)
ROM0:0169 03               inc  bc
ROM0:016A CD D8 0D         call 0DD8
ROM0:016D CD 9F 01         call 019F
ROM0:0170 3E 02            ld   a,02
ROM0:0172 CF               rst  08
ROM0:0173 03               inc  bc
ROM0:0174 3F               ccf  
ROM0:0175 CF               rst  08
ROM0:0176 49               ld   c,c
ROM0:0177 01 3E 04         ld   bc,043E
ROM0:017A CF               rst  08
ROM0:017B 03               inc  bc
ROM0:017C 3F               ccf  
ROM0:017D CF               rst  08
ROM0:017E 4B               ld   c,e
ROM0:017F 01 3E 06         ld   bc,063E
ROM0:0182 CF               rst  08

Joypad input

ROM0:03AA F5               push af
ROM0:03AB C5               push bc
ROM0:03AC D5               push de
ROM0:03AD 3E 20            ld   a,20
ROM0:03AF E0 00            ld   (ff00+00),a
ROM0:03B1 F0 00            ld   a,(ff00+00)	// Joypad input
ROM0:03B3 F0 00            ld   a,(ff00+00)
ROM0:03B5 2F               cpl  
ROM0:03B6 E6 0F            and  a,0F
ROM0:03B8 CB 37            swap a
ROM0:03BA 47               ld   b,a
ROM0:03BB 3E 10            ld   a,10
ROM0:03BD E0 00            ld   (ff00+00),a
ROM0:03BF F0 00            ld   a,(ff00+00)
ROM0:03C1 F0 00            ld   a,(ff00+00)
ROM0:03C3 F0 00            ld   a,(ff00+00)
ROM0:03C5 F0 00            ld   a,(ff00+00)
ROM0:03C7 F0 00            ld   a,(ff00+00)
ROM0:03C9 F0 00            ld   a,(ff00+00)
ROM0:03CB 2F               cpl  
ROM0:03CC E6 0F            and  a,0F
ROM0:03CE B0               or   b
ROM0:03CF 4F               ld   c,a
ROM0:03D0 FA A5 CA         ld   a,(CAA5)
ROM0:03D3 57               ld   d,a
ROM0:03D4 A9               xor  c
ROM0:03D5 A1               and  c
ROM0:03D6 EA A6 CA         ld   (CAA6),a
ROM0:03D9 79               ld   a,c
ROM0:03DA EA A5 CA         ld   (CAA5),a	// Stores input in (CAA5)
ROM0:03DD 3E 30            ld   a,30
ROM0:03DF E0 00            ld   (ff00+00),a
ROM0:03E1 FA A5 CA         ld   a,(CAA5)
ROM0:03E4 BA               cp   d
ROM0:03E5 20 19            jr   nz,0400
ROM0:03E7 3E 00            ld   a,00
ROM0:03E9 EA A7 CA         ld   (CAA7),a
ROM0:03EC FA A8 CA         ld   a,(CAA8)
ROM0:03EF 3D               dec  a
ROM0:03F0 EA A8 CA         ld   (CAA8),a
ROM0:03F3 20 09            jr   nz,03FE
ROM0:03F5 3E 03            ld   a,03
ROM0:03F7 EA A8 CA         ld   (CAA8),a
ROM0:03FA 7A               ld   a,d
ROM0:03FB EA A7 CA         ld   (CAA7),a
ROM0:03FE 18 08            jr   0408
ROM0:0400 EA A7 CA         ld   (CAA7),a
ROM0:0403 3E 14            ld   a,14
ROM0:0405 EA A8 CA         ld   (CAA8),a
ROM0:0408 D1               pop  de
ROM0:0409 C1               pop  bc
ROM0:040A F1               pop  af
ROM0:040B C9               ret

Object Attribute Memory

rst 40 - Load pointer to OAM subroutine

ROM0:041A F5               push af
ROM0:041B E5               push hl
ROM0:041C C5               push bc
ROM0:041D D5               push de
ROM0:041E 06 00            ld   b,00
ROM0:0420 FA AC CA         ld   a,(CAAC)
ROM0:0423 4F               ld   c,a
ROM0:0424 21 2C 04         ld   hl,042C
ROM0:0427 09               add  hl,bc
ROM0:0428 2A               ldi  a,(hl)
ROM0:0429 66               ld   h,(hl)
ROM0:042A 6F               ld   l,a
ROM0:042B E9               jp   hl

0:042C (pointers, to document)

ROM0:042C
44 04
5D 04
83 04
AC 04
1F 05
CE 06
26 08
00 09
0A 0A
62 0B
F0 0B

0:045D ((CAAC) = 0, (CAA9) = 1)

ROM0:045D 3E 00            ld   a,00
ROM0:045F EA AC CA         ld   (CAAC),a
ROM0:0462 3E 01            ld   a,01
ROM0:0464 EA A9 CA         ld   (CAA9),a
ROM0:0467 CD AA 03         call 03AA		;Joypad input
ROM0:046A 0E E4            ld   c,E4
ROM0:046C F2               ld   a,(ff00+c)
ROM0:046D F6 80            or   a,80
ROM0:046F E2               ld   (ff00+c),a
ROM0:0470 0E E5            ld   c,E5
ROM0:0472 F2               ld   a,(ff00+c)
ROM0:0473 F6 80            or   a,80
ROM0:0475 E2               ld   (ff00+c),a
ROM0:0476 CD 05 17         call 1705
ROM0:0479 E0 CD            ld   (ff00+CD),a
ROM0:047B 05               dec  b
ROM0:047C 17               rla  
ROM0:047D E1               pop  hl
ROM0:047E D1               pop  de
ROM0:047F C1               pop  bc
ROM0:0480 E1               pop  hl
ROM0:0481 F1               pop  af
ROM0:0482 D9               reti

0:0DE3 (set (CAAB) to accumulator, and (CAAA) to 0)

ROM0:0DE3 F5               push af
ROM0:0DE4 C5               push bc
ROM0:0DE5 E5               push hl
ROM0:0DE6 EA AB CA         ld   (CAAB),a
ROM0:0DE9 4F               ld   c,a
ROM0:0DEA 06 00            ld   b,00
ROM0:0DEC 21 01 0E         ld   hl,0E01
ROM0:0DEF 09               add  hl,bc
ROM0:0DF0 2A               ldi  a,(hl)
ROM0:0DF1 66               ld   h,(hl)
ROM0:0DF2 6F               ld   l,a
ROM0:0DF3 01 F8 0D         ld   bc,0DF8
ROM0:0DF6 C5               push bc
ROM0:0DF7 E9               jp   hl
ROM0:0DF8 3E 00            ld   a,00
ROM0:0DFA EA AA CA         ld   (CAAA),a
ROM0:0DFD E1               pop  hl
ROM0:0DFE C1               pop  bc
ROM0:0DFF F1               pop  af
ROM0:0E00 C9               ret

0:0E01 (pointers to ?)

ROM0:0E01
19 0E 19 0E 19 0E 1A 0E 3F 0E 40 0E 4D 0E 6A 0E B7 0E E4 0E 11 0F 2E 0F

0:0F2F ((CAAB) => (CAAC), (CAAB) = 0)

ROM0:0F2F F5               push af
ROM0:0F30 FA AB CA         ld   a,(CAAB)
ROM0:0F33 EA AC CA         ld   (CAAC),a
ROM0:0F36 3E 00            ld   a,00
ROM0:0F38 EA AB CA         ld   (CAAB),a
ROM0:0F3B F1               pop  af
ROM0:0F3C C9               ret

Store reg bc in [wC5(CAAA)], and update wCAAA

ROM0:0F3D F5               push af
ROM0:0F3E E5               push hl
ROM0:0F3F 26 C5            ld   h,C5
ROM0:0F41 FA AA CA         ld   a,(CAAA)
ROM0:0F44 6F               ld   l,a		;hl = 0xC5XX
ROM0:0F45 79               ld   a,c
ROM0:0F46 22               ldi  (hl),a
ROM0:0F47 78               ld   a,b
ROM0:0F48 22               ldi  (hl),a
ROM0:0F49 7D               ld   a,l
ROM0:0F4A EA AA CA         ld   (CAAA),a
ROM0:0F4D E1               pop  hl
ROM0:0F4E F1               pop  af
ROM0:0F4F C9               ret  

Store reg a in [wC5(CAAA)], and update wCAAA

ROM0:0F50 F5               push af
ROM0:0F51 E5               push hl
ROM0:0F52 F5               push af
ROM0:0F53 26 C5            ld   h,C5
ROM0:0F55 FA AA CA         ld   a,(CAAA)
ROM0:0F58 6F               ld   l,a		;hl = 0xC5XX
ROM0:0F59 F1               pop  af
ROM0:0F5A 22               ldi  (hl),a
ROM0:0F5B 7D               ld   a,l
ROM0:0F5C EA AA CA         ld   (CAAA),a
ROM0:0F5F E1               pop  hl
ROM0:0F60 F1               pop  af
ROM0:0F61 C9               ret

0:0F74 (call 0:177B)

ROM0:0F74 F5               push af
ROM0:0F75 CD 7B 17         call 177B

0:0F7A (call 0:168F, 0:175A)

ROM0:0F7A CD 8F 16         call 168F        ;Checks input at Title Screen for password
ROM0:0F7D CD 5A 17         call 175A

0:0FCE (to document)

ROM0:0FCE FA 00 40         ld   a,(4000)
ROM0:0FD1 F5               push af
ROM0:0FD2 3E 3E            ld   a,3E
ROM0:0FD4 CD 9F 10         call 109F
ROM0:0FD7 CD 1A 41         call 411A		;set (CAD1) to 2
ROM0:0FDA F1               pop  af
ROM0:0FDB CD 9F 10         call 109F
ROM0:0FDE CD 7B 17         call 177B
ROM0:0FE1 80               add  b
ROM0:0FE2 E5               push hl
ROM0:0FE3 CD 8F 16         call 168F		;Checks input at Title Screen for password
ROM0:0FE6 CD 5A 17         call 175A
ROM0:0FE9 80               add  b
ROM0:0FEA E5               push hl
ROM0:0FEB 28 F6            jr   z,0FE3
ROM0:0FED 18 DF            jr   0FCE
ROM0:0FEF C9               ret

rst 08 instructions

  • 0x1033-0x1070 - rst 08 jumps here
ROM0:1033 F5               push af
ROM0:1034 E8 FD            add  sp,FD
ROM0:1036 F5               push af
ROM0:1037 E5               push hl
ROM0:1038 C5               push bc
ROM0:1039 D5               push de
ROM0:103A F8 06            ld   hl,sp+06
ROM0:103C 54               ld   d,h
ROM0:103D 5D               ld   e,l
ROM0:103E F8 0E            ld   hl,sp+0E
ROM0:1040 3A               ldd  a,(hl)
ROM0:1041 47               ld   b,a
ROM0:1042 3A               ldd  a,(hl)
ROM0:1043 4F               ld   c,a
ROM0:1044 FA 00 40         ld   a,(4000)
ROM0:1047 32               ldd  (hl),a
ROM0:1048 7E               ld   a,(hl)
ROM0:1049 12               ld   (de),a
ROM0:104A 3E 10            ld   a,10
ROM0:104C 32               ldd  (hl),a
ROM0:104D 3E 71            ld   a,71
ROM0:104F 32               ldd  (hl),a
ROM0:1050 0A               ld   a,(bc)		;Retrieve address pointer after the rst 08
ROM0:1051 5F               ld   e,a		;Store it in e
ROM0:1052 03               inc  bc
ROM0:1053 16 40            ld   d,40		;de = 40xx
ROM0:1055 0A               ld   a,(bc)		;Retrieve Bank after the rst 08
ROM0:1056 03               inc  bc
ROM0:1057 F3               di   
ROM0:1058 EA 00 30         ld   (3000),a	;ROM Bank switch
ROM0:105B 1F               rra  
ROM0:105C CB 37            swap a
ROM0:105E EA 00 50         ld   (5000),a
ROM0:1061 FB               ei   
ROM0:1062 1A               ld   a,(de)
ROM0:1063 32               ldd  (hl),a
ROM0:1064 1D               dec  e
ROM0:1065 1A               ld   a,(de)
ROM0:1066 77               ld   (hl),a
ROM0:1067 F8 0D            ld   hl,sp+0D
ROM0:1069 79               ld   a,c
ROM0:106A 22               ldi  (hl),a
ROM0:106B 70               ld   (hl),b
ROM0:106C D1               pop  de
ROM0:106D C1               pop  bc
ROM0:106E E1               pop  hl
ROM0:106F F1               pop  af
ROM0:1070 C9               ret

Jump back to after the rst 08

ROM0:1071 F5               push af
ROM0:1072 E5               push hl
ROM0:1073 C5               push bc
ROM0:1074 F8 06            ld   hl,sp+06
ROM0:1076 7E               ld   a,(hl)
ROM0:1077 F3               di   
ROM0:1078 EA 00 30         ld   (3000),a	;Switches to original Bank
ROM0:107B 1F               rra  
ROM0:107C CB 37            swap a
ROM0:107E EA 00 50         ld   (5000),a
ROM0:1081 FB               ei   
ROM0:1082 44               ld   b,h
ROM0:1083 4D               ld   c,l
ROM0:1084 0B               dec  bc
ROM0:1085 0A               ld   a,(bc)
ROM0:1086 32               ldd  (hl),a
ROM0:1087 0B               dec  bc
ROM0:1088 0A               ld   a,(bc)
ROM0:1089 77               ld   (hl),a
ROM0:108A C1               pop  bc
ROM0:108B E1               pop  hl
ROM0:108C E8 01            add  sp,01
ROM0:108E F1               pop  af
ROM0:108F C9               ret

0:1090 (to document)

ROM0:1090 F5               push af
ROM0:1091 E5               push hl
ROM0:1092 21 00 10         ld   hl,1000
ROM0:1095 36 0A            ld   (hl),0A
ROM0:1097 21 00 70         ld   hl,7000
ROM0:109A 36 00            ld   (hl),00
ROM0:109C E1               pop  hl
ROM0:109D F1               pop  af
ROM0:109E C9               ret  

0:109F (to document)

ROM0:109F F5               push af
ROM0:10A0 F3               di   
ROM0:10A1 EA 00 30         ld   (3000),a
ROM0:10A4 1F               rra  
ROM0:10A5 CB 37            swap a
ROM0:10A7 EA 00 50         ld   (5000),a
ROM0:10AA FB               ei   
ROM0:10AB F1               pop  af
ROM0:10AC C9               ret

0:123C (to document)

ROM0:123C F5               push af
ROM0:123D C5               push bc
ROM0:123E E5               push hl
ROM0:123F C5               push bc
ROM0:1240 CB 21            sla  c
ROM0:1242 CB 21            sla  c
ROM0:1244 06 00            ld   b,00
ROM0:1246 21 00 CA         ld   hl,CA00
ROM0:1249 09               add  hl,bc
ROM0:124A C1               pop  bc
ROM0:124B 22               ldi  (hl),a
ROM0:124C 7A               ld   a,d
ROM0:124D 22               ldi  (hl),a
ROM0:124E 78               ld   a,b
ROM0:124F 22               ldi  (hl),a
ROM0:1250 36 00            ld   (hl),00
ROM0:1252 E1               pop  hl
ROM0:1253 C1               pop  bc
ROM0:1254 F1               pop  af
ROM0:1255 C9               ret

0:1282

0:1282 (call 0:1289 and 0:12A4)

ROM0:1282 CD 89 12         call 1289
ROM0:1285 CD A4 12         call 12A4
ROM0:1288 C9               ret  

0:1289

ROM0:1289 F5               push af
ROM0:128A C5               push bc
ROM0:128B FA 1D CD         ld   a,(CD1D)
ROM0:128E 47               ld   b,a
ROM0:128F FA 1B CD         ld   a,(CD1B)
ROM0:1292 80               add  b
ROM0:1293 EA 1B CD         ld   (CD1B),a
ROM0:1296 FA 1E CD         ld   a,(CD1E)
ROM0:1299 47               ld   b,a
ROM0:129A FA 1C CD         ld   a,(CD1C)
ROM0:129D 80               add  b
ROM0:129E EA 1C CD         ld   (CD1C),a
ROM0:12A1 C1               pop  bc
ROM0:12A2 F1               pop  af
ROM0:12A3 C9               ret  

0:12A4

ROM0:12A4 F5               push af
ROM0:12A5 C5               push bc
ROM0:12A6 D5               push de
ROM0:12A7 E5               push hl
ROM0:12A8 21 00 CA         ld   hl,CA00
ROM0:12AB 16 00            ld   d,00
ROM0:12AD 06 05            ld   b,05
ROM0:12AF 1E 00            ld   e,00
ROM0:12B1 0E 08            ld   c,08
ROM0:12B3 FA 1B CD         ld   a,(CD1B)
ROM0:12B6 82               add  d
ROM0:12B7 22               ldi  (hl),a
ROM0:12B8 FA 1C CD         ld   a,(CD1C)
ROM0:12BB 83               add  e
ROM0:12BC 22               ldi  (hl),a
ROM0:12BD 23               inc  hl
ROM0:12BE 23               inc  hl
ROM0:12BF 3E 08            ld   a,08
ROM0:12C1 83               add  e
ROM0:12C2 5F               ld   e,a
ROM0:12C3 0D               dec  c
ROM0:12C4 20 ED            jr   nz,12B3		;Loop 8 times to 0:12B3
ROM0:12C6 3E 10            ld   a,10
ROM0:12C8 82               add  d
ROM0:12C9 57               ld   d,a
ROM0:12CA 05               dec  b
ROM0:12CB 20 E2            jr   nz,12AF		;Loop 5 times to 0:12AF
ROM0:12CD E1               pop  hl
ROM0:12CE D1               pop  de
ROM0:12CF C1               pop  bc
ROM0:12D0 F1               pop  af
ROM0:12D1 C9               ret

0:1347

ROM0:1347 F5               push af
ROM0:1348 C5               push bc
ROM0:1349 1E 00            ld   e,00
ROM0:134B 0E 08            ld   c,08
ROM0:134D CB 22            sla  d
ROM0:134F CB 13            rl   e
ROM0:1351 7B               ld   a,e
ROM0:1352 B8               cp   b
ROM0:1353 38 03            jr   c,1358
ROM0:1355 90               sub  b
ROM0:1356 5F               ld   e,a
ROM0:1357 14               inc  d
ROM0:1358 0D               dec  c
ROM0:1359 20 F2            jr   nz,134D
ROM0:135B C1               pop  bc
ROM0:135C F1               pop  af
ROM0:135D C9               ret

0:135E

ROM0:135E F5               push af
ROM0:135F C5               push bc
ROM0:1360 E5               push hl
ROM0:1361 21 00 00         ld   hl,0000
ROM0:1364 3E 10            ld   a,10
ROM0:1366 F5               push af
ROM0:1367 CB 23            sla  e
ROM0:1369 CB 12            rl   d
ROM0:136B CB 15            rl   l
ROM0:136D CB 14            rl   h
ROM0:136F 7C               ld   a,h
ROM0:1370 B8               cp   b
ROM0:1371 38 14            jr   c,1387
ROM0:1373 7C               ld   a,h
ROM0:1374 B8               cp   b
ROM0:1375 20 0B            jr   nz,1382
ROM0:1377 7D               ld   a,l
ROM0:1378 B9               cp   c
ROM0:1379 38 05            jr   c,1380
ROM0:137B 91               sub  c
ROM0:137C 6F               ld   l,a
ROM0:137D 7C               ld   a,h
ROM0:137E 98               sbc  b
ROM0:137F 67               ld   h,a
ROM0:1380 18 05            jr   1387
ROM0:1382 91               sub  c
ROM0:1383 6F               ld   l,a
ROM0:1384 7C               ld   a,h
ROM0:1385 98               sbc  b
ROM0:1386 67               ld   h,a
ROM0:1387 F1               pop  af
ROM0:1388 3D               dec  a
ROM0:1389 20 DB            jr   nz,1366
ROM0:138B 54               ld   d,h
ROM0:138C 5D               ld   e,l
ROM0:138D E1               pop  hl
ROM0:138E C1               pop  bc
ROM0:138F F1               pop  af
ROM0:1390 C9               ret  

0:1391 (daa)

ROM0:1391 F5               push af
ROM0:1392 C5               push bc
ROM0:1393 D5               push de
ROM0:1394 16 00            ld   d,00
ROM0:1396 21 00 00         ld   hl,0000
ROM0:1399 0E 08            ld   c,08
ROM0:139B CB 38            srl  b
ROM0:139D 30 01            jr   nc,13A0
ROM0:139F 19               add  hl,de
ROM0:13A0 CB 23            sla  e
ROM0:13A2 CB 12            rl   d
ROM0:13A4 0D               dec  c
ROM0:13A5 20 F4            jr   nz,139B
ROM0:13A7 D1               pop  de
ROM0:13A8 C1               pop  bc
ROM0:13A9 F1               pop  af
ROM0:13AA C9               ret  
ROM0:13AB F5               push af
ROM0:13AC 7B               ld   a,e
ROM0:13AD 81               add  c
ROM0:13AE 27               daa  
ROM0:13AF 4F               ld   c,a
ROM0:13B0 7A               ld   a,d
ROM0:13B1 80               add  b
ROM0:13B2 27               daa  
ROM0:13B3 47               ld   b,a
ROM0:13B4 30 03            jr   nc,13B9     ;if(bc ≤ 9999), exit this function
ROM0:13B6 01 99 99         ld   bc,9999     ;bc = 9999
ROM0:13B9 F1               pop  af
ROM0:13BA C9               ret  

0:13BB

ROM0:13BB F5               push af
ROM0:13BC 78               ld   a,b
ROM0:13BD BA               cp   d
ROM0:13BE 20 0B            jr   nz,13CB
ROM0:13C0 79               ld   a,c
ROM0:13C1 BB               cp   e
ROM0:13C2 20 07            jr   nz,13CB
ROM0:13C4 01 00 00         ld   bc,0000
ROM0:13C7 1E 01            ld   e,01
ROM0:13C9 18 0E            jr   13D9
ROM0:13CB 7B               ld   a,e
ROM0:13CC 91               sub  c
ROM0:13CD 27               daa  
ROM0:13CE 4F               ld   c,a
ROM0:13CF 7A               ld   a,d
ROM0:13D0 98               sbc  b
ROM0:13D1 27               daa  
ROM0:13D2 47               ld   b,a
ROM0:13D3 1E 02            ld   e,02
ROM0:13D5 30 02            jr   nc,13D9
ROM0:13D7 1E 00            ld   e,00
ROM0:13D9 F1               pop  af
ROM0:13DA C9               ret

0:1508

ROM0:1508 F5               push af
ROM0:1509 C5               push bc
ROM0:150A E5               push hl
ROM0:150B C5               push bc
ROM0:150C 21 B9 CA         ld   hl,CAB9
ROM0:150F AF               xor  a
ROM0:1510 0E 08            ld   c,08
ROM0:1512 22               ldi  (hl),a
ROM0:1513 0D               dec  c
ROM0:1514 20 FC            jr   nz,1512
ROM0:1516 C1               pop  bc
ROM0:1517 CD EF 1C         call 1CEF
ROM0:151A FE 00            cp   a,00
ROM0:151C 20 20            jr   nz,153E
ROM0:151E 3E 04            ld   a,04
ROM0:1520 CF               rst  08
           => 1:401D points at 1:42D0 => Update wCAB8
ROM0:1523 CF               rst  08
           => 1:401B points at 1:42C5 => Update value to display in Battle screen
ROM0:1526 CF               rst  08
           => 1F 01
ROM0:1529 CF               rst  08
           => 11 01
ROM0:152C CF               rst  08
           => 13 01
ROM0:152F FE FF            cp   a,FF
ROM0:1531 20 0B            jr   nz,153E
ROM0:1533 21 B9 CA         ld   hl,CAB9
ROM0:1536 3E 73            ld   a,73
ROM0:1538 0E 08            ld   c,08
ROM0:153A 22               ldi  (hl),a
ROM0:153B 0D               dec  c
ROM0:153C 20 FC            jr   nz,153A
ROM0:153E E1               pop  hl
ROM0:153F C1               pop  bc
ROM0:1540 F1               pop  af
ROM0:1541 C9               ret

Checks input at Title Screen for password

ROM0:168F E5               push hl
ROM0:1690 21 FF FF         ld   hl,FFFF
ROM0:1693 CB 96            res  2,(hl)
ROM0:1695 F5               push af
ROM0:1696 C5               push bc
ROM0:1697 D5               push de
ROM0:1698 F3               di   
ROM0:1699 F0 DF            ld   a,(ff00+DF)
ROM0:169B 4F               ld   c,a
ROM0:169C D6 E0            sub  a,E0
ROM0:169E 47               ld   b,a
ROM0:169F 07               rlca 
ROM0:16A0 80               add  b
ROM0:16A1 5F               ld   e,a
ROM0:16A2 3E 00            ld   a,00
ROM0:16A4 E2               ld   (ff00+c),a
ROM0:16A5 0C               inc  c
ROM0:16A6 79               ld   a,c
ROM0:16A7 FE E4            cp   a,E4
ROM0:16A9 20 02            jr   nz,16AD
ROM0:16AB 0E E0            ld   c,E0
ROM0:16AD F2               ld   a,(ff00+c)
ROM0:16AE FE 01            cp   a,01
ROM0:16B0 20 F3            jr   nz,16A5
ROM0:16B2 79               ld   a,c
ROM0:16B3 E0 DF            ld   (ff00+DF),a
ROM0:16B5 3E 02            ld   a,02
ROM0:16B7 E2               ld   (ff00+c),a
ROM0:16B8 3E E8            ld   a,E8
ROM0:16BA 83               add  e
ROM0:16BB 4F               ld   c,a
ROM0:16BC F8 00            ld   hl,sp+00
ROM0:16BE 7D               ld   a,l
ROM0:16BF E2               ld   (ff00+c),a
ROM0:16C0 0C               inc  c
ROM0:16C1 7C               ld   a,h
ROM0:16C2 E2               ld   (ff00+c),a
ROM0:16C3 0C               inc  c
ROM0:16C4 FA 00 40         ld   a,(4000)
ROM0:16C7 E2               ld   (ff00+c),a
ROM0:16C8 F0 DF            ld   a,(ff00+DF)
ROM0:16CA D6 E0            sub  a,E0
ROM0:16CC 47               ld   b,a
ROM0:16CD 07               rlca 
ROM0:16CE 80               add  b
ROM0:16CF 5F               ld   e,a
ROM0:16D0 C6 E8            add  a,E8
ROM0:16D2 4F               ld   c,a
ROM0:16D3 F2               ld   a,(ff00+c)
ROM0:16D4 6F               ld   l,a
ROM0:16D5 0C               inc  c
ROM0:16D6 F2               ld   a,(ff00+c)
ROM0:16D7 67               ld   h,a
ROM0:16D8 F9               ld   sp,hl
ROM0:16D9 0C               inc  c
ROM0:16DA F2               ld   a,(ff00+c)
ROM0:16DB EA 00 30         ld   (3000),a
ROM0:16DE 1F               rra  
ROM0:16DF CB 37            swap a
ROM0:16E1 EA 00 50         ld   (5000),a
ROM0:16E4 16 00            ld   d,00
ROM0:16E6 21 DD 15         ld   hl,15DD
ROM0:16E9 19               add  hl,de
ROM0:16EA 7E               ld   a,(hl)
ROM0:16EB E0 05            ld   (ff00+05),a
ROM0:16ED 2A               ldi  a,(hl)
ROM0:16EE E0 06            ld   (ff00+06),a
ROM0:16F0 2A               ldi  a,(hl)
ROM0:16F1 E0 07            ld   (ff00+07),a
ROM0:16F3 7E               ld   a,(hl)
ROM0:16F4 E0 07            ld   (ff00+07),a
ROM0:16F6 D1               pop  de
ROM0:16F7 C1               pop  bc
ROM0:16F8 F1               pop  af
ROM0:16F9 21 0F FF         ld   hl,FF0F
ROM0:16FC CB 96            res  2,(hl)
ROM0:16FE 2E FF            ld   l,FF
ROM0:1700 CB D6            set  2,(hl)
ROM0:1702 E1               pop  hl
ROM0:1703 D9               reti 
ROM0:1704 C9               ret

0:1705 (to document)

ROM0:1705 F5               push af
ROM0:1706 C5               push bc
ROM0:1707 D5               push de
ROM0:1708 E5               push hl
ROM0:1709 F8 08            ld   hl,sp+08
ROM0:170B 2A               ldi  a,(hl)
ROM0:170C 5F               ld   e,a
ROM0:170D 56               ld   d,(hl)
ROM0:170E 1A               ld   a,(de)
ROM0:170F 4F               ld   c,a
ROM0:1710 13               inc  de
ROM0:1711 7A               ld   a,d
ROM0:1712 32               ldd  (hl),a
ROM0:1713 73               ld   (hl),e
ROM0:1714 3E 01            ld   a,01
ROM0:1716 E2               ld   (ff00+c),a
ROM0:1717 E1               pop  hl
ROM0:1718 D1               pop  de
ROM0:1719 C1               pop  bc
ROM0:171A F1               pop  af
ROM0:171B C9               ret

0:175A (to document)

ROM0:175A C5               push bc
ROM0:175B D5               push de
ROM0:175C E5               push hl
ROM0:175D F8 06            ld   hl,sp+06
ROM0:175F 2A               ldi  a,(hl)
ROM0:1760 5F               ld   e,a
ROM0:1761 56               ld   d,(hl)
ROM0:1762 1A               ld   a,(de)
ROM0:1763 47               ld   b,a
ROM0:1764 13               inc  de
ROM0:1765 1A               ld   a,(de)
ROM0:1766 4F               ld   c,a
ROM0:1767 13               inc  de
ROM0:1768 7A               ld   a,d
ROM0:1769 32               ldd  (hl),a
ROM0:176A 73               ld   (hl),e
ROM0:176B F3               di   
ROM0:176C 3E FF            ld   a,FF
ROM0:176E A8               xor  b
ROM0:176F 57               ld   d,a
ROM0:1770 F2               ld   a,(ff00+c)
ROM0:1771 5F               ld   e,a
ROM0:1772 A2               and  d
ROM0:1773 E2               ld   (ff00+c),a
ROM0:1774 7B               ld   a,e
ROM0:1775 A0               and  b
ROM0:1776 E1               pop  hl
ROM0:1777 D1               pop  de
ROM0:1778 C1               pop  bc
ROM0:1779 D9               reti 
ROM0:177A C9               ret  

0:177B (to document)

ROM0:177B F5               push af
ROM0:177C C5               push bc
ROM0:177D D5               push de
ROM0:177E E5               push hl
ROM0:177F F8 08            ld   hl,sp+08
ROM0:1781 2A               ldi  a,(hl)
ROM0:1782 5F               ld   e,a
ROM0:1783 56               ld   d,(hl)
ROM0:1784 1A               ld   a,(de)
ROM0:1785 47               ld   b,a
ROM0:1786 13               inc  de
ROM0:1787 1A               ld   a,(de)
ROM0:1788 4F               ld   c,a
ROM0:1789 13               inc  de
ROM0:178A 7A               ld   a,d
ROM0:178B 32               ldd  (hl),a
ROM0:178C 73               ld   (hl),e
ROM0:178D F3               di   
ROM0:178E 3E FF            ld   a,FF
ROM0:1790 A8               xor  b
ROM0:1791 47               ld   b,a
ROM0:1792 F2               ld   a,(ff00+c)
ROM0:1793 A0               and  b
ROM0:1794 E2               ld   (ff00+c),a
ROM0:1795 E1               pop  hl
ROM0:1796 D1               pop  de
ROM0:1797 C1               pop  bc
ROM0:1798 F1               pop  af
ROM0:1799 D9               reti 
ROM0:179A C9               ret

Check if(card_id == 365)

  • 0x1CEF-0x1CFF - Returns 1 if (card_id == 365), 0 otherwise
ROM0:1CEF D5               push de
ROM0:1CF0 1E 00            ld   e,00
ROM0:1CF2 78               ld   a,b
ROM0:1CF3 FE 01            cp   a,01
ROM0:1CF5 20 06            jr   nz,1CFD
ROM0:1CF7 79               ld   a,c
ROM0:1CF8 FE 6D            cp   a,6D
ROM0:1CFA 20 01            jr   nz,1CFD
ROM0:1CFC 1C               inc  e
ROM0:1CFD 7B               ld   a,e
ROM0:1CFE D1               pop  de
ROM0:1CFF C9               ret

Check if is equal

  • 0x1D00-0x1D0E - Returns 0 if bc == de, 1 otherwise
ROM0:1D00 E5               push hl
ROM0:1D01 2E 01            ld   l,01
ROM0:1D03 78               ld   a,b
ROM0:1D04 BA               cp   d
ROM0:1D05 20 05            jr   nz,1D0C
ROM0:1D07 79               ld   a,c
ROM0:1D08 BB               cp   e
ROM0:1D09 20 01            jr   nz,1D0C
ROM0:1D0B 2D               dec  l
ROM0:1D0C 7D               ld   a,l
ROM0:1D0D E1               pop  hl
ROM0:1D0E C9               ret  

0:1D0F

ROM0:1D0F C5               push bc
ROM0:1D10 D5               push de
ROM0:1D11 E5               push hl
ROM0:1D12 2E 02            ld   l,02
ROM0:1D14 CD BB 13         call 13BB
ROM0:1D17 7B               ld   a,e
ROM0:1D18 FE 01            cp   a,01
ROM0:1D1A 20 02            jr   nz,1D1E
ROM0:1D1C 2E 01            ld   l,01
ROM0:1D1E 7B               ld   a,e
ROM0:1D1F FE 00            cp   a,00
ROM0:1D21 20 02            jr   nz,1D25
ROM0:1D23 2E 00            ld   l,00
ROM0:1D25 7D               ld   a,l
ROM0:1D26 E1               pop  hl
ROM0:1D27 D1               pop  de
ROM0:1D28 C1               pop  bc
ROM0:1D29 C9               ret

0:1D2A

ROM0:1D2A D5               push de
ROM0:1D2B E5               push hl
ROM0:1D2C 2E 02            ld   l,02
ROM0:1D2E FA F5 CD         ld   a,(CDF5)
ROM0:1D31 EA DC CA         ld   (CADC),a
ROM0:1D34 FA F6 CD         ld   a,(CDF6)
ROM0:1D37 EA DD CA         ld   (CADD),a
ROM0:1D3A FA F7 CD         ld   a,(CDF7)
ROM0:1D3D EA DE CA         ld   (CADE),a
ROM0:1D40 FA F8 CD         ld   a,(CDF8)
ROM0:1D43 EA DF CA         ld   (CADF),a
ROM0:1D46 FA F9 CD         ld   a,(CDF9)
ROM0:1D49 EA E0 CA         ld   (CAE0),a
ROM0:1D4C FA FA CD         ld   a,(CDFA)
ROM0:1D4F EA E1 CA         ld   (CAE1),a
ROM0:1D52 CD DB 13         call 13DB
ROM0:1D55 7B               ld   a,e
ROM0:1D56 FE 01            cp   a,01
ROM0:1D58 20 02            jr   nz,1D5C
ROM0:1D5A 2E 01            ld   l,01
ROM0:1D5C 7B               ld   a,e
ROM0:1D5D FE 00            cp   a,00
ROM0:1D5F 20 02            jr   nz,1D63
ROM0:1D61 2E 00            ld   l,00
ROM0:1D63 7D               ld   a,l
ROM0:1D64 E1               pop  hl
ROM0:1D65 D1               pop  de
ROM0:1D66 C9               ret

PRNG

ROM0:20E2 F5               push af
ROM0:20E3 C5               push bc
ROM0:20E4 D5               push de
ROM0:20E5 FA 9C CE         ld   a,(CE9C)
ROM0:20E8 47               ld   b,a
ROM0:20E9 4F               ld   c,a
ROM0:20EA FA 9B CE         ld   a,(CE9B)
ROM0:20ED CB 19            rr   c
ROM0:20EF 1F               rra  
ROM0:20F0 CB 1A            rr   d
ROM0:20F2 A8               xor  b
ROM0:20F3 CB 12            rl   d
ROM0:20F5 17               rla  
ROM0:20F6 CB 11            rl   c
ROM0:20F8 EA 9C CE         ld   (CE9C),a
ROM0:20FB FA 9A CE         ld   a,(CE9A)
ROM0:20FE EA 9B CE         ld   (CE9B),a
ROM0:2101 FA 99 CE         ld   a,(CE99)
ROM0:2104 EA 9A CE         ld   (CE9A),a
ROM0:2107 79               ld   a,c
ROM0:2108 EA 99 CE         ld   (CE99),a
ROM0:210B EA 9F CE         ld   (CE9F),a
ROM0:210E D1               pop  de
ROM0:210F C1               pop  bc
ROM0:2110 F1               pop  af
ROM0:2111 C9               ret

Pseudo-Random Number

ROM0:2112 F5               push af
ROM0:2113 C5               push bc
ROM0:2114 D5               push de
ROM0:2115 FA 9D CE         ld   a,(CE9D)
ROM0:2118 4F               ld   c,a
ROM0:2119 FA 9E CE         ld   a,(CE9E)
ROM0:211C B9               cp   c
ROM0:211D 20 05            jr   nz,2124
ROM0:211F EA 9F CE         ld   (CE9F),a
ROM0:2122 18 12            jr   2136
ROM0:2124 91               sub  c
ROM0:2125 47               ld   b,a
ROM0:2126 04               inc  b
ROM0:2127 CD E2 20         call 20E2          ;PRNG
ROM0:212A FA 9F CE         ld   a,(CE9F)
ROM0:212D 57               ld   d,a
ROM0:212E CD 47 13         call 1347
ROM0:2131 7B               ld   a,e
ROM0:2132 81               add  c
ROM0:2133 EA 9F CE         ld   (CE9F),a
ROM0:2136 D1               pop  de
ROM0:2137 C1               pop  bc
ROM0:2138 F1               pop  af
ROM0:2139 C9               ret

0:23F7

ROM0:23F7 FA 00 CE         ld   a,(CE00)
ROM0:23FA FE 01            cp   a,01
ROM0:23FC 20 0E            jr   nz,240C
ROM0:23FE FA 02 CF         ld   a,(CF02)
ROM0:2401 FE 02            cp   a,02
ROM0:2403 20 03            jr   nz,2408
ROM0:2405 AF               xor  a
ROM0:2406 18 02            jr   240A
ROM0:2408 3E 01            ld   a,01
ROM0:240A 18 28            jr   2434
ROM0:240C FA 02 CF         ld   a,(CF02)
ROM0:240F FE 03            cp   a,03
ROM0:2411 20 04            jr   nz,2417
ROM0:2413 3E 01            ld   a,01
ROM0:2415 18 1D            jr   2434
ROM0:2417 FA 02 CF         ld   a,(CF02)
ROM0:241A FE 02            cp   a,02
ROM0:241C 20 03            jr   nz,2421
ROM0:241E AF               xor  a
ROM0:241F 18 13            jr   2434
ROM0:2421 FA 03 CF         ld   a,(CF03)
ROM0:2424 FE 03            cp   a,03
ROM0:2426 20 03            jr   nz,242B
ROM0:2428 AF               xor  a
ROM0:2429 18 09            jr   2434
ROM0:242B FA 03 CF         ld   a,(CF03)
ROM0:242E FE 03            cp   a,03
ROM0:2430 20 02            jr   nz,2434
ROM0:2432 3E 01            ld   a,01
ROM0:2434 C9               ret

0:265B

ROM0:265B F5               push af
ROM0:265C C5               push bc
ROM0:265D FA 19 CF         ld   a,(CF19)
ROM0:2660 CF               rst  08
ROM0:2661 25               dec  h
ROM0:2662 03               inc  bc
ROM0:2663 C1               pop  bc
ROM0:2664 F1               pop  af
ROM0:2665 C9               ret  

Starter deck routine

ROM0:2666 CD 70 26         call 2670          ;Starter Deck - 33 random cards
ROM0:2669 CD 74 27         call 2774          ;Starter Deck - 7 fixed cards
ROM0:266C CD A9 27         call 27A9
ROM0:266F C9               ret

Starter Deck - 33 random cards

ROM0:2670 F5               push af
ROM0:2671 C5               push bc
ROM0:2672 D5               push de
ROM0:2673 E5               push hl
ROM0:2674 3E 00            ld   a,00
ROM0:2676 EA 9D CE         ld   (CE9D),a
ROM0:2679 3E 63            ld   a,63
ROM0:267B EA 9E CE         ld   (CE9E),a      ;PRN[0;99]
ROM0:267E 1E 00            ld   e,00
ROM0:2680 D5               push de
ROM0:2681 16 00            ld   d,00
ROM0:2683 CD 12 21         call 2112          ;Pseudo-Random Number
ROM0:2686 FA 9F CE         ld   a,(CE9F)
ROM0:2689 5F               ld   e,a
ROM0:268A CB 23            sla  e
ROM0:268C 21 AC 26         ld   hl,26AC       ;pointer to the random card pool
ROM0:268F 19               add  hl,de
ROM0:2690 D1               pop  de
ROM0:2691 2A               ldi  a,(hl)
ROM0:2692 46               ld   b,(hl)
ROM0:2693 4F               ld   c,a           ;bc = card_id
ROM0:2694 7B               ld   a,e
ROM0:2695 CF               rst  08
          61 03
ROM0:2698 CF               rst  08
          63 03
ROM0:269B CF               rst  08
          11 01
ROM0:269E CF               rst  08
          43 01         => Set card as visible in trunk
ROM0:26A1 1C               inc e
ROM0:26A2 7B               ld a,e
ROM0:26A3 FE 21            cp   a,21
ROM0:26A5 20 D9            jr   nz,2680       ;loop 33 times
ROM0:26A7 E1               pop  hl
ROM0:26A8 D1               pop  de
ROM0:26A9 C1               pop  bc
ROM0:26AA F1               pop  af
ROM0:26AB C9               ret

Starter Deck - Random card pool

ROM0:26AC
04 00 - Ryu-Kishin
07 00 - Mushroom Man
08 00 - Shadow Specter
17 00 - Skull Servant
1C 00 - Mountain Warrior
2C 00 - Oscillo Hero #2
2F 00 - Sangan
39 00 - Kuriboh
4A 00 - Man-Eating Plant
64 00 - Wings of Wicked Flame
65 00 - Mask of Darkness
68 00 - Tomozaurus
6A 00 - Kageningen
7A 00 - Dark Plant
80 00 - Nemuriko
81 00 - Weather Control
85 00 - Mystical Capture Chain
8A 00 - Blue-Eyed Silver Zombie
8B 00 - Toad Master
8D 00 - Flame Manipulator
8E 00 - Chronolord
8F 00 - Wind Djinn
90 00 - Phantom Thief
92 00 - Monster Egg
93 00 - Sinister Shadow
97 00 - The Melting Red Shadow
99 00 - Fire Reaper
9A 00 - Larvas
9C 00 - Firegrass
9D 00 - Man Eater
9E 00 - Dig Beak
9F 00 - M-warrior #1
A0 00 - M-warrior #2
A6 00 - Ancient Jar
AC 00 - Dark Prisoner
AD 00 - Hurricail
AF 00 - Fire Eye
B0 00 - Monsturtle
B2 00 - Phantom Dewan
B3 00 - Arlownay
B4 00 - Dark Shade
B5 00 - Masked Clown
B6 00 - Lucky Trinket
B7 00 - Genin
B8 00 - Eyearmor
BA 00 - Gate Deeg
BB 00 - Synchar
BC 00 - Fusionist
BD 00 - Akakieisu
BE 00 - LaLa Li-oon
BF 00 - Key Mace
C0 00 - Turtle Tiger
C1 00 - Terra the Terrible
C2 00 - Doron
C3 00 - Arma Knight
C4 00 - Mech Mole Zombie
C5 00 - Happy Lover
C6 00 - Penguin Knight
C7 00 - Petit Dragon
C9 00 - Air Marmot of Nefa
CA 00 - Phantom Ghost
CC 00 - Dorover
CD 00 - Twin Long Rods #1
CE 00 - Droll Bird
CF 00 - Petit Angel
D0 00 - Winged Cleaver
D1 00 - Hinotama Soul
D2 00 - Kaminarikozou
D3 00 - Meotoko
D5 00 - B. Flame Kagemusha
D6 00 - Flame Ghost
D9 00 - Two-mouth Darkrule
DD 00 - Midnight Fiend
E1 00 - Skull Stalker
E2 00 - Hitodenchak
E3 00 - Wood Remains
E4 00 - Hourglass of Life
E7 00 - Madjinn Gunn
EC 00 - Haniwa
ED 00 - Yashinoki
EE 00 - Vishwar Randi
EF 00 - The Drdek
F1 00 - Candle of Destiny
F2 00 - Water Element
F3 00 - Dissolverock
F4 00 - Meda Bat
F6 00 - Root Water
FC 00 - Angelwitch
FD 00 - Embryonic Beast
04 01 - Wicked Mirror
0B 01 - Sectarian of Secrets
0E 01 - Megirus Light
13 01 - Ray & Temperature
16 01 - King Fog
19 01 - Mystical Sheep #2
1C 01 - Serpent Marauder
20 01 - Change Slime
23 01 - Psychic Kappa
29 01 - Wicked Dragon with the Ersatz Head
2B 01 - Kurama

Starter Deck - 7 fixed cards

ROM0:2774 F5               push af
ROM0:2775 C5               push bc
ROM0:2776 D5               push de
ROM0:2777 E5               push hl
ROM0:2778 1E 21            ld   e,21
ROM0:277A 21 9B 27         ld   hl,279B     ;hl = pointer to Fixed cards list
ROM0:277D 7B               ld   a,e
ROM0:277E FE 28            cp   a,28
ROM0:2780 30 14            jr   nc,2796     ;if the Starter Deck has 40 cards, exit this function
ROM0:2782 7B               ld   a,e
ROM0:2783 CF               rst  08
          61 03
ROM0:2786 2A               ldi  a,(hl)
ROM0:2787 4F               ld   c,a
ROM0:2788 2A               ldi  a,(hl)
ROM0:2789 47               ld   b,a         ;bc = card_id
ROM0:278A CF               rst  08
          63 03
ROM0:278D CF               rst  08
          11 01
ROM0:2790 CF               rst  08
          43 01         => Set card as visible in trunk
ROM0:2793 1C               inc e            ;e++
ROM0:2794 18 E7            jr 277D          ;loop to 0:277D
ROM0:2796 E1               pop  hl
ROM0:2797 D1               pop  de
ROM0:2798 C1               pop  bc
ROM0:2799 F1               pop  af
ROM0:279A C9               ret  

Starter Deck - Fixed cards list

ROM0:279B
50 01 - Raigeki
56 01 - Sparks
56 01 - Sparks
57 01 - Hinotama
51 01 - Mooyan Curry
52 01 - Red Medicine
5D 01 - Dark-Piercing Light

0:27A9

ROM0:27A9 F5               push af
ROM0:27AA C5               push bc
ROM0:27AB D5               push de
ROM0:27AC E5               push hl
ROM0:27AD 3E 00            ld   a,00
ROM0:27AF EA 9D CE         ld   (CE9D),a
ROM0:27B2 3E FF            ld   a,FF
ROM0:27B4 EA 9E CE         ld   (CE9E),a
ROM0:27B7 CD 12 21         call 2112          ;Pseudo-Random Number
ROM0:27BA FA 9F CE         ld   a,(CE9F)
ROM0:27BD 5F               ld   e,a
ROM0:27BE 3E 00            ld   a,00
ROM0:27C0 EA 9D CE         ld   (CE9D),a
ROM0:27C3 3E 07            ld   a,07
ROM0:27C5 EA 9E CE         ld   (CE9E),a
ROM0:27C8 CD 12 21         call 2112          ;Pseudo-Random Number
ROM0:27CB FA 9F CE         ld   a,(CE9F)
ROM0:27CE 57               ld   d,a
ROM0:27CF 7A               ld   a,d
ROM0:27D0 FE 01            cp   a,01
ROM0:27D2 20 1E            jr   nz,27F2
ROM0:27D4 7B               ld   a,e
ROM0:27D5 FE 03            cp   a,03
ROM0:27D7 20 0B            jr   nz,27E4
ROM0:27D9 01 25 00         ld   bc,0025
ROM0:27DC CF               rst  08
          11 01
ROM0:27DF CF               rst  08
          41 01
ROM0:27E2 18 0E            jr   27F2 
ROM0:27E4 7B               ld   a,e
ROM0:27E5 FE 0E            cp   a,0E
ROM0:27E7 20 09            jr   nz,27F2
ROM0:27E9 01 22 00         ld   bc,0022
ROM0:27EC CF               rst  08
          11 01
ROM0:27EF CF               rst  08
          41 01
ROM0:27F2 E1               pop  hl
ROM0:27F3 D1               pop  de
ROM0:27F4 C1               pop  bc
ROM0:27F5 F1               pop  af
ROM0:27F6 C9               ret  

0:29F1 (to document)

ROM0:29F1 F5               push af
ROM0:29F2 C5               push bc
ROM0:29F3 D5               push de
ROM0:29F4 E5               push hl
ROM0:29F5 CF               rst  08

0:29F8 (pop registers, ret)

ROM0:29F8 E1               pop  hl
ROM0:29F9 D1               pop  de
ROM0:29FA C1               pop  bc
ROM0:29FB F1               pop  af
ROM0:29FC C9               ret

0:2B26 (to document, called by Password #3))

ROM0:2B26 F5               push af
ROM0:2B27 3E 9D            ld   a,9D
ROM0:2B29 CD F1 29         call 29F1
ROM0:2B2C CD 74 0F         call 0F74
ROM0:2B2F F1               pop  af
ROM0:2B30 C9               ret

0:2B7E (to document))

ROM0:2B7E F5               push af
ROM0:2B7F 3E A1            ld   a,A1
ROM0:2B81 CD F1 29         call 29F1
ROM0:2B84 CD 74 0F         call 0F74
ROM0:2B87 F1               pop  af
ROM0:2B88 C9               ret

Bank 1

rst 08 pointers

  • 0x4002 - pointers to subroutines to call after a rst 08
ROM1:4002
6840
1F55
CB5A
485C
925B
E056
865C
F25A
805B
B85B
D15B
105C
C542	;1:42C5 => Update value to display in Battle screen
D042	;1:42D0 => Update wCAB8
EC42	;1:42EC => Jump to damage handling subroutines ?
1353
B35E
375F
795F
0860
1560
F25F
BB5F
F55E

1:4110 (calls 42C5 which seems to handle display of decreasing LPs during direct damage))

ROM1:4110 F5               push af
ROM1:4111 C5               push bc
ROM1:4112 D5               push de
ROM1:4113 E5               push hl
ROM1:4114 3E 00            ld   a,00
ROM1:4116 CD D0 42         call 42D0
ROM1:4119 FA B0 CA         ld   a,(CAB0)
ROM1:411C 4F               ld   c,a
ROM1:411D FA B1 CA         ld   a,(CAB1)
ROM1:4120 47               ld   b,a
ROM1:4121 CD C5 42         call 42C5		;Update value to display in Battle screen
ROM1:4124 CD EC 42         call 42EC
ROM1:4127 21 05 9A         ld   hl,9A05
ROM1:412A 11 B9 CA         ld   de,CAB9
ROM1:412D 0E 04            ld   c,04
ROM1:412F 1A               ld   a,(de)
ROM1:4130 22               ldi  (hl),a
ROM1:4131 13               inc  de
ROM1:4132 0D               dec  c
ROM1:4133 20 FA            jr   nz,412F
ROM1:4135 E1               pop  hl
ROM1:4136 D1               pop  de
ROM1:4137 C1               pop  bc
ROM1:4138 F1               pop  af
ROM1:4139 C9               ret

Update value to display in Battle screen

ROM1:42C5 F5               push af
ROM1:42C6 79               ld   a,c
ROM1:42C7 EA B6 CA         ld   (CAB6),a
ROM1:42CA 78               ld   a,b
ROM1:42CB EA B7 CA         ld   (CAB7),a
ROM1:42CE F1               pop  af
ROM1:42CF C9               ret  

Update wCAB8

ROM1:42D0 EA B8 CA         ld   (CAB8),a
ROM1:42D3 C9               ret

00s wCAB9 to wCACD

ROM1:42D4 F5               push af
ROM1:42D5 C5               push bc
ROM1:42D6 D5               push de
ROM1:42D7 E5               push hl
ROM1:42D8 21 B9 CA         ld   hl,CAB9
ROM1:42DB AF               xor  a		;a = 0
ROM1:42DC 0E 14            ld   c,14
ROM1:42DE 22               ldi  (hl),a		;00s wCAB9 to wCACD
ROM1:42DF 0D               dec  c
ROM1:42E0 20 FC            jr   nz,42DE		;Loop 20 times
ROM1:42E2 3E 00            ld   a,00		;xor a would've been faster, but register a is already equal to 0 anyway
ROM1:42E4 EA CD CA         ld   (CACD),a	;WTF
ROM1:42E7 E1               pop  hl
ROM1:42E8 D1               pop  de
ROM1:42E9 C1               pop  bc
ROM1:42EA F1               pop  af
ROM1:42EB C9               ret

Jump to damage handling subroutines ?

ROM1:42EC F5               push af
ROM1:42ED C5               push bc
ROM1:42EE E5               push hl
ROM1:42EF 06 00            ld   b,00
ROM1:42F1 FA B8 CA         ld   a,(CAB8)
ROM1:42F4 4F               ld   c,a
ROM1:42F5 21 05 43         ld   hl,4305
ROM1:42F8 09               add  hl,bc
ROM1:42F9 2A               ldi  a,(hl)
ROM1:42FA 66               ld   h,(hl)
ROM1:42FB 6F               ld   l,a		;hl = 0x4305 + (CAB8), which determines which subroutine to call
ROM1:42FC 01 01 43         ld   bc,4301		;return address
ROM1:42FF C5               push bc
ROM1:4300 E9               jp   hl		;jump to the selected subroutine
ROM1:4301 E1               pop  hl
ROM1:4302 C1               pop  bc
ROM1:4303 F1               pop  af
ROM1:4304 C9               ret

Function pointers

  • 0x4305-0x4318 - Function pointers
19 43
7B 43
D4 43 - Read selected card's name
A5 52
D8 52
5C 43
24 53
6D 53
36 54
EF 54

1:4319

ROM1:4319 F5               push af
ROM1:431A C5               push bc
ROM1:431B D5               push de
ROM1:431C E5               push hl
ROM1:431D CD D4 42         call 42D4
ROM1:4320 21 B9 CA         ld   hl,CAB9
ROM1:4323 11 B7 CA         ld   de,CAB7
ROM1:4326 06 01            ld   b,01
ROM1:4328 0E 02            ld   c,02
ROM1:432A 1A               ld   a,(de)
ROM1:432B D5               push de
ROM1:432C 16 02            ld   d,02
ROM1:432E CB 37            swap a
ROM1:4330 F5               push af
ROM1:4331 E6 0F            and  a,0F
ROM1:4333 28 06            jr   z,433B
ROM1:4335 C6 01            add  a,01
ROM1:4337 77               ld   (hl),a
ROM1:4338 04               inc  b
ROM1:4339 18 07            jr   4342
ROM1:433B 78               ld   a,b
ROM1:433C FE 01            cp   a,01
ROM1:433E 28 02            jr   z,4342
ROM1:4340 36 01            ld   (hl),01
ROM1:4342 2C               inc  l
ROM1:4343 F1               pop  af
ROM1:4344 15               dec  d
ROM1:4345 20 E7            jr   nz,432E
ROM1:4347 D1               pop  de
ROM1:4348 1B               dec  de
ROM1:4349 0D               dec  c
ROM1:434A 20 DE            jr   nz,432A
ROM1:434C 05               dec  b
ROM1:434D 20 03            jr   nz,4352
ROM1:434F 2D               dec  l
ROM1:4350 36 01            ld   (hl),01
ROM1:4352 3E 04            ld   a,04
ROM1:4354 EA CD CA         ld   (CACD),a
ROM1:4357 E1               pop  hl
ROM1:4358 D1               pop  de
ROM1:4359 C1               pop  bc
ROM1:435A F1               pop  af
ROM1:435B C9               ret  

1:435C

ROM1:435C F5               push af
ROM1:435D C5               push bc
ROM1:435E E5               push hl
ROM1:435F CD 19 43         call 4319
ROM1:4362 21 B9 CA         ld   hl,CAB9
ROM1:4365 0E 04            ld   c,04
ROM1:4367 7E               ld   a,(hl)
ROM1:4368 FE 00            cp   a,00
ROM1:436A 28 05            jr   z,4371
ROM1:436C C6 C5            add  a,C5
ROM1:436E 77               ld   (hl),a
ROM1:436F 18 02            jr   4373
ROM1:4371 36 80            ld   (hl),80
ROM1:4373 23               inc  hl
ROM1:4374 0D               dec  c
ROM1:4375 20 F0            jr   nz,4367
ROM1:4377 E1               pop  hl
ROM1:4378 C1               pop  bc
ROM1:4379 F1               pop  af
ROM1:437A C9               ret  

Copy array of 8 bytes from 0x439C + (wCAB6 × 8), and paste it to wCAB9

ROM1:437B F5               push af
ROM1:437C C5               push bc
ROM1:437D D5               push de
ROM1:437E E5               push hl
ROM1:437F 11 9C 43         ld   de,439C
ROM1:4382 26 00            ld   h,00
ROM1:4384 FA B6 CA         ld   a,(CAB6)	;wCAB6 : Next value to display in Battle screen
ROM1:4387 6F               ld   l,a
ROM1:4388 29               add  hl,hl
ROM1:4389 29               add  hl,hl
ROM1:438A 29               add  hl,hl		;hl × 8
ROM1:438B 19               add  hl,de		;hl = 0x439C + (wCAB6 × 8)
ROM1:438C 11 B9 CA         ld   de,CAB9		;start pasting at wCAB9
ROM1:438F 0E 08            ld   c,08
ROM1:4391 2A               ldi  a,(hl)
ROM1:4392 12               ld   (de),a		;(de) = (hl)
ROM1:4393 13               inc  de
ROM1:4394 0D               dec  c
ROM1:4395 20 FA            jr   nz,4391		;loop 8 times
ROM1:4397 E1               pop  hl
ROM1:4398 D1               pop  de
ROM1:4399 C1               pop  bc
ROM1:439A F1               pop  af
ROM1:439B C9               ret

Field names

  • 0x439C-0x43D3 - Field names (left-padded with spaces to 8 bytes)
00 10 12 1E 0D 84 3C 0D - かくとうじょう (kakutōjyou fighting field)
00 00 00 00 00 00 2D 32 - もり (Forest)
00 00 00 00 00 14 0D 2E - こうや (Wasteland)
00 00 00 00 00 00 2E 29 - やま (Mountain)
00 00 00 00 19 0D 81 38 - そうげん (Sogen)
00 00 00 00 00 00 0D 2A - うみ (Umi)
00 00 00 00 00 00 2E 2A - やみ (Yami)

Read selected card's name

  • 0x43D4-0x440E - Read selected card's name
ROM1:43D4 F5               push af
ROM1:43D5 C5               push bc
ROM1:43D6 D5               push de
ROM1:43D7 E5               push hl
ROM1:43D8 CD D4 42         call 42D4
ROM1:43DB 11 0F 44         ld   de,440F
ROM1:43DE FA B6 CA         ld   a,(CAB6)
ROM1:43E1 6F               ld   l,a
ROM1:43E2 FA B7 CA         ld   a,(CAB7)
ROM1:43E5 67               ld   h,a
ROM1:43E6 29               add  hl,hl
ROM1:43E7 44               ld   b,h
ROM1:43E8 4D               ld   c,l
ROM1:43E9 19               add  hl,de		// hl = Pointer to card name pointer
ROM1:43EA 2A               ldi  a,(hl)
ROM1:43EB 66               ld   h,(hl)
ROM1:43EC 6F               ld   l,a
ROM1:43ED E5               push hl
ROM1:43EE 03               inc  bc
ROM1:43EF 03               inc  bc
ROM1:43F0 60               ld   h,b
ROM1:43F1 69               ld   l,c
ROM1:43F2 19               add  hl,de
ROM1:43F3 2A               ldi  a,(hl)
ROM1:43F4 46               ld   b,(hl)
ROM1:43F5 4F               ld   c,a
ROM1:43F6 E1               pop  hl
ROM1:43F7 11 B9 CA         ld   de,CAB9
ROM1:43FA 06 00            ld   b,00
ROM1:43FC 79               ld   a,c
ROM1:43FD BD               cp   l
ROM1:43FE 28 06            jr   z,4406
ROM1:4400 2A               ldi  a,(hl)
ROM1:4401 12               ld   (de),a
ROM1:4402 13               inc  de
ROM1:4403 04               inc  b
ROM1:4404 18 F6            jr   43FC
ROM1:4406 78               ld   a,b
ROM1:4407 EA CD CA         ld   (CACD),a
ROM1:440A E1               pop  hl
ROM1:440B D1               pop  de
ROM1:440C C1               pop  bc
ROM1:440D F1               pop  af
ROM1:440E C9               ret

Card names pointers

  • 0x440F-0x46EC - Card names pointers

Card names

  • 0x46ED-0x5292 - Card names

Write card_id to wCAE2

  • 0x5AF2-0x5B03 - Write card_id to wCAE2
ROM1:5AF2 F5               push af
ROM1:5AF3 CD EF 1C         call 1CEF         ;check if(card_id == 365)
ROM1:5AF6 FE 00            cp   a,00
ROM1:5AF8 20 08            jr   nz,5B02      ;if(card_id == 365), exit this function
ROM1:5AFA 79               ld   a,c
ROM1:5AFB EA E2 CA         ld   (CAE2),a
ROM1:5AFE 78               ld   a,b
ROM1:5AFF EA E3 CA         ld   (CAE3),a     ;write card_id to wCAE2
ROM1:5B02 F1               pop  af
ROM1:5B03 C9               ret

Add card to trunk

  • 0x5B04-0x5B28 - Add card to trunk
ROM1:5B04 F5               push af
ROM1:5B05 C5               push bc
ROM1:5B06 E5               push hl
ROM1:5B07 CD 80 5B         call 5B80         ;a = card_quantity
ROM1:5B0A FE FF            cp   a,FF
ROM1:5B0C 20 04            jr   nz,5B12      ;if the card is already visible in trunk, jump to 1:5B12
ROM1:5B0E AF               xor  a
ROM1:5B0F CD 6C 5B         call 5B6C         ;set card_quantity to 0
ROM1:5B12 FA E2 CA         ld   a,(CAE2)
ROM1:5B15 4F               ld   c,a
ROM1:5B16 FA E3 CA         ld   a,(CAE3)
ROM1:5B19 47               ld   b,a          ;bc = card_id
ROM1:5B1A 21 E4 CA         ld   hl,CAE4
ROM1:5B1D 09               add  hl,bc
ROM1:5B1E 7E               ld   a,(hl)       ;a = card_id_quantity
ROM1:5B1F FE 63            cp   a,63
ROM1:5B21 28 02            jr   z,5B25       ;if there is already 99 copies of the card, exit this function
ROM1:5B23 3C               inc  a            ;card_quantity ++
ROM1:5B24 77               ld   (hl),a       ;store new card quantity
ROM1:5B25 E1               pop  hl
ROM1:5B26 C1               pop  bc
ROM1:5B27 F1               pop  af
ROM1:5B28 C9               ret

1:5B29

  • 0x5B29-0x5B51 -
ROM1:5B29 C5               push bc
ROM1:5B2A D5               push de
ROM1:5B2B E5               push hl
ROM1:5B2C 16 00            ld   d,00
ROM1:5B2E FA E2 CA         ld   a,(CAE2)
ROM1:5B31 4F               ld   c,a
ROM1:5B32 FA E3 CA         ld   a,(CAE3)
ROM1:5B35 47               ld   b,a
ROM1:5B36 21 E4 CA         ld   hl,CAE4
ROM1:5B39 09               add  hl,bc
ROM1:5B3A 7E               ld   a,(hl)
ROM1:5B3B FE 00            cp   a,00
ROM1:5B3D 20 04            jr   nz,5B43
ROM1:5B3F 16 01            ld   d,01
ROM1:5B41 18 0A            jr   5B4D
ROM1:5B43 FE FF            cp   a,FF
ROM1:5B45 20 04            jr   nz,5B4B
ROM1:5B47 16 01            ld   d,01
ROM1:5B49 18 02            jr   5B4D
ROM1:5B4B 3D               dec  a
ROM1:5B4C 77               ld   (hl),a
ROM1:5B4D 7A               ld   a,d
ROM1:5B4E E1               pop  hl
ROM1:5B4F D1               pop  de
ROM1:5B50 C1               pop  bc
ROM1:5B51 C9               ret  

Set card as visible in trunk

  • 0x5B52-0x5B6B - Set card as visible in trunk
ROM1:5B52 F5               push af
ROM1:5B53 C5               push bc
ROM1:5B54 E5               push hl
ROM1:5B55 FA E2 CA         ld   a,(CAE2)
ROM1:5B58 4F               ld   c,a
ROM1:5B59 FA E3 CA         ld   a,(CAE3)
ROM1:5B5C 47               ld   b,a          ;bc = card_id
ROM1:5B5D 21 E4 CA         ld   hl,CAE4
ROM1:5B60 09               add  hl,bc
ROM1:5B61 7E               ld   a,(hl)       ;a = card_id_quantity
ROM1:5B62 FE FF            cp   a,FF
ROM1:5B64 20 02            jr   nz,5B68      ;if the card is already visible in trunk, exit this function
ROM1:5B66 36 00            ld   (hl),00      ;else set card as visible in trunk
ROM1:5B68 E1               pop  hl
ROM1:5B69 C1               pop  bc
ROM1:5B6A F1               pop  af
ROM1:5B6B C9               ret  

Set card quantity

  • 0x5B6C-0x5B7F - Set card quantity
ROM1:5B6C C5               push bc
ROM1:5B6D E5               push hl
ROM1:5B6E F5               push af
ROM1:5B6F FA E2 CA         ld   a,(CAE2)
ROM1:5B72 4F               ld   c,a
ROM1:5B73 FA E3 CA         ld   a,(CAE3)
ROM1:5B76 47               ld   b,a          ;bc = card_id
ROM1:5B77 21 E4 CA         ld   hl,CAE4
ROM1:5B7A 09               add  hl,bc        ;pointer to card_id_quantity
ROM1:5B7B F1               pop  af
ROM1:5B7C 77               ld   (hl),a       ;store new card_id_quantity in (hl)
ROM1:5B7D E1               pop  hl
ROM1:5B7E C1               pop  bc
ROM1:5B7F C9               ret

Retrieve card quantity

  • 0x5B80-0x5B91 - Retrieve card quantity
ROM1:5B80 C5               push bc
ROM1:5B81 E5               push hl
ROM1:5B82 FA E2 CA         ld   a,(CAE2)
ROM1:5B85 4F               ld   c,a
ROM1:5B86 FA E3 CA         ld   a,(CAE3)
ROM1:5B89 47               ld   b,a          ;bc = card_id
ROM1:5B8A 21 E4 CA         ld   hl,CAE4
ROM1:5B8D 09               add  hl,bc
ROM1:5B8E 7E               ld   a,(hl)       ;a = card_id_quantity
ROM1:5B8F E1               pop  hl
ROM1:5B90 C1               pop  bc
ROM1:5B91 C9               ret

1:5B92

0x5B92-0x5BB7 -

ROM1:5B92 C5               push bc
ROM1:5B93 D5               push de
ROM1:5B94 1E 01            ld   e,01
ROM1:5B96 FA E2 CA         ld   a,(CAE2)
ROM1:5B99 4F               ld   c,a
ROM1:5B9A FA E3 CA         ld   a,(CAE3)
ROM1:5B9D 47               ld   b,a
ROM1:5B9E C5               push bc
ROM1:5B9F CF               rst  08
          1D 03
ROM1:5BA2 78               ld   a,b
ROM1:5BA3 C1               pop  bc
ROM1:5BA4 FE 00            cp   a,00
ROM1:5BA6 20 0C            jr   nz,5BB4
ROM1:5BA8 CD 29 5B         call 5B29
ROM1:5BAB FE 00            cp   a,00
ROM1:5BAD 20 05            jr   nz,5BB4
ROM1:5BAF CF               rst  08
          1B 03
ROM1:5BB2 1E 00            ld   e,00
ROM1:5BB4 7B               ld   a,e
ROM1:5BB5 D1               pop  de
ROM1:5BB6 C1               pop  bc
ROM1:5BB7 C9               ret  

Graphics 1

  • 0x630B-0x63CA - Menu cursors (star, left/right arrows)
  • 0x6675-0x6734 - Menu cursors (plain down arrow, left/right arrows (repeated))
  • 0x68F4-0x69B3 - Menu cursors (small right arrow x 4, left/right arrows (repeated))
  • 0x6AED-0x6BAC - Menu cursors (small right arrow x 4 (repeated), left/right arrows (repeated))
  • 0x6CE6-0x6DA5 - Menu cursors (small right arrow (repeated), 3 blank tiles, left/right arrows (repeated))

Bank 2

Graphics 2

  • 0x80D9 - 0x84C0 - Text table (1bpp; stored tiled instead of linear)
  • 0x880D - 0x883C - Misc tiles/sprites (inverted blank/solid black, inverted small right arrow, inverted folded paper/continue dialog icon)
  • 0x8CAC - 0xB52B - CPU opponents eyes + mouths animations

2:7711

ROM2:7711 F5               push af
ROM2:7712 3E 06            ld   a,06
ROM2:7714 EA 50 CD         ld   (CD50),a
ROM2:7717 3E 00            ld   a,00
ROM2:7719 EA 51 CD         ld   (CD51),a
ROM2:771C CF               rst  08
ROM2:771D 03               inc  bc
ROM2:771E 06 CD            ld   b,CD
ROM2:7720 4A               ld   c,d
ROM2:7721 48               ld   c,b
ROM2:7722 F1               pop  af
ROM2:7723 C9               ret  

duelist_id handling

Return duelist_id drops pointer

ROM2:7724 C5               push bc
ROM2:7725 E5               push hl
ROM2:7726 06 00            ld   b,00
ROM2:7728 FA EF CE         ld   a,(CEEF)    ;a = selected_duelist
ROM2:772B 4F               ld   c,a
ROM2:772C 21 34 77         ld   hl,7734     ;duelist_id drops pointers
ROM2:772F 09               add  hl,bc
ROM2:7730 7E               ld   a,(hl)      ;a = duelist_id
ROM2:7731 E1               pop  hl
ROM2:7732 C1               pop  bc
ROM2:7733 C9               ret  

duelist_id drops pointers

ROM2:7734
00 - Weevil Underwood
01 - Mai Valentine
02 - Rex Raptor
03 - Mako Tsunami
08 - Seto Kaiba
09 - Mokuba Kaiba
0C - Puppeteer of Doom
0D - PaniK
0E - Bandit Keith
05 - Yugi Muto
0A - Tristan Taylor
07 - Joey Wheeler
0B - Ryou Bakura
10 - Simon Muran
0F - Maximillion Pegasus
04 - Yami Yugi

2:7744

ROM2:7744 C5               push bc
ROM2:7745 E5               push hl
ROM2:7746 06 00            ld   b,00
ROM2:7748 FA EF CE         ld   a,(CEEF)     ;a = selected_duelist
ROM2:774B CD CD 28         call 28CD
ROM2:774E 21 79 77         ld   hl,7779
ROM2:7751 79               ld   a,c
ROM2:7752 FE 00            cp   a,00
ROM2:7754 20 08            jr   nz,775E
ROM2:7756 78               ld   a,b
ROM2:7757 FE 00            cp   a,00
ROM2:7759 20 03            jr   nz,775E
ROM2:775B 21 69 77         ld   hl,7769
ROM2:775E 06 00            ld   b,00
ROM2:7760 FA EF CE         ld   a,(CEEF)     ;a = selected_duelist
ROM2:7763 4F               ld   c,a
ROM2:7764 09               add  hl,bc
ROM2:7765 7E               ld   a,(hl)
ROM2:7766 E1               pop  hl
ROM2:7767 C1               pop  bc
ROM2:7768 C9               ret

2:7769 (array of duelists ?)

ROM2:7769
01 02 03 04 08 09 0C 0D 0E 06 0A 07 0B 10 0F 05
11 12 13 14 18 19 1C 1D 1E 16 1A 17 1B 20 1F 15

Bank 3

3:410E (set (CAD1) to accumulator)

ROM3:410E EA D1 CA         ld   (CAD1),a
ROM3:4111 C9               ret  

3:4112 (set (CAD1) to 1)

ROM3:4112 F5               push af
ROM3:4113 3E 01            ld   a,01
ROM3:4115 CD 0E 41         call 410E		// set (CAD1) to 1
ROM3:4118 F1               pop  af
ROM3:4119 C9               ret  

3:411A (set (CAD1) to 2)

ROM3:411A F5               push af
ROM3:411B 3E 02            ld   a,02
ROM3:411D CD 0E 41         call 410E		// set (CAD1) to 2
ROM3:4120 F1               pop  af
ROM3:4121 C9               ret  

3:4122 (set (CAD1) to 3)

ROM3:4122 F5               push af
ROM3:4123 3E 03            ld   a,03
ROM3:4125 CD 0E 41         call 410E		// set (CAD1) to 3
ROM3:4128 F1               pop  af
ROM3:4129 C9               ret  

3:412A (set (CAD1) to 4)

ROM3:412A F5               push af
ROM3:412B 3E 04            ld   a,04
ROM3:412D CD 0E 41         call 410E		// set (CAD1) to 4
ROM3:4130 F1               pop  af
ROM3:4131 C9               ret  

3:4132 (set (CAD1) to 5)

ROM3:4132 F5               push af
ROM3:4133 3E 05            ld   a,05
ROM3:4135 CD 0E 41         call 410E		// set (CAD1) to 5
ROM3:4138 F1               pop  af
ROM3:4139 C9               ret  

3:413A (set (CAD1) to 6)

ROM3:413A F5               push af
ROM3:413B 3E 06            ld   a,06
ROM3:413D CD 0E 41         call 410E          ;set (CAD1) to 6
ROM3:4140 F1               pop  af
ROM3:4141 C9               ret

Player's Deck handling

Starter Deck initialization

ROM3:45CC F5               push af
ROM3:45CD C5               push bc
ROM3:45CE D5               push de
ROM3:45CF E5               push hl
ROM3:45D0 3E 00            ld   a,00
ROM3:45D2 EA 5A CC         ld   (CC5A),a     ;wCC5A = 0
ROM3:45D5 21 5B CC         ld   hl,CC5B
ROM3:45D8 0E 28            ld   c,28         ;40 cards
ROM3:45DA 3E 6D            ld   a,6D
ROM3:45DC 22               ldi  (hl),a
ROM3:45DD 3E 01            ld   a,01
ROM3:45DF 22               ldi  (hl),a       ;write 0x16D to Player's Deck
ROM3:45E0 0D               dec  c
ROM3:45E1 20 F7            jr   nz,45DA      ;loop 40 times to 3:45DA
ROM3:45E3 E1               pop  hl
ROM3:45E4 D1               pop  de
ROM3:45E5 C1               pop  bc
ROM3:45E6 F1               pop  af
ROM3:45E7 C9               ret  

3:45E8 (updates wCC5A)

ROM3:45E8 EA 5A CC         ld   (CC5A),a
ROM3:45EB C9               ret

Add card to deck

  • 0xC5EC-0xC603 - Write card_id (bc) to wCC5B + offset (wCC5A)
ROM3:45EC F5               push af
ROM3:45ED C5               push bc
ROM3:45EE D5               push de
ROM3:45EF E5               push hl
ROM3:45F0 16 00            ld   d,00
ROM3:45F2 FA 5A CC         ld   a,(CC5A)     ;current deck slot
ROM3:45F5 5F               ld   e,a
ROM3:45F6 CB 23            sla  e
ROM3:45F8 21 5B CC         ld   hl,CC5B
ROM3:45FB 19               add  hl,de
ROM3:45FC 79               ld   a,c
ROM3:45FD 22               ldi  (hl),a
ROM3:45FE 70               ld   (hl),b
ROM3:45FF E1               pop  hl
ROM3:4600 D1               pop  de
ROM3:4601 C1               pop  bc
ROM3:4602 F1               pop  af
ROM3:4603 C9               ret

CPU's deck handling

Add card to CPU's deck

ROM3:4715 F5               push af
ROM3:4716 E5               push hl
ROM3:4717 C5               push bc
ROM3:4718 06 00            ld   b,00
ROM3:471A FA AB CC         ld   a,(CCAB)     ;current deck slot
ROM3:471D 4F               ld   c,a
ROM3:471E CB 21            sla  c
ROM3:4720 21 AC CC         ld   hl,CCAC
ROM3:4723 09               add  hl,bc        ;deck_slot pointer
ROM3:4724 C1               pop  bc
ROM3:4725 79               ld   a,c
ROM3:4726 22               ldi  (hl),a       ;Store card_id to (wCCAC+deck_slot)
ROM3:4727 70               ld   (hl),b
ROM3:4728 E1               pop  hl
ROM3:4729 F1               pop  af
ROM3:472A C9               ret

Refresh battle display

ROM3:5545 F5               push af
ROM3:5546 C5               push bc
ROM3:5547 E5               push hl
ROM3:5548 FA B0 CA         ld   a,(CAB0)	;P1 Life Points
ROM3:554B 4F               ld   c,a
ROM3:554C FA B1 CA         ld   a,(CAB1)
ROM3:554F 47               ld   b,a
ROM3:5550 CF               rst  08
ROM3:5551 1B               dec  de
ROM3:5552 01 CF 1F         ld   bc,1FCF
ROM3:5555 01 01 05         ld   bc,0501
ROM3:5558 9A               sbc  d
ROM3:5559 CD 3D 0F         call 0F3D		;Store reg bc in wC5(CAAA), and update wCAAA
ROM3:555C 21 B9 CA         ld   hl,CAB9
ROM3:555F 0E 04            ld   c,04
ROM3:5561 2A               ldi  a,(hl)
ROM3:5562 CD 50 0F         call 0F50		;Store reg a in wC5(CAAA), and update wCAAA
ROM3:5565 0D               dec  c
ROM3:5566 20 F9            jr   nz,5561
ROM3:5568 FA B3 CA         ld   a,(CAB3)	;P2 Life Points
ROM3:556B 4F               ld   c,a
ROM3:556C FA B4 CA         ld   a,(CAB4)
ROM3:556F 47               ld   b,a
ROM3:5570 CF               rst  08
           => 1:401B points at 1:42C5 => Update value to display in Battle screen
ROM3:5573 CF
            => 1:401F points at 1:42EC => Jump to damage handling subroutines ?
ROM3:5576 01 25 98         ld   bc,9825
ROM3:5579 CD 3D 0F         call 0F3D		;Store reg bc in wC5(CAAA), and update wCAAA
ROM3:557C 21 B9 CA         ld   hl,CAB9
ROM3:557F 0E 04            ld   c,04
ROM3:5581 2A               ldi  a,(hl)
ROM3:5582 CD 50 0F         call 0F50		;Store reg a in wC5(CAAA), and update wCAAA
ROM3:5585 0D               dec  c
ROM3:5586 20 F9            jr   nz,5581		;Loop 4 times
ROM3:5588 E1               pop  hl
ROM3:5589 C1               pop  bc
ROM3:558A F1               pop  af
ROM3:558B C9               ret

3:6054

ROM3:6054 F5               push af
ROM3:6055 C5               push bc
ROM3:6056 FA 0E CE         ld   a,(CE0E)
ROM3:6059 4F               ld   c,a
ROM3:605A FA 0F CE         ld   a,(CE0F)
ROM3:605D 47               ld   b,a
ROM3:605E CD D1 61         call 61D1
ROM3:6061 FE 02            cp   a,02
ROM3:6063 28 03            jr   z,6068
ROM3:6065 CD 19 61         call 6119
ROM3:6068 C1               pop  bc
ROM3:6069 F1               pop  af
ROM3:606A C9               ret  

3:606B

ROM3:606B F5               push af
ROM3:606C E5               push hl
ROM3:606D 2E 02            ld   l,02
ROM3:606F CD BB 13         call 13BB
ROM3:6072 7B               ld   a,e
ROM3:6073 FE 01            cp   a,01
ROM3:6075 20 02            jr   nz,6079
ROM3:6077 2E 01            ld   l,01
ROM3:6079 7B               ld   a,e
ROM3:607A FE 00            cp   a,00
ROM3:607C 20 08            jr   nz,6086
ROM3:607E 2E 00            ld   l,00
ROM3:6080 11 00 00         ld   de,0000
ROM3:6083 CD BB 13         call 13BB
ROM3:6086 5D               ld   e,l
ROM3:6087 E1               pop  hl
ROM3:6088 F1               pop  af
ROM3:6089 C9               ret  

Store accumulator in wCE01

ROM3:608A EA 01 CE         ld   (CE01),a
ROM3:608D C9               ret  

Copy P1 Life Points to wCE06 and wCED4

ROM3:608E F5               push af
ROM3:608F FA B0 CA         ld   a,(CAB0)
ROM3:6092 EA 06 CE         ld   (CE06),a
ROM3:6095 EA D4 CE         ld   (CED4),a
ROM3:6098 FA B1 CA         ld   a,(CAB1)
ROM3:609B EA 07 CE         ld   (CE07),a
ROM3:609E EA D5 CE         ld   (CED5),a
ROM3:60A1 F1               pop  af
ROM3:60A2 C9               ret

Copy P2 Life Points to wCE08 and wCEDF

ROM3:60A3 F5               push af
ROM3:60A4 FA B3 CA         ld   a,(CAB3)
ROM3:60A7 EA 08 CE         ld   (CE08),a
ROM3:60AA EA DF CE         ld   (CEDF),a
ROM3:60AD FA B4 CA         ld   a,(CAB4)
ROM3:60B0 EA 09 CE         ld   (CE09),a
ROM3:60B3 EA E0 CE         ld   (CEE0),a
ROM3:60B6 F1               pop  af
ROM3:60B7 C9               ret

3:6124 (Damage step - decreasing P2 LPs animation handling ?)

ROM3:6124 F5               push af
ROM3:6125 FA 06 CE         ld   a,(CE06)
ROM3:6128 EA B0 CA         ld   (CAB0),a
ROM3:612B EA D6 CE         ld   (CED6),a
ROM3:612E FA 07 CE         ld   a,(CE07)
ROM3:6131 EA B1 CA         ld   (CAB1),a
ROM3:6134 EA D7 CE         ld   (CED7),a
ROM3:6137 FA 08 CE         ld   a,(CE08)
ROM3:613A EA B3 CA         ld   (CAB3),a
ROM3:613D EA E1 CE         ld   (CEE1),a
ROM3:6140 FA 09 CE         ld   a,(CE09)	;Life Points to decrease
ROM3:6143 EA B4 CA         ld   (CAB4),a	;P2 Life Points
ROM3:6146 EA E2 CE         ld   (CEE2),a	;Next P2 LPs to display during damage
ROM3:6149 F1               pop  af
ROM3:614A C9               ret

3:614B

ROM3:614B F5               push af
ROM3:614C FA 02 CE         ld   a,(CE02)
ROM3:614F EA D2 CE         ld   (CED2),a
ROM3:6152 FA 03 CE         ld   a,(CE03)
ROM3:6155 EA D3 CE         ld   (CED3),a
ROM3:6158 FA 0A CE         ld   a,(CE0A)
ROM3:615B EA D8 CE         ld   (CED8),a
ROM3:615E FA 0B CE         ld   a,(CE0B)
ROM3:6161 EA D9 CE         ld   (CED9),a
ROM3:6164 FA 0C CE         ld   a,(CE0C)
ROM3:6167 EA DA CE         ld   (CEDA),a
ROM3:616A FA 0D CE         ld   a,(CE0D)
ROM3:616D EA DB CE         ld   (CEDB),a
ROM3:6170 FA 04 CE         ld   a,(CE04)
ROM3:6173 EA DD CE         ld   (CEDD),a
ROM3:6176 FA 05 CE         ld   a,(CE05)
ROM3:6179 EA DE CE         ld   (CEDE),a
ROM3:617C FA 0E CE         ld   a,(CE0E)
ROM3:617F EA E3 CE         ld   (CEE3),a
ROM3:6182 FA 0F CE         ld   a,(CE0F)
ROM3:6185 EA E4 CE         ld   (CEE4),a
ROM3:6188 FA 10 CE         ld   a,(CE10)
ROM3:618B EA E5 CE         ld   (CEE5),a
ROM3:618E FA 11 CE         ld   a,(CE11)
ROM3:6191 EA E6 CE         ld   (CEE6),a
ROM3:6194 F1               pop  af
ROM3:6195 C9               ret

00s wCE01, copy P1 and P2 Life Points to wCE06 and wCED4

ROM3:61F2 F5               push af
ROM3:61F3 3E 00            ld   a,00
ROM3:61F5 CD 8A 60         call 608A		;Store accumulator in wCE01
ROM3:61F8 CD 8E 60         call 608E		;Copy P1 Life Points to wCE06 and wCED4
ROM3:61FB CD A3 60         call 60A3		;Copy P2 Life Points to wCE08 and wCEDF
ROM3:61FE F1               pop  af
ROM3:61FF C9               ret

Button Password check

  • 0xE4FB-0xE521 - Button Password check
ROM3:64FB F5               push af
ROM3:64FC C5               push bc
ROM3:64FD D5               push de
ROM3:64FE E5               push hl
ROM3:64FF 1E 00            ld   e,00
ROM3:6501 CD E2 20         call 20E2		// PRNG
ROM3:6504 CD 2E 65         call 652E
ROM3:6507 CD 26 66         call 6626
ROM3:650A 06 00            ld   b,00
ROM3:650C 4F               ld   c,a
ROM3:650D 21 22 65         ld   hl,6522
ROM3:6510 09               add  hl,bc
ROM3:6511 2A               ldi  a,(hl)
ROM3:6512 66               ld   h,(hl)
ROM3:6513 6F               ld   l,a
ROM3:6514 01 19 65         ld   bc,6519
ROM3:6517 C5               push bc
ROM3:6518 E9               jp   hl
ROM3:6519 FE 01            cp   a,01
ROM3:651B 20 E4            jr   nz,6501
ROM3:651D E1               pop  hl
ROM3:651E D1               pop  de
ROM3:651F C1               pop  bc
ROM3:6520 F1               pop  af
ROM3:6521 C9               ret

3:6522 (Button Password check array)

ROM3:6522
68 65 - Password #3
75 65 - Loads requested Menu
F3 65
06 66 - Wipe out SRAM
19 66

3:652E (to document)

  • 0xE52E-0xE55F - To document
ROM3:652E C5               push bc
ROM3:652F D5               push de
ROM3:6530 E5               push hl
ROM3:6531 16 00            ld   d,00
ROM3:6533 FA A6 CA         ld   a,(CAA6)
ROM3:6536 E6 FF            and  a,FF
ROM3:6538 28 0D            jr   z,6547
ROM3:653A 0E 08            ld   c,08
ROM3:653C 0D               dec  c
ROM3:653D 07               rlca 
ROM3:653E 30 FC            jr   nc,653C
ROM3:6540 06 00            ld   b,00
ROM3:6542 21 60 65         ld   hl,6560
ROM3:6545 09               add  hl,bc
ROM3:6546 56               ld   d,(hl)
ROM3:6547 FA A7 CA         ld   a,(CAA7)
ROM3:654A E6 C0            and  a,C0
ROM3:654C 28 0D            jr   z,655B
ROM3:654E 0E 08            ld   c,08
ROM3:6550 0D               dec  c
ROM3:6551 07               rlca 
ROM3:6552 30 FC            jr   nc,6550
ROM3:6554 06 00            ld   b,00
ROM3:6556 21 60 65         ld   hl,6560
ROM3:6559 09               add  hl,bc
ROM3:655A 56               ld   d,(hl)
ROM3:655B 7A               ld   a,d
ROM3:655C E1               pop  hl
ROM3:655D D1               pop  de
ROM3:655E C1               pop  bc
ROM3:655F C9               ret
  • 0xE560-0xE567 - Array ?
ROM3:6560
02 0A 00 08 00 00 04 06

3:6568 (to document)

ROM3:6568 3E 02            ld   a,02
ROM3:656A CD E3 0D         call 0DE3		// (CAAA) = 0, (CAAB) = 2
ROM3:656D CD 2F 0F         call 0F2F		// (CAAB) = 0, (CAAC) = 2
ROM3:6570 CD 74 0F         call 0F74
ROM3:6573 AF               xor  a
ROM3:6574 C9               ret

Loads requested Menu

  • 0xE575-0xE5CE - Loads requested Menu
ROM3:6575 3E 04            ld   a,04
ROM3:6577 CD E3 0D         call 0DE3
ROM3:657A CD E9 66         call 66E9
ROM3:657D CD 2F 0F         call 0F2F
ROM3:6580 CD 74 0F         call 0F74
ROM3:6583 FA A0 CE         ld   a,(CEA0)		// a = Menu ID
ROM3:6586 FE 00            cp   a,00
ROM3:6588 20 0E            jr   nz,6598		// If not Campaign, jump to 3:6598
ROM3:658A CD A8 1F         call 1FA8
ROM3:658D CF               rst  08
ROM3:658E 0D               dec  c
ROM3:658F 04               inc  b
ROM3:6590 CD BE 66         call 66BE
ROM3:6593 CD 9C 64         call 649C
ROM3:6596 18 34            jr   65CC
ROM3:6598 FE 01            cp   a,01
ROM3:659A 20 0E            jr   nz,65AA		// If not Versus, jump to 3:65AA
ROM3:659C CD B0 1F         call 1FB0
ROM3:659F CF               rst  08
ROM3:65A0 0F               rrca 
ROM3:65A1 04               inc  b
ROM3:65A2 CD BE 66         call 66BE
ROM3:65A5 CD 9C 64         call 649C
ROM3:65A8 18 22            jr   65CC
ROM3:65AA FE 02            cp   a,02
ROM3:65AC 20 0E            jr   nz,65BC		// If not Trade, jump to 3:65BC
ROM3:65AE CD B8 1F         call 1FB8
ROM3:65B1 CF               rst  08
ROM3:65B2 11 04 CD         ld   de,CD04
ROM3:65B5 BE               cp   (hl)
ROM3:65B6 66               ld   h,(hl)
ROM3:65B7 CD 9C 64         call 649C
ROM3:65BA 18 10            jr   65CC
ROM3:65BC FE 03            cp   a,03
ROM3:65BE 20 0C            jr   nz,65CC		// If not Records, jump to 3:65CC
ROM3:65C0 CD C0 1F         call 1FC0
ROM3:65C3 CF               rst  08
ROM3:65C4 17               rla  
ROM3:65C5 04               inc  b
ROM3:65C6 CD BE 66         call 66BE
ROM3:65C9 CD 9C 64         call 649C
ROM3:65CC 3E 01            ld   a,01		// Invalid Menu ID
ROM3:65CE C9               ret

Check if the 1st button password had been entered, then ?

ROM3:65CF 3E 04            ld   a,04
ROM3:65D1 CD E3 0D         call 0DE3
ROM3:65D4 CD E9 66         call 66E9
ROM3:65D7 CD 2F 0F         call 0F2F
ROM3:65DA CD 74 0F         call 0F74
ROM3:65DD 7B               ld   a,e
ROM3:65DE FE 80            cp   a,80
ROM3:65E0 20 0F            jr   nz,65F1
ROM3:65E2 CF               rst  08
ROM3:65E3 1F               rra  
ROM3:65E4 04               inc  b
ROM3:65E5 CD BE 66         call 66BE
ROM3:65E8 CD 9C 64         call 649C
ROM3:65EB 1E 00            ld   e,00
ROM3:65ED 3E 01            ld   a,01
ROM3:65EF 18 01            jr   65F2
ROM3:65F1 AF               xor  a
ROM3:65F2 C9               ret  

3:65F3

ROM3:65F3 3E 04            ld   a,04
ROM3:65F5 CD E3 0D         call 0DE3
ROM3:65F8 CD D8 66         call 66D8
ROM3:65FB CD E9 66         call 66E9
ROM3:65FE CD 2F 0F         call 0F2F
ROM3:6601 CD 74 0F         call 0F74
ROM3:6604 AF               xor  a
ROM3:6605 C9               ret

Button Password - Wipe out save file

ROM3:6606 3E 04            ld   a,04
ROM3:6608 CD E3 0D         call 0DE3
ROM3:660B CD C7 66         call 66C7
ROM3:660E CD E9 66         call 66E9
ROM3:6611 CD 2F 0F         call 0F2F
ROM3:6614 CD 74 0F         call 0F74
ROM3:6617 AF               xor  a
ROM3:6618 C9               ret

3:6619

ROM3:6619 3E 02            ld   a,02
ROM3:661B CD E3 0D         call 0DE3	;wCAAB = 2, and set wCAAA to 0
ROM3:661E CD 2F 0F         call 0F2F	;Copy wCAAB to wCAAC, set wCAAB to 0
ROM3:6621 CD 74 0F         call 0F74	;push af, call 0:177B
ROM3:6624 AF               xor  a	;a = 0
ROM3:6625 C9               ret

Compares input with Button Password

  • 0xE626-0xE689 - Compares input with Button Password
ROM3:6626 F5               push af
ROM3:6627 C5               push bc
ROM3:6628 E5               push hl
ROM3:6629 FA A6 CA         ld   a,(CAA6)	// Load button pressed
ROM3:662C FE 00            cp   a,00
ROM3:662E 28 56            jr   z,6686		// If no button pressed, jump to 3:6686
ROM3:6630 7B               ld   a,e
ROM3:6631 FE 00            cp   a,00
ROM3:6633 20 17            jr   nz,664C	// If we are in the middle of a button password, jump to 3:664C
ROM3:6635 FA A6 CA         ld   a,(CAA6)	// Load button pressed
ROM3:6638 FE 40            cp   a,40
ROM3:663A 20 02            jr   nz,663E
ROM3:663C 1E 01            ld   e,01		// If Up button pressed, e = 0x01
ROM3:663E FE 80            cp   a,80
ROM3:6640 20 02            jr   nz,6644
ROM3:6642 1E 08            ld   e,08		// If Down button pressed, e = 0x08
ROM3:6644 FE 20            cp   a,20
ROM3:6646 20 02            jr   nz,664A
ROM3:6648 1E 13            ld   e,13		// If Left button pressed, e = 0x13
ROM3:664A 18 15            jr   6661
ROM3:664C 16 00            ld   d,00
ROM3:664E 21 8A 66         ld   hl,668A
ROM3:6651 19               add  hl,de		// hl = (668A) + current position in Button Password
ROM3:6652 FA A6 CA         ld   a,(CAA6)	// Load button pressed
ROM3:6655 BE               cp   (hl)		// Compare with Button Password
ROM3:6656 20 07            jr   nz,665F		// If invalid Button Password, jump to 3:665F
ROM3:6658 21 A4 66         ld   hl,66A4
ROM3:665B 19               add  hl,de
ROM3:665C 5E               ld   e,(hl)
ROM3:665D 18 02            jr   6661
ROM3:665F 1E 00            ld   e,00
ROM3:6661 7B               ld   a,e		// a = Button Password cursor
ROM3:6662 FE 81            cp   a,81
ROM3:6664 20 0C            jr   nz,6672		// If it's not the last Button of Password #2, jump to 3:6672
ROM3:6666 3E 22            ld   a,22
ROM3:6668 EA F1 B7         ld   (B7F1),a	// (B7F1) = 0x22, wipe out save file
ROM3:666B CD 7E 2B         call 2B7E
ROM3:666E 1E 00            ld   e,00
ROM3:6670 18 14            jr   6686
ROM3:6672 7B               ld   a,e
ROM3:6673 FE 82            cp   a,82
ROM3:6675 20 0F            jr   nz,6686		// If it's not the last Button of Password #3, jump to 3:6686
ROM3:6677 F0 DE            ld   a,(ff00+DE)
ROM3:6679 FE 03            cp   a,03
ROM3:667B 20 04            jr   nz,6681		// If not playing on Super Game Boy 2, jump to 3:6681
ROM3:667D 3E 02            ld   a,02
ROM3:667F E0 DE            ld   (ff00+DE),a	// Else (FFDE) = 2 (Disables Super Game Boy 2 flag)
ROM3:6681 CD 26 2B         call 2B26
ROM3:6684 1E 00            ld   e,00
ROM3:6686 E1               pop  hl
ROM3:6687 C1               pop  bc
ROM3:6688 F1               pop  af
ROM3:6689 C9               ret

Button Passwords

  • 0xE68A - Button Passwords
ROM3:668A
40 80 02 80 80 42 02
=> UP DOWN B DOWN DOWN B+UP B
80 40 02 80 80 10 40 40 40 40 82
=> DOWN UP B DOWN DOWN RIGHT UP UP UP UP B+DOWN
20 02 02 02 40 02 02 12
=> LEFT B B B UP B B B+RIGHT

Button Password cursor

  • 0xE6A4-0xE6BD - Button Password cursor, last value is the function called
ROM3:66A4
01 02 03 04 05 06 80			- Card Password
08 09 0A 0B 0C 0D 0E 0F 10 11 81	- Wipe out SRAM
13 14 15 16 17 18 19 82			- Disables Super Game Boy 2 flag

Increment Menu ID

  • 0xE6C7-0xE6D7 - Menu ID + 1
ROM3:66C7 F5               push af
ROM3:66C8 FA A0 CE         ld   a,(CEA0)	// Current selected Menu
ROM3:66CB FE 03            cp   a,03
ROM3:66CD 28 07            jr   z,66D6		// If(Menu ID == 3), get out of this function
ROM3:66CF FA A0 CE         ld   a,(CEA0)
ROM3:66D2 3C               inc  a
ROM3:66D3 EA A0 CE         ld   (CEA0),a	// Menu ID ++
ROM3:66D6 F1               pop  af
ROM3:66D7 C9               ret

3:66E9 (to document)

ROM3:66E9 F5               push af
ROM3:66EA C5               push bc
ROM3:66EB D5               push de
ROM3:66EC E5               push hl
ROM3:66ED 01 02 00         ld   bc,0002
ROM3:66F0 FA A0 CE         ld   a,(CEA0)	// a = Menu ID
ROM3:66F3 CD 00 67         call 6700
ROM3:66F6 16 60            ld   d,60
ROM3:66F8 CD 3C 12         call 123C
ROM3:66FB E1               pop  hl
ROM3:66FC D1               pop  de
ROM3:66FD C1               pop  bc
ROM3:66FE F1               pop  af
ROM3:66FF C9               ret

Pointer to appropriate Menu

ROM3:6700 C5               push bc
ROM3:6701 E5               push hl
ROM3:6702 06 00            ld   b,00
ROM3:6704 4F               ld   c,a
ROM3:6705 21 0D 67         ld   hl,670D
ROM3:6708 09               add  hl,bc
ROM3:6709 7E               ld   a,(hl)
ROM3:670A E1               pop  hl
ROM3:670B C1               pop  bc
ROM3:670C C9               ret

Menus pointers

ROM3:670D
60 68 70 78

Bank 4

SRAM management

Save file sanity check

  • 0x10484-0x104B2 - Save file sanity check, creates a new save file if the current save is corrupted
ROM4:4484 F5               push af
ROM4:4485 3E 00            ld   a,00
ROM4:4487 EA 17 CF         ld   (CF17),a	// (CF17) = 0
ROM4:448A CD 67 46         call 4667		// SRAM KONAMI check
ROM4:448D FE 01            cp   a,01
ROM4:448F 20 0B            jr   nz,449C		// If the « KONAMI » string is correct, jump to 4:449C
ROM4:4491 CD F2 49         call 49F2		// Name Input screen
ROM4:4494 CD B3 44         call 44B3		// Erase SRAM and create a new Save File
ROM4:4497 3E 01            ld   a,01
ROM4:4499 EA 17 CF         ld   (CF17),a	// (CF17) = 1
ROM4:449C CD BC 45         call 45BC		// Check SRAM Block and Checksum
ROM4:449F FE 01            cp   a,01
ROM4:44A1 20 0B            jr   nz,44AE
ROM4:44A3 CD F2 49         call 49F2		// Name Input screen
ROM4:44A6 CD B3 44         call 44B3		// Erase SRAM and create a new Save File
ROM4:44A9 3E 01            ld   a,01
ROM4:44AB EA 17 CF         ld   (CF17),a	// (CF17) = 1
ROM4:44AE CD 0F 45         call 450F		// Clones SRAM if SRAM block 2
ROM4:44B1 F1               pop  af
ROM4:44B2 C9               ret

SRAM KONAMI check

  • 0x1065C-0x10666 - Date of build and « KONAMI » string used to check SRAM existence
ROM4:465C
98 10 10 00 10 4B 4F 4E 41 4D 49
October 10, 1998 - KONAMI
  • 0x10667-0x10683 - Control the presence of date of build and « KONAMI » string in SRAM at 0xB7F1-0xB7FB, to determine if save data exists.
ROM4:4667 C5               push bc
ROM4:4668 D5               push de
ROM4:4669 E5               push hl
ROM4:466A 06 00            ld   b,00
ROM4:466C 21 F1 B7         ld   hl,B7F1
ROM4:466F 11 5C 46         ld   de,465C
ROM4:4672 0E 0B            ld   c,0B
ROM4:4674 1A               ld   a,(de)
ROM4:4675 BE               cp   (hl)
ROM4:4676 28 02            jr   z,467A		// If the current character is ok, jump to 4:467A
ROM4:4678 06 01            ld   b,01		// Else b = 1
ROM4:467A 23               inc  hl
ROM4:467B 13               inc  de
ROM4:467C 0D               dec  c
ROM4:467D 20 F5            jr   nz,4674		// Loops 11 times to see if « 98 10 10 KONAMI » is present in SRAM at (B7F1)-(B7FB).
ROM4:467F 78               ld   a,b
ROM4:4680 E1               pop  hl
ROM4:4681 D1               pop  de
ROM4:4682 C1               pop  bc
ROM4:4683 C9               ret

Link battle rewards

  • 0x112A3-0x112CA - Link battle rewards array
20 01 - Change Slime
0E 00 - Flame Swordsman
19 00 - Battle Ox
48 01 - Dragon Capture Jar
03 00 - Baby Dragon
32 00 - Armored Lizard
53 01 - Goblin's Secret Re
3B 01 - Electro-whip
0A 00 - Sword Arm of Drago
5C 01 - Spellbinding Circl
0F 00 - Time Wizard
59 00 - Gyakutenno Megami
41 00 - Kojikocy
33 00 - Hercules Beetle
59 01 - Ookazi
3C 01 - Cyber Shield
4E 00 - Megazowler
48 00 - Kairyu-shin
15 00 - Summoned Skull
5A 01 - Tremendous Fire

Graphics 3

  • 0x1132B - Cursors in Campaign mode

Bank 5

"Change Slime" evolution materials

  • 0x1436B-0x1445A - "Change Slime" evolution materials array
25 00 26 00 20 01 6D 01 6D 01 - Gaia The Fierce Kn + Curse of Dragon    + Change Slime
03 00 0F 00 20 01 6D 01 6D 01 - Baby Dragon        + Time Wizard        + Change Slime
19 00 5A 00 20 01 6D 01 6D 01 - Battle Ox          + Mystic Horseman    + Change Slime
7A 00 15 01 20 01 6D 01 6D 01 - Dark Plant         + Petit Moth         + Change Slime
9C 00 15 01 20 01 6D 01 6D 01 - Firegrass          + Petit Moth         + Change Slime
11 01 15 01 20 01 6D 01 6D 01 - Green Phantom King + Petit Moth         + Change Slime
10 01 15 01 20 01 6D 01 6D 01 - Ancient Tree of En + Petit Moth         + Change Slime
07 00 15 01 20 01 6D 01 6D 01 - Mushroom Man       + Petit Moth         + Change Slime
4A 00 15 01 20 01 6D 01 6D 01 - Man-eating Plant   + Petit Moth         + Change Slime
9D 00 15 01 20 01 6D 01 6D 01 - Man Eater          + Petit Moth         + Change Slime
ED 00 15 01 20 01 6D 01 6D 01 - Yashinoshi         + Petit Moth         + Change Slime
B3 00 15 01 20 01 6D 01 6D 01 - Arlownay           + Petit Moth         + Change Slime
7A 00 37 00 20 01 6D 01 6D 01 - Dark Plant         + Larvae Moth        + Change Slime
9C 00 37 00 20 01 6D 01 6D 01 - Firegrass          + Larvae Moth        + Change Slime
11 01 37 00 20 01 6D 01 6D 01 - Green Phantom King + Larvae Moth        + Change Slime
10 01 37 00 20 01 6D 01 6D 01 - Ancient Tree of En + Larvae Moth        + Change Slime
07 00 37 00 20 01 6D 01 6D 01 - Mushroom Man       + Larvae Moth        + Change Slime
4A 00 37 00 20 01 6D 01 6D 01 - Man-eating Plant   + Larvae Moth        + Change Slime
9D 00 37 00 20 01 6D 01 6D 01 - Man Eater          + Larvae Moth        + Change Slime
ED 00 37 00 20 01 6D 01 6D 01 - Yashinoshi         + Larvae Moth        + Change Slime
B3 00 37 00 20 01 6D 01 6D 01 - Arlownay           + Larvae Moth        + Change Slime
47 00 47 00 20 01 6D 01 6D 01 - Cocoon of Evolutio + Cocoon of Evolutio + Change Slime
38 00 47 00 20 01 6D 01 6D 01 - Great Moth         + Cocoon of Evolutio + Change Slime
15 00 51 00 20 01 6D 01 6D 01 - Summoned Skull     + Red-eyes B. Dragon + Change Slime

"Change Slime" evolution results

  • 0x1445B-0x1454A - "Change Slime" evolution results array
24 00 6D 01 6D 01 6D 01 6D 01 - Gaia the Dragon Ch
44 00 6D 01 6D 01 6D 01 6D 01 - Thousand Dragon
5B 00 6D 01 6D 01 6D 01 6D 01 - Rabid Horseman
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
37 00 6D 01 6D 01 6D 01 6D 01 - Larvae Moth
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
47 00 6D 01 6D 01 6D 01 6D 01 - Cocoon of Evolutio
38 00 6D 01 6D 01 6D 01 6D 01 - Great Moth
42 00 6D 01 6D 01 6D 01 6D 01 - Perfectly Ultimate
D8 00 6D 01 6D 01 6D 01 6D 01 - B. Skull Dragon

Bank 6

Graphics 4

  • 0x1805E-0x1812D - Dialog box border/background tiles

Battle step display

Handle Battle Step display

ROM6:5272 CD 7F 52         call 527F		;Display Monsters ?
ROM6:5275 CD 05 54         call 5405
ROM6:5278 CF               rst  08
             => E:4003 pointer, claw animation + claw sound effect
ROM6:527B CD 8B 55         call 558B		;Decreasing LPs animation
ROM6:527E C9               ret

Display Monsters ?

ROM6:527F F5               push af
ROM6:5280 FA D1 CE         ld   a,(CED1)
ROM6:5283 E6 01            and  a,01
ROM6:5285 28 11            jr   z,5298
ROM6:5287 CD 9A 52         call 529A		;Display 1st monster
ROM6:528A CD 10 53         call 5310		;Display 1st monster name and ATK
ROM6:528D CD F9 52         call 52F9
ROM6:5290 0E 28            ld   c,28
ROM6:5292 CD 74 0F         call 0F74		;push af, call 177B
ROM6:5295 0D               dec  c
ROM6:5296 20 FA            jr   nz,5292		;Loop 40 times to 6:5292
ROM6:5298 F1               pop  af
ROM6:5299 C9               ret

Battle step: Display 1st monster

ROM6:529A F5               push af
ROM6:529B C5               push bc
ROM6:529C D5               push de
ROM6:529D CD 0A 1C         call 1C0A
ROM6:52A0 01 38 C0         ld   bc,C038
ROM6:52A3 CD 1D 1C         call 1C1D
ROM6:52A6 01 00 10         ld   bc,1000
ROM6:52A9 CD 12 1C         call 1C12
ROM6:52AC FA D2 CE         ld   a,(CED2)
ROM6:52AF 4F               ld   c,a
ROM6:52B0 FA D3 CE         ld   a,(CED3)
ROM6:52B3 47               ld   b,a
ROM6:52B4 CF               rst  08
ROM6:52B5 03               inc  bc
ROM6:52B6 09               add  hl,bc
ROM6:52B7 CF               rst  08
ROM6:52B8 23               inc  hl
ROM6:52B9 01 1E 05         ld   bc,051E
ROM6:52BC CD 82 12         call 1282
ROM6:52BF 3E 04            ld   a,04
ROM6:52C1 CD E3 0D         call 0DE3
ROM6:52C4 CD 2F 0F         call 0F2F
ROM6:52C7 CD 74 0F         call 0F74
ROM6:52CA 1D               dec  e
ROM6:52CB 20 EF            jr   nz,52BC
ROM6:52CD 01 00 00         ld   bc,0000
ROM6:52D0 CD 12 1C         call 1C12
ROM6:52D3 3E 0A            ld   a,0A
ROM6:52D5 CD E3 0D         call 0DE3
ROM6:52D8 CD 82 12         call 1282
ROM6:52DB CF               rst  08
ROM6:52DC 3B               dec  sp
ROM6:52DD 01 CD 2F         ld   bc,2FCD
ROM6:52E0 0F               rrca 
ROM6:52E1 CD 74 0F         call 0F74
ROM6:52E4 01 38 C0         ld   bc,C038
ROM6:52E7 CD 1D 1C         call 1C1D
ROM6:52EA 3E 04            ld   a,04
ROM6:52EC CD E3 0D         call 0DE3
ROM6:52EF CD 2F 0F         call 0F2F
ROM6:52F2 CD 74 0F         call 0F74
ROM6:52F5 D1               pop  de
ROM6:52F6 C1               pop  bc
ROM6:52F7 F1               pop  af
ROM6:52F8 C9               ret

6:52F9

ROM6:52F9 F5               push af
ROM6:52FA CF               rst  08
           => 1:4025 pointer
ROM6:52FD 3E 0A            ld   a,0A
ROM6:52FF CD E3 0D         call 0DE3		;set wCAAB to accumulator, and (CAAA) to 0
ROM6:5302 CD 82 12         call 1282
ROM6:5305 CF               rst  08
           => 1:4029 pointer
ROM6:5308 CD 2F 0F         call 0F2F		;Copy wCAAB to wCAAC, wCAAB = 0
ROM6:530B CD 74 0F         call 0F74		;push af, call 0:177B
ROM6:530E F1               pop  af
ROM6:530F C9               ret

Display 1st monster name and ATK

ROM6:5310 F5               push af
ROM6:5311 3E 14            ld   a,14
ROM6:5313 CD E3 0D         call 0DE3
ROM6:5316 CD 30 53         call 5330
ROM6:5319 FA D1 CE         ld   a,(CED1)
ROM6:531C E6 02            and  a,02
ROM6:531E 28 05            jr   z,5325
ROM6:5320 CD 79 53         call 5379
ROM6:5323 18 03            jr   5328
ROM6:5325 CD BF 53         call 53BF
ROM6:5328 CD 2F 0F         call 0F2F
ROM6:532B CD 74 0F         call 0F74
ROM6:532E F1               pop  af
ROM6:532F C9               ret

Decreasing LPs animation

ROM6:558B C5               push bc
ROM6:558C 0E 14            ld   c,14
ROM6:558E CD 74 0F         call 0F74
ROM6:5591 0D               dec  c
ROM6:5592 20 FA            jr   nz,558E
ROM6:5594 CD A4 55         call 55A4
ROM6:5597 CD 78 56         call 5678		;Attack screen : decrease displayed LPs
ROM6:559A 0E 28            ld   c,28
ROM6:559C CD 74 0F         call 0F74
ROM6:559F 0D               dec  c
ROM6:55A0 20 FA            jr   nz,559C
ROM6:55A2 C1               pop  bc
ROM6:55A3 C9               ret

6:55A4

ROM6:55A4 F5               push af
ROM6:55A5 C5               push bc
ROM6:55A6 D5               push de
ROM6:55A7 E5               push hl
ROM6:55A8 FA D4 CE         ld   a,(CED4)
ROM6:55AB EA F5 CD         ld   (CDF5),a
ROM6:55AE FA D5 CE         ld   a,(CED5)
ROM6:55B1 EA F6 CD         ld   (CDF6),a
ROM6:55B4 3E 00            ld   a,00
ROM6:55B6 EA F7 CD         ld   (CDF7),a
ROM6:55B9 FA D6 CE         ld   a,(CED6)
ROM6:55BC EA F8 CD         ld   (CDF8),a
ROM6:55BF FA D7 CE         ld   a,(CED7)
ROM6:55C2 EA F9 CD         ld   (CDF9),a
ROM6:55C5 3E 00            ld   a,00
ROM6:55C7 EA FA CD         ld   (CDFA),a
ROM6:55CA CD 2A 1D         call 1D2A
ROM6:55CD FE 01            cp   a,01
ROM6:55CF 28 59            jr   z,562A
ROM6:55D1 CD 52 2B         call 2B52
ROM6:55D4 FA D4 CE         ld   a,(CED4)
ROM6:55D7 4F               ld   c,a
ROM6:55D8 FA D5 CE         ld   a,(CED5)
ROM6:55DB 47               ld   b,a
ROM6:55DC 16 00            ld   d,00
ROM6:55DE 1E 0A            ld   e,0A
ROM6:55E0 79               ld   a,c
ROM6:55E1 EA F5 CD         ld   (CDF5),a
ROM6:55E4 78               ld   a,b
ROM6:55E5 EA F6 CD         ld   (CDF6),a
ROM6:55E8 CD 2A 1D         call 1D2A
ROM6:55EB FE 00            cp   a,00
ROM6:55ED 28 02            jr   z,55F1
ROM6:55EF 16 01            ld   d,01
ROM6:55F1 7A               ld   a,d
ROM6:55F2 FE 01            cp   a,01
ROM6:55F4 28 2C            jr   z,5622
ROM6:55F6 3E 01            ld   a,01
ROM6:55F8 EA DC CA         ld   (CADC),a
ROM6:55FB 3E 00            ld   a,00
ROM6:55FD EA DD CA         ld   (CADD),a
ROM6:5600 3E 00            ld   a,00
ROM6:5602 EA DE CA         ld   (CADE),a
ROM6:5605 79               ld   a,c
ROM6:5606 EA DF CA         ld   (CADF),a
ROM6:5609 78               ld   a,b
ROM6:560A EA E0 CA         ld   (CAE0),a
ROM6:560D 3E 00            ld   a,00
ROM6:560F EA E1 CA         ld   (CAE1),a
ROM6:5612 D5               push de
ROM6:5613 CD DB 13         call 13DB
ROM6:5616 D1               pop  de
ROM6:5617 FA DC CA         ld   a,(CADC)
ROM6:561A 4F               ld   c,a
ROM6:561B FA DD CA         ld   a,(CADD)
ROM6:561E 47               ld   b,a
ROM6:561F 1D               dec  e
ROM6:5620 20 BE            jr   nz,55E0
ROM6:5622 CD 2F 56         call 562F
ROM6:5625 7A               ld   a,d
ROM6:5626 FE 00            cp   a,00
ROM6:5628 28 B4            jr   z,55DE
ROM6:562A E1               pop  hl
ROM6:562B D1               pop  de
ROM6:562C C1               pop  bc
ROM6:562D F1               pop  af
ROM6:562E C9               ret  

Attack screen : decrease displayed LPs

ROM6:5678 F5               push af
ROM6:5679 C5               push bc
ROM6:567A D5               push de
ROM6:567B E5               push hl
ROM6:567C FA DF CE         ld   a,(CEDF)
ROM6:567F EA F5 CD         ld   (CDF5),a
ROM6:5682 FA E0 CE         ld   a,(CEE0)	;Next LPs to display during damage
ROM6:5685 EA F6 CD         ld   (CDF6),a	;Copy it to wCDF6
ROM6:5688 3E 00            ld   a,00
ROM6:568A EA F7 CD         ld   (CDF7),a	;wCDF7 = 0
ROM6:568D FA E1 CE         ld   a,(CEE1)
ROM6:5690 EA F8 CD         ld   (CDF8),a	;wCDF8 = wCEE1
ROM6:5693 FA E2 CE         ld   a,(CEE2)
ROM6:5696 EA F9 CD         ld   (CDF9),a	;wCDF9 = wCEE2
ROM6:5699 3E 00            ld   a,00
ROM6:569B EA FA CD         ld   (CDFA),a	;wCDFA = 0
ROM6:569E CD 2A 1D         call 1D2A
ROM6:56A1 FE 01            cp   a,01
ROM6:56A3 28 59            jr   z,56FE
ROM6:56A5 CD 52 2B         call 2B52
ROM6:56A8 FA DF CE         ld   a,(CEDF)
ROM6:56AB 4F               ld   c,a
ROM6:56AC FA E0 CE         ld   a,(CEE0)
ROM6:56AF 47               ld   b,a
ROM6:56B0 16 00            ld   d,00
ROM6:56B2 1E 0A            ld   e,0A		;Decrease LPs 10 per 10
ROM6:56B4 79               ld   a,c
ROM6:56B5 EA F5 CD         ld   (CDF5),a
ROM6:56B8 78               ld   a,b
ROM6:56B9 EA F6 CD         ld   (CDF6),a
ROM6:56BC CD 2A 1D         call 1D2A
ROM6:56BF FE 00            cp   a,00
ROM6:56C1 28 02            jr   z,56C5
ROM6:56C3 16 01            ld   d,01
ROM6:56C5 7A               ld   a,d
ROM6:56C6 FE 01            cp   a,01
ROM6:56C8 28 2C            jr   z,56F6
ROM6:56CA 3E 01            ld   a,01
ROM6:56CC EA DC CA         ld   (CADC),a
ROM6:56CF 3E 00            ld   a,00
ROM6:56D1 EA DD CA         ld   (CADD),a
ROM6:56D4 3E 00            ld   a,00
ROM6:56D6 EA DE CA         ld   (CADE),a
ROM6:56D9 79               ld   a,c
ROM6:56DA EA DF CA         ld   (CADF),a
ROM6:56DD 78               ld   a,b
ROM6:56DE EA E0 CA         ld   (CAE0),a
ROM6:56E1 3E 00            ld   a,00
ROM6:56E3 EA E1 CA         ld   (CAE1),a
ROM6:56E6 D5               push de
ROM6:56E7 CD DB 13         call 13DB
ROM6:56EA D1               pop  de
ROM6:56EB FA DC CA         ld   a,(CADC)
ROM6:56EE 4F               ld   c,a
ROM6:56EF FA DD CA         ld   a,(CADD)
ROM6:56F2 47               ld   b,a
ROM6:56F3 1D               dec  e
ROM6:56F4 20 BE            jr   nz,56B4		;Loop 10 times
ROM6:56F6 CD 03 57         call 5703
ROM6:56F9 7A               ld   a,d
ROM6:56FA FE 00            cp   a,00
ROM6:56FC 28 B4            jr   z,56B2
ROM6:56FE E1               pop  hl
ROM6:56FF D1               pop  de
ROM6:5700 C1               pop  bc
ROM6:5701 F1               pop  af
ROM6:5702 C9               ret

6:5703

ROM6:5703 F5               push af
ROM6:5704 C5               push bc
ROM6:5705 D5               push de
ROM6:5706 E5               push hl
ROM6:5707 3E 14            ld   a,14
ROM6:5709 CD E3 0D         call 0DE3
ROM6:570C 3E 0A            ld   a,0A
ROM6:570E CF               rst 08
 => 1:401D
ROM6:5711 CF 1B            rst 08
 => 1:401B
ROM6:5714 CF               rst  08
ROM6:5715 1F               rra  
ROM6:5716 01 78 FE         ld   bc,FE78
ROM6:5719 FF               rst  38
ROM6:571A 20 03            jr   nz,571F
ROM6:571C CF               rst  08
ROM6:571D 21 01 01         ld   hl,0101
ROM6:5720 0A               ld   a,(bc)
ROM6:5721 9A               sbc  d
ROM6:5722 CD 3D 0F         call 0F3D		;Store reg bc in wC5(CAAA), and update wCAAA
ROM6:5725 21 48 57         ld   hl,5748
ROM6:5728 0E 04            ld   c,04
ROM6:572A 2A               ldi  a,(hl)
ROM6:572B CD 50 0F         call 0F50		;Store reg a in wC5(CAAA), and update wCAAA
ROM6:572E 0D               dec  c
ROM6:572F 20 F9            jr   nz,572A
ROM6:5731 21 B9 CA         ld   hl,CAB9
ROM6:5734 0E 04            ld   c,04
ROM6:5736 2A               ldi  a,(hl)
ROM6:5737 CD 50 0F         call 0F50		;Store reg a in wC5(CAAA), and update wCAAA
ROM6:573A 0D               dec  c
ROM6:573B 20 F9            jr   nz,5736
ROM6:573D CD 2F 0F         call 0F2F
ROM6:5740 CD 74 0F         call 0F74
ROM6:5743 E1               pop  hl
ROM6:5744 D1               pop  de
ROM6:5745 C1               pop  bc
ROM6:5746 F1               pop  af
ROM6:5747 C9               ret

Bank 8

CPU Decks

Generate CPU Deck

ROM8:4004 F5               push af
ROM8:4005 C5               push bc
ROM8:4006 D5               push de
ROM8:4007 E5               push hl
ROM8:4008 1E 00            ld   e,00            ;deck_size = 0
ROM8:400A 7B               ld   a,e
ROM8:400B FE 28            cp   a,28
ROM8:400D 30 0D            jr   nc,401C         ;if(deck_size ≥ 40), exit this function
ROM8:400F 7B               ld   a,e
ROM8:4010 CF               rst  08
          5D 03
ROM8:4013 CD 21 40         call 4021            ;Generate CPU Card
ROM8:4016 CF               rst  08
          5F 03        => Add card to CPU's deck
ROM8:4019 1C               inc  e               ;deck_size ++
ROM8:401A 18 EE            jr   400A            ;loop to 8:400A
ROM8:401C E1               pop  hl
ROM8:401D D1               pop  de
ROM8:401E C1               pop  bc
ROM8:401F F1               pop  af
ROM8:4020 C9               ret

Generate CPU Card

ROM8:4021 F5               push af
ROM8:4022 D5               push de
ROM8:4023 E5               push hl
ROM8:4024 3E 00            ld   a,00
ROM8:4026 EA 9D CE         ld   (CE9D),a
ROM8:4029 3E FF            ld   a,FF
ROM8:402B EA 9E CE         ld   (CE9E),a      ;PRN[0;255]
ROM8:402E CD 12 21         call 2112          ;Pseudo-Random Number
ROM8:4031 FA 9F CE         ld   a,(CE9F)
ROM8:4034 5F               ld   e,a
ROM8:4035 3E 00            ld   a,00
ROM8:4037 EA 9D CE         ld   (CE9D),a
ROM8:403A 3E 07            ld   a,07
ROM8:403C EA 9E CE         ld   (CE9E),a      ;PRN[0;7]
ROM8:403F CD 12 21         call 2112          ;Pseudo-Random Number
ROM8:4042 FA 9F CE         ld   a,(CE9F)
ROM8:4045 57               ld   d,a           ;de = [0;2047]
ROM8:4046 06 00            ld   b,00
ROM8:4048 CF               rst  08
          19 02
ROM8:404B 4F               ld   c,a
ROM8:404C CB 21            sla  c              ;c = CPU opponent deck offset
ROM8:404E 21 6C 40         ld   hl,406C
ROM8:4051 09               add  hl,bc          ;hl = CPU Deck pointer
ROM8:4052 2A               ldi  a,(hl)
ROM8:4053 66               ld   h,(hl)
ROM8:4054 6F               ld   l,a
ROM8:4055 01 00 00         ld   bc,0000        ;card_id = 0
ROM8:4058 C5               push bc
ROM8:4059 2A               ldi  a,(hl)
ROM8:405A 4F               ld   c,a
ROM8:405B 2A               ldi  a,(hl)
ROM8:405C 47               ld   b,a            ;bc = card_probability
ROM8:405D CD 0F 1D         call 1D0F
ROM8:4060 C1               pop  bc             ;bc = card_id
ROM8:4061 FE 00            cp   a,00
ROM8:4063 28 03            jr   z,4068         ;if card_probability > PRN, exit this function
ROM8:4065 03               inc  bc             ;card_id ++
ROM8:4066 18 F0            jr   4058           ;loop to 8:4058 (next card probability)
ROM8:4068 E1               pop  hl
ROM8:4069 D1               pop  de
ROM8:406A F1               pop  af
ROM8:406B C9               ret

CPU Decks pointers

ROM8:406C
8E 40 - Weevil Underwood
68 43 - Mai Valentine
42 46 - Rex Raptor
1C 49 - Mako Tsunami
F6 4B - Yami Yugi
D0 4E - Yugi Muto
AA 51 - ?
D6 51 - Joey Wheeler
B0 54 - Seto Kaiba
8A 57 - Mokuba Kaiba
64 5A - Tristan Taylor
3E 5D - Ryou Bakura
18 60 - Puppeteer of Doom
F2 62 - PaniK
CC 65 - Bandit Keith
A6 68 - Maximillion Pegasus
80 6B - Simon Muran

CPU Decks data

0x2008E-0x22E59 - CPU Decks cards cumulative probabilities, from 0 to 2048, using the CPU Decks pointers

Array ?

0x211AA-0x211D5 - ?

ROM8:51AA
01 00 02 00 03 00 04 00 0A 00 0F 00 14 00 19 00
1E 00 23 00 28 00 2D 00 32 00 37 00 3C 00 41 00
46 00 4B 00 50 00 55 00 5A 00 63 00

Bank 9

  • 0x2409E-0x2420A - Card type array
  • 0x2420B-0x24380 - ?
  • 0x24381-0x2465C - Cards original ATK array
  • 0x2465D-0x24938 - Cards original DEF array
  • 0x24939-0x24C14 - Cards modified ATK array (while "Forest" is active)
  • 0x24C15-0x24EF0 - Cards modified DEF array (while "Forest" is active)
  • 0x24EF1-0x251CC - Cards modified ATK array (while "Wasteland" is active)
  • 0x251CD-0x254A8 - Cards modified DEF array (while "Wasteland" is active)
  • 0x254A9-0x25784 - Cards modified ATK array (while "Mountain" is active)
  • 0x25785-0x25A60 - Cards modified DEF array (while "Mountain" is active)
  • 0x25A61-0x25D3C - Cards modified ATK array (while "Sogen" is active)
  • 0x25D3D-0x26018 - Cards modified DEF array (while "Sogen" is active)
  • 0x26019-0x262F4 - Cards modified ATK array (while "Umi" is active)
  • 0x262F5-0x265D0 - Cards modified DEF array (while "Umi" is active)
  • 0x265D1-0x268AC - Cards modified ATK array (while "Yami" is active)
  • 0x268AD-0x26B88 - Cards modified DEF array (while "Yami" is active)

9:6B9F

  • 0x26B9F-0x26BC7
ROM9:6B9F C5               push bc
ROM9:6BA0 D5               push de
ROM9:6BA1 E5               push hl
ROM9:6BA2 2A               ldi  a,(hl)
ROM9:6BA3 5F               ld   e,a
ROM9:6BA4 2A               ldi  a,(hl)
ROM9:6BA5 57               ld   d,a
ROM9:6BA6 C5               push bc
ROM9:6BA7 01 FF FF         ld   bc,FFFF
ROM9:6BAA CD 00 1D         call 1D00		// Checks if 0xFFFF ≠ de
ROM9:6BAD C1               pop  bc
ROM9:6BAE FE 00            cp   a,00
ROM9:6BB0 20 04            jr   nz,6BB6
ROM9:6BB2 1E 00            ld   e,00
ROM9:6BB4 18 0D            jr   6BC3
ROM9:6BB6 CD 00 1D         call 1D00		// Checks if bc ≠ de
ROM9:6BB9 FE 00            cp   a,00
ROM9:6BBB 20 04            jr   nz,6BC1
ROM9:6BBD 1E 01            ld   e,01
ROM9:6BBF 18 02            jr   6BC3
ROM9:6BC1 18 DF            jr   6BA2
ROM9:6BC3 7B               ld   a,e
ROM9:6BC4 E1               pop  hl
ROM9:6BC5 D1               pop  de
ROM9:6BC6 C1               pop  bc
ROM9:6BC7 C9               ret

Equip Monster IDs arrays

  • 0x26BC8-0x2764D - Equip Monster IDs arrays, separated by FF FF

Equip Monster IDs pointers array

  • 0x26BC8-0x26BFB - Equip Monster IDs pointers array
FC 6B 62 6C AC 6C F2 6D 60 6E FA 6E 22 6F 64 6F 30 70 3A 70 56 70 E0 70
10 71 3E 71 90 71 E4 71 62 72 90 72 FA 72 76 73 D2 73 36 74 D0 74 F0 74
76 75 00 76

Legendary Sword array

  • 0x26BFC-0x26C61 - "Legendary Sword" Equip Monster IDs array
0B 00 0E 00 19 00 1A 00 1C 00 20 00 25 00 28 00 2A 00 3F 00 41 00 4D 00
5B 00 5C 00 63 00 6D 00 75 00 77 00 82 00 84 00 89 00 92 00 96 00 9B 00
9F 00 A0 00 A4 00 A5 00 AB 00 B8 00 C3 00 C6 00 D3 00 DF 00 E6 00 EA 00
F9 00 FB 00 FF 00 05 01 08 01 09 01 1D 01 21 01 22 01 24 01 2A 01 5F 01
61 01 69 01 FF FF

Sword of Ruin array

  • 0x26C62-0x26CAB - "Sword of Ruin" Equip Monster IDs array
0B 00 0D 00 15 00 16 00 18 00 1D 00 25 00 41 00 43 00 6A 00 76 00 7B 00
7E 00 B5 00 C2 00 D5 00 DA 00 E0 00 E1 00 E9 00 EB 00 EE 00 F0 00 F5 00
FF 00 0A 01 0C 01 18 01 24 01 25 01 28 01 62 01 63 01 66 01 67 01 6B 01
FF FF

Dark Energy array

  • 0x26CAC-0x26DF1 - "Dark Energy" Equip Monster IDs array
02 00 04 00 05 00 08 00 09 00 0B 00 0F 00 10 00 11 00 12 00 13 00 14 00
15 00 16 00 17 00 18 00 1D 00 1E 00 21 00 22 00 25 00 27 00 29 00 2C 00
2F 00 39 00 40 00 41 00 4A 00 4B 00 50 00 52 00 53 00 54 00 55 00 56 00
57 00 5E 00 5F 00 60 00 61 00 62 00 64 00 65 00 66 00 67 00 68 00 6A 00
6B 00 6E 00 6F 00 70 00 72 00 73 00 76 00 7A 00 7B 00 7E 00 83 00 86 00
87 00 88 00 8A 00 8C 00 8D 00 8E 00 91 00 93 00 94 00 95 00 97 00 98 00
99 00 9A 00 9D 00 A1 00 A3 00 A6 00 A7 00 A8 00 AA 00 AC 00 AD 00 AE 00
AF 00 B1 00 B2 00 B4 00 B5 00 B8 00 BA 00 BB 00 BD 00 C1 00 C2 00 C4 00
C8 00 C9 00 CA 00 CB 00 CC 00 CD 00 D0 00 D1 00 D3 00 D4 00 D5 00 D6 00
D9 00 DA 00 DB 00 DC 00 DD 00 DE 00 DF 00 E0 00 E1 00 E3 00 E6 00 E7 00
E8 00 E9 00 EB 00 EE 00 EF 00 F0 00 F1 00 F4 00 F5 00 F7 00 FC 00 FD 00
FF 00 01 01 02 01 04 01 0A 01 0B 01 0C 01 0E 01 14 01 16 01 18 01 1A 01
1B 01 1C 01 1D 01 1E 01 1F 01 22 01 24 01 25 01 26 01 28 01 29 01 5E 01
62 01 66 01 67 01 69 01 6B 01 6C 01 FF FF

Axe of Despair array

  • 0x26DF2-0x26E5F - "Axe of Despair" Equip Monster IDs array
02 00 04 00 05 00 0B 00 0D 00 15 00 16 00 17 00 18 00 19 00 1A 00 1C 00
1D 00 3F 00 41 00 43 00 4B 00 4C 00 4D 00 55 00 57 00 5A 00 5B 00 5F 00
6A 00 76 00 7E 00 94 00 97 00 A8 00 AA 00 B1 00 B5 00 B8 00 BA 00 BB 00
C1 00 C2 00 C9 00 CD 00 DA 00 DF 00 E1 00 E6 00 F5 00 06 01 0E 01 18 01
1D 01 1E 01 26 01 5E 01 63 01 66 01 FF FF

Lazer Cannon Armor array

  • 0x26E60-0x26EF9 - "Lazer Cannon Armor" Equip Monster IDs array
02 00 03 00 04 00 05 00 0B 00 0C 00 1B 00 26 00 2C 00 2D 00 30 00 31 00
32 00 33 00 34 00 35 00 36 00 37 00 38 00 40 00 42 00 43 00 47 00 49 00
4B 00 4C 00 4E 00 4F 00 50 00 54 00 56 00 57 00 58 00 5A 00 5B 00 5D 00
60 00 68 00 6F 00 70 00 73 00 78 00 7C 00 8A 00 8C 00 9A 00 9E 00 AA 00
AE 00 B0 00 B4 00 B6 00 C0 00 C4 00 C9 00 CB 00 D0 00 DC 00 DD 00 E1 00
E7 00 F0 00 F2 00 F4 00 FE 00 12 01 15 01 1D 01 23 01 27 01 28 01 2B 01
60 01 62 01 64 01 67 01 FF FF

Insect Armor with array

  • 0x26EFA-0x26F21 - "Insect Armor with" Equip Monster IDs array
30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 38 00 42 00 47 00 73 00
8C 00 D0 00 DC 00 12 01 15 01 1C 01 62 01 FF FF

Elf's Light array

  • 0x26F22-0x26F63 - "Elf's Light" Equip Monster IDs array
01 00 28 00 2B 00 2C 00 59 00 6C 00 7C 00 7D 00 7F 00 80 00 81 00 92 00
A9 00 B6 00 B7 00 BF 00 C5 00 CF 00 D7 00 E4 00 F2 00 F8 00 FB 00 FC 00
03 01 10 01 11 01 13 01 19 01 2A 01 68 01 6A 01 FF FF

Beast Fangs array

  • 0x26F64-0x2702F - "Beast Fangs" Equip Monster IDs array
02 00 03 00 04 00 05 00 06 00 08 00 09 00 0A 00 0D 00 15 00 16 00 17 00
1A 00 1C 00 1D 00 1E 00 1F 00 23 00 26 00 2D 00 2E 00 2F 00 30 00 32 00
33 00 3A 00 3B 00 3C 00 3F 00 40 00 43 00 48 00 4B 00 4C 00 4E 00 4F 00
50 00 54 00 55 00 56 00 5A 00 5D 00 5E 00 60 00 61 00 62 00 68 00 70 00
78 00 7A 00 7D 00 83 00 89 00 8C 00 8E 00 95 00 96 00 98 00 9D 00 9E 00
A2 00 A6 00 A7 00 A8 00 B2 00 B5 00 BA 00 BB 00 BC 00 C0 00 C4 00 C7 00
C8 00 C9 00 CD 00 D2 00 D3 00 D9 00 DD 00 DE 00 E1 00 E3 00 E5 00 F5 00
F7 00 FB 00 FE 00 00 01 01 01 08 01 19 01 1C 01 1E 01 29 01 2B 01 5E 01
60 01 61 01 63 01 64 01 67 01 FF FF

Steel Shell array

  • 0x27030-0x27039 - "Steel Shell" Equip Monster IDs array
58 00 B0 00 C0 00 23 01 FF FF

Vile Germs array

  • 0x2703A-0x27055 - "Vile Germs" Equip Monster IDs array
07 00 4A 00 61 00 7A 00 9C 00 9D 00 B3 00 D7 00 E3 00 EA 00 ED 00 10 01
11 01 FF FF

Black Pendant array

  • 0x27056-0x270DF - "Black Pendant" Equip Monster IDs array
0B 00 0F 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 21 00
22 00 23 00 27 00 29 00 53 00 54 00 5E 00 61 00 62 00 64 00 65 00 66 00
67 00 6B 00 6E 00 6F 00 72 00 83 00 8B 00 8D 00 8E 00 90 00 93 00 94 00
98 00 99 00 A3 00 A5 00 A6 00 A8 00 AC 00 AE 00 AF 00 B2 00 B4 00 B5 00
BD 00 D2 00 D4 00 DA 00 DB 00 DF 00 E6 00 E8 00 EB 00 FC 00 02 01 04 01
0B 01 0C 01 0E 01 14 01 1A 01 1B 01 5E 01 6C 01 FF FF

Silver Bow & Arrow array

  • 0x270E0-0x2710F - "Silver Bow & Arrow" Equip Monster IDs array
01 00 3D 00 3E 00 59 00 6C 00 6E 00 79 00 7D 00 7F 00 81 00 85 00 A9 00
AE 00 BC 00 BF 00 C5 00 CF 00 D7 00 E4 00 FC 00 03 01 07 01 13 01 FF FF

Horn of Light array

  • 0x27110-0x2713D - "Horn of Light" Equip Monster IDs array
03 00 06 00 19 00 1A 00 1B 00 1C 00 1F 00 26 00 2C 00 2E 00 33 00 58 00
5B 00 6D 00 B0 00 D3 00 F7 00 08 01 19 01 21 01 25 01 64 01 FF FF

Horn of the Unicor array

  • 0x2713E-0x2718F - "Horn of the Unicor" Equip Monster IDs array
04 00 05 00 09 00 0B 00 0D 00 15 00 18 00 37 00 38 00 3A 00 42 00 43 00
4E 00 50 00 54 00 55 00 56 00 5C 00 66 00 70 00 7A 00 8E 00 96 00 A3 00
AC 00 AE 00 B1 00 B4 00 C9 00 CB 00 DA 00 DB 00 E1 00 E6 00 EB 00 EE 00
F4 00 0A 01 62 01 67 01 FF FF

Dragon Treasure array

  • 0x27190-0x271E3 - "Dragon Treasure" Equip Monster IDs array
00 00 03 00 06 00 09 00 0A 00 1E 00 1F 00 24 00 26 00 2D 00 2E 00 32 00
43 00 44 00 48 00 4B 00 4C 00 4E 00 4F 00 50 00 51 00 56 00 5D 00 60 00
68 00 79 00 89 00 A7 00 BB 00 C7 00 D8 00 DD 00 DE 00 25 01 27 01 29 01
2B 01 60 01 64 01 65 01 67 01 FF FF

Electro-whip array

  • 0x271E4-0x27261 - "Electro-whip" Equip Monster IDs array
01 00 02 00 05 00 0B 00 18 00 21 00 2C 00 3D 00 3E 00 59 00 5A 00 69 00
6C 00 71 00 77 00 7F 00 80 00 83 00 86 00 88 00 8A 00 8C 00 8D 00 8E 00
8F 00 A8 00 A9 00 B3 00 B8 00 BA 00 BB 00 BF 00 C2 00 CD 00 CF 00 D2 00
D3 00 D7 00 DF 00 E8 00 E9 00 EC 00 EE 00 F2 00 F8 00 F9 00 FA 00 FB 00
FC 00 FD 00 03 01 09 01 11 01 17 01 18 01 1E 01 23 01 2A 01 5E 01 5F 01
66 01 6A 01 FF FF

Cyber Shield array

  • 0x27262-0x2728F - "Cyber Shield" Equip Monster IDs array
01 00 3D 00 3E 00 59 00 69 00 6C 00 7F 00 80 00 A9 00 B3 00 BF 00 D7 00
E9 00 EE 00 F2 00 F8 00 FA 00 FC 00 03 01 09 01 17 01 2A 01 FF FF

Mystical Moon array

  • 0x27290-0x272F9 - "Mystical Moon" Equip Monster IDs array
05 00 08 00 0D 00 16 00 19 00 1A 00 1C 00 2D 00 2E 00 2F 00 39 00 3C 00
3D 00 3E 00 3F 00 40 00 55 00 5A 00 5B 00 70 00 78 00 9E 00 A2 00 A3 00
BA 00 BB 00 BC 00 C0 00 C4 00 C5 00 C6 00 C8 00 C9 00 CE 00 D3 00 DA 00
E5 00 F5 00 F7 00 F9 00 FB 00 FE 00 00 01 01 01 07 01 19 01 1E 01 23 01
26 01 2B 01 61 01 63 01 FF FF

Malevolent Nuzzler array

  • 0x272FA-0x27375 - "Malevolent Nuzzler" Equip Monster IDs array
01 00 02 00 04 00 08 00 15 00 17 00 1D 00 27 00 29 00 2F 00 3D 00 3E 00
59 00 5E 00 5F 00 61 00 62 00 69 00 6C 00 7A 00 7F 00 80 00 8C 00 95 00
9A 00 9D 00 A3 00 A9 00 B3 00 B5 00 BA 00 BB 00 BF 00 C2 00 C4 00 C5 00
C8 00 CD 00 CE 00 D2 00 D3 00 D7 00 DC 00 E9 00 EC 00 EE 00 F2 00 F8 00
FA 00 FB 00 FC 00 03 01 09 01 11 01 17 01 2A 01 5F 01 61 01 63 01 67 01
6A 01 FF FF

Violet Crystal array

  • 0x27376-0x273D1 - "Violet Crystal" Equip Monster IDs array
04 00 08 00 15 00 17 00 1D 00 23 00 26 00 2D 00 5F 00 60 00 61 00 62 00
65 00 66 00 67 00 6B 00 6F 00 76 00 79 00 83 00 86 00 88 00 8A 00 8B 00
8C 00 91 00 98 00 99 00 A6 00 AC 00 B2 00 C4 00 CA 00 D6 00 E3 00 F0 00
FD 00 04 01 0B 01 0C 01 0E 01 14 01 5E 01 66 01 6C 01 FF FF

Book of Secret Art array

  • 0x273D2-0x27435 - "Book of Secret Art" Equip Monster IDs array
01 00 0F 00 20 00 28 00 29 00 2B 00 2C 00 3D 00 3E 00 59 00 69 00 6C 00
71 00 74 00 77 00 79 00 7D 00 7F 00 80 00 81 00 85 00 8D 00 8E 00 8F 00
90 00 A4 00 A9 00 AD 00 B6 00 B7 00 BF 00 C5 00 CF 00 D4 00 D7 00 EA 00
F2 00 03 01 07 01 08 01 0D 01 10 01 11 01 13 01 17 01 19 01 23 01 2A 01
6A 01 FF FF

Invigoration array

  • 0x27436-0x274CF - "Invigoration" Equip Monster IDs array
07 00 08 00 0E 00 1B 00 27 00 2C 00 39 00 45 00 46 00 48 00 49 00 4A 00
52 00 60 00 62 00 64 00 65 00 66 00 67 00 69 00 6B 00 76 00 79 00 7A 00
81 00 84 00 85 00 86 00 88 00 8D 00 91 00 92 00 95 00 97 00 9C 00 A1 00
A6 00 A7 00 AA 00 AC 00 AD 00 AF 00 B7 00 BE 00 CC 00 D1 00 D2 00 D5 00
D6 00 E0 00 E2 00 E3 00 E4 00 EC 00 ED 00 EF 00 F1 00 F3 00 00 01 01 01
04 01 06 01 07 01 10 01 12 01 13 01 14 01 16 01 1A 01 20 01 22 01 5E 01
61 01 62 01 69 01 6C 01 FF FF

Machine Conversion array

  • 0x274D0-0x274EF - "Machine Conversion" Equip Monster IDs array
0B 00 0C 00 58 00 7B 00 9F 00 A0 00 CB 00 DF 00 E7 00 12 01 1A 01 1D 01
20 01 28 01 62 01 FF FF

Raise Body Heat array

  • 0x274F0-0x27575 - "Raise Body Heat" Equip Monster IDs array
07 00 0A 00 0C 00 0E 00 1E 00 1F 00 2D 00 2E 00 30 00 31 00 32 00 33 00
34 00 35 00 36 00 37 00 38 00 3A 00 42 00 43 00 4B 00 4C 00 4E 00 4F 00
50 00 56 00 64 00 68 00 73 00 7B 00 8D 00 95 00 96 00 97 00 99 00 9C 00
9E 00 AA 00 AF 00 BB 00 C2 00 C9 00 CB 00 CD 00 D0 00 D1 00 D7 00 D9 00
E2 00 F1 00 F3 00 06 01 07 01 0F 01 12 01 14 01 15 01 1C 01 1D 01 20 01
22 01 28 01 5E 01 61 01 62 01 64 01 FF FF

Follow Wind array

  • 0x27576-0x275FF - "Follow Wind" Equip Monster IDs array
03 00 04 00 05 00 06 00 09 00 0C 00 17 00 1E 00 26 00 2B 00 33 00 34 00
38 00 3D 00 3E 00 42 00 52 00 53 00 55 00 56 00 64 00 69 00 6E 00 6F 00
70 00 74 00 7C 00 7F 00 89 00 8F 00 99 00 9A 00 A2 00 A7 00 B4 00 B6 00
B9 00 BC 00 C5 00 C7 00 C9 00 CA 00 CB 00 CE 00 CF 00 D0 00 D1 00 D6 00
D7 00 DD 00 E4 00 FB 00 FC 00 FD 00 03 01 07 01 0B 01 0C 01 0F 01 13 01
16 01 25 01 27 01 29 01 2B 01 60 01 68 01 6A 01 FF FF

Power of Kaishin array

  • 0x27600-0x2764D - "Power of Kaishin" Equip Monster IDs array
2C 00 3B 00 45 00 46 00 48 00 4B 00 58 00 82 00 86 00 8B 00 8C 00 95 00
97 00 AA 00 B0 00 C0 00 C1 00 C2 00 C3 00 C6 00 CC 00 CD 00 D2 00 D4 00
DE 00 E2 00 E5 00 F2 00 F6 00 F8 00 FA 00 01 01 08 01 0D 01 20 01 23 01
60 01 68 01 FF FF

Bank A

Graphics 5

  • 0x28060 - Duel area

A:5163

ROMA:5163 F5               push af
ROMA:5164 C5               push bc
ROMA:5165 D5               push de
ROMA:5166 E5               push hl
ROMA:5167 11 00 88         ld   de,8800
ROMA:516A 21 AA 51         ld   hl,51AA
ROMA:516D 06 11            ld   b,11
ROMA:516F 0E 10            ld   c,10
ROMA:5171 2A               ldi  a,(hl)
ROMA:5172 12               ld   (de),a		;Copy A:51AA-A:51BA to v8800-8810 (0xFFs)
ROMA:5173 13               inc  de
ROMA:5174 0D               dec  c
ROMA:5175 20 FA            jr   nz,5171
ROMA:5177 05               dec  b
ROMA:5178 20 F5            jr   nz,516F
ROMA:517A 21 00 8D         ld   hl,8D00
ROMA:517D 3E FF            ld   a,FF
ROMA:517F 06 10            ld   b,10
ROMA:5181 0E 10            ld   c,10
ROMA:5183 22               ldi  (hl),a
ROMA:5184 0D               dec  c
ROMA:5185 20 FC            jr   nz,5183
ROMA:5187 05               dec  b
ROMA:5188 20 F7            jr   nz,5181
ROMA:518A 11 00 98         ld   de,9800
ROMA:518D 21 BA 52         ld   hl,52BA
ROMA:5190 06 12            ld   b,12
ROMA:5192 0E 14            ld   c,14
ROMA:5194 2A               ldi  a,(hl)
ROMA:5195 12               ld   (de),a
ROMA:5196 13               inc  de
ROMA:5197 0D               dec  c
ROMA:5198 20 FA            jr   nz,5194
ROMA:519A E5               push hl
ROMA:519B 21 0C 00         ld   hl,000C
ROMA:519E 19               add  hl,de
ROMA:519F 54               ld   d,h
ROMA:51A0 5D               ld   e,l
ROMA:51A1 E1               pop  hl
ROMA:51A2 05               dec  b
ROMA:51A3 20 ED            jr   nz,5192
ROMA:51A5 E1               pop  hl
ROMA:51A6 D1               pop  de
ROMA:51A7 C1               pop  bc
ROMA:51A8 F1               pop  af
ROMA:51A9 C9               ret  

A:51AA (Array of 16 0xFFs that are copied to v8800)

An array of 0xFFs.

FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

Graphics 6

  • 0x294B0 - Title Screen
  • 0x2A810 - Campaign map screens

Bank B

Graphics 7

  • 0x2C050 - KONAMI / KCE Shinjuku / Yu-Gi-Oh screens
  • 0x2D770 - Campaign opponents pictures

Bank C

Graphics 8

  • 0x30060 - Stage 3 / 4 / 5 Campaign opponents pictures

Bank D

Card drop

Card drop - main routine

ROMD:400C F5               push af
ROMD:400D C5               push bc
ROMD:400E CD F7 23         call 23F7
ROMD:4011 FE 00            cp   a,00
ROMD:4013 28 0F            jr   z,4024
ROMD:4015 CD 27 40         call 4027          ;Card drop - random card
ROMD:4018 CF               rst  08
          11 01
ROMD:401B CF               rst  08
          41 01
ROMD:401E CF               rst  08
          29 02
ROMD:4021 CD 8E 6E         call 6E8E
ROMD:4024 C1               pop  bc
ROMD:4025 F1               pop  af
ROMD:4026 C9               ret  

Card drop - random card

ROMD:4027 F5               push af
ROMD:4028 D5               push de
ROMD:4029 E5               push hl
ROMD:402A 3E 00            ld   a,00
ROMD:402C EA 9D CE         ld   (CE9D),a
ROMD:402F 3E FF            ld   a,FF
ROMD:4031 EA 9E CE         ld   (CE9E),a      ;PRN[0;255]
ROMD:4034 CD 12 21         call 2112          ;Pseudo-Random Number
ROMD:4037 FA 9F CE         ld   a,(CE9F)
ROMD:403A 5F               ld   e,a
ROMD:403B 3E 00            ld   a,00
ROMD:403D EA 9D CE         ld   (CE9D),a
ROMD:4040 3E 07            ld   a,07
ROMD:4042 EA 9E CE         ld   (CE9E),a      ;PRN[0;7]
ROMD:4045 CD 12 21         call 2112          ;Pseudo-Random Number
ROMD:4048 FA 9F CE         ld   a,(CE9F)
ROMD:404B 57               ld   d,a           ;de = [0;2047]
ROMD:404C 06 00            ld   b,00
ROMD:404E CF               rst  08
          19 02
ROMD:4051 4F               ld   c,a
ROMD:4052 CB 21            sla  c
ROMD:4054 21 72 40         ld   hl,4072
ROMD:4057 09               add  hl,bc
ROMD:4058 2A               ldi  a,(hl)
ROMD:4059 66               ld   h,(hl)
ROMD:405A 6F               ld   l,a           ;hl = pointer to card pool
ROMD:405B 01 00 00         ld   bc,0000       ;card_id = 0
ROMD:405E C5               push bc
ROMD:405F 2A               ldi  a,(hl)
ROMD:4060 4F               ld   c,a
ROMD:4061 2A               ldi  a,(hl)
ROMD:4062 47               ld   b,a           ;bc = card drop rate
ROMD:4063 CD 0F 1D         call 1D0F
ROMD:4066 C1               pop  bc            ;bc = card_id
ROMD:4067 FE 00            cp   a,00
ROMD:4069 28 03            jr   z,406E
ROMD:406B 03               inc  bc            ;bc ++
ROMD:406C 18 F0            jr   405E
ROMD:406E E1               pop  hl
ROMD:406F D1               pop  de
ROMD:4070 F1               pop  af
ROMD:4071 C9               ret  

Card drop - card pools pointers

ROMD:4072
94 40 - Weevil Underwood
6E 43 - Mai Valentine
48 46 - Rex Raptor
22 49 - Mako Tsunami
FC 4B - Yami Yugi
D6 4E - Yugi Muto
B0 51 - Joey Wheeler
8A 54 - Seto Kaiba
64 57 - Mokuba Kaiba
3E 5A - Tristan Taylor
18 5D - Ryou Bakura
F2 5F - Puppeteer of Doom
CC 62 - PaniK
A6 65 - Bandit Keith
80 68 - Maximillion Pegasus
5A 6B - Simon Muran

Card drop - card pools

  • 0x34094-0x36E33 - Card drop pools, cumulative drop rates from 0 to 2048.

Card Password check

  • 0x37151-0x37172 - Card Password check
ROMD:7151 E5               push hl
ROMD:7152 06 00            ld   b,00
ROMD:7154 4F               ld   c,a
ROMD:7155 CB 21            sla  c
ROMD:7157 21 73 71         ld   hl,7173
ROMD:715A 09               add  hl,bc
ROMD:715B 2A               ldi  a,(hl)
ROMD:715C 56               ld   d,(hl)
ROMD:715D 5F               ld   e,a
ROMD:715E 21 A1 CF         ld   hl,CFA1
ROMD:7161 0E 08            ld   c,08
ROMD:7163 1A               ld   a,(de)		// Load next character from valid Password
ROMD:7164 BE               cp   (hl)		// Compare with next character from submitted Password
ROMD:7165 28 02            jr   z,7169		// If it matches, jump to D:7169
ROMD:7167 06 01            ld   b,01		// If the Password is invalid, set b to 1
ROMD:7169 13               inc  de
ROMD:716A 23               inc  hl
ROMD:716B 0D               dec  c
ROMD:716C 20 F5            jr   nz,7163		// Loop until the 8 characters have been checked
ROMD:716E 78               ld   a,b
ROMD:716F E1               pop  hl
ROMD:7170 D1               pop  de
ROMD:7171 C1               pop  bc
ROMD:7172 C9               ret

Card password pointers

  • 0x37173-0x37184 - Card password pointers
85 71 8D 71 95 71 9D 71 A5 71 AD 71 B5 71 BD 71 C5 71

Cards Passwords

  • 0x37185 - Cards Passwords
4C 42 56 48 42 99 43 00 - Fairy's Gift (タカハシカズキ)
60 5B 9C 55 A3 57 67 00 - Flying Penguin (ヤマダノブヒロ)
48 5F 5D 63 47 50 48 00 - Megasonic Eye (シモムラサトシ)
4D 9C 4C 44 32 00 00 00 - Takriminos (チダタクリ)
56 48 5F 50 42 51 46 00 - Kanan the Swordmis (ハシモトカナコ)
27 3E 48 62 48 57 47 00 - Yaranzo (ヘイシヨシヒサ)
43 4C 3F 40 42 99 5C 00 - Stuffed Animal (キタウエカズミ)
50 32 48 5B 42 99 57 46 - Seiyaryu (トリシマカズヒコ)
4C 42 56 48 50 48 5B 47 - Three-legged Zombi (タカハシトシマサ)

Bank E

Graphics 8

  • 0x382A0 - I don't know what this is (some weird shapes, and a worn out mat ?

Bank 10-2D?

Graphics 9

  • 0x40300 - Cards illustrations ?

Bank 3B

Fusion data

  • 0xEC155-0xEF3EE - Fusion data

Bank 3C

Card lores text

  • 0xF036A - 0xF368D - Card lores text

Bank 3E

3E:407A (Called by Button Password 3)

  • 0xF807A-0xF80C0 - Stores value from array at 3E:4660 to (C863)-(C864), (C8A4), (C8A4), and (C902)-(C905)
RO3E:407A E5               push hl
RO3E:407B C5               push bc
RO3E:407C D5               push de
RO3E:407D FE 81            cp   a,81
RO3E:407F 30 40            jr   nc,40C1
RO3E:4081 11 24 C7         ld   de,C724
RO3E:4084 CD 8D 40         call 408D
RO3E:4087 21 00 C7         ld   hl,C700
RO3E:408A C3 CC 40         jp   40CC
RO3E:408D 87               add  a
RO3E:408E 87               add  a
RO3E:408F 21 60 46         ld   hl,4660		// array at 3E:4660
RO3E:4092 06 00            ld   b,00
RO3E:4094 4F               ld   c,a
RO3E:4095 09               add  hl,bc		// Stores value from array at 3E:4660 to...
RO3E:4096 01 02 C9         ld   bc,C902
RO3E:4099 2A               ldi  a,(hl)
RO3E:409A 12               ld   (de),a		// (C863)
RO3E:409B 02               ld   (bc),a		// (C902)
RO3E:409C 03               inc  bc
RO3E:409D E5               push hl
RO3E:409E 21 40 00         ld   hl,0040
RO3E:40A1 19               add  hl,de
RO3E:40A2 E5               push hl
RO3E:40A3 D1               pop  de
RO3E:40A4 E1               pop  hl
RO3E:40A5 2A               ldi  a,(hl)
RO3E:40A6 12               ld   (de),a		// (C864)
RO3E:40A7 02               ld   (bc),a		// (C903)
RO3E:40A8 03               inc  bc
RO3E:40A9 E5               push hl
RO3E:40AA 21 40 00         ld   hl,0040
RO3E:40AD 19               add  hl,de
RO3E:40AE E5               push hl
RO3E:40AF D1               pop  de
RO3E:40B0 E1               pop  hl
RO3E:40B1 2A               ldi  a,(hl)
RO3E:40B2 12               ld   (de),a		// (C8A4)
RO3E:40B3 02               ld   (bc),a		// (C904)
RO3E:40B4 03               inc  bc
RO3E:40B5 E5               push hl
RO3E:40B6 21 40 00         ld   hl,0040
RO3E:40B9 19               add  hl,de
RO3E:40BA E5               push hl
RO3E:40BB D1               pop  de
RO3E:40BC E1               pop  hl
RO3E:40BD 7E               ld   a,(hl)
RO3E:40BE 12               ld   (de),a		// (C8E4)
RO3E:40BF 02               ld   (bc),a		// (C905)
RO3E:40C0 C9               ret

3E:40C1 (to document)

RO3E:40C1 E6 7F            and  a,7F
RO3E:40C3 11 24 C8         ld   de,C824
RO3E:40C6 CD 8D 40         call 408D
RO3E:40C9 21 00 C8         ld   hl,C800
RO3E:40CC 11 02 C9         ld   de,C902
RO3E:40CF 16 80            ld   d,80
RO3E:40D1 06 04            ld   b,04
RO3E:40D3 3E 12            ld   a,12
RO3E:40D5 4F               ld   c,a
RO3E:40D6 7D               ld   a,l
RO3E:40D7 E6 C0            and  a,C0
RO3E:40D9 2E 21            ld   l,21
RO3E:40DB B5               or   l
RO3E:40DC 6F               ld   l,a
RO3E:40DD AF               xor  a
RO3E:40DE 77               ld   (hl),a
RO3E:40DF 7D               ld   a,l
RO3E:40E0 E6 C0            and  a,C0
RO3E:40E2 2E 2F            ld   l,2F
RO3E:40E4 B5               or   l
RO3E:40E5 6F               ld   l,a
RO3E:40E6 AF               xor  a
RO3E:40E7 77               ld   (hl),a
RO3E:40E8 7D               ld   a,l
RO3E:40E9 E6 C0            and  a,C0
RO3E:40EB 2E 2E            ld   l,2E
RO3E:40ED B5               or   l
RO3E:40EE 6F               ld   l,a
RO3E:40EF AF               xor  a
RO3E:40F0 77               ld   (hl),a
RO3E:40F1 7D               ld   a,l
RO3E:40F2 E6 C0            and  a,C0
RO3E:40F4 2E 23            ld   l,23
RO3E:40F6 B5               or   l
RO3E:40F7 6F               ld   l,a
RO3E:40F8 72               ld   (hl),d		// (C823) = 0x80
RO3E:40F9 7D               ld   a,l
RO3E:40FA E6 C0            and  a,C0
RO3E:40FC 2E 35            ld   l,35
RO3E:40FE B5               or   l
RO3E:40FF 6F               ld   l,a
RO3E:4100 AF               xor  a
RO3E:4101 77               ld   (hl),a
RO3E:4102 1A               ld   a,(de)
RO3E:4103 13               inc  de
RO3E:4104 FE 80            cp   a,80
RO3E:4106 30 02            jr   nc,410A
RO3E:4108 AF               xor  a
RO3E:4109 E2               ld   (ff00+c),a
RO3E:410A C5               push bc
RO3E:410B 01 40 00         ld   bc,0040
RO3E:410E 09               add  hl,bc
RO3E:410F C1               pop  bc
RO3E:4110 79               ld   a,c
RO3E:4111 C6 05            add  a,05
RO3E:4113 05               dec  b
RO3E:4114 20 BF            jr   nz,40D5		// Loop 4 times
RO3E:4116 D1               pop  de
RO3E:4117 C1               pop  bc
RO3E:4118 E1               pop  hl
RO3E:4119 C9               ret

3E:411A (to document)

RO3E:411A FA 20 C9         ld   a,(C920)
RO3E:411D FE FF            cp   a,FF
RO3E:411F 28 08            jr   z,4129			// If((C920)==0xFF), jump to 3E:4129
RO3E:4121 CD 7A 40         call 407A
RO3E:4124 3E FF            ld   a,FF
RO3E:4126 EA 20 C9         ld   (C920),a		// (C920) = 0xFF
RO3E:4129 21 0C C9         ld   hl,C90C
RO3E:412C 11 18 C9         ld   de,C918
RO3E:412F 01 12 C9         ld   bc,C912
RO3E:4132 7E               ld   a,(hl)
RO3E:4133 12               ld   (de),a
RO3E:4134 0A               ld   a,(bc)
RO3E:4135 22               ldi  (hl),a
RO3E:4136 03               inc  bc
RO3E:4137 13               inc  de
RO3E:4138 7E               ld   a,(hl)
RO3E:4139 12               ld   (de),a
RO3E:413A 0A               ld   a,(bc)
RO3E:413B 22               ldi  (hl),a
RO3E:413C 03               inc  bc
RO3E:413D 13               inc  de
RO3E:413E 7E               ld   a,(hl)
RO3E:413F 12               ld   (de),a
RO3E:4140 0A               ld   a,(bc)
RO3E:4141 22               ldi  (hl),a
RO3E:4142 03               inc  bc
RO3E:4143 13               inc  de
RO3E:4144 7E               ld   a,(hl)
RO3E:4145 12               ld   (de),a
RO3E:4146 0A               ld   a,(bc)
RO3E:4147 22               ldi  (hl),a
RO3E:4148 03               inc  bc
RO3E:4149 13               inc  de
RO3E:414A 7E               ld   a,(hl)
RO3E:414B 12               ld   (de),a
RO3E:414C 0A               ld   a,(bc)
RO3E:414D 22               ldi  (hl),a
RO3E:414E 03               inc  bc
RO3E:414F 13               inc  de
RO3E:4150 7E               ld   a,(hl)
RO3E:4151 12               ld   (de),a
RO3E:4152 0A               ld   a,(bc)
RO3E:4153 22               ldi  (hl),a
RO3E:4154 03               inc  bc
RO3E:4155 13               inc  de
RO3E:4156 AF               xor  a
RO3E:4157 21 37 C8         ld   hl,C837
RO3E:415A 77               ld   (hl),a
RO3E:415B C5               push bc
RO3E:415C 01 40 00         ld   bc,0040
RO3E:415F 09               add  hl,bc
RO3E:4160 C1               pop  bc
RO3E:4161 AF               xor  a
RO3E:4162 77               ld   (hl),a
RO3E:4163 C5               push bc
RO3E:4164 01 40 00         ld   bc,0040
RO3E:4167 09               add  hl,bc
RO3E:4168 C1               pop  bc
RO3E:4169 AF               xor  a
RO3E:416A 77               ld   (hl),a
RO3E:416B C5               push bc
RO3E:416C 01 40 00         ld   bc,0040
RO3E:416F 09               add  hl,bc
RO3E:4170 C1               pop  bc
RO3E:4171 AF               xor  a
RO3E:4172 77               ld   (hl),a
RO3E:4173 F0 11            ld   a,(ff00+11)
RO3E:4175 EA 1E C9         ld   (C91E),a
RO3E:4178 F0 16            ld   a,(ff00+16)
RO3E:417A EA 1F C9         ld   (C91F),a
RO3E:417D AF               xor  a
RO3E:417E EA 00 C9         ld   (C900),a
RO3E:4181 21 00 C8         ld   hl,C800
RO3E:4184 3E 10            ld   a,10
RO3E:4186 CD F2 41         call 41F2
RO3E:4189 21 0C C9         ld   hl,C90C
RO3E:418C 11 18 C9         ld   de,C918
RO3E:418F 01 12 C9         ld   bc,C912
RO3E:4192 7E               ld   a,(hl)
RO3E:4193 02               ld   (bc),a
RO3E:4194 1A               ld   a,(de)
RO3E:4195 22               ldi  (hl),a
RO3E:4196 03               inc  bc
RO3E:4197 13               inc  de
RO3E:4198 7E               ld   a,(hl)
RO3E:4199 02               ld   (bc),a
RO3E:419A 1A               ld   a,(de)
RO3E:419B 22               ldi  (hl),a
RO3E:419C 03               inc  bc
RO3E:419D 13               inc  de
RO3E:419E 7E               ld   a,(hl)
RO3E:419F 02               ld   (bc),a
RO3E:41A0 1A               ld   a,(de)
RO3E:41A1 22               ldi  (hl),a
RO3E:41A2 03               inc  bc
RO3E:41A3 13               inc  de
RO3E:41A4 7E               ld   a,(hl)
RO3E:41A5 02               ld   (bc),a
RO3E:41A6 1A               ld   a,(de)
RO3E:41A7 22               ldi  (hl),a
RO3E:41A8 03               inc  bc
RO3E:41A9 13               inc  de
RO3E:41AA 7E               ld   a,(hl)
RO3E:41AB 02               ld   (bc),a
RO3E:41AC 1A               ld   a,(de)
RO3E:41AD 22               ldi  (hl),a
RO3E:41AE 03               inc  bc
RO3E:41AF 13               inc  de
RO3E:41B0 7E               ld   a,(hl)
RO3E:41B1 02               ld   (bc),a
RO3E:41B2 1A               ld   a,(de)
RO3E:41B3 22               ldi  (hl),a
RO3E:41B4 03               inc  bc
RO3E:41B5 13               inc  de
RO3E:41B6 21 37 C8         ld   hl,C837
RO3E:41B9 11 37 C7         ld   de,C737
RO3E:41BC 0E 04            ld   c,04
RO3E:41BE 7E               ld   a,(hl)
RO3E:41BF 12               ld   (de),a
RO3E:41C0 C5               push bc
RO3E:41C1 01 40 00         ld   bc,0040
RO3E:41C4 09               add  hl,bc
RO3E:41C5 C1               pop  bc
RO3E:41C6 E5               push hl
RO3E:41C7 21 40 00         ld   hl,0040
RO3E:41CA 19               add  hl,de
RO3E:41CB E5               push hl
RO3E:41CC D1               pop  de
RO3E:41CD E1               pop  hl
RO3E:41CE 0D               dec  c
RO3E:41CF 20 ED            jr   nz,41BE		// Loop 4 times
RO3E:41D1 FA 1E C9         ld   a,(C91E)
RO3E:41D4 E0 11            ld   (ff00+11),a
RO3E:41D6 FA 1F C9         ld   a,(C91F)
RO3E:41D9 E0 16            ld   (ff00+16),a
RO3E:41DB AF               xor  a
RO3E:41DC EA 00 C9         ld   (C900),a
RO3E:41DF 21 00 C7         ld   hl,C700
RO3E:41E2 3E 10            ld   a,10
RO3E:41E4 CD F2 41         call 41F2
RO3E:41E7 FA 0A C9         ld   a,(C90A)
RO3E:41EA E0 24            ld   (ff00+24),a
RO3E:41EC FA 0B C9         ld   a,(C90B)
RO3E:41EF E0 25            ld   (ff00+25),a
RO3E:41F1 C9               ret

3E:41F2 (to document)

RO3E:41F2 EA 01 C9         ld   (C901),a
RO3E:41F5 7D               ld   a,l
RO3E:41F6 E6 C0            and  a,C0
RO3E:41F8 2E 24            ld   l,24
RO3E:41FA B5               or   l
RO3E:41FB 6F               ld   l,a
RO3E:41FC 7E               ld   a,(hl)
RO3E:41FD 0E 80            ld   c,80
RO3E:41FF B9               cp   c
RO3E:4200 30 34            jr   nc,4236
RO3E:4202 71               ld   (hl),c
RO3E:4203 87               add  a
RO3E:4204 C6 F0            add  a,F0
RO3E:4206 5F               ld   e,a
RO3E:4207 3E 00            ld   a,00
RO3E:4209 CE 46            adc  a,46
RO3E:420B 57               ld   d,a
RO3E:420C 7D               ld   a,l
RO3E:420D E6 C0            and  a,C0
RO3E:420F 2E 22            ld   l,22
RO3E:4211 B5               or   l
RO3E:4212 6F               ld   l,a
RO3E:4213 1A               ld   a,(de)
RO3E:4214 77               ld   (hl),a		// (C822) = a
RO3E:4215 13               inc  de
RO3E:4216 2C               inc  l
RO3E:4217 1A               ld   a,(de)
RO3E:4218 77               ld   (hl),a
RO3E:4219 F5               push af
RO3E:421A 7D               ld   a,l
RO3E:421B E6 C0            and  a,C0
RO3E:421D 2E 20            ld   l,20
RO3E:421F B5               or   l
RO3E:4220 6F               ld   l,a
RO3E:4221 F1               pop  af
RO3E:4222 36 1F            ld   (hl),1F		// (C820) = 0x1F
RO3E:4224 7D               ld   a,l
RO3E:4225 E6 C0            and  a,C0
RO3E:4227 2E 2F            ld   l,2F
RO3E:4229 B5               or   l
RO3E:422A 6F               ld   l,a
RO3E:422B AF               xor  a
RO3E:422C 77               ld   (hl),a
RO3E:422D 7D               ld   a,l
RO3E:422E E6 C0            and  a,C0
RO3E:4230 2E 21            ld   l,21
RO3E:4232 B5               or   l
RO3E:4233 6F               ld   l,a
RO3E:4234 AF               xor  a
RO3E:4235 77               ld   (hl),a
RO3E:4236 7D               ld   a,l
RO3E:4237 E6 C0            and  a,C0
RO3E:4239 2E 23            ld   l,23
RO3E:423B B5               or   l
RO3E:423C 6F               ld   l,a
RO3E:423D 7E               ld   a,(hl)
RO3E:423E B9               cp   c
RO3E:423F 30 37            jr   nc,4278
RO3E:4241 7D               ld   a,l
RO3E:4242 E6 C0            and  a,C0
RO3E:4244 2E 2F            ld   l,2F
RO3E:4246 B5               or   l
RO3E:4247 6F               ld   l,a
RO3E:4248 7E               ld   a,(hl)
RO3E:4249 F5               push af
RO3E:424A 7D               ld   a,l
RO3E:424B E6 C0            and  a,C0
RO3E:424D 2E 21            ld   l,21
RO3E:424F B5               or   l
RO3E:4250 6F               ld   l,a
RO3E:4251 F1               pop  af
RO3E:4252 96               sub  (hl)
RO3E:4253 38 0D            jr   c,4262
RO3E:4255 F5               push af
RO3E:4256 7D               ld   a,l
RO3E:4257 E6 C0            and  a,C0
RO3E:4259 2E 2F            ld   l,2F
RO3E:425B B5               or   l
RO3E:425C 6F               ld   l,a
RO3E:425D F1               pop  af
RO3E:425E 77               ld   (hl),a
RO3E:425F CD 88 44         call 4488
RO3E:4262 7D               ld   a,l
RO3E:4263 E6 C0            and  a,C0
RO3E:4265 2E 2F            ld   l,2F
RO3E:4267 B5               or   l
RO3E:4268 6F               ld   l,a
RO3E:4269 FA 0C C9         ld   a,(C90C)
RO3E:426C 86               add  (hl)
RO3E:426D 77               ld   (hl),a
RO3E:426E 7D               ld   a,l
RO3E:426F E6 C0            and  a,C0
RO3E:4271 2E 37            ld   l,37
RO3E:4273 B5               or   l
RO3E:4274 6F               ld   l,a
RO3E:4275 3E FF            ld   a,FF
RO3E:4277 77               ld   (hl),a
RO3E:4278 FA 00 C9         ld   a,(C900)
RO3E:427B 3C               inc  a
RO3E:427C EA 00 C9         ld   (C900),a
RO3E:427F C5               push bc
RO3E:4280 01 40 00         ld   bc,0040
RO3E:4283 09               add  hl,bc
RO3E:4284 C1               pop  bc
RO3E:4285 FA 01 C9         ld   a,(C901)
RO3E:4288 C6 05            add  a,05
RO3E:428A FE 24            cp   a,24
RO3E:428C 30 03            jr   nc,4291
RO3E:428E C3 F2 41         jp   41F2
RO3E:4291 FA 08 C9         ld   a,(C908)
RO3E:4294 3C               inc  a
RO3E:4295 EA 08 C9         ld   (C908),a
RO3E:4298 E6 1F            and  a,1F
RO3E:429A 5F               ld   e,a
RO3E:429B FA 0E C9         ld   a,(C90E)
RO3E:429E 47               ld   b,a
RO3E:429F E6 70            and  a,70
RO3E:42A1 4F               ld   c,a
RO3E:42A2 CB 31            swap c
RO3E:42A4 B1               or   c
RO3E:42A5 EA 0A C9         ld   (C90A),a
RO3E:42A8 1D               dec  e
RO3E:42A9 20 13            jr   nz,42BE
RO3E:42AB FA 10 C9         ld   a,(C910)
RO3E:42AE 80               add  b
RO3E:42AF 4F               ld   c,a
RO3E:42B0 A8               xor  b
RO3E:42B1 07               rlca 
RO3E:42B2 30 06            jr   nc,42BA
RO3E:42B4 79               ld   a,c
RO3E:42B5 07               rlca 
RO3E:42B6 07               rlca 
RO3E:42B7 9F               sbc  a
RO3E:42B8 2F               cpl  
RO3E:42B9 4F               ld   c,a
RO3E:42BA 79               ld   a,c
RO3E:42BB EA 0E C9         ld   (C90E),a
RO3E:42BE FA 0F C9         ld   a,(C90F)
RO3E:42C1 4F               ld   c,a
RO3E:42C2 FA 0E C9         ld   a,(C90E)
RO3E:42C5 A7               and  a
RO3E:42C6 20 02            jr   nz,42CA
RO3E:42C8 0E 00            ld   c,00
RO3E:42CA 79               ld   a,c
RO3E:42CB EA 0B C9         ld   (C90B),a
RO3E:42CE C9               ret

3E:4660 (array for (C863) to (C864), (C8A4), (C8E4), and (C902) to (C905))

RO3E:4660
00 01 02 03
04 05 06 07 - Title Screen
08 09 0A 0B
0C 0D 0E 0F - Character speech
10 11 12 13
14 15 16 17
18 19 1A 1B - Campaign, Duel Records
1C 1D 1E 1F - Password Screen
20 21 22 23
24 25 26 27 - Pre-Duel screen
28 29 2A 2B
2C 2D 2E 2F - Tea speech
30 31 32 33 - Duel win
34 35 36 37
38 39 3A 3B
3C 3D 3E 3F
40 41 42 43
80 80 80 80
44 45 80 80
80 46 80 80
80 47 80 80 - Duel screen
80 48 80 80
49 80 80 80
4A 80 80 80
4B 80 80 80 - Card trunk
80 4C 80 80 - Card trunk, Deck list, Card display
80 4D 80 80 - Pre-Duel screen
80 4E 80 80 - Duel Screen
80 80 80 4F
50 80 80 80 - Button Password #3
51 80 80 80
52 80 80 80
53 54 80 80
80 80 80 55 - Button Password #2 (Wipe out save file)
80 80 80 56
57 80 80 58

Sound

  • 0xF86F0 - 0xF8BFF - Sound track

Bank 3F

3F:404E (to document)

RO3F:404E F5               push af
RO3F:404F C5               push bc
RO3F:4050 D5               push de
RO3F:4051 E5               push hl
RO3F:4052 FE 00            cp   a,00
RO3F:4054 20 70            jr   nz,40C6
RO3F:4056 3E 00            ld   a,00
RO3F:4058 E0 47            ld   (ff00+47),a
RO3F:405A 21 40 FF         ld   hl,FF40
RO3F:405D CB FE            set  7,(hl)
RO3F:405F 21 21 44         ld   hl,4421
RO3F:4062 CD 14 41         call 4114
RO3F:4065 1E 00            ld   e,00
RO3F:4067 F0 44            ld   a,(ff00+44)
RO3F:4069 FE 00            cp   a,00
RO3F:406B 20 FA            jr   nz,4067
RO3F:406D F0 44            ld   a,(ff00+44)
RO3F:406F FE 90            cp   a,90
RO3F:4071 38 FA            jr   c,406D
RO3F:4073 16 0A            ld   d,0A
RO3F:4075 3E 20            ld   a,20
RO3F:4077 E0 00            ld   (ff00+00),a
RO3F:4079 F0 00            ld   a,(ff00+00)
RO3F:407B F0 00            ld   a,(ff00+00)
RO3F:407D 3E 10            ld   a,10
RO3F:407F E0 00            ld   (ff00+00),a
RO3F:4081 F0 00            ld   a,(ff00+00)
RO3F:4083 F0 00            ld   a,(ff00+00)
RO3F:4085 F0 00            ld   a,(ff00+00)
RO3F:4087 F0 00            ld   a,(ff00+00)
RO3F:4089 F0 00            ld   a,(ff00+00)
RO3F:408B F0 00            ld   a,(ff00+00)
RO3F:408D 3E 30            ld   a,30
RO3F:408F E0 00            ld   (ff00+00),a
RO3F:4091 3E 30            ld   a,30
RO3F:4093 E0 00            ld   (ff00+00),a
RO3F:4095 3E 30            ld   a,30
RO3F:4097 E0 00            ld   (ff00+00),a
RO3F:4099 3E 30            ld   a,30
RO3F:409B E0 00            ld   (ff00+00),a
RO3F:409D F0 00            ld   a,(ff00+00)
RO3F:409F FE FE            cp   a,FE
RO3F:40A1 20 02            jr   nz,40A5
RO3F:40A3 1E 01            ld   e,01
RO3F:40A5 15               dec  d
RO3F:40A6 20 CD            jr   nz,4075
RO3F:40A8 21 31 44         ld   hl,4431
RO3F:40AB CD 14 41         call 4114
RO3F:40AE 16 00            ld   d,00
RO3F:40B0 06 00            ld   b,00
RO3F:40B2 CB 23            sla  e
RO3F:40B4 0E 00            ld   c,00
RO3F:40B6 F0 DD            ld   a,(ff00+DD)
RO3F:40B8 FE FF            cp   a,FF
RO3F:40BA 20 02            jr   nz,40BE
RO3F:40BC 0E 01            ld   c,01
RO3F:40BE 21 CB 40         ld   hl,40CB
RO3F:40C1 19               add  hl,de
RO3F:40C2 09               add  hl,bc		// hl = 0x40CB + de + bc
RO3F:40C3 7E               ld   a,(hl)		// Load value from the array at 3F:40CB
RO3F:40C4 E0 DE            ld   (ff00+DE),a
RO3F:40C6 E1               pop  hl
RO3F:40C7 D1               pop  de
RO3F:40C8 C1               pop  bc
RO3F:40C9 F1               pop  af
RO3F:40CA C9               ret  

Gaming consoles array

RO3F:40CB
00 - Game Boy Color
01 
02 - Game Boy
03 - Super Game Boy 2

3F:4114 (to document)

RO3F:4114 F5               push af
RO3F:4115 C5               push bc
RO3F:4116 D5               push de
RO3F:4117 F0 44            ld   a,(ff00+44)
RO3F:4119 FE 90            cp   a,90
RO3F:411B 38 FA            jr   c,4117
RO3F:411D 3E 30            ld   a,30
RO3F:411F E0 00            ld   (ff00+00),a
RO3F:4121 3E 00            ld   a,00
RO3F:4123 E0 00            ld   (ff00+00),a
RO3F:4125 3E 30            ld   a,30
RO3F:4127 E0 00            ld   (ff00+00),a
RO3F:4129 16 10            ld   d,10
RO3F:412B 2A               ldi  a,(hl)
RO3F:412C 47               ld   b,a
RO3F:412D 1E 08            ld   e,08
RO3F:412F CB 38            srl  b
RO3F:4131 38 0A            jr   c,413D
RO3F:4133 3E 20            ld   a,20
RO3F:4135 E0 00            ld   (ff00+00),a
RO3F:4137 3E 30            ld   a,30
RO3F:4139 E0 00            ld   (ff00+00),a
RO3F:413B 18 08            jr   4145
RO3F:413D 3E 10            ld   a,10
RO3F:413F E0 00            ld   (ff00+00),a
RO3F:4141 3E 30            ld   a,30
RO3F:4143 E0 00            ld   (ff00+00),a
RO3F:4145 1D               dec  e
RO3F:4146 20 E7            jr   nz,412F
RO3F:4148 15               dec  d
RO3F:4149 20 E0            jr   nz,412B
RO3F:414B 3E 20            ld   a,20
RO3F:414D E0 00            ld   (ff00+00),a
RO3F:414F 3E 30            ld   a,30
RO3F:4151 E0 00            ld   (ff00+00),a
RO3F:4153 CD 5A 41         call 415A
RO3F:4156 D1               pop  de
RO3F:4157 C1               pop  bc
RO3F:4158 F1               pop  af
RO3F:4159 C9               ret

Graphics 10

  • 0xFCDA0 - Millenium tablet (Stage 3 / 4 / 5 opponents background)