Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user megasoftargentina ! (Registered 2024-04-16) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Restoring vectors between parts in a trackmo
2015-08-24 17:20
Trap

Registered: Jul 2010
Posts: 222
Restoring vectors between parts in a trackmo

Hi,

So I'm fiddling with Spindle and I am at the point where I need to take a good look at how to make the shift from one part to another. Obviously I have to save the IRQ vectors FFFE/FFFF when I start my part after loading and restore the vectors again when I am done.
Now I wanted to hear if there is anything in particular I need to do other than that?
So the only thing I do when the part is complete is to wait for VSYNC and then restore the old vectors. One thing I have been thinking about is if I should in fact change the vectors in the last part of my existing IRQ. In my logic that would be a smoother/stable approach. I am not sure however and I hope that this thread will save me a headache or two when it comes to final linking.

Thanks.

/Trap
 
... 1 post hidden. Click here to view all posts....
 
2015-08-24 19:03
lft

Registered: Jul 2007
Posts: 369
I prefer to do it in main context. SEI, update vector, call init routine of new effect, CLI. If there's a visual glitch, I add a delay before the SEI, waiting for a good spot (e.g. vblank). If there's a music hiccup, I add an extra call to the playroutine before or after the wait.
2015-08-24 19:36
Oswald

Registered: Apr 2002
Posts: 5017
once there was thread on how to change the place of the music jsr without hiccups, some guy was talking about X frames of moving the irq place, maybe a good idea to automate this in the framework :)
2015-08-24 19:37
chatGPZ

Registered: Dec 2001
Posts: 11090
thats the old, glitchy way. DONT :=) it'll save you a few WTFs during debugging. (you hardly ever want a CLI anywhere unless doing recursive IRQs)

Oswald: thats not required often enough to put it into the framework... mostly you are calling the music in the border anyways.
2015-08-25 07:05
Axis/Oxyron

Registered: Apr 2007
Posts: 91
I mostly do the IRQ-switching the lazy way (in the mainloop with a VSYNC before). Sometimes this can cause trouble/glitches, e.g. if an IRQ occupies the rastertime around the VSYNC.

What Oswald is talking about, is the fact that not only missing or doubling a music playback-IRQ in the switch-frame can cause glitches, even changing the rasterline of the playback-IRQ can cause a glitch. Not as noticeable as the normal case, but hearable. The glitch gets bigger linearly with the amount of rasterlines your IRQ´s jump. So moving the IRQ-rasterline smoothly is sometimes the only way to get rid of it.
2015-08-25 07:19
Bitbreaker

Registered: Oct 2002
Posts: 498
Also, refrain from stuffing all kind of functionality into a framework or other resident parts like a loader script when it could easily be added statically and still very comfortably with the use of some simple macros or at least includes.
2015-08-25 10:13
chatGPZ

Registered: Dec 2001
Posts: 11090
axis: "sometimes" is they important part there... unless its "nearly always", then putting it into a (static) framework is a waste of memory and should be linked when needed, like faker said.
2015-08-25 20:02
Trap

Registered: Jul 2010
Posts: 222
Thank you guys. So, what I gather from all this is that I should probably redirect the last irq handler in my irq chain to the saved vectors. Makes sense to me. Not sure I fully grasp the timing issues around music mentioned here, but I guess I'll see it.

cheers
Trap
2015-08-25 20:19
algorithm

Registered: May 2002
Posts: 702
if your music routine will be running at a fixed area, you can also set up a nmi running once per frame along with the required io values (d011,dd00,d018 etc) then no need to worry about syncing the audio.
2015-08-25 20:40
chatGPZ

Registered: Dec 2001
Posts: 11090
i wouldnt worry about it unless you really notice a glitch... its seldom a problem :)
2015-08-26 06:54
Trap

Registered: Jul 2010
Posts: 222
ok. thanks.
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
Exploding Fi../Techn..
zscs
trident
Didi/Laxity
Hok/Remember
MCM/ONSLAUGHT
St0rmfr0nt/Quantum
mutetus/Ald ^ Ons
Freeze/Blazon
Guests online: 126
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.6)
4 Mutetus  (9.6)
5 Linus  (9.6)

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