Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Super Stable(tm) NMIs
2017-01-28 06:53
oziphantom

Registered: Oct 2014
Posts: 490
Super Stable(tm) NMIs

Before I go tumbling down a rabbit hole, though I would check with people in the know if this is sane..
I have a need for stable raster ( doesn't need to be to the clock stable, but stable ish <4 ) with potential sprites and maybe some samples playing...

To which I was thinking if doing my IRQ stuff in NMI, where I can use TIMER A to clock the point I want, then use the Inverse X cycle counter in Timer B to stabilise it. A Pal Frame is 19,656 cycles right, which easily fits into 65,536.
Since I can set the cycle to start me in the char area ( on a good line) the fact there are sprites is neither here nor there right? And I can support NTSC by having a different Next NMI timer value table?
The I get the Sample routine ( which are traditionally on NMI ) to use the other CIA, so it fires on IRQs.

So I can had stable rasters that change a register during the "write cycle" before the VIC enables Sprite DMA, and optionally have and not have sprites around, and play samples, as it starting to get a bit too good to be true..
2017-01-28 09:00
tlr

Registered: Sep 2003
Posts: 1790
Yes, you can use the timers although I didn't fully understand the timer B part you describe. Using the inverted LSB of the triggering timer is usually sufficient. Both NMI or IRQs work.

The interrupt routine needs to be really fast though. When you enable sprites the window the routine must fit in shrinks a lot. The more stable you need the interrupt, the larger the execution time of the correcting code is going to be.
2017-01-28 11:02
Mixer

Registered: Apr 2008
Posts: 452
You probably mean that the NMI Timer B is the timer that sets the interrupt flag and Timer A just runs from 8-0 for the jitter stabilization, ok that works. I do not get the super stable part unless you imply that there is a way to make the jitter smaller?
2017-01-28 11:04
oziphantom

Registered: Oct 2014
Posts: 490
The NMI will still have a jitter because of the CPU, so I can use http://codebase64.org/doku.php?id=base:using_a_timer_as_an_inve.. to lock it again. Which thinking about it more, I will need as I'm then going to set the next NMI in clocks, so if there is a cycle of jitter then the whole thing will slide around...
The critical parts of the NMI are open border, closer border, toggle multi colour to hires, so basically store a value into one VIC location.
2017-01-29 15:35
chatGPZ

Registered: Dec 2001
Posts: 11386
perhaps look at the "Ninja method" as well, since you waste a lot less cycles with that
2017-01-29 18:51
algorithm

Registered: May 2002
Posts: 705
Indeed, also utilised in sounddemons cycle exact sample replay. Based on the jitter, it directly jumps to for example (can be changed) $0100,$0200,$0300,$0400.. and relevant delays in each section to ensure that the nmi routine starts from exactly the same position
2017-01-29 22:04
Frantic

Registered: Mar 2003
Posts: 1648
For convenience:
https://codebase64.org/doku.php?id=base:nmis_and_distributed_ji..
2017-01-30 04:13
oziphantom

Registered: Oct 2014
Posts: 490
The Ninja method is amazing, but in a Video game where I'm going to have at least 3 splits, and maybe dynamically add in/remove some splits with a bitmap and sprites. So that takes out 64 pages, ZP, Stack, 66 pages. Data storage of extra sprites and level data, game code and well having bits for lets say 6 splits, at 8 pages each = 48 pages, its starting to get to be a real pain to manage. So at this stage I would rather pay the clocks, but thanks for the info anyway.
2017-01-30 08:27
JackAsser

Registered: Jun 2002
Posts: 2014
It only eats 7 pages (or 8 if you treat diffierent CIA versions as jitter). Which pages depends on the relation between the IRQ-source and the timer
2017-01-30 09:31
HCL

Registered: Feb 2003
Posts: 728
If you want several different IRQ:s (or NMI:s) with stable timing, you may of course use the lo-byte of the jmp to address different locations on each page. ..but i think that is included in the so called "Ninja-method".

Besides i will refuse to start a discussion on who was really the first to invent the so called "Ninja-method" :).
2017-01-30 09:59
Oswald

Registered: Apr 2002
Posts: 5094
so, HCL method ? :)
 
... 10 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Freeze/Blazon
TheRyk/MYD!
Alakran_64
Chesser/Blazon
MWR/Visdom
Didi/Laxity
Guests online: 113
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.049 sec.