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


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

Registered: Oct 2014
Posts: 159
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..
 
... 10 posts hidden. Click here to view all posts....
 
2017-01-30 12:20
Frantic

Registered: Mar 2003
Posts: 1317
Don't discuss it!
2017-01-30 14:06
HCL

Registered: Feb 2003
Posts: 667
Nono.. I was definitely *not* the first. Perhaps the last.
2017-01-31 09:50
lft

Registered: Jul 2007
Posts: 314
Quoting HCL
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".


I'm not so sure. Those locations would have to be one byte apart, and later calls would go to earlier addresses. So you would have to construct some kind of inverted clockslide. Maybe it is possible somehow, but it seems really difficult. Game on?
2017-01-31 10:50
Mixer

Registered: Apr 2008
Posts: 228
Like HCL said.

From the top of my head, you can do

dc02 4c
dc03 lowbyte, Any value, the stable routine lo
dc04 hibyte , == timer from 8 to 0, the stable routine hi
dc05 0
dc06 your event timer lo
dc07 your event timer hi
dc0d 02 // timer B causes interrupt, A does not.
dc0e 01 // timer A just runs.
dc0f 01 // timer B just runs. must be started in sync with timer A

fffe 02 // IRQ vector to $dc02
ffff dc //

The stable routine then has the nops or other delays depending on how many cycles to compensate on each page/timer value.

But getting back to the Oziphantom original problem, I think there is no need for such a complex system, if one just needs one or two timed events per frame.
2017-01-31 11:37
lft

Registered: Jul 2007
Posts: 314
Oh, right. I misunderstood HCL. Yes, the lo-byte can be anything as long as it's fixed. I was thinking of having a dynamic lo-byte and a fixed hi-byte.
2017-01-31 17:11
Groepaz

Registered: Dec 2001
Posts: 8269
but can you change the lowbyte using sprite collisions?
2017-02-01 14:52
Radiant

Registered: Sep 2004
Posts: 626
Quoting HCL
Nono.. I was definitely *not* the first. Perhaps the last.


I still haven't used that method. :-)
2017-02-01 23:10
Compyx

Registered: Jan 2005
Posts: 272
Is this the thing that jumps to $3c00, $3d00 etc? Then it's the Horizon-method :)
2017-02-04 00:43
Copyfault

Registered: Dec 2001
Posts: 215
Quote: 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

Hmm, if I understood this "use timer lo-byte as hi-byte of the irq-jump-vector"-method (or should we call it Ninja-rizon-method;)?) correctly it needs 8 pages even when sticking to a fixed CIA version (and without the use of unintended opcodes).

As discussed before (e.g. in Stable Raster via Timer) jitter causes 8 different timer values resulting in eight different jump adresses. Or do I mix things up here???
2017-02-04 10:19
Frantic

Registered: Mar 2003
Posts: 1317
Hehe.. I was also reminded about that discussion when I read that and thought "hey, uh... what was the conclusion of that old thread again?".
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
LHS/Padua
Scorpie/F4CG
Alakran_64
Romppainen/ΤRIΛD
thesuperfrog
Rebok
Marvin
Dymo
Carrion/SHAPE
Deev/Onslaught
Guests online: 41
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Lunatico  (9.6)
6 Comaland 100%  (9.5)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Pandemoniac Part 2 o..  (9.6)
3 Daah, Those Acid Pil..  (9.5)
4 Synthesis  (9.5)
5 Dawnfall V1.1  (9.5)
6 Dawnfall  (9.4)
7 Treu Love [reu]  (9.4)
8 Field Sort  (9.4)
9 Pro Memoria 4  (9.3)
10 KAOS 64  (9.3)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 The Judges  (9.3)
Top Hardware-Gurus
1 Soci  (9.9)
2 Wiesel  (9.9)
3 Grue  (9.8)
4 Zer0-X  (9.8)
5 Lemming  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2017
Page generated in: 0.749 sec.