mirror of https://github.com/mgba-emu/mgba.git
DS GX: Fixed viewport calculations (fixes #709)
This commit is contained in:
parent
de55e44152
commit
9dfcef3f45
1
CHANGES
1
CHANGES
|
@ -4,6 +4,7 @@ Features:
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- DS GX: Fix vertex texture transformation (fixes mgba.io/i/702)
|
- DS GX: Fix vertex texture transformation (fixes mgba.io/i/702)
|
||||||
- DS GX: Automatically normalize winding culling calculations (fixes mgba.io/i/699)
|
- DS GX: Automatically normalize winding culling calculations (fixes mgba.io/i/699)
|
||||||
|
- DS GX: Fixed viewport calculations (fixes mgba.io/i/709)
|
||||||
Misc:
|
Misc:
|
||||||
- DS GX: Clean up and unify texture mapping
|
- DS GX: Clean up and unify texture mapping
|
||||||
- DS Core: Add symbol loading
|
- DS Core: Add symbol loading
|
||||||
|
|
|
@ -498,7 +498,7 @@ static void _preparePoly(struct DSGXRenderer* renderer, struct DSGXVertex* verts
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t v0x = (v0->viewCoord[0] + v0w) * (int64_t) (v0->viewportWidth << 12) / (v0w * 2) + (v0->viewportX << 12);
|
int32_t v0x = (v0->viewCoord[0] + v0w) * (int64_t) (v0->viewportWidth << 12) / (v0w * 2) + (v0->viewportX << 12);
|
||||||
int32_t v0y = (-v0->viewCoord[1] + v0w) * (int64_t) (v0->viewportHeight << 12) / (v0w * 2) + (v0->viewportY << 12);
|
int32_t v0y = (DS_VIDEO_VERTICAL_PIXELS << 12) - ((v0->viewCoord[1] + v0w) * (int64_t) (v0->viewportHeight << 12) / (v0w * 2) + (v0->viewportY << 12));
|
||||||
if (poly->minY > v0y >> 12) {
|
if (poly->minY > v0y >> 12) {
|
||||||
poly->minY = v0y >> 12;
|
poly->minY = v0y >> 12;
|
||||||
}
|
}
|
||||||
|
@ -515,7 +515,7 @@ static void _preparePoly(struct DSGXRenderer* renderer, struct DSGXVertex* verts
|
||||||
v1w = 1;
|
v1w = 1;
|
||||||
}
|
}
|
||||||
int32_t v1x = (v1->viewCoord[0] + v1w) * (int64_t) (v1->viewportWidth << 12) / (v1w * 2) + (v1->viewportX << 12);
|
int32_t v1x = (v1->viewCoord[0] + v1w) * (int64_t) (v1->viewportWidth << 12) / (v1w * 2) + (v1->viewportX << 12);
|
||||||
int32_t v1y = (-v1->viewCoord[1] + v1w) * (int64_t) (v1->viewportHeight << 12) / (v1w * 2) + (v1->viewportY << 12);
|
int32_t v1y = (DS_VIDEO_VERTICAL_PIXELS << 12) - ((v1->viewCoord[1] + v1w) * (int64_t) (v1->viewportHeight << 12) / (v1w * 2) + (v1->viewportY << 12));
|
||||||
if (poly->minY > v1y >> 12) {
|
if (poly->minY > v1y >> 12) {
|
||||||
poly->minY = v1y >> 12;
|
poly->minY = v1y >> 12;
|
||||||
}
|
}
|
||||||
|
@ -574,7 +574,7 @@ static void _preparePoly(struct DSGXRenderer* renderer, struct DSGXVertex* verts
|
||||||
v1w = 1;
|
v1w = 1;
|
||||||
}
|
}
|
||||||
int32_t v1x = (v1->viewCoord[0] + v1w) * (int64_t) (v1->viewportWidth << 12) / (v1w * 2) + (v1->viewportX << 12);
|
int32_t v1x = (v1->viewCoord[0] + v1w) * (int64_t) (v1->viewportWidth << 12) / (v1w * 2) + (v1->viewportX << 12);
|
||||||
int32_t v1y = (-v1->viewCoord[1] + v1w) * (int64_t) (v1->viewportHeight << 12) / (v1w * 2) + (v1->viewportY << 12);
|
int32_t v1y = (DS_VIDEO_VERTICAL_PIXELS << 12) - ((v1->viewCoord[1] + v1w) * (int64_t) (v1->viewportHeight << 12) / (v1w * 2) + (v1->viewportY << 12));
|
||||||
|
|
||||||
if (poly->minY > v1y >> 12) {
|
if (poly->minY > v1y >> 12) {
|
||||||
poly->minY = v1y >> 12;
|
poly->minY = v1y >> 12;
|
||||||
|
|
Loading…
Reference in New Issue