aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-04-23 01:05:04 +0200
committerStapleButter <thetotalworm@gmail.com>2017-04-23 01:05:04 +0200
commit60cdc7d6f70343a99ed5b391aafd6188447f6c14 (patch)
tree230d9cebfb96daad50e2f226a5c44e4866a69a40
parent96b471d729a0b2007818e1e32eb71f6bb04f799f (diff)
fix display capture. dumb bug of the year.
-rw-r--r--src/GPU2D.cpp2
-rw-r--r--src/GPU3D.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index e1419bf..d92d960 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 b8eb2a2..dc08841 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;