Vpc

Struct Vpc 

Source
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: PriorityLabels

C-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: WindowOrigin

U-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: i64

U-SGX2: a window width at or below this disables the window (sgxtech, tier 2).

§priority: [u8; 2]§window: [u16; 2]§st_to_vdc2: bool

Implementations§

Source§

impl Vpc

Source

pub fn new() -> Vpc

Source

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.

Source

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].

Source

pub fn write(&mut self, offset: u32, value: u8, mclk: i64)

Source

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.

Source

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).

Source

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.

Trait Implementations§

Source§

impl Clone for Vpc

Source§

fn clone(&self) -> Vpc

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Vpc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Vpc

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Vpc

Source§

fn eq(&self, other: &Vpc) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Vpc

Source§

impl StructuralPartialEq for Vpc

Auto Trait Implementations§

§

impl Freeze for Vpc

§

impl RefUnwindSafe for Vpc

§

impl Send for Vpc

§

impl Sync for Vpc

§

impl Unpin for Vpc

§

impl UnwindSafe for Vpc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.