9 ld a, $04 ;start timer, 4.096KHz
33 db $0D,$0A,$1B,"[1mFPGABoy Diagnostic ROM",$1B,"[0m",$0D,$0A,0
35 section "fuq",HOME[$100]
62 ; Memory tester: writes h ^ l to all addresses from C000 to DF80.
67 ld hl, $C001 ; Write loop
79 ld hl, $C001 ; Read loop
95 ld hl, testokstr ; Say we're OK
98 .memfail: ; Say we failed (sadface)
99 ; decrement hl the easy way
115 db "Testing memory from $C000 to $DF80...",0
119 db " Test failed at $",0
121 puthex: ; Put two hex nibbles to the serial console.
136 ; Wait for switches to be flipped on and off again.
160 db "Diagnostic ROM complete; flip switches to nonzero and then to zero to reset. Expect A.",$0D,$0A,0
162 ; Core instruction basic acceptance tests.
237 ld c, $0F ; First, wait until an interrupt happens...
241 ei ; Now make sure that an IRQ didn't happen on EI/DI
246 ei ; Make sure that an IRQ does happen on EI/NOP/DI
264 db "Testing instructions... ",0
284 db " test failed.",$0D,$0A,0
288 ; Serial port manipulation functions.