From 792e2aa4a6f1900c738b58a75d00e610e7a71759 Mon Sep 17 00:00:00 2001 From: ProfElements Date: Wed, 27 Nov 2024 03:33:31 -0600 Subject: [PATCH 1/5] :sparkles: feat(mmio): Add Command Processor MMIO region --- src/mmio/command_processor.rs | 116 ++++++++++++++++++++++++++++++++++ src/mmio/mod.rs | 6 ++ 2 files changed, 122 insertions(+) create mode 100644 src/mmio/command_processor.rs diff --git a/src/mmio/command_processor.rs b/src/mmio/command_processor.rs new file mode 100644 index 0000000..cb0122d --- /dev/null +++ b/src/mmio/command_processor.rs @@ -0,0 +1,116 @@ +#![warn(missing_docs)] +#![warn(clippy::pedantic)] + +use voladdress::{Safe, VolAddress}; + +const BASE: usize = 0xCC00_0000; + +const STATUS_REGISTER: VolAddress = unsafe { VolAddress::new(BASE) }; + +const CONTROL_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x2) }; + +const CLEAR_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x4) }; + +const PERFORMANCE_SELECT: VolAddress = unsafe { VolAddress::new(BASE + 0x6) }; + +const TOKEN: VolAddress = unsafe { VolAddress::new(BASE + 0xE) }; + +const BOUNDING_BOX_LEFT: VolAddress = unsafe { VolAddress::new(BASE + 0x10) }; + +const BOUNDING_BOX_RIGHT: VolAddress = unsafe { VolAddress::new(BASE + 0x12) }; + +const BOUNDING_BOX_TOP: VolAddress = unsafe { VolAddress::new(BASE + 0x14) }; + +const BOUNDING_BOX_BOTTOM: VolAddress = unsafe { VolAddress::new(BASE + 0x16) }; + +const FIFO_BASE_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x20) }; + +const FIFO_BASE_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x22) }; + +const FIFO_END_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x24) }; + +const FIFO_END_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x26) }; + +const FIFO_HIGH_WATERMARK_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x28) }; + +const FIFO_HIGH_WATERMARK_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x2A) }; + +const FIFO_LOW_WATERMARK_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x2C) }; + +const FIFO_LOW_WATERMARK_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x2E) }; + +const FIFO_READ_WRITE_DISTANCE_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x30) }; + +const FIFO_READ_WRITE_DISTANCE_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x32) }; + +const FIFO_WRITE_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x34) }; + +const FIFO_WRITE_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x36) }; + +const FIFO_READ_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x38) }; + +const FIFO_READ_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x3A) }; + +const FIFO_BREAKPOINT_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x3C) }; + +const FIFO_BREAKPOINT_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x3E) }; + +const TRANSFORM_RASTER_BUSY_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x40) }; + +const TRANSFORM_RASTER_BUSY_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x42) }; + +const TRANSFORM_CLOCK_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x44) }; + +const TRANSFORM_CLOCK_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x46) }; + +const TRANSFORM_WAIT_IN_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x48) }; + +const TRANSFORM_WAIT_IN_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x4A) }; + +const TRANSFORM_WAIT_OUT_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x4C) }; + +const TRANSFORM_WAIT_OUT_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x4E) }; + +const VERTEX_CACHE_CHECK_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x50) }; + +const VERTEX_CACHE_CHECK_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x52) }; + +const VERTEX_CACHE_MISS_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x54) }; + +const VERTEX_CACHE_MISS_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x56) }; + +const VERTEX_CACHE_STALL_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x58) }; + +const VERTEX_CACHE_STALL_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x5A) }; + +const CLOCKS_PER_VERTEX_IN_COUNT_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x60) }; + +const CLOCKS_PER_VERTEX_IN_COUNT_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x62) }; + +const CLOCKS_PER_VERTEX_OUT_COUNT: VolAddress = + unsafe { VolAddress::new(BASE + 0x64) }; diff --git a/src/mmio/mod.rs b/src/mmio/mod.rs index a56ef88..f08ab61 100644 --- a/src/mmio/mod.rs +++ b/src/mmio/mod.rs @@ -12,4 +12,10 @@ pub mod pi; /// with the serial interface command buffers. pub mod serial_interface; +/// Command Processor Inteface Helper Types and MMIO +/// +/// This is used to interact with the Graphics Fifo. This is needed to properly intitalize the GX +/// subsystem. +pub mod command_processor; + pub mod vi; From 12aaa0e634ea47aae5bf7e607429677dc0d93c92 Mon Sep 17 00:00:00 2001 From: ProfElements Date: Thu, 12 Dec 2024 02:56:36 -0600 Subject: [PATCH 2/5] :sparkles: feat(MMIO): Swap u16 to `Status` and `Control` for each of their respective MMIO registers. --- src/mmio/command_processor.rs | 150 +++++++++++++++++++++++++++++++++- 1 file changed, 148 insertions(+), 2 deletions(-) diff --git a/src/mmio/command_processor.rs b/src/mmio/command_processor.rs index cb0122d..bcb56e5 100644 --- a/src/mmio/command_processor.rs +++ b/src/mmio/command_processor.rs @@ -3,11 +3,13 @@ use voladdress::{Safe, VolAddress}; +pub use types::{Control, Status}; + const BASE: usize = 0xCC00_0000; -const STATUS_REGISTER: VolAddress = unsafe { VolAddress::new(BASE) }; +const STATUS_REGISTER: VolAddress = unsafe { VolAddress::new(BASE) }; -const CONTROL_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x2) }; +const CONTROL_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x2) }; const CLEAR_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x4) }; @@ -114,3 +116,147 @@ const CLOCKS_PER_VERTEX_IN_COUNT_HIGH: VolAddress = const CLOCKS_PER_VERTEX_OUT_COUNT: VolAddress = unsafe { VolAddress::new(BASE + 0x64) }; + +pub(crate) mod types { + use bit_field::BitField; + + use super::{CONTROL_REGISTER, STATUS_REGISTER}; + + #[repr(transparent)] + #[derive(Copy, Clone, Debug)] + pub struct Status(u16); + + impl Status { + pub const fn new() -> Self { + Self(0) + } + + pub fn read() -> Self { + STATUS_REGISTER.read() + } + + pub fn write(self) { + STATUS_REGISTER.write(self); + } + + pub fn overflow(self) -> bool { + self.0.get_bit(0) + } + + pub fn with_overflow(mut self, has_overflowed: bool) -> Self { + self.0.set_bit(0, has_overflowed); + self + } + + pub fn underflow(self) -> bool { + self.0.get_bit(1) + } + + pub fn with_underflow(mut self, has_underflowed: bool) -> Self { + self.0.set_bit(1, has_underflowed); + self + } + + pub fn read_idle(self) -> bool { + self.0.get_bit(2) + } + + pub fn with_read_idle(mut self, is_idle: bool) -> Self { + self.0.set_bit(2, is_idle); + self + } + + pub fn command_idle(self) -> bool { + self.0.get_bit(3) + } + + pub fn with_command_idle(mut self, is_idle: bool) -> Self { + self.0.set_bit(3, is_idle); + self + } + + pub fn breakpoint(self) -> bool { + self.0.get_bit(4) + } + + pub fn with_breakpoint(mut self, breakpoint_hit: bool) -> Self { + self.0.set_bit(4, breakpoint_hit); + self + } + } + + #[repr(transparent)] + #[derive(Copy, Clone, Debug)] + pub struct Control(u16); + + impl Control { + pub const fn new() -> Self { + Self(0) + } + + pub fn read() -> Self { + CONTROL_REGISTER.read() + } + + pub fn write(self) { + CONTROL_REGISTER.write(self); + } + + pub fn read_enable(&self) -> bool { + self.0.get_bit(0) + } + + pub fn with_read_enable(mut self, read_enable: bool) -> Self { + self.0.set_bit(0, read_enable); + self + } + + pub fn breakpoint_enable(&self) -> bool { + self.0.get_bit(1) + } + + pub fn with_breakpoint_enable(mut self, breakpoint_enable: bool) -> Self { + self.0.set_bit(1, breakpoint_enable); + self + } + + pub fn overflow_interrupt_enable(&self) -> bool { + self.0.get_bit(2) + } + + pub fn with_overflow_interrupt_enable(mut self, overflow_interrupt_enable: bool) -> Self { + self.0.set_bit(2, overflow_interrupt_enable); + self + } + + pub fn underflow_interrupt_enable(&self) -> bool { + self.0.get_bit(3) + } + + pub fn with_underflow_interrupt_enable(mut self, underflow_interrupt_enable: bool) -> Self { + self.0.set_bit(3, underflow_interrupt_enable); + self + } + + pub fn link_enable(&self) -> bool { + self.0.get_bit(4) + } + + pub fn with_link_enable(mut self, link_enable: bool) -> Self { + self.0.set_bit(4, link_enable); + self + } + + pub fn breakpoint_interrupt_enable(&self) -> bool { + self.0.get_bit(5) + } + + pub fn with_breakpoint_interrupt_enable( + mut self, + breakpoint_interrupt_enable: bool, + ) -> Self { + self.0.set_bit(5, breakpoint_interrupt_enable); + self + } + } +} From 7af3efa5b05c5887654d8bac595dc4120dec56bd Mon Sep 17 00:00:00 2001 From: ProfElements Date: Tue, 17 Dec 2024 01:03:18 -0600 Subject: [PATCH 3/5] sparkles: feat(mmio): Add Command Processor Clear Register --- src/mmio/command_processor.rs | 51 ++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/mmio/command_processor.rs b/src/mmio/command_processor.rs index bcb56e5..641e589 100644 --- a/src/mmio/command_processor.rs +++ b/src/mmio/command_processor.rs @@ -3,7 +3,7 @@ use voladdress::{Safe, VolAddress}; -pub use types::{Control, Status}; +pub use types::{Clear, Control, Status}; const BASE: usize = 0xCC00_0000; @@ -11,7 +11,7 @@ const STATUS_REGISTER: VolAddress = unsafe { VolAddress::new const CONTROL_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x2) }; -const CLEAR_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x4) }; +const CLEAR_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x4) }; const PERFORMANCE_SELECT: VolAddress = unsafe { VolAddress::new(BASE + 0x6) }; @@ -120,7 +120,7 @@ const CLOCKS_PER_VERTEX_OUT_COUNT: VolAddress = pub(crate) mod types { use bit_field::BitField; - use super::{CONTROL_REGISTER, STATUS_REGISTER}; + use super::{CLEAR_REGISTER, CONTROL_REGISTER, STATUS_REGISTER}; #[repr(transparent)] #[derive(Copy, Clone, Debug)] @@ -259,4 +259,49 @@ pub(crate) mod types { self } } + + #[repr(transparent)] + #[derive(Debug, Copy, Clone)] + pub struct Clear(u16); + + impl Clear { + pub const fn new() -> Self { + Self(0) + } + + pub fn read() -> Self { + CLEAR_REGISTER.read() + } + + pub fn write(self) { + CLEAR_REGISTER.write(self); + } + + pub fn clear_overflow(&self) -> bool { + self.0.get_bit(0) + } + + pub fn with_clear_overflow(mut self, clear_overflow: bool) -> Self { + self.0.set_bit(0, clear_overflow); + self + } + + pub fn clear_underflow(&self) -> bool { + self.0.get_bit(1) + } + + pub fn with_clear_underflow(mut self, clear_underflow: bool) -> Self { + self.0.set_bit(1, clear_underflow); + self + } + + pub fn clear_metrics(&self) -> bool { + self.0.get_bit(2) + } + + pub fn with_clear_metrics(mut self, clear_metrics: bool) -> Self { + self.0.set_bit(2, clear_metrics); + self + } + } } From a36b14c584b1cd343663396578e74f3584684971 Mon Sep 17 00:00:00 2001 From: ProfElements Date: Tue, 21 Jan 2025 09:00:39 -0600 Subject: [PATCH 4/5] blah --- ' | 328 ++ Cargo.lock | 56 +- Cargo.toml | 6 +- examples/colored-tri/Cargo.lock | 52 +- examples/colored-tri/Cargo.toml | 1 + examples/colored-tri/src/main.rs | 259 +- examples/ios/Cargo.lock | 45 +- examples/obj-loading/Cargo.lock | 7 + examples/obj-loading/Cargo.toml | 2 +- examples/obj-loading/src/main.rs | 11 +- examples/texture-tri/Cargo.lock | 37 +- log | 5656 ++++++++++++++++++++++++++++++ ogc-sys/src/ogc.rs | 4 + src/gx/mod.rs | 257 ++ src/lib.rs | 79 +- src/mmio/command_processor.rs | 176 +- src/network.rs | 59 + src/pad.rs | 412 +++ 18 files changed, 7248 insertions(+), 199 deletions(-) create mode 100644 ' create mode 100644 log create mode 100644 src/pad.rs diff --git a/' b/' new file mode 100644 index 0000000..05cf111 --- /dev/null +++ b/' @@ -0,0 +1,328 @@ +#![warn(missing_docs)] +#![warn(clppy::pedantic)] + +use core::{ffi::CStr, fmt::Display}; + +pub mod dolphin; + +#[repr(u32)] +/// Interprocess Control / IOS File Mode +pub enum Mode { + None = 0, + Read = 1, + Write = 2, + ReadWrite = 3, +} + +impl From for u32 { + fn from(value: Mode) -> Self { + match value { + Mode::None => 0, + Mode::Read => 1, + Mode::Write => 2, + Mode::ReadWrite => 3, + } + } +} + +#[repr(i32)] +#[derive(Copy, Clone, Debug)] +/// Interprocess Control / IOS Errors +pub enum Error { + /// A invalid argument was provided. + Invalid = -4, + /// No IPC heap is currently allocated + NoHeap = -5, + /// No file entry was found. + NoEntry = -6, + /// The IPC queue is full. This is non-fatal. + QueueFull = -8, + /// Could not allocate an IPC request. + NoMemory = -22, + /// The provided file path was too long. + FilePathLengthTooLong, + /// An Unknown error code was returned. + UnknownErrorCode(i32), + /// The provided buffer is too long + BufferTooLong(usize), + /// The provided amount of inputs to [`ioctlv`] are too many + TooManyInputs(usize), + /// The provided amount of outputs to [`ioctlv`] are too many + TooManyOutputs(usize), +} + +impl TryFrom for Error { + type Error = (); + fn try_from(value: i32) -> Result { + match value { + -4 => Ok(Self::Invalid), + -5 => Ok(Self::NoHeap), + -6 => Ok(Self::NoEntry), + -8 => Ok(Self::QueueFull), + -22 => Ok(Self::NoMemory), + _ => Err(()), + } + } +} + +impl Display for Error { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::Invalid => write!(f, "An Invalid argument was provided"), + Self::NoHeap => write!(f, "No IPC/IOS heap was available"), + Self::NoEntry => write!(f, "The file asked for did not exist"), + Self::QueueFull => write!(f, "The IPC / IOS queue was full"), + Self::NoMemory => write!(f, "There was no memory left to allocate the IPC/IOS queue"), + Self::FilePathLengthTooLong => write!(f, "The file path provided was too long"), + Self::UnknownErrorCode(val) => { + write!(f, "The error code encountered was unknown {val}") + } + Self::BufferTooLong(val) => { + write!(f, "The buffer provided was too long. length: {val}") + } + Self::TooManyInputs(val) => write!( + f, + "The provided amount of inputs was too many for `ioctlv`. input count: {val}" + ), + Self::TooManyOutputs(val) => write!( + f, + "The provided amount of outputs was too many for `ioctlv`. output count: {val}" + ), + } + } +} + +/// Interprocess Control / IOS File Descriptor +/// +/// Represents either a device in the case of something under the `/dev/` file path or an actual +/// file handle. +/// +#[derive(Copy, Clone, Debug)] +pub struct FileDescriptor(i32); + +/// Attempt to open a file from IOS +/// +/// # Errors +/// See [`Error`] +/// +pub fn open(file_path: &CStr, file_mode: Mode) -> Result { + if file_path.count_bytes() + 1 > 64 { + return Err(Error::FilePathLengthTooLong); + } + + match unsafe { ogc_sys::IOS_Open(file_path.as_ptr().cast(), file_mode.into()) } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(FileDescriptor(val)), + val => Err(Error::UnknownErrorCode(val)), + } +} +/// Attempts to close an open file descriptor +/// +/// # Errors +/// See [`Error`] +/// +pub fn close(fd: FileDescriptor) -> Result<(), Error> { + match unsafe { ogc_sys::IOS_Close(fd.0) } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(()), + val => Err(Error::UnknownErrorCode(val)), + } +} + +/// Attempts to read bytes from a file descriptor into a buffer. +/// +/// Attempts to read up to `buf.len()` bytes into `buf` from `fd`. Returns the amount of bytes read. +/// +/// # Errors +/// See [`Error`] +/// +pub fn read(fd: FileDescriptor, buf: &mut [u8]) -> Result { + let (ptr, len) = (buf.as_mut_ptr(), buf.len()); + match unsafe { + ogc_sys::IOS_Read( + fd.0, + ptr.cast(), + len.try_into().map_err(|_| Error::BufferTooLong(len))?, + ) + } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(val), + val => Err(Error::UnknownErrorCode(val)), + } +} + +/// Attempts to writes bytes into a file descriptor from a buffer. +/// +/// Attempts to write up to `buf.len()` bytes into `fd` Returns the amount of bytes written. +/// +/// # Errors +/// See [`Error`] +/// +pub fn write(fd: FileDescriptor, buf: &[u8]) -> Result { + let (ptr, len) = (buf.as_ptr(), buf.len()); + match unsafe { + ogc_sys::IOS_Write( + fd.0, + ptr.cast(), + len.try_into().map_err(|_| Error::BufferTooLong(len))?, + ) + } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(val), + val => Err(Error::UnknownErrorCode(val)), + } +} + +/// Interprocess Control / IOS Seek Mode +#[repr(i32)] +pub enum SeekMode { + /// Seek from the start + Start = 0, + /// Seek from current position + Current = 1, + /// Seek from the end + End = 2, +} + +impl From for i32 { + fn from(val: SeekMode) -> i32 { + match val { + SeekMode::Start => 0, + SeekMode::Current => 1, + SeekMode::End => 2, + } + } +} +/// Attempts to seek to a certain position within a file descriptor +/// +/// Attempts to seek to `offset` from `mode` in `fd` +/// +/// # Errors +/// See [`Error`] +/// +pub fn seek(fd: FileDescriptor, offset: i32, mode: SeekMode) -> Result<(), Error> { + match unsafe { ogc_sys::IOS_Seek(fd.0, offset, mode.into()) } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(()), + val => Err(Error::UnknownErrorCode(val)), + } +} + +/// Attempts to call an ioctl using a file descriptor with an in buffer and out buffer +/// +/// Attempts to call `ioctl` with `fd` using `buf_in` and `buf_out` +/// +/// # Errors +/// See [`Error`] +/// +pub fn ioctl>( + fd: FileDescriptor, + ioctl: IOCTL, + buf_in: &[u8], + buf_out: &mut [u8], +) -> Result<(), Error> { + let io_s32 = ioctl.into(); + let (in_ptr, in_len) = (buf_in.as_ptr(), buf_in.len()); + let (out_ptr, out_len) = (buf_out.as_mut_ptr(), buf_out.len()); + // SAFETY: I promise in_buf does not get modified + match unsafe { + ogc_sys::IOS_Ioctl( + fd.0, + io_s32, + in_ptr.cast_mut().cast(), + in_len + .try_into() + .map_err(|_| Error::BufferTooLong(in_len))?, + out_ptr.cast(), + out_len + .try_into() + .map_err(|_| Error::BufferTooLong(out_len))?, + ) + } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(()), + val => Err(Error::UnknownErrorCode(val)), + } +} + +/// Attempts to call ioctl using a file descriptor with multiple input and output buffers +/// +/// Attempts to call `ioctl` using `fd` with `bufs_in` and `bufs_out` +/// +/// # Errors +/// See [`Error`] +/// +pub fn ioctlv< + const COUNT_IN: usize, + const COUNT_OUT: usize, + //Invariant: This must be COUNT_IN + COUNT_OUT (waiting for `generic_const_exprs` to be + //stabilizied) + const COUNT_IN_OUT: usize, +>( + fd: FileDescriptor, + ioctl: impl Into, + buf_ins: &[&[u8]], + buf_outs: &mut [&mut [u8]], +) -> Result<(), Error> { + type Ioctlv = ogc_sys::_ioctlv; + debug_assert!(buf_ins.len() == COUNT_IN); + debug_assert!(buf_outs.len() == COUNT_OUT); + debug_assert!(COUNT_IN + COUNT_OUT == COUNT_IN_OUT); + + let mut ioctls = [Ioctlv { + data: core::ptr::null_mut(), + len: 0, + }; COUNT_IN_OUT]; + //SAFETY: I promise that i don't modify the contents of in buffers up to COUNT_IN + for (i, buf_in) in buf_ins.iter().enumerate() { + ioctls[i] = Ioctlv { + data: buf_in.as_ptr().cast_mut().cast(), + len: buf_in + .len() + .try_into() + .map_err(|_| Error::BufferTooLong(buf_in.len()))?, + } + } + + for (i, buf_out) in buf_outs.iter_mut().enumerate() { + ioctls[COUNT_IN + i] = Ioctlv { + data: buf_out.as_mut_ptr().cast(), + len: buf_out + .len() + .try_into() + .map_err(|_| Error::BufferTooLong(buf_out.len()))?, + } + } + + match unsafe { + ogc_sys::IOS_Ioctlv( + fd.0, + ioctl.into(), + COUNT_IN + .try_into() + .map_err(|_| Error::TooManyInputs(COUNT_IN))?, + COUNT_OUT + .try_into() + .map_err(|_| Error::TooManyOutputs(COUNT_OUT))?, + ioctls.as_ptr().cast_mut(), + ) + } { + val if { val == -4 || val == -5 || val == -6 || val == -8 || val == -22 } => { + Err(Error::try_from(val).map_err(|_| Error::UnknownErrorCode(val))?) + } + val if { val >= 0 } => Ok(()), + val => Err(Error::UnknownErrorCode(val)), + } +} diff --git a/Cargo.lock b/Cargo.lock index e5869c9..d60bd9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + [[package]] name = "autocfg" version = "1.4.0" @@ -36,7 +42,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.89", "which", ] @@ -84,6 +90,12 @@ dependencies = [ "libloading", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "doxygen-rs" version = "0.4.2" @@ -156,9 +168,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "libloading" @@ -172,9 +184,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" @@ -244,9 +256,11 @@ dependencies = [ name = "ogc-rs" version = "0.1.1" dependencies = [ + "aliasable", "bit_field", "bitflags 1.3.2", "cfg-if", + "critical-section", "glam", "libc", "num-traits", @@ -301,7 +315,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.89", ] [[package]] @@ -315,19 +329,19 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.89", ] [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -358,9 +372,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -370,9 +384,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -393,9 +407,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -429,9 +443,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -440,9 +454,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "voladdress" diff --git a/Cargo.toml b/Cargo.toml index 407bdb8..daebec1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,12 +16,14 @@ crate-type = ["rlib"] [features] -default = ["default_alloc_handler", "default_panic_handler"] +default = ["critical-section-wii", "default_alloc_handler", "default_panic_handler"] ffi = [] mmio = [] glam_compat = ["glam"] default_alloc_handler = [] default_panic_handler = [] +critical-section-wii = ["critical-section/restore-state-u32"] + [dependencies] bitflags = "1.3" @@ -33,3 +35,5 @@ glam = { version = "0.19.0", default-features = false, features = ["libm"], opti voladdress = "1.4" bit_field = "0.10.1" num-traits = { version = "0.2.19", default-features = false, features = ["libm"] } +critical-section = { version = "1.2.0", default-features = false } +aliasable = { version = "0.1.3", default-features = false, features = ["alloc"] } diff --git a/examples/colored-tri/Cargo.lock b/examples/colored-tri/Cargo.lock index 2758818..afa71ec 100644 --- a/examples/colored-tri/Cargo.lock +++ b/examples/colored-tri/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -11,6 +11,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + [[package]] name = "bindgen" version = "0.69.4" @@ -52,6 +64,12 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +[[package]] +name = "bitfrob" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de3bf9292416bc27b97603d1af580e4253138851ce3898f878807b898e90d2d" + [[package]] name = "cexpr" version = "0.6.0" @@ -79,20 +97,10 @@ dependencies = [ ] [[package]] -name = "cstr_core" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" -dependencies = [ - "cty", - "memchr", -] - -[[package]] -name = "cty" -version = "0.2.2" +name = "critical-section" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "doxygen-rs" @@ -211,6 +219,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + [[package]] name = "num_enum" version = "0.5.11" @@ -235,12 +253,13 @@ dependencies = [ name = "ogc-rs" version = "0.1.1" dependencies = [ + "aliasable", "bit_field", "bitflags 1.3.2", "cfg-if", - "cstr_core", + "critical-section", "libc", - "libm", + "num-traits", "num_enum", "ogc-sys", "voladdress", @@ -433,6 +452,7 @@ dependencies = [ name = "template" version = "0.1.0" dependencies = [ + "bitfrob", "ogc-rs", ] diff --git a/examples/colored-tri/Cargo.toml b/examples/colored-tri/Cargo.toml index 3f4913d..7501951 100644 --- a/examples/colored-tri/Cargo.toml +++ b/examples/colored-tri/Cargo.toml @@ -9,4 +9,5 @@ dev = { panic = "abort" } release = { panic = "abort", lto = true, codegen-units = 1, strip = "symbols", opt-level = "s" } [dependencies] +bitfrob = "1.3.2" ogc-rs = { path = "../../", features = ["ffi"] } diff --git a/examples/colored-tri/src/main.rs b/examples/colored-tri/src/main.rs index 8afa45a..0c5ebc1 100644 --- a/examples/colored-tri/src/main.rs +++ b/examples/colored-tri/src/main.rs @@ -6,10 +6,14 @@ use core::mem::ManuallyDrop; use ogc_rs::{ ffi::{ GX_CLR_RGBA, GX_COLOR0A0, GX_PASSCLR, GX_POS_XYZ, GX_RGBA8, GX_S16, GX_TEXCOORDNULL, - GX_TEXMAP_NULL, GX_VA_CLR0, GX_VA_POS, + GX_TEXMAP_NULL, GX_VA_CLR0, GX_VA_POS, TB_BUS_CLOCK, }, gu::{Gu, RotationAxis}, - gx::{types::VtxDest, CmpFn, Color, CullMode, Gx, Primitive, ProjectionType, VtxAttr}, + gx::{ + experimental::{enable_write_pipe, move_to_write_pipe_address, Fifo}, + types::VtxDest, + CmpFn, Color, CullMode, Gx, Primitive, ProjectionType, VtxAttr, + }, video::Video, }; @@ -25,10 +29,81 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize { Video::set_black(false); Video::flush(); - let fifo = ManuallyDrop::new(Gx::init(256 * 1024)); - // Set values to use when video is flipped / cleared - Gx::set_copy_clear(Color::new(0x00, 0x00, 0x00), 0x00_FF_FF_FF); + // let fifo = ManuallyDrop::new(Gx::init(256 * 1024)); + let mut fifo = ManuallyDrop::new(Fifo::<262144>::new().unwrap()); + fifo.set_as_cpu_fifo().unwrap(); + fifo.set_as_gpu_fifo().unwrap(); + fifo.link_cpu_gpu_fifo().unwrap(); + + unsafe { + move_to_write_pipe_address(0x0C00_8000); + enable_write_pipe(); + //Mask out all Indirect Tev Stages + fifo.load_bp_reg(0x0f, &[0, 0, 0, 0xFF]); + + let value: u32 = TB_BUS_CLOCK / 500; + let mut reg = bitfrob::u32_with_bit(10, 0u32, true); + reg = bitfrob::u32_with_value(11, 24, reg, value); + + fifo.load_bp_reg(0x69, ®.to_be_bytes()); + + let mut other_reg = value / 4224; + other_reg = bitfrob::u32_with_bit(9, other_reg, true); + fifo.load_bp_reg(0x46, &other_reg.to_be_bytes()); + + // Set VCacheEnhance on VAT + let mut value = 0; + value = bitfrob::u32_with_bit(31, value, true); + for idx in 0x80..=0x87 { + fifo.load_cp_reg(idx, &value.to_be_bytes()); + } + + fifo.load_cp_reg(0x20, &0u32.to_be_bytes()); + fifo.load_xf_reg(0x1006, &0u32.to_be_bytes()); + + fifo.load_bp_reg(0x23, &0u32.to_be_bytes()); + fifo.load_bp_reg(0x24, &0u32.to_be_bytes()); + fifo.load_bp_reg(0x67, &0u32.to_be_bytes()); + + // Clear Tex Indirect Mask at end + fifo.load_bp_reg(0x0f, &[0, 0, 0, 0x0]); + + //Default texture setup + let mut default_tex_reg = 0u32; + const IMAGE_TYPE_CACHED: u32 = 0; + const CACHE_SIZE_32KB: u32 = 3; + const TEXTURE_MEM_OFFSET: u32 = 0; + default_tex_reg = bitfrob::u32_with_bit(21, default_tex_reg, IMAGE_TYPE_CACHED != 0); + default_tex_reg = bitfrob::u32_with_value(18, 20, default_tex_reg, CACHE_SIZE_32KB); + default_tex_reg = bitfrob::u32_with_value(15, 17, default_tex_reg, CACHE_SIZE_32KB); + default_tex_reg = bitfrob::u32_with_value(0, 14, default_tex_reg, TEXTURE_MEM_OFFSET); + + for index in 0x8c..=0x8f { + fifo.load_bp_reg(index, &default_tex_reg.to_be_bytes()); + } + + for index in 0x90..=0x93 { + fifo.load_bp_reg(index, &default_tex_reg.to_be_bytes()); + } + + default_tex_reg = bitfrob::u32_with_value(0, 14, default_tex_reg, 0x00010000); + + for index in 0xac..=0xaf { + fifo.load_bp_reg(index, &default_tex_reg.to_be_bytes()); + } + for index in 0xb0..=0xb3 { + fifo.load_bp_reg(index, &default_tex_reg.to_be_bytes()); + } + + fifo.set_copy_clear(&[0, 0, 0, 0xff], 0xFF_FF_FF); + + fifo.write_bytes(&[0x48]); + } + + // // Set values to use when video is flipped / cleared + // Gx::set_copy_clear(Color::new(0x00, 0x00, 0x00), 0x00_FF_FF_FF); + // Gx::set_viewport( 0.0, 0.0, @@ -69,90 +144,92 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize { Gx::set_field_mode(config.field_rendering != 0, val); Gx::set_cull_mode(CullMode::None); unsafe { Gx::copy_disp(vi.framebuffer, true) }; - - let mut mat = [[0.; 4]; 4]; - Gu::perspective(&mut mat, 60., 4. / 3., 10., 300.); - Gx::load_projection_mtx(&mat, ProjectionType::Perspective); - Gx::clear_vtx_desc(); - Gx::set_vtx_desc(VtxAttr::Pos, VtxDest::INDEX8); - Gx::set_vtx_desc(VtxAttr::Color0, VtxDest::INDEX8); - Gx::set_vtx_attr_fmt(0, VtxAttr::Pos, GX_POS_XYZ, GX_S16, 0); - Gx::set_vtx_attr_fmt(0, VtxAttr::Color0, GX_CLR_RGBA, GX_RGBA8, 0); - - let positions: [[i16; 3]; 3] = [[0, 15, 0], [-15, -15, 0], [15, -15, 0]]; - let colors: [[u8; 4]; 3] = [[255, 0, 0, 255], [0, 255, 0, 255], [0, 0, 255, 255]]; - - Gx::set_array( - GX_VA_POS, - &positions, - core::mem::size_of::<[i16; 3]>().try_into().unwrap(), - ); - - Gx::set_array( - GX_VA_CLR0, - &colors, - core::mem::size_of::<[u8; 4]>().try_into().unwrap(), - ); - - Gx::set_num_chans(1); - Gx::set_num_tex_gens(0); - - Gx::set_tev_order( - 0, - GX_TEXCOORDNULL.try_into().unwrap(), - GX_TEXMAP_NULL, - GX_COLOR0A0.try_into().unwrap(), - ); - Gx::set_tev_op(0, GX_PASSCLR.try_into().unwrap()); - - let mut i: u16 = 0; - loop { - let mut mtx = [[0.; 4]; 3]; - let mut rot_mtx = [[0.; 4]; 3]; - let mut mdl_mtx = [[0.; 4]; 3]; - let mut mdl2_mtx = [[0.; 4]; 3]; - - Gu::mtx_identity(&mut mtx); - Gu::mtx_identity(&mut rot_mtx); - Gu::mtx_identity(&mut mdl_mtx); - - Gu::mtx_rotation_radians( - &mut rot_mtx, - RotationAxis::Y, - f32::from(i) * (3.14159 / 180.), - ); - // Rotation + Identity = Rotation; - Gu::mtx_concat(&mut rot_mtx, &mut mdl_mtx, &mut mdl2_mtx); - // Rotation + Translation = Model; - Gu::mtx_translation_apply(&mut mdl2_mtx, &mut mdl_mtx, (0., 0., -50.)); - // Load Model - Gx::load_pos_mtx_imm(&mut mdl_mtx, 0); - - Gx::begin(Primitive::Triangles, 0, 3); - Gx::position1x8(0); - Gx::color1x8(0); - Gx::position1x8(1); - Gx::color1x8(1); - Gx::position1x8(2); - Gx::color1x8(2); - - /* - Gx::position_3i16(0, 15, 0); - Gx::color_4u8(255, 0, 0, 255); - Gx::position_3i16(-15, -15, 0); - Gx::color_4u8(0, 255, 0, 255); - Gx::position_3i16(15, -15, 0); - Gx::color_4u8(0, 0, 255, 255); - */ - Gx::end(); - - Gx::draw_done(); - Gx::set_z_mode(true, CmpFn::LessEq, true); - Gx::set_color_update(true); - unsafe { Gx::copy_disp(vi.framebuffer, true) }; - Gx::flush(); - - Video::wait_vsync(); - i += 1; - } + // Gx::flush(); + // // let mut mat = [[0.; 4]; 4]; + // Gu::perspective(&mut mat, 60., 4. / 3., 10., 300.); + // Gx::load_projection_mtx(&mat, ProjectionType::Perspective); + // Gx::clear_vtx_desc(); + // Gx::set_vtx_desc(VtxAttr::Pos, VtxDest::INDEX8); + // Gx::set_vtx_desc(VtxAttr::Color0, VtxDest::INDEX8); + // Gx::set_vtx_attr_fmt(0, VtxAttr::Pos, GX_POS_XYZ, GX_S16, 0); + // Gx::set_vtx_attr_fmt(0, VtxAttr::Color0, GX_CLR_RGBA, GX_RGBA8, 0); + // + // let positions: [[i16; 3]; 3] = [[0, 15, 0], [-15, -15, 0], [15, -15, 0]]; + // let colors: [[u8; 4]; 3] = [[255, 0, 0, 255], [0, 255, 0, 255], [0, 0, 255, 255]]; + // + // Gx::set_array( + // GX_VA_POS, + // &positions, + // core::mem::size_of::<[i16; 3]>().try_into().unwrap(), + // ); + // + // Gx::set_array( + // GX_VA_CLR0, + // &colors, + // core::mem::size_of::<[u8; 4]>().try_into().unwrap(), + // ); + // + // Gx::set_num_chans(1); + // Gx::set_num_tex_gens(0); + // + // Gx::set_tev_order( + // 0, + // GX_TEXCOORDNULL.try_into().unwrap(), + // GX_TEXMAP_NULL, + // GX_COLOR0A0.try_into().unwrap(), + // ); + // Gx::set_tev_op(0, GX_PASSCLR.try_into().unwrap()); + // + // let mut i: u16 = 0; + // loop { + // let mut mtx = [[0.; 4]; 3]; + // let mut rot_mtx = [[0.; 4]; 3]; + // let mut mdl_mtx = [[0.; 4]; 3]; + // let mut mdl2_mtx = [[0.; 4]; 3]; + // + // Gu::mtx_identity(&mut mtx); + // Gu::mtx_identity(&mut rot_mtx); + // Gu::mtx_identity(&mut mdl_mtx); + // + // Gu::mtx_rotation_radians( + // &mut rot_mtx, + // RotationAxis::Y, + // f32::from(i) * (3.14159 / 180.), + // ); + // // Rotation + Identity = Rotation; + // Gu::mtx_concat(&mut rot_mtx, &mut mdl_mtx, &mut mdl2_mtx); + // // Rotation + Translation = Model; + // Gu::mtx_translation_apply(&mut mdl2_mtx, &mut mdl_mtx, (0., 0., -50.)); + // // Load Model + // Gx::load_pos_mtx_imm(&mut mdl_mtx, 0); + // + // Gx::begin(Primitive::Triangles, 0, 3); + // Gx::position1x8(0); + // Gx::color1x8(0); + // Gx::position1x8(1); + // Gx::color1x8(1); + // Gx::position1x8(2); + // Gx::color1x8(2); + // + // /* + // Gx::position_3i16(0, 15, 0); + // Gx::color_4u8(255, 0, 0, 255); + // Gx::position_3i16(-15, -15, 0); + // Gx::color_4u8(0, 255, 0, 255); + // Gx::position_3i16(15, -15, 0); + // Gx::color_4u8(0, 0, 255, 255); + // */ + // Gx::end(); + // + // Gx::draw_done(); + // Gx::set_z_mode(true, CmpFn::LessEq, true); + // Gx::set_color_update(true); + // unsafe { Gx::copy_disp(vi.framebuffer, true) }; + // Gx::flush(); + // + // Video::wait_vsync(); + // i += 1; + // } + // + loop {} } diff --git a/examples/ios/Cargo.lock b/examples/ios/Cargo.lock index 2758818..205732c 100644 --- a/examples/ios/Cargo.lock +++ b/examples/ios/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -11,6 +11,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + [[package]] name = "bindgen" version = "0.69.4" @@ -79,20 +91,10 @@ dependencies = [ ] [[package]] -name = "cstr_core" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" -dependencies = [ - "cty", - "memchr", -] - -[[package]] -name = "cty" -version = "0.2.2" +name = "critical-section" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "doxygen-rs" @@ -211,6 +213,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + [[package]] name = "num_enum" version = "0.5.11" @@ -235,12 +247,13 @@ dependencies = [ name = "ogc-rs" version = "0.1.1" dependencies = [ + "aliasable", "bit_field", "bitflags 1.3.2", "cfg-if", - "cstr_core", + "critical-section", "libc", - "libm", + "num-traits", "num_enum", "ogc-sys", "voladdress", diff --git a/examples/obj-loading/Cargo.lock b/examples/obj-loading/Cargo.lock index 372f481..b338200 100644 --- a/examples/obj-loading/Cargo.lock +++ b/examples/obj-loading/Cargo.lock @@ -90,6 +90,12 @@ dependencies = [ "libloading", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "doxygen-rs" version = "0.4.2" @@ -276,6 +282,7 @@ dependencies = [ "bit_field", "bitflags 1.3.2", "cfg-if", + "critical-section", "libc", "num-traits", "num_enum", diff --git a/examples/obj-loading/Cargo.toml b/examples/obj-loading/Cargo.toml index 4bdc5cc..98df8ec 100644 --- a/examples/obj-loading/Cargo.toml +++ b/examples/obj-loading/Cargo.toml @@ -11,4 +11,4 @@ release = { panic = "abort", lto = true, codegen-units = 1, strip = "symbols", o [dependencies] gctex = {path = "./vendor/gctex", default-features = false } minipng = { version = "0.1.1", default-features = false } -ogc-rs = { path = "../../", features = ["ffi", "default_panic_handler"] } +ogc-rs = { path = "../../", features = ["mmio", "ffi", "default_panic_handler"] } diff --git a/examples/obj-loading/src/main.rs b/examples/obj-loading/src/main.rs index 570f4df..26c1488 100644 --- a/examples/obj-loading/src/main.rs +++ b/examples/obj-loading/src/main.rs @@ -6,7 +6,7 @@ use core::f32::consts::PI; use core::mem::ManuallyDrop; use ogc_rs::ffi::{GX_F32, GX_NRM_XYZ, GX_TEX_ST, GX_VA_NRM, GX_VA_TEX0}; use ogc_rs::gu::RotationAxis; -use ogc_rs::input::{Button, ControllerPort, ControllerType, Input}; +use ogc_rs::pad::{Channel, Controller}; use ogc_rs::{alloc_aligned_buffer, print}; use ogc_rs::{ @@ -170,16 +170,11 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize { Gx::flush(); let mut i: u16 = 0; - Input::init(ControllerType::Gamecube); - let input = Input::new(ControllerType::Gamecube, ControllerPort::One); - + let controller = Controller::new().unwrap(); loop { - Input::update(ControllerType::Gamecube); - - if input.is_button_down(Button::Start) { + if controller.state().start { break 0; } - Gx::inv_vtx_cache(); Gx::invalidate_tex_all(); diff --git a/examples/texture-tri/Cargo.lock b/examples/texture-tri/Cargo.lock index 8fb9602..372f481 100644 --- a/examples/texture-tri/Cargo.lock +++ b/examples/texture-tri/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -11,6 +11,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + [[package]] name = "bindgen" version = "0.69.4" @@ -84,22 +90,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "cstr_core" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" -dependencies = [ - "cty", - "memchr", -] - -[[package]] -name = "cty" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" - [[package]] name = "doxygen-rs" version = "0.4.2" @@ -249,6 +239,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + [[package]] name = "num_enum" version = "0.5.11" @@ -276,9 +276,8 @@ dependencies = [ "bit_field", "bitflags 1.3.2", "cfg-if", - "cstr_core", "libc", - "libm", + "num-traits", "num_enum", "ogc-sys", "voladdress", diff --git a/log b/log new file mode 100644 index 0000000..f5af5f6 --- /dev/null +++ b/log @@ -0,0 +1,5656 @@ + Checking ogc-rs v0.1.1 (/home/profelements/git/ogc-rs) +warning: unused import: `mem::to_physical` + --> src/gx/mod.rs:2376:17 + | +2376 | use crate::{mem::to_physical, print, println}; + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/cp.rs:45:30 + | +45 | unsafe { VolAddress::new(0xCC00_002a) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + = note: `#[warn(clippy::mixed_case_hex_literals)]` on by default + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/cp.rs:48:30 + | +48 | unsafe { VolAddress::new(0xCC00_002c) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/cp.rs:50:30 + | +50 | unsafe { VolAddress::new(0xCC00_002e) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/cp.rs:61:84 + | +61 | pub const FIFO_READ_PTR_HI: VolAddress = unsafe { VolAddress::new(0xCC00_003a) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/cp.rs:64:30 + | +64 | unsafe { VolAddress::new(0xCC00_003c) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/cp.rs:66:30 + | +66 | unsafe { VolAddress::new(0xCC00_003e) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/dsp.rs:18:30 + | +18 | unsafe { VolAddress::new(0xCC00_500a) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: inconsistent casing in hexadecimal literal + --> src/mmio/vi.rs:86:30 + | +86 | unsafe { VolAddress::new(0xCC00_204a) }; + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals + +warning: accessing first element with `chunk.get(0)` + --> src/pad.rs:54:18 + | +54 | *chunk.get(0).unwrap_or(&0), + | ^^^^^^^^^^^^ help: try: `chunk.first()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first + = note: `#[warn(clippy::get_first)]` on by default + +warning: the following explicit lifetimes could be elided: 'a + --> src/gx/mod.rs:1086:6 + | +1086 | impl<'a> From for Texture<'a> { + | ^^ ^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes + = note: `#[warn(clippy::needless_lifetimes)]` on by default +help: elide the lifetimes + | +1086 - impl<'a> From for Texture<'a> { +1086 + impl From for Texture<'_> { + | + +warning: empty line after doc comment + --> src/mmio/cp.rs:3:1 + | +3 | / /// TODO: ACTUALLY CHECK WHATS SAFE AND WHATS UNSAFE INSTEAD OF ASSUMING SAFE LOL +4 | | + | |_ +5 | #[repr(transparent)] +6 | pub struct StatusRegisterControl(u16); + | -------------------------------- the comment documents this struct + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments + = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default + = help: if the empty line is unintentional remove it + +warning: missing documentation for a module + --> src/lib.rs:29:1 + | +29 | pub mod pad; + | ^^^^^^^^^^^ + | + = note: requested on the command line with `-W missing-docs` + +warning: missing documentation for a module + --> src/lib.rs:48:1 + | +48 | pub mod mp3player; + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/lib.rs:79:1 + | +79 | pub mod aesnd; + | ^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/lib.rs:82:1 + | +82 | pub mod input; + | ^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/lib.rs:88:1 + | +88 | pub mod mutex; + | ^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/lib.rs:91:1 + | +91 | pub mod cache; + | ^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/lib.rs:96:1 + | +96 | pub mod time; + | ^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/lib.rs:113:9 + | +113 | pub mod mmio; + | ^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/pad.rs:11:1 + | +11 | pub enum Channel { + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:12:5 + | +12 | Zero, + | ^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:13:5 + | +13 | One, + | ^^^ + +warning: missing documentation for a variant + --> src/pad.rs:14:5 + | +14 | Two, + | ^^^ + +warning: missing documentation for a variant + --> src/pad.rs:15:5 + | +15 | Three, + | ^^^^^ + +warning: missing documentation for an enum + --> src/pad.rs:30:1 + | +30 | pub enum Error { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:31:5 + | +31 | NoResponse, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:32:5 + | +32 | Collision, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:33:5 + | +33 | BufferUnderrun, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:34:5 + | +34 | BufferOverrun, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/pad.rs:35:5 + | +35 | Unknown, + | ^^^^^^^ + +warning: missing documentation for a function + --> src/pad.rs:38:1 + | +38 | pub fn transfer(channel: Channel, input_buf: &[u8], output_buf: &mut [u8]) -> Result<(), Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/pad.rs:155:1 + | +155 | pub fn get_type(channel: Channel) -> Result<[u8; 3], Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/pad.rs:167:1 + | +167 | pub fn get_origin(channel: Channel) -> Result<[u8; 10], Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/pad.rs:174:1 + | +174 | pub fn recalibrate(channel: Channel) -> Result<[u8; 10], Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/pad.rs:181:1 + | +181 | pub fn set_analog_mode(channel: Channel, mode: u8) -> Result<(), Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/pad.rs:200:1 + | +200 | pub struct Controller { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/pad.rs:205:1 + | +205 | pub struct State { + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:206:5 + | +206 | pub a: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:207:5 + | +207 | pub b: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:208:5 + | +208 | pub x: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:209:5 + | +209 | pub y: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:210:5 + | +210 | pub start: bool, + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:211:5 + | +211 | pub dpad_left: bool, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:212:5 + | +212 | pub dpad_right: bool, + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:213:5 + | +213 | pub dpad_down: bool, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:214:5 + | +214 | pub dpad_up: bool, + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:215:5 + | +215 | pub z: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:216:5 + | +216 | pub r: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:217:5 + | +217 | pub l: bool, + | ^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:218:5 + | +218 | pub stick_x: i8, + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:219:5 + | +219 | pub stick_y: i8, + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:220:5 + | +220 | pub sub_stick_x: i8, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:221:5 + | +221 | pub sub_stick_y: i8, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:222:5 + | +222 | pub analog_l: u8, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/pad.rs:223:5 + | +223 | pub analog_r: u8, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/pad.rs:227:5 + | +227 | pub fn new(channel: Channel) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/pad.rs:260:5 + | +260 | pub fn raw(&self) -> [u8; 8] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/pad.rs:292:5 + | +292 | pub fn state(&self) -> State { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/pad.rs:324:5 + | +324 | pub fn read(&self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/pad.rs:363:5 + | +363 | pub fn copy_on_vblank(&mut self) -> &mut Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/ios.rs:3:1 + | +3 | pub mod dolphin; + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios.rs:8:5 + | +8 | None = 0, + | ^^^^ + +warning: missing documentation for a variant + --> src/ios.rs:9:5 + | +9 | Read = 1, + | ^^^^ + +warning: missing documentation for a variant + --> src/ios.rs:10:5 + | +10 | Write = 2, + | ^^^^^ + +warning: missing documentation for a variant + --> src/ios.rs:11:5 + | +11 | ReadWrite = 3, + | ^^^^^^^^^ + +warning: missing documentation for an enum + --> src/ios/dolphin.rs:7:1 + | +7 | pub enum Ioctl { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:8:5 + | +8 | GetElapsedTime, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:9:5 + | +9 | GetVersion, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:10:5 + | +10 | GetSpeedLimit, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:11:5 + | +11 | SetSpeedLimit, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:12:5 + | +12 | GetCpuSpeed, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:13:5 + | +13 | GetRealProductCode, + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:14:5 + | +14 | DiscordSetClient, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:15:5 + | +15 | DiscordSetPresence, + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:16:5 + | +16 | DiscordReset, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/ios/dolphin.rs:17:5 + | +17 | GetSystemTime, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:38:1 + | +38 | pub fn get_elapsed_time() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:49:1 + | +49 | pub fn get_version() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:59:1 + | +59 | pub fn get_speed_limit() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:69:1 + | +69 | pub fn set_speed_limit(speed_limit: u32) -> Result<(), ios::Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:86:1 + | +86 | pub fn get_cpu_speed() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:96:1 + | +96 | pub fn get_product_code() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:106:1 + | +106 | pub fn set_discord_client(client_id: &CStr) -> Result<(), ios::Error> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/ios/dolphin.rs:120:1 + | +120 | pub struct ImageDetails<'a> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/ios/dolphin.rs:126:5 + | +126 | pub fn new(key: &'a CStr, text: &'a CStr) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/ios/dolphin.rs:134:1 + | +134 | pub struct Timestamps { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/ios/dolphin.rs:140:5 + | +140 | pub fn new(start: u64, end: u64) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:145:1 + | +145 | / pub fn set_discord_presence( +146 | | details: &CStr, +147 | | state: &CStr, +148 | | large_image_details: ImageDetails, +... | +152 | | max_party_size: u32, +153 | | ) -> Result<(), ios::Error> { + | |___________________________^ + +warning: missing documentation for a function + --> src/ios/dolphin.rs:179:1 + | +179 | pub fn get_system_time() -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/error.rs:11:5 + | +11 | Network(String), + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/error.rs:12:5 + | +12 | Audio(String), + | ^^^^^ + +warning: missing documentation for a variant + --> src/error.rs:13:5 + | +13 | Console(String), + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/error.rs:14:5 + | +14 | System(String), + | ^^^^^^ + +warning: missing documentation for an associated constant + --> src/network.rs:22:1 + | +22 | / bitflags! { +23 | | /// Optional flags for sockets. +24 | | pub struct SocketFlags: i32 { +25 | | const SO_DEBUG = 0x0001; +... | +36 | | } +37 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/network.rs:39:1 + | +39 | / bitflags! { +40 | | /// Additional socket options. +41 | | pub struct SocketOptions: u32 { +42 | | const SO_SNDBUF = 0x1001; +... | +50 | | } +51 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/network.rs:53:1 + | +53 | / bitflags! { +54 | | /// Incoming Address Routing +55 | | pub struct AddressRouting: u32 { +56 | | const INADDR_ANY = 0; +57 | | const INADDR_BROADCAST = 0xffffffff; +58 | | } +59 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/network.rs:61:1 + | +61 | / bitflags! { +62 | | /// Definitions for IP precedence +63 | | pub struct IPPrecedence: u32 { +64 | | const IPTOS_PREC_MASK = 0xe0; +... | +73 | | } +74 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/network.rs:76:1 + | +76 | / bitflags! { +77 | | /// IPV4 ToS Bits +78 | | pub struct TOSBits: u32 { +79 | | const IPTOS_TOS_MASK = 0x1E; +... | +85 | | } +86 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/network.rs:88:1 + | +88 | / bitflags! { +89 | | /// Ioctl Commands +90 | | pub struct IoctlCommands: u32 { +91 | | const IOCPARM_MASK = 0x7f; +... | +96 | | } +97 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/network.rs:99:1 + | +99 | / bitflags! { +100 | | /// Bits that may be set/returned in events and revents from net_poll +101 | | pub struct PollBits: u32 { +102 | | const POLLIN = 0x0001; +... | +108 | | } +109 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for a variant + --> src/network.rs:115:5 + | +115 | AfUnspec = 0, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/network.rs:116:5 + | +116 | AfInet = 2, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/network.rs:123:5 + | +123 | SockStream = 1, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/network.rs:124:5 + | +124 | SockDgram = 2, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/network.rs:125:5 + | +125 | SockRaw = 3, + | ^^^^^^^ + +warning: missing documentation for a constant + --> src/network.rs:136:1 + | +136 | pub const TCP_KEEPALIVE: u32 = 0x02; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/network.rs:140:1 + | +140 | pub const SOCKET_ERROR: i32 = -1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/network.rs:147:1 + | +147 | pub const IPPROTO_TCP: u32 = 6; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/network.rs:148:1 + | +148 | pub const IPPROTO_UDP: u32 = 17; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/network.rs:152:1 + | +152 | pub const IP_TTL: u32 = 2; + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:157:5 + | +157 | pub address: u32, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:172:5 + | +172 | pub length: u8, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:174:5 + | +174 | pub family: ProtocolFamily, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:176:5 + | +176 | pub port: u16, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:178:5 + | +178 | pub addr: IPV4Address, + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:184:5 + | +184 | pub length: u8, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:186:5 + | +186 | pub family: ProtocolFamily, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/network.rs:188:5 + | +188 | pub data: [i8; 14], + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/audio.rs:19:5 + | +19 | Started = 1, + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/audio.rs:20:5 + | +20 | Stopped = 0, + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/audio.rs:27:5 + | +27 | FortyEightKhz = 1, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/audio.rs:28:5 + | +28 | ThirtySixKhz = 0, + | ^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mp3player.rs:6:1 + | +6 | pub struct MP3Player { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mp3player.rs:11:5 + | +11 | pub fn new(asnd: Asnd) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mp3player.rs:20:5 + | +20 | pub fn play_buffer(&mut self, buffer: &[u8]) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mp3player.rs:30:5 + | +30 | pub fn is_playing(&self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mp3player.rs:34:5 + | +34 | pub fn volume(&mut self, volume: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mp3player.rs:38:5 + | +38 | pub fn stop(&mut self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:18:5 + | +18 | Restart = 0, + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:19:5 + | +19 | HotReset = 1, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:20:5 + | +20 | Shutdown = 2, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:21:5 + | +21 | ReturnToMenu = 3, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:22:5 + | +22 | PowerOff = 4, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:23:5 + | +23 | PowerOffStandby = 5, + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:24:5 + | +24 | PowerOffIdle = 6, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:31:5 + | +31 | ProtectNone = 0, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:32:5 + | +32 | ProtectRead = 1, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:33:5 + | +33 | ProtectWrite = 2, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:34:5 + | +34 | ProtectReadWrite = 1 | 2, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:41:5 + | +41 | ChannelZero = 0, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:42:5 + | +42 | ChannelOne = 1, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:43:5 + | +43 | ChannelTwo = 2, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:44:5 + | +44 | ChannelThree = 3, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/system.rs:45:5 + | +45 | All = 4, + | ^^^ + +warning: missing documentation for a struct field + --> src/system.rs:50:5 + | +50 | pub font_type: u16, + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:51:5 + | +51 | pub first_char: u16, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:52:5 + | +52 | pub last_char: u16, + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:53:5 + | +53 | pub inval_char: u16, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:54:5 + | +54 | pub asc: u16, + | ^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:55:5 + | +55 | pub desc: u16, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:56:5 + | +56 | pub width: u16, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:57:5 + | +57 | pub leading: u16, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:58:5 + | +58 | pub cell_dimensions: (u16, u16), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:59:5 + | +59 | pub sheet_size: u32, + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:60:5 + | +60 | pub sheet_format: u16, + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:61:5 + | +61 | pub sheet_colrow: (u16, u16), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:62:5 + | +62 | pub sheet_dimensions: (u16, u16), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:63:5 + | +63 | pub width_table: u16, + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:64:5 + | +64 | pub sheet_image: u32, + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/system.rs:65:5 + | +65 | pub sheet_fullsize: u32, + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/video.rs:12:1 + | +12 | pub struct RenderConfig { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:13:5 + | +13 | pub tv_type: u32, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:14:5 + | +14 | pub framebuffer_width: u16, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:15:5 + | +15 | pub embed_framebuffer_height: u16, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:16:5 + | +16 | pub extern_framebuffer_height: u16, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:17:5 + | +17 | pub vi_x_origin: u16, + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:18:5 + | +18 | pub vi_y_origin: u16, + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:19:5 + | +19 | pub vi_width: u16, + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:20:5 + | +20 | pub vi_height: u16, + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:21:5 + | +21 | pub extern_framebuffer_mode: u32, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:22:5 + | +22 | pub field_rendering: u8, + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:23:5 + | +23 | pub anti_aliasing: u8, + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:24:5 + | +24 | pub sample_pattern: [[u8; 2usize]; 12usize], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:25:5 + | +25 | pub v_filter: [u8; 7usize], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/video.rs:70:1 + | +70 | pub enum TVMode { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/video.rs:87:1 + | +87 | pub enum ViField { + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/video.rs:88:5 + | +88 | ViLowerField = 0, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/video.rs:89:5 + | +89 | ViUpperField = 1, + | ^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:94:5 + | +94 | pub render_config: RenderConfig, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct field + --> src/video.rs:95:5 + | +95 | pub framebuffer: *mut c_void, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:99:5 + | +99 | pub fn init() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/video.rs:119:5 + | +119 | pub fn clear_framebuffer(&mut self, rconf: &RenderConfig, colour: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:125:5 + | +125 | pub fn get_preferred_mode() -> RenderConfig { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:134:5 + | +134 | pub fn configure(render_config: &RenderConfig) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:140:5 + | +140 | pub fn flush() { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:146:5 + | +146 | pub fn get_current_line() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:152:5 + | +152 | pub fn get_tv_mode() -> TVMode { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:157:5 + | +157 | pub fn get_next_field() -> ViField { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:162:5 + | +162 | pub fn is_component_cable() -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:167:5 + | +167 | pub fn set_black(is_black: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/video.rs:187:5 + | +187 | / pub fn register_post_retrace_callback(callback: Box) +188 | | where +189 | | F: Fn(u32), + | |___________________^ + +warning: missing documentation for an associated function + --> src/video.rs:200:5 + | +200 | / pub fn register_pre_retrace_callback(callback: Box) +201 | | where +202 | | F: Fn(u32), + | |___________________^ + +warning: missing documentation for an associated function + --> src/video.rs:213:5 + | +213 | pub fn wait_vsync() { + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/debug.rs:11:5 + | +11 | Usb = 0, + | ^^^ + +warning: missing documentation for a variant + --> src/debug.rs:12:5 + | +12 | Tcp = 1, + | ^^^ + +warning: missing documentation for a function + --> src/utils.rs:71:1 + | +71 | pub fn alloc_aligned_buffer(buffer: &[u8]) -> Vec { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/utils.rs:15:5 + | +15 | pub const BASE_CACHED: usize = ffi::SYS_BASE_CACHED as _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/utils.rs:16:5 + | +16 | pub const BASE_UNCACHED: usize = ffi::SYS_BASE_UNCACHED as _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/gu.rs:17:1 + | +17 | pub enum RotationAxis { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gu.rs:18:5 + | +18 | X = 0x58, + | ^ + +warning: missing documentation for a variant + --> src/gu.rs:19:5 + | +19 | Y = 0x59, + | ^ + +warning: missing documentation for a variant + --> src/gu.rs:20:5 + | +20 | Z = 0x5A, + | ^ + +warning: missing documentation for an associated function + --> src/gu.rs:28:5 + | +28 | pub fn vec_half_angle(a_vec: &mut guVector, b_vec: &mut guVector, ab_vec: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:32:5 + | +32 | pub fn vec_add(a_vec: &mut guVector, b_vec: &mut guVector, ab_vec: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:36:5 + | +36 | pub fn vec_sub(a_vec: &mut guVector, b_vec: &mut guVector, ab_vec: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:40:5 + | +40 | pub fn vec_scale(src: &mut guVector, dest: &mut guVector, scale: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:44:5 + | +44 | pub fn vec_normalize(vector: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:48:5 + | +48 | pub fn vec_mult(mat: &mut Mtx34, src: &mut guVector, dest: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:52:5 + | +52 | pub fn vec_cross(a_vec: &mut guVector, b_vec: &mut guVector, ab_vec: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:56:5 + | +56 | pub fn vec_mult_sr(mat: &mut Mtx34, src: &mut guVector, dest: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:60:5 + | +60 | pub fn vec_dot(a_vec: &mut guVector, b_vec: &mut guVector) -> f32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:65:5 + | +65 | / pub fn quat_add( +66 | | a_quat: &mut guQuaternion, +67 | | b_quat: &mut guQuaternion, +68 | | ab_quat: &mut guQuaternion, +69 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/gu.rs:73:5 + | +73 | / pub fn quat_sub( +74 | | a_quat: &mut guQuaternion, +75 | | b_quat: &mut guQuaternion, +76 | | ab_quat: &mut guQuaternion, +77 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/gu.rs:81:5 + | +81 | pub fn quat_norm(quaternion: &mut guQuaternion, dest: &mut guQuaternion) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:84:5 + | +84 | pub fn quat_inverse(quaternion: &mut guQuaternion, dest: &mut guQuaternion) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:88:5 + | +88 | / pub fn frustrum( +89 | | mt: &mut Mtx44, +90 | | top: f32, +91 | | bottom: f32, +... | +95 | | z_far: f32, +96 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/gu.rs:130:5 + | +130 | pub fn mtx44_identity(mt: &mut Mtx44) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:134:5 + | +134 | pub fn mtx44_copy(src: &mut Mtx44, dst: &mut Mtx44) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:138:5 + | +138 | pub fn mtx44_inverse(src: &mut Mtx44, inverse: &mut Mtx44) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:144:5 + | +144 | / pub fn light_frustum( +145 | | mt: &mut Mtx34, +146 | | frust_box: (f32, f32, f32, f32), +147 | | z_near: f32, +148 | | scale: (f32, f32), +149 | | translation: (f32, f32), +150 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/gu.rs:167:5 + | +167 | / pub fn light_perspective( +168 | | mt: &mut Mtx34, +169 | | fov_y: f32, +170 | | aspect_ratio: f32, +171 | | scale: (f32, f32), +172 | | translation: (f32, f32), +173 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/gu.rs:187:5 + | +187 | / pub fn light_ortho( +188 | | mt: &mut Mtx34, +189 | | top: f32, +190 | | bottom: f32, +... | +194 | | translation: (f32, f32), +195 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/gu.rs:228:5 + | +228 | pub fn mtx_identity(mt: &mut Mtx34) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:232:5 + | +232 | pub fn mtx_concat(a: &mut Mtx34, b: &mut Mtx34, ab: &mut Mtx34) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:236:5 + | +236 | pub fn mtx_scale(mt: &mut Mtx34, scale: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:240:5 + | +240 | pub fn mtx_scale_apply(src: &mut Mtx34, dst: &mut Mtx34, scale: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:252:5 + | +252 | pub fn mtx_apply_scale(src: &mut Mtx34, dst: &mut Mtx34, scale: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:264:5 + | +264 | pub fn mtx_translation(mt: &mut Mtx34, translation: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:275:5 + | +275 | pub fn mtx_translation_apply(src: &mut Mtx34, dst: &mut Mtx34, translation: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:287:5 + | +287 | pub fn mtx_apply_translation(src: &mut Mtx34, dst: &mut Mtx34, translation: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:299:5 + | +299 | pub fn mtx_inverse(src: &mut Mtx34, inverse: &mut Mtx34) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:305:5 + | +305 | pub fn mtx_inv_xpose(src: &mut Mtx34, xpose: &mut Mtx34) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:311:5 + | +311 | pub fn mtx_transpose(src: &mut Mtx34, xpose: &mut Mtx34) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:317:5 + | +317 | pub fn mtx_rotation_radians(mt: &mut Mtx34, axis: RotationAxis, rot_radians: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:321:5 + | +321 | pub fn mtx_rotation_trig(mt: &mut Mtx34, axis: RotationAxis, sin: f32, cos: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:325:5 + | +325 | pub fn mtx_rotation_axis_radians(mt: &mut Mtx34, axis: &mut guVector, rot_radians: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:329:5 + | +329 | pub fn mtx_reflect(mt: &mut Mtx34, point: &mut guVector, normal: &mut guVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:333:5 + | +333 | pub fn mtx_quaternion(mt: &mut Mtx34, quaternion: &mut guQuaternion) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gu.rs:341:1 + | +341 | pub struct Mat4([[f32; 4]; 4]); + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gu.rs:343:5 + | +343 | pub const IDENTITY: Mat4 = Mat4([ + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gu.rs:350:5 + | +350 | pub const ZERO: Mat4 = Mat4([[0.0; 4]; 4]); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:352:5 + | +352 | pub fn as_array(&self) -> &[[f32; 4]; 4] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:356:5 + | +356 | pub fn as_array_mut(&mut self) -> &mut [[f32; 4]; 4] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:360:5 + | +360 | / pub fn gu_frustrum( +361 | | top: f32, +362 | | bottom: f32, +363 | | left: f32, +... | +366 | | z_far: f32, +367 | | ) -> Self { + | |_____________^ + +warning: missing documentation for an associated function + --> src/gu.rs:390:5 + | +390 | pub fn gu_perspective(fov_y: f32, aspect_ratio: f32, z_near: f32, z_far: f32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:403:5 + | +403 | pub fn gu_ortho(top: f32, bottom: f32, left: f32, right: f32, z_near: f32, z_far: f32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:426:5 + | +426 | pub fn load_as_proj_mat(&mut self, p: gx::ProjectionType) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gu.rs:461:1 + | +461 | pub struct Mat3x4([[f32; 4]; 3]); + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gu.rs:463:5 + | +463 | pub const IDENTITY: Mat3x4 = Mat3x4([ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gu.rs:469:5 + | +469 | pub const ZERO: Mat3x4 = Mat3x4([[0.0; 4]; 3]); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:471:5 + | +471 | pub fn as_array(&self) -> &[[f32; 4]; 3] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:475:5 + | +475 | pub fn as_array_mut(&mut self) -> &mut [[f32; 4]; 3] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gu.rs:479:5 + | +479 | / pub fn gu_light_frustrum( +480 | | top: f32, +481 | | bottom: f32, +482 | | left: f32, +... | +486 | | translation: (f32, f32), +487 | | ) -> Self { + | |_____________^ + +warning: missing documentation for an associated function + --> src/gu.rs:508:5 + | +508 | / pub fn gu_light_perspective( +509 | | fov_y: f32, +510 | | aspect_ratio: f32, +511 | | scale: (f32, f32), +512 | | translation: (f32, f32), +513 | | ) -> Self { + | |_____________^ + +warning: missing documentation for an associated function + --> src/gu.rs:524:5 + | +524 | / pub fn gu_light_ortho( +525 | | top: f32, +526 | | bottom: f32, +527 | | left: f32, +... | +530 | | translation: (f32, f32), +531 | | ) -> Self { + | |_____________^ + +warning: missing documentation for an associated function + --> src/gu.rs:552:5 + | +552 | pub fn gu_look_at(pos: (f32, f32, f32), up: (f32, f32, f32), target: (f32, f32, f32)) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:576:5 + | +576 | pub fn gu_translation_apply(&mut self, translation: (f32, f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:588:5 + | +588 | pub fn concat(&mut self, other: &mut Mat3x4) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:596:5 + | +596 | pub fn load_as_pos_mtx(&mut self, pnidx: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:599:5 + | +599 | pub fn load_as_nrm_mtx(&mut self, pnidx: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gu.rs:602:5 + | +602 | pub fn load_as_tex_mtx(&mut self, pnidx: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/gx/mod.rs:24:1 + | +24 | pub const GX_PIPE: VolAddress = unsafe { VolAddress::new(0xCC00_8000) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/gx/mod.rs:27:1 + | +27 | pub mod types; + | ^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/mod.rs:31:1 + | +31 | pub struct Color(ffi::GXColor); + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:34:5 + | +34 | pub const fn new(r: u8, g: u8, b: u8) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:38:5 + | +38 | pub const fn with_alpha(r: u8, g: u8, b: u8, a: u8) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:66:5 + | +66 | Never = ffi::GX_NEVER as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:67:5 + | +67 | Less = ffi::GX_LESS as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:68:5 + | +68 | Equal = ffi::GX_EQUAL as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:69:5 + | +69 | LessEq = ffi::GX_LEQUAL as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:70:5 + | +70 | Greater = ffi::GX_GREATER as _, + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:71:5 + | +71 | NotEq = ffi::GX_NEQUAL as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:72:5 + | +72 | GreaterEq = ffi::GX_GEQUAL as _, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:73:5 + | +73 | Always = ffi::GX_ALWAYS as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:80:5 + | +80 | And = ffi::GX_AOP_AND as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:81:5 + | +81 | Or = ffi::GX_AOP_OR as _, + | ^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:82:5 + | +82 | Xnor = ffi::GX_AOP_XNOR as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:83:5 + | +83 | Xor = ffi::GX_AOP_XOR as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:198:5 + | +198 | ClipRatio = ffi::GX_PERF0_CLIP_RATIO, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:219:5 + | +219 | Triangles0Clr = ffi::GX_PERF0_TRIANGLES_0CLR, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:220:5 + | +220 | Triangles0Tex = ffi::GX_PERF0_TRIANGLES_0TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:221:5 + | +221 | Triangles1Clr = ffi::GX_PERF0_TRIANGLES_1CLR, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:222:5 + | +222 | Triangles1Tex = ffi::GX_PERF0_TRIANGLES_1TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:223:5 + | +223 | Triangles2Clr = ffi::GX_PERF0_TRIANGLES_2CLR, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:224:5 + | +224 | Triangles2Tex = ffi::GX_PERF0_TRIANGLES_2TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:225:5 + | +225 | Triangles3Tex = ffi::GX_PERF0_TRIANGLES_3TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:226:5 + | +226 | Triangles4Tex = ffi::GX_PERF0_TRIANGLES_4TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:227:5 + | +227 | Triangles5Tex = ffi::GX_PERF0_TRIANGLES_5TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:228:5 + | +228 | Triangles6Tex = ffi::GX_PERF0_TRIANGLES_6TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:229:5 + | +229 | Triangles7Tex = ffi::GX_PERF0_TRIANGLES_7TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:230:5 + | +230 | Triangles8Tex = ffi::GX_PERF0_TRIANGLES_8TEX, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:282:5 + | +282 | TcCheck12 = ffi::GX_PERF1_TC_CHECK1_2, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:283:5 + | +283 | TcCheck34 = ffi::GX_PERF1_TC_CHECK3_4, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:284:5 + | +284 | TcCheck56 = ffi::GX_PERF1_TC_CHECK5_6, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:285:5 + | +285 | TcCheck78 = ffi::GX_PERF1_TC_CHECK7_8, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:296:5 + | +296 | VcAllStalls = ffi::GX_PERF1_VC_ALL_STALLS, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:297:5 + | +297 | VcElemqFull = ffi::GX_PERF1_VC_ELEMQ_FULL, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:298:5 + | +298 | VcMemreqFull = ffi::GX_PERF1_VC_MEMREQ_FULL, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:301:5 + | +301 | VcMissqFull = ffi::GX_PERF1_VC_MISSQ_FULL, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:302:5 + | +302 | VcMissrepFull = ffi::GX_PERF1_VC_MISSREP_FULL, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:303:5 + | +303 | VcStatus7 = ffi::GX_PERF1_VC_STATUS7, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:304:5 + | +304 | VcStreamBufLow = ffi::GX_PERF1_VC_STREAMBUF_LOW, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:337:5 + | +337 | Linear = ffi::GX_ZC_LINEAR as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:338:5 + | +338 | Near = ffi::GX_ZC_NEAR as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:339:5 + | +339 | Mid = ffi::GX_ZC_MID as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:340:5 + | +340 | Far = ffi::GX_ZC_FAR as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:347:5 + | +347 | Register = ffi::GX_SRC_REG as _, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:348:5 + | +348 | Vertex = ffi::GX_SRC_VTX as _, + | ^^^^^^ + +warning: missing documentation for an enum + --> src/gx/mod.rs:353:1 + | +353 | pub enum DiffFn { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:354:5 + | +354 | None = ffi::GX_DF_NONE as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:355:5 + | +355 | Signed = ffi::GX_DF_SIGNED as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:356:5 + | +356 | Clamp = ffi::GX_DF_CLAMP as _, + | ^^^^^ + +warning: missing documentation for an enum + --> src/gx/mod.rs:361:1 + | +361 | pub enum AttnFn { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gx/mod.rs:474:5 + | +474 | pub fn is_empty(&self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:524:5 + | +524 | Off = ffi::GX_DA_OFF as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:525:5 + | +525 | Gentle = ffi::GX_DA_GENTLE as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:526:5 + | +526 | Medium = ffi::GX_DA_MEDIUM as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:527:5 + | +527 | Steep = ffi::GX_DA_STEEP as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:534:5 + | +534 | Off = ffi::GX_SP_OFF as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:535:5 + | +535 | Flat = ffi::GX_SP_FLAT as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:536:5 + | +536 | Cos = ffi::GX_SP_COS as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:537:5 + | +537 | Cos2 = ffi::GX_SP_COS2 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:538:5 + | +538 | Sharp = ffi::GX_SP_SHARP as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:539:5 + | +539 | Ring1 = ffi::GX_SP_RING1 as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:540:5 + | +540 | Ring2 = ffi::GX_SP_RING2 as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:860:5 + | +860 | Clamp = ffi::GX_CLAMP as _, + | ^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:861:5 + | +861 | Repeat = ffi::GX_REPEAT as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:862:5 + | +862 | Mirror = ffi::GX_MIRROR as _, + | ^^^^^^ + +warning: missing documentation for a struct + --> src/gx/mod.rs:866:1 + | +866 | pub struct Texture<'img>(ffi::GXTexObj, PhantomData<&'img [u8]>); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gx/mod.rs:1081:5 + | +1081 | pub fn gxtexobj(&mut self) -> &mut GXTexObj { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1096:5 + | +1096 | Null = ffi::GX_VA_NULL as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1097:5 + | +1097 | LightArray = ffi::GX_LIGHTARRAY as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1098:5 + | +1098 | NrmMtxArray = ffi::GX_NRMMTXARRAY as _, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1099:5 + | +1099 | PosMtxArray = ffi::GX_POSMTXARRAY as _, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1100:5 + | +1100 | TexMtxArray = ffi::GX_TEXMTXARRAY as _, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1101:5 + | +1101 | Color0 = ffi::GX_VA_CLR0 as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1102:5 + | +1102 | Color1 = ffi::GX_VA_CLR1 as _, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1103:5 + | +1103 | MaxAttr = ffi::GX_VA_MAXATTR as _, + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1106:5 + | +1106 | Nrm = ffi::GX_VA_NRM as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1107:5 + | +1107 | Pos = ffi::GX_VA_POS as _, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1108:5 + | +1108 | PtnMtxIdx = ffi::GX_VA_PTNMTXIDX as _, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1109:5 + | +1109 | Tex0 = ffi::GX_VA_TEX0 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1110:5 + | +1110 | Tex0MtxIdx = ffi::GX_VA_TEX0MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1111:5 + | +1111 | Tex1 = ffi::GX_VA_TEX1 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1112:5 + | +1112 | Tex1MtxIdx = ffi::GX_VA_TEX1MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1113:5 + | +1113 | Tex2 = ffi::GX_VA_TEX2 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1114:5 + | +1114 | Tex2MtxIdx = ffi::GX_VA_TEX2MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1115:5 + | +1115 | Tex3 = ffi::GX_VA_TEX3 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1116:5 + | +1116 | Tex3MtxIdx = ffi::GX_VA_TEX3MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1117:5 + | +1117 | Tex4 = ffi::GX_VA_TEX4 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1118:5 + | +1118 | Tex4MtxIdx = ffi::GX_VA_TEX4MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1119:5 + | +1119 | Tex5 = ffi::GX_VA_TEX5 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1120:5 + | +1120 | Tex5MtxIdx = ffi::GX_VA_TEX5MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1121:5 + | +1121 | Tex6 = ffi::GX_VA_TEX6 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1122:5 + | +1122 | Tex6MtxIdx = ffi::GX_VA_TEX6MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1123:5 + | +1123 | Tex7 = ffi::GX_VA_TEX7 as _, + | ^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1124:5 + | +1124 | Tex7MtxIdx = ffi::GX_VA_TEX7MTXIDX as _, + | ^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/gx/mod.rs:1137:1 + | +1137 | pub enum ProjectionType { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1138:5 + | +1138 | Perspective = ffi::GX_PERSPECTIVE as _, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:1139:5 + | +1139 | Orthographic = ffi::GX_ORTHOGRAPHIC as _, + | ^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/mod.rs:1143:1 + | +1143 | pub struct GpStatus { + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:1886:5 + | +1886 | pub fn load_nrm_mtx_imm(mt: &mut Mtx34, pnidx: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:1890:5 + | +1890 | pub fn load_tex_mtx_imm(mt: &mut Mtx34, pnidx: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2000:5 + | +2000 | pub fn position_3f32(x: f32, y: f32, z: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2022:5 + | +2022 | pub fn position_3u16(x: u16, y: u16, z: u16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2039:5 + | +2039 | pub fn position_3i16(x: i16, y: i16, z: i16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2056:5 + | +2056 | pub fn position_3u8(x: u8, y: u8, z: u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2073:5 + | +2073 | pub fn position_3i8(x: i8, y: i8, z: i8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2090:5 + | +2090 | pub fn position_2f32(x: f32, y: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2104:5 + | +2104 | pub fn position_2u16(x: u16, y: u16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2118:5 + | +2118 | pub fn position_2i16(x: i16, y: i16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2132:5 + | +2132 | pub fn position_2u8(x: u8, y: u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2146:5 + | +2146 | pub fn position_2i8(x: i8, y: i8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2160:5 + | +2160 | pub fn position1x8(index: u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2168:5 + | +2168 | pub fn position1x16(index: u16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2176:5 + | +2176 | pub fn color_4u8(r: u8, g: u8, b: u8, a: u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2197:5 + | +2197 | pub fn color_3u8(r: u8, g: u8, b: u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2214:5 + | +2214 | pub fn color_3f32(r: f32, g: f32, b: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2229:5 + | +2229 | pub fn color_4f32(r: f32, g: f32, b: f32, a: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2239:5 + | +2239 | pub fn color_1u32(clr: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2247:5 + | +2247 | pub fn color_1u16(clr: u16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2255:5 + | +2255 | pub fn color1x8(index: u8) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2263:5 + | +2263 | pub fn color1x16(index: u16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2276:5 + | +2276 | pub fn tex_coord_2f32(s: f32, t: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2289:5 + | +2289 | pub fn flush() { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/mod.rs:2294:5 + | +2294 | pub fn end() { + | ^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/gx/mod.rs:2339:1 + | +2339 | pub enum GPCommand { + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2340:5 + | +2340 | Nop = 0x00, + | ^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2341:5 + | +2341 | LoadCPReg = 0x08, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2342:5 + | +2342 | LoadXFReg = 0x10, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2343:5 + | +2343 | LoadPosIndexed = 0x20, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2344:5 + | +2344 | LoadNormalIndexed = 0x28, + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2345:5 + | +2345 | LoadTexureIndexed = 0x30, + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2346:5 + | +2346 | LoadLightIndexed = 0x38, + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2347:5 + | +2347 | CallDisplayList = 0x40, + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2348:5 + | +2348 | InvalidateVertexCache = 0x48, + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2349:5 + | +2349 | LoadBPReg = 0x61, + | ^^^^^^^^^ + +warning: missing documentation for an enum + --> src/gx/mod.rs:2354:1 + | +2354 | pub enum GPDrawCommand { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2355:5 + | +2355 | DrawQuads = 0x80, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2356:5 + | +2356 | DrawTriangles = 0x90, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2357:5 + | +2357 | DrawTriangleStrip = 0x98, + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2358:5 + | +2358 | DrawTriangleFan = 0xA0, + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2359:5 + | +2359 | DrawLines = 0xA8, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2360:5 + | +2360 | DrawLineStrip = 0xB0, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2361:5 + | +2361 | DrawPoints = 0xBB, + | ^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/gx/mod.rs:2365:1 + | +2365 | pub enum ColorChannel { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2366:5 + | +2366 | Color0 = ffi::GX_COLOR0, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/gx/mod.rs:2367:5 + | +2367 | Color1 = ffi::GX_COLOR1, + | ^^^^^^ + +warning: missing documentation for a struct + --> src/gx/types.rs:3:1 + | +3 | pub struct PixelFormat(u8); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:6:5 + | +6 | pub const RGB8_Z24: Self = Self(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:7:5 + | +7 | pub const RGBA6_Z24: Self = Self(1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:8:5 + | +8 | pub const RGB565_Z16: Self = Self(2); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:9:5 + | +9 | pub const Z24: Self = Self(3); + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:10:5 + | +10 | pub const Y8: Self = Self(4); + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:11:5 + | +11 | pub const U8: Self = Self(5); + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:12:5 + | +12 | pub const V8: Self = Self(6); + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:13:5 + | +13 | pub const YUV420: Self = Self(7); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/types.rs:16:1 + | +16 | pub struct ZFormat(u8); + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:19:5 + | +19 | pub const LINEAR: Self = Self(0); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:20:5 + | +20 | pub const NEAR: Self = Self(1); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:21:5 + | +21 | pub const MID: Self = Self(2); + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:22:5 + | +22 | pub const FAR: Self = Self(3); + | ^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/types.rs:25:1 + | +25 | pub struct ZCompareLocation(bool); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:28:5 + | +28 | pub const AFTER_TEXTURE: Self = Self(false); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:29:5 + | +29 | pub const BEFORE_TEXTURE: Self = Self(true); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/types.rs:32:1 + | +32 | pub struct Gamma(pub(crate) u8); + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:35:5 + | +35 | pub const ONE_ZERO: Self = Self(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:36:5 + | +36 | pub const ONE_SEVEN: Self = Self(1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:37:5 + | +37 | pub const TWO_TWO: Self = Self(2); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/types.rs:40:1 + | +40 | pub struct VtxDest(pub(crate) u8); + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:43:5 + | +43 | pub const NONE: Self = Self(0); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:44:5 + | +44 | pub const DIRECT: Self = Self(1); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:45:5 + | +45 | pub const INDEX8: Self = Self(2); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated constant + --> src/gx/types.rs:46:5 + | +46 | pub const INDEX16: Self = Self(3); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/gx/types.rs:49:1 + | +49 | pub struct PixelEngineControl { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/gx/types.rs:56:5 + | +56 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gx/types.rs:64:5 + | +64 | pub fn to_u32(&self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gx/types.rs:75:5 + | +75 | pub fn pixel_format(mut self, format: PixelFormat) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gx/types.rs:81:5 + | +81 | pub fn z_format(mut self, format: ZFormat) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/gx/types.rs:87:5 + | +87 | pub fn z_comp_loc(mut self, z_comp_loc: ZCompareLocation) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:114:5 + | +114 | Mono8Bit, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:115:5 + | +115 | Mono16Bit, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:116:5 + | +116 | Mono16BitBe, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:117:5 + | +117 | Stereo8Bit, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:118:5 + | +118 | Stereo16Bit, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:119:5 + | +119 | Stereo16BitBe, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:120:5 + | +120 | Mono8BitU, + | ^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:121:5 + | +121 | Mono16BitLE, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:122:5 + | +122 | Stereo8BitU, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/asnd.rs:123:5 + | +123 | Stereo16BitLe, + | ^^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/aesnd.rs:10:1 + | +10 | pub enum AudioFormat { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:11:5 + | +11 | VoiceMono8 = ffi::VOICE_MONO8, + | ^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:12:5 + | +12 | VoiceStereo8 = ffi::VOICE_STEREO8, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:13:5 + | +13 | VoiceMono16 = ffi::VOICE_MONO16, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:14:5 + | +14 | VoiceStereo16 = ffi::VOICE_STEREO16, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:15:5 + | +15 | VoiceMono8U = ffi::VOICE_MONO8_UNSIGNED, + | ^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:16:5 + | +16 | VoiceStereo8U = ffi::VOICE_STEREO8_UNSIGNED, + | ^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:17:5 + | +17 | VoiceMono16U = ffi::VOICE_MONO16_UNSIGNED, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/aesnd.rs:18:5 + | +18 | VoiceStereo16U = ffi::VOICE_STEREO16_UNSIGNED, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a type alias + --> src/aesnd.rs:21:1 + | +21 | pub type VoiceCallback = Option>; + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a type alias + --> src/aesnd.rs:22:1 + | +22 | pub type AudioCallback = Option>; + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/aesnd.rs:24:1 + | +24 | pub struct Aesnd; + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:27:5 + | +27 | pub fn init() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:34:5 + | +34 | pub fn reset() { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:40:5 + | +40 | pub fn set_pause(pause: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:46:5 + | +46 | pub fn pause() { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:50:5 + | +50 | pub fn unpause() { + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:54:5 + | +54 | pub fn get_dsp_process_time() -> Duration { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:58:5 + | +58 | pub fn get_dsp_process_usage() -> f32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:62:5 + | +62 | pub fn register_audio_callback(callback: Option) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:68:5 + | +68 | pub fn set_voice_stop(play_state: &mut AESNDPB, stop: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:74:5 + | +74 | pub fn set_voice_mute(play_state: &mut AESNDPB, mute: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:80:5 + | +80 | pub fn set_voice_loop(play_state: &mut AESNDPB, loop_: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:86:5 + | +86 | pub fn set_voice_format(play_state: &mut AESNDPB, format: AudioFormat) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:92:5 + | +92 | pub fn set_voice_stream(play_state: &mut AESNDPB, stream: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:98:5 + | +98 | pub fn set_voice_frequency(play_state: &mut AESNDPB, frequency: f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:104:5 + | +104 | pub fn set_voice_volume(play_state: &mut AESNDPB, volume: (f32, f32)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:114:5 + | +114 | pub fn set_voice_delay(play_state: &mut AESNDPB, delay: u32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:120:5 + | +120 | pub fn set_voice_buffer(play_state: &mut AESNDPB, buffer: &[u8]) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:147:5 + | +147 | / pub fn play_voice( +148 | | play_state: &mut AESNDPB, +149 | | format: AudioFormat, +150 | | buffer: &[u8], +... | +153 | | loop_: bool, +154 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:187:5 + | +187 | / pub fn register_voice_callback( +188 | | play_state: &mut AESNDPB, +189 | | callback: Option, +190 | | ) { + | |_____^ + +warning: missing documentation for an associated function + --> src/aesnd.rs:196:5 + | +196 | pub fn new_playstate() -> AESNDPB { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/input/mod.rs:1:1 + | +1 | pub mod controller; + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/input/mod.rs:2:1 + | +2 | pub mod pad; + | ^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/input/mod.rs:3:1 + | +3 | pub mod wpad; + | ^^^^^^^^^^^^ + +warning: missing documentation for an enum + --> src/input/mod.rs:7:1 + | +7 | pub enum ControllerPort { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/input/mod.rs:8:5 + | +8 | One = 0, + | ^^^ + +warning: missing documentation for a variant + --> src/input/mod.rs:9:5 + | +9 | Two = 1, + | ^^^ + +warning: missing documentation for a variant + --> src/input/mod.rs:10:5 + | +10 | Three = 2, + | ^^^^^ + +warning: missing documentation for a variant + --> src/input/mod.rs:11:5 + | +11 | Four = 3, + | ^^^^ + +warning: missing documentation for an enum + --> src/input/controller.rs:5:1 + | +5 | pub enum ControllerType { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:6:5 + | +6 | Gamecube, + | ^^^^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:7:5 + | +7 | Wii, + | ^^^ + +warning: missing documentation for an enum + --> src/input/controller.rs:10:1 + | +10 | pub enum Button { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:11:5 + | +11 | Left, + | ^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:12:5 + | +12 | Right, + | ^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:13:5 + | +13 | Up, + | ^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:14:5 + | +14 | Down, + | ^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:15:5 + | +15 | TrigL, + | ^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:16:5 + | +16 | TrigR, + | ^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:17:5 + | +17 | TrigZ, + | ^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:18:5 + | +18 | TrigZL, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:19:5 + | +19 | TrigZR, + | ^^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:20:5 + | +20 | A, + | ^ + +warning: missing documentation for a variant + --> src/input/controller.rs:21:5 + | +21 | B, + | ^ + +warning: missing documentation for a variant + --> src/input/controller.rs:22:5 + | +22 | C, + | ^ + +warning: missing documentation for a variant + --> src/input/controller.rs:23:5 + | +23 | X, + | ^ + +warning: missing documentation for a variant + --> src/input/controller.rs:24:5 + | +24 | Y, + | ^ + +warning: missing documentation for a variant + --> src/input/controller.rs:25:5 + | +25 | Z, + | ^ + +warning: missing documentation for a variant + --> src/input/controller.rs:26:5 + | +26 | One, + | ^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:27:5 + | +27 | Two, + | ^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:28:5 + | +28 | Minus, + | ^^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:29:5 + | +29 | Plus, + | ^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:30:5 + | +30 | Home, + | ^^^^ + +warning: missing documentation for a variant + --> src/input/controller.rs:31:5 + | +31 | Start, + | ^^^^^ + +warning: missing documentation for a struct + --> src/input/controller.rs:73:1 + | +73 | pub struct Input { + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/controller.rs:79:5 + | +79 | pub fn new(ctrl_type: ControllerType, id: ControllerPort) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/controller.rs:83:5 + | +83 | pub fn as_pad(&self) -> Pad { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/controller.rs:87:5 + | +87 | pub fn as_wpad(&self) -> WPad { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/controller.rs:91:5 + | +91 | pub fn is_button_up(&self, button: Button) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/controller.rs:104:5 + | +104 | pub fn is_button_down(&self, button: Button) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/controller.rs:117:5 + | +117 | pub fn is_button_held(&self, button: Button) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/controller.rs:130:5 + | +130 | pub fn init(ctrl_type: ControllerType) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/controller.rs:141:5 + | +141 | pub fn update(ctrl_type: ControllerType) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/input/pad.rs:5:1 + | +5 | pub struct Pad { + | ^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/input/pad.rs:9:1 + | +9 | / bitflags! { +10 | | pub struct PadButton: u16 { +11 | | const LEFT = 0x0001; +12 | | const RIGHT = 0x0002; +... | +23 | | } +24 | | } + | |_^ + | + = note: this warning originates in the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/input/pad.rs:9:1 + | +9 | / bitflags! { +10 | | pub struct PadButton: u16 { +11 | | const LEFT = 0x0001; +12 | | const RIGHT = 0x0002; +... | +23 | | } +24 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated function + --> src/input/pad.rs:27:5 + | +27 | pub fn new(id: ControllerPort) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:31:5 + | +31 | pub fn buttons_up(&self) -> PadButton { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:35:5 + | +35 | pub fn is_button_up(&self, button: PadButton) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:40:5 + | +40 | pub fn buttons_down(&self) -> PadButton { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:44:5 + | +44 | pub fn is_button_down(&self, button: PadButton) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:49:5 + | +49 | pub fn buttons_held(&self) -> PadButton { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:53:5 + | +53 | pub fn is_button_held(&self, button: PadButton) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:58:5 + | +58 | pub fn stick_x(&self) -> i8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:62:5 + | +62 | pub fn stick_y(&self) -> i8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:66:5 + | +66 | pub fn c_stick_x(&self) -> i8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:70:5 + | +70 | pub fn c_stick_y(&self) -> i8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:74:5 + | +74 | pub fn trigger_l(&self) -> u8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/pad.rs:78:5 + | +78 | pub fn trigger_r(&self) -> u8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/pad.rs:82:5 + | +82 | pub fn init() { + | ^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/pad.rs:86:5 + | +86 | pub fn update() { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/input/wpad.rs:6:1 + | +6 | pub struct WPad { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/input/wpad.rs:10:1 + | +10 | / bitflags! { +11 | | pub struct WPadButton: u32 { +12 | | const TWO = 0x0001; +13 | | const ONE = 0x0002; +... | +55 | | } +56 | | } + | |_^ + | + = note: this warning originates in the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an associated constant + --> src/input/wpad.rs:10:1 + | +10 | / bitflags! { +11 | | pub struct WPadButton: u32 { +12 | | const TWO = 0x0001; +13 | | const ONE = 0x0002; +... | +55 | | } +56 | | } + | |_^ + | + = note: this warning originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: missing documentation for an enum + --> src/input/wpad.rs:60:1 + | +60 | pub enum WPadDataFormat { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/input/wpad.rs:61:5 + | +61 | Buttons = ffi::WPAD_FMT_BTNS, + | ^^^^^^^ + +warning: missing documentation for a variant + --> src/input/wpad.rs:62:5 + | +62 | ButtonsAccel = ffi::WPAD_FMT_BTNS_ACC, + | ^^^^^^^^^^^^ + +warning: missing documentation for a variant + --> src/input/wpad.rs:63:5 + | +63 | ButtonsAccelIR = ffi::WPAD_FMT_BTNS_ACC_IR, + | ^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/wpad.rs:67:5 + | +67 | pub fn new(id: ControllerPort) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:71:5 + | +71 | pub fn buttons_up(&self) -> WPadButton { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:75:5 + | +75 | pub fn is_button_up(&self, button: WPadButton) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:80:5 + | +80 | pub fn buttons_down(&self) -> WPadButton { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:84:5 + | +84 | pub fn is_button_down(&self, button: WPadButton) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:89:5 + | +89 | pub fn buttons_held(&self) -> WPadButton { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:93:5 + | +93 | pub fn is_button_held(&self, button: WPadButton) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:98:5 + | +98 | pub fn raw(&self) -> Box { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:102:5 + | +102 | pub fn ir(&self) -> (f32, f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:107:5 + | +107 | pub fn gforce(self) -> (f32, f32, f32) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:112:5 + | +112 | pub fn accel(&self) -> (u16, u16, u16) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:117:5 + | +117 | pub fn expansion(&self) -> ffi::expansion_t { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:122:5 + | +122 | pub fn set_data_format(&self, data_format: WPadDataFormat) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/input/wpad.rs:126:5 + | +126 | pub fn set_motion_plus(&self, enable_motion_plus: bool) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/wpad.rs:130:5 + | +130 | pub fn init() { + | ^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/input/wpad.rs:134:5 + | +134 | pub fn update() { + | ^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/lwp.rs:74:1 + | +74 | pub struct Builder { + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a type alias + --> src/lwp.rs:81:1 + | +81 | pub type EntryFn = Option *mut c_void>; + | ^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/lwp.rs:90:5 + | +90 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/lwp.rs:100:5 + | +100 | pub fn arg(mut self, arg: *mut c_void) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/lwp.rs:106:5 + | +106 | pub fn stack_base(mut self, base: *mut c_void) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/lwp.rs:112:5 + | +112 | pub fn stack_size(mut self, size: usize) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/lwp.rs:118:5 + | +118 | pub fn priority(mut self, prio: u8) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/lwp.rs:123:5 + | +123 | / pub fn spawn( +124 | | self, +125 | | entry: EntryFn, +126 | | ) -> Result { + | |____________________________^ + +warning: missing documentation for a struct + --> src/time.rs:9:1 + | +9 | pub struct Instant(Duration); + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/time.rs:13:5 + | +13 | pub fn now() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/time.rs:18:5 + | +18 | pub fn duration_since(&self, earlier: Self) -> Duration { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/time.rs:23:5 + | +23 | pub fn checked_duration_since(&self, earlier: Self) -> Option { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/time.rs:28:5 + | +28 | pub fn saturating_duration_since(&self, earlier: Self) -> Duration { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/time.rs:33:5 + | +33 | pub fn elapsed(&self) -> Duration { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/time.rs:38:5 + | +38 | pub fn checked_add(&self, duration: Duration) -> Option { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/time.rs:43:5 + | +43 | pub fn checked_sub(&self, duration: Duration) -> Option { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:1:1 + | +1 | pub mod cp; + | ^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:2:1 + | +2 | pub mod di; + | ^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:3:1 + | +3 | pub mod dsp; + | ^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:4:1 + | +4 | pub mod mi; + | ^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:5:1 + | +5 | pub mod pe; + | ^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:6:1 + | +6 | pub mod pi; + | ^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:7:1 + | +7 | pub mod serial_interface; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a module + --> src/mmio/mod.rs:8:1 + | +8 | pub mod vi; + | ^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:7:1 + | +7 | pub const STATUS_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/cp.rs:11:1 + | +11 | pub struct ControlRegisterControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:12:1 + | +12 | pub const CONTROL_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/cp.rs:16:1 + | +16 | pub struct ClearRegisterControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:17:1 + | +17 | pub const CLEAR_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:20:1 + | +20 | pub const TOKEN_REGISTER: VolAddress = unsafe { VolAddress::new(0xCC00_000E) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/cp.rs:23:1 + | +23 | pub struct BoundingBoxWidthBound(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:24:1 + | +24 | pub const BBOX_LEFT: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:26:1 + | +26 | pub const BBOX_RIGHT: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/cp.rs:30:1 + | +30 | pub struct BoundingBoxHeightBound(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:31:1 + | +31 | pub const BBOX_TOP: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:33:1 + | +33 | pub const BBOX_BOTTOM: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:36:1 + | +36 | pub const FIFO_BASE_LO: VolAddress = unsafe { VolAddress::new(0xCC00_0020) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:37:1 + | +37 | pub const FIFO_BASE_HI: VolAddress = unsafe { VolAddress::new(0xCC00_0022) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:39:1 + | +39 | pub const FIFO_END_LO: VolAddress = unsafe { VolAddress::new(0xCC00_0024) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:40:1 + | +40 | pub const FIFO_END_HI: VolAddress = unsafe { VolAddress::new(0xCC00_0026) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:42:1 + | +42 | pub const FIFO_HIGH_WATERMARK_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:44:1 + | +44 | pub const FIFO_HIGH_WATERMARK_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:47:1 + | +47 | pub const FIFO_LOW_WATERMARK_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:49:1 + | +49 | pub const FIFO_LOW_WATERMARK_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:52:1 + | +52 | pub const FIFO_RW_DISTANCE_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:54:1 + | +54 | pub const FIFO_RW_DISTANCE_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:57:1 + | +57 | pub const FIFO_WRITE_PTR_LO: VolAddress = unsafe { VolAddress::new(0xCC00_0034) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:58:1 + | +58 | pub const FIFO_WRITE_PTR_HI: VolAddress = unsafe { VolAddress::new(0xCC00_0036) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:60:1 + | +60 | pub const FIFO_READ_PTR_LO: VolAddress = unsafe { VolAddress::new(0xCC00_0038) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:61:1 + | +61 | pub const FIFO_READ_PTR_HI: VolAddress = unsafe { VolAddress::new(0xCC00_003a) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:63:1 + | +63 | pub const FIFO_BREAKPOINT_PTR_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/cp.rs:65:1 + | +65 | pub const FIFO_BREAKPOINT_PTR_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/di.rs:4:1 + | +4 | pub struct DiStatusControl(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/di.rs:5:1 + | +5 | pub const DI_STATUS_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/di.rs:9:1 + | +9 | pub struct DiCoverControl(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/di.rs:10:1 + | +10 | pub const DI_COVER_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/di.rs:14:1 + | +14 | pub struct DiCommandBufControl(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/di.rs:15:1 + | +15 | pub const DI_COMMAND_BUFFER_ZERO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/di.rs:17:1 + | +17 | pub const DI_COMMAND_BUFFER_ONE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/di.rs:19:1 + | +19 | pub const DI_COMMAND_BUFFER_TWO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/dsp.rs:4:1 + | +4 | pub struct MailBoxVal(u16); + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:6:1 + | +6 | pub const DSP_MAILBOX_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:8:1 + | +8 | pub const DSP_MAILBOX_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:10:1 + | +10 | pub const CPU_MAILBOX_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:12:1 + | +12 | pub const CPU_MAILBOX_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/dsp.rs:16:1 + | +16 | pub struct DSPControlStatus(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:17:1 + | +17 | pub const DSP_CONTROL_STATUS_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:20:1 + | +20 | pub const AR_SIZE: VolAddress = unsafe { VolAddress::new(0xCC00_5012) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:21:1 + | +21 | pub const AR_MODE: VolAddress = unsafe { VolAddress::new(0xCC00_5016) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:22:1 + | +22 | pub const AR_REFRESH: VolAddress = unsafe { VolAddress::new(0xCC00_501A) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:23:1 + | +23 | pub const AR_MRAM_ADDR_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:25:1 + | +25 | pub const AR_MRAM_ADDR_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:27:1 + | +27 | pub const AR_ARAM_ADDR_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:29:1 + | +29 | pub const AR_ARAM_ADDR_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/dsp.rs:33:1 + | +33 | pub struct DmaCountHi(u16); + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:34:1 + | +34 | pub const AR_DMA_COUNT_HI: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:36:1 + | +36 | pub const AR_DMA_COUNT_LO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:39:1 + | +39 | pub const AR_START_ADDR_HI: VolAddress = unsafe { VolAddress::new(0xCC00_5030) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:40:1 + | +40 | pub const AR_START_ADDR_LO: VolAddress = unsafe { VolAddress::new(0xCC00_5032) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/dsp.rs:44:1 + | +44 | pub struct DmaControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:45:1 + | +45 | pub const DMA_CONTROL: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/dsp.rs:48:1 + | +48 | pub const DMA_BYTES_LEFT: VolAddress = unsafe { VolAddress::new(0xCC00_503A) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:4:1 + | +4 | pub struct PageAddress(u32); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:5:1 + | +5 | pub const PROTECTED_REGION_ZERO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:7:1 + | +7 | pub const PROTECTED_REGION_ONE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:9:1 + | +9 | pub const PROTECTED_REGION_TWO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:11:1 + | +11 | pub const PROTECTED_REGION_THREE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:15:1 + | +15 | pub struct ProtectionType(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:16:1 + | +16 | pub const PROJECTION_TYPE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:20:1 + | +20 | pub struct MemoryInterruptMask(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:21:1 + | +21 | pub const MI_INTERRUPT_MASK: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:25:1 + | +25 | pub struct MemoryInterruptCause(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:26:1 + | +26 | pub const MI_INTERRUPT_CAUSE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:30:1 + | +30 | pub struct MemUnknown(u16); + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:31:1 + | +31 | pub const MEM_UNKNOWN: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:35:1 + | +35 | pub struct MemAddrLo(u16); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:36:1 + | +36 | pub const MEM_ADDR_LO: VolAddress = unsafe { VolAddress::new(0xCC00_4022) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/mi.rs:39:1 + | +39 | pub struct MemAddrHi(u16); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:40:1 + | +40 | pub const MEM_ADDR_HI: VolAddress = unsafe { VolAddress::new(0xCC00_4024) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:42:1 + | +42 | pub const TIMER_HI: VolSeries = unsafe { VolSeries::new(0xCC00_4032) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/mi.rs:43:1 + | +43 | pub const TIMER_LO: VolSeries = unsafe { VolSeries::new(0xCC00_4034) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pe.rs:4:1 + | +4 | pub struct ZConfigControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:5:1 + | +5 | pub const Z_CONFIG: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pe.rs:9:1 + | +9 | pub struct AlphaConfigControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:10:1 + | +10 | pub const ALPHA_CONFIG: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pe.rs:14:1 + | +14 | pub struct DestAlpha(u16); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:15:1 + | +15 | pub const DEST_ALPHA: VolAddress = unsafe { VolAddress::new(0xCC00_1004) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pe.rs:18:1 + | +18 | pub struct AlphaMode(u16); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:19:1 + | +19 | pub const ALPHA_MODE: VolAddress = unsafe { VolAddress::new(0xCC00_1006) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pe.rs:22:1 + | +22 | pub struct AlphaRead(u16); + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:23:1 + | +23 | pub const ALPHA_READ: VolAddress = unsafe { VolAddress::new(0xCC00_1008) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pe.rs:26:1 + | +26 | pub struct InterruptStatusControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:27:1 + | +27 | pub const INTERRUPT_STATUS_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pe.rs:30:1 + | +30 | pub const PE_TOKEN: VolAddress = unsafe { VolAddress::new(0xCC00_100E) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pi.rs:4:1 + | +4 | pub struct InterruptCause(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:5:1 + | +5 | pub const INTERRUPT_CAUSE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pi.rs:9:1 + | +9 | pub struct InterruptMask(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:10:1 + | +10 | pub const INTERRUPT_MASK: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:13:1 + | +13 | pub const CPU_FIFO_START: VolAddress = unsafe { VolAddress::new(0xCC00_3008) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:14:1 + | +14 | pub const CPU_FIFO_END: VolAddress = unsafe { VolAddress::new(0xCC00_300C) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:15:1 + | +15 | pub const CPU_FIFO_WRITE_PTR: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:17:1 + | +17 | pub const RESET: VolAddress = unsafe { VolAddress::new(0xCC00_3024) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/pi.rs:20:1 + | +20 | pub struct HardwareDescription(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/pi.rs:21:1 + | +21 | pub const HW_DESCRIPTION: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/serial_interface.rs:55:1 + | +55 | pub const INPUT_OUTPUT_BUFFER: VolBlock = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:71:5 + | +71 | pub struct OutputBuffer(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:81:9 + | +81 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:86:9 + | +86 | pub fn read_zero() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:91:9 + | +91 | pub fn read_one() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:96:9 + | +96 | pub fn read_two() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:101:9 + | +101 | pub fn read_three() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:105:9 + | +105 | pub fn write_zero(self) { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:109:9 + | +109 | pub fn write_one(self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:113:9 + | +113 | pub fn write_two(self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:117:9 + | +117 | pub fn write_three(self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:122:9 + | +122 | pub fn command_opcode(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:127:9 + | +127 | pub fn with_command_opcode(mut self, opcode: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:133:9 + | +133 | pub fn output_zero(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:138:9 + | +138 | pub fn with_output_zero(mut self, output_zero: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:144:9 + | +144 | pub fn output_one(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:149:9 + | +149 | pub fn with_output_one(mut self, output_one: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:157:5 + | +157 | pub struct InputBufferHigh(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:167:9 + | +167 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:172:9 + | +172 | pub fn read_zero() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:177:9 + | +177 | pub fn read_one() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:182:9 + | +182 | pub fn read_two() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:187:9 + | +187 | pub fn read_three() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:191:9 + | +191 | pub fn write_zero(self) { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:195:9 + | +195 | pub fn write_one(self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:199:9 + | +199 | pub fn write_two(self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:203:9 + | +203 | pub fn write_three(self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:208:9 + | +208 | pub fn error_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:213:9 + | +213 | pub fn with_error_status(mut self, status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:219:9 + | +219 | pub fn error_latch(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:224:9 + | +224 | pub fn with_error_latch(mut self, latch: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:230:9 + | +230 | pub fn input_zero(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:235:9 + | +235 | pub fn with_input_zero(mut self, zero: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:241:9 + | +241 | pub fn input_one(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:246:9 + | +246 | pub fn with_input_one(mut self, one: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:252:9 + | +252 | pub fn input_two(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:257:9 + | +257 | pub fn with_input_two(mut self, two: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:263:9 + | +263 | pub fn input_three(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:268:9 + | +268 | pub fn with_input_three(mut self, three: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:276:5 + | +276 | pub struct InputBufferLow(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:286:9 + | +286 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:291:9 + | +291 | pub fn read_zero() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:296:9 + | +296 | pub fn read_one() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:301:9 + | +301 | pub fn read_two() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:306:9 + | +306 | pub fn read_three() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:310:9 + | +310 | pub fn write_zero(self) { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:314:9 + | +314 | pub fn write_one(self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:318:9 + | +318 | pub fn write_two(self) { + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:322:9 + | +322 | pub fn write_three(self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:327:9 + | +327 | pub fn input_four(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:332:9 + | +332 | pub fn with_input_four(mut self, four: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:338:9 + | +338 | pub fn input_five(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:343:9 + | +343 | pub fn with_input_five(mut self, five: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:349:9 + | +349 | pub fn input_six(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:354:9 + | +354 | pub fn with_input_six(mut self, six: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:360:9 + | +360 | pub fn input_seven(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:365:9 + | +365 | pub fn with_input_seven(mut self, seven: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:373:5 + | +373 | pub struct PollingRegister(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:383:9 + | +383 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:388:9 + | +388 | pub fn read() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:392:9 + | +392 | pub fn write(self) { + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:397:9 + | +397 | pub fn lines_per_poll(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:402:9 + | +402 | pub fn with_lines_per_poll(mut self, lines: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:408:9 + | +408 | pub fn polls_per_frame(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:413:9 + | +413 | pub fn with_polls_per_frame(mut self, polls: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:419:9 + | +419 | pub fn channel_0_enable(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:424:9 + | +424 | pub fn with_channel_0_enable(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:430:9 + | +430 | pub fn channel_1_enable(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:435:9 + | +435 | pub fn with_channel_1_enable(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:441:9 + | +441 | pub fn channel_2_enable(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:446:9 + | +446 | pub fn with_channel_2_enable(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:452:9 + | +452 | pub fn channel_3_enable(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:457:9 + | +457 | pub fn with_channel_3_enable(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:463:9 + | +463 | pub fn channel_0_copy_on_vblank(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:468:9 + | +468 | pub fn with_channel_0_copy_on_vblank(mut self, vblank: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:474:9 + | +474 | pub fn channel_1_copy_on_vblank(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:479:9 + | +479 | pub fn with_channel_1_copy_on_vblank(mut self, vblank: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:485:9 + | +485 | pub fn channel_2_copy_on_vblank(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:490:9 + | +490 | pub fn with_channel_2_copy_on_vblank(mut self, vblank: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:496:9 + | +496 | pub fn channel_3_copy_on_vblank(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:501:9 + | +501 | pub fn with_channel_3_copy_on_vblank(mut self, vblank: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:509:5 + | +509 | pub struct CommuicationStatus(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:518:9 + | +518 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:523:9 + | +523 | pub fn read() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:527:9 + | +527 | pub fn write(self) { + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:532:9 + | +532 | pub fn transfer_start(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:537:9 + | +537 | pub fn with_transfer_start(mut self, start: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:543:9 + | +543 | pub fn channel(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:548:9 + | +548 | pub fn with_channel(mut self, channel: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:554:9 + | +554 | pub fn input_length(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:559:9 + | +559 | pub fn with_input_length(mut self, length: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:565:9 + | +565 | pub fn output_length(self) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:570:9 + | +570 | pub fn with_output_length(mut self, length: u32) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:576:9 + | +576 | pub fn read_status_interrupt_mask(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:581:9 + | +581 | pub fn with_read_status_interrupt_mask(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:587:9 + | +587 | pub fn read_status_interrupt(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:592:9 + | +592 | pub fn with_read_status_interrupt(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:598:9 + | +598 | pub fn communication_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:603:9 + | +603 | pub fn with_communication_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:609:9 + | +609 | pub fn transfer_complete_interrupt_mask(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:614:9 + | +614 | pub fn with_transfer_complete_interrupt_mask(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:620:9 + | +620 | pub fn transfer_complete_interrupt(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:625:9 + | +625 | pub fn with_transfer_complete_interrupt(mut self, enable: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:633:5 + | +633 | pub struct Status(u32); + | ^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:643:9 + | +643 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:648:9 + | +648 | pub fn read() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:652:9 + | +652 | pub fn write(self) { + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:657:9 + | +657 | pub fn output_buffer_write(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:662:9 + | +662 | pub fn with_output_buffer_write(mut self, write: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:668:9 + | +668 | pub fn channel_0_read_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:673:9 + | +673 | pub fn with_channel_0_read_status(mut self, read_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:679:9 + | +679 | pub fn channel_0_write_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:684:9 + | +684 | pub fn with_channel_0_write_status(mut self, write_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:690:9 + | +690 | pub fn channel_0_no_response_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:695:9 + | +695 | pub fn with_channel_0_no_response_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:701:9 + | +701 | pub fn channel_0_collision_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:706:9 + | +706 | pub fn with_channel_0_collision_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:712:9 + | +712 | pub fn channel_0_buffer_overrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:717:9 + | +717 | pub fn with_channel_0_buffer_overrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:723:9 + | +723 | pub fn channel_0_buffer_underrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:728:9 + | +728 | pub fn with_channel_0_buffer_underrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:734:9 + | +734 | pub fn channel_1_read_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:739:9 + | +739 | pub fn with_channel_1_read_status(mut self, read_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:745:9 + | +745 | pub fn channel_1_write_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:750:9 + | +750 | pub fn with_channel_1_write_status(mut self, write_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:756:9 + | +756 | pub fn channel_1_no_response_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:761:9 + | +761 | pub fn with_channel_1_no_response_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:767:9 + | +767 | pub fn channel_1_collision_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:772:9 + | +772 | pub fn with_channel_1_collision_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:778:9 + | +778 | pub fn channel_1_buffer_overrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:783:9 + | +783 | pub fn with_channel_1_buffer_overrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:789:9 + | +789 | pub fn channel_1_buffer_underrrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:794:9 + | +794 | pub fn with_channel_1_buffer_underrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:800:9 + | +800 | pub fn channel_2_read_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:805:9 + | +805 | pub fn with_channel_2_read_status(mut self, read_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:811:9 + | +811 | pub fn channel_2_write_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:816:9 + | +816 | pub fn with_channel_2_write_status(mut self, write_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:822:9 + | +822 | pub fn channel_2_no_response_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:827:9 + | +827 | pub fn with_channel_2_no_response_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:833:9 + | +833 | pub fn channel_2_collision_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:838:9 + | +838 | pub fn with_channel_2_collision_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:844:9 + | +844 | pub fn channel_2_buffer_overrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:849:9 + | +849 | pub fn with_channel_2_buffer_overrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:855:9 + | +855 | pub fn channel_2_buffer_underrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:860:9 + | +860 | pub fn with_channel_2_buffer_underrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:866:9 + | +866 | pub fn channel_3_read_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:871:9 + | +871 | pub fn with_channel_3_read_status(mut self, read_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:877:9 + | +877 | pub fn channel_3_write_status(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:882:9 + | +882 | pub fn with_channel_3_write_status(mut self, write_status: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:888:9 + | +888 | pub fn channel_3_no_response_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:893:9 + | +893 | pub fn with_channel_3_no_response_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:899:9 + | +899 | pub fn channel_3_collision_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:904:9 + | +904 | pub fn with_channel_3_collision_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:910:9 + | +910 | pub fn channel_3_buffer_overrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:915:9 + | +915 | pub fn with_channel_3_buffer_overrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:921:9 + | +921 | pub fn channel_3_buffer_underrun_error(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:926:9 + | +926 | pub fn with_channel_3_buffer_underrun_error(mut self, error: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/serial_interface.rs:934:5 + | +934 | pub struct ExternalClockLock(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:944:9 + | +944 | pub fn new() -> Self { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for an associated function + --> src/mmio/serial_interface.rs:949:9 + | +949 | pub fn read() -> Self { + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:953:9 + | +953 | pub fn write(self) { + | ^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:958:9 + | +958 | pub fn thirty_two_mhz_clock_lock(self) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a method + --> src/mmio/serial_interface.rs:963:9 + | +963 | pub fn with_thirty_two_mhz_clock_lock(mut self, lock: bool) -> Self { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:4:1 + | +4 | pub struct VerticalTimingControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:5:1 + | +5 | pub const VERTICAL_TIMING_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:9:1 + | +9 | pub struct DisplayConfig(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:10:1 + | +10 | pub const DISPLAY_CONFIG_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:14:1 + | +14 | pub struct HorizontalTimingZero(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:15:1 + | +15 | pub const HORIZONTAL_TIMING_ZERO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:19:1 + | +19 | pub struct HorizontalTimingOne(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:20:1 + | +20 | pub const HORIZONTAL_TIMING_ONE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:24:1 + | +24 | pub struct BlankingLines(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:25:1 + | +25 | pub const ODD_VERTICAL_TIMING_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:27:1 + | +27 | pub const EVEN_VERTICAL_TIMING_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:31:1 + | +31 | pub struct BurstInterval(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:32:1 + | +32 | pub const ODD_BURST_BLANKING_INTERVAL_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:34:1 + | +34 | pub const EVEN_BURST_BLANKING_INTERVAL_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:38:1 + | +38 | pub struct TopFieldBase(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:39:1 + | +39 | pub const TOP_FIELD_BASE_REGISTER_L: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:42:1 + | +42 | pub const TOP_FIELD_BASE_REGISTER_R: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:46:1 + | +46 | pub struct BottomFieldBase(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:47:1 + | +47 | pub const BOTTOM_FIELD_BASE_REGISTER_L: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:50:1 + | +50 | pub const BOTTOM_FIELD_BASE_REGISTER_R: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:54:1 + | +54 | pub struct ScreenPosition(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:55:1 + | +55 | pub const CURRENT_VERTICAL_POSITION: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:57:1 + | +57 | pub const CURRENT_HORIZONTAL_POSITION: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:61:1 + | +61 | pub struct DisplayInterrupt(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:62:1 + | +62 | pub const DISPLAY_INTERRUPT_ZERO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:64:1 + | +64 | pub const DISPLAY_INTERRUPT_ONE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:66:1 + | +66 | pub const DISPLAY_INTERRUPT_TWO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:68:1 + | +68 | pub const DISPLAY_INTERRUPT_THREE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:72:1 + | +72 | pub struct DisplayLatchControl(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:73:1 + | +73 | pub const DISPLAY_LATCH_REGISTER_ZERO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:75:1 + | +75 | pub const DISPLAY_LATCH_REGISTER_ONE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:79:1 + | +79 | pub struct ScalerControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:80:1 + | +80 | pub const SCALING_WIDTH_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:84:1 + | +84 | pub struct ScalingControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:85:1 + | +85 | pub const HORIZONTAL_SCALING_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:89:1 + | +89 | pub struct FilterCoefficents(u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:90:1 + | +90 | pub const FILTER_COEFFICENT_TABLE_ZERO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:92:1 + | +92 | pub const FILTER_COEFFICENT_TABLE_ONE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:94:1 + | +94 | pub const FILTER_COEFFICENT_TABLE_TWO: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:96:1 + | +96 | pub const FILTER_COEFFICENT_TABLE_THREE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:98:1 + | +98 | pub const FILTER_COEFFICENT_TABLE_FOUR: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:100:1 + | +100 | pub const FILTER_COEFFICENT_TABLE_FIVE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:102:1 + | +102 | pub const FILTER_COEFFICENT_TABLE_SIX: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:105:1 + | +105 | pub const UNKNOWN_ANTIALIASING: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:109:1 + | +109 | pub struct VideoClockControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:110:1 + | +110 | pub const VIDEO_CLOCK_SELECT_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:114:1 + | +114 | pub struct VideoSelect(u16); + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:115:1 + | +115 | pub const VIDEO_DTV_SELECT_REGISTER: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:119:1 + | +119 | pub struct BorderHBEControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:120:1 + | +120 | pub const BORDER_HBE: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a struct + --> src/mmio/vi.rs:124:1 + | +124 | pub struct BorderHBSControl(u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:125:1 + | +125 | pub const BORDER_HBS: VolAddress = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:128:1 + | +128 | pub const UNUSED_ZERO: VolAddress = unsafe { VolAddress::new(0xCC00_2076) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:129:1 + | +129 | pub const UNUSED_ONE: VolAddress = unsafe { VolAddress::new(0xCC00_2078) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a constant + --> src/mmio/vi.rs:130:1 + | +130 | pub const UNUSED_TWO: VolAddress = unsafe { VolAddress::new(0xCC00_207C) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: `ogc-rs` (lib) generated 995 warnings (87 duplicates) (run `cargo clippy --fix --lib -p ogc-rs` to apply 3 suggestions) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.77s diff --git a/ogc-sys/src/ogc.rs b/ogc-sys/src/ogc.rs index 8d2731f..5dc7441 100644 --- a/ogc-sys/src/ogc.rs +++ b/ogc-sys/src/ogc.rs @@ -4043,6 +4043,10 @@ extern "C" { #[doc = "void GX_GetTexObjLOD(const GXTexObj* obj, f32 *minlod, f32 *maxlod)\n Returns the min and max LOD values for the texture object _obj._\n\n > **Note:** Use GX_InitTexObjLOD(), GX_InitTexObjMinLOD() or GX_InitTexObjMaxLOD()\n to initialize the texture minimum and maximum LOD.\n\n # Arguments\n\n* `obj` (direction in) - ptr to a texture object\n * `minlod` (direction out) - minimum LOD value from 0.0 - 10.0 inclusive\n * `maxlod` (direction out) - maximum LOD value from 0.0 - 10.0 inclusive\n\n # Returns\n\nnone"] pub fn GX_GetTexObjLOD(obj: *const GXTexObj, minlod: *mut f32_, maxlod: *mut f32_); } +extern "C" { + #[doc = "void GX_GetTexObjFilterMode(const GXTexObj* obj, u8 *minfilt, u8 *magfilt)\n Returns the filter mode for the texture object _obj._\n\n > **Note:** Use GX_InitTexObjLOD() or GX_InitTexObjFilterMode() to initialize the\n texture filter mode.\n\n # Arguments\n\n* `obj` (direction in) - ptr to a texture object\n * `minfilt` (direction out) - minification filter mode; will be one of texfilter\n * `maxfilt` (direction out) - magnification filter mode; will be _GX_NEAR_ or _GX_LINEAR_\n\n # Returns\n\nnone"] + pub fn GX_GetTexObjFilterMode(obj: *const GXTexObj, minfilt: *mut u8_, magfilt: *mut u8_); +} extern "C" { #[doc = "void GX_GetTexObjAll(const GXTexObj* obj, void** image_ptr, u16* width, u16* height, u8* format, u8* wrap_s, u8* wrap_t, u8* mipmap);\n Returns the parameters described by a texture object. Texture objects are used to describe all the parameters associated with a texture, including size, format, wrap modes, filter modes, etc. Texture objects are initialized using either GX_InitTexObj() or, for color index format textures, GX_InitTexObjCI().\n\n # Arguments\n\n* `obj` (direction in) - ptr to a texture object\n * `image_ptr` (direction out) - Returns a physical pointer to the image data for a texture.\n * `width` (direction out) - Returns the width of the texture or LOD 0 for mipmaps\n * `height` (direction out) - Returns the height of the texture or LOD 0 for mipmaps\n * `format` (direction out) - Returns the texel format\n * `mipmap` (direction out) - Returns the mipmap enable flag.\n\n # Returns\n\nnone"] pub fn GX_GetTexObjAll( diff --git a/src/gx/mod.rs b/src/gx/mod.rs index 841fdeb..e629a93 100644 --- a/src/gx/mod.rs +++ b/src/gx/mod.rs @@ -2366,3 +2366,260 @@ pub enum ColorChannel { Color0 = ffi::GX_COLOR0, Color1 = ffi::GX_COLOR1, } + +pub mod experimental { + use core::alloc::Layout; + + use aliasable::boxed::AliasableBox; + use alloc::boxed::Box; + use bit_field::BitField; + use num_traits::ToBytes; + + use crate::{ + mmio::command_processor::{ + read_fifo_base, write_fifo_base, write_fifo_end, write_fifo_high_watermark, + write_fifo_low_watermark, write_fifo_read_addr, write_fifo_read_write_distance, + write_fifo_write_addr, AlignedPhysPtr, Clear, Control, + }, + print, println, + }; + + use super::GX_PIPE; + + pub struct Fifo { + buffer: AliasableBox<[u8; SIZE]>, + high_watermark_index: usize, + low_watermark_index: usize, + read_write_distance: u32, + write_index: usize, + read_index: usize, + breakpoint_index: Option, + } + + #[derive(Copy, Clone, Debug)] + pub enum Error { + InvalidSize, + InvalidLayout, + NotEnoughMemory, + BufferTooBig, + WriteIndexOutOfRange, + MisalignedPtr, + IndexOutOfRange, + InvalidFifoPair, + } + + pub unsafe fn move_to_write_pipe_address(address: usize) { + debug_assert!(core::mem::size_of::() == core::mem::size_of::()); + + core::arch::asm!("mtspr 921,{}", in(reg) address); + } + + pub unsafe fn enable_write_pipe() { + let mut hid2: usize; + core::arch::asm!("mfspr {},920", out(reg) hid2); + + hid2.set_bit(30, true); + + core::arch::asm!("mtspr 920,{}", in(reg) hid2); + } + + impl Fifo { + pub fn new() -> Result { + const HIGH_WATERMARK: usize = 16 * 1024; + const MIN_SIZE: usize = 64 * 1024; + + if SIZE < MIN_SIZE { + println!("[ERROR]: SIZE must be at least {}", MIN_SIZE); + return Err(Error::InvalidSize); + } + + if SIZE.next_multiple_of(32) != SIZE { + println!("[ERROR]: SIZE is not a multiple of 32"); + return Err(Error::InvalidSize); + } + + let buffer = { + let layout = Layout::from_size_align(SIZE, 32).map_err(|_| Error::InvalidLayout)?; + let ptr = unsafe { alloc::alloc::alloc(layout) }; + if ptr.is_null() { + return Err(Error::NotEnoughMemory); + } + + unsafe { Box::from_raw(ptr.cast::<[u8; SIZE]>()) } + }; + + Ok(Self { + buffer: AliasableBox::from_unique(buffer), + high_watermark_index: SIZE.checked_sub(HIGH_WATERMARK).ok_or(Error::InvalidSize)?, + low_watermark_index: SIZE / 2, + read_write_distance: 0, + write_index: 0, + read_index: 0, + breakpoint_index: None, + }) + } + + pub fn set_as_cpu_fifo(&mut self) -> Result<(), Error> { + critical_section::with(|_| { + //Disable Command Processor linking and interrupts + Control::read() + .with_link_enable(false) + .with_underflow_interrupt_enable(false) + .with_overflow_interrupt_enable(true) + .write(); + + let start_ptr = AlignedPhysPtr::from_virtual(self.buffer.as_mut_ptr()) + .unwrap() + .as_mut_ptr(); + + let end_ptr = AlignedPhysPtr::from_virtual(unsafe { + self.buffer.as_mut_ptr().add(self.buffer.len()) + }) + .unwrap() + .as_mut_ptr(); + + let write_ptr = AlignedPhysPtr::from_virtual(unsafe { + self.buffer.as_mut_ptr().add(self.write_index) + }) + .unwrap() + .as_mut_ptr(); + + if start_ptr.align_offset(32) != 0 + || end_ptr.align_offset(32) != 0 + || write_ptr.align_offset(32) != 0 + { + return Err(Error::MisalignedPtr); + } + + // SAFETY: + // All ptrs are in physical space: ptr.addr() <= 0x1FFF_FFFF + // All ptrs are 32 byte aligned: ptr.align_offset(32) == 0 + + unsafe { + crate::mmio::pi::CPU_FIFO_START.write(start_ptr); + crate::mmio::pi::CPU_FIFO_END.write(end_ptr); + crate::mmio::pi::CPU_FIFO_WRITE_PTR.write(write_ptr); + } + + Ok(()) + }) + } + + pub fn set_as_gpu_fifo(&mut self) -> Result<(), Error> { + critical_section::with(|_| { + //Disable Command Processor read, linking and interrupts + Control::read() + .with_read_enable(false) + .with_link_enable(false) + .with_underflow_interrupt_enable(false) + .with_overflow_interrupt_enable(false) + .write(); + + unsafe { + write_fifo_base( + AlignedPhysPtr::from_virtual(self.buffer.as_mut_ptr()).unwrap(), + ); + + write_fifo_end( + AlignedPhysPtr::from_virtual( + self.buffer.as_mut_ptr().add(self.buffer.len()), + ) + .unwrap(), + ); + write_fifo_high_watermark( + AlignedPhysPtr::from_virtual( + self.buffer.as_mut_ptr().add(self.high_watermark_index), + ) + .unwrap(), + ); + write_fifo_low_watermark( + AlignedPhysPtr::from_virtual( + self.buffer.as_mut_ptr().add(self.low_watermark_index), + ) + .unwrap(), + ); + + write_fifo_read_write_distance(self.read_write_distance); + + write_fifo_read_addr( + AlignedPhysPtr::from_virtual(self.buffer.as_mut_ptr().add(self.read_index)) + .unwrap(), + ); + + write_fifo_write_addr( + AlignedPhysPtr::from_virtual( + self.buffer.as_mut_ptr().add(self.write_index), + ) + .unwrap(), + ); + + //Re-enable reading from the fifo + Control::read().with_read_enable(true).write(); + } + + Ok(()) + }) + } + + pub unsafe fn load_bp_reg(&mut self, register_index: u8, value: &[u8; 4]) { + self.write_bytes(&[0x61, register_index, value[1], value[2], value[3]]); + } + + pub unsafe fn load_cp_reg(&mut self, register_index: u8, value: &[u8; 4]) { + self.write_bytes(&[0x08, register_index, value[0], value[1], value[2], value[3]]); + } + + pub unsafe fn load_xf_reg(&mut self, register_index: u16, value: &[u8; 4]) { + let reg_bytes = u32::from(register_index).to_be_bytes(); + self.write_bytes(&[ + 0x10, + reg_bytes[0], + reg_bytes[1], + reg_bytes[2], + reg_bytes[3], + value[0], + value[1], + value[2], + value[3], + ]); + } + + pub unsafe fn set_copy_clear(&mut self, colors: &[u8; 4], z: u32) { + let [r, g, b, a] = colors; + self.load_bp_reg(0x4f, &[0, 0, *r, *g]); + self.load_bp_reg(0x50, &[0, 0, *b, *a]); + self.load_bp_reg(0x51, &z.to_be_bytes()); + } + + pub fn link_cpu_gpu_fifo(&mut self) -> Result<(), Error> { + critical_section::with(|_| { + let pi_ptr = crate::mmio::pi::CPU_FIFO_START.read(); + let (high, low) = unsafe { read_fifo_base().split() }; + + println!("{:?}, {:?}", high, low); + + if pi_ptr == unsafe { read_fifo_base().as_mut_ptr() } { + //Clear underflow and overflow + Clear::new() + .with_clear_overflow(true) + .with_clear_underflow(true) + .write(); + Control::read() + .with_read_enable(true) + .with_link_enable(true) + .write(); + + Ok(()) + } else { + return Err(Error::InvalidFifoPair); + } + }) + } + + pub fn write_bytes(&mut self, bytes: &[u8]) { + for byte in bytes { + GX_PIPE.write(*byte); + } + } + } +} diff --git a/src/lib.rs b/src/lib.rs index ff6e4f9..820bae2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,11 +22,12 @@ #![feature(negative_impls)] #![feature(slice_ptr_get)] #![feature(allocator_api)] -#![feature(strict_provenance)] #![feature(asm_experimental_arch)] extern crate alloc; +pub mod pad; + /// Interprocess Control / IOS Implementation /// /// This module provides various low level functions to help with opening and using the underlying @@ -115,6 +116,67 @@ cfg_if::cfg_if! { } } +mod interrupts { + use bit_field::BitField; + + fn get_msr() -> u32 { + let msr: u32; + unsafe { core::arch::asm!("mfmsr {}", out(reg) msr) }; + msr + } + + fn set_msr(msr: u32) { + unsafe { core::arch::asm!("mtmsr {}", in(reg) msr) }; + } + + pub fn disable() -> u32 { + let restore_state = get_msr(); + let mut msr = restore_state; + // Set External Interrupts false + msr.set_bit(15, false); + set_msr(msr); + return restore_state; + } + + pub fn enable(restore_state: u32) { + set_msr(restore_state); + } +} + +#[cfg(feature = "critical-section-wii")] +mod sync { + use bit_field::BitField; + + struct WiiCriticalSection; + + critical_section::set_impl!(WiiCriticalSection); + + fn get_msr() -> u32 { + let msr: u32; + unsafe { core::arch::asm!("mfmsr {}", out(reg) msr) }; + msr + } + + fn set_msr(msr: u32) { + unsafe { core::arch::asm!("mtmsr {}", in(reg) msr) }; + } + + unsafe impl critical_section::Impl for WiiCriticalSection { + unsafe fn acquire() -> critical_section::RawRestoreState { + let restore_state = get_msr(); + let mut msr = restore_state; + // Set External Interrupts false + msr.set_bit(15, false); + set_msr(msr); + restore_state + } + + unsafe fn release(restore_state: critical_section::RawRestoreState) { + set_msr(restore_state); + } + } +} + ///Prelude pub mod prelude { // alloc Export @@ -140,3 +202,18 @@ pub mod prelude { #[global_allocator] static GLOBAL_ALLOCATOR: OGCAllocator = OGCAllocator; } + +mod test { + + struct Func(fn(Args) -> Ret); + + impl Func { + fn cast(self) -> Func { + unsafe { core::mem::transmute(self) } + } + + unsafe fn call(&self, args: Args) -> Ret { + (self.0)(args) + } + } +} diff --git a/src/mmio/command_processor.rs b/src/mmio/command_processor.rs index 641e589..b1e2bfd 100644 --- a/src/mmio/command_processor.rs +++ b/src/mmio/command_processor.rs @@ -1,9 +1,10 @@ #![warn(missing_docs)] #![warn(clippy::pedantic)] +use bit_field::BitField; use voladdress::{Safe, VolAddress}; -pub use types::{Clear, Control, Status}; +pub use types::{AlignedPhysPtr, AlignedPhysPtrHigh, AlignedPhysPtrLow, Clear, Control, Status}; const BASE: usize = 0xCC00_0000; @@ -14,7 +15,6 @@ const CONTROL_REGISTER: VolAddress = unsafe { VolAddress::n const CLEAR_REGISTER: VolAddress = unsafe { VolAddress::new(BASE + 0x4) }; const PERFORMANCE_SELECT: VolAddress = unsafe { VolAddress::new(BASE + 0x6) }; - const TOKEN: VolAddress = unsafe { VolAddress::new(BASE + 0xE) }; const BOUNDING_BOX_LEFT: VolAddress = unsafe { VolAddress::new(BASE + 0x10) }; @@ -25,24 +25,28 @@ const BOUNDING_BOX_TOP: VolAddress = unsafe { VolAddress::new(B const BOUNDING_BOX_BOTTOM: VolAddress = unsafe { VolAddress::new(BASE + 0x16) }; -const FIFO_BASE_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x20) }; +const FIFO_BASE_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x20) }; -const FIFO_BASE_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x22) }; +const FIFO_BASE_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x22) }; -const FIFO_END_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x24) }; +const FIFO_END_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x24) }; -const FIFO_END_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x26) }; +const FIFO_END_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x26) }; -const FIFO_HIGH_WATERMARK_ADDRESS_LOW: VolAddress = +const FIFO_HIGH_WATERMARK_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x28) }; -const FIFO_HIGH_WATERMARK_ADDRESS_HIGH: VolAddress = +const FIFO_HIGH_WATERMARK_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x2A) }; -const FIFO_LOW_WATERMARK_ADDRESS_LOW: VolAddress = +const FIFO_LOW_WATERMARK_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x2C) }; -const FIFO_LOW_WATERMARK_ADDRESS_HIGH: VolAddress = +const FIFO_LOW_WATERMARK_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x2E) }; const FIFO_READ_WRITE_DISTANCE_LOW: VolAddress = @@ -51,19 +55,22 @@ const FIFO_READ_WRITE_DISTANCE_LOW: VolAddress = const FIFO_READ_WRITE_DISTANCE_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x32) }; -const FIFO_WRITE_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x34) }; +const FIFO_WRITE_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x34) }; -const FIFO_WRITE_ADDRESS_HIGH: VolAddress = +const FIFO_WRITE_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x36) }; -const FIFO_READ_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x38) }; +const FIFO_READ_ADDRESS_LOW: VolAddress = + unsafe { VolAddress::new(BASE + 0x38) }; -const FIFO_READ_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x3A) }; +const FIFO_READ_ADDRESS_HIGH: VolAddress = + unsafe { VolAddress::new(BASE + 0x3A) }; -const FIFO_BREAKPOINT_ADDRESS_LOW: VolAddress = +const FIFO_BREAKPOINT_ADDRESS_LOW: VolAddress = unsafe { VolAddress::new(BASE + 0x3C) }; -const FIFO_BREAKPOINT_ADDRESS_HIGH: VolAddress = +const FIFO_BREAKPOINT_ADDRESS_HIGH: VolAddress = unsafe { VolAddress::new(BASE + 0x3E) }; const TRANSFORM_RASTER_BUSY_COUNT_LOW: VolAddress = @@ -117,9 +124,75 @@ const CLOCKS_PER_VERTEX_IN_COUNT_HIGH: VolAddress = const CLOCKS_PER_VERTEX_OUT_COUNT: VolAddress = unsafe { VolAddress::new(BASE + 0x64) }; +pub unsafe fn read_fifo_base() -> AlignedPhysPtr { + let low = FIFO_BASE_ADDRESS_LOW.read(); + let high = FIFO_BASE_ADDRESS_HIGH.read(); + + AlignedPhysPtr::::from_raw_parts(high, low) +} + +pub unsafe fn write_fifo_base(ptr: AlignedPhysPtr) { + let (high, low) = ptr.split(); + + FIFO_BASE_ADDRESS_LOW.write(low); + FIFO_BASE_ADDRESS_HIGH.write(high); +} + +pub unsafe fn write_fifo_end(ptr: AlignedPhysPtr) { + let (high, low) = ptr.split(); + + FIFO_END_ADDRESS_LOW.write(low); + FIFO_END_ADDRESS_HIGH.write(high); +} + +pub unsafe fn write_fifo_high_watermark(ptr: AlignedPhysPtr) { + let (high, low) = ptr.split(); + + FIFO_HIGH_WATERMARK_ADDRESS_LOW.write(low); + FIFO_HIGH_WATERMARK_ADDRESS_HIGH.write(high); +} + +pub unsafe fn write_fifo_low_watermark(ptr: AlignedPhysPtr) { + let (high, low) = ptr.split(); + + FIFO_LOW_WATERMARK_ADDRESS_LOW.write(low); + FIFO_LOW_WATERMARK_ADDRESS_HIGH.write(high); +} + +pub unsafe fn write_fifo_write_addr(ptr: AlignedPhysPtr) { + let (high, low) = ptr.split(); + + FIFO_WRITE_ADDRESS_LOW.write(low); + FIFO_WRITE_ADDRESS_HIGH.write(high); +} + +pub unsafe fn write_fifo_read_addr(ptr: AlignedPhysPtr) { + let (high, low) = ptr.split(); + + FIFO_READ_ADDRESS_LOW.write(low); + FIFO_READ_ADDRESS_HIGH.write(high); +} + +pub unsafe fn write_fifo_read_write_distance(distance: u32) { + debug_assert!(distance == 0 || distance % 32 == 0); + + let (high, low) = { + ( + u16::try_from(distance.get_bits(0..=15)).unwrap(), + u16::try_from(distance.get_bits(16..=31)).unwrap(), + ) + }; + + FIFO_READ_WRITE_DISTANCE_LOW.write(low); + FIFO_READ_WRITE_DISTANCE_HIGH.write(high); +} + pub(crate) mod types { + use bit_field::BitField; + use crate::mem; + use super::{CLEAR_REGISTER, CONTROL_REGISTER, STATUS_REGISTER}; #[repr(transparent)] @@ -202,7 +275,7 @@ pub(crate) mod types { CONTROL_REGISTER.write(self); } - pub fn read_enable(&self) -> bool { + pub fn read_enable(self) -> bool { self.0.get_bit(0) } @@ -211,7 +284,7 @@ pub(crate) mod types { self } - pub fn breakpoint_enable(&self) -> bool { + pub fn breakpoint_enable(self) -> bool { self.0.get_bit(1) } @@ -220,7 +293,7 @@ pub(crate) mod types { self } - pub fn overflow_interrupt_enable(&self) -> bool { + pub fn overflow_interrupt_enable(self) -> bool { self.0.get_bit(2) } @@ -229,7 +302,7 @@ pub(crate) mod types { self } - pub fn underflow_interrupt_enable(&self) -> bool { + pub fn underflow_interrupt_enable(self) -> bool { self.0.get_bit(3) } @@ -238,7 +311,7 @@ pub(crate) mod types { self } - pub fn link_enable(&self) -> bool { + pub fn link_enable(self) -> bool { self.0.get_bit(4) } @@ -247,7 +320,7 @@ pub(crate) mod types { self } - pub fn breakpoint_interrupt_enable(&self) -> bool { + pub fn breakpoint_interrupt_enable(self) -> bool { self.0.get_bit(5) } @@ -277,7 +350,7 @@ pub(crate) mod types { CLEAR_REGISTER.write(self); } - pub fn clear_overflow(&self) -> bool { + pub fn clear_overflow(self) -> bool { self.0.get_bit(0) } @@ -286,7 +359,7 @@ pub(crate) mod types { self } - pub fn clear_underflow(&self) -> bool { + pub fn clear_underflow(self) -> bool { self.0.get_bit(1) } @@ -295,7 +368,7 @@ pub(crate) mod types { self } - pub fn clear_metrics(&self) -> bool { + pub fn clear_metrics(self) -> bool { self.0.get_bit(2) } @@ -304,4 +377,57 @@ pub(crate) mod types { self } } + + #[repr(transparent)] + #[derive(Copy, Clone, Debug)] + pub struct AlignedPhysPtrHigh(u16); + + #[repr(transparent)] + #[derive(Copy, Clone, Debug)] + pub struct AlignedPhysPtrLow(u16); + + #[repr(transparent)] + #[derive(Copy, Clone, Debug)] + pub struct AlignedPhysPtr(*mut T); + + impl AlignedPhysPtr { + pub fn from_virtual(ptr: *mut T) -> Option> { + if ptr.align_offset(32) != 0 { + None + } else { + Some(AlignedPhysPtr(ptr.map_addr(mem::to_physical))) + } + } + + pub fn split(self) -> (AlignedPhysPtrHigh, AlignedPhysPtrLow) { + debug_assert!(core::mem::size_of::() == core::mem::size_of::()); + let addr_with_provenance = self.0.expose_provenance(); + let high = u16::try_from(addr_with_provenance.get_bits(16..=31)).ok(); + let low = u16::try_from(addr_with_provenance.get_bits(0..=15)).ok(); + + ( + AlignedPhysPtrHigh(high.unwrap()), + AlignedPhysPtrLow(low.unwrap()), + ) + } + + pub fn from_raw_parts( + high: AlignedPhysPtrHigh, + low: AlignedPhysPtrLow, + ) -> AlignedPhysPtr { + debug_assert!(core::mem::size_of::() == core::mem::size_of::()); + let mut val = 0usize; + + let ptr = core::ptr::with_exposed_provenance_mut( + *val.set_bits(0..=15, low.0.into()) + .set_bits(16..=31, high.0.into()), + ); + + AlignedPhysPtr(ptr) + } + + pub fn as_mut_ptr(&mut self) -> *mut T { + self.0 + } + } } diff --git a/src/network.rs b/src/network.rs index d75e482..a112d4a 100644 --- a/src/network.rs +++ b/src/network.rs @@ -438,3 +438,62 @@ impl Drop for Socket { } } } + +mod experimental { + use core::ffi::c_int; + + use crate::ios::{self, Mode}; + + struct SocketParams { + domain: c_int, + r#type: c_int, + protocol: c_int, + } + + struct ConnectParams { + socket: c_int, + has_addr: u32, + addr: [u8; 28], + } + + #[repr(C)] + struct SocketAddress { + socket_address_length: u8, + socket_address_family: u8, + socket_address_data: [u8; 14], + } + + type sockaddr = SocketAddress; + + pub fn socket(domain: c_int, r#type: c_int, protocol: c_int) { + let mut bytes = [0u8; 12]; + bytes[0..4].copy_from_slice(&domain.to_be_bytes()); + bytes[4..8].copy_from_slice(&r#type.to_be_bytes()); + bytes[8..12].copy_from_slice(&protocol.to_be_bytes()); + + const IOCTL_SO_SOCKET: c_int = 0xF; + + if let Ok(fd) = ios::open(c"/dev/net/ip/top", Mode::None) { + ios::ioctl(fd, IOCTL_SO_SOCKET, &bytes, &mut []).unwrap() + } + } + + fn connect(sockfd: c_int, sockaddr: *const sockaddr, len: u32) { + let mut bytes = [0u8; 36]; + bytes[0..4].copy_from_slice(&sockfd.to_be_bytes()); + bytes[4..8].copy_from_slice(&1u32.to_be_bytes()); + + unsafe { + bytes[8..11].copy_from_slice(&[ + (*sockaddr).socket_address_length, + (*sockaddr).socket_address_family, + ]); + bytes[11..26].copy_from_slice(&(*sockaddr).socket_address_data); + } + + const IOCTL_SO_CONNECT: c_int = 0x4; + if let Ok(fd) = ios::open(c"/dev/net/ip/top", Mode::None) { + ios::ioctl(fd, IOCTL_SO_CONNECT, &bytes, &mut []).unwrap() + } + } +} diff --git a/src/pad.rs b/src/pad.rs new file mode 100644 index 0000000..65bd47e --- /dev/null +++ b/src/pad.rs @@ -0,0 +1,412 @@ +use core::cell::Cell; + +use bit_field::BitField; +use critical_section::Mutex; + +use crate::mmio::serial_interface::{ + types::{ + CommuicationStatus, InputBufferHigh, InputBufferLow, OutputBuffer, PollingRegister, Status, + }, + INPUT_OUTPUT_BUFFER, +}; + +#[derive(Debug, Copy, Clone)] +pub enum Channel { + Zero, + One, + Two, + Three, +} + +impl From for u32 { + fn from(value: Channel) -> Self { + match value { + Channel::Zero => 0, + Channel::One => 1, + Channel::Two => 2, + Channel::Three => 3, + } + } +} + +#[derive(Debug, Copy, Clone)] +pub enum Error { + NoResponse, + Collision, + BufferUnderrun, + BufferOverrun, + Unknown, + NoAvailableChannel, +} + +pub fn transfer(channel: Channel, input_buf: &[u8], output_buf: &mut [u8]) -> Result<(), Error> { + // Output = Us + // Input = Controller + let command_transfer = CommuicationStatus::new() + .with_channel(channel.into()) + .with_output_length( + u32::try_from(input_buf.len()).expect("input buf length is larger then u32::MAX"), + ) + .with_input_length( + u32::try_from(output_buf.len()).expect("output buf length is larger then u32::MAX"), + ) + .with_transfer_start(true); + + for (index, chunk) in input_buf.chunks(4).enumerate() { + if let Some(addr) = INPUT_OUTPUT_BUFFER.get(index) { + addr.write(u32::from_be_bytes([ + *chunk.first().unwrap_or(&0), + *chunk.get(1).unwrap_or(&0), + *chunk.get(2).unwrap_or(&0), + *chunk.get(3).unwrap_or(&0), + ])); + } + } + + command_transfer.write(); + while CommuicationStatus::read().transfer_start() { + core::hint::spin_loop(); + } + + match CommuicationStatus::read().communication_error() { + false => { + for (index, chunk) in output_buf.chunks_mut(4).enumerate() { + if let Some(addr) = INPUT_OUTPUT_BUFFER.get(index) { + let bytes = addr.read().to_be_bytes(); + + if let Some(val) = chunk.get_mut(0) { + *val = bytes[0] + } + + if let Some(val) = chunk.get_mut(1) { + *val = bytes[1] + } + + if let Some(val) = chunk.get_mut(2) { + *val = bytes[2] + } + + if let Some(val) = chunk.get_mut(3) { + *val = bytes[3] + } + } + } + + Ok(()) + } + true => status_error(channel), + } +} + +fn status_error(channel: Channel) -> Result<(), Error> { + let status = Status::read(); + match channel { + Channel::Zero => { + if status.channel_0_no_response_error() { + Err(Error::NoResponse) + } else if status.channel_0_collision_error() { + Err(Error::Collision) + } else if status.channel_0_buffer_underrun_error() { + Err(Error::BufferUnderrun) + } else if status.channel_0_buffer_overrun_error() { + Err(Error::BufferOverrun) + } else { + Err(Error::Unknown) + } + } + Channel::One => { + if status.channel_1_no_response_error() { + Err(Error::NoResponse) + } else if status.channel_1_collision_error() { + Err(Error::Collision) + } else if status.channel_1_buffer_underrrun_error() { + Err(Error::BufferUnderrun) + } else if status.channel_1_buffer_overrun_error() { + Err(Error::BufferOverrun) + } else { + Err(Error::Unknown) + } + } + Channel::Two => { + if status.channel_2_no_response_error() { + Err(Error::NoResponse) + } else if status.channel_2_collision_error() { + Err(Error::Collision) + } else if status.channel_2_buffer_underrun_error() { + Err(Error::BufferUnderrun) + } else if status.channel_2_buffer_overrun_error() { + Err(Error::BufferOverrun) + } else { + Err(Error::Unknown) + } + } + Channel::Three => { + if status.channel_3_no_response_error() { + Err(Error::NoResponse) + } else if status.channel_3_collision_error() { + Err(Error::Collision) + } else if status.channel_3_buffer_underrun_error() { + Err(Error::BufferUnderrun) + } else if status.channel_3_buffer_overrun_error() { + Err(Error::BufferOverrun) + } else { + Err(Error::Unknown) + } + } + } +} + +pub fn get_type(channel: Channel) -> Result<[u8; 3], Error> { + const CMD_TYPE_AND_STATUS: u8 = 0; + let mut data = [0u8; 3]; + + transfer( + channel, + core::slice::from_ref(&CMD_TYPE_AND_STATUS), + &mut data, + ) + .map(|()| Ok(data))? +} + +pub fn get_origin(channel: Channel) -> Result<[u8; 10], Error> { + const CMD_READ_ORIGIN: u8 = 0x41; + let mut data = [0u8; 10]; + + transfer(channel, core::slice::from_ref(&CMD_READ_ORIGIN), &mut data).map(|()| Ok(data))? +} + +pub fn recalibrate(channel: Channel) -> Result<[u8; 10], Error> { + const CMD_RECALIBRATE: u8 = 0x42; + let mut data = [0u8; 10]; + + transfer(channel, core::slice::from_ref(&CMD_RECALIBRATE), &mut data).map(|()| Ok(data))? +} + +pub fn set_analog_mode(channel: Channel, mode: u8) -> Result<(), Error> { + debug_assert!(mode < 8); + let command = OutputBuffer::new() + .with_command_opcode(0x40) + .with_output_zero(mode.into()); + match channel { + Channel::Zero => command.write_zero(), + Channel::One => command.write_one(), + Channel::Two => command.write_two(), + Channel::Three => command.write_three(), + } + + let status = Status::read(); + status.with_output_buffer_write(true).write(); + + Ok(()) +} + +#[derive(Debug)] +pub struct Controller { + channel: Channel, +} + +#[derive(Debug)] +pub struct State { + pub a: bool, + pub b: bool, + pub x: bool, + pub y: bool, + pub start: bool, + pub dpad_left: bool, + pub dpad_right: bool, + pub dpad_down: bool, + pub dpad_up: bool, + pub z: bool, + pub r: bool, + pub l: bool, + pub stick_x: i8, + pub stick_y: i8, + pub sub_stick_x: i8, + pub sub_stick_y: i8, + pub analog_l: u8, + pub analog_r: u8, +} + +static AVAILABLE_CHANNELS: Mutex; 4]>> = Mutex::new(Cell::new([ + Some(Channel::Zero), + Some(Channel::One), + Some(Channel::Two), + Some(Channel::Three), +])); + +impl Controller { + pub fn new() -> Result { + let mut si = None; + critical_section::with(|cs| { + let mut available_channels = AVAILABLE_CHANNELS.borrow(cs).get(); + + available_channels.iter_mut().for_each(|channel| { + if channel.is_some() && get_type(channel.unwrap()).is_ok() { + si = channel.take(); + } + }); + + AVAILABLE_CHANNELS.borrow(cs).set(available_channels); + }); + + if si.is_none() { + return Err(Error::NoAvailableChannel); + } + + let channel = si.unwrap(); + let _type = get_type(channel)?; + set_analog_mode(channel, 3)?; + + //Enable polling for channel + //Copy on Write instead of Copy on Vblank + let poll = PollingRegister::read(); + match channel { + Channel::Zero => { + poll.with_channel_0_copy_on_vblank(false) + .with_channel_0_enable(true) + .write(); + } + Channel::One => { + poll.with_channel_1_copy_on_vblank(false) + .with_channel_1_enable(true) + .write(); + } + Channel::Two => { + poll.with_channel_2_copy_on_vblank(false) + .with_channel_2_enable(true) + .write(); + } + Channel::Three => { + poll.with_channel_3_copy_on_vblank(false) + .with_channel_3_enable(true) + .write(); + } + } + + Ok(Self { channel }) + } + + pub fn raw(&self) -> [u8; 8] { + let input_high = match self.channel { + Channel::Zero => InputBufferHigh::read_zero(), + Channel::One => InputBufferHigh::read_one(), + Channel::Two => InputBufferHigh::read_two(), + Channel::Three => InputBufferHigh::read_three(), + }; + + debug_assert!( + !input_high.error_status() && !input_high.error_latch(), + "Should not be able to get an error from just reading data in theory", + ); + + let input_low = match self.channel { + Channel::Zero => InputBufferLow::read_zero(), + Channel::One => InputBufferLow::read_one(), + Channel::Two => InputBufferLow::read_two(), + Channel::Three => InputBufferLow::read_three(), + }; + + [ + u8::try_from(input_high.input_zero()).unwrap(), + u8::try_from(input_high.input_one()).unwrap(), + u8::try_from(input_high.input_two()).unwrap(), + u8::try_from(input_high.input_three()).unwrap(), + u8::try_from(input_low.input_four()).unwrap(), + u8::try_from(input_low.input_five()).unwrap(), + u8::try_from(input_low.input_six()).unwrap(), + u8::try_from(input_low.input_seven()).unwrap(), + ] + } + + pub fn state(&self) -> State { + let raw = self.raw(); + Self::state_from_bytes(raw) + } + + fn remap_stick_state(state: u8) -> i8 { + i8::try_from(i16::from(state) - 128).unwrap() + } + + fn state_from_bytes(raw: [u8; 8]) -> State { + State { + a: raw[0].get_bit(0), + b: raw[0].get_bit(1), + x: raw[0].get_bit(2), + y: raw[0].get_bit(3), + start: raw[0].get_bit(4), + dpad_left: raw[1].get_bit(0), + dpad_right: raw[1].get_bit(1), + dpad_down: raw[1].get_bit(2), + dpad_up: raw[1].get_bit(3), + z: raw[1].get_bit(4), + r: raw[1].get_bit(5), + l: raw[1].get_bit(6), + stick_x: Self::remap_stick_state(raw[2]), + stick_y: Self::remap_stick_state(raw[3]), + sub_stick_x: Self::remap_stick_state(raw[4]), + sub_stick_y: Self::remap_stick_state(raw[5]), + analog_l: raw[6], + analog_r: raw[7], + } + } + + pub fn read(&self) -> Result { + let status = Status::read(); + let has_new_data = match self.channel { + Channel::Zero => status.channel_0_read_status(), + Channel::One => status.channel_1_read_status(), + Channel::Two => status.channel_2_read_status(), + Channel::Three => status.channel_3_read_status(), + }; + + let input_high = match self.channel { + Channel::Zero => InputBufferHigh::read_zero(), + Channel::One => InputBufferHigh::read_one(), + Channel::Two => InputBufferHigh::read_two(), + Channel::Three => InputBufferHigh::read_three(), + }; + match !has_new_data && !input_high.error_status() && !input_high.error_latch() { + false => Err(status_error(self.channel).expect_err("Didn't get a known error")), + true => { + let input_low = match self.channel { + Channel::Zero => InputBufferLow::read_zero(), + Channel::One => InputBufferLow::read_one(), + Channel::Two => InputBufferLow::read_two(), + Channel::Three => InputBufferLow::read_three(), + }; + + Ok(Self::state_from_bytes([ + u8::try_from(input_high.input_zero()).unwrap(), + u8::try_from(input_high.input_one()).unwrap(), + u8::try_from(input_high.input_two()).unwrap(), + u8::try_from(input_high.input_three()).unwrap(), + u8::try_from(input_low.input_four()).unwrap(), + u8::try_from(input_low.input_five()).unwrap(), + u8::try_from(input_low.input_six()).unwrap(), + u8::try_from(input_low.input_seven()).unwrap(), + ])) + } + } + } + + pub fn copy_on_vblank(&mut self) -> &mut Self { + let poll = PollingRegister::read(); + + match self.channel { + Channel::Zero => { + poll.with_channel_0_copy_on_vblank(true).write(); + } + Channel::One => { + poll.with_channel_1_copy_on_vblank(true).write(); + } + Channel::Two => { + poll.with_channel_2_copy_on_vblank(true).write(); + } + Channel::Three => { + poll.with_channel_3_copy_on_vblank(true).write(); + } + } + + self + } +} From ca3e832c387d5cb3434bdeea5031f856cb6e4578 Mon Sep 17 00:00:00 2001 From: ProfElements Date: Mon, 31 Mar 2025 17:01:24 -0500 Subject: [PATCH 5/5] :wip: --- Cargo.toml | 2 +- examples/colored-tri/Cargo.lock | 31 ++- examples/colored-tri/Cargo.toml | 4 + examples/colored-tri/src/main.rs | 79 ++++++- examples/ios/Cargo.lock | 9 + ogc-sys/src/ogc.rs | 40 +++- src/arch.rs | 173 ++++++++++++++ src/gx/mod.rs | 390 +++++++++++++++++++++++++++++++ src/lib.rs | 11 +- src/sync/mod.rs | 133 +++++++++++ 10 files changed, 843 insertions(+), 29 deletions(-) create mode 100644 src/arch.rs create mode 100644 src/sync/mod.rs diff --git a/Cargo.toml b/Cargo.toml index daebec1..49d326d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ libc = "0.2" ogc-sys = { path = "./ogc-sys/"} glam = { version = "0.19.0", default-features = false, features = ["libm"], optional = true } voladdress = "1.4" -bit_field = "0.10.1" +bit_field = { version = "0.10.1", default-features = false } num-traits = { version = "0.2.19", default-features = false, features = ["libm"] } critical-section = { version = "1.2.0", default-features = false } aliasable = { version = "0.1.3", default-features = false, features = ["alloc"] } diff --git a/examples/colored-tri/Cargo.lock b/examples/colored-tri/Cargo.lock index afa71ec..50b1042 100644 --- a/examples/colored-tri/Cargo.lock +++ b/examples/colored-tri/Cargo.lock @@ -12,12 +12,15 @@ dependencies = [ ] [[package]] +<<<<<<< Updated upstream name = "aliasable" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] +======= +>>>>>>> Stashed changes name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -42,7 +45,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.66", + "syn 2.0.96", "which", ] @@ -97,12 +100,15 @@ dependencies = [ ] [[package]] +<<<<<<< Updated upstream name = "critical-section" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] +======= +>>>>>>> Stashed changes name = "doxygen-rs" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -257,7 +263,10 @@ dependencies = [ "bit_field", "bitflags 1.3.2", "cfg-if", +<<<<<<< Updated upstream "critical-section", +======= +>>>>>>> Stashed changes "libc", "num-traits", "num_enum", @@ -311,7 +320,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] @@ -330,23 +339,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -439,9 +448,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -452,7 +461,11 @@ dependencies = [ name = "template" version = "0.1.0" dependencies = [ +<<<<<<< Updated upstream "bitfrob", +======= + "bit_field", +>>>>>>> Stashed changes "ogc-rs", ] diff --git a/examples/colored-tri/Cargo.toml b/examples/colored-tri/Cargo.toml index 7501951..8e72458 100644 --- a/examples/colored-tri/Cargo.toml +++ b/examples/colored-tri/Cargo.toml @@ -9,5 +9,9 @@ dev = { panic = "abort" } release = { panic = "abort", lto = true, codegen-units = 1, strip = "symbols", opt-level = "s" } [dependencies] +<<<<<<< Updated upstream bitfrob = "1.3.2" +======= +bit_field = { version = "0.10.2", default-features = false } +>>>>>>> Stashed changes ogc-rs = { path = "../../", features = ["ffi"] } diff --git a/examples/colored-tri/src/main.rs b/examples/colored-tri/src/main.rs index 0c5ebc1..0858500 100644 --- a/examples/colored-tri/src/main.rs +++ b/examples/colored-tri/src/main.rs @@ -1,11 +1,13 @@ #![no_std] -#![feature(start)] - +#![no_main] use core::mem::ManuallyDrop; +use bit_field::BitField; +use ogc_rs::ffi::GX_TEXMAP_NULL; use ogc_rs::{ ffi::{ GX_CLR_RGBA, GX_COLOR0A0, GX_PASSCLR, GX_POS_XYZ, GX_RGBA8, GX_S16, GX_TEXCOORDNULL, +<<<<<<< Updated upstream GX_TEXMAP_NULL, GX_VA_CLR0, GX_VA_POS, TB_BUS_CLOCK, }, gu::{Gu, RotationAxis}, @@ -13,14 +15,22 @@ use ogc_rs::{ experimental::{enable_write_pipe, move_to_write_pipe_address, Fifo}, types::VtxDest, CmpFn, Color, CullMode, Gx, Primitive, ProjectionType, VtxAttr, +======= + GX_VA_CLR0, GX_VA_POS, TB_BUS_CLOCK, + }, + gu::{Gu, RotationAxis}, + gx::{ + experimental::Fifo, types::VtxDest, CmpFn, Color, CullMode, Gx, Primitive, ProjectionType, + VtxAttr, +>>>>>>> Stashed changes }, video::Video, }; extern crate alloc; -#[start] -fn main(_argc: isize, _argv: *const *const u8) -> isize { +#[no_mangle] +fn main() { let vi = Video::init(); let mut config = Video::get_preferred_mode(); @@ -28,7 +38,65 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize { unsafe { Video::set_next_framebuffer(vi.framebuffer) }; Video::set_black(false); Video::flush(); + // + // let fifo = ManuallyDrop::new(Gx::init(256 * 1024)); + // // Set values to use when video is flipped / cleared + + let mut fifo = ManuallyDrop::new(Fifo::new(256 * 1024).expect("Fifo building failed")); + fifo.init(); + + const TB_BUS_CLOCK: u32 = 243000000; + let res = TB_BUS_CLOCK / 500; + + fifo.write_bp_register(0x0f, 0xff); + fifo.write_bp_register(0x69, *(res >> 11 & 0x00_FF_FF_FF).set_bit(10, true)); + + fifo.write_bp_register(0x0f, 0xff); + fifo.write_bp_register(0x46, *(res / 4224).set_bit(9, true)); + + for i in 0..8 { + fifo.write_cp_register(0x80 + i, 0x8000_0000); + } + + fifo.write_xf_register(0x1000, 0x3f); + fifo.write_xf_register(0x1012, 0x1); + fifo.write_bp_register(0x58, 0x0f); + + fifo.write_cp_register(0x20, 0x00); + fifo.write_xf_register(0x1006, 0x00); + + fifo.write_bp_register(0x23, 0x00); + fifo.write_bp_register(0x24, 0x00); + fifo.write_bp_register(0x67, 0x00); + + fifo.write_bp_register(0x0f, 0x00); + + fifo.write_bp_register(0x8c, 0x0d8000); + fifo.write_bp_register(0x90, 0x0dc000); + fifo.write_bp_register(0x8d, 0x0d8800); + fifo.write_bp_register(0x91, 0x0dc800); + fifo.write_bp_register(0x8e, 0x0d9000); + fifo.write_bp_register(0x92, 0x0dd000); + fifo.write_bp_register(0x8f, 0x0d9800); + fifo.write_bp_register(0x93, 0x0dd800); + + // Set_TextureImage0-3, GXTexMapID=4-7 tmem_offset=00010000, cache_width=32 kb, cache_height=32 kb, image_type=cached + fifo.write_bp_register(0xac, 0x0da000); + fifo.write_bp_register(0xb0, 0x0dc400); + fifo.write_bp_register(0xad, 0x0da800); + fifo.write_bp_register(0xb1, 0x0dcc00); + fifo.write_bp_register(0xae, 0x0db000); + fifo.write_bp_register(0xb2, 0x0dd400); + fifo.write_bp_register(0xaf, 0x0db800); + fifo.write_bp_register(0xb3, 0x0ddc00); + + fifo.set_copy_clear(Color::with_alpha(0x0, 0x0, 0x0, 0xff), 0x00_FF_FF_FF); + + fifo.flush(); + + loop {} +<<<<<<< Updated upstream // let fifo = ManuallyDrop::new(Gx::init(256 * 1024)); let mut fifo = ManuallyDrop::new(Fifo::<262144>::new().unwrap()); fifo.set_as_cpu_fifo().unwrap(); @@ -91,6 +159,9 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize { for index in 0xac..=0xaf { fifo.load_bp_reg(index, &default_tex_reg.to_be_bytes()); } +======= + Gx::set_copy_clear(Color::new(0x00, 0x00, 0x00), 0x00_FF_FF_FF); +>>>>>>> Stashed changes for index in 0xb0..=0xb3 { fifo.load_bp_reg(index, &default_tex_reg.to_be_bytes()); diff --git a/examples/ios/Cargo.lock b/examples/ios/Cargo.lock index 205732c..8546eab 100644 --- a/examples/ios/Cargo.lock +++ b/examples/ios/Cargo.lock @@ -12,12 +12,15 @@ dependencies = [ ] [[package]] +<<<<<<< Updated upstream name = "aliasable" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] +======= +>>>>>>> Stashed changes name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -91,12 +94,15 @@ dependencies = [ ] [[package]] +<<<<<<< Updated upstream name = "critical-section" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] +======= +>>>>>>> Stashed changes name = "doxygen-rs" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -251,7 +257,10 @@ dependencies = [ "bit_field", "bitflags 1.3.2", "cfg-if", +<<<<<<< Updated upstream "critical-section", +======= +>>>>>>> Stashed changes "libc", "num-traits", "num_enum", diff --git a/ogc-sys/src/ogc.rs b/ogc-sys/src/ogc.rs index 5dc7441..86751d4 100644 --- a/ogc-sys/src/ogc.rs +++ b/ogc-sys/src/ogc.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ #[repr(C)] #[derive(Default)] @@ -3634,11 +3634,11 @@ extern "C" { pub fn GX_SetTevOp(tevstage: u8_, mode: u8_); } extern "C" { - #[doc = "void GX_SetTevColor(u8 tev_regid,GXColor color)\n Used to set one of the primary color registers in the TEV unit.\n\n \n\nThese registers are available to all TEV stages. At least one of these registers is used to pass the output of one TEV stage to\n the next in a multi-texture configuration. The application is responsible for allocating these registers so that no collisions in usage occur.\n\n > **Note:** This function can only set unsigned 8-bit colors. To set signed, 10-bit colors use GX_SetTevColorS10().\n\n # Arguments\n\n* `tev_regid` (direction in) - tevcoloutreg.\n * `color` (direction in) - Constant color value.\n\n # Returns\n\nnone"] + #[doc = "void GX_SetTevColor(u8 tev_regid,GXColor color)\n Used to set one of the primary color registers in the TEV unit.\n\n \n\nThese registers are available to all TEV stages. At least one of these registers is used to pass the output of one TEV stage to\n the next in a multi-texture configuration. The application is responsible for allocating these registers so that no collisions in usage occur.\n\n > **Note:** This function can only set unsigned 8-bit colors. To set signed, 10-bit colors use GX_SetTevColorS10().\n\n # Arguments\n\n* `tev_regid` (direction in) - tevcoloutreg. Only GX_TEVREG0, GX_TEVREG1 and GX_TEVREG2 are supported.\n * `color` (direction in) - Constant color value.\n\n # Returns\n\nnone"] pub fn GX_SetTevColor(tev_regid: u8_, color: GXColor); } extern "C" { - #[doc = "void GX_SetTevColorS10(u8 tev_regid,GXColorS10 color)\n Used to set one of the constant color registers in the TEV unit.\n\n \n\nThese registers are available to all TEV stages. At least one of these registers is used to pass the output of one TEV stage to the\n next in a multi-texture configuration. The application is responsible for allocating these registers so that no collisions in usage occur.\n\n > **Note:** This function enables the color components to be signed 10-bit numbers. To set 8-bit unsigned colors (the common case), use GX_SetTevColor().\n\n # Arguments\n\n* `tev_regid` (direction in) - tevcoloutreg.\n * `color` (direction in) - Constant color value in S10 format.\n\n # Returns\n\nnone"] + #[doc = "void GX_SetTevColorS10(u8 tev_regid,GXColorS10 color)\n Used to set one of the constant color registers in the TEV unit.\n\n \n\nThese registers are available to all TEV stages. At least one of these registers is used to pass the output of one TEV stage to the\n next in a multi-texture configuration. The application is responsible for allocating these registers so that no collisions in usage occur.\n\n > **Note:** This function enables the color components to be signed 10-bit numbers. To set 8-bit unsigned colors (the common case), use GX_SetTevColor().\n\n # Arguments\n\n* `tev_regid` (direction in) - tevcoloutreg. Only GX_TEVREG0, GX_TEVREG1 and GX_TEVREG2 are supported.\n * `color` (direction in) - Constant color value in S10 format.\n\n # Returns\n\nnone"] pub fn GX_SetTevColorS10(tev_regid: u8_, color: GXColorS10); } extern "C" { @@ -3743,7 +3743,7 @@ extern "C" { pub fn GX_SetNumChans(num: u8_); } extern "C" { - #[doc = "void GX_SetTevOrder(u8 tevstage,u8 texcoord,u32 texmap,u8 color)\n Specifies the texture and rasterized color that will be available as inputs to this TEV _tevstage._\n\n The texture coordinate _texcoord_ is generated from input attributes using the GX_SetTexCoordGen() function and is used to look up the\n texture map, previously loaded by GX_LoadTexObj(). The _color_ to rasterize for this _tevstage_ is also specified. The color\n is the result of per-vertex lighting which is controlled by GX_SetChanCtrl().\n\n This function will scale the normalized texture coordinates produced by GX_SetTexCoordGen() according to the size of the texture map in the\n function call. For this reason, texture coordinates can only be broadcast to multiple texture maps if and only if the maps are the same size. In\n some cases, you may want to generate a texture coordinate having a certain scale, but disable the texture lookup (this comes up when generating\n texture coordinates for indirect bump mapping). To accomplish this, use the GX_TEXMAP_DISABLE flag:\n\n GX_SetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP3 | GX_TEXMAP_DISABLE, GX_COLORNULL); \n\nThis will scale GX_TEXCOORD0 using GX_TEXMAP3 but disable the lookup of GX_TEXMAP3.\n\n > **Note:** This function does not enable the TEV stage. To enable a consecutive number of TEV stages, starting at stage GX_TEVSTAGE0, use GX_SetNumTevStages().

