diff options
| author | 2014-12-20 12:40:06 -0500 | |
|---|---|---|
| committer | 2014-12-20 12:40:06 -0500 | |
| commit | acabd7be82b4174a3adab0771df6320bdbc5a85b (patch) | |
| tree | c47c2f68f50005bfb5c4003831f3977aec0be3ca /src/citra_qt/debugger/graphics_framebuffer.cpp | |
| parent | Merge pull request #315 from chinhodado/master (diff) | |
| parent | Pica/VertexShader: Promote a log message to critical status. (diff) | |
| download | yuzu-acabd7be82b4174a3adab0771df6320bdbc5a85b.tar.gz yuzu-acabd7be82b4174a3adab0771df6320bdbc5a85b.tar.xz yuzu-acabd7be82b4174a3adab0771df6320bdbc5a85b.zip | |
Merge pull request #284 from neobrain/pica_progress
Pica progress: Texturing, shaders, cleanups & more
Diffstat (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp')
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 61b61ef6d..484be1db5 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp | |||
| @@ -125,7 +125,8 @@ GraphicsFramebufferWidget::GraphicsFramebufferWidget(std::shared_ptr<Pica::Debug | |||
| 125 | setWidget(main_widget); | 125 | setWidget(main_widget); |
| 126 | 126 | ||
| 127 | // Load current data - TODO: Make sure this works when emulation is not running | 127 | // Load current data - TODO: Make sure this works when emulation is not running |
| 128 | emit Update(); | 128 | if (debug_context && debug_context->at_breakpoint) |
| 129 | emit Update(); | ||
| 129 | widget()->setEnabled(false); // TODO: Only enable if currently at breakpoint | 130 | widget()->setEnabled(false); // TODO: Only enable if currently at breakpoint |
| 130 | } | 131 | } |
| 131 | 132 | ||
| @@ -198,7 +199,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 198 | auto framebuffer = Pica::registers.framebuffer; | 199 | auto framebuffer = Pica::registers.framebuffer; |
| 199 | using Framebuffer = decltype(framebuffer); | 200 | using Framebuffer = decltype(framebuffer); |
| 200 | 201 | ||
| 201 | framebuffer_address = framebuffer.GetColorBufferAddress(); | 202 | framebuffer_address = framebuffer.GetColorBufferPhysicalAddress(); |
| 202 | framebuffer_width = framebuffer.GetWidth(); | 203 | framebuffer_width = framebuffer.GetWidth(); |
| 203 | framebuffer_height = framebuffer.GetHeight(); | 204 | framebuffer_height = framebuffer.GetHeight(); |
| 204 | framebuffer_format = static_cast<Format>(framebuffer.color_format); | 205 | framebuffer_format = static_cast<Format>(framebuffer.color_format); |
| @@ -223,7 +224,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 223 | case Format::RGBA8: | 224 | case Format::RGBA8: |
| 224 | { | 225 | { |
| 225 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 226 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 226 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); | 227 | u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); |
| 227 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 228 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 228 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 229 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 229 | u32 value = *(color_buffer + x + y * framebuffer_width); | 230 | u32 value = *(color_buffer + x + y * framebuffer_width); |
| @@ -238,7 +239,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 238 | case Format::RGB8: | 239 | case Format::RGB8: |
| 239 | { | 240 | { |
| 240 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 241 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 241 | u8* color_buffer = Memory::GetPointer(framebuffer_address); | 242 | u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); |
| 242 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 243 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 243 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 244 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 244 | u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; | 245 | u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; |
| @@ -253,7 +254,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 253 | case Format::RGBA5551: | 254 | case Format::RGBA5551: |
| 254 | { | 255 | { |
| 255 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 256 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 256 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); | 257 | u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); |
| 257 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 258 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 258 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 259 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 259 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); | 260 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); |