Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) 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: 2825
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-05-01 22:13
Krill

Registered: Apr 2002
Posts: 2825
Quoting tlr
Maybe you could send a few extra bits? In Format II I send 10-bits as status.
Not really feasible either, as bytes are the atoms there, and i rather not send another byte for each block, then completely ignore it for the most common case of loading. =)

There is one spare bit in the two metadata bytes sent prior to a block's worth of data, though. But it's just one bit.
2021-05-02 09:32
JackAsser

Registered: Jun 2002
Posts: 1987
Quote: Quoting tlr
Maybe you could send a few extra bits? In Format II I send 10-bits as status.
Not really feasible either, as bytes are the atoms there, and i rather not send another byte for each block, then completely ignore it for the most common case of loading. =)

There is one spare bit in the two metadata bytes sent prior to a block's worth of data, though. But it's just one bit.


So let that one bit determine if it's 1541 or not. The other types can have more drive code for further queries.
2021-05-02 11:55
Krill

Registered: Apr 2002
Posts: 2825
Quoting JackAsser
So let that one bit determine if it's 1541 or not. The other types can have more drive code for further queries.
Good idea, but... would like to somehow ignore that bit without adding extra code when loading, and pretend-loading an existing file (with just discarding the incoming blocks) just to determine the drive-type doesn't sound very elegant either. =)
2021-05-02 12:43
Copyfault

Registered: Dec 2001
Posts: 466
Quoting JackAsser
So let that one bit determine if it's 1541 or not. The other types can have more drive code for further queries.
Already suggested it via pm, but since I did not fully understand what makes it fail I'll ask again (a little bit adjusted to what JA wrote): couldn't you always send the 1541-save routine and have some watch-dog-alike routines on 1571- and 1581-side that will cancel the send-procedure and request "their" routine when the watch-dog detects the (first bytes of the) 1541-save-routine incoming?
2021-05-02 13:27
chatGPZ

Registered: Dec 2001
Posts: 11100
All in 4 Bytes :=)
2021-05-02 18:35
JackAsser

Registered: Jun 2002
Posts: 1987
I think we’re getting to the point that you should let the user store the returned config value during loader install then ask them to pass that value to the save-installer. Anyone can keep track of that byte..
2021-05-02 19:04
Krill

Registered: Apr 2002
Posts: 2825
Quoting JackAsser
I think we’re getting to the point that you should let the user store the returned config value during loader install then ask them to pass that value to the save-installer. Anyone can keep track of that byte..
We have passed that point already some way up in this thread. :)

I am defaulting to $dd03 at the moment, planning to add a variable to the custom drive code upload parameter structure to override/provide drive type.
2021-05-02 19:08
Rastah Bar

Registered: Oct 2012
Posts: 336
Quote: Quoting Rastah Bar
F.e., let the C64 try to load a nonexisting file and let the loader return a "file not found" error code that is different for each drive type.
Not a bad idea, but not really feasible in practice either.

The byte in question sent by the drive encodes a status/error code ($00: end of file, $ff: file not found) or $01-$fe for current highest consecutive bytestream position (for decrunching while loading with blocks coming in out of order) or $01-$fe for the block size of the file's last block (which of the two $01-$fe options is determined elsewhere).

So other no other values left. If there were, however, reducing the 3 values for a file not found error would take some extra space in the resident C-64-side loader code, plus a definitely non-existing filename would have to be chosen somehow, and then things like no disk inserted can happen, too (although malicious user error is not very relevant in practice).


Switching codes $00 and $ff for one of the drives might provide one bit of information.
2021-05-02 20:51
Copyfault

Registered: Dec 2001
Posts: 466
Quoting Groepaz
All in 4 Bytes :=)
Oh noes, that's not much /o\ Got the impression that there's still more free space, at least for drivecode on the non-1541-drives.

So I take it if you look at it spot on the details, especially the code on c64-side would've to be changed too much in order to make a watch-dog-driven handshake for uploading the save-routine work.


On an abstract level, I still think this would be most elegant ;)
2021-05-03 06:02
Flavioweb

Registered: Nov 2011
Posts: 442
I guess i haven't really understood the problem here... but i try: why don't reserve a file name/file number which return a byte containing drive model value?
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
iAN CooG/HVSC
csio/monarchy c+4
Scooby/G★P/Light
pcollins/Quantum
megasoftargentina
Exile/Anubis
Guests online: 65
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.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 Wafer Demo  (9.5)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Onscreen 5k  (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 Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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