\n\n > **Note:** The operation of each TEV stage is independent. The color operations are controlled by GX_SetTevColorIn() and GX_SetTevColorOp(). The alpha\n operations are controlled by GX_SetTevAlphaIn() and GX_SetTevAlphaOp().

\n\n > **Note:** The number of texture coordinates available for all the active TEV stages is set using GX_SetNumTexGens(). The number of color channels\n available for all the active TEV stages is set using GX_SetNumChans(). Active TEV stages should not reference more texture coordinates or colors\n than are being generated.

\n\n > **Note:** There are some special settings for the _color_ argument. If you specify GX_COLOR_ZERO, you always get zero as rasterized color. If you specify\n GX_ALPHA_BUMP or GX_ALPHA_BUMPN, you can use \"Bump alpha\" component from indirect texture unit as rasterized color input (see GX_SetTevIndirect()\n for details about how to configure bump alpha). Since bump alpha contains only 5-bit data, GX_ALPHA_BUMP shifts them to higher bits, which makes the\n value range 0-248. Meanwhile GX_ALPHA_BUMPN performs normalization and you can get the value range 0-255.\n\n # Arguments\n\n* `tevstage` (direction in) - tevstage\n * `texcoord` (direction in) - texcoordid\n * `texmap` (direction in) - texmapid\n * `color` (direction in) - channelid\n\n # Returns\n\nnone"] + #[doc = "void GX_SetTevOrder(u8 tevstage,u8 texcoord,u32 texmap,u8 color)\n Specifies the texture and rasterized color that will be available as inputs to this TEV _tevstage._\n\n The texture coordinate _texcoord_ is generated from input attributes using the GX_SetTexCoordGen() function and is used to look up the\n texture map, previously loaded by GX_LoadTexObj(). The _color_ to rasterize for this _tevstage_ is also specified. The color\n is the result of per-vertex lighting which is controlled by GX_SetChanCtrl().\n\n This function will scale the normalized texture coordinates produced by GX_SetTexCoordGen() according to the size of the texture map in the\n function call. For this reason, texture coordinates can only be broadcast to multiple texture maps if and only if the maps are the same size. In\n some cases, you may want to generate a texture coordinate having a certain scale, but disable the texture lookup (this comes up when generating\n texture coordinates for indirect bump mapping). To accomplish this, use the GX_TEXMAP_DISABLE flag:\n\n GX_SetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP3 | GX_TEXMAP_DISABLE, GX_COLORNULL); \n\nThis will scale GX_TEXCOORD0 using GX_TEXMAP3 but disable the lookup of GX_TEXMAP3.\n\n > **Note:** This function does not enable the TEV stage. To enable a consecutive number of TEV stages, starting at stage GX_TEVSTAGE0, use GX_SetNumTevStages().

\n\n > **Note:** The operation of each TEV stage is independent. The color operations are controlled by GX_SetTevColorIn() and GX_SetTevColorOp(). The alpha\n operations are controlled by GX_SetTevAlphaIn() and GX_SetTevAlphaOp().

\n\n > **Note:** The number of texture coordinates available for all the active TEV stages is set using GX_SetNumTexGens(). The number of color channels\n available for all the active TEV stages is set using GX_SetNumChans(). Active TEV stages should not reference more texture coordinates or colors\n than are being generated.

\n\n > **Note:** There are some special settings for the _color_ argument. If you specify GX_COLORZERO, you always get zero as rasterized color. If you specify\n GX_ALPHA_BUMP or GX_ALPHA_BUMPN, you can use \"Bump alpha\" component from indirect texture unit as rasterized color input (see GX_SetTevIndirect()\n for details about how to configure bump alpha). Since bump alpha contains only 5-bit data, GX_ALPHA_BUMP shifts them to higher bits, which makes the\n value range 0-248. Meanwhile GX_ALPHA_BUMPN performs normalization and you can get the value range 0-255.\n\n # Arguments\n\n* `tevstage` (direction in) - tevstage\n * `texcoord` (direction in) - texcoordid\n * `texmap` (direction in) - texmapid\n * `color` (direction in) - channelid\n\n # Returns\n\nnone"] pub fn GX_SetTevOrder(tevstage: u8_, texcoord: u8_, texmap: u32_, color: u8_); } extern "C" { @@ -3767,7 +3767,7 @@ extern "C" { pub fn GX_SetTevKAlphaSel(tevstage: u8_, sel: u8_); } extern "C" { - #[doc = "void GX_SetTevKColorS10(u8 sel, GXColorS10 col)\n Used to set one of the constant color registers in the Texture Environment (TEV) unit.\n\n \n\nThese registers are available to all TEV stages. At least one of these registers is used to pass the output of one TEV stage to the next\n in a multi-texture configuration.\n\n > **Note:** The application is responsible for allocating these registers so that no collisions in usage occur.

\n\n > **Note:** This function takes 10-bit signed values as color values; use GX_SetTevColor() to give 8-bit values.\n\n # Arguments\n\n* `sel` (direction in) - tevcoloutreg\n * `col` (direction in) - constant color value\n\n # Returns\n\nnone"] + #[doc = "void GX_SetTevKColorS10(u8 sel, GXColorS10 col)\n Used to set one of the constant color registers in the Texture Environment (TEV) unit.\n\n \n\nThese registers are available to all TEV stages. At least one of these registers is used to pass the output of one TEV stage to the next\n in a multi-texture configuration.\n\n > **Note:** The application is responsible for allocating these registers so that no collisions in usage occur.

\n\n > **Note:** This function takes 10-bit signed values as color values; use GX_SetTevColor() to give 8-bit values.\n\n # Arguments\n\n* `sel` (direction in) - tevkcolorid\n * `col` (direction in) - constant color value\n\n # Returns\n\nnone"] pub fn GX_SetTevKColorS10(sel: u8_, col: GXColorS10); } extern "C" { @@ -4773,6 +4773,13 @@ pub type _flock_t = _LOCK_RECURSIVE_T; pub struct __locale_t { _unused: [u8; 0], } +extern "C" { + pub fn memset( + arg1: *mut ::libc::c_void, + arg2: ::libc::c_int, + arg3: ::libc::c_ulong, + ) -> *mut ::libc::c_void; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _Bigint { @@ -6090,29 +6097,42 @@ pub struct sha_context { pub lower_length: u32_, } extern "C" { + #[doc = "s32 SHA_Init(void)\n Initializes the SHA1 subsystem. This call could be done in the early stages of your main()\n\n # Returns\n\n0 or higher on success, otherwise the returned error code"] pub fn SHA_Init() -> s32; } extern "C" { + #[doc = "s32 SHA_Close(void)\n Closes the SHA1 subsystem handlers. This call could be done when exiting your application or before reloading IOS\n\n # Returns\n\n0 or higher on success, otherwise the returned error code"] pub fn SHA_Close() -> s32; } extern "C" { - pub fn SHA_InitializeContext(context: *mut sha_context) -> s32; -} -extern "C" { + #[doc = "s32 SHA_Calculate(const void* data, const u32 data_size, void* message_digest)\n Calculates the SHA1 hash of the given data, and puts it in message_digest\n\n # Arguments\n\n* `data` (direction in) - pointer to the data to hash. if it is not 64-byte aligned an internal buffer will be used\n * `data_size` (direction in) - size of the data to hash\n * `message_digest` (direction out) - pointer to where to write the hash to\n\n # Returns\n\n0 or higher on success, otherwise the returned error code"] pub fn SHA_Calculate( - context: *mut sha_context, data: *const ::libc::c_void, data_size: u32_, message_digest: *mut ::libc::c_void, ) -> s32; } extern "C" { + #[doc = "s32 SHA_InitializeContext(sha_context* context)\n Initializes the given sha context\n\n # Arguments\n\n* `context` (direction in) - pointer to the sha_context to initialize\n\n # Returns\n\n0 or higher on success, otherwise the returned error code"] + pub fn SHA_InitializeContext(context: *const sha_context) -> s32; +} +extern "C" { + #[doc = "s32 SHA_Input(const sha_context* context, const void* data, const u32 data_size)\n Adds data to the given sha_context and hashes it\n\n # Arguments\n\n* `context` (direction in) - pointer to the sha_context to use\n * `data` (direction in) - pointer to the data to hash. if it is not 64-byte aligned an internal buffer will be used\n * `data_size` (direction in) - size of the data to hash\n\n # Returns\n\n0 or higher on success, otherwise the returned error code"] pub fn SHA_Input( - context: *mut sha_context, + context: *const sha_context, data: *const ::libc::c_void, data_size: u32_, ) -> s32; } +extern "C" { + #[doc = "s32 SHA_Finalize(const sha_context* context, const void* data, const u32 data_size, void* message_digest)\n Calculates the final SHA1 hash of the given context and last data, and puts it in message_digest\n\n # Arguments\n\n* `context` (direction in) - pointer to the sha_context to use\n * `data` (direction in) - pointer to the data to hash. if it is not 64-byte aligned an internal buffer will be used\n * `data_size` (direction in) - size of the data to hash\n * `message_digest` (direction out) - pointer to where to write the final SHA1 hash to\n\n # Returns\n\n0 or higher on success, otherwise the returned error code"] + pub fn SHA_Finalize( + context: *const sha_context, + data: *const ::libc::c_void, + data_size: u32_, + message_digest: *mut ::libc::c_void, + ) -> s32; +} extern "C" { pub fn AES_Init() -> s32; } diff --git a/src/arch.rs b/src/arch.rs new file mode 100644 index 0000000..a830d3e --- /dev/null +++ b/src/arch.rs @@ -0,0 +1,173 @@ +use voladdress::{Safe, VolAddress}; + +pub unsafe fn move_to_machine_state_register(value: MachineStateRegister) { + core::arch::asm!("mtmsr {VALUE}", VALUE = in(reg) value.bits()); +} + +pub unsafe fn move_from_machine_state_register() -> MachineStateRegister { + let value: u32; + + core::arch::asm!("mfmsr {VALUE}", VALUE = out(reg) value); + + MachineStateRegister::from_bits_truncate(value) +} + +pub unsafe fn disable_interrupts() -> MachineStateRegister { + let mut register = unsafe { move_from_machine_state_register() }; + let ret = register; + + register.remove(MachineStateRegister::EE); + unsafe { move_to_machine_state_register(register) }; + + ret +} + +pub unsafe fn enable_interrupts() { + let mut register = unsafe { move_from_machine_state_register() }; + register.insert(MachineStateRegister::EE); + unsafe { move_to_machine_state_register(register) }; +} + +pub fn with_interrupts_disabled(func: impl FnOnce() -> R) -> R { + let msr = unsafe { disable_interrupts() }; + + let r = func(); + + if msr.contains(MachineStateRegister::EE) { + unsafe { enable_interrupts() }; + } + + r +} + +bitflags::bitflags! { + pub struct MachineStateRegister: u32 { + const LE = 1 << 0; + const RI = 1 << 1; + const PM = 1 << 2; + const DR = 1 << 4; + const IR = 1 << 5; + const IP = 1 << 6; + const FE1 = 1 << 8; + const BE = 1 << 9; + const SE = 1 << 10; + const FE0 = 1 << 11; + const ME = 1 << 12; + const FP = 1 << 13; + const PR = 1 << 14; + /// External Interrupt Enable + const EE = 1 << 15; + const ILE = 1 << 16; + const POW = 1 << 18; + } +} + +mod allocator { + use core::{ + alloc::Layout, + ptr::NonNull, + sync::atomic::{AtomicPtr, Ordering}, + }; + + pub struct Allocator; + pub struct AllocatorError; + + static MEM1_START: AtomicPtr = AtomicPtr::new(core::ptr::null_mut()); + static MEM2_START: AtomicPtr = AtomicPtr::new(core::ptr::null_mut()); + static MEM1_END: AtomicPtr = AtomicPtr::new(core::ptr::null_mut()); + static MEM2_END: AtomicPtr = AtomicPtr::new(core::ptr::null_mut()); + + impl Allocator { + pub fn allocate(&self, layout: Layout) -> Result, AllocatorError> { + if let Some(ptr) = self.try_mem1_allocate(layout) { + MEM1_START.store( + ptr.as_ptr().cast::().wrapping_add(layout.size()), + Ordering::Relaxed, + ); + return Ok(ptr); + } + + if let Some(ptr) = self.try_mem2_allocate(layout) { + MEM2_START.store( + ptr.as_ptr().cast::().wrapping_add(layout.size()), + Ordering::Relaxed, + ); + return Ok(ptr); + } + + Err(AllocatorError) + } + + pub unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) {} + + fn try_allocate( + &self, + layout: Layout, + region_start: *mut u8, + region_end: *const u8, + ) -> Option> { + let size = layout.size(); + let align = layout.align(); + + let mut ptr = region_start; + let offset = ptr.align_offset(align); + ptr = ptr.wrapping_add(offset); + + let ptr_end = ptr.wrapping_add(size); + + if ptr_end.addr() >= region_end.addr() { + None + } else { + Some(NonNull::slice_from_raw_parts(NonNull::new(ptr)?, size)) + } + } + + fn try_mem1_allocate(&self, layout: Layout) -> Option> { + let _ = MEM1_START.compare_exchange_weak( + core::ptr::null_mut(), + super::MEM1_START.read(), + Ordering::SeqCst, + Ordering::Relaxed, + ); + let _ = MEM1_END.compare_exchange_weak( + core::ptr::null_mut(), + super::MEM1_END.read().cast_mut(), + Ordering::SeqCst, + Ordering::Relaxed, + ); + + self.try_allocate( + layout, + MEM1_START.load(Ordering::Relaxed), + MEM1_END.load(Ordering::Relaxed), + ) + } + + fn try_mem2_allocate(&self, layout: Layout) -> Option> { + let _ = MEM2_START.compare_exchange_weak( + core::ptr::null_mut(), + super::MEM2_START.read(), + Ordering::SeqCst, + Ordering::Relaxed, + ); + let _ = MEM2_END.compare_exchange_weak( + core::ptr::null_mut(), + super::MEM2_END.read().cast_mut(), + Ordering::SeqCst, + Ordering::Relaxed, + ); + + self.try_allocate( + layout, + MEM2_START.load(Ordering::Relaxed), + MEM2_END.load(Ordering::Relaxed), + ) + } + } +} + +const MEM1_START: VolAddress<*mut u8, Safe, Safe> = unsafe { VolAddress::new(0x8000_310C) }; +const MEM1_END: VolAddress<*const u8, Safe, Safe> = unsafe { VolAddress::new(0x8000_3110) }; + +const MEM2_START: VolAddress<*mut u8, Safe, Safe> = unsafe { VolAddress::new(0x8000_3124) }; +const MEM2_END: VolAddress<*const u8, Safe, Safe> = unsafe { VolAddress::new(0x8000_3128) }; diff --git a/src/gx/mod.rs b/src/gx/mod.rs index e629a93..33038f3 100644 --- a/src/gx/mod.rs +++ b/src/gx/mod.rs @@ -2368,6 +2368,7 @@ pub enum ColorChannel { } pub mod experimental { +<<<<<<< Updated upstream use core::alloc::Layout; use aliasable::boxed::AliasableBox; @@ -2623,3 +2624,392 @@ pub mod experimental { } } } +======= + use core::{alloc::Layout, pin::Pin}; + + use ::alloc::boxed::Box; + use alloc::alloc; + use bit_field::BitField; + + use crate::{ + arch, + mmio::{ + command_processor::{self, AlignedPhysPtr, Clear, Control}, + processor_interface, + }, + }; + + use super::Color; + + pub struct Fifo { + buffer: Pin>, + low_watermark_idx: usize, + high_watermark_idx: usize, + read_write_dist: usize, + read_idx: usize, + write_idx: usize, + } + + #[derive(Debug)] + pub struct Error; + + impl Fifo { + pub fn new(size: usize) -> Result { + let size = size.next_multiple_of(32); + let layout = Layout::from_size_align(size, 32).map_err(|_| Error)?; + let ptr = unsafe { alloc::alloc(layout) }; + + if ptr.is_null() { + return Err(Error); + } + + let buffer = unsafe { + Pin::new(Box::from_raw(core::ptr::slice_from_raw_parts_mut( + ptr, size, + ))) + }; + + Ok(Fifo { + buffer, + low_watermark_idx: size - 16384, + high_watermark_idx: size >> 1, + read_write_dist: 0, + read_idx: 0, + write_idx: 0, + }) + } + + pub fn init(&mut self) { + unsafe { + self.set_as_processor_interface_fifo(); + self.set_as_command_processor_fifo(); + self.link_fifo(); + + // Enable write gather pipe + let hid2: u32; + core::arch::asm!("mtspr 921, {WPAR}", WPAR = in(reg) 0x0C00_8000); + core::arch::asm!("mfspr {HID2}, 920", HID2 = out(reg) hid2); + core::arch::asm!("mtspr 920, {NEW_HID2}", NEW_HID2 = in(reg) hid2 | 0x4000_0000); + } + } + + pub fn write_bp_register(&mut self, bp_reg_idx: u8, value: u32) { + let gather_pipe_u32: *mut u32 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + let gather_pipe_u8: *mut u8 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + let val = *0u32 + .set_bits(24..=31, bp_reg_idx.into()) + .set_bits(0..=23, value); + + unsafe { + gather_pipe_u8.write_volatile(0x61); + gather_pipe_u32.write_volatile(val) + }; + } + + pub fn write_cp_register(&mut self, reg_idx: u8, value: u32) { + let gather_pipe_u32: *mut u32 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + let gather_pipe_u8: *mut u8 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + + unsafe { + gather_pipe_u8.write_volatile(0x08); + gather_pipe_u8.write_volatile(reg_idx); + gather_pipe_u32.write_volatile(value) + }; + } + + pub fn write_xf_register(&mut self, reg_idx: u16, value: u32) { + let gather_pipe_u32: *mut u32 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + let gather_pipe_u8: *mut u8 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + + unsafe { + gather_pipe_u8.write_volatile(0x10); + gather_pipe_u32.write_volatile(reg_idx.into()); + gather_pipe_u32.write_volatile(value) + }; + } + + pub fn set_copy_clear(&mut self, color: Color, z_val: u32) { + self.write_bp_register( + 0x4f, + *0u32 + .set_bits(0..8, color.0.r.into()) + .set_bits(8..16, color.0.a.into()), + ); + self.write_bp_register( + 0x59, + *0u32 + .set_bits(0..8, color.0.b.into()) + .set_bits(8..16, color.0.g.into()), + ); + self.write_bp_register(0x51, z_val); + } + + pub fn flush(&mut self) { + let gather_pipe_u32: *mut u32 = core::ptr::with_exposed_provenance_mut(0xCC00_8000); + + for _ in 0..8 { + unsafe { gather_pipe_u32.write_volatile(0u32) }; + } + } + + pub fn set_as_processor_interface_fifo(&mut self) { + // TODO: Make sure to disable interrupts while handling mmio + + arch::with_interrupts_disabled(|| { + // Disable command processor underflow and overflow interrupts + Control::read() + .with_overflow_interrupt_enable(false) + .with_underflow_interrupt_enable(false) + .write(); + + let fifo_base = self.buffer.as_ptr().cast::(); + let fifo_end = self + .buffer + .as_ptr() + .cast::() + .wrapping_add(self.buffer.len()); + + let fifo_write_ptr = self + .buffer + .as_mut_ptr() + .cast::() + .wrapping_add(self.write_idx); + + unsafe { + processor_interface::write_fifo_base( + AlignedPhysPtr::try_from_ptr(fifo_base).unwrap(), + ); + processor_interface::write_fifo_end( + AlignedPhysPtr::try_from_ptr(fifo_end).unwrap(), + ); + processor_interface::write_fifo_write_ptr( + AlignedPhysPtr::new(fifo_write_ptr).unwrap(), + ); + + core::arch::asm!("sc"); + + // TODO: and Reenable them + } + }); + } + + pub unsafe fn set_as_command_processor_fifo(&mut self) { + // TODO: Make sure to disable interrupts while handling mmio + + arch::with_interrupts_disabled(|| { + // Disable Interrupts and Command Processor reading + Control::read() + .with_read_enable(false) + .with_overflow_interrupt_enable(false) + .with_underflow_interrupt_enable(false) + .write(); + + let fifo_base = self.buffer.as_mut().as_mut_ptr(); + + let fifo_end = self + .buffer + .as_mut() + .as_mut_ptr() + .wrapping_add(self.buffer.len()); + + let fifo_low_watermark = self + .buffer + .as_mut() + .as_mut_ptr() + .wrapping_add(self.low_watermark_idx); + + let fifo_high_watermark = self + .buffer + .as_mut() + .as_mut_ptr() + .wrapping_add(self.low_watermark_idx); + + let fifo_write_ptr = self + .buffer + .as_mut() + .as_mut_ptr() + .wrapping_add(self.write_idx); + + let fifo_read_ptr = self + .buffer + .as_mut() + .as_mut_ptr() + .wrapping_add(self.read_idx); + + command_processor::write_fifo_base(AlignedPhysPtr::new(fifo_base).unwrap()); + command_processor::write_fifo_end(AlignedPhysPtr::new(fifo_end).unwrap()); + command_processor::write_fifo_low_watermark( + AlignedPhysPtr::new(fifo_low_watermark).unwrap(), + ); + command_processor::write_fifo_high_watermark( + AlignedPhysPtr::new(fifo_high_watermark).unwrap(), + ); + command_processor::write_fifo_write_ptr( + AlignedPhysPtr::new(fifo_write_ptr).unwrap(), + ); + command_processor::write_fifo_read_ptr(AlignedPhysPtr::new(fifo_read_ptr).unwrap()); + + core::arch::asm!("sc"); + + // Clear any spurious overflow or underflows + Clear::read() + .with_clear_overflow(true) + .with_clear_underflow(true) + .write(); + // Reenable command processor reading + Control::read().with_read_enable(true).write(); + // TODO: and Reenable them + }); + } + + pub unsafe fn link_fifo(&mut self) { + Control::read().with_link_enable(true).write(); + } + } +} + +#[repr(u8)] +pub enum CompareFunction { + Never = 0, + Less = 1, + Equal = 2, + LessEqual = 3, + Greater = 4, + NotEqual = 5, + GreaterEqual = 6, + Always = 7, +} + +impl CompareFunction { + pub const fn into_u32(self) -> u32 { + match self { + CompareFunction::Never => 0, + CompareFunction::Less => 1, + CompareFunction::Equal => 2, + CompareFunction::LessEqual => 3, + CompareFunction::Greater => 4, + CompareFunction::NotEqual => 5, + CompareFunction::GreaterEqual => 6, + CompareFunction::Always => 7, + } + } +} + +pub fn create_pixel_engine_z_mode( + enable: bool, + function: CompareFunction, + update_enable: bool, +) -> u32 { + *0u32 + .set_bit(0, enable) + .set_bits(1..4, function.into_u32()) + .set_bit(4, update_enable) + .set_bits(24..32, 64) +} + +pub enum BlendFactor { + Zero = 0, + One = 1, + SourceColor = 2, + InverseSourceColor = 3, + SourceAlpha = 4, + InverseSourceAlpha = 5, + DestinationAlpha = 6, + InverseDestinationAlpha = 7, +} + +impl BlendFactor { + pub const fn into_u32(self) -> u32 { + match self { + BlendFactor::Zero => 0, + BlendFactor::One => 1, + BlendFactor::SourceColor => 2, + BlendFactor::InverseSourceColor => 3, + BlendFactor::SourceAlpha => 4, + BlendFactor::InverseSourceAlpha => 5, + BlendFactor::DestinationAlpha => 6, + BlendFactor::InverseDestinationAlpha => 7, + } + } +} + +pub enum BlendOperation { + Blend = 0, + Subtract = 1, +} + +impl BlendOperation { + pub const fn into_bool(self) -> bool { + match self { + BlendOperation::Blend => false, + BlendOperation::Subtract => true, + } + } +} + +pub enum LogicOperation { + Clear = 0, + And = 1, + ReverseAnd = 2, + Copy = 3, + InverseAnd = 4, + NoOperation = 5, + Xor = 6, + Or = 7, + NotOr = 8, + Equiv = 9, // ~(source ^ destination) + Inverse = 10, + ReverseOr = 11, + InverseCopy = 12, + InverseOr = 13, + NotAnd = 14, + Set = 15, +} + +impl LogicOperation { + pub const fn into_u32(self) -> u32 { + match self { + Self::Clear => 0, + Self::And => 1, + Self::ReverseAnd => 2, + Self::Copy => 3, + Self::InverseAnd => 4, + Self::NoOperation => 5, + Self::Xor => 6, + Self::Or => 7, + Self::NotOr => 8, + Self::Equiv => 9, // ~(source ^ destination) + Self::Inverse => 10, + Self::ReverseOr => 11, + Self::InverseCopy => 12, + Self::InverseOr => 13, + Self::NotAnd => 14, + Self::Set => 15, + } + } +} + +pub fn create_pixel_engine_c_mode_0( + blend_enable: bool, + logicop_enable: bool, + dither_enable: bool, + color_update: bool, + alpha_update: bool, + source_blend_factor: BlendFactor, + destination_blend_factor: BlendFactor, + blend_operation: BlendOperation, + logic_operation: LogicOperation, +) -> u32 { + *0u32 + .set_bit(0, blend_enable) + .set_bit(1, logicop_enable) + .set_bit(2, dither_enable) + .set_bit(4, color_update) + .set_bit(5, alpha_update) + .set_bits(5..8, destination_blend_factor.into_u32()) + .set_bits(8..11, source_blend_factor.into_u32()) + .set_bit(11, blend_operation.into_bool()) + .set_bits(11..24, logic_operation.into_u32()) + .set_bits(24..32, 65) +} +>>>>>>> Stashed changes diff --git a/src/lib.rs b/src/lib.rs index 820bae2..4edfbca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -98,6 +98,8 @@ pub mod time; #[cfg(feature = "glam_compat")] pub mod glam_impl; +pub mod sync; + // FFI cfg_if::cfg_if! { if #[cfg(feature = "ffi")] { @@ -116,6 +118,7 @@ cfg_if::cfg_if! { } } +<<<<<<< Updated upstream mod interrupts { use bit_field::BitField; @@ -176,14 +179,12 @@ mod sync { } } } +======= +pub mod arch; +>>>>>>> Stashed changes ///Prelude pub mod prelude { - // alloc Export - pub use alloc::boxed::Box; - pub use alloc::string::{String, ToString}; - pub use alloc::{vec, vec::Vec}; - // Export Services pub use crate::asnd::*; pub use crate::console::*; diff --git a/src/sync/mod.rs b/src/sync/mod.rs new file mode 100644 index 0000000..8954fe5 --- /dev/null +++ b/src/sync/mod.rs @@ -0,0 +1,133 @@ +use core::{ + cell::UnsafeCell, + ops::{Deref, DerefMut}, + sync::atomic::{AtomicBool, Ordering}, +}; + +use crate::arch; + +pub struct SpinLock { + locked: AtomicBool, + value: UnsafeCell, +} + +impl SpinLock { + pub const fn new(value: T) -> Self { + Self { + locked: AtomicBool::new(false), + value: UnsafeCell::new(value), + } + } + + pub fn is_locked(&self) -> bool { + self.locked.load(Ordering::Relaxed) + } + + pub fn try_lock(&self) -> Option> { + if self.locked.swap(true, Ordering::Acquire) { + Some(Guard { lock: self }) + } else { + None + } + } + + pub fn try_with_lock(&self, f: impl FnOnce(Guard<'_, T>) -> R) -> Option { + if let Some(guard) = self.try_lock() { + Some(f(guard)) + } else { + None + } + } + + pub fn lock(&self) -> Guard { + while self.locked.swap(true, Ordering::Acquire) { + core::hint::spin_loop(); + } + Guard { lock: self } + } + + pub fn with_lock(&self, f: impl FnOnce(Guard<'_, T>) -> R) -> R { + let guard = self.lock(); + f(guard) + } +} + +unsafe impl Sync for SpinLock where T: Send {} + +pub struct Guard<'a, T> { + lock: &'a SpinLock, +} + +impl Deref for Guard<'_, T> { + type Target = T; + fn deref(&self) -> &Self::Target { + unsafe { &*self.lock.value.get() } + } +} + +impl DerefMut for Guard<'_, T> { + fn deref_mut(&mut self) -> &mut Self::Target { + unsafe { &mut *self.lock.value.get() } + } +} + +impl<'a, T, R> AsRef for Guard<'a, T> +where + T: AsRef, +{ + fn as_ref(&self) -> &R { + self.deref().as_ref() + } +} + +impl<'a, T, R> AsMut for Guard<'a, T> +where + T: AsMut, +{ + fn as_mut(&mut self) -> &mut R { + self.deref_mut().as_mut() + } +} + +impl Drop for Guard<'_, T> { + fn drop(&mut self) { + self.lock.locked.store(false, Ordering::Release); + } +} + +unsafe impl Sync for Guard<'_, T> where T: Sync {} +unsafe impl Send for Guard<'_, T> where T: Send {} + +pub struct CriticalSectionSpinLock { + inner: SpinLock, +} + +impl CriticalSectionSpinLock { + pub const fn new(value: T) -> Self { + Self { + inner: SpinLock::new(value), + } + } + + pub fn is_locked(&self) -> bool { + self.inner.is_locked() + } + + pub fn try_lock(&self) -> Option> { + arch::with_interrupts_disabled(|| self.inner.try_lock()) + } + + pub fn try_with_lock(&self, f: impl FnOnce(Guard<'_, T>) -> R) -> Option { + arch::with_interrupts_disabled(|| self.inner.try_with_lock(f)) + } + + pub fn lock(&self) -> Guard { + arch::with_interrupts_disabled(|| self.inner.lock()) + } + + pub fn with_lock(&self, f: impl FnOnce(Guard<'_, T>) -> R) -> R { + arch::with_interrupts_disabled(|| self.inner.with_lock(f)) + } +} + +unsafe impl Sync for CriticalSectionSpinLock where T: Send {}