Struct GPU

Source
pub struct GPU {
    pub scanline: u32,
    pub crtc: CRTC,
    pub dac: DAC,
    pub font_14: MemoryAddress,
    pub font_16: MemoryAddress,
    pub card: GraphicCard,
    pub mode: VideoModeBlock,
    /* private fields */
}

Fields§

§scanline: u32§crtc: CRTC§dac: DAC§font_14: MemoryAddress§font_16: MemoryAddress§card: GraphicCard§mode: VideoModeBlock

Implementations§

Source§

impl GPU

Source

pub fn default() -> Self

Source

pub fn render_frame(&self, mmu: &MMU) -> VideoFrame

Source

pub fn set_mode(&mut self, mmu: &mut MMU, mode: u8)

int 10h, ah = 00h SET VIDEO MODE

Source

pub fn set_active_page(&mut self, mmu: &mut MMU, page: u8)

int 10h, ah = 05h SELECT ACTIVE DISPLAY PAGE

Source

pub fn get_active_page(&self, mmu: &mut MMU) -> u8

returns the active display page value

Source

pub fn set_cursor_pos(&mut self, mmu: &mut MMU, row: u8, col: u8, page: u8)

int 10h, ah = 02h SET CURSOR POSITION

Source

pub fn write_char( &mut self, mmu: &mut MMU, chr: u16, attr: u8, page: u8, count: u16, showattr: bool, )

int 10h, ah = 0Ah WRITE CHARACTER ONLY AT CURSOR POSITION

Source

pub fn teletype_output(&mut self, mmu: &mut MMU, chr: u8, page: u8, attr: u8)

int 10h, ah = 0Eh TELETYPE OUTPUT Display a character on the screen, advancing the cursor and scrolling the screen as necessary

Source

pub fn write_pixel( &mut self, mmu: &mut MMU, x: u16, y: u16, _page: u8, color: u8, )

int 10h, ah = 0Ch WRITE GRAPHICS PIXEL color: if bit 7 is set, value is XOR’ed onto screen except in 256-color modes

Source

pub fn read_dac_block( &mut self, mmu: &mut MMU, index: u16, count: u16, seg: u16, off: u16, )

int 10h, ax = 1017h READ BLOCK OF DAC REGISTERS (VGA/MCGA)

Source

pub fn load_graphics_chars(&mut self, mmu: &mut MMU, row: u8, dl: u8)

int 10h, ax = 1124h GRAPH-MODE CHARGEN - LOAD 8x16 GRAPHICS CHARS (VGA,MCGA)

Source

pub fn write_string( &mut self, mmu: &mut MMU, row: u8, col: u8, flag: u8, attr: u8, str_seg: u16, str_off: u16, count: u16, page: u8, )

int 10h, ah = 13h WRITE STRING (AT and later,EGA)

Source

pub fn get_individual_palette_register(&self, _reg: u8) -> u8

int 10h, ax = 1007h GET INDIVIDUAL PALETTE REGISTER (VGA,UltraVision v2+)

Source

pub fn set_individual_dac_register( &mut self, mmu: &mut MMU, index: u8, r: u8, g: u8, b: u8, )

int 10h, ax = 1010h SET INDIVIDUAL DAC REGISTER (VGA/MCGA) color components in 6-bit values (0-63)

Source

pub fn set_dac_block( &mut self, mmu: &mut MMU, index: u16, count: u16, seg: u16, off: u16, )

int 10, ax = 1012h SET BLOCK OF DAC REGISTERS (VGA/MCGA)

Source

pub fn get_individual_dac_register(&mut self, reg: u8) -> (u8, u8, u8)

int 10h, ax = 1015h READ INDIVIDUAL DAC REGISTER (VGA/MCGA)

Source

pub fn progress_scanline(&mut self)

HACK to have a source of info to toggle CGA status register

Source

pub fn read_cga_status_register(&self) -> u8

CGA status register (0x03DA) color EGA/VGA: input status 1 register

Source

pub fn init(&mut self, mmu: &mut MMU)

Trait Implementations§

Source§

impl Clone for GPU

Source§

fn clone(&self) -> GPU

Returns a copy 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 Component for GPU

Source§

fn in_u8(&mut self, port: u16) -> Option<u8>

returns Some if read was handled
Source§

fn out_u8(&mut self, port: u16, data: u8) -> bool

returns true if write was handled
Source§

fn out_u16(&mut self, port: u16, data: u16) -> bool

returns true if write was handled
Source§

fn int(&mut self, int: u8, cpu: &mut CPU, mmu: &mut MMU) -> bool

returns true if interrupt was handled

Auto Trait Implementations§

§

impl Freeze for GPU

§

impl RefUnwindSafe for GPU

§

impl Send for GPU

§

impl Sync for GPU

§

impl Unpin for GPU

§

impl UnwindSafe for GPU

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SetParameter for T

Source§

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result
where T: Parameter<Self>,

Sets value as a parameter of 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.