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
impl GPU
pub fn default() -> Self
pub fn render_frame(&self, mmu: &MMU) -> VideoFrame
Sourcepub fn set_active_page(&mut self, mmu: &mut MMU, page: u8)
pub fn set_active_page(&mut self, mmu: &mut MMU, page: u8)
int 10h, ah = 05h SELECT ACTIVE DISPLAY PAGE
Sourcepub fn get_active_page(&self, mmu: &mut MMU) -> u8
pub fn get_active_page(&self, mmu: &mut MMU) -> u8
returns the active display page value
Sourcepub fn set_cursor_pos(&mut self, mmu: &mut MMU, row: u8, col: u8, page: u8)
pub fn set_cursor_pos(&mut self, mmu: &mut MMU, row: u8, col: u8, page: u8)
int 10h, ah = 02h SET CURSOR POSITION
Sourcepub fn write_char(
&mut self,
mmu: &mut MMU,
chr: u16,
attr: u8,
page: u8,
count: u16,
showattr: bool,
)
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
Sourcepub fn teletype_output(&mut self, mmu: &mut MMU, chr: u8, page: u8, attr: u8)
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
Sourcepub fn write_pixel(
&mut self,
mmu: &mut MMU,
x: u16,
y: u16,
_page: u8,
color: u8,
)
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
Sourcepub fn read_dac_block(
&mut self,
mmu: &mut MMU,
index: u16,
count: u16,
seg: u16,
off: u16,
)
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)
Sourcepub fn load_graphics_chars(&mut self, mmu: &mut MMU, row: u8, dl: u8)
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)
Sourcepub 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,
)
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)
Sourcepub fn get_individual_palette_register(&self, _reg: u8) -> u8
pub fn get_individual_palette_register(&self, _reg: u8) -> u8
int 10h, ax = 1007h GET INDIVIDUAL PALETTE REGISTER (VGA,UltraVision v2+)
Sourcepub fn set_individual_dac_register(
&mut self,
mmu: &mut MMU,
index: u8,
r: u8,
g: u8,
b: u8,
)
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)
Sourcepub fn set_dac_block(
&mut self,
mmu: &mut MMU,
index: u16,
count: u16,
seg: u16,
off: u16,
)
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)
Sourcepub fn get_individual_dac_register(&mut self, reg: u8) -> (u8, u8, u8)
pub fn get_individual_dac_register(&mut self, reg: u8) -> (u8, u8, u8)
int 10h, ax = 1015h READ INDIVIDUAL DAC REGISTER (VGA/MCGA)
Sourcepub fn progress_scanline(&mut self)
pub fn progress_scanline(&mut self)
HACK to have a source of info to toggle CGA status register
Sourcepub fn read_cga_status_register(&self) -> u8
pub fn read_cga_status_register(&self) -> u8
CGA status register (0x03DA) color EGA/VGA: input status 1 register
pub fn init(&mut self, mmu: &mut MMU)
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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