pub struct GameBoy { /* private fields */ }
Expand description
The GameBoy is the main interface to the emulator.
Everything regarding emulation can be controlled from here.
Implementations
sourceimpl GameBoy
impl GameBoy
sourcepub fn builder<RomP: AsRef<Path>>(rom_file: RomP) -> GameBoyBuilder
pub fn builder<RomP: AsRef<Path>>(rom_file: RomP) -> GameBoyBuilder
Initiate a builder object with a cartridge file.
sourcepub fn clock_for_frame(&mut self)
pub fn clock_for_frame(&mut self)
Clocks the Gameboy clock for the duration of one PPU frame.
This is good for timing emulation, you can call this function once and then render it.
sourcepub fn game_title(&self) -> &str
pub fn game_title(&self) -> &str
Return the game title string extracted from the cartridge.
sourcepub fn screen_buffer(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn screen_buffer(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Return the pixels buffer of the PPU at the current state.
The format of the pixel buffer is RGB, i.e. 3 bytes per pixel.
sourcepub fn audio_buffers(&mut self) -> AudioBuffers
pub fn audio_buffers(&mut self) -> AudioBuffers
Return the audio buffer of the APU at the current state.
sourcepub fn press_joypad(&mut self, button: JoypadButton)
pub fn press_joypad(&mut self, button: JoypadButton)
Change the state of the joypad button to pressed
.
sourcepub fn release_joypad(&mut self, button: JoypadButton)
pub fn release_joypad(&mut self, button: JoypadButton)
Change the state of the joypad button to released
.
sourcepub fn connect_device(&mut self, device: Rc<RefCell<dyn SerialDevice>>)
pub fn connect_device(&mut self, device: Rc<RefCell<dyn SerialDevice>>)
Connect a serial device to the Gameboy.
Currently the gameboy can only be master
, so the other device
must be implemented as slave
.
sourcepub fn disconnect_device(&mut self)
pub fn disconnect_device(&mut self)
Disconnects the serial device if any is connected, else, nothing is done
Auto Trait Implementations
impl !RefUnwindSafe for GameBoy
impl !Send for GameBoy
impl !Sync for GameBoy
impl Unpin for GameBoy
impl !UnwindSafe for GameBoy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more