summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar archshift2015-05-10 18:59:22 -0700
committerGravatar archshift2015-05-10 18:59:22 -0700
commit40310e2132ea0b1a48661883e0fbc845488c51eb (patch)
treeff40f5a686cae1ff1775f094cab99652405f2869 /src
parentMerge pull request #740 from yuriks/gsp-shmem (diff)
downloadyuzu-40310e2132ea0b1a48661883e0fbc845488c51eb.tar.gz
yuzu-40310e2132ea0b1a48661883e0fbc845488c51eb.tar.xz
yuzu-40310e2132ea0b1a48661883e0fbc845488c51eb.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp11
-rw-r--r--src/video_core/pica.h2
2 files changed, 12 insertions, 1 deletions
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<u8> LookupTexture(const u8* source, int x, int y, const Texture
393 } 393 }
394 } 394 }
395 395
396 case Regs::TextureFormat::I4:
397 {
398 u32 morton_offset = VideoCore::GetMortonOffset(x, y, 1);
399 const u8* source_ptr = source + morton_offset / 2;
400
401 u8 i = (morton_offset % 2) ? ((*source_ptr & 0xF0) >> 4) : (*source_ptr & 0xF);
402 i = Color::Convert4To8(i);
403
404 return { i, i, i, 255 };
405 }
406
396 case Regs::TextureFormat::A4: 407 case Regs::TextureFormat::A4:
397 { 408 {
398 u32 morton_offset = VideoCore::GetMortonOffset(x, y, 1); 409 u32 morton_offset = VideoCore::GetMortonOffset(x, y, 1);
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 5e169ff69..a53429716 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -156,7 +156,7 @@ struct Regs {
156 I8 = 7, 156 I8 = 7,
157 A8 = 8, 157 A8 = 8,
158 IA4 = 9, 158 IA4 = 9,
159 159 I4 = 10,
160 A4 = 11, 160 A4 = 11,
161 ETC1 = 12, // compressed 161 ETC1 = 12, // compressed
162 ETC1A4 = 13, // compressed 162 ETC1A4 = 13, // compressed