From 4a6b94980e3368986b072034bb25712b78a8d3fe Mon Sep 17 00:00:00 2001 From: lif <> Date: Sun, 24 Dec 2023 13:39:32 -0800 Subject: [PATCH] fix blend masks --- mips/mips_emit.h | 3 +-- video.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mips/mips_emit.h b/mips/mips_emit.h index b36d637..2552ced 100644 --- a/mips/mips_emit.h +++ b/mips/mips_emit.h @@ -2366,10 +2366,9 @@ static void emit_pmemst_stub( mips_emit_andi(reg_temp, reg_a1, 0x7FFF); #elif defined(USE_RGBA5551_FORMAT) /* N64's native format */ - //#error "TODO" #define palette_convert() \ mips_emit_sll(reg_temp, reg_a1, 1); \ - mips_emit_ori(reg_temp, reg_temp, 1); + mips_emit_ori(reg_temp, reg_temp, 1) #else /* 0BGR to RGB565 (clobbers a0) */ #ifdef MIPS_HAS_R2_INSTS diff --git a/video.cc b/video.cc index 3f7dca2..567b200 100644 --- a/video.cc +++ b/video.cc @@ -1656,13 +1656,20 @@ static void order_layers(u32 layer_flags, u32 vcnt) #define BLND_MSK (SATR_MSK | SATG_MSK | SATB_MSK) -#if defined(USE_XBGR1555_FORMAT) || defined(USE_RGBA5551_FORMAT) +#if defined(USE_XBGR1555_FORMAT) #define OVFG_MSK 0x04000000 #define OVFR_MSK 0x00008000 #define OVFB_MSK 0x00000020 #define SATG_MSK 0x03E00000 #define SATR_MSK 0x00007C00 #define SATB_MSK 0x0000001F +#elif defined(USE_RGBA5551_FORMAT) + #define OVFG_MSK 0x08000000 + #define OVFR_MSK 0x00010000 + #define OVFB_MSK 0x00000040 + #define SATG_MSK 0x07c00000 + #define SATR_MSK 0x0000f800 + #define SATB_MSK 0x0000003e #else #define OVFG_MSK 0x08000000 #define OVFR_MSK 0x00010000