diff options
| author | 2014-08-03 01:46:47 +0200 | |
|---|---|---|
| committer | 2014-08-12 13:32:56 +0200 | |
| commit | 7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84 (patch) | |
| tree | 2b005f3358a228136e7711ddac790ed54bb67b1f /src/video_core | |
| parent | GSP: Fix a major regression introduced in ffda035c, due to which no display t... (diff) | |
| download | yuzu-7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84.tar.gz yuzu-7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84.tar.xz yuzu-7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84.zip | |
Pica/GPU: Change hardware registers to use physical addresses rather than virtual ones.
This cleans up the mess that address reading/writing had become and makes the code a *lot* more sensible.
This adds a physical<->virtual address converter to mem_map.h. For further accuracy, we will want to properly extend this to support a wider range of address regions. For now, this makes simply homebrew applications work in a good manner though.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/pica.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index d64559d72..858335d44 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -45,7 +45,7 @@ struct Regs { | |||
| 45 | INSERT_PADDING_WORDS(0x41); | 45 | INSERT_PADDING_WORDS(0x41); |
| 46 | 46 | ||
| 47 | BitField<0, 24, u32> viewport_size_x; | 47 | BitField<0, 24, u32> viewport_size_x; |
| 48 | INSERT_PADDING_WORDS(1); | 48 | INSERT_PADDING_WORDS(0x1); |
| 49 | BitField<0, 24, u32> viewport_size_y; | 49 | BitField<0, 24, u32> viewport_size_y; |
| 50 | 50 | ||
| 51 | INSERT_PADDING_WORDS(0x1bc); | 51 | INSERT_PADDING_WORDS(0x1bc); |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 02b174562..f11a64fad 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -81,20 +81,20 @@ void RendererOpenGL::RenderXFB(const common::Rect& src_rect, const common::Rect& | |||
| 81 | const auto& framebuffer_top = GPU::g_regs.framebuffer_config[0]; | 81 | const auto& framebuffer_top = GPU::g_regs.framebuffer_config[0]; |
| 82 | const auto& framebuffer_sub = GPU::g_regs.framebuffer_config[1]; | 82 | const auto& framebuffer_sub = GPU::g_regs.framebuffer_config[1]; |
| 83 | const u32 active_fb_top = (framebuffer_top.active_fb == 1) | 83 | const u32 active_fb_top = (framebuffer_top.active_fb == 1) |
| 84 | ? framebuffer_top.address_left2 | 84 | ? Memory::PhysicalToVirtualAddress(framebuffer_top.address_left2) |
| 85 | : framebuffer_top.address_left1; | 85 | : Memory::PhysicalToVirtualAddress(framebuffer_top.address_left1); |
| 86 | const u32 active_fb_sub = (framebuffer_sub.active_fb == 1) | 86 | const u32 active_fb_sub = (framebuffer_sub.active_fb == 1) |
| 87 | ? framebuffer_sub.address_left2 | 87 | ? Memory::PhysicalToVirtualAddress(framebuffer_sub.address_left2) |
| 88 | : framebuffer_sub.address_left1; | 88 | : Memory::PhysicalToVirtualAddress(framebuffer_sub.address_left1); |
| 89 | 89 | ||
| 90 | DEBUG_LOG(GPU, "RenderXFB: 0x%08x bytes from 0x%08x(%dx%d), fmt %x", | 90 | DEBUG_LOG(GPU, "RenderXFB: 0x%08x bytes from 0x%08x(%dx%d), fmt %x", |
| 91 | framebuffer_top.stride * framebuffer_top.height, | 91 | framebuffer_top.stride * framebuffer_top.height, |
| 92 | GPU::GetFramebufferAddr(active_fb_top), (int)framebuffer_top.width, | 92 | active_fb_top, (int)framebuffer_top.width, |
| 93 | (int)framebuffer_top.height, (int)framebuffer_top.format); | 93 | (int)framebuffer_top.height, (int)framebuffer_top.format); |
| 94 | 94 | ||
| 95 | // TODO: This should consider the GPU registers for framebuffer width, height and stride. | 95 | // TODO: This should consider the GPU registers for framebuffer width, height and stride. |
| 96 | FlipFramebuffer(GPU::GetFramebufferPointer(active_fb_top), m_xfb_top_flipped); | 96 | FlipFramebuffer(Memory::GetPointer(active_fb_top), m_xfb_top_flipped); |
| 97 | FlipFramebuffer(GPU::GetFramebufferPointer(active_fb_sub), m_xfb_bottom_flipped); | 97 | FlipFramebuffer(Memory::GetPointer(active_fb_sub), m_xfb_bottom_flipped); |
| 98 | 98 | ||
| 99 | // Blit the top framebuffer | 99 | // Blit the top framebuffer |
| 100 | // ------------------------ | 100 | // ------------------------ |