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
This commit is contained in:
Aetias
2025-07-21 19:09:56 +02:00
committed by GitHub
parent 32cc123547
commit aee9c362bb
21 changed files with 103 additions and 68 deletions
+3 -3
View File
@@ -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;
}
};
+4 -2
View File
@@ -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);
};