X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/5bac4cf0a60acac6826eb3215e1526d48ba8f7ac..fc443a4f61b38236a17ab2928bd90327edc68266:/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