Me toying again with the VIC20 and for days I try to reset my double IRQ for stable rasters routines... and all I do stops my trackloader at some point...
so simple question... i have a part which has set 2 VIAs timers and i simply want to "switch it back" to normal mode... where I have a simple VBL based IRQ running through $314/15...
i saved all regs prior setting the IRQinit routines and the IRQserver to handle the raster-IRQ and vblank... when I call $fdf9 in ROM to init i/o my trackloader seems fucked up...
Code: Select all
;**************************************************************************
;*
;* IRQ Interrupt server
;*
;******
IRQServer:
lda $912d
asl
asl
bcs irq_skp1
asl
bcc irq_ex1
jsr T2Timeout ;raster IRQ
jmp irq_ex1
irq_skp1:
jsr T1Timeout ;VBL
irq_ex1:
pla
tay
pla
tax
pla
rti
;**************************************************************************
;*
;* Routines + stuff
;*
;******
T1Timeout:
lda #[75+[<t1_TComp]]&255
sec
sbc $9124 ;68-73 (for PAL)
sta t1_SelfModJMP+1
t1_SelfModJMP:
jmp t1_TComp
; START_SAMEPAGE "T1COMP"
t1_TComp:
.byte $a9,$a9,$a9,$a9,$a9,$a9
.byte $a9,$a9,$a9,$a9,$24,$ea
; END_SAMEPAGE
lda InterruptTab
sta $9128
lda InterruptTab+1
sta $9129 ;load T2
lda #$00
sta Line
jsr Update
jsr VertBlanking
.IF DEBUG2
lda t1_SelfModJMP+1
sec
sbc #<t1_TComp
tax
lda #$01
sta $5100,x
.ENDIF ;DEBUG2
rts
T2Timeout:
lda #[$c0+[<t2_TComp]]&255
sec
sbc $9128 ;$ba-$bd (for PAL)
sta t2_SelfModJMP+1
t2_SelfModJMP:
jmp t2_TComp
; START_SAMEPAGE "T2COMP"
; .align $100
t2_TComp:
.byte $a9,$a9,$a9,$a9,$a9,$a9
.byte $a9,$a9,$a9,$a9,$24,$ea
; END_SAMEPAGE
lda TimeLow
sta $9128
lda TimeHigh
sta $9129
SelfModJSR:
jsr SelfModJSR
.IF DEBUG2
lda t2_SelfModJMP+1
sec
sbc #<t2_TComp
tax
lda #$01
sta $5000,x
.ENDIF ;DEBUG2
Update:
lda Line
inc Line
asl
asl
tax
lda InterruptTab+4,x
sta TimeLow
lda InterruptTab+5,x
sta TimeHigh
lda InterruptTab+2,x
sta SelfModJSR+1
lda InterruptTab+3,x
sta SelfModJSR+2
rts ;$2095
TimeLow:
.byte 0
TimeHigh:
.byte 0
Line:
.byte 0
InterruptTab: ;$2099 $13 $54
.word ROWTIME*70-COMPTIME,Rast0
.word -1,-1