all repos — mgba @ fb94f99cd81a49cfc9cd81e38925425abc698f61

mGBA Game Boy Advance Emulator

DS GX: Fix texture matrix magnitudes
Vicki Pfau vi@endrift.com
Mon, 06 Mar 2017 00:59:59 -0800
commit

fb94f99cd81a49cfc9cd81e38925425abc698f61

parent

e1e627e4960d463a88cb60200b00a03c22ae0a3c

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

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

@@ -244,10 +244,10 @@ int64_t sum;

switch (mode) { case 1: a = col[0]; - b = vertex->s; + b = vertex->s << 8; sum = a * b; a = col[4]; - b = vertex->t; + b = vertex->t << 8; sum += a * b; a = col[8]; b = MTX_ONE >> 4;

@@ -260,19 +260,19 @@ case 2:

return 0; case 3: a = col[0]; - b = vertex->vx; + b = vertex->vx << 8; sum = a * b; a = col[4]; - b = vertex->vy; + b = vertex->vy << 8; sum += a * b; a = col[8]; - b = vertex->vz; + b = vertex->vz << 8; sum += a * b; a = col[12]; b = MTX_ONE; sum += a * b; } - return sum >> 12; + return sum >> 20; } static void _emitVertex(struct DSGX* gx, uint16_t x, uint16_t y, uint16_t z) {