X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/179b434745a7b2da871d69c201dd1bda3e445f41..30ef1ae0e1d60f55aee401ad9741cb8d5a0feef0:/diag.asm?ds=sidebyside diff --git a/diag.asm b/diag.asm index 68ea3f8..004935a 100644 --- a/diag.asm +++ b/diag.asm @@ -7,20 +7,64 @@ main: ld sp, $DFF0 + ld c, $07 + ld a, $04 ;start timer, 4.096KHz + ld [c], a + + ld hl, $DF81 + xor a + ld [hl], a + ld hl, signon call puts + + ei call memtest call insntest call waitsw + + di jr main signon: db $0D,$0A,$1B,"[1mFPGABoy Diagnostic ROM",$1B,"[0m",$0D,$0A,0 + section "fuq",HOME[$100] +irqhand: + PUSH AF + PUSH BC + PUSH DE + PUSH HL + + xor a + ld c, $0F ; ack the irq + ld [c], a + + ld a, $41 ; print A + call putc + + ld hl, $DF81 + ld a, [hl] + ld b, 1 + add b + ld c, $51 + ld [c], a + ld [hl], a + + + POP HL + POP DE + POP BC + POP AF + RETI + db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE + db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE + db $18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE,$18,$FE + ; Memory tester: writes h ^ l to all addresses from C000 to DF80. memtest: ld hl,memteststr