uxn/src/device.rs

19 lines
483 B
Rust

pub mod console;
pub mod null;
pub mod system;
use crate::vm::Uxn;
pub trait Device: std::fmt::Debug {
/**
* Callbacks used by UXN to do input from a "device".
*/
fn dei1(&mut self, vm: &mut Uxn, port: u8) -> u8;
fn dei2(&mut self, vm: &mut Uxn, port: u8) -> u16;
/**
* Callback used by UXN to do output through a "device".
*/
fn deo1(&mut self, vm: &mut Uxn, port: u8, val: u8);
fn deo2(&mut self, vm: &mut Uxn, port: u8, val: u16);
}