summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorElijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>2024-05-12 13:00:28 -0400
committerGitHub <noreply@github.com>2024-05-12 13:00:28 -0400
commit901eebc4efdc9b94c3e934bd50c4c3e3388dbd92 (patch)
tree2143634e577d2e4d5b22a90c23681060d520536e /include
parent477f6da6cdd5051fc2d1be98cbe0ef366c33822d (diff)
parentd91a82929535494924ef979dd334a77c3bbd38f1 (diff)
Merge branch 'main' into eggXfbManager
Diffstat (limited to 'include')
-rw-r--r--include/Runtime.PPCEABI.H/__va_arg.h1
-rw-r--r--include/egg/core/eggExpHeap.h7
-rw-r--r--include/egg/core/eggGraphicsFifo.h2
-rw-r--r--include/egg/core/eggHeap.h20
-rw-r--r--include/egg/prim/eggAssert.h13
-rw-r--r--include/m/m_angle.h11
-rw-r--r--include/rvl/MEM/mem_expHeap.h8
-rw-r--r--include/rvl/OS/OSError.h2
8 files changed, 43 insertions, 21 deletions
diff --git a/include/Runtime.PPCEABI.H/__va_arg.h b/include/Runtime.PPCEABI.H/__va_arg.h
index d3600d51..445bb985 100644
--- a/include/Runtime.PPCEABI.H/__va_arg.h
+++ b/include/Runtime.PPCEABI.H/__va_arg.h
@@ -36,5 +36,6 @@ void *__va_arg(_va_list_struct *, int);
#define __va_end(list) ((void)0)
#define __va_copy(a, b) (*(a) = *(b))
+#define va_copy __va_copy
#endif /* __VA_ARG_H */
diff --git a/include/egg/core/eggExpHeap.h b/include/egg/core/eggExpHeap.h
index 2cfc534d..69b35128 100644
--- a/include/egg/core/eggExpHeap.h
+++ b/include/egg/core/eggExpHeap.h
@@ -24,7 +24,12 @@ public:
/* 80495b70 */ static ExpHeap *create(void *block, size_t size, u16 attr);
/* 80495c30 */ static ExpHeap *create(size_t size, Heap *heap, u16 attr);
/* 80495d00 */ void setGroupID(u16 groupId);
- /* 80495f80 */ u32 getSizeForMBlock(const void *block);
+ /* 80495f80 */ static u32 getSizeForMBlock(const void *block);
+
+ // Placement new for ::create
+ inline void *operator new(size_t size, void *ptr) {
+ return ptr;
+ }
};
} // namespace EGG
diff --git a/include/egg/core/eggGraphicsFifo.h b/include/egg/core/eggGraphicsFifo.h
index 0e060401..8226aa90 100644
--- a/include/egg/core/eggGraphicsFifo.h
+++ b/include/egg/core/eggGraphicsFifo.h
@@ -22,7 +22,7 @@ public:
public:
/* 80576798 */ static GraphicsFifo *sGraphicsFifo;
- /* 8057679c */ static bool sGpStatus[4];
+ /* 8057679c */ static u8 sGpStatus[5];
};
} // namespace EGG
diff --git a/include/egg/core/eggHeap.h b/include/egg/core/eggHeap.h
index 969fc229..8d9ce935 100644
--- a/include/egg/core/eggHeap.h
+++ b/include/egg/core/eggHeap.h
@@ -18,12 +18,12 @@ class Allocator;
struct HeapAllocArg {
void *userArg; // 00
- u32 size; // 04
- int align; // 08
- Heap *heap; // 0C heap to allocate in
- int another; // 10
+ u32 size; // 04
+ int align; // 08
+ void *ptr; // 0C the allocated ptr
+ Heap *heap; // 10 heap to allocate in
- inline HeapAllocArg() : userArg(0), size(0), align(0), heap(nullptr) {}
+ inline HeapAllocArg() : userArg(0), size(0), align(0), heap(nullptr), ptr(nullptr) {}
};
typedef void (*HeapAllocCallback)(HeapAllocArg *arg);
@@ -37,8 +37,8 @@ typedef void (*ErrorCallback)(HeapErrorArg *);
struct HeapFreeArg {
void *userArg;
- int arg1;
- int arg2;
+ void *ptr;
+ Heap *heap;
};
typedef void (*HeapFreeCallback)(HeapFreeArg *);
@@ -57,14 +57,14 @@ public:
// vtable at 0x0 | 8056e950
/* vt 0x08 | 804954c0 */ virtual ~Heap();
/* vt 0x0C | 00000000 */ virtual eHeapKind getHeapKind() const = 0;
- /* vt 0x10 | 80495a40 */ virtual void initAllocator(Allocator *allocator, s32 align) = 0;
+ /* vt 0x10 | 80495a40 */ virtual void initAllocator(Allocator *allocator, s32 align);
/* vt 0x14 | 00000000 */ virtual void *alloc(u32 size, s32 align) = 0;
/* vt 0x18 | 00000000 */ virtual void free(void *block) = 0;
/* vt 0x1C | 00000000 */ virtual void destroy() = 0;
/* vt 0x20 | 00000000 */ virtual u32 resizeForMBlock(void *block, u32 size) = 0;
/* vt 0x24 | 00000000 */ virtual u32 getTotalFreeSize() = 0;
- /* vt 0x24 | 00000000 */ virtual u32 getAllocatableSize(s32 align) = 0;
- /* vt 0x28 | 00000000 */ virtual u32 adjust() = 0;
+ /* vt 0x28 | 00000000 */ virtual u32 getAllocatableSize(s32 align) = 0;
+ /* vt 0x2C | 00000000 */ virtual u32 adjust() = 0;
public:
void setName(const char *name) {
diff --git a/include/egg/prim/eggAssert.h b/include/egg/prim/eggAssert.h
index 0910f203..147847b9 100644
--- a/include/egg/prim/eggAssert.h
+++ b/include/egg/prim/eggAssert.h
@@ -8,14 +8,17 @@ namespace EGG {
// TODO: Fixup funtions
namespace Assert {
+typedef void (*AssertCallback)();
+
/* 8049bf90 */ void wait(u32 time);
-/* 8049c010 */ void system_print();
-/* 8049c010 */ void system_report();
-/* 8049c0a0 */ s32 getPeriodPos(char *);
+/* 8049c010 */ void system_vreport(const char *str, va_list list);
+/* 8049c010 */ void system_report(const char *str, ...);
+/* 8049c0a0 */ s32 getPeriodPos(const char *);
/* 8049c100 */ char *getMapSymbol();
/* 8049c150 */ bool isOutsideMEM1(u32 addr);
-/* 8049c190 */ void system_halt();
-/* 8049c530 */ void assert();
+/* 8049c180 */ AssertCallback setAssertCallback(AssertCallback cb);
+/* 8049c190 */ void system_halt(const char *file, u32 line, const char *msg, va_list list);
+/* 8049c530 */ void assert(const char *file, u32 line, const char *msg, ...);
} // namespace Assert
diff --git a/include/m/m_angle.h b/include/m/m_angle.h
index 29a20d18..37fca394 100644
--- a/include/m/m_angle.h
+++ b/include/m/m_angle.h
@@ -5,18 +5,25 @@
struct mAng {
mAng() {}
- mAng(s16 s) : val(s) {}
- s16 val;
+ mAng(s16 s) : mVal(s) {}
+
+ s32 step(s16 target, s32 steps, s16 max, s16 min);
+
+ s16 mVal;
};
class mAng3_c {
public:
s16 x, y, z;
+ mAng3_c(s16 fx, s16 fy, s16 fz) : x(fx), y(fy), z(fz) {}
+
void set(s16 fx, s16 fy, s16 fz) {
x = fx;
y = fy;
z = fz;
}
+
+ static mAng3_c Zero;
};
#endif
diff --git a/include/rvl/MEM/mem_expHeap.h b/include/rvl/MEM/mem_expHeap.h
index 2a8cbe88..bdf9e79a 100644
--- a/include/rvl/MEM/mem_expHeap.h
+++ b/include/rvl/MEM/mem_expHeap.h
@@ -53,8 +53,11 @@ struct MEMiHeapHead *MEMDestroyExpHeap(struct MEMiHeapHead *heap);
void *MEMAllocFromExpHeapEx(struct MEMiHeapHead *heap, u32 size, s32 align);
u32 MEMResizeForMBlockExpHeap(struct MEMiHeapHead *heap, void *memBlock, u32 size);
void MEMFreeToExpHeap(struct MEMiHeapHead *heap, void *memBlock);
+u32 MEMGetAllocatableSizeForExpHeap(struct MEMiHeapHead *heap);
u32 MEMGetAllocatableSizeForExpHeapEx(struct MEMiHeapHead *heap, s32 align);
+void MEMSetGroupIdForExpHeap(MEMiHeapHead *mHeapHandle, u16 groupId);
u32 MEMAdjustExpHeap(struct MEMiHeapHead *heap);
+u32 MEMGetSizeForMBlockExpHeap(const void *block);
static inline struct MEMiHeapHead *MEMCreateExpHeap(void *start, u32 size) {
return MEMCreateExpHeapEx(start, size, 0);
@@ -63,10 +66,11 @@ static inline struct MEMiHeapHead *MEMCreateExpHeap(void *start, u32 size) {
static inline void *MEMAllocFromExpHeap(struct MEMiHeapHead *heap, u32 size) {
return MEMAllocFromExpHeapEx(heap, size, 4);
}
-
+// This doesn't appear to be inline in SS yet
+/*
static inline u32 MEMGetAllocatableSizeForExpHeap(struct MEMiHeapHead *heap) {
return MEMGetAllocatableSizeForExpHeapEx(heap, 4);
-}
+}*/
#ifdef __cplusplus
}
diff --git a/include/rvl/OS/OSError.h b/include/rvl/OS/OSError.h
index 64ce47e1..ac9ece4b 100644
--- a/include/rvl/OS/OSError.h
+++ b/include/rvl/OS/OSError.h
@@ -1,6 +1,7 @@
#ifndef RVL_SDK_OS_ERROR_H
#define RVL_SDK_OS_ERROR_H
#include <common.h>
+#include <Runtime.PPCEABI.H/__va_arg.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -41,6 +42,7 @@ extern OSErrorHandler __OSErrorTable[OS_ERR_MAX];
extern u32 __OSFpscrEnableBits;
DECL_WEAK void OSReport(const char *msg, ...);
+DECL_WEAK void OSVReport(const char *msg, va_list args);
DECL_WEAK void OSPanic(const char *file, int line, const char *msg, ...);
OSErrorHandler OSSetErrorHandler(u16 error, OSErrorHandler handler);