Struct megadrive_sys::vdp::VDP[][src]

pub struct VDP { /* fields omitted */ }

Implementations

impl VDP[src]

pub fn new() -> VDP[src]

Initialise and return the VDP.

pub fn read_state_raw(&self) -> u16[src]

Read the VDP status register.

pub fn set_register(&mut self, reg: u8, value: u8)[src]

Set a single VDP register.

This can cause the VDP to become out of sync with our state caching. Where possible it is best to use the specific methods in VDP.

pub fn set_increment(&mut self, incr: u8)[src]

Set the address increment on write.

This can be used to configure how many bytes are written per data write.

pub fn write_data(&mut self, data: u16)[src]

Write data to VRAM at the current write address.

pub fn set_address(&mut self, kind: AddrKind, ptr: u16)[src]

Set the VRAM write address.

This will be incremented after every write via write_data.

pub fn dma_upload(
    &mut self,
    kind: AddrKind,
    dst_addr: u16,
    src_addr: *const (),
    length: u16
)
[src]

Upload memory from ROM or RAM to VRAM.

pub fn dma_set(&mut self, kind: AddrKind, dst_addr: u16, fill: u8, length: u16)[src]

Fill VRAM memory with the given byte.

Technically the VDP supports doing this in both byte and word forms, but the word form seems to not work as expected.

pub fn dma_copy(
    &mut self,
    kind: AddrKind,
    dst_addr: u16,
    src_addr: u16,
    length: u16
)
[src]

Copy from VRAM to VRAM.

pub fn modify_mode(&mut self, mask: u32, set: u32)[src]

Modify the MODE registers.

This takes a mask of bits to replace and their new values. The integer is formatted with MODE_4 being the highest 8 bits, down to MODE_1 being the lowest.

pub fn framerate(&self) -> u8[src]

Fetch the framerate of the VDP.

pub fn resolution(&self) -> (u16, u16)[src]

Fetch the current operating resolution.

pub fn enable_display(&mut self, enable: bool)[src]

Enable the display.

Without this set, the entire screen shows the background colour.

pub fn enable_interrupts(&mut self, h: bool, v: bool, x: bool)[src]

Enable the horizontal blanking interrupt.

The IRQ level on the CPU still needs to be set accordingly to allow the interrupt to happen.

h triggers an interrupt for every horizontal line drawn. v triggers an interrupt at the start of the vblank period. x triggers an interrupt on the external interrupt.

pub fn stop_hv_counter(&mut self, stopped: bool)[src]

Stop the HV counter.

pub fn set_resolution(&mut self, h: bool, v: bool)[src]

Enable the increased resolution 40x30-cell mode.

Vertical 30-cell mode is only available on PAL systems.

pub fn set_scroll_mode(&mut self, h: HScrollMode, v: VScrollMode)[src]

Configure scrolling mode.

pub fn enable_shadow_mode(&mut self, enable: bool)[src]

Enable shadow / highlight mode.

pub fn set_interlace(&mut self, mode: InterlaceMode)[src]

Configure interlaced output.

pub fn set_h_interrupt_interval(&mut self, interval: u8)[src]

Configure how frequently the H-blank interrupt fires.

pub fn set_plane_size(&mut self, x: ScrollSize, y: ScrollSize)[src]

Set the size of the tile planes (plane A, plane B and the window plane).

pub fn set_plane_a_address(&mut self, address: u16)[src]

Configure the address for the plane A tile map.

This should ideally be set before the display is enabled if it is to be changed.

pub fn set_plane_b_address(&mut self, address: u16)[src]

Configure the address for the plane B tile map.

This should ideally be set before the display is enabled if it is to be changed.

pub fn set_sprite_address(&mut self, address: u16)[src]

Set the base address for the sprite table.

pub fn set_window_base(&mut self, address: u16)[src]

Set the base address for the window plane.

pub fn set_scroll_base(&mut self, address: u16)[src]

Set the base address for the scrolling matrix.

pub fn set_window(&mut self, x: WindowDivide, y: WindowDivide)[src]

Configure where the window is drawn instead of plane A.

pub fn set_background(&mut self, palette: u8, colour: u8)[src]

Set the palette entry for the background colour.

pub fn set_palette(&mut self, index: u16, palette: &[u16; 16])[src]

Set one of the 4 configurable palettes.

pub fn set_tiles_iter<T>(
    &mut self,
    start_index: u16,
    tiles: impl Iterator<Item = T>
) where
    T: Deref<Target = Tile>, 
[src]

Set the contents of some tiles in VRAM.

pub fn set_tiles(&mut self, start_index: u16, tiles: &[Tile])[src]

Set tiles using DMA.

This can be faster than set_tiles() but is slightly more restricted: it has to take a slice.

pub fn set_sprites_iter<T>(
    &mut self,
    first_index: u16,
    sprites: impl Iterator<Item = T>
) where
    T: Deref<Target = Sprite>, 
[src]

Set the contents of some sprites in the sprite table.

pub fn set_sprites(&mut self, first_index: u16, sprites: &[Sprite])[src]

Load sprites into VRAM using DMA.

This can be faster than set_sprites() but is slightly more restricted: it has to take a slice.

pub fn set_h_scroll(&mut self, first_index: u16, values: &[i16])[src]

Set the horizontal scroll for planes A and B.

pub fn set_v_scroll(&mut self, first_index: u16, values: &[i16])[src]

Set the vertical scroll for planes A and B.

pub fn set_plane_a_tiles(&mut self, first_index: u16, values: &[TileFlags])[src]

Set the tile flags for plane A.

pub fn set_plane_b_tiles(&mut self, first_index: u16, values: &[TileFlags])[src]

Set the tile flags for plane B.

pub fn set_window_tiles(&mut self, first_index: u16, values: &[TileFlags])[src]

Set the tile flags for the window plane.

Auto Trait Implementations

impl Send for VDP

impl Sync for VDP

impl Unpin for VDP

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.