Introduction
The HuC6280 addresses 64 KB, but through eight mapping registers it reaches a 2 MB physical space of 256 banks of 8 KB. A game’s ROM is the first banks; the work RAM, the backup memory and the chip registers are banks of their own. The logical map and the registers are on the HuC6280 registers page; this page is the card’s side of it.
Banks
A .pce file is the ROM as 8 KB banks, numbered from 0 (after any copier header). Bank n is shown by a mapping register holding
n; the first bank is at $E000 at reset. Up to 128 banks (1 MB) fit the card’s space, $00-$7F. A program remaps registers while it runs, with lda #n and
tam #mask, so which bank is at a logical address depends on what ran before; the viewer shows bank 0 at $E000 and one chosen bank at a chosen segment.
The physical banks
| Banks | What is there |
|---|---|
$00-$7F | The HuCard. |
$80-$F6 | Not on a plain system. The CD-ROM system, the Super System Card, the Arcade Card and the SuperGrafx add RAM and registers here; the sources read do not give the bank numbers reliably. |
$F7 | Backup (save game) memory, where the system has it. |
$F8 | Work RAM, 8 KB: the zero page ($2000 logical) and the stack ($2100). |
$F9-$FB | Mirrors of $F8 on the PC Engine; the SuperGrafx has more RAM. |
$FC-$FE | Nothing. |
$FF | The hardware page. |
The hardware page
Bank $FF holds the chip registers; with the first mapping register set to $FF they are at the start of the logical map. Each block repeats through its 1 KB.
| Offset | Block | What it is |
|---|---|---|
$0000-$03FF | VDC | HuC6270 video display controller, 4 registers. The address register is at $0000 and the data at $0002 (low) and $0003 (high). st0, st1 and st2 write these. |
$0400-$07FF | VCE | HuC6260 video colour encoder, 8 registers: control at $0400, the colour table address at $0402-$0403, the colour data at $0404-$0405. |
$0800-$0BFF | PSG | Programmable sound generator: $0800 channel select, $0801 main amplitude, $0802-$0803 frequency, $0804 channel control, $0805 left and right volume, $0806 waveform, $0807 noise, $0808-$0809 LFO. |
$0C00-$0FFF | Timer | 2 registers: reload value at $0C00, start and stop at $0C01. |
$1000-$13FF | I/O | The input/output port (the joypads), 1 register. |
$1400-$17FF | Interrupt controller | 4 registers: $1402 disables interrupts (bit 0 timer, bit 1 IRQ1, bit 2 IRQ2), $1403 holds the request status. |
$1800-$1FFF | (CD) | Unmapped on a plain system. The PC Engine CD’s interface registers start at $1800. |
The SuperGrafx replaces the first block by two video controllers and a priority controller. The VDC register numbers (selected with st0): 00 memory address write, 01 memory address read,
02 VRAM data, 05 control, 06 raster counter, 07 and 08 background scroll, 09 memory width, 0A-0E the sync and display registers, 0F DMA control, 10 DMA source, 11 DMA destination, 12 DMA length, 13 sprite table address.
Vectors
| Logical address | Vector |
|---|---|
$FFF6 | IRQ2, and BRK |
$FFF8 | IRQ1, the video display controller |
$FFFA | TIQ, the timer |
$FFFC | NMI |
$FFFE | Reset |
Each is a 16-bit address, low byte first, read through the mapping register of the top segment. On a card that is the last ten bytes of the first bank: file offset $1FF6.
The Street Fighter II mapper
The 2.5 MB card of Street Fighter II Champion Edition is the one common card with a mapper. In MAME’s description, the first 512 KB of the ROM are banks $00-$3F and stay;
banks $40-$7F (the logical window a program maps there) show one of four 512 KB parts after them, and a write to $1FF0, $1FF1, $1FF2 or $1FF3
chooses the part from the low two bits of the address. The first of the four is selected at reset. A file of exactly 2.5 MB is taken as this card.
| File bytes | Physical banks |
|---|---|
| $000000-$07FFFF (512 KB) | $00-$3F, always |
| $080000-$0FFFFF | $40-$7F when part 0 is chosen (write to $1FF0) |
| $100000-$17FFFF | $40-$7F when part 1 is chosen ($1FF1) |
| $180000-$1FFFFF | $40-$7F when part 2 is chosen ($1FF2) |
| $200000-$27FFFF | $40-$7F when part 3 is chosen ($1FF3) |
Populous’s card has 32 KB of RAM at physical $080000 (bank $40) and is known by the text “POPULOUS” at ROM offset $1F26 (MAME). The CD-ROM System Card is a 256 KB ROM
with the text “PC Engine CD-ROM SYSTEM” at offset $3FFB6 (MAME). The viewer notes both texts and does not model either.
Not described
Known, not yet covered
- Reference: the ROM layouts of 384 KB and 192 KB cards (MAME builds mirrored bank maps for these two sizes; the maps were not read), the Arcade Card’s registers, the CD-ROM interface, the SuperGrafx’s registers, and the exact bank numbers the expansion hardware uses.
Unknown
- Reference: the bits of the joypad port and of the timer and interrupt registers beyond the few named above; the meaning of the VDC’s sync and display registers is not described.
Links
Reference
- CPU memory map – the PCEdev wiki: the banks, the hardware page and the vectors
- Memory Mapping – the physical map by address
- HuC6280 assembly programming for the PC Engine – Chibi Akumas: the register lists of the colour encoder, the sound generator and the interrupt controller
- pce_rom.cpp – MAME: the Street Fighter II and Populous cards