Skip to content

andete/disk-peek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disk Peek

▶ Live: https://damad.be/joost/disk-peek/

A polished, 100% client-side web tool for inspecting and extracting files from retro floppy disk images — MSX .dsk, Atari ST .st, and generic FAT12 .img (MS-DOS 160K–1.44M). Drag a disk in, browse its directory tree, preview files, and download them individually or as a .zip. Nothing is ever uploaded — all parsing happens in your browser.

Features

  • Drag & drop (or browse) a disk image — no server, works offline.
  • Zipped disks — drop a .zip and Disk Peek finds the disk image inside (picking one if the archive holds several). DEFLATE is handled natively, no dependencies.
  • Directory tree with subdirectories, file sizes, and a volume label.
  • Smart previews:
    • MSX‑BASIC programs are detokenized back to a readable listing.
    • Plain text / ASCII files shown as text.
    • MSX screen images rendered from the raw VRAM dump: MSX1 SCREEN 1/2, MSX2 SCREEN 4/5/6/7/8, MSX2+ YJK SCREEN 10/11/12 (.SCA/.SCB/.SCC), Graphos .GE5/.GL5, and Graph Saurus raw .SR5/.SR7. For the customisable modes the palette is taken from the image itself when the dump includes it (palette VRAM region — 0x7680 for SCREEN 4/5/6, 0xFA80 for SCREEN 7), else a sibling .PLx file, else the MSX2 default.
    • Format auto-detection: type is decided by content, not just the extension — tokenized BASIC, .COM/BSAVE binaries, and (from the BSAVE header) SCREEN 2/5 dumps are recognised even under the "wrong" or a missing extension.
    • Binaries shown as a hex dump (with the BSAVE/BLOAD header decoded) and a Z80 disassembly view. .COM files are treated as MSX‑DOS Z80 executables (origin 0x0100) and default to the disassembly view.
    • A per-file view toggle (Decoded ⇄ Hex, or Hex ⇄ Z80).
  • Recover deleted files — a toggle reveals 0xE5-deleted entries, recovered best-effort (contiguous read; the erased first name character shows as ?).
  • Try it instantly with the bundled sample disk — one file per preview type: tokenized BASIC, text, SCREEN 2/5/8 images, a BSAVE binary, an MSX-DOS .COM, and a deleted file to recover.
  • Download individual files, or bundle everything into a .zip.
  • Robust FAT12 reader for real-world / imperfect dumps:
    • falls back to a contiguous read when the FAT chain is broken/zeroed (CONTIG),
    • flags cross-linked clusters (XLINK),
    • reconstructs geometry from the image size when the boot sector has no usable BPB.

Running it

It's a static site with no build step. Because it uses ES modules, serve it over HTTP (opening file:// directly won't load the modules):

python3 -m http.server 8777
# then open http://localhost:8777/

To deploy, copy the folder to any static host.

Project layout

File Purpose
index.html Page shell
css/styles.css Theme-aware styling (light/dark)
js/fat12.js FAT12 reader (BPB, cluster chains, subdirs, recovery)
js/msxbasic.js MSX‑BASIC detokenizer (canonical token table)
js/preview.js Preview dispatch: text / BASIC / image / .COM / hex
js/screens.js MSX screen renderers (SCREEN 1/2/4/5/6/7/8) + palettes
js/z80.js Z80 disassembler (CB/ED/DD/FD/DDCB/FDCB)
js/zip.js Minimal dependency-free ZIP writer (store method)
js/unzip.js ZIP reader — lists entries, inflates via DecompressionStream
js/app.js UI wiring
tools/make-sample-disk.mjs Node script that builds the bundled samples/sample.dsk

Notes & limitations

  • FAT12 only for now (covers MSX, Atari ST, and DOS floppies). FAT16/FAT32 and Amiga/Apple/Commodore formats are out of scope.
  • Read/extract only, by design — writing modified disks back out is out of scope.
  • Disassembly is Z80 only. m68k (Atari ST) could follow but is a much larger job.
  • The 256-wide MSX2 modes share a VRAM size, so an extension-less dump of SCREEN 6/7/8/10/11/12 can't be told apart by content — those need the right extension.
  • Screen images saved as bare bitmaps (no palette region) use the MSX2 default palette.
  • MSX‑BASIC float literals are decoded from the BCD format on a best-effort basis.

Validated against a corpus of 185 real MSX .dsk images (7.8k live files + ~750 recoverable deleted files) — everything parses without error.

The FAT12 recovery logic is adapted from a proven Python extractor used for real MSX disk preservation work.

License

MIT © 2026 Joost Yervante Damad.

About

Inspect & extract files from retro floppy disk images (MSX .dsk, Atari ST .st, FAT12 .img) — entirely in your browser. No uploads, no build step.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors