all repos — mgba @ 2c8068f4188be31cb231863e02bc389a3eb8625a

mGBA Game Boy Advance Emulator

DS GX: Fudge accuracy loss issue
Vicki Pfau vi@endrift.com
Mon, 13 Mar 2017 11:59:39 -0700
commit

2c8068f4188be31cb231863e02bc389a3eb8625a

parent

507a1c78e90edeb7f9185a8896255f5d6a0cd0b5

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M src/ds/gx.csrc/ds/gx.c

@@ -231,9 +231,9 @@

int32_t vx = _lerp(v0->vx, v1->vx, w0, w1, xw); int32_t vy = _lerp(v0->vy, v1->vy, w0, w1, xw); int32_t vz = _lerp(v0->vz, v1->vz, w0, w1, xw); - out->vx = (vx * wRecip) >> 32; - out->vy = (vy * wRecip) >> 32; - out->vz = (vz * wRecip) >> 32; + out->vx = ((vx * wRecip) >> 32) + 1; + out->vy = ((vy * wRecip) >> 32) + 1; + out->vz = ((vz * wRecip) >> 32) + 1; int32_t s = _lerp(v0->vs, v1->vs, w0, w1, xw); int32_t t = _lerp(v0->vt, v1->vt, w0, w1, xw);