]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - fpgaboot.asm
Make the boot rom talk a bit more, and wait for you to flip a switch. Make the 'progr...
[fpgaboy.git] / fpgaboot.asm
index a9236579c3874079fef0f287eb031251fb1383a0..4a1089f522eb0257ce91549f53ae057eeff5aedc 100644 (file)
@@ -1,11 +1,15 @@
        SECTION "boot", HOME[$0]
-       ld a, $AA
+boot:  ld a, $AA
        ld [$FF51], A   ; Poke the LEDs
+
+       ld sp, $FFFE
+       
+       ld hl, signon
+       call puts
        
        ; Write a little bit to the RAM
-       ld H, $01
-       ld L, $00
-       ld A, $00
+       ld hl, $0104
+       xor a
        ld [HLI], A
        ld [HLI], A
        ld [HLI], A
@@ -15,9 +19,6 @@
        ld [HLI], A
        ld [HLI], A
        
-       ld a, $55
-       ld [$FF51], A   ; Poke the LEDs
-       
        ld A, $FF
        ld [HLI], A
        ld [HLI], A
        ld [HLI], A
        ld [HLI], A
        
-       ld H, $00
-       ld L, $00
-       ld [HL], $01    ; Select the GB boot rom
-       rst $00         ; Boot
+       ld c, $51
        
+.wait: ld a, [c]
+       cp $00
+       jr nz, .wait
+
+       ld h, a
+       ld l, a
+       ld [hl], $01    ; Select the GB boot rom
+       
+       ld a, $55
+       ld [c], a
+       
+       ld hl, booting
+       call puts
+       
+       rst $00         ; Boot
+
+putc:
+       ld c, $53
+       push af
+.waitport:
+       ld a,[c]
+       cp $00
+       jr nz,.waitport
+       pop af
+       ld [$FF52],a
+       ret
+
+puts:
+       ld a, [hli]
+       cp $00
+       ret z
+       call putc
+       jr puts
+
+signon:
+       db $0D,$0A,$1B,"[1mFPGABoy Boot ROM",$1B,"[0m",$0D,$0A,0
+booting:
+       db "Booting...",$0D,$0A,0
+
+
        SECTION "a", HOME[$100]
        nop     ; Make sure we don't overflow.
        
\ No newline at end of file
This page took 0.024991 seconds and 4 git commands to generate.