From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Commodore CRT cartridge image" |
|---|
| claim | "CRT header fields as read by crt_open (all big-endian): signature 0x00 (16), header length u32 0x10, version u16 0x14, hardware type u16 0x16, EXROM 0x18, GAME 0x19, subtype 0x1A, name 32 bytes at 0x20; the header is at least 0x40 bytes and any excess is skipped." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Commodore CRT cartridge image" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "CRT_HEADER" |
|---|
| size_min | 64 |
|---|
| endianness | "big" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 16 |
|---|
| type | "char[16]" |
|---|
| name | "signature" |
|---|
| notes | "one of 'C64 CARTRIDGE ', 'C128 CARTRIDGE ', 'CBM2 CARTRIDGE ', 'VIC20 CARTRIDGE ', 'PLUS4 CARTRIDGE ' (space padded to 16, compared with memcmp); crt_open fails when the signature does not belong to the emulated machine class (a C64 signature is accepted by C64, C64SC, C128 and SCPU64 machines)" |
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "header_length" |
|---|
| notes | "values below 0x40 are rejected; the bytes beyond 0x40 are skipped" |
|---|
|
| offset | "0x14" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "version" |
|---|
|
| offset | "0x16" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "hardware_type" |
|---|
|
| offset | "0x18" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "exrom" |
|---|
|
| offset | "0x19" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "game" |
|---|
|
| offset | "0x1a" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "subtype" |
|---|
|
| offset | "0x20" |
|---|
| size | 32 |
|---|
| type | "char[32]" |
|---|
| name | "name" |
|---|
| notes | "copied with strncpy into a 33-byte buffer, so it stops at the first NUL" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "crt_open uses util_be_buf_to_dword(&h[0x10]), util_be_buf_to_word at 0x14 and 0x16, bytes 0x18/0x19/0x1a, strncpy from 0x20 into a 33-byte name; header size minimum check against sizeof(crt_header)==0x40" |
|---|
| repo | "https://github.com/VICE-Team/svn-mirror" |
|---|
| commit | "22cf0cc8eee4dae54f55ff7a738cf0cb7eaa258f" |
|---|
| path | "vice/src/crt.c" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "CRT header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T13:07:07.547Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T17:46:44.637Z" |
|---|
| summary | "The signature is one of five 16-byte strings and crt_open rejects the file when it does not match the emulated machine; the fact listed it as a bare char[16]. Read crt.c 52-250 at 22cf0cc." |
|---|
| changed | |
|---|
|
|
|---|