Jump to content
IGNORED

POKEY TIMER INTERRUPTS


Recommended Posts

I have a bit of a dilemma. The program below sets and executes an IRQ Timer-1 interrupt but I'm baffled: The 'timer' interrupts are meant to be used when timing something quicker than jiffies (1/50thsec) right!? But that contradicts the fact that the timers are decremented every immediate V/Blank?

 

10 POKE 53768,0                                             - SET CLOCK FREQ.
20 FOR I=0 TO 9                                              - PUT M/C INTO P6
30 READ D:POKE 1536+I,D:NEXT I
40 DATA 173,10,210,41,248,141,24,208,104,64
50 POKE 528,0:POKE 529,6                               - SET ADDRESS OF TIMER-1
60 POKE 53760,30                                            - RE-EXECUTE DELAY (CLK PULSES)
70 POKE 16,193:POKE 53774,193                      - ENABLE INTERRUPT
80 POKE 53769,1                                              - RESET COUNTER

 

Am I doing something wrong, I'm confused. Please, can someone clarify this situation.

Link to comment
Share on other sites

21 minutes ago, Wrathchild said:

You might be confusing software countdown timers (CDTMVx/CDTMAx) with pokey timer irqs (VTIMRx)?

Do you know, that is exactly what I was doing, thanks for that wrathchild. In all the years I've been programming I never realised that there were system software timers as well as the IRQ ones. That definately clears up that problem.

 

NB* Does anyone know if my code is correct, because I expect system control to return to Basic alike NMI DLI's in between IRQ executions but it doesn't, is this correct?

Edited by ac.tomo
Link to comment
Share on other sites

That code works.

For Pokey Timers much more frequent than that (looks to be every 8th scanline) you'd probably want to do a custom VIMIRQ handler.

The system IRQ handler puts the timers fairly low in the order of priority so there's a long code path before your code is run.

When doing that you'd then have to do extra stuff like testing and resetting IRQ status and enable bits.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...