| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
Safe zeropage addresses
Which zeropage addresses are safe for use?
I've checked through a C64-memory map, and it seems like most zeropage locations with the exception of $00 and $01 are mostly for BASIC stuff, meaning that they should be OK when coding demos that doesn't use ase any BASIC or Kernel stuff?
|
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Which zeropage addresses are safe for use?
I've checked through a C64-memory map, and it seems like most zeropage locations with the exception of $00 and $01 are mostly for BASIC stuff, meaning that they should be OK when coding demos that doesn't use ase any BASIC or Kernel stuff?
You said it yourself. If your demo doesn't use any BASIC or Kernel stuff, all addresses except $00 and $01 are safe. It's really simple as that. |
| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
Thanks, good to know. I was a bit unsure of things like $a0-$a2 and $c5-$c6 for example (some kind of timer thing, and keyboard). |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Thanks, good to know. I was a bit unsure of things like $a0-$a2 and $c5-$c6 for example (some kind of timer thing, and keyboard).
ZP is just memory and not related to any I/O chips at all in any way except through kernel calls.
Although when adding music and IRQ-loaders you must know what ZP-locations they use so that you doesn't accidentally overwrite those. F.e. I normally use GoatTracker and Krill's IRQ-loader, both with customizable ZP-locations so it's really not any problems at all.
|
| |
HCL
Registered: Feb 2003 Posts: 728 |
IRQ-loaders don't use ZeroPage, only decrunchers. That's a rule. Plus music of course. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
I prefer stacking the zp pointers used by the music (the better players use only one) and then forget about it. |
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
Quote: Thanks, good to know. I was a bit unsure of things like $a0-$a2 and $c5-$c6 for example (some kind of timer thing, and keyboard).
$c5-$c6 are updated by the keyboard routines quite late on after $ea31 is called.
$a0-$a2 are updated by the real time clock rountine which is the first thing called by $ea31.
So as long as you're not using $ea31 to exit your interrupt then you're fine.
|
| |
Skate
Registered: Jul 2003 Posts: 494 |
in other words as long as you are not using kernel... |
| |
Soren
Registered: Dec 2001 Posts: 547 |
@Oswald: afaik one can just do some selfmodding code instead of using the stack... throw the zp values into somewhere else in the music-player.... that's the "trick" I use nowadays, but ofcourse I used the stack in my earlier players :-)
2 zeropage adresses is usually what's needed for a musicplayers, I'd say. |
| |
Mantiz Account closed
Registered: Apr 2006 Posts: 36 |
$00 is okay too, as long as you remember to set it accordingly if you plan to change $01. |
| |
Burglar
Registered: Dec 2004 Posts: 1101 |
you might want to skip using $90 (I/O status) and $ba (device number). some loaders will set/use those. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Quote: You said it yourself. If your demo doesn't use any BASIC or Kernel stuff, all addresses except $00 and $01 are safe. It's really simple as that.
And if we could just have had these two as well, everything would be perfect. I'll never forgive the C64 designers for this. DAMN YOU RUSSELL AND YANNES!! ;)
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
yeah, also chuck peddle should suffer for not adding atleast one more damned index register ;) |
| |
Skate
Registered: Jul 2003 Posts: 494 |
@Oswald: registers are just like girls. you can load them as much as you want but you will still miss another one ;) tax, tay, tya, txa are all lesbians... |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Which register is most teh ghay?
..and @Oswald: a bit naive to judge a music player as better/worse by the number of zp-adresses it uses.. lda zp,pha is not teh quality. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
The ideal music player should be configurable so you could set parameters like how many zp-adrs it can use, whether it should be optimized for cycle or memory consumption, whether it's the max or average rastertime that counts, etc. and then it should generate the player based on these criteria. Just an idea for next version, Jeff! ;)
|
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
It should also create the music by itself, automagically. :) |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Ahh, you're f**kedup, and you know it. This is the kind of stuff that is really motivating for the composers.. Cryptic, meaningless settings that doesn't affect the sound of your music at all. I guess *every* musician would start to fiddle with the ZeroPage-ramp and the Optimize-button at once, yeah right.. ;) |
| |
Dane
Registered: May 2002 Posts: 423 |
Quote: The ideal music player should be configurable so you could set parameters like how many zp-adrs it can use, whether it should be optimized for cycle or memory consumption, whether it's the max or average rastertime that counts, etc. and then it should generate the player based on these criteria. Just an idea for next version, Jeff! ;)
This pretty much describes my relationship with HCL |
| |
Quetzal
Registered: Jul 2002 Posts: 71 |
Quote: @Oswald: registers are just like girls. you can load them as much as you want but you will still miss another one ;) tax, tay, tya, txa are all lesbians...
lax = two at same time?! |
| |
Skate
Registered: Jul 2003 Posts: 494 |
this explains why lax is illegal ;) |
| |
Mace
Registered: May 2002 Posts: 1799 |
Quote:This pretty much describes my relationship with HCL LOL! :-D |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Well, the 6510 never gets closer to sex than SAX, so don't worry. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
How about:
sec
sec
Get it? SECs ;D And it's not even illegal 0:)
|
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Sure, but this just proves the point. Two SECs in a row is just so unnatural to the 6510. It is never used. |