all repos — mgba @ 415298ebcd0d702581d9b7d4244c4a69cc0dd54f

mGBA Game Boy Advance Emulator

GBA BIOS: Fix ArcTan2 accuracy and boundary conditions
Jeffrey Pfau jeffrey@endrift.com
Thu, 16 Jun 2016 00:19:20 -0700
commit

415298ebcd0d702581d9b7d4244c4a69cc0dd54f

parent

eb6cedde2e11184c560dc69717891d0c00c96452

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

jump to
M CHANGESCHANGES

@@ -27,6 +27,7 @@ - SDL: Fix SDL 1.2 build

- ARM7: Fix flags on SBC/RSC - Util: Fix realloc semantics in utf16to8 - ARM7: Fix setting spsr privilege bits when spsr is empty + - GBA BIOS: Fix ArcTan2 accuracy and boundary conditions Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M src/gba/bios.csrc/gba/bios.c

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

cpu->gprs[0] = sqrt((uint32_t) cpu->gprs[0]); break; case 0xA: - cpu->gprs[0] = atan2f(cpu->gprs[1] / 16384.f, cpu->gprs[0] / 16384.f) / (2 * M_PI) * 0x10000; + cpu->gprs[0] = (uint16_t) (atan2f(cpu->gprs[1] / 16384.f, cpu->gprs[0] / 16384.f) / (2 * M_PI) * 0x10001); break; case 0xB: case 0xC: