Skip to main content

TileDescriptor

Struct TileDescriptor 

Source
pub struct TileDescriptor {
Show 17 fields pub format: u8, pub size: u8, pub line: u16, pub tmem_addr: u16, pub palette: u8, pub clamp_t: bool, pub mirror_t: bool, pub mask_t: u8, pub shift_t: u8, pub clamp_s: bool, pub mirror_s: bool, pub mask_s: u8, pub shift_s: u8, pub sl: u16, pub tl: u16, pub sh: u16, pub th: u16,
}
Expand description

One of the RDP’s eight tile descriptors.

The format/size/addressing state that binds a region of TMEM to a texture, set by Set Tile (0x35) and sized by Set Tile Size (0x32) / the load commands. All fields are decoded straight from the command word (N64brew …/Commands §0x35/§0x32).

Fields§

§format: u8

Texel format: RGBA=0, YUV=1, CI=2, IA=3, I=4 (Set Tile bits 55:53).

§size: u8

Texel size code: 4bpp=0, 8bpp=1, 16bpp=2, 32bpp=3 (bits 52:51).

§line: u16

Row stride in 64-bit TMEM words (bits 49:41).

§tmem_addr: u16

Base TMEM address in 64-bit words (bits 40:32); word 0x100 = byte 0x800.

§palette: u8

Palette index, the high half of the TLUT address for CI4 tiles only (bits 23:20).

§clamp_t: bool

Clamp T when sampling outside the tile (bit 19).

§mirror_t: bool

Mirror T on every other wrap (bit 18).

§mask_t: u8

Number of T integer-coordinate bits used for wrap; 0 = all (bits 17:14).

§shift_t: u8

T coordinate shift code, per the shift table (bits 13:10).

§clamp_s: bool

Clamp S when sampling outside the tile (bit 9).

§mirror_s: bool

Mirror S on every other wrap (bit 8).

§mask_s: u8

Number of S integer-coordinate bits used for wrap; 0 = all (bits 7:4).

§shift_s: u8

S coordinate shift code, per the shift table (bits 3:0).

§sl: u16

Tile-size upper-left S (u10.2), from Set Tile Size / the loaders.

§tl: u16

Tile-size upper-left T (u10.2).

§sh: u16

Tile-size lower-right S (u10.2).

§th: u16

Tile-size lower-right T (u10.2).

Trait Implementations§

Source§

impl Clone for TileDescriptor

Source§

fn clone(&self) -> TileDescriptor

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TileDescriptor

Source§

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

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

impl Default for TileDescriptor

Source§

fn default() -> TileDescriptor

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

impl<'de> Deserialize<'de> for TileDescriptor

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TileDescriptor

Source§

fn eq(&self, other: &TileDescriptor) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TileDescriptor

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for TileDescriptor

Source§

impl Eq for TileDescriptor

Source§

impl StructuralPartialEq for TileDescriptor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,