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 11:00
AlexC

Registered: Jan 2008
Posts: 293
Very interesting question. I would say there aren't such, especially if you do not narrow your selection. For example are we talking about games with copy protection? There are some copy protection schemes were whole memory is overwritten during loading starting from load address in order to reach $01 for example and change it accordingly. Secondly are we talking about loading from tape or disk?

But you know all of that ;)

Do you need whole bytes or just bits?

How about reset vector assuming you can disable kernal rom? (we wrote the same idea with JackAsser at the same time)

How about using external ram from attached devices like disk drive ram. Action Replay and clones have interesting memory access model too.

Just my 5 cents... looking forward to other ideas.
2021-04-18 11:28
tlr

Registered: Sep 2003
Posts: 1714
The upper bits in the $00 (DDR) could often be used. IIRC Mr. Z said that he often used that for his cheat flags.
2021-04-18 11:32
Krill

Registered: Apr 2002
Posts: 2839
Quoting JackAsser
$0100-$011f

Only very special demo parts or very complex games will use this memory
Or anything printing numbers using ROM calls. =) $0100 is FBUFFR, where numbers converted to strings are stored.

Quoting JackAsser
Or the reset vector maybe? $fffc/d

You could store both on TOD, $fffc/d and $0100/0101 and do some heuristics to determine which value has not been overwritten
Reset vector is sometimes written to when the adjacent NMI and IRQ vectors are set up by simply copying to them in a loop.

True about the heuristics, but those need good locations in the first place. :)

Quoting AlexC
Do you need whole bytes or just bits?
Yes. =)
I mean, if a register is written to, one can expect all of its bits to be changed, even if just one is required. But it's about any information, at least one bit, the more the merrier.

Copy protections can be ignored. The "hostile" wordage was just for effect. :)

I mean any kind of read-writeable machine state that is very rarely used, intentionally or accidentally. Stock machine, without extra hardware.

And for some narrowing-down, loading (tape/disk/user port) is under control and can be ignored (hence my idea of using $DD03).
2021-04-18 11:34
Krill

Registered: Apr 2002
Posts: 2839
Quoting tlr
The upper bits in the $00 (DDR) could often be used. IIRC Mr. Z said that he often used that for his cheat flags.
Could some accelerators fail with that?
2021-04-18 11:38
tlr

Registered: Sep 2003
Posts: 1714
Quoting Krill
Quoting tlr
The upper bits in the $00 (DDR) could often be used. IIRC Mr. Z said that he often used that for his cheat flags.
Could some accelerators fail with that?

Not sure. I seem to remember that flash8 uses the corresponding ones in $01 but I might be wrong. A '0' in a $00 bit will make the corresponding output effectively forced as a '1' so it may or may not be a problem even if used.

You did say "I mean any kind of read-writeable machine state that is very rarely used, intentionally or accidentally. Stock machine, without extra hardware." though.
2021-04-18 11:40
Krill

Registered: Apr 2002
Posts: 2839
Quoting tlr
You did say "I mean any kind of read-writeable machine state that is very rarely used, intentionally or accidentally. Stock machine, without extra hardware." though.
Yes, did not think of accelerators before your post popped up. I just wanted to rule out storing information in external/add-on hardware.
2021-04-18 11:57
Frantic

Registered: Mar 2003
Posts: 1627
Would it be possible to use redundance? E g to store the information in several places, to increase chances of survival?
2021-04-18 12:02
Krill

Registered: Apr 2002
Posts: 2839
Quoting Frantic
Would it be possible to use redundance? E g to store the information in several places, to increase chances of survival?
This is what Jacky referred to with "heuristics". =)

So yes, possible, but that's an add-on solution to the problem here.
2021-04-18 12:18
Frantic

Registered: Mar 2003
Posts: 1627
Ah, yes. Didn't read carefully enough.
2021-04-18 13:28
Rex

Registered: Sep 2011
Posts: 14
If someone is willing to spend the effort I guess it is possible to write a test runner based on a modified VICE that runs a gazillion programs while keeping track of which memory addresses are touched during execution.

It may be a bit tricky detecting when the initialization and kernel loading is complete - which is when you want to start monitoring memory usage.

This should allow for finding the optimal solution.
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
MAT64
Jetboy/Elysium
Brush/Elysium
Nordischsound/Hokuto..
syntaxerror
Clown
Shake/Role
Guests online: 130
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 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (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 Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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