johnsa
Member |
Hey,
I've been pulling my hair out trying to get timer b to count timer a underflows - to extend it's duration..
Can anyone spot what I'm missing?
; Disable all ints lea.l CUSTOM_BASE,a1 move.w #$7fff,INTENA(a1) move.w #$7fff,INTREQ(a1)
; Install a handler to be used by CIA-B Timer B to count underflow move.l #0,_vblankCount move.l _vbr_addr(pc),a0 lea.l Int6Handler2(pc),a1 move.l a1,CIAB_VECTOR(a0) lea.l CUSTOM_BASE,a1
; Activate vblank and CIA ints move.w #$e020,INTENA(a1)
; TIME = 10ms lea.l _CIAB,a0 move.b #%01111111,ciaicr(a0) move.b #%10000010,ciaicr(a0) ; trigger interrupt move.b #(TIME&$ff),ciatalo(a0) move.b #(TIME>>8),ciatahi(a0) move.b ciacra(a0),d0 move.b ciacrb(a0),d1 and.b #%11000000,d0 ;preserve unused/sp-mode or.b #%00010001,d0 ;continuous and.b #%10000000,d1 or.b #%01010001,d1 move.b d1,ciacrb(a0) move.b d0,ciacra(a0)
; here I loop for N vblanks, then check the value of underflows counted by the int.. it's 0 no matter what i do!
|