From 60cdc7d6f70343a99ed5b391aafd6188447f6c14 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Sun, 23 Apr 2017 01:05:04 +0200 Subject: [PATCH] fix display capture. dumb bug of the year. --- src/GPU2D.cpp | 2 +- src/GPU3D.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp index e1419bfc..d92d9609 100644 --- a/src/GPU2D.cpp +++ b/src/GPU2D.cpp @@ -547,7 +547,7 @@ void GPU2D::DoCapture(u32 line, u32 width, u32* src) dstaddr &= 0xFFFF; srcBaddr &= 0xFFFF; - switch ((DispCnt >> 29) & 0x3) + switch ((CaptureCnt >> 29) & 0x3) { case 0: // source A { diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index b8eb2a29..dc088418 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -620,7 +620,7 @@ void SubmitPolygon() normalX = (((s64)v0->Position[1] * v2->Position[3]) - ((s64)v0->Position[3] * v2->Position[1])) >> 12; normalY = (((s64)v0->Position[3] * v2->Position[0]) - ((s64)v0->Position[0] * v2->Position[3])) >> 12; normalZ = (((s64)v0->Position[0] * v2->Position[1]) - ((s64)v0->Position[1] * v2->Position[0])) >> 12; - dot = ((s64)(v1->Position[0] >> 0) * normalX) + ((s64)(v1->Position[1] >> 0) * normalY) + ((s64)(v1->Position[3] >> 0) * normalZ); + dot = ((s64)v1->Position[0] * normalX) + ((s64)v1->Position[1] * normalY) + ((s64)v1->Position[3] * normalZ); bool facingview = (dot < 0); @@ -805,6 +805,7 @@ void SubmitPolygon() // determine bounds of the polygon // also determine the W shift and normalize W + // TODO: normalization works both ways u32 vtop = 0, vbot = 0; s32 ytop = 192, ybot = 0;