- SECTION "a",HOME[$00]
-
- LD SP,$fffe ; $0000 Setup Stack
-
- XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM)
- LD HL,$9fff ; $0004
-Addr_0007:
- LD [HLD],A ; $0007
- BIT 7,H ; $0008
- JR NZ, Addr_0007 ; $000a
-
- LD HL,$ff26 ; $000c Setup Audio
- LD C,$11 ; $000f
- LD A,$80 ; $0011
- LD [HLD],A ; $0013
- LD [C],A ; $0014
- INC C ; $0015
- LD A,$f3 ; $0016
- LD [C],A ; $0018
- LD [HLD],A ; $0019
- LD A,$77 ; $001a
- LD [HLD],A ; $001c
-
- LD A,$fc ; $001d Setup BG palette
- LD [$FF47],A ; $001f
-
- LD DE,$0104 ; $0021 Convert and load logo data from cart into Video RAM
- LD HL,$8010 ; $0024
-Addr_0027:
- LD A,[DE] ; $0027
- CALL $0095 ; $0028
- CALL $0096 ; $002b
- INC DE ; $002e
- LD A,E ; $002f
- CP $34 ; $0030
- JR NZ, Addr_0027 ; $0032
-
- LD DE,$00d8 ; $0034 Load 8 additional bytes into Video RAM
- LD B,$08 ; $0037
-Addr_0039:
- LD A,[DE] ; $0039
- INC DE ; $003a
- LD [HLI],A ; $003b
- INC HL ; $003c
- DEC B ; $003d
- JR NZ, Addr_0039 ; $003e
-
- LD A,$19 ; $0040 Setup background tilemap
- LD [$9910],A ; $0042
- LD HL,$992f ; $0045
-Addr_0048:
- LD C,$0c ; $0048
-Addr_004A:
- DEC A ; $004a
- JR Z, Addr_0055 ; $004b
- LD [HLD],A ; $004d
- DEC C ; $004e
- JR NZ, Addr_004A ; $004f
- LD L,$0f ; $0051
- JR Addr_0048 ; $0053
-
- ; === Scroll logo on screen, and play logo sound===
-
-Addr_0055:
- LD H,A ; $0055 Initialize scroll count, H=0
- LD A,$64 ; $0056
- LD D,A ; $0058 set loop count, D=$64
- LD [$FF42],A ; $0059 Set vertical scroll register
- LD A,$91 ; $005b
- LD [$FF40],A ; $005d Turn on LCD, showing Background
- INC B ; $005f Set B=1
-Addr_0060:
- LD E,$02 ; $0060
-Addr_0062:
- LD C,$0c ; $0062
-Addr_0064:
- LD A,[$FF44] ; $0064 wait for screen frame
- CP $90 ; $0066
- JR NZ, Addr_0064 ; $0068
- DEC C ; $006a
- JR NZ, Addr_0064 ; $006b
- DEC E ; $006d
- JR NZ, Addr_0062 ; $006e
-
- LD C,$13 ; $0070
- INC H ; $0072 increment scroll count
- LD A,H ; $0073
- LD E,$83 ; $0074
- CP $62 ; $0076 $62 counts in, play sound #1
- JR Z, Addr_0080 ; $0078
- LD E,$c1 ; $007a
- CP $64 ; $007c
- JR NZ, Addr_0086 ; $007e $64 counts in, play sound #2
-Addr_0080:
- LD A,E ; $0080 play sound
- LD [C],A ; $0081
- INC C ; $0082
- LD A,$87 ; $0083
- LD [C],A ; $0085
-Addr_0086:
- LD A,[$FF42] ; $0086
- SUB B ; $0088
- LD [$FF42],A ; $0089 scroll logo up if B=1
- DEC D ; $008b
- JR NZ, Addr_0060 ; $008c
-
- DEC B ; $008e set B=0 first time
- JR NZ, Addr_00E0 ; $008f ... next time, cause jump to "Nintendo Logo check"
-
- LD D,$20 ; $0091 use scrolling loop to pause
- JR Addr_0060 ; $0093
-
- ; ==== Graphic routine ====
-
- LD C,A ; $0095 "Double up" all the bits of the graphics data
- LD B,$04 ; $0096 and store in Video RAM
-Addr_0098:
- PUSH BC ; $0098
- RL C ; $0099
- RLA ; $009b
- POP BC ; $009c
- RL C ; $009d
- RLA ; $009f
- DEC B ; $00a0
- JR NZ, Addr_0098 ; $00a1
- LD [HLI],A ; $00a3
- INC HL ; $00a4
- LD [HLI],A ; $00a5
- INC HL ; $00a6
- RET ; $00a7
-
-Addr_00A8:
- ;Nintendo Logo