From 40310e2132ea0b1a48661883e0fbc845488c51eb Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 10 May 2015 18:59:22 -0700 Subject: Implement I4 texture format @neobrain, could you confirm that this is correct? It's been tested with various different games and fixes different textures, including in Animal Crossing, Kirby Triple Deluxe, and SMB3D. --- src/video_core/debug_utils/debug_utils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/video_core/debug_utils') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 2d9d8ab1f..883df48a5 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -393,6 +393,17 @@ const Math::Vec4 LookupTexture(const u8* source, int x, int y, const Texture } } + case Regs::TextureFormat::I4: + { + u32 morton_offset = VideoCore::GetMortonOffset(x, y, 1); + const u8* source_ptr = source + morton_offset / 2; + + u8 i = (morton_offset % 2) ? ((*source_ptr & 0xF0) >> 4) : (*source_ptr & 0xF); + i = Color::Convert4To8(i); + + return { i, i, i, 255 }; + } + case Regs::TextureFormat::A4: { u32 morton_offset = VideoCore::GetMortonOffset(x, y, 1); -- cgit v1.2.3