all repos — mgba @ d4d42a2eee45ab3e8777f617de168fb0515e5629

mGBA Game Boy Advance Emulator

GBA BIOS: Fix more potential regressions with signed 16-bit loads
Jeffrey Pfau jeffrey@endrift.com
Sat, 21 Feb 2015 11:01:08 -0800
commit

d4d42a2eee45ab3e8777f617de168fb0515e5629

parent

01f7036401816e53edb4ec3b1a733e5d51cd3f86

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

jump to
M src/gba/bios.csrc/gba/bios.c

@@ -90,10 +90,10 @@ // [ 0 sy 0 ] * [ sin(theta) cos(theta) 0 ] * [ 0 1 cy - oy ] = [ C D ry ]

// [ 0 0 1 ] [ 0 0 1 ] [ 0 0 1 ] [ 0 0 1 ] ox = cpu->memory.load32(cpu, offset, 0) / 256.f; oy = cpu->memory.load32(cpu, offset + 4, 0) / 256.f; - cx = cpu->memory.load16(cpu, offset + 8, 0); - cy = cpu->memory.load16(cpu, offset + 10, 0); - sx = cpu->memory.load16(cpu, offset + 12, 0) / 256.f; - sy = cpu->memory.load16(cpu, offset + 14, 0) / 256.f; + cx = (int16_t) cpu->memory.load16(cpu, offset + 8, 0); + cy = (int16_t) cpu->memory.load16(cpu, offset + 10, 0); + sx = (int16_t) cpu->memory.load16(cpu, offset + 12, 0) / 256.f; + sy = (int16_t) cpu->memory.load16(cpu, offset + 14, 0) / 256.f; theta = (cpu->memory.load16(cpu, offset + 16, 0) >> 8) / 128.f * M_PI; offset += 20; // Rotation