| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Formatting a disk from Basic
Anyone knows how to format a disk in basic, without using any cartridge-specific commands? IIRC it's something with "open". |
|
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
open15,8,15
print#15,"n:name"
close15
or something like that |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
OPEN 1,8,15,"N:DISKNAME,ID":CLOSE 1
(IIRC) |
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
What I suggested only makes a fast format since I forgot ,id
Anyway, the way JackAsser suggested seems better. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
That's like the quickest answer ever! Thanks! |
| |
Clarence
Registered: Mar 2004 Posts: 121 |
I'am suspecting some killer CML-Sports stuff coming up soon...? ;) |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
No chance, he just formatted the disk. |
| |
Scout
Registered: Dec 2002 Posts: 1570 |
Quote: No chance, he just formatted the disk.
:D |
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
Quote: :D
As mentioned, without the ",id" it will only erase the contents of the directory (track 18). The other tracks will not be formatted.
I've had many bad experiences with the emulator lately, with files corrupting. I religiously do a validation after saving code over and over and I also avoid "save and replace" (eg. save "@0:blah,8"). I've always been told save and replace could cause corruption and you know what, it does!! Despite making backups of source code for my last two demos, the original source files were garbled.
open1,8,15,"v0":close1 will validate a disk
open1,8,15,"i0":close 1 will initialize a disk
The zero is optional and dates back from the time where drives were numbered 0 and 1 (like PET drives)
|
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
I've always used save "@:name" & never had any problems with it. |
| |
Nafcom
Registered: Apr 2002 Posts: 588 |
Quote: I've always used save "@:name" & never had any problems with it.
But I experience the same as Wanderer, but only very rarely.
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
wanderer,
replacing files with original 1541 dos is bugges, I've experienced it on the real thing. if you really have to attach an AR, and that will do it fine.
Vice.. I've noticed that it doesnt handles files correctly when a new file is created on the attached .d64 ( PRG* it doesnt close the file until you deattch the d64). That was a year or more ago, not sure if this bug still exists, but when making a new file within vice I always deattach and reattach the d64 to make sure. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
@Wanderer: "I've had many bad experiences with the emulator lately". Hmmm... so you're basically saying that you're coding on the real thing, but on an emulator, that is, u're not cross-compiling. Ever considered simply use Save Snapshot in the VICE menu instead of fiddeling with disks etc?
I atleast always do that when I want to save f.e. a BASIC program or whatever. It's not until I wish to transfer the code to the real thing or distribute it as a .d64/.prg I actually save to disk. |
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
I use CCGS, which I've become accustomed to. It's a mess really.
I save my data files in the monitor but they can't be loaded from a .d64 file, only from the monitor (where they are stored in the CCGS root directory).
Then I have to import the data files using the D64 editor, link them, and I have the final product.
However with CCGS (which has an option to allow instant write on the D64 file so as not to keep it open) it still corrupts.
I have tried the snapshot option, and it works great... but I am somewhat convinced that it also snapshots the D64 file. I'm not 100% certain but I can recall a time where I loaded my snapshot and went to the disk directory to find an outdated file instead of the newer one.
I'd love it if I could save data files direct to D64 file so I could link them. I tried Vice once or twice and it works good but I'm not sure I can save direct to the disk file?? If so I may consider switching.
In a related/unrelated note, you have to be careful with the D64 editor and the "wipe" file option. I once "wiped" a SCR-atched file that was crosslinked with a real file. This occurs when you scratch a file and it's sectors become occupied with a valid file - d64 says they are crosslinked. If you WIPE the old file (which shows as SCRATCHED) so as to avoid getting that crosslink message it will actually fill in the sectors with 0 bytes. Ouch! Thus your valid file gets erased.
|
| |
QuasaR
Registered: Dec 2001 Posts: 145 |
VICE only updates the D64-file if it's detached (IIRC there was a option to update the file after every write but I'm not sure...)
The old SAVE"@:XZY",8 mostly didn't work because the 1541-DOS first wrote the file and then scratched it afterwards, so when there were too less blocks left on the disc, the file went corrupt. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
with save"@:xxx" I had a problem when the new file was overwritten on an older existing one. So when loading "somefilealreadyondisksinceages" It loaded "filesavedwith@:" instead.... |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Hehe, only stupid Action Replay folks use @:, FC3 users can continue to work during file deleting :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
and FC3 users definetly need those extra seconds i guess! :=) |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
They do? On small files the FC3 is actually faster than an AR6 due to less drive upload time and no full track access :P |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
graham: guess what, @: is a commodore dos, and no AR only feature. hope it helped your mental health today, to call us stupid AR folks. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Oswald: Yes, @ is a DOS command but you know what it does? It first saves the file to disk and then deletes the old file. |
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
Quote: Oswald: Yes, @ is a DOS command but you know what it does? It first saves the file to disk and then deletes the old file.
The @ command is a DOS command which Commodore implemented with the evil intent to corrupt source code files, thus causing agony and frustration for programmers worldwide. How many times have I lost code due to the Save and Replace operation? Too many.
|
| |
hollowman
Registered: Dec 2001 Posts: 474 |
Quote: The @ command is a DOS command which Commodore implemented with the evil intent to corrupt source code files, thus causing agony and frustration for programmers worldwide. How many times have I lost code due to the Save and Replace operation? Too many.
i stopped using it after losing sourcecode for the first time =) |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Ofcourse some people like some risk in their lives, and the @ command is very good for that. |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Yeah, I have an old source disk that's been nuked by @:... If you do, it's actually possible to recover all the files, since only the directory is corrupt. By following all the sector links with a recursive algorithm you can reconstruct file chains. My d64 library is probably a good starting place if you feel like writing a recovery utility:
http://www.paradroid.net/diskimage/
|
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
damn, just formatted the wrong disk by mistake. guess it's back to square one :) |
| |
iopop
Registered: Dec 2001 Posts: 317 |
Quote: Yeah, I have an old source disk that's been nuked by @:... If you do, it's actually possible to recover all the files, since only the directory is corrupt. By following all the sector links with a recursive algorithm you can reconstruct file chains. My d64 library is probably a good starting place if you feel like writing a recovery utility:
http://www.paradroid.net/diskimage/
Broken disks is shit. For some reason, which I cant remember right now, I had to code such a tool at lcp this year.. |
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
Quote: Broken disks is shit. For some reason, which I cant remember right now, I had to code such a tool at lcp this year..
I know that the track/sectors follow a pattern (eg. 2/14 2/4, 2/13. 2/3). I've been able to resurrect a few programs with a sector editor.
It goes without saying that if you do lose a file due to scratching it, you can put a value of 130 in the directory to restore it. Everyone must know this already :) I remember being given disks (as a youth) with games and the first thing I'd do was check it for deleting files. I was able to restore a few games this way.
Back on topic though, save and replace sucks. If not for that, I'd still have my missing level for my Jailbreak game. *sigh*
I lost a few vital things that way...
|