diff options
| author | 2014-04-27 12:42:01 -0400 | |
|---|---|---|
| committer | 2014-04-27 12:42:01 -0400 | |
| commit | 1142ccba035afbe75ab707a81633c6cc26515848 (patch) | |
| tree | fb0aa6f63cdeb42b079e9fa7a6a6fa5cb1545e0e /src | |
| parent | hackish but working way to set the framebuffer location to VRAM (used in ARM1... (diff) | |
| download | yuzu-1142ccba035afbe75ab707a81633c6cc26515848.tar.gz yuzu-1142ccba035afbe75ab707a81633c6cc26515848.tar.xz yuzu-1142ccba035afbe75ab707a81633c6cc26515848.zip | |
fixed renderer to use correct framebuffer location
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index cf7b029ab..b63a73d18 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -53,12 +53,11 @@ void RendererOpenGL::SwapBuffers() { | |||
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * Helper function to flip framebuffer from left-to-right to top-to-bottom | 55 | * Helper function to flip framebuffer from left-to-right to top-to-bottom |
| 56 | * @param addr Address of framebuffer in RAM | 56 | * @param in Pointer to input raw framebuffer in V/RAM |
| 57 | * @param out Pointer to output buffer with flipped framebuffer | 57 | * @param out Pointer to output buffer with flipped framebuffer |
| 58 | * @todo Early on hack... I'd like to find a more efficient way of doing this /bunnei | 58 | * @todo Early on hack... I'd like to find a more efficient way of doing this /bunnei |
| 59 | */ | 59 | */ |
| 60 | void RendererOpenGL::FlipFramebuffer(u32 addr, u8* out) { | 60 | void RendererOpenGL::FlipFramebuffer(const u8* in, u8* out) { |
| 61 | u8* in = Memory::GetPointer(addr); | ||
| 62 | for (int y = 0; y < VideoCore::kScreenTopHeight; y++) { | 61 | for (int y = 0; y < VideoCore::kScreenTopHeight; y++) { |
| 63 | for (int x = 0; x < VideoCore::kScreenTopWidth; x++) { | 62 | for (int x = 0; x < VideoCore::kScreenTopWidth; x++) { |
| 64 | int in_coord = (VideoCore::kScreenTopHeight * 3 * x) + (VideoCore::kScreenTopHeight * 3) | 63 | int in_coord = (VideoCore::kScreenTopHeight * 3 * x) + (VideoCore::kScreenTopHeight * 3) |
| @@ -77,10 +76,10 @@ void RendererOpenGL::FlipFramebuffer(u32 addr, u8* out) { | |||
| 77 | * @param src_rect Source rectangle in XFB to copy | 76 | * @param src_rect Source rectangle in XFB to copy |
| 78 | * @param dst_rect Destination rectangle in output framebuffer to copy to | 77 | * @param dst_rect Destination rectangle in output framebuffer to copy to |
| 79 | */ | 78 | */ |
| 80 | void RendererOpenGL::RenderXFB(const Rect& src_rect, const Rect& dst_rect) { | 79 | void RendererOpenGL::RenderXFB(const Rect& src_rect, const Rect& dst_rect) { |
| 81 | 80 | ||
| 82 | FlipFramebuffer(LCD::TOP_RIGHT_FRAME1, m_xfb_top_flipped); | 81 | FlipFramebuffer(LCD::GetFramebufferPointer(LCD::g_regs.framebuffer_top_left_1), m_xfb_top_flipped); |
| 83 | FlipFramebuffer(LCD::SUB_FRAME1, m_xfb_bottom_flipped); | 82 | FlipFramebuffer(LCD::GetFramebufferPointer(LCD::g_regs.framebuffer_sub_left_1), m_xfb_bottom_flipped); |
| 84 | 83 | ||
| 85 | // Blit the top framebuffer | 84 | // Blit the top framebuffer |
| 86 | // ------------------------ | 85 | // ------------------------ |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 00aa17649..676a0ea02 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h | |||
| @@ -55,11 +55,11 @@ private: | |||
| 55 | 55 | ||
| 56 | /** | 56 | /** |
| 57 | * Helper function to flip framebuffer from left-to-right to top-to-bottom | 57 | * Helper function to flip framebuffer from left-to-right to top-to-bottom |
| 58 | * @param addr Address of framebuffer in RAM | 58 | * @param in Pointer to input raw framebuffer in V/RAM |
| 59 | * @param out Pointer to output buffer with flipped framebuffer | 59 | * @param out Pointer to output buffer with flipped framebuffer |
| 60 | * @todo Early on hack... I'd like to find a more efficient way of doing this /bunnei | 60 | * @todo Early on hack... I'd like to find a more efficient way of doing this /bunnei |
| 61 | */ | 61 | */ |
| 62 | void RendererOpenGL::FlipFramebuffer(u32 addr, u8* out); | 62 | void RendererOpenGL::FlipFramebuffer(const u8* in, u8* out); |
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | EmuWindow* m_render_window; ///< Handle to render window | 65 | EmuWindow* m_render_window; ///< Handle to render window |