Giter VIP home page Giter VIP logo

Comments (2)

simonowen avatar simonowen commented on July 26, 2024

Unfortunately, 800KiB files fall back on MGT for backwards compatibility, to ensure quirky SAM Coupé disks are still recognised. It's also partly to allow zero-filled files to be treated as MGT, where there's no disk content to match against signatures.

It's supposed to be possible to override the format, to change some values from the detected defaults. In your case I hoped using -s 5 (5 sectors per track) or -z 3 (1024 bytes per sector) would be enough to get it correctly recognised, but it doesn't seem to be working. Either it's broken or I never got around to finishing that -- I'll check!

It'd also be worth me changing the MGT reader to only accept file extensions known to be used for MGT disks: .dsk, .img, .mgt. Unfortunately, the first two are quite common disk image extensions. It could perhaps also treat completely blank images as a special case.

Raw formats (including MGT) should only be tried when signature recognition has failed on other types. Perhaps another format is needed to recognise them? The CP/M support in SAMdisk is also fairly tied to SAM Coupé Pro-DOS, so it's unlikely to recognise other CP/M formats without some help.

from samdisk.

simonowen avatar simonowen commented on July 26, 2024

I've pushed a couple of commits that should hopefully resolve this.

The MGT file reader is now stricter, and requires either directory signature matches or a .mgt file extension. Blank files and quirky SAM disks without a .mgt extension will fall back to the RAW file handler, which will use the same format, but with a warning.

If the raw file handler guesses the wrong format, you can override parts of it to correct it. The default for an 800K file is still the MGT format:

$ samdisk info 800.img
[800.img]
Warning: input format guessed from file size -- please check
 Type:   RAW
 Format: 250Kbps MFM, 80 cyls, 2 heads, 10 sectors,  512 bytes/sector

However, you can override parts of the geometry:

$ samdisk info 800.img -s5
[800.img]
 Type:   RAW
 Format: 250Kbps MFM, 80 cyls, 2 heads,  5 sectors, 1024 bytes/sector

In that case the sector size has been adjusted to match the change in sector count. You can do it with cyls/heads and it works changing either value too:

$ samdisk info 800.img -z3
[800.img]
 Type:   RAW
 Format: 250Kbps MFM, 80 cyls, 2 heads,  5 sectors, 1024 bytes/sector

Similarly, a completely unrecognised file format such as an empty 810K image will normally be rejected:

$ samdisk info 810.img
[810.img]
Error: unrecognised disk image format

However, providing sufficient details from the 80/2/0/512 default allows it to be recognised:

$ samdisk info 810.img -c81 -s10
[810.img]
 Type:   RAW
 Format: 250Kbps MFM, 81 cyls, 2 heads, 10 sectors,  512 bytes/sector

from samdisk.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.