Login
Back to forumSee the full topicGo to last reply

Posted By

Mad
on 2017-01-13
21:53:34
 Re: VB interrupt. How do you get it to trigger?

Hi Stinsris,

You said your Rasters are ok and you can't get a VB Interrupt. As far as I know a VB Interrupt is also a Rasterinterrupt on a specific rasterline. So I just try to help with the Rasterinterrupt. Be sure to check the Ultimate Map here at the forum.

First of all it is important if you have rom enabled or ram. If rom is enabled (by writing any value to $ff3e) then your irq vector will be at $0314/$0315 and needs a special ending sequence. If you have ram enabled (by writing any value to $ff3f) then your interrupt vector is at $fffe/$ffff.

irq_rasterline dc.w $0100

irq_install SUBROUTINE
sei ; prohibit interrupts for now
lda irq_rasterline+1 ; rasterline hibyte
ora #$02 ; 2 means rasterirq
sta $ff0a
lda irq_rasterline ; rasterline lobyte
sta $ff0b
lda #irqFFFE & 255
sta $fffe
lda #irqFFFE / 256
sta $ffff
lda #irq0314 & 255
sta $0314
lda #irq0314 / 256
sta $0315
cli ; allow interrupts again
rts

if you just have rom on or off then you need just the $0314 or $fffe part respectively

irqFFFE SUBROUTINE
pha ; fake 0314 return parameters
txa
pha
tya
pha
irq0314 SUBROUTINE
jsr yourIrqCode ; you can write your code here
pla ; that's the code needed for returning from a 0314 interrupt
tay
pla
tax
pla
inc $ff09 ; notify interrupt done (I don't understand this inc $ff09 "trick" (perhaps some could explain this), but that's the code I use for Rasterinterrupts.)
rti

I hope this helps somehow.. It seems you have an other problem, since you wrote that your rasters work. (And the timers.. So you already have some interrupts running.. :))

Edit: I always wanted to write a big thank you to all the guys that made the plus4 architecture more transparent to newbies.. especially big thanks to SVS for the ultimate map from here. If that information would have been there in the past, who knows what could have been.. (I suppose for professional programmers there where a lot of information or good books to read, however.)



Back to top


Copyright © Plus/4 World Team, 2001-2024