From b154457857d3367a4c0196a4abadeeb6c850ffdf Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 20 Apr 2017 23:18:51 -0700 Subject: [PATCH] GBA BIOS: More tiny fixes to ArcTan2 --- CHANGES | 2 +- src/gba/bios.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index eb9428338..66c37278a 100644 --- a/CHANGES +++ b/CHANGES @@ -39,7 +39,7 @@ Bugfixes: - 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 + - GBA BIOS: Fix ArcTan2 sign in HLE BIOS (fixes mgba.io/i/689) Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers diff --git a/src/gba/bios.c b/src/gba/bios.c index b1e9574e3..65504098f 100644 --- a/src/gba/bios.c +++ b/src/gba/bios.c @@ -359,7 +359,8 @@ void GBASwi16(struct ARMCore* cpu, int immediate) { cpu->gprs[0] = _ArcTan(cpu->gprs[0]); break; case 0xA: - cpu->gprs[0] = _ArcTan2(cpu->gprs[0], cpu->gprs[1]); + cpu->gprs[0] = (uint16_t) _ArcTan2(cpu->gprs[0], cpu->gprs[1]); + cpu->gprs[3] = 0x170; break; case 0xB: case 0xC: