mirror of
https://github.com/PodeCaradox/GalaxyQuest-SteamFrame.git
synced 2026-10-24 22:26:23 +02:00
The sources of Petari (https://github.com/SMGCommunity/Petari), the Super Mario Galaxy decompilation by the SMGCommunity, at commit 0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and src/. Left out: the game data Petari keeps from the original executable, the error message archive (include/Game/System/ ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's own disc. The port's changes follow in the next commit, so `git diff petari-base -- decomp` shows them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.1 KiB
C
55 lines
1.1 KiB
C
#include "math_api.h"
|
|
|
|
int __fpclassifyf(float f) {
|
|
int val = (*(int*)&f);
|
|
|
|
switch (val & 0x7F800000) {
|
|
case 0x7F800000:
|
|
if (val & 0x7FFFFF) {
|
|
return 1;
|
|
}
|
|
else {
|
|
return 2;
|
|
}
|
|
break;
|
|
case 0:
|
|
if (val & 0x7FFFFF) {
|
|
return 5;
|
|
}
|
|
else {
|
|
return 3;
|
|
}
|
|
break;
|
|
}
|
|
|
|
return 4;
|
|
}
|
|
|
|
int __signbitd(double dbl) {
|
|
return (*(int*)&dbl) & 0x80000000;
|
|
}
|
|
|
|
int __fpclassifyd(double dbl) {
|
|
switch ((*(int*)&dbl) & 0x7FF00000) {
|
|
case 0x7FF00000:
|
|
if (((*(int*)&dbl) & 0xFFFFF) || (*(1 + (int*)&dbl)) & 0xFFFFFFFF) {
|
|
return 1;
|
|
}
|
|
else {
|
|
return 2;
|
|
}
|
|
|
|
break;
|
|
case 0:
|
|
if (((*(int*)&dbl) & 0xFFFFF) || (*(1 + (int*)&dbl)) & 0xFFFFFFFF) {
|
|
return 5;
|
|
}
|
|
else {
|
|
return 3;
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
return 4;
|
|
} |