Files
perfect_dark/port/include/system.h
T
fgsfds 53e881b75e port: support loading/saving from/to a directory in HOME or APPDATA
~/.local/share/perfectdark on Linux

AppData/Roaming/perfectdark on Windows

on Windows if the game has write access to the working directory it will save there by default, otherwise it will save to AppData

on Linux the game will save to the working directory if there is already a config there, otherwise it will save to ~

additionally the ROM/data files will be loaded from wherever they're found, working directory taking priority
2023-09-13 20:36:42 +02:00

43 lines
799 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 sysInit(s32 argc, const char **argv);
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));
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);
void crashInit(void);
void crashShutdown(void);
#ifdef __cplusplus
}
#endif
#endif