X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/5bac4cf0a60acac6826eb3215e1526d48ba8f7ac..01878f5fdca9d08e4cf7ceed7f5a39f4df602de4:/rom.asm?ds=sidebyside diff --git a/rom.asm b/rom.asm index 6989b2d..1504c71 100644 --- a/rom.asm +++ b/rom.asm @@ -1,25 +1,25 @@ SECTION "a",HOME main: - ld c, $51 ; Note that we are alive. - ld a, $FF - ld [c],a + ld a, $FF ; Note that we are alive. + ld [$FF51],a ld sp, $DFF0 -; ld hl, $DF81 -; ld a, $80 -; ld [hl], a + ld hl, $DF81 + ld a, $80 + ld [hl], a -; ld c, $07 -; ld a, $07 ;start timer, 4.096KHz -; ld [c], a + ld c, $07 + ld a, $04 ;start timer, 4.096KHz + ld [c], a ;diqs: ei ; ld a, $80 ; ld c, $51 ; ld [c], a ; jr diqs call irqhand + ei coqs: jr coqs section "Diq", HOME[$38] @@ -34,33 +34,20 @@ irqhand: PUSH DE PUSH HL -; ld c, $51 -; ld a, $F0 -; ld [c], a - xor a ld c, $0F ; ack the irq ld [c], a - ;ld a, $41 ; print A - ;call putc + ld a, $41 ; print A + call putc -; ld hl, $DF81 -; ld a, [hl] -; ld b, 1 -; add b - ld a, $08 - ld hl, $FF51 -; ld c, $51 - nop - nop - ld [hl], a + ld hl, $DF81 + inc [hl] + ld a, [hl] + ld c, $51 + ld [c], a -; ld c, $51 -; ld a, $0F -; ld [c], a - POP HL POP DE POP BC @@ -69,3 +56,15 @@ irqhand: 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 + +putc: + ld b, 0 + ld c, $50 + push af +.waitport: + ld a,[c] + cp b + jr nz,.waitport + pop af + ld [c],a + ret