Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:G64 GCR disk image

From ReverseEngineering.wiki
Format
Platforms Platform:Commodore 64
Magic GCR-1541
Extensions .g64 .g71
On this wiki Facts · Code · Notes · Topics

VICE's raw-GCR image of a 1541 (GCR-1541) or 1571 (GCR-1571) disk: 8-byte signature, version 0, half-track count, maximum track size and a table of half-track offsets, so copy-protection tracks and non-standard sync survive.

Header

Offsets from MAME's g64_dsk.h: signature at 0 ("GCR-1541", or "GCR-1571" for a two-sided image), version byte at 8 (must be 0), half-track count at 9, little-endian u16 maximum track size at 0xA, then the half-track offset table (u32 little-endian each) at 0xC. A zero offset means the half track has no data. After the offset table comes a table of u32 speed zones, one per half track; a value above 3 means an offset to a per-byte speed table (MAME ignores it). Each track record starts with a u16 byte length followed by the raw GCR bytes. MAME treats 84 half tracks per side as the maximum.

Speed zones

Zone 0-3 have cell sizes of 16 MHz/16/4, /15/4, /14/4 and /13/4 (4000, 3750, 3500, 3250 in MAME units). Raw track size is 200000000 / (cell size x 8) bytes.

Why use it

A D64 (Format:Commodore D64, D71 and D81 disk images) only holds decoded sectors; G64 keeps sync marks, half tracks and weak data layout, which protections depend on.

Sources

MAME src/lib/formats/g64_dsk.cpp and g64_dsk.h, commit 1d7a454ed79e97d35d2a9f127ac029ead94711d6.

Code & repositories

  • https://github.com/mamedev/mame @ 1d7a454ed79e97d35d2a9f127ac029ead94711d6 · license: BSD-3-Clause (declared by the contributor; GitHub's detector did not recognize COPYING)
    MAME src/lib/formats/*_dsk.cpp and tzx_cas.cpp: floppy and tape image loaders
    Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries
  • https://github.com/VICE-Team/svn-mirror @ 22cf0cc8eee4dae54f55ff7a738cf0cb7eaa258f · license: GPL-2.0-or-later (declared by the contributor; GitHub's detector did not recognize a license file)
    VICE emulator source: src/tape/t64.c, tap.c, src/crt.c, cartridge.h, diskimage/fsimage-probe.c
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-19; Note: the latest release ships binaries; the wiki links only the source, never the binaries