Fix 4-bit textures djui

This commit is contained in:
PeachyPeachSM64 2025-11-26 00:23:20 +01:00
parent e45c564cac
commit 4ce9be4935

View file

@ -2069,12 +2069,12 @@ static const struct {
uint8_t LOAD_BLOCK;
uint8_t SHIFT;
uint8_t INCR;
uint8_t LINE_BYTES;
uint8_t LINE_NIBBLES;
} G_IM_SIZ_[] = {
[G_IM_SIZ_4b] = { G_IM_SIZ_4b_LOAD_BLOCK, G_IM_SIZ_4b_SHIFT, G_IM_SIZ_4b_INCR, G_IM_SIZ_4b_LINE_BYTES },
[G_IM_SIZ_8b] = { G_IM_SIZ_8b_LOAD_BLOCK, G_IM_SIZ_8b_SHIFT, G_IM_SIZ_8b_INCR, G_IM_SIZ_8b_LINE_BYTES },
[G_IM_SIZ_16b] = { G_IM_SIZ_16b_LOAD_BLOCK, G_IM_SIZ_16b_SHIFT, G_IM_SIZ_16b_INCR, G_IM_SIZ_16b_LINE_BYTES },
[G_IM_SIZ_32b] = { G_IM_SIZ_32b_LOAD_BLOCK, G_IM_SIZ_32b_SHIFT, G_IM_SIZ_32b_INCR, G_IM_SIZ_32b_LINE_BYTES },
[G_IM_SIZ_4b] = { G_IM_SIZ_4b_LOAD_BLOCK, G_IM_SIZ_4b_SHIFT, G_IM_SIZ_4b_INCR, 1 },
[G_IM_SIZ_8b] = { G_IM_SIZ_8b_LOAD_BLOCK, G_IM_SIZ_8b_SHIFT, G_IM_SIZ_8b_INCR, 2 * G_IM_SIZ_8b_LINE_BYTES },
[G_IM_SIZ_16b] = { G_IM_SIZ_16b_LOAD_BLOCK, G_IM_SIZ_16b_SHIFT, G_IM_SIZ_16b_INCR, 2 * G_IM_SIZ_16b_LINE_BYTES },
[G_IM_SIZ_32b] = { G_IM_SIZ_32b_LOAD_BLOCK, G_IM_SIZ_32b_SHIFT, G_IM_SIZ_32b_INCR, 2 * G_IM_SIZ_32b_LINE_BYTES },
};
static bool sDjuiClip = 0;
@ -2162,7 +2162,7 @@ static void OPTIMIZE_O3 djui_gfx_dp_execute_override(void) {
gfx_dp_set_texture_image(fmt, G_IM_SIZ_[siz].LOAD_BLOCK, width, texture);
gfx_dp_set_tile(fmt, siz, 0, 0, G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0);
gfx_dp_load_block(0, 0, 0, ((width * height + G_IM_SIZ_[siz].INCR) >> G_IM_SIZ_[siz].SHIFT) - 1, 0);
gfx_dp_set_tile(fmt, siz, (((width * G_IM_SIZ_[siz].LINE_BYTES) + 7) >> 3), 0, G_TX_RENDERTILE, 0, rdp.texture_tile.cmt, 0, 0, rdp.texture_tile.cms, 0, 0);
gfx_dp_set_tile(fmt, siz, (((width * G_IM_SIZ_[siz].LINE_NIBBLES) + 15) >> 4), 0, G_TX_RENDERTILE, 0, rdp.texture_tile.cmt, 0, 0, rdp.texture_tile.cms, 0, 0);
}
static void OPTIMIZE_O3 djui_gfx_dp_execute_djui(uint32_t opcode) {