Module chip

Module chip 

Source
Expand description

The HuC6270 VDC as the CPU sees it: the bus port, VRAM access, status, IRQ1 (vdc/chip.py).

Instances, not module state: a SuperGrafx has two, a PC-FX may one day pin this module.

Bus ($FF:0000-03FF, 4-byte mirror) [hw: pcetech 5]:

$0  write: register select (low 5 bits); read: status
$1  unused, reads 0
$2  data LSB     $3  data MSB

Provisional (U1, tier 5): the VDC’s CPU access schedule in active display. Hudson’s table and MacDonald’s give the mode-0 slot order (CPU, BAT, CPU, ?, CPU, CG0, CPU, CG1) but not the phase against the line. A VRAM data access made during the display width is accepted at once and committed at the next CPU slot of an 8-dot cycle counted from the display start; BSY (status bit 6) is set until then; a second data access while one is pending holds the CPU (RDY) until the first commits. Mednafen instead charges a statistical 1-cycle penalty (C4).

Differences forced by Rust: the reference’s hold callable (the board’s) is an accumulator here, held, which the board takes when the access returns (take_hold): the reference’s board applies its own sum at the same point. A row the reference’s slice assignment would leave with a length other than the line’s (a display start past the row’s end) is left as the overscan row pixel_row returns for it there.

Structs§

Vdc

Constants§

CPU_SLOTS
[hw: pcetech 5.1 register $09] CPU slots within the 8-dot cycle, by VRAM access mode (MWR D1-D0): mode 0 “CPU BAT CPU ??? CPU CG0 CPU CG1”, modes 1 and 2 “BAT CPU CG0 CG1” over two dots each, mode 3 none for the CPU (four-dot accesses, BAT then CG).
VRAM_WORDS
[hw: pcetech 5] 64 KiB; the upper half of the 128 KiB space mirrors it