summaryrefslogtreecommitdiff
path: root/src/video_core/rasterizer.cpp
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-15 21:28:45 +0100
committerGravatar Tony Wasserka2014-12-20 18:06:53 +0100
commit40f123b7c0eaf1507d51f6b87192ec2f956e5d5e (patch)
tree7f87847435d510ed0e70a10cd67129a3b2511335 /src/video_core/rasterizer.cpp
parentPica: Further improve Tev emulation. (diff)
downloadyuzu-40f123b7c0eaf1507d51f6b87192ec2f956e5d5e.tar.gz
yuzu-40f123b7c0eaf1507d51f6b87192ec2f956e5d5e.tar.xz
yuzu-40f123b7c0eaf1507d51f6b87192ec2f956e5d5e.zip
Pica: Unify ugly address translation hacks.
Diffstat (limited to 'src/video_core/rasterizer.cpp')
-rw-r--r--src/video_core/rasterizer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 25efd49c8..bd79e4413 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -18,7 +18,7 @@ namespace Pica {
18namespace Rasterizer { 18namespace Rasterizer {
19 19
20static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) { 20static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
21 u32* color_buffer = (u32*)Memory::GetPointer(registers.framebuffer.GetColorBufferAddress()); 21 u32* color_buffer = (u32*)Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress()));
22 u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b(); 22 u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b();
23 23
24 // Assuming RGBA8 format until actual framebuffer format handling is implemented 24 // Assuming RGBA8 format until actual framebuffer format handling is implemented
@@ -26,14 +26,14 @@ static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
26} 26}
27 27
28static u32 GetDepth(int x, int y) { 28static u32 GetDepth(int x, int y) {
29 u16* depth_buffer = (u16*)Memory::GetPointer(registers.framebuffer.GetDepthBufferAddress()); 29 u16* depth_buffer = (u16*)Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress()));
30 30
31 // Assuming 16-bit depth buffer format until actual format handling is implemented 31 // Assuming 16-bit depth buffer format until actual format handling is implemented
32 return *(depth_buffer + x + y * registers.framebuffer.GetWidth()); 32 return *(depth_buffer + x + y * registers.framebuffer.GetWidth());
33} 33}
34 34
35static void SetDepth(int x, int y, u16 value) { 35static void SetDepth(int x, int y, u16 value) {
36 u16* depth_buffer = (u16*)Memory::GetPointer(registers.framebuffer.GetDepthBufferAddress()); 36 u16* depth_buffer = (u16*)Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress()));
37 37
38 // Assuming 16-bit depth buffer format until actual format handling is implemented 38 // Assuming 16-bit depth buffer format until actual format handling is implemented
39 *(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value; 39 *(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value;
@@ -204,7 +204,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
204 s = GetWrappedTexCoord(registers.texture0.wrap_s, s, registers.texture0.width); 204 s = GetWrappedTexCoord(registers.texture0.wrap_s, s, registers.texture0.width);
205 t = GetWrappedTexCoord(registers.texture0.wrap_t, t, registers.texture0.height); 205 t = GetWrappedTexCoord(registers.texture0.wrap_t, t, registers.texture0.height);
206 206
207 u8* texture_data = Memory::GetPointer(texture.config.GetPhysicalAddress()); 207 u8* texture_data = Memory::GetPointer(PAddrToVAddr(texture.config.GetPhysicalAddress()));
208 auto info = DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format); 208 auto info = DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format);
209 209
210 texture_color[i] = DebugUtils::LookupTexture(texture_data, s, t, info); 210 texture_color[i] = DebugUtils::LookupTexture(texture_data, s, t, info);