X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/f6fa1d6e1393de5d18302b8674ed1616afdfcefb..4d90f272baf43caf90927ca7e893518d526649e5:/diag.asm diff --git a/diag.asm b/diag.asm index 8e09874..bc164a0 100644 --- a/diag.asm +++ b/diag.asm @@ -32,6 +32,8 @@ main: ld hl, signon call puts + + call putscreen ei @@ -48,6 +50,66 @@ main: signon: db $0D,$0A,$1B,"[1mFPGABoy Diagnostic ROM",$1B,"[0m",$0D,$0A,0 +putscreen: + ; Wait for vblank +;.stat: ld a, [$FF41] ; STAT +; and $03 ; mode +; cp $01 ; VBLANK +;' jp nz, .stat + + ld hl, $8000 ; Copy two tiles. + ld a, $AA + ld [hli], a + ld [hli], a + ld a, $55 + ld [hli], a + ld [hli], a + ld a, $AA + ld [hli], a + ld [hli], a + ld a, $55 + ld [hli], a + ld [hli], a + ld a, $AA + ld [hli], a + ld [hli], a + ld a, $55 + ld [hli], a + ld [hli], a + ld a, $AA + ld [hli], a + ld [hli], a + ld a, $55 + ld [hli], a + ld [hli], a + xor a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + + ld hl, $9800 +.loop: ld a, $01 + ld [hli], a + xor a + ld [hli], a + ld a, h + cp $9C + jp nz,.loop + ret + vbl: PUSH AF PUSH BC @@ -61,6 +123,11 @@ vbl: ld a, [c] inc a ld [c], a + + ld c, $43 ; SCX + ld a, [c] + inc a + ld [c], a POP HL POP DE