Git Product home page Git Product logo

pc98-disk-tools's Introduction

PC98 disk image tools

Here are some various tools for dealing with PC98 disk images.

History

Many historical image sets of PC98 software store them in "BKDSK" HDM format, but at the time the FlashFloppy firmware only supported FDI images. A converter was needed to convert them.

Most people used the closed-source (AFAIK) Virtual Floppy Image Converter tool, which is excellent. Out of fear of the software one day becoming incompatible, I wanted to figure out for myself what the format differences were. Also, VFIC didn't run right in WINE, which meant having to use a real Windows machine every time I wanted to update or add images.

Nowadays, the FlashFloppy firmware supports HDM images, so this code is primarily useful as a reference.

The tools

is_fdi.py

Has a bunch of best-guess heuristics about whether or not a random image actually is in the FDI format. I ran across a few that were just raw images renamed to .FDI, and so had nonsense headers or the wrong size.

Useful so you don't waste too much time looking at an image that can't possibly be right.

Usage:

$ python3 is_fdi.py Windows\ 95\ \?\?\?\?\?\?.fdi
dummy = 0
fddtype = 144
header size = 4096
fdd size = 1261568
sector size = 1024
sectors = 8
surfaces = 2
cylinders = 77
Windows 95 ??????.fdi: yes

hdm_to_fdi.py

Converts raw HDM images to FDI by generating a fake FDI header for a "2HD"-size disk, and then appends the header and the pad bytes to the front of the HDM raw image.

This worked with FlashFloppy. I don't think it will work if you have any other BKDSK size format (e.g. *.HD5 or *.DD9).

It also worked for me on a D88 image that was converted using d88split's d882mhlt utility, which makes me think that any raw (i.e. uncompressed) Mahalito image will work.

Patches very welcome.

Usage:

$ python3 hdm_to_fdi.py Lemmings.hdm
Converting Lemmings.hdm
Completed write of Lemmings.fdi

fdi_to_hdm.py

Converts FDI images to HDM (raw) by clawing the first 4096 bytes off of them and then sanity-checking that they seem like the right length afterward.

This worked to convert a few FDI images to a raw image that I could mount with mount_disk_image.sh.

Usage:

$ python3 fdi_to_hdm.py Lemmings.fdi
Completed write of Lemmings.hdm

hdi_to_flat.py

Converts an *.HDI hard disk image into a flat image, suitable for writing to a CompactFlash card or other destination hard drive using dd or similar tool.

Usage:

$ python3 hdi_to_flat.py A Ressha de Ikou III HD - Hard Disk Only.hdi
Completed write of A Ressha de Ikou III HD - Hard Disk Only.img

make_blank_image.py

Produces a blank FDI or HDM image. Determines which one based on the extension given.

Usage:

% python3 make_blank_image.py blank.fdi
Wrote blank.fdi

mount_disk_image.sh

Convenience script to mount a raw MSDOS disk image as a loopback on macOS.

Mounts read-write, so be careful if you are afraid of corrupting a disk image.

Usage:

$ sh mount_disk_image.sh Lemmings.hdm
/dev/disk3	/Volumes/Untitled

On Linux, you would probably use something like mount -o loop Lemmings.hdm /mnt/Lemmings, but I haven't tried this yet.

pc98-disk-tools's People

Contributors

barbeque avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pc98-disk-tools's Issues

Convert fdis back to raw images

Should just write a fdi_to_hdm.py that just trims off the first 4096 bytes and then does some sanity checks to make sure the resulting image "seems like" a disk.

Package files into a blank formatted image

Often I'll have something like a loose bunch of files (lzh archive) that I want to install on the computer (e.g. P88SR).

Right now, my technique is:

  1. Get a working HDM
  2. Make a copy
  3. Mount the copy
  4. Delete all the files from the mounted HDM
  5. Copy my files into the HDM
  6. Repeat if I have too many files for one disk
  7. Convert the HDMs to FDIs and put them on the USB stick to be mounted

This is a lot of annoying repetitive stuff, and a computer is supposed to be good at doing annoying repetitive stuff. So let's make the computer do it.

  • Figure out what a FAT filesystem actually looks like on one of these images
  • Make a variation of the make_blank_fdi.py code that creates a blank image with a filesystem
  • Copy in the files into the filesystem (maybe FATPy can help?)
  • Convert the resulting disk into fdi and present it

Create blank disk image

There should be a script or option to create a valid blank disk image, for saving stuff to.

Convert d88 format to fdi(s)

The tomari/d88split repo has some perl scripts for handling d88 disk formats, including the "multiple disks in one file" format.

Should use them as reference to build a better d88 -> raw image converter, which we can then put onto the front end of the hdm -> fdi converter.

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.