simonowen / simcoupe

SAM Coupé emulator
GNU General Public License v2.0
53 stars 12 forks source link

impossible to use CP/M #86

Closed dddfffggg777 closed 1 year ago

dddfffggg777 commented 1 year ago

the issue https://github.com/simonowen/simcoupe/issues/64 still not solved image image impossible to use CP/M

simonowen commented 1 year ago

I believe I've reproduced this and understand what is happening. I missed this previously as I always formatted a new disk rather than an re-using an existing SAM-format disk.

B: maps to SAM floppy drive 1, which probably still contains your Pro-Dos boot disk (was that intentional?). I suspect it's in MGT format, which is a fixed-format sector-based container (2 80 10 * 512=819200 bytes). In that case the target is 10 sectors/track and you're trying to format it as CP/M 9 sectors/track, which is incompatible with the MGT container. SimCoupe tries to fail this command by signalling a FDC WRITE_FAULT, but Pro-Dos doesn't notice and continues trying to format the remaining tracks. At the end of the process the target disk is completely unchanged as none of the track formatting worked. The directory listing will find the original (mostly) zero-filled SAM disk when it tries to show a directory listing, showing question marks instead of the NUL control character. This is the same as if you booted Pro-Dos and issued dir b: immediately.

I suspect that returning a write fault might not be valid controller behaviour so SimCoupe can't use this as a failure mechanism. The only failure guaranteed to work is reporting that the disk is write-protected, which has the potential to confuse users but at least it shows it hasn't worked. It's very much an emulator-specific problem due to the limitations of the target disk image container.

Some work-arounds that you could use with the latest official SimCoupe release:

I'll make a fix to instead report WRITE_PROTECT for any incompatible disk formatting.

dddfffggg777 commented 1 year ago

format.com ignoring "no disk" state and format air same with dir command

dddfffggg777 commented 1 year ago

there is no SAMdisk documentation

dddfffggg777 commented 1 year ago

SAMdisk.exe copy Pro-DOS-v2.dsk zzz.scl Error: SCL is not supported for output

SAMdisk.exe copy Pro-DOS-v2.dsk zzz.trd Error: TRD writing not implemented


useless

simonowen commented 1 year ago

format.com ignoring "no disk" state and format air same with dir command

Pro-Dos doesn't check for a disk before sending the WRITE_TRACK command and relies on a FDC quirk that keeps the controller busy until a disk is inserted. SimCoupe doesn't current support that stuck state but I can add it. I'd not seen this before as most programs checking for a disk before sending FDC commands.

I can't see a problem with the dir b: command without a disk. It loops waiting and the command continues once a disk is inserted. What problem are you seeing?

dddfffggg777 commented 1 year ago

format.com ignoring "no disk" state and format air same with dir command

Pro-Dos doesn't check for a disk before sending the WRITE_TRACK command and relies on a FDC quirk that keeps the controller busy until a disk is inserted. SimCoupe doesn't current support that stuck state but I can add it. I'd not seen this before as most programs checking for a disk before sending FDC commands.

I can't see a problem with the dir b: command without a disk. It loops waiting and the command continues once a disk is inserted. What problem are you seeing?

how to copy files using SAMdisk.exe?

simonowen commented 1 year ago

there is no SAMdisk documentation

There is if you look on the main site. The example command I gave you is all you need to convert your Pro-Dos disk to the more flexible EDSK format. After that you can reformat the 10-sector Pro-Dos boot disk to use as a 9-sector CP/M disk. if that's really what you wanted to do.

SAMdisk.exe copy Pro-DOS-v2.dsk zzz.scl Error: SCL is not supported for output

SAMdisk.exe copy Pro-DOS-v2.dsk zzz.trd Error: TRD writing not implemented

You're probably using SAMdisk v4 ALPHA, which isn't feature complete. SAMdisk v3 on the main site supports writing to .trd images if that's what you need.

However, it makes absolutely no sense to do what you're trying, which is copying a SAM disk into a TRD disk image container. TRD is a fixed-format disk image used by TR-DOS, where each track is 16 x 256 bytes/sector. SimCoupe doesn't support TRD images and has no need to, so even if the copy worked it'd be useless.

If you want a disk image that can be reformatted either as SAM or CP/M in SimCoupe you should use EDSK format. Copying a disk image using SAMdisk and using .dsk for the output image will give you an EDSK image. You can confirm it using SAMdisk info image.dsk.

useless

Garbage in, garbage out.

how to copy files using SAMdisk.exe?

You can't -- it works at a physical disk level not a logical filesystem level. You can copy disks/tracks/sectors between different disk image container formats, but not logical files. You can view directory listings for a few filesystem formats, but they're read-only views.

