Make the boot rom talk a bit more, and wait for you to flip a switch. Make the 'progr...
[fpgaboy.git] / fpgaboot.asm
CommitLineData
49c326da 1 SECTION "boot", HOME[$0]
1eefdc8e 2boot: ld a, $AA
49c326da 3 ld [$FF51], A ; Poke the LEDs
1eefdc8e
JW
4
5 ld sp, $FFFE
6
7 ld hl, signon
8 call puts
49c326da
JW
9
10 ; Write a little bit to the RAM
1eefdc8e
JW
11 ld hl, $0104
12 xor a
49c326da
JW
13 ld [HLI], A
14 ld [HLI], A
15 ld [HLI], A
16 ld [HLI], A
17 ld [HLI], A
18 ld [HLI], A
19 ld [HLI], A
20 ld [HLI], A
21
49c326da
JW
22 ld A, $FF
23 ld [HLI], A
24 ld [HLI], A
25 ld [HLI], A
26 ld [HLI], A
27 ld [HLI], A
28 ld [HLI], A
29 ld [HLI], A
30 ld [HLI], A
31
1eefdc8e 32 ld c, $51
49c326da 33
1eefdc8e
JW
34.wait: ld a, [c]
35 cp $00
36 jr nz, .wait
37
38 ld h, a
39 ld l, a
40 ld [hl], $01 ; Select the GB boot rom
41
42 ld a, $55
43 ld [c], a
44
45 ld hl, booting
46 call puts
47
48 rst $00 ; Boot
49
50putc:
51 ld c, $53
52 push af
53.waitport:
54 ld a,[c]
55 cp $00
56 jr nz,.waitport
57 pop af
58 ld [$FF52],a
59 ret
60
61puts:
62 ld a, [hli]
63 cp $00
64 ret z
65 call putc
66 jr puts
67
68signon:
69 db $0D,$0A,$1B,"[1mFPGABoy Boot ROM",$1B,"[0m",$0D,$0A,0
70booting:
71 db "Booting...",$0D,$0A,0
72
73
49c326da
JW
74 SECTION "a", HOME[$100]
75 nop ; Make sure we don't overflow.
76
This page took 0.025911 seconds and 4 git commands to generate.