pub struct Vpc {
pub priority_labels: PriorityLabels,
pub window_origin: WindowOrigin,
pub window_off_at_or_below: i64,
pub priority: [u8; 2],
pub window: [u16; 2],
pub st_to_vdc2: bool,
/* private fields */
}Expand description
Registers, ST steering and the mix. mix(timing, rows) is the PixelPath’s.
Fields§
§priority_labels: PriorityLabelsC-SGX1 (undecidable without hardware): which 2-bit priority code means what. sgxtech says
01b = “VDC #1 sprites behind the VDC #2 background” and 10b = “VDC #2 sprites in front of
the VDC #1 background”; Mednafen and Mesen2 (tier 5) read the same register the other way
round, and Mednafen’s source says Dai Makai Mura (Ghouls ’n Ghosts) uses setting 1 and
expects VDC #2 sprites in front of the VDC #1 background. A shipped game that works on
hardware outranks the document’s labels, so the default follows the detectors. Sgxtech
swaps the two codes. Tier: detectors + a game’s behaviour (5), against tier 2 text.
Decided 2026-11-12 (Aubrey): this default stays. Past the title Dai Makai Mura’s cutscene
and stage 1 lose their statues and score display under Sgxtech and are row-identical to
both detectors under Detectors (the reference’s docs/m6-record.md); still no console run.
window_origin: WindowOriginU-SGX1: where the window edges fall. A window of width W covers the row’s dots
[0, W - 0x40 + ORIGIN[dot_divider]) and is off for W <= 0x40 (sgxtech: “values smaller
than $0040 disable the window”; “windows start from the leftmost pixel of the physical
screen”). The origin per dot clock (4 = 5.37 MHz, 3 = 7.16, 2 = 10.7) is Mednafen’s
calibrated 8 + 24/8 + 38; Mesen2 uses 48 at every clock. Tier 5; the pictures decide
(the reference’s docs/m6-record.md).
window_off_at_or_below: i64U-SGX2: a window width at or below this disables the window (sgxtech, tier 2).
priority: [u8; 2]§window: [u16; 2]§st_to_vdc2: boolImplementations§
Source§impl Vpc
impl Vpc
pub fn new() -> Vpc
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
[hw: sgxtech] power-up: $11 $11 $00 $00 $00 $00 $00 $00 in $08-$0F: windows off,
store-immediate to VDC 1, and only VDC 1 enabled with the default priority everywhere.
Sourcepub fn read(&self, offset: u32) -> u8
pub fn read(&self, offset: u32) -> u8
$08-$0F. Both priority registers and the window LSBs return what was written; the
window MSBs keep only bits 1-0; $0E and $0F read $00 [hw: sgxtech].
pub fn write(&mut self, offset: u32, value: u8, mclk: i64)
Sourcepub fn mix(&mut self, timing: &VideoTiming, rows: &[Vec<u16>]) -> Vec<u16>
pub fn mix(&mut self, timing: &VideoTiming, rows: &[Vec<u16>]) -> Vec<u16>
The PixelPath: VDC 1’s and VDC 2’s rows for one line in, the row for the VCE out.
A register written during the line takes effect at the first dot whose time is at or
after the write, as the VCE’s palette does (Capture): the line is mixed in pieces.
Sourcepub fn window_edge(&self, width: u16, div: i64, dots: i64) -> i64
pub fn window_edge(&self, width: u16, div: i64, dots: i64) -> i64
The first row dot outside a window of register value width (0 = no window).
Sourcepub fn region_config(&self, in_window1: bool, in_window2: bool) -> u8
pub fn region_config(&self, in_window1: bool, in_window2: bool) -> u8
The 4-bit group for a window area, from the registers as the line has replayed them.