Files
perfect_dark/port/include/system.h
T
fgsfds de3b8ff548 port: revert multithreaded audio experiments
until I can figure out how to fix all the funny concurrency issues that cropped up
2024-05-19 19:44:34 +02:00

51 lines
990 B
C

#ifndef _IN_SYSTEM_H
#define _IN_SYSTEM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <PR/ultratypes.h>
enum LogLevel {
LOG_NOTE,
LOG_WARNING,
LOG_ERROR,
};
void sysInitArgs(s32 argc, const char **argv);
void sysInit(void);
s32 sysArgCheck(const char *arg);
const char *sysArgGetString(const char *arg);
s32 sysArgGetInt(const char *arg, s32 defval);
u64 sysGetMicroseconds(void);
void sysFatalError(const char *fmt, ...) __attribute__((noreturn));
s32 sysLogIsOpen(void);
void sysLogPrintf(s32 level, const char *fmt, ...);
void sysGetExecutablePath(char *outPath, const u32 outLen);
void sysGetHomePath(char *outPath, const u32 outLen);
void *sysMemAlloc(const u32 size);
void *sysMemZeroAlloc(const u32 size);
void sysMemFree(void *ptr);
// hns is specified in 100ns units
void sysSleep(const s64 hns);
// yield CPU if supported (e.g. during a busy loop)
void sysCpuRelax(void);
void crashInit(void);
void crashShutdown(void);
#ifdef __cplusplus
}
#endif
#endif