To copy files you should probably use the correct OS for the file type. Use Pro-Dos to copy CP/M files and SAMDOS/MasterDOS/BDOS to copy SAM files. If you want to copy files to/from your desktop operating system you will need a different utility. There are a few that support the SAM filesystem, and standard CP/M utilities should support Pro-Dos CP/M disks if you get the parameters right (I've never tried).

dddfffggg777 commented 1 year ago

ZIP file with CP/M files most used CP/M disk format in internet 2nd most used https://github.com/begoon/yaze

simonowen commented 1 year ago

There are many different flavours of CP/M and I'd be surprised if many available disk images are compatible directly compatible with Pro-Dos, though I don't know for sure. Some have a header on the disk to describe the format parameters but many lack it and expect the OS to know.

SimCoupe and SAMdisk support for CP/M disks doesn't really go beyond 720K DOS disks used by Pro-Dos, which are seen as a normal 9-sector double-density format. The rest of how they're interpreted is up to Pro-Dos, but anything that works in Pro-Dos on a real SAM machine should work in SimCoupe too.

I have fixes for the two issues you found, which I'll make available after I've had a chance to run some more tests with them.

dddfffggg777 commented 1 year ago

here is example of CP/M disk: https://winworldpc.com/download/146cc2a0-51c2-a9e2-84a2-11c3a6e28094 with i cant use

simonowen commented 1 year ago

That's not a CP/M disk it's just a zip archive containing some CP/M command and data files. To use the files with Pro-Dos in SimCoupe you'll need to find a way to create a CP/M disk image from them. The disk must also be created with the correct CP/M parameters that are compatible with Pro-Dos. I don't know what the parameters are and I don't know of a utility that will convert files to a disk image. You might be better asking the CP/M community and maybe looking at the Pro-Dos manual in case it can help you.

Only once you have a compatible CP/M disk image is it worth returning to try it in SimCoupe. Boot Pro-Dos then insert your new disk image and try a directory listing, etc. The disk image will probably be a raw 720K file (737280 bytes). Even if it doesn't work it's unlikely I'll be able to advise you further as my CP/M knowledge is very limited.

All this is well beyond the scope of SimCoupe support and this GitHub issue. CP/M isn't a native SAM Coupé feature, it's just a software application that runs on the machine to provide a CP/M environment. I can only help with emulation related issues and features, such as any difference in behaviour between running on real SAM hardware and SimCoupe.

dddfffggg777 commented 1 year ago

here is CP/M disk creator: https://www.mathematik.uni-ulm.de/users/ag/yaze-ag/cdm.1.html but it use only *.ydsk format

simonowen commented 1 year ago

There seems to be a much simpler way to transfer files for use with Pro-Dos. It includes a FATREAD command that can read files from FAT16/FAT32 drives. If you format a USB stick as FAT32 and copy your files onto it you can make that drive available to Pro-Dos in SimCoupe.

Launch SimCoupe as Administrator to ensure it has raw access to the USB device. Then under Tools -> Options -> Drive 2, change the drive type to Atom Lite. Instead of selecting a disk image path select your USB device from the drop-down list:

image

Then boot Pro-Dos and run FATREAD C: (or whatever your USB stick show up as). You'll then have a mini shell where you can view the files on the disk and copy to a different drive:

simc0190

Press Ctrl-C (in SimCoupe use the Right-Ctrl key on the keyboard) to exit the shell and return to Pro-Dos. Then do whatever you need with the files. In this example I'm copying the files to the RAM drive to run. You could also copy it to a .cpm disk image file for use in a later session, etc.

dddfffggg777 commented 1 year ago

https://github.com/Othernet-Project/dir2fat32 this ok?

dddfffggg777 commented 1 year ago

how i can create a fat32 image file?

simonowen commented 1 year ago

Using a USB stick is the simplest solution to import files into Pro-Dos, as described above. Creating a FAT32 image file just makes the process more complicated and is beyond the scope of the emulator and this issue.

Please keep to the topic of the issue in these threads. If you require general support on how to use disk images in SimCoupe see the manual, which explains how to insert and boot disks. If you require more general SAM Coupé information and support I recommend joining the SAM Coupe Users Group on Facebook.

You can open a new issue to request emulator features, such as support for the SAM communication interface. Though due to limited development time not all will be added, especially if they're not well supported by software and useful to many SimCoupe users.

dddfffggg777 commented 1 year ago

software not come cose not supported, not supported cose dont have software

simonowen commented 1 year ago

That's true, but it's difficult to change that for such an old system. Only a couple of SAM programs were ever written to use the serial ports on the comms interface, and one of them was only available as a pre-release demo (Termite). The real comms interface also needed a hardware mod to reduce serial port noise and make it more reliable. For comparison, the parallel port in the comms interface was more widely used so SimCoupe supports it for DACs and printers.

I did have some experimental serial support in a very old (~20 years ago) development version of SimCoupe. It was Windows-only and supported just enough to talk to a device (such as a modem) on COM1. I didn't do anything more than send AT commands to it as even then most BBS servers had long since closed down.

Few modern PCs have a serial port (or USB to serial adapter) and something to connect to the serial port. The number of users that would make use of the emulator feature could probably be counted on one hand, so unfortunately it's likely to remain low on my ToDo list. With unlimited time I'd support every feature but in reality I have to prioritise those that benefit more users.

dddfffggg777 commented 1 year ago

check about ESP8266 - a wifi to COM converter its used now for old computers

dddfffggg777 commented 1 year ago

COM port software for CP/M https://github.com/mecparts/zmp useful for file transfer also this http://www.z80.eu/kermit.html

dddfffggg777 commented 1 year ago

www gopher client for zx spectrum + esp8266 on COM port https://www.youtube.com/watch?v=3wtMhGbxkl8