Skip to content

Instantly share code, notes, and snippets.

@ovalenti
Created June 14, 2024 10:45
Show Gist options
  • Save ovalenti/6c37415361bb601d7c23c80d36216e58 to your computer and use it in GitHub Desktop.
Save ovalenti/6c37415361bb601d7c23c80d36216e58 to your computer and use it in GitHub Desktop.
Hector cassette format (Victor Interact Micronique)
# Interact cassette format
The cassette content is made of successive records, each starting by a header, optionally followed
by some payload. Each record's action is determined by a type byte.
record header: [00 40 A0 A9 FE]
| | | | ^ Tape record data type identifier
| | `--+--> Bytes to read/fill [TPBYTS=(5FD6)]
`--+--------> Dest memory address [TPSTRT=(5FD4)]
Record data type flags:
0xFD: end of file. Call program at 0x4C00, must start with 0x31 (LD sp, #xxxx) (see 0x01CF)
0xFE: bulk memory data (erase a memory region).
0xFF(or anything else): tape data
Bulk memory data: expects one byte payload and fills memory with it. (see 0x027B)
BulkByte -> [TPSTRT, TPSTRT + TPBYTS[
Example: 00 40 A0 A9 FE 00
Zeroes 0xA9A0 bytes starting from 0x4000
Tape data: expects a data block of size TPBYTS and copy to memory at TPSTRT. (see 0x02AE)
# .k7 file encoding
The k7 file data is cut into chunks, prefixed by one byte storing the size of the chunk.
[size1][data1 of size size1][size2][data2 of size size2]...
Note1: when size is 0, then the block is 256 bytes long
Note2: Mame uses the last byte of a block to detect bulk records and insert waiting time.
Thus it is important to put bulk records in their own k7 chunk.
Example: [05] DB 5F 02 00 FF [02] E0 39
--- ^ \ actual data
| |
| ` tape data
̀ length: 2 bytes
Copy 2 bytes at 0x5FDB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment