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:PC Engine HuCard ROM image

From ReverseEngineering.wiki
Format
Extensions .pce, .sgx
Endianness little
On this wiki Facts · Code · Notes · Topics

Raw dump of a PC Engine / TurboGrafx-16 HuCard (.pce, .sgx): no header, the ROM in 8 KiB banks that the HuC6280 maps through its MPR registers; a 512-byte copier header is sometimes in front, and ROMs above 1 MiB use the Street Fighter II board mapper.

Overview

A HuCard dump has no header or magic. The file is the ROM, divided into 8 KiB banks (the unit of the HuC6280 memory mapping, see Platform:PC Engine). Emulator loaders: Mesen2 Core/PCE/PceConsole.cpp, ares mia/medium/pc-engine.cpp.

Copier header

If the file size modulo 0x2000 is 512, both Mesen2 and ares discard the first 512 bytes before use. Mesen2 then pads a non-power-of-two size with zeros at the end up to the next power of two.

Bank layout and mirroring

The CPU sees 128 ROM banks (bank numbers 0x00-0x7F, 1 MiB) through the MPR registers. ROM images smaller than 1 MiB are mirrored. Mesen2 (PceMemoryManager.cpp, constructor) maps the 8 groups of 16 banks as follows:

ROM size Group offsets (units of 16 banks = 128 KiB)
384 KiB (0x30 banks) 0, 1, 0, 1, 2, 2, 2, 2
512 KiB (0x40 banks) 0, 1, 2, 3, 2, 3, 2, 3
768 KiB (0x60 banks) 0, 1, 2, 3, 4, 5, 4, 5
anything else 0..7 in order, wrapping modulo the bank count

This is that emulator's compatibility choice, not a hardware statement: the real 384/512/768 KiB cards decode their address lines in their own way. ares classifies by size: 0x60000 bytes is board "Split", 0x280000 is "Banked", everything else "Linear".

Street Fighter II mapper (above 1 MiB)

A ROM larger than 1 MiB (0x80 banks) is assumed to be the 2.5 MiB Street Fighter II card (Mesen2 PceSf2RomMapper.cpp). The lowest 512 KiB (banks 0x00-0x3F) stay fixed; a write to any address 0x1FF0-0x1FFF inside the mapped window selects a 512 KiB page: the page number is address & 0x0F, and the upper four groups (CPU 0x8000-0xFFFF, banks 0x40-0x7F) then show ROM bank 0x40 + page*0x40 + n.

Related

Platform:PC Engine (memory map, CD-ROM system card).

Code & repositories

  • https://github.com/SourMesen/Mesen2 @ b9fa69ddc6d0a331fb103fdb5eef6904305703c2 · license: GPL-3.0 (declared by the contributor; GitHub's detector did not recognize LICENSE)
    Multi-system emulator with debugger; Core/SMS (Sega mapper, Codemasters), Core/PCE (MPR banking, SF2 mapper, CD-ROM), Core/WS (cart footer parsing)
    Tested on: source read, not run: read the source, not built · checked 2026-10-18
  • https://github.com/ares-emulator/ares @ 9408cb43d4948fc3ea6e152a307a34348df3fe04 · license: ISC (declared by the contributor; GitHub's detector did not recognize LICENSE)
    Multi-system emulator; its cartridge loaders and databases show header layouts, mapper detection and save types.
    Tested on: source read, not run: source read, not run · checked 2026-10-18