pub struct Printer { /* private fields */ }Expand description
A custom GameBoy SerialDevice that emulates
how the GameBoy printer operated.
This device can be used to display printed images by games, check
a sample implementation in mizu frontend crate.
Implementations§
Source§impl Printer
impl Printer
Sourcepub fn get_image_buffer(&self) -> &[u8] ⓘ
pub fn get_image_buffer(&self) -> &[u8] ⓘ
Returns the current printer image buffer
The format is in RGB. i.e. 3 bytes per pixel.
Sourcepub fn get_image_size(&self) -> (u32, u32)
pub fn get_image_size(&self) -> (u32, u32)
Returns the current printer image size (width, height)
Sourcepub fn clear_image_buffer(&mut self)
pub fn clear_image_buffer(&mut self)
Clear the current image buffer of the printer.
Trait Implementations§
Source§impl SerialDevice for Printer
impl SerialDevice for Printer
Source§fn exchange_bit_external_clock(&mut self, bit: bool) -> bool
fn exchange_bit_external_clock(&mut self, bit: bool) -> bool
A device implemnts this, when receiving a call from this function will
send a bit (return) and get a bit from the sender (
bit argument)