DSK file editors/tool. Freeware.

Started by cj7hawk, 07:31, 08 June 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hi All,

I hope some in the community find this program useful. It's for copying files between CP/M DSK images, and browsing and managing those images.

I won't announce this proudly, because what I am offering at this time is pretty crap, but it does function and has been useful to me to date, so I am offering it to everyone in early Alpha. It's a programming project to get me back into the saddle with programming a larger project, so it varies from spaghetti code to structure throughout depending on when I wrote the routines.

It can perform a few useful functions such as;
* Copying files between disk images and to/from the PC on which it's being run.
* Managing the files on CP/M disks.
* Changing the boot code for the disk ( can make many 8256 game disks run on the 9512 ).
* Reviewing the disk generally.

It also has rudimentary formatting capabilities for all kinds of formats ( probably unreliable at this point, but it's a start ) and can copy files from a ZX Spectrum TAP file to a disk to begin conversion of the program, though I still have to write in the header code, so it doesn't work properly, but at least makes a start towards this end. I'll add Microdrive image support in later too, though this has little relevance to Amstrad PCWs and CPCs.

It's not great, but it does work and can assist in moving files betweem disks and between the PC and an Amstrad machine that has a GOTEK installed.

To compile, you will need to download FREEBASIC, which is probably the most advanced BASIC out there that's free, and install it, or you can just unzip it to a directory - it's not too fussy as long as you keep to it's root directory. Then copy the CP/M.BAS file to the FREEBASIC root directory, open a CMD window in the same directory and type in "FBC CPM.BAS" and that will compile it as all the code is in the BASIC file - it doesn't have any dependencies. This will produce an executable on Linux, PC or Mac, though I haven't tested on Mac. The executable is portable, and will run on a PC without installation, but I don't recommend downloading the binary in a modern virus-filled world.

Once the executable is run, it opens a pseudo-shell and you can type help or enter a ? and press enter to get the help instructions up. DSKs can be mounted from A: to P: ( It's a pseudo-shell, so these are not accessible from windows, only within the program ) and then you can get information on the DSK image, move files, view files, dump hex, etc.

If anyone is interested in testing and offering feedback as I continue development, please join in. I can't promise good code, or even a good program, but it works at what it was designed to do to at least a functional level and I figure even if you just use it to rewrite boot sector data on DSK images, it's good for that one thing.

It is provided without any warranty, as an alpha. Make sure you back up all your DSK images before use, as it is code that is likely to cause as many problems as it solves, but some times any tool is better than no tool. It's not ready for release at this stage, and is not fit for any purpose, but I am seeking early feedback on it to improve it.

If there is interest, I don't mind making a few short videos to show how to do stuff like changing the boot code or similar.


File: https://os.blackice.com.au/userfiles/david-cpm.bas

Rename as just "cpm.bas" before compiling, or just use "FBC david-cpm.bas" instead. 


Thanks for this - I'll try it out.

I've already got FreeBasic installed, and I've used it for a number of projects.  Very useful, esp as there are so many fancy bits already incorporated.   Also great that you can download it, install it onto your HD and immed compile/run the sample progs.   So it pretty much works 'out of the box'!   On the PC anyway, I think it's more complicated under Linux, as you've got to download/install etc a lot of the GCC libs separately.

I think that I can do all the functions of your system in other ways incl the Joyce emularot, but it'll be interesting to see what you've donw.



So, I've compiled the prog, everything seems OK.

I tried the HELP command, which over-ran my screen with text which was not a lot of 'help'.

So, came out, went back in again running the prog followed by '> help.txt', and mimiced being in the prog typing the 'help' and then the 'quit' to exit.   This gave me a file 'help.txt' which could be useable.   BUT many of the lines were too long, so I had to edit it somewhat.

Hopefully, edited version attached.

Tried to do something with a .DSK file, but got an error re 'no image mapped to drive'.   Seems that the command to do this is 'mount' and this is not implemented yet?  Does this mean that the prog will not do anything yet - at all?  Maybe your posting said this, but I maybe assumed that it would do SOMETHING?

I'll keep playing?

Thanks anyway.



Update - I looked at the .BAS file, found the code for the 'mount' function, and noted that it did not appear to be disabled.   Seemed to be there, and OK.

So I tried the mount <image.dsk> B: and it worked.   Followed this with 'dir B:' and this gave me the promised directory listing.

So far, so good.



Following on from the previous, this time I added an lput command, which is supposed to copy a file from the image to the host drive.


Tried to copy the filename, got errors.

Tried again, this time with the drive and the filename i.e. lput B:file - this worked.  So you need a valid PATH, not just a filename.   Local (host) destination is assumed OK.

BUT, when I looked at the file created!!

The image I was accessing had a small SUBMIT file in, TEST.SUB.  The file showing on my drive was TEST     SUB, i.e. spaces showing, no dot.  File was not accessible unless I renamed it correctly, or I tried to access it as 'TEST    SUB', or used WinDoze to access it (I was working from the command prompt otherwise).   Looking in the data for the file, there was no EOF marker, and there were numerous E5 bytes after the end of the valid data (i.e. the blank disk format marker), to pad the data out to 256 bytes.   The file I was testing was a .txt file, so I can get rid of the dud bytes, if it was a binary file this would be more of a problem?



If anyone's interested, I could put the .exe into a .zip and attach it.  If you're worried about security, I could specify the file sizes of the .zip and the .exe to provide some degree of verification.



Wow, that was quite a lot of work - Again I apologise that it is very early Alpha... Barely functional, but as you noticed, it does mostly work.

i never thought of adding the EOF, since I wanted copied files to be binary accurate, but it does set the byte counter as per CP/M-3 which does count bytes rather than extents. I should add in a command to add an EOF to a file otherwise.

There's some bugs with CPM3 compatability though, as it doesn't process the flags in the filename - it just removes them.

Someone has suggested I add a "Command Line" mode since apart from drive selected, it's functionally idempotent, so it should be possible to just run it as a command followed by the string.

I should have written some basic instructions. It's intended for a very large DOS window size, and when it prints HEX, it prints 32 bytes wide, in HEX format, with subsequent character strings, so I usually open a DOS window, resize it to full screen and then run the program, and look back through the HELP via the scroll bar in the DOS CMD window.

I never considered how awkward that would get as it got bigger. When I started, it was 80x25 and I just kept adding stuff to it.

Changing the boot sector code is a little more complicated. When a DSK is mounted, it goes something like (assuming it's mounted as F )

BCOPY F: F: 255

That will rewrite the boot sector with the new checksum to FF which is useful for converting a 8256 game disk to a 9512 game disk. I find my success rate is better than 50% so far, but that is more due to the game not being written for the PCW9512.


Powered by SMFPacks Menu Editor Mod