[−][src]Struct pir_8_emu::binutils::pir_8_emu::RawNativePortHandler
Raw C funxion pointers into a loaded DLL
The raw in-/exported names are prefixed with pir_8_emu_
Consult PortHandler
for timings and invariants
These correspond to the following C declaration set:
unsigned char pir_8_emu_port_count();
void * pir_8_emu_init(const unsigned char * ports, unsigned char ports_len);
void pir_8_emu_uninit(void * state);
unsigned char pir_8_emu_handle_read(void * state, unsigned char port);
void pir_8_emu_handle_write(void * state, unsigned char port, unsigned char byte);
These can also be obtained from the
include/pir-8-emu/port_handler.h
file in the git repo
Fields
port_count: extern "C" fn() -> u8
Get the amount of ports this handler handles
Returning 0
from this funxion will panic
init: extern "C" fn(ports: *const u8, ports_len: u8) -> *mut c_void
Get the handler-allocated state corresponding to the specified ports set
It is valid to return nullptr
from this funxion
The ports_len
argument will always be equal to the last return value of port_count()
uninit: extern "C" fn(state: *mut c_void)
Release all resources associated with the specified state
The state
argument will always be equal to the one returned from init()
handle_read: extern "C" fn(state: *mut c_void, port: u8) -> u8
Handle the program reading from one of the handled ports
The port
argument will always have been contained within the set passed to init()
The state
argument will always be equal to the one returned from init()
handle_write: extern "C" fn(state: *mut c_void, port: u8, byte: u8)
Handle the program writing to one of the handled ports
The port
argument will always have been contained within the set passed to init()
The state
argument will always be equal to the one returned from init()
Methods
impl RawNativePortHandler
[src]
pub const PORT_COUNT_NAME: ConstCStr
pub const INIT_NAME: ConstCStr
pub const UNINIT_NAME: ConstCStr
pub const HANDLE_READ_NAME: ConstCStr
pub const HANDLE_WRITE_NAME: ConstCStr
Trait Implementations
impl Clone for RawNativePortHandler
[src]
fn clone(&self) -> RawNativePortHandler
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RawNativePortHandler
[src]
impl Debug for RawNativePortHandler
[src]
impl Eq for RawNativePortHandler
[src]
impl Hash for RawNativePortHandler
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for RawNativePortHandler
[src]
fn cmp(&self, other: &RawNativePortHandler) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<RawNativePortHandler> for RawNativePortHandler
[src]
fn eq(&self, other: &RawNativePortHandler) -> bool
[src]
fn ne(&self, other: &RawNativePortHandler) -> bool
[src]
impl PartialOrd<RawNativePortHandler> for RawNativePortHandler
[src]
fn partial_cmp(&self, other: &RawNativePortHandler) -> Option<Ordering>
[src]
fn lt(&self, other: &RawNativePortHandler) -> bool
[src]
fn le(&self, other: &RawNativePortHandler) -> bool
[src]
fn gt(&self, other: &RawNativePortHandler) -> bool
[src]
fn ge(&self, other: &RawNativePortHandler) -> bool
[src]
impl StructuralEq for RawNativePortHandler
[src]
impl StructuralPartialEq for RawNativePortHandler
[src]
Auto Trait Implementations
impl RefUnwindSafe for RawNativePortHandler
impl Send for RawNativePortHandler
impl Sync for RawNativePortHandler
impl Unpin for RawNativePortHandler
impl UnwindSafe for RawNativePortHandler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,