3 LD SP,$fffe ; $0000 Setup Stack
5 XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM)
10 JR NZ, Addr_0007 ; $000a
12 LD HL,$ff26 ; $000c Setup Audio
24 LD A,$fc ; $001d Setup BG palette
27 LD DE,$0104 ; $0021 Convert and load logo data from cart into Video RAM
36 JR NZ, Addr_0027 ; $0032
38 LD DE,Addr_00D8 ; $0034 Load 8 additional bytes into Video RAM
46 JR NZ, Addr_0039 ; $003e
48 LD A,$19 ; $0040 Setup background tilemap
55 JR Z, Addr_0055 ; $004b
58 JR NZ, Addr_004A ; $004f
62 ; === Scroll logo on screen, and play logo sound===
65 LD H,A ; $0055 Initialize scroll count, H=0
67 LD D,A ; $0058 set loop count, D=$64
68 LD [$FF42],A ; $0059 Set vertical scroll register
70 LD [$FF40],A ; $005d Turn on LCD, showing Background
77 LD A,[$FF44] ; $0064 wait for screen frame
79 JR NZ, Addr_0064 ; $0068
81 JR NZ, Addr_0064 ; $006b
83 JR NZ, Addr_0062 ; $006e
86 INC H ; $0072 increment scroll count
89 CP $62 ; $0076 $62 counts in, play sound #1
90 JR Z, Addr_0080 ; $0078
93 JR NZ, Addr_0086 ; $007e $64 counts in, play sound #2
95 LD A,E ; $0080 play sound
103 LD [$FF42],A ; $0089 scroll logo up if B=1
105 JR NZ, Addr_0060 ; $008c
107 DEC B ; $008e set B=0 first time
108 JR NZ, Addr_00E0 ; $008f ... next time, cause jump to "Nintendo Logo check"
110 LD D,$20 ; $0091 use scrolling loop to pause
113 ; ==== Graphic routine ====
115 a95: LD C,A ; $0095 "Double up" all the bits of the graphics data
116 a96: LD B,$04 ; $0096 and store in Video RAM
125 JR NZ, Addr_0098 ; $00a1
134 DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C,$00,$0D
135 DB $00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6,$DD,$DD,$D9,$99
136 DB $BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC,$99,$9F,$BB,$B9,$33,$3E
140 DB $3C,$42,$B9,$A5,$B9,$A5,$42,$3C
142 ; ===== Nintendo logo comparison routine =====
145 LD HL,$0104 ; $00e0 ; point HL to Nintendo logo in cart
146 LD DE,NintendoLogo ; $00e3 ; point DE to Nintendo logo in DMG rom
151 CP [HL] ; $00e8 ;compare logo data in cart to DMG rom
152 .fuq JR NZ,.fuq ; $00e9 ;if not a match, lock up here
155 CP $34 ; $00ed ;do this for $30 bytes
156 JR NZ, Addr_00E6 ; $00ef
164 JR NZ, Addr_00F4 ; $00f7
166 .fuq: JR NZ,.fuq ; $00fa ; if $19 + bytes from $0134-$014D don't add to $00
170 LD [$FF50],A ; $00fe ;turn off DMG rom
173 SECTION "b",HOME[$100]
174 boot: jr .running ; $0100
177 ;Nintendo Logo ; $0104
178 DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C,$00,$0D
179 DB $00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6,$DD,$DD,$D9,$99
180 DB $BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC,$99,$9F,$BB,$B9,$33,$3E
182 DB $00,$E7,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$00,$00
184 DB $00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$00,$00