| |
Thundax
Registered: Oct 2013 Posts: 4 |
Saving routines
Heyz,
I am trying to put a loader and saver in my codework for a game, but it's quite a challenge.
The loaders are no problem at all... They work fine.
The saver is a huge problem at the moment, though.
I need the saver to save files including the ability to overwrite files (for hiscores etc.). It would be great if it would be a fast loader and even better when it's also an irq-loader.
Here is what I tried:
- Plushdos 1-bit saver: Saving works fine (as the only save solution that works for me now), but overwriting a file isn't possible with this saver (also in the manual). I don't have a seperate scratch routine which works, so the saver isn't that useful when I can't overwrite any files.
- Plushdos 1/2-bit disksystem: Saving is only possible by tracks/sectors. I try to understand how tracks/sectors work, and I think I should be able to put the savefiles on fixed tracks/sectors, but I don't know how to edit the tracks/sectors of a file. Dirmaster has the ability to view the file properties but editing tracks/sectors doesn't work. I tried to use the BAM-editor, but I can't change/don't know how to change the tracks/sectors of a file. Beside of that I don't even know if the saver in the 2-bit disksystem can overwrite at all. So that's even a question.
- I tried basic IO kernal for saving, like on codebase: http://codebase64.org/doku.php?id=base:saving_a_file . I put this code 1-on-1 in C64 assembler and tried to run it. But nothing happens at all. Just a small second and it reaches the end of the code and saved nothing... Why isn't this even working?
- Googled a lot, but couldn't find anything additional useful for my problem.
Btw, I'm using an Ultimate II+, but that should run fine I guess.. Certainly with basic IO stuff...
So my main question:
How can I easily load and save (preferrable fast and irq) files with the ability to overwrite files? Preferrably by only filenames and without tracks/sector sh1t?
Hope some of you have an answer to this. It's driving me mad and takes me a couple of days now. I need to get this solved otherwise I can't release it at all... :(
Please answer in common simple easy accessible english :) I'm not a tech wizkid :P Sample routines or common loaders/savers with explanation which do the trick would be great instead of (deep) technical discussions which I don't understand.
Eventually on #C-64
Thanks in advance!
The one who gives me the working solution gets a free LED bouncing ball @X! :D
Grtz, Thundax |
|
... 15 posts hidden. Click here to view all posts.... |
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
https://github.com/martinpiper/C64Public/blob/master/BerzerkRed..
SaveHiScore
IRQ saver used in Berzerk Redux.
Example drive init usage here
https://github.com/martinpiper/C64Public/blob/master/IRQDisk/Te.. |
| |
Moloch
Registered: Jan 2002 Posts: 2928 |
Not a good idea to use save with replace (@0:filename) as the patch from Commodore was only applied to newer models of the 1541 |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Not a good idea to use save with replace (@0:filename) as the patch from Commodore was only applied to newer models of the 1541
Oh dang! |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
It can easily be migtigated if need be. see https://www.atarimagazines.com/compute/issue65/save_with_replac..
Basically you either reset the drive, or if you have control over such things make sure all operations just before it, specify the drive number. So if you do load"0:yourfiles" you will be safe. There is a test program in above, not sure if you always have to do the 0: or if it is just before.
This needs to be tested.. off to get the old roms for testing.. |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
I can't get it to happen in VICE |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
but you would trust an atari mag? jeeez |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
Its from Compute! |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
you even expect me to not stop reading the url at "atari"? jeez
and as for the original topic - no, you really have to scratch before save, or you WILL run into problems sooner or later. actually the proper fail safe way would be:
- save new file with temporary name
- scratch old file
- rename new file |
| |
Danzig
Registered: Jun 2002 Posts: 440 |
Quote: you even expect me to not stop reading the url at "atari"? jeez
and as for the original topic - no, you really have to scratch before save, or you WILL run into problems sooner or later. actually the proper fail safe way would be:
- save new file with temporary name
- scratch old file
- rename new file
Pleez follow this advice! |
| |
Thundax
Registered: Oct 2013 Posts: 4 |
Thank you all for your replies!
I'll be working on them the coming few days... |
Previous - 1 | 2 | 3 - Next |