#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cycle_type: u8Cycle 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: boolForce the no-divide blend form even on the final cycle.
image_read_en: boolRead the framebuffer (memory) color into the blend.
cvg_dest: u8Coverage write-back mode: 0 clamp, 1 wrap, 2 full, 3 save.
z_compare_en: boolZ test / update enables and the Z mode (T-33-004 consumes these).
z_update_en: boolZ-buffer update enable.
z_mode: u8Z mode: 0 opaque, 1 interpenetrating, 2 transparent, 3 decal.
alpha_compare_en: boolAlpha-compare enable (gates the pixel write; R-11).
key_en: boolChroma-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: boolPerspective-correct texturing (bit 51): divide the interpolated S/T by W.
aa_enable: boolAnti-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: u8RGB 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: boolTexture 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: boolLOD 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: boolSharpen-texture enable (bit 49): keeps the LOD fraction live when
magnifying and sets its 0x100 bit (R-13).
detail_tex_en: boolDetail-texture enable (bit 50): keeps the LOD fraction live when magnifying (R-13).
tlut_en: boolTLUT 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_enclear is no longer palette-mapped. Pinned byci4_tlut_disabled_16, whose golden is all black where thetlut_en-set twin renders the full palette. - Deferred: a non-CI tile with
tlut_enset 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 astlut_type’s IA16 palettes below.
tlut_type: boolTLUT 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: boolMid-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
impl Clone for OtherModes
Source§fn clone(&self) -> OtherModes
fn clone(&self) -> OtherModes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more