]> Joshua Wise's Git repositories - fpgaboy.git/blame_incremental - flashboot.asm
IP
[fpgaboy.git] / flashboot.asm
... / ...
CommitLineData
1 SECTION "wee",HOME[$0]
2 ld sp, $CFFF
3
4 ld hl, loading+$D800
5 call puts+$D800
6
7 ld a, $FF ; Put the thing in read array mode.
8 ld [$FF65], a
9
10 xor a
11 ld d, a
12 ld e, a
13
14loop: ld a, $04
15 cp d
16 jr z,done
17
18 xor c
19ifl: ld a, d ; Set up for the flash read.
20 ld [$FF60], a
21 ld a, e
22 ld [$FF61], a
23 ld a, c
24 ld [$FF62], a
25 ld a, [$FF65]
26 ld b, a
27 ld a, d ; Set up for the flash read.
28 ld [$FF60], a
29 ld a, e
30 ld [$FF61], a
31 ld a, c
32 ld [$FF62], a
33 ld a, b
34 ld [$FF63], a
35 inc c
36 jr nz, ifl
37
38 ld a, $2E ;.
39 call putc+$D800
40
41 inc de
42 jr loop
43done:
44 ld hl, booting+$D800
45 call puts+$D800
46
47 xor a
48 ld h, a
49 ld l, a
50 ld [hl], $01 ; Select the GB boot rom
51
52 rst $00 ; Boot
53
54putc:
55 push bc
56 ld c, $53
57 push af
58.waitport:
59 ld a,[c]
60 and $01
61 jr nz,.waitport
62 pop af
63 ld [$FF52],a
64 pop bc
65 ret
66
67loading:
68 db "Loading...",0
69booting:
70 db $0D,$0A,"Booting...",$0D,$0A,0
71
72puts:
73 ld a, [hli]
74 cp $00
75 ret z
76 call putc+$D800
77 jr puts
78
79 section "a", HOME[$FF]
80 nop
This page took 0.028911 seconds and 5 git commands to generate.