GBA BIOS: Fix ArcTan sign in HLE BIOS

This commit is contained in:
Vicki Pfau 2017-04-20 17:53:01 -07:00
parent 997ba3572b
commit c9d411a762
2 changed files with 3 additions and 2 deletions

View File

@ -38,6 +38,7 @@ Bugfixes:
- GB: Fix flickering when screen is strobed quickly - GB: Fix flickering when screen is strobed quickly
- FFmpeg: Fix overflow and general issues with audio encoding - FFmpeg: Fix overflow and general issues with audio encoding
- Qt: Fix crash when changing audio settings after a game is closed - Qt: Fix crash when changing audio settings after a game is closed
- GBA BIOS: Fix ArcTan sign in HLE BIOS
Misc: Misc:
- SDL: Remove scancode key input - SDL: Remove scancode key input
- GBA Video: Clean up unused timers - GBA Video: Clean up unused timers

View File

@ -271,7 +271,7 @@ static void _Div(struct GBA* gba, int32_t num, int32_t denom) {
} }
} }
static int16_t _ArcTan(int16_t i) { static int16_t _ArcTan(int32_t i) {
int32_t a = -((i * i) >> 14); int32_t a = -((i * i) >> 14);
int32_t b = ((0xA9 * a) >> 14) + 0x390; int32_t b = ((0xA9 * a) >> 14) + 0x390;
b = ((b * a) >> 14) + 0x91C; b = ((b * a) >> 14) + 0x91C;
@ -356,7 +356,7 @@ void GBASwi16(struct ARMCore* cpu, int immediate) {
cpu->gprs[0] = sqrt((uint32_t) cpu->gprs[0]); cpu->gprs[0] = sqrt((uint32_t) cpu->gprs[0]);
break; break;
case 0x9: case 0x9:
cpu->gprs[0] = (uint16_t) _ArcTan(cpu->gprs[0]); cpu->gprs[0] = _ArcTan(cpu->gprs[0]);
break; break;
case 0xA: case 0xA:
cpu->gprs[0] = (uint16_t) _ArcTan2(cpu->gprs[0], cpu->gprs[1]); cpu->gprs[0] = (uint16_t) _ArcTan2(cpu->gprs[0], cpu->gprs[1]);