all repos — mgba @ 16023b2994b052aa5a75fe9721742cbc891f329c

mGBA Game Boy Advance Emulator

GBA BIOS: Fix ArcTan2 sign in HLE BIOS (fixes #689)
Vicki Pfau vi@endrift.com
Thu, 20 Apr 2017 17:59:02 -0700
commit

16023b2994b052aa5a75fe9721742cbc891f329c

parent

e37091595b7aac206f78ab20da9439d275593f02

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -20,6 +20,7 @@ - SDL: Fix race condition with audio thread when starting

- FFmpeg: Fix overflow and general issues with audio encoding - Qt: Fix crash when changing audio settings after a game is closed - GBA BIOS: Fix ArcTan sign in HLE BIOS + - GBA BIOS: Fix ArcTan2 sign in HLE BIOS Misc: - Qt: Improved HiDPI support - Feature: Support ImageMagick 7
M src/gba/bios.csrc/gba/bios.c

@@ -282,7 +282,7 @@ b = ((b * a) >> 14) + 0xA2F9;

return (i * b) >> 16; } -static int16_t _ArcTan2(int16_t x, int16_t y) { +static int16_t _ArcTan2(int32_t x, int32_t y) { if (!y) { if (x >= 0) { return 0;

@@ -298,7 +298,7 @@ }

if (y >= 0) { if (x >= 0) { if (x >= y) { - return _ArcTan((y << 14)/ x); + return _ArcTan((y << 14) / x); } } else if (-x >= y) { return _ArcTan((y << 14) / x) + 0x8000;

@@ -358,7 +358,7 @@ case 0x9:

cpu->gprs[0] = _ArcTan(cpu->gprs[0]); break; case 0xA: - cpu->gprs[0] = (uint16_t) _ArcTan2(cpu->gprs[0], cpu->gprs[1]); + cpu->gprs[0] = _ArcTan2(cpu->gprs[0], cpu->gprs[1]); break; case 0xB: case 0xC: