mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-07 13:23:27 -04:00
JUTException showFloatSub
This commit is contained in:
@@ -222,10 +222,10 @@ void JUTException::setFPException(u32 fpscr_enable_bits) {
|
||||
|
||||
/* 802C50CC-802C525C .text showFloatSub__12JUTExceptionFif */
|
||||
void JUTException::showFloatSub(int index, f32 value) {
|
||||
if (fpclassify(value) == FP_NAN) {
|
||||
if (isnan(value)) {
|
||||
sConsole->print_f("F%02d: Nan ", index);
|
||||
} else if (fpclassify(value) == FP_INFINITE) {
|
||||
if (signbit(value)) {
|
||||
} else if (isinf(value)) {
|
||||
if (*((u8*)&value) & 0x80) {
|
||||
sConsole->print_f("F%02d:+Inf ", index);
|
||||
} else {
|
||||
sConsole->print_f("F%02d:-Inf ", index);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) : __fpclassifyd(x))
|
||||
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
|
||||
#define isfinite(x) ((fpclassify(x) > 2))
|
||||
#define isnan(x) ((fpclassify(x) == FP_NAN))
|
||||
#define isinf(x) ((fpclassify(x) == FP_INFINITE))
|
||||
|
||||
#define __signbitf(x) ((int)(__HI(x) & 0x80000000))
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ def import_c_file(in_file) -> str:
|
||||
out_text = ''
|
||||
|
||||
try:
|
||||
with open(in_file, encoding="shift-jis") as file:
|
||||
with open(in_file, encoding="utf8") as file:
|
||||
out_text += process_file(in_file, list(file))
|
||||
except Exception:
|
||||
with open(in_file) as file:
|
||||
|
||||
Reference in New Issue
Block a user