From 22b07505bf637e0db1d0e43df303120e3050c2c4 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Sat, 5 Oct 2024 01:22:08 +0200 Subject: [PATCH] rdpq_mode: fix a few issues with SHQ textures --- include/rdpq_mode.h | 2 +- include/rsp_rdpq.inc | 2 +- src/rdpq/rdpq_sprite.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/rdpq_mode.h b/include/rdpq_mode.h index 64d3c9cf2..1f8d9732e 100644 --- a/include/rdpq_mode.h +++ b/include/rdpq_mode.h @@ -248,7 +248,7 @@ typedef enum rdpq_mipmap_s { MIPMAP_INTERPOLATE = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE) >> 32, ///< Interpolate between the two nearest mipmap levels (also known as "trilinear") MIPMAP_INTERPOLATE_SHARPEN = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE | SOM_TEXTURE_SHARPEN) >> 32, ///< Interpolate between the two nearest mipmap levels (also known as "trilinear") with sharpening enabled MIPMAP_INTERPOLATE_DETAIL = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE | SOM_TEXTURE_DETAIL) >> 32, ///< Interpolate between the two nearest mipmap levels (also known as "trilinear") with detail texture enabled - MIPMAP_INTERPOLATE_SHQ = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE_SHQ) >> 32, ///< Special mipmap mode that must be used for SHC textures + MIPMAP_INTERPOLATE_SHQ = (SOMX_LOD_INTERPOLATE_SHQ) >> 32, ///< Special mipmap mode that must be used for SHC textures } rdpq_mipmap_t; /** diff --git a/include/rsp_rdpq.inc b/include/rsp_rdpq.inc index acdd1d62f..7b79dc1a0 100644 --- a/include/rsp_rdpq.inc +++ b/include/rsp_rdpq.inc @@ -219,7 +219,7 @@ AA_BLEND_DEFAULT_FORMULA: .word RDPQ_BLENDER((IN_RGB, IN_ALPHA, MEMORY_RGB, MEMORY_CVG)) & ~SOM_READ_ENABLE # Reduced AA #define RDPQ_COMB_LOD_INTERP RDPQ_COMBINER2((TEX1, TEX0, LOD_FRAC, TEX0), (TEX1, TEX0, LOD_FRAC, TEX0), (0,0,0,0), (0,0,0,0)) -#define RDPQ_COMB_LOD_SHQ RDPQ_COMBINER2((TEX1, TEX0, K5, 0 ), (0, 0, 0, TEX1), (0,0,0,0), (0,0,0,0)) +#define RDPQ_COMB_LOD_SHQ RDPQ_COMBINER2((TEX0, TEX1, K5, 0 ), (0, 0, 0, TEX1), (0,0,0,0), (0,0,0,0)) #define RDPQ_COMB_SHADE_FOG RDPQ_COMBINER1((0,0,0,SHADE), (0,0,0,1)) #define RDPQ_COMB_TEX_SHADE_FOG RDPQ_COMBINER1((TEX0,0,SHADE,0), (0,0,0,TEX0)) diff --git a/src/rdpq/rdpq_sprite.c b/src/rdpq/rdpq_sprite.c index 4f1e69979..703214969 100644 --- a/src/rdpq/rdpq_sprite.c +++ b/src/rdpq/rdpq_sprite.c @@ -114,8 +114,8 @@ int __rdpq_sprite_upload(rdpq_tile_t tile, sprite_t *sprite, const rdpq_texparms if (__builtin_expect(set_mode, 1)) { // Enable/disable mipmapping if(is_shq) { - rdpq_mode_mipmap(MIPMAP_INTERPOLATE_SHQ, num_mipmaps+1); - rdpq_set_yuv_parms(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF); + rdpq_mode_mipmap(MIPMAP_INTERPOLATE_SHQ, num_mipmaps); + rdpq_set_yuv_parms(0, 0, 0, 0, 0, 0xFF); } else if(use_detail) rdpq_mode_mipmap(MIPMAP_INTERPOLATE_DETAIL, num_mipmaps+1); else if (num_mipmaps) rdpq_mode_mipmap(MIPMAP_INTERPOLATE, num_mipmaps);