4 ld c, $51 ; Note that we are alive.
11 ld a, $04 ;start timer, 4.096KHz
35 db $0D,$0A,$1B,"[1mFPGABoy Diagnostic ROM",$1B,"[0m",$0D,$0A,0
37 section "fuq",HOME[$100]
45 ld c, $0F ; ack the irq
66 ; Memory tester: writes h ^ l to all addresses from C000 to DF80.
71 ld hl, $C001 ; Write loop
83 ld hl, $C001 ; Read loop
99 ld hl, testokstr ; Say we're OK
102 .memfail: ; Say we failed (sadface)
103 ; decrement hl the easy way
119 db "Testing memory from $C000 to $DF80...",0
123 db " Test failed at $",0
125 puthex: ; Put two hex nibbles to the serial console.
140 ; Wait for switches to be flipped on and off again.
164 db "Diagnostic ROM complete; flip switches to nonzero and then to zero to reset. Expect A.",$0D,$0A,0
166 ; Core instruction basic acceptance tests.
241 ld c, $0F ; First, wait until an interrupt happens...
245 ei ; Now make sure that an IRQ didn't happen on EI/DI
250 ei ; Make sure that an IRQ does happen on EI/NOP/DI
268 db "Testing instructions... ",0
288 db " test failed.",$0D,$0A,0
292 ; Serial port manipulation functions.