|
|
@ -199,7 +199,7 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|
|
|
auto framebuffer = Pica::registers.framebuffer;
|
|
|
|
auto framebuffer = Pica::registers.framebuffer;
|
|
|
|
using Framebuffer = decltype(framebuffer);
|
|
|
|
using Framebuffer = decltype(framebuffer);
|
|
|
|
|
|
|
|
|
|
|
|
framebuffer_address = framebuffer.GetColorBufferAddress();
|
|
|
|
framebuffer_address = framebuffer.GetColorBufferPhysicalAddress();
|
|
|
|
framebuffer_width = framebuffer.GetWidth();
|
|
|
|
framebuffer_width = framebuffer.GetWidth();
|
|
|
|
framebuffer_height = framebuffer.GetHeight();
|
|
|
|
framebuffer_height = framebuffer.GetHeight();
|
|
|
|
framebuffer_format = static_cast<Format>(framebuffer.color_format);
|
|
|
|
framebuffer_format = static_cast<Format>(framebuffer.color_format);
|
|
|
@ -224,7 +224,7 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|
|
|
case Format::RGBA8:
|
|
|
|
case Format::RGBA8:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
|
|
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
|
|
|
u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address);
|
|
|
|
u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
|
|
|
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
|
|
|
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
|
|
|
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
|
|
|
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
|
|
|
u32 value = *(color_buffer + x + y * framebuffer_width);
|
|
|
|
u32 value = *(color_buffer + x + y * framebuffer_width);
|
|
|
@ -239,7 +239,7 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|
|
|
case Format::RGB8:
|
|
|
|
case Format::RGB8:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
|
|
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
|
|
|
u8* color_buffer = Memory::GetPointer(framebuffer_address);
|
|
|
|
u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
|
|
|
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
|
|
|
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
|
|
|
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
|
|
|
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
|
|
|
u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width;
|
|
|
|
u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width;
|
|
|
@ -254,7 +254,7 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|
|
|
case Format::RGBA5551:
|
|
|
|
case Format::RGBA5551:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
|
|
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
|
|
|
u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address);
|
|
|
|
u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
|
|
|
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
|
|
|
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
|
|
|
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
|
|
|
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
|
|
|
u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2);
|
|
|
|
u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2);
|
|
|
|