Skip to main content

OtherModes

Struct OtherModes 

Source
#[non_exhaustive]
pub struct OtherModes {
Show 20 fields pub cycle_type: u8, pub blend: [BlendCycle; 2], pub force_blend: bool, pub image_read_en: bool, pub cvg_dest: u8, pub z_compare_en: bool, pub z_update_en: bool, pub z_mode: u8, pub alpha_compare_en: bool, pub key_en: bool, pub persp_tex_en: bool, pub aa_enable: bool, pub rgb_dither_mode: u8, pub sample_type: bool, pub tex_lod_en: bool, pub sharpen_tex_en: bool, pub detail_tex_en: bool, pub tlut_en: bool, pub tlut_type: bool, pub mid_texel: bool,
}
Expand description

The Set Other Modes (0x2F) render-mode state the blender and cycle control need.

Coverage, RGB dither, and alpha-compare are decoded here and now applied (dither on both pixel paths; alpha-compare gates the write on both). The remaining decoded-but-unused fields — the AA-edge divider LUT, the interpenetrating-Z blend-shift, color_on_cvg, and coverage write-back — are the open residual R-11.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§cycle_type: u8

Cycle type: 0 = 1-cycle, 1 = 2-cycle, 2 = copy, 3 = fill.

§blend: [BlendCycle; 2]

The two blender cycles (cycle 0 chains into cycle 1 in 2-cycle mode).

§force_blend: bool

Force the no-divide blend form even on the final cycle.

§image_read_en: bool

Read the framebuffer (memory) color into the blend.

§cvg_dest: u8

Coverage write-back mode: 0 clamp, 1 wrap, 2 full, 3 save.

§z_compare_en: bool

Z test / update enables and the Z mode (T-33-004 consumes these).

§z_update_en: bool

Z-buffer update enable.

§z_mode: u8

Z mode: 0 opaque, 1 interpenetrating, 2 transparent, 3 decal.

§alpha_compare_en: bool

Alpha-compare enable (gates the pixel write; R-11).

§key_en: bool

Chroma-key enable (bit 40): the combiner outputs the sub-A color and derives the pixel alpha from the key window (chroma_key_min). R-10.

§persp_tex_en: bool

Perspective-correct texturing (bit 51): divide the interpolated S/T by W.

§aa_enable: bool

Anti-aliasing enable (bit 3): sub-pixel edge coverage governs which edge pixels draw and enables the edge blend (N64brew …/Commands §0x2F bit 3).

§rgb_dither_mode: u8

RGB dither mode (bits 39:38): 0 magic, 1 bayer, 2 noise, 3 off. Applied to the combined RGB per pixel before write-back (N64brew …/Commands §0x2F; parallel-rdp dither.c). Modes 0/1 dither; 2 (noise, R-10) currently reads the magic cell; 3 never rounds up (dither off).

§sample_type: bool

Texture sample type (bit 45): false = point-sample one texel, true = the N64’s 3-point bilinear filter (R-13). Applied in the triangle sampler.

§tex_lod_en: bool

LOD enable (bit 48): the derivative-based mip level drives tile selection. Decoded and fed to the LOD fraction; LOD-driven tile selection is the remaining R-13 residual, so this does not yet re-tile.

§sharpen_tex_en: bool

Sharpen-texture enable (bit 49): keeps the LOD fraction live when magnifying and sets its 0x100 bit (R-13).

§detail_tex_en: bool

Detail-texture enable (bit 50): keeps the LOD fraction live when magnifying (R-13).

§tlut_en: bool

TLUT enable (bit 47). N64brew …/Commands §0x2F: tlut_en: Enables Texture Look-Up Table (TLUT) sampling. Texels are first fetched from low TMEM that are then used to index a palette in high TMEM to find the final color values.”

This is the flag that decides whether a palette lookup happens — not the tile’s format field. Keying off the format alone is wrong in two directions, and only one of them is fixed:

  • Implemented: a CI tile with tlut_en clear is no longer palette-mapped. Pinned by ci4_tlut_disabled_16, whose golden is all black where the tlut_en-set twin renders the full palette.
  • Deferred: a non-CI tile with tlut_en set is still not palette-mapped, though hardware would sample it through the TLUT. No vector covers that case, and the RGBA/IA/I formats index the palette differently enough that implementing it from the prose alone would be inventing behavior. It stays wrong-but-honest until a vector defines it, the same posture as tlut_type’s IA16 palettes below.
§tlut_type: bool

TLUT texel format (bit 46): false = RGBA16, true = IA16 (N64brew …/Commands §0x2F). Decoded so it is available and so the flag is not silently ignored; IA16 palettes are still deferred — the lookup assumes RGBA16, and implementing IA16 without a vector would be inventing behavior rather than emulating it.

§mid_texel: bool

Mid-texel filter (bit 44, R-13): when set and the bilinear sample lands exactly on the texel center (sfrac == tfrac == 0x10), the four neighbors are averaged instead of the 3-point triangle pick (Angrylion tex.c, the center/centerrg case). Only meaningful with sample_type.

Trait Implementations§

Source§

impl Clone for OtherModes

Source§

fn clone(&self) -> OtherModes

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 OtherModes

Source§

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

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

impl Default for OtherModes

Source§

fn default() -> OtherModes

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

impl<'de> Deserialize<'de> for OtherModes

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 OtherModes

Source§

fn eq(&self, other: &OtherModes) -> 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 OtherModes

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 OtherModes

Source§

impl Eq for OtherModes

Source§

impl StructuralPartialEq for OtherModes

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