41 #ifndef DISABLE_TEXT_CONSOLE 42 std::fputs(
"WARNING: ", stderr);
43 std::fputs(buf, stderr);
44 std::fputs(
"!\n", stderr);
60 #ifndef DISABLE_TEXT_CONSOLE 61 std::fputs(buf, stderr);
62 std::fputs(
"\n", stderr);
69 void info(
const char *s, ...) {
77 #ifndef DISABLE_TEXT_CONSOLE 78 std::fputs(buf, stdout);
79 std::fputs(
"\n", stdout);
94 #ifndef DISABLE_TEXT_CONSOLE 95 std::fputs(
"ERROR: ", stderr);
96 std::fputs(buf, stderr);
97 std::fputs(
"!\n", stderr);
163 assert((iBits + fBits + (sign ? 1 : 0)) <= 32);
167 const uint32 iMask = ((
UINT64_C(1) << (iBits + fBits)) - 1) - fMask;
171 const uint32 fDiv = (1 << fBits);
174 int32 fPart = value & fMask;
175 int32 iPart = (value & iMask) >> fBits;
178 if (sign && ((value & sMask) != 0))
179 iPart = -((
int32) ((~iPart & (iMask >> fBits)) + 1));
181 return (
double)iPart + ((double) fPart) / ((double) fDiv);
200 if ((value & 0x7FFF) == 0)
203 uint16 vS = value & 0x8000;
204 uint16 vE = value & 0x7C00;
205 uint16 vM = value & 0x03FF;
240 }
while ((vM & 0x0400) == 0);
double convertIEEEDouble(uint64 data)
Convert a uint64 holding the bit pattern of a 64-bit IEEE 754 double precision floating point value i...
The debug manager, managing debug channels.
Utility templates and functions.
void info(const char *s,...)
double readNintendoFixedPoint(uint32 value, bool sign, uint8 iBits, uint8 fBits)
Read a fixed-point value, in a format used by the Nintendo DS.
void warning(const char *s,...)
#define DebugMan
Shortcut for accessing the debug manager.
float convertIEEEFloat(uint32 data)
Convert a uint32 holding the bit pattern of a 32-bit IEEE 754 single precision floating point value i...
void status(const char *s,...)
float readIEEEFloat16(uint16 value)
Read a half-precision 16-bit IEEE float, converting it into a 32-bit iEEE float.
void NORETURN_PRE error(const char *s,...)