Improve BIOS Math tests score from 425 to 625.
Without using BIOS file.
This commit is contained in:
parent
6f2e320d59
commit
3ba0529585
|
@ -2132,6 +2132,7 @@ void CPUSoftwareInterrupt(int comment)
|
|||
break;
|
||||
case 0x0A:
|
||||
BIOS_ArcTan2();
|
||||
reg[3].I = 0x170;
|
||||
break;
|
||||
case 0x0B: {
|
||||
int len = (reg[2].I & 0x1FFFFF) >> 1;
|
||||
|
|
|
@ -52,7 +52,8 @@ void BIOS_ArcTan()
|
|||
}
|
||||
#endif
|
||||
|
||||
int32_t a = -(((int32_t)(reg[0].I * reg[0].I)) >> 14);
|
||||
int32_t i = reg[0].I;
|
||||
int32_t a = -((i*i) >> 14);
|
||||
int32_t b = ((0xA9 * a) >> 14) + 0x390;
|
||||
b = ((b * a) >> 14) + 0x91C;
|
||||
b = ((b * a) >> 14) + 0xFB6;
|
||||
|
@ -60,8 +61,9 @@ void BIOS_ArcTan()
|
|||
b = ((b * a) >> 14) + 0x2081;
|
||||
b = ((b * a) >> 14) + 0x3651;
|
||||
b = ((b * a) >> 14) + 0xA2F9;
|
||||
a = ((int32_t)reg[0].I * b) >> 16;
|
||||
reg[0].I = a;
|
||||
reg[0].I = (i * b) >> 16;
|
||||
reg[1].I = a;
|
||||
reg[3].I = b;
|
||||
|
||||
#ifdef GBA_LOGGING
|
||||
if (systemVerbose & VERBOSE_SWI) {
|
||||
|
@ -84,7 +86,7 @@ void BIOS_ArcTan2()
|
|||
|
||||
int32_t x = reg[0].I;
|
||||
int32_t y = reg[1].I;
|
||||
uint32_t res = 0;
|
||||
int32_t res = 0;
|
||||
if (y == 0) {
|
||||
res = ((x >> 16) & 0x8000);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue