Skip to main content

NullBus

Struct NullBus 

Source
pub struct NullBus;
Expand description

A no-op Bus (all reads open, writes dropped) for unit-testing the CPU in isolation.

Trait Implementations§

Source§

impl Bus for NullBus

Source§

fn read24(&mut self, _addr24: u32) -> u8

Read a byte at a 24-bit address (no clock advance — the CPU sequences timing via Bus::advance around this call).
Source§

fn write24(&mut self, _addr24: u32, _val: u8)

Write a byte at a 24-bit address (no clock advance — see Bus::read24).
Source§

fn access_cycles(&self, _addr24: u32) -> u32

Master clocks this access costs (ares CPU::wait): the region-variable access speed (FastROM vs SlowROM, WRAM, I/O). Defaults to the SlowROM/internal-cycle cost of 6.
Source§

fn advance(&mut self, _clocks: u32)

Advance the system clock by clocks master ticks (ares CPU::step), ticking the PPU/APU/coprocessor and HDMA in lockstep. Default no-op for buses whose timebase is charged elsewhere (the SA-1 second CPU) or that don’t model timing (unit-test buses).
Source§

fn poll_nmi(&mut self) -> bool

Edge-triggered NMI poll (PPU vblank → CPU). Returns true once per high→low edge.
Source§

fn poll_irq(&mut self) -> bool

Level-sensitive IRQ poll (PPU HV-IRQ, on-cart coprocessor, APU timer). Honored only when the CPU’s I flag is clear.
Source§

impl Debug for NullBus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NullBus

Source§

fn default() -> NullBus

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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, 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.