mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 23:25:41 +00:00
MDEC: Don't round when texture replacements are enabled
This changes texture hashes, and people got annoyed :/
This commit is contained in:
parent
928dd0e665
commit
1bb321c41f
|
@ -633,6 +633,30 @@ void MDEC::CopyOutBlock(void* param, TickCount ticks, TickCount ticks_late)
|
|||
}
|
||||
|
||||
case DataOutputDepth_15Bit:
|
||||
{
|
||||
// people have made texture packs using the old conversion routines.. best to just leave them be.
|
||||
if (g_settings.texture_replacements.enable_vram_write_replacements ||
|
||||
g_settings.texture_replacements.dump_vram_writes)
|
||||
{
|
||||
const u16 a = ZeroExtend16(s_status.data_output_bit15.GetValue()) << 15;
|
||||
for (u32 i = 0; i < static_cast<u32>(s_block_rgb.size());)
|
||||
{
|
||||
u32 color = s_block_rgb[i++];
|
||||
u16 r = Truncate16((color >> 3) & 0x1Fu);
|
||||
u16 g = Truncate16((color >> 11) & 0x1Fu);
|
||||
u16 b = Truncate16((color >> 19) & 0x1Fu);
|
||||
const u16 color15a = r | (g << 5) | (b << 10) | (a << 15);
|
||||
|
||||
color = s_block_rgb[i++];
|
||||
r = Truncate16((color >> 3) & 0x1Fu);
|
||||
g = Truncate16((color >> 11) & 0x1Fu);
|
||||
b = Truncate16((color >> 19) & 0x1Fu);
|
||||
const u16 color15b = r | (g << 5) | (b << 10) | (a << 15);
|
||||
|
||||
s_data_out_fifo.Push(ZeroExtend32(color15a) | (ZeroExtend32(color15b) << 16));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const u32 a = ZeroExtend32(s_status.data_output_bit15.GetValue()) << 15;
|
||||
for (u32 i = 0; i < static_cast<u32>(s_block_rgb.size());)
|
||||
|
@ -654,6 +678,7 @@ void MDEC::CopyOutBlock(void* param, TickCount ticks, TickCount ticks_late)
|
|||
s_data_out_fifo.Push(color15a | (color15b << 16));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue