4 ld c, $51 ; Note that we are alive.
11 ld a, $04 ;start timer, 4.096KHz
34 db $0D,$0A,$1B,"[1mFPGABoy Diagnostic ROM",$1B,"[0m",$0D,$0A,0
36 section "fuq",HOME[$100]
44 ld c, $0F ; ack the irq
64 db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE
65 db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE
66 db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE
68 ; Memory tester: writes h ^ l to all addresses from C000 to DF80.
73 ld hl, $C001 ; Write loop
85 ld hl, $C001 ; Read loop
101 ld hl, testokstr ; Say we're OK
104 .memfail: ; Say we failed (sadface)
105 ; decrement hl the easy way
121 db "Testing memory from $C000 to $DF80...",0
125 db " Test failed at $",0
127 puthex: ; Put two hex nibbles to the serial console.
146 ; Wait for switches to be flipped on and off again.
167 db "Diagnostic ROM complete; flip switches to nonzero and then to zero to reset. Expect A.",$0D,$0A,0
169 ; Core instruction basic acceptance tests.
254 db "Testing instructions... ",0
272 db " test failed.",$0D,$0A,0
276 ; Serial port manipulation functions.