# HG changeset patch # User boisy # Date 1048135726 0 # Node ID 4fa216983d96157deeac4f8f642b21005caf341e # Parent 1ba9c76ad73fdd87ee6c48773db3218edb9c074a Added Level 3 code, needs testing in that environment diff -r 1ba9c76ad73f -r 4fa216983d96 level2/modules/clock.asm --- a/level2/modules/clock.asm Sun Mar 16 16:36:09 2003 +0000 +++ b/level2/modules/clock.asm Thu Mar 20 04:48:46 2003 +0000 @@ -149,7 +149,17 @@ ldy $0643 + stb >$0645 + std >$FFA1 + andcc #^IntMasks + ENDC + + ldd Vi.Cnt,x Decrement tick count IFNE H6309 decd --- subd #1 ELSE @@ -168,14 +178,50 @@ virqent ldx ,y++ bne virqloop + IFGT Level-2 + puls d + orcc #Carry + stb >$0643 + stb >$FFA1 + incb + stb >$0645 + stb >$FFA1 + andcc #^IntMasks + ELSE puls a Get VIRQ status flag: high bit set if VIRQ + ENDC + ora D.AltIRQ] go update mouse, gfx cursor, keyboard, etc. + +KbdCheck equ * + IFGT Level-2 + lda >$0643 grab current map type + ldb >$0645 + pshs d save it + orcc #IntMasks IRQs off + lda >$0660 SCF local memory ---x + sta >$0643 into DAT image ---x + sta >$FFA1 and into RAM ---x + inca + sta >$0645 + sta >$FFA2 map in SCF, CC3IO, WindInt, etc. + ENDC + + jsr [>D.AltIRQ] go update mouse, gfx cursor, keyboard, etc. + + IFGT Level-2 + puls d restore original map type ---x + orcc #IntMasks + sta >$0643 into system DAT image ---x + stb >$0645 + std >$FFA1 and into RAM ---x + andcc #$AF + ENDC dec D.Poll] Call poll routine - bcc DoPoll Until error (error -> no interrupt found) +Dopoll + IFGT Level-2 + lda >$0643 Level 3: get map type + ldb >$0645 + pshs d save for later + ENDC +Dopoll.i + jsr [>D.Poll] Call poll routine + bcc DoPoll.i Until error (error -> no interrupt found) + + IFGT Level-2 + puls d + orcc #IntMasks + sta >$0643 + stb >$0645 + std >$FFA1 + andcc #^IntMasks + ENDC + * * Reset GIME to avoid missed IRQs * @@ -711,7 +774,11 @@ ldb PollCnt,x Number of polling table entries from INIT ldx R$X,u Zero means delete entry beq RemVIRQ + IFGT Level-2 + bra FindVIRQ ---x +v.loop leay 4,y ---x + ENDC FindVIRQ ldx ,y++ Is VIRQ entry null? beq AddVIRQ If yes, add entry here decb @@ -721,14 +788,28 @@ ldb #E$Poll rts -AddVIRQ leay -2,y point to first null VIRQ entry +AddVIRQ + IFGT Level-2 ldx R$Y,u stx ,y + lda >$0643 + ldb >$0645 + std 2,y + ELSE + leay -2,y point to first null VIRQ entry + ldx R$Y,u + stx ,y + ENDC ldy R$D,u sty ,x bra virqexit + IFGT Level-2 +v.chk leay 4,y +RemVIRQ ldx ,y + ELSE RemVIRQ ldx ,y++ + ENDC beq virqexit cmpx R$Y,u bne RemVIRQ @@ -738,12 +819,21 @@ rts DelVIRQ pshs x,y -DelVLup ldx ,y++ move entries up in table +DelVLup + IFGT Level-2 + ldq ,y++ move entries up in table + leay 2,y + stq -8,y + bne DelVLup + puls x,y,pc + ELSE + ldx ,y++ move entries up in table stx -4,y bne DelVLup puls x,y leay -2,y rts + ENDC *------------------------------------------------------------ *