pub struct Bus { /* private fields */ }Implementations§
Source§impl Bus
impl Bus
pub fn new_without_boot_rom(cartridge: Cartridge, config: GameBoyConfig) -> Self
pub fn new_with_boot_rom( cartridge: Cartridge, boot_rom_data: Vec<u8>, config: GameBoyConfig, ) -> Self
pub fn cartridge(&self) -> &Cartridge
pub fn screen_buffer(&self) -> &[u8] ⓘ
pub fn audio_buffers(&mut self) -> AudioBuffers<'_>
pub fn press_joypad(&mut self, button: JoypadButton)
pub fn release_joypad(&mut self, button: JoypadButton)
pub fn connect_device(&mut self, device: Rc<RefCell<dyn SerialDevice>>)
pub fn disconnect_device(&mut self)
pub fn elapsed_ppu_cycles(&mut self) -> u32
Trait Implementations§
Source§impl CpuBusProvider for Bus
impl CpuBusProvider for Bus
Source§fn write(&mut self, addr: u16, data: u8)
fn write(&mut self, addr: u16, data: u8)
each time the cpu writes, clock the components on the bus
fn take_next_interrupt(&mut self) -> Option<InterruptType>
fn peek_next_interrupt(&mut self) -> Option<InterruptType>
fn is_hdma_running(&mut self) -> bool
fn enter_stop_mode(&mut self)
fn stopped(&self) -> bool
Source§fn trigger_write_oam_bug(&mut self, addr: u16)
fn trigger_write_oam_bug(&mut self, addr: u16)
Triggers oam_bug without clock, this is used for inc/dec instructions
Source§fn trigger_read_write_oam_bug(&mut self, addr: u16)
fn trigger_read_write_oam_bug(&mut self, addr: u16)
Triggers oam_bug special case read_write, this happens when an
increment/decrement happen in the same cycle as read
Source§fn read_no_oam_bug(&mut self, addr: u16) -> u8
fn read_no_oam_bug(&mut self, addr: u16) -> u8
reads data without triggering oam_bug, this is used in pop