Skip to content

Commit

Permalink
GBA BIOS: Fix ArcTan2 accuracy and boundary conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Jun 16, 2016
1 parent eb6cedd commit 415298e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Bugfixes:
- 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
Expand Down
2 changes: 1 addition & 1 deletion src/gba/bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void GBASwi16(struct ARMCore* cpu, int immediate) {
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:
Expand Down

0 comments on commit 415298e

Please sign in to comment.