summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAetias <144526980+AetiasHax@users.noreply.github.com>2025-07-21 19:09:56 +0200
committerGitHub <noreply@github.com>2025-07-21 19:09:56 +0200
commitaee9c362bbeb9ae717f4b93cbbd5fa0dd9a71450 (patch)
tree76d68901c25694abd6e3b7f90821e36229accf32 /include
parent32cc123547fef2ff4aa170ef27ee0a825957a859 (diff)
ActorRupee 90% (#124)
* Remove `force_data` macro * Use size_t in `operator new` * Bump objdiff to v3.0.0-beta.10 * Decompile functions using gRandom * ActorRupee 90% * Fix old gRandom.Next calls * Revert objdiff * Clean up
Diffstat (limited to 'include')
-rw-r--r--include/Actor/ActorType.hpp13
-rw-r--r--include/System/Random.hpp6
-rw-r--r--include/System/SysNew.hpp6
-rw-r--r--include/global.h4
-rw-r--r--include/types.h1
5 files changed, 14 insertions, 16 deletions
diff --git a/include/Actor/ActorType.hpp b/include/Actor/ActorType.hpp
index 6101cd2c..30f2b0d1 100644
--- a/include/Actor/ActorType.hpp
+++ b/include/Actor/ActorType.hpp
@@ -95,14 +95,13 @@ enum ActorTypeId_ {
class ActorType_UnkClass {
public:
- u32 unk_00;
- u32 unk_04;
- u32 unk_08;
- u32 unk_0C;
- u32 unk_10;
+ /* 0 */ u32 mUnk_0;
+ /* 4 */ s32 mUnk_4;
+ /* 8 */
+
ActorType_UnkClass(u32 unk_00, u32 unk_04) :
- unk_00(unk_00),
- unk_04(unk_04) {}
+ mUnk_0(unk_00),
+ mUnk_4(unk_04) {}
};
class Actor;
diff --git a/include/System/Random.hpp b/include/System/Random.hpp
index cc1f2a12..02bed0bd 100644
--- a/include/System/Random.hpp
+++ b/include/System/Random.hpp
@@ -12,10 +12,10 @@ struct Random {
/**
* Generate a random number from 0 (inclusive) to `max` (exclusive)
*/
- inline u32 Next(u32 max) {
+ inline u32 Next(u32 min, u32 max) {
mRandomValue = mAddend + mFactor * mRandomValue;
- u64 result = (mRandomValue >> 32) * max;
- return result >> 32;
+ u64 result = (mRandomValue >> 32) * (max - min);
+ return (result >> 32) + min;
}
};
diff --git a/include/System/SysNew.hpp b/include/System/SysNew.hpp
index 5b3089ed..e488166b 100644
--- a/include/System/SysNew.hpp
+++ b/include/System/SysNew.hpp
@@ -3,6 +3,8 @@
#include "global.h"
#include "types.h"
+#include <stddef.h>
+
struct UnkStruct_0202e894 {
/* 00 */ u32 mId;
/* 04 */ u32 *mUnk_04;
@@ -19,8 +21,8 @@ extern u32 *data_027e0ce0[];
class SysObject {
public:
- static void *operator new(unsigned long length, u32 *id, u32 idLength);
- static void *operator new[](unsigned long length, u32 *id, u32 idLength);
+ static void *operator new(size_t length, u32 *id, u32 idLength);
+ static void *operator new[](size_t length, u32 *id, u32 idLength);
static void operator delete(void *ptr);
static void operator delete[](void *ptr);
};
diff --git a/include/global.h b/include/global.h
index a12885e7..449b8dfa 100644
--- a/include/global.h
+++ b/include/global.h
@@ -26,8 +26,4 @@
#pragma define_section sbss ".data" \
".sbss"
-// Force variables to be in .data by using #pragma section force_data begin|end
-#pragma define_section force_data ".data" \
- ".data"
-
#endif
diff --git a/include/types.h b/include/types.h
index 5d42ab41..06b45bbb 100644
--- a/include/types.h
+++ b/include/types.h
@@ -16,6 +16,7 @@ typedef char s8;
typedef s8 unk8;
typedef s16 unk16;
typedef s32 unk32;
+typedef s64 unk64;
#ifndef __cplusplus
typedef s32 bool;