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 > Keeping a few bits of information in a hostile environment
2021-04-18 09:24
Krill

Registered: Apr 2002
Posts: 2839
Keeping a few bits of information in a hostile environment

If not reserving space in RAM, where would read-writable data be most likely to survive throughout the run-time of any random demo or game?

$D800-$DC00 is often overwritten entirely, $00/$01 in RAM are too cumbersome to access.

$DD03 (parallel port data direction register) might be good, or maybe the 2x4 CIA TOD registers at $DC08 and $DD08.

Or are they? What else could be usable for that purpose? =)
 
... 72 posts hidden. Click here to view all posts....
 
2021-04-18 13:52
Krill

Registered: Apr 2002
Posts: 2839
Quoting Rex
a test runner based on a modified VICE that runs a gazillion programs while keeping track of which memory addresses are touched during execution
Regular RAM ($0002..$ffff) can be ruled out entirely. What's left are chip registers and similar state.
Register access may be trackable using some brute force machine, but maybe some other tricks exist to access hidden state.
2021-04-18 14:50
chatGPZ

Registered: Dec 2001
Posts: 11114
I'd use the TODs, write the same data to both CIAs, consider it valid if it matches.

Then again, i wouldnt do this, because it is doomed to fail in one way or another :)
2021-04-19 00:53
Krill

Registered: Apr 2002
Posts: 2839
Quoting Groepaz
I'd use the TODs, write the same data to both CIAs, consider it valid if it matches.
More than one bit of information would be encoded with the difference between both clocks? =)
2021-04-19 01:22
Krill

Registered: Apr 2002
Posts: 2839
Some background to this thread's OP (inb4 XY problem):

I'm currently working on the next release version of Krill's Loader, Repository Version 184 - next feature to implement being the hiscore saver.

Now, for that i'd like to store and retrieve 2 bits of information, encoding the type of drive the loader is currently installed on (1541, 1571, 1581), as each of the three executes entirely different and separate loader code with different custom-code plug-in hooks.

Goal is to avoid reserved zeropage/memory addresses and the like because it does without so far (entire ZP can be clobbered between load calls, C-64 side loader code incarnations can be swapped freely), and the 2 bits are required because there is no code space for the drives in question (1541 mostly) to tell their kind prior to uploading and executing the fitting piece of saver code using those custom-code plug-in mechanics.
2021-04-19 08:47
chatGPZ

Registered: Dec 2001
Posts: 11114
so you just let the user provide a symbol that points to a byte in memory. problem solved.
2021-04-19 08:58
Krill

Registered: Apr 2002
Posts: 2839
Quoting Groepaz
so you just let the user provide a symbol that points to a byte in memory. problem solved.
How does that "avoid reserved zeropage/memory addresses and the like"? =)
2021-04-19 09:02
chatGPZ

Registered: Dec 2001
Posts: 11114
The symbol can point anywhere, including CIA registers or unused colorram nibbles. It solves the problem 100%.
2021-04-19 09:05
Krill

Registered: Apr 2002
Posts: 2839
Then it's providing an optional manual override for the loader's default of "use $dd03 to shuffle data from installer to resident portion" to "use user-provided address".

Yeah, i guess i'd have done that. =)
2021-04-19 09:37
chatGPZ

Registered: Dec 2001
Posts: 11114
By now i wonder *what else* did you expect to be able to do? :=)
2021-04-19 10:21
Krill

Registered: Apr 2002
Posts: 2839
This thread is about finding a sensible default that is not in regular RAM, $dd03 being the best bet so far.

But "maybe some other tricks exist to access hidden state". Something that can (only) be manipulated somewhat indirectly.
Like "VSP channel", but obviously something else that can be set (and doesn't have weird side-effects).
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 - 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
The MeatBall
Martin Piper
McMeatLoaf
Jazzcat/Onslaught
Sabbi/Hokuto Force
celticdesign/G★P/M..
daimansion
Mythus/Delysid
Shake/Role
Apollyon/ALD
Guests online: 142
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 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (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 Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

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