2020-09-05 20:12:14 +02:00
|
|
|
#ifndef DRIVER2_H
|
|
|
|
#define DRIVER2_H
|
|
|
|
|
2021-05-07 18:11:32 +02:00
|
|
|
#include <types.h>
|
|
|
|
#include <libcd.h>
|
|
|
|
#include <libgte.h>
|
|
|
|
#include <libgpu.h>
|
|
|
|
#include <libspu.h>
|
|
|
|
#include <libmcrd.h>
|
|
|
|
#include <libmath.h>
|
|
|
|
#include <libetc.h>
|
|
|
|
#include <libapi.h>
|
2020-09-05 20:12:14 +02:00
|
|
|
|
2021-05-07 18:11:32 +02:00
|
|
|
#include <inline_c.h>
|
2021-05-09 23:16:50 +02:00
|
|
|
#include <gtemac.h>
|
2021-05-07 18:11:32 +02:00
|
|
|
|
|
|
|
#include <strings.h>
|
|
|
|
#include <rand.h>
|
2021-04-18 21:52:27 +02:00
|
|
|
#include <stdio.h>
|
2021-05-07 18:11:32 +02:00
|
|
|
#include <limits.h>
|
2021-04-18 21:52:27 +02:00
|
|
|
|
2021-04-10 21:24:05 +02:00
|
|
|
#include "platform.h"
|
2020-09-05 20:12:14 +02:00
|
|
|
|
2021-04-09 10:33:27 +02:00
|
|
|
#define USE_PC_FILESYSTEM !defined(PSX) // PC filesystem is prioritized over CD
|
2021-04-09 11:44:49 +02:00
|
|
|
#define USE_CD_FILESYSTEM 1 // use always
|
2021-04-09 10:33:27 +02:00
|
|
|
|
2020-09-05 20:12:14 +02:00
|
|
|
#ifdef PSX
|
|
|
|
// TODO: Include PSX STUFF
|
2021-04-25 15:55:50 +02:00
|
|
|
#define trap(code)
|
2020-12-28 09:51:40 +01:00
|
|
|
|
2021-04-25 00:30:34 +02:00
|
|
|
#define printMsg printf
|
|
|
|
#define printInfo printf
|
|
|
|
#define printWarning printf
|
|
|
|
#define printError printf
|
2020-12-28 09:51:40 +01:00
|
|
|
|
2021-04-29 00:56:05 +02:00
|
|
|
#define LOAD_OVERLAY(filename, addr) Loadfile(filename, (char*)addr)
|
2021-04-25 15:55:50 +02:00
|
|
|
|
2020-09-05 20:12:14 +02:00
|
|
|
#else
|
|
|
|
|
2021-04-04 21:33:43 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2021-02-14 20:05:50 +01:00
|
|
|
#define printMsg PsyX_Log
|
|
|
|
#define printInfo PsyX_Log_Info
|
|
|
|
#define printWarning PsyX_Log_Warning
|
|
|
|
#define printError PsyX_Log_Error
|
2020-12-28 09:51:40 +01:00
|
|
|
|
2021-04-09 18:00:28 +02:00
|
|
|
#ifdef __EMSCRIPTEN__
|
|
|
|
#define trap(ode) {printError("EXCEPTION code: %x\n", ode);}
|
|
|
|
#elif _MSC_VER >= 1400
|
2020-09-05 20:12:14 +02:00
|
|
|
#define trap(ode) {printError("EXCEPTION code: %x\n", ode); __debugbreak();}
|
2020-09-27 00:44:27 +02:00
|
|
|
#elif defined(__GNUC__)
|
|
|
|
#define trap(ode) {__asm__("int3");}
|
2020-09-05 20:12:14 +02:00
|
|
|
#else
|
|
|
|
#define trap(ode) {_asm int 0x03}
|
|
|
|
#endif
|
|
|
|
|
2021-04-25 15:55:50 +02:00
|
|
|
#define LOAD_OVERLAY(filename, addr) 1
|
|
|
|
|
2020-09-05 20:12:14 +02:00
|
|
|
#endif // PSX
|
|
|
|
|
2021-04-25 15:55:50 +02:00
|
|
|
#define D_CHECK_ERROR(expr, message) if(expr){ printError("%s - %s\n", FUNCNAME, message); while (FrameCnt != 0x78654321) trap(0x400); }
|
|
|
|
|
2020-12-28 11:28:40 +01:00
|
|
|
#include "reversing.h"
|
2020-09-10 18:07:29 +02:00
|
|
|
|
2020-12-28 11:28:40 +01:00
|
|
|
#include "version.h"
|
|
|
|
#include "dr2math.h"
|
|
|
|
#include "dr2limits.h"
|
|
|
|
#include "dr2types.h"
|
|
|
|
#include "dr2locale.h"
|
2020-09-05 20:12:14 +02:00
|
|
|
|
|
|
|
#endif // DRIVER2_H
|