all repos — mgba @ c9d411a762ec6ef13c3108d0479408f8326df442

mGBA Game Boy Advance Emulator

GBA BIOS: Fix ArcTan sign in HLE BIOS
Vicki Pfau vi@endrift.com
Thu, 20 Apr 2017 17:53:01 -0700
commit

c9d411a762ec6ef13c3108d0479408f8326df442

parent

997ba3572b0fd15ec5f0f5575720dec77c1904c8

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

jump to
M CHANGESCHANGES

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

- GB: Fix flickering when screen is strobed quickly - 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 Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M src/gba/bios.csrc/gba/bios.c

@@ -271,7 +271,7 @@ cpu->gprs[3] = 1;

} } -static int16_t _ArcTan(int16_t i) { +static int16_t _ArcTan(int32_t i) { int32_t a = -((i * i) >> 14); int32_t b = ((0xA9 * a) >> 14) + 0x390; b = ((b * a) >> 14) + 0x91C;

@@ -356,7 +356,7 @@ case 0x8:

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