| |
AlexC
Registered: Jan 2008 Posts: 299 |
Controling execution flow with timers examples
I'm writing an update to my text on cartridges for codebase64 and I am looking for real life examples of controlling execution flow with timers other than triggering NMI with CIA or triggering IRQ to execute interrupt handler. So if you guys could point me at some code that uses such trick I'd be grateful. BTW: I'm still looking for v4.2 Expert software ;) |
|
... 8 posts hidden. Click here to view all posts.... |
| |
doynax Account closed
Registered: Oct 2004 Posts: 212 |
Quote: Thank you for all tips and info. One more question - have you ever seen construction similar to this one:
JMP ($DD04) or JMP ($DC04)
To what end? It might well work as a form of copy-protection or other obfuscation, but it would be of little use as jitter compensation given that the timers count downwards.
On the other hand I can see how jumping into a second chained timer might be useful, one which wouldn't be sensitive to jitter. That way you could invoke a different interrupt handler every few scanlines, though without any free stabilization.
Oh, and if you find a use for this the trick on the first IRQ or NMI timer then you could probably get away with poking a JMP opcode directly into the DDR register immediately preceding the timers, and thus save yourself two cycles per interrupt. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
guys, look at the routine ninja mentioned =) |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
Quote: Thank you for all tips and info. One more question - have you ever seen construction similar to this one:
JMP ($DD04) or JMP ($DC04)
jmp ($dc03) is a classic way of making the raster stable within a line, when doing f.e. a DYSP routine. I haven't seen jmp ($dc04). |
| |
Ninja
Registered: Jan 2002 Posts: 411 |
You haven't read the article, have you? I gave an example of a demo using JMP ($DCxx) there... |
| |
AlexC
Registered: Jan 2008 Posts: 299 |
Quote: You haven't read the article, have you? I gave an example of a demo using JMP ($DCxx) there...
Not yet :( But I'll definitively do it. Thank you once again. |
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
Useful for making a completely steady screen split during a game screen and the score panel with lots of sprites flying around over the split. But not many games bother because they're tight on memory. :) I seem to remember Citadel did do it though. *I think*. My memory is really hazy from back then. |
| |
TNT Account closed
Registered: Oct 2004 Posts: 189 |
Quote: Useful for making a completely steady screen split during a game screen and the score panel with lots of sprites flying around over the split. But not many games bother because they're tight on memory. :) I seem to remember Citadel did do it though. *I think*. My memory is really hazy from back then.
IIRC Citadel does use NMI for screen split but doesn't bother stabilizing it with timers. Paradroid Redux does, but even that isn't perfect. (It does variable delay based on timer value, no jumping through timer). |
| |
AlexC
Registered: Jan 2008 Posts: 299 |
Quote: You haven't read the article, have you? I gave an example of a demo using JMP ($DCxx) there...
Done it. Really cool idea. Apart from the effect itself I really like the idea to store opcode inside hardware registers. Neat trick for copy protection scheme as well. Thanks Ninja. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Quote: mmmh i *think* timex did something like that (for example used in the game "logo", and a couple of magic-disk issues). not sure though :)
Yes, Timex did a timer IRQ after every opcode to decrypt the next one and re-crypt the previous one. This way there was only one decrypted opcode at a time in memory.
|
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
Completely mental. |
Previous - 1 | 2 - Next |