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 > reading flags
2011-04-12 15:44
ready.

Registered: Feb 2003
Posts: 441
reading flags

Hello,
I am packing some parts together to be loaded using DreamLoad and I want to dedicate n clock cylces per frame for loading. To do this, at a certain of the demo code point I start a signle shot CIA timer to generate a NMI after some delay (during which the loader loads). I jump to the loader code, which later on is interrupted by the previously set NMI. I change a bit the stack and stack pointer for jumping back and forth between demo and loader and it seems to work....


....but after some frames it crashes. I suspect that the problem is that when the code enters the loader the flags are changed and I should save not only A, X, Y, SP but flags also.

Is there a way to read/write the flags all in one, like TSX and TXS for the stack pointer?
 
... 10 posts hidden. Click here to view all posts....
 
2011-04-16 19:06
WVL

Registered: Mar 2002
Posts: 903
Oswald : effect happens in the IRQ ofcourse :)

And you get the horizontal scrollbar because of my too-long sentence between code tags (which I can't edit anymore..)..
2011-04-16 20:25
Pantaloon

Registered: Aug 2003
Posts: 124
i do it as the rest of you guys, one main interrupt that drives the effect, the code executing outside the irq i normally do loading in, and if i need it i issue more irq's from the main irq and doing a cli to get higher priority then the normal loop.

sometimes you want loading to be of higher priority then effect updates so you just switch place between the two.
2011-04-16 20:50
Oswald

Registered: Apr 2002
Posts: 5095
Panta, and how do you make sure that the loader returns from time to time before finishing a whole file?
2011-04-17 16:59
ready.

Registered: Feb 2003
Posts: 441
Oswald, your last question was exactly my original problem. I hope my previous posts clearify this.
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
Longhair/Elysium
Yogibear/Protovision
Guests online: 109
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.6)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 The Demo Coder  (9.6)
8 Comaland 100%  (9.6)
9 What Is The Matrix 2  (9.6)
10 Wonderland XIV  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Dawnfall V1.1  (9.5)
6 Rainbow Connection  (9.5)
7 Morph  (9.5)
8 Libertongo  (9.5)
9 Onscreen 5k  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Mutetus  (9.7)
2 Jeroen Tel  (9.7)
3 Rob Hubbard  (9.6)
4 Linus  (9.6)
5 Jammer  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.053 sec.