Skip to content

Instantly share code, notes, and snippets.

@andyzickler
Created January 11, 2023 22:50
Show Gist options
  • Save andyzickler/a1989075b865cda62c26c1297734a0fc to your computer and use it in GitHub Desktop.
Save andyzickler/a1989075b865cda62c26c1297734a0fc to your computer and use it in GitHub Desktop.
Disk Copy 4.2 Kaitai
meta:
id: diskcopy42
file-extension: img
endian: be
bit-endian: be
doc-ref: https://web.archive.org/web/20201028142058/https://wiki.68kmla.org/DiskCopy_4.2_format_specification
seq:
- id: name
type: pstring
- id: padding
size: 63 - name.len
- id: data_size
type: u4
- id: tag_size
type: u4
- id: data_checksum
type: u4
- id: tag_checksum
type: u4
- id: disk_encoding
type: u1
enum: disk_encodings
- id: format_byte
type:
switch-on: disk_encoding
cases:
'disk_encodings::gcr_ssdd': gcr_format_data
'disk_encodings::gcr_dsdd': gcr_format_data
'disk_encodings::mfm_dsdd': mfm_format_data
'disk_encodings::mfm_dshd': mfm_format_data
- id: magic
contents: [0x01, 0x00]
- id: image_data
size: data_size
- id: tag_data
size: tag_size
enums:
disk_encodings:
0: gcr_ssdd
1: gcr_dsdd
2: mfm_dsdd
3: mfm_dshd
types:
mfm_format_data:
seq:
- id: unused
type: b2
- id: double_sided
type: b1
- id: sector_size
type: b5
gcr_format_data:
seq:
- id: unused
type: b2
- id: double_sided
type: b1
- id: interleave_factor
type: b5
pstring:
seq:
- id: len
type: u1
- id: value
size: len
type: str
encoding: mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment