feat(profile): more bc routines

This commit is contained in:
phaneron 2025-03-06 16:40:31 -05:00
parent 1e6fb307de
commit fb267a5683
35 changed files with 818 additions and 2959 deletions

View file

@ -41,7 +41,7 @@ enum Blizzard__File__Operation {
num_operations
};
#define FS_OP(N) bool (*f_##N)(Blizzard__File__Filesystem* fs, System_File__Stacked__FileParms* parms)
#define FS_OP(N) bool (*N)(Blizzard__File__Filesystem* fs, System_File__Stacked__FileParms* parms)
// 0x7C bytes = 4 + 4 + (29 * 4)
struct Blizzard__File__Filesystem {

View file

@ -0,0 +1,22 @@
#ifndef BC_FILE_INFO_H
#define BC_FILE_INFO_H
#include "bc/time/timestamp.h"
DECLARE_STRUCT(Blizzard__File__FileInfo);
struct Blizzard__File__FileInfo {
char* name;
uint32_t unk04;
// uint32_t unk08;
// uint32_t unk0C;
uint64_t size; // 08
uint32_t attributes;
Blizzard__Time__Timestamp creationTime;
Blizzard__Time__Timestamp lastWriteTime;
Blizzard__Time__Timestamp lastAccessTime;
int32_t exists;
int32_t normal;
};
#endif

View file

@ -0,0 +1,15 @@
#ifndef BC_FILE_PROCESS_DIR_H
#define BC_FILE_PROCESS_DIR_H
DECLARE_STRUCT(Blizzard__File__ProcessDirParms);
struct Blizzard__File__ProcessDirParms {
const char* dir;
const char* item;
void* param;
bool isdir;
};
typedef bool (*Blizzard__File__ProcessDirCallback)(const Blizzard__File__ProcessDirParms* parms);
#endif

View file

@ -1,10 +1,19 @@
#ifndef BC_FILE_STREAM_H
#define BC_FILE_STREAM_H
#include "bc/file/info.h"
DECLARE_STRUCT(Blizzard__File__StreamRecord);
struct Blizzard__File__StreamRecord {
void* handle;
void* filehandle;
uint32_t flags;
bool haveinfo;
uint32_t unk0C;
Blizzard__File__FileInfo info;
int32_t* unk48;
char* name; // name is a pointer to &filehandle (0x00) + sizeof(StreamRecord)
// extra buffer that holds the actual data of name
};
#endif

View file

@ -0,0 +1,11 @@
#ifndef BC_LOCK_DO_ONCE_H
#define BC_LOCK_DO_ONCE_H
DECLARE_STRUCT(Blizzard__Lock__DoOnceData);
struct Blizzard__Lock__DoOnceData {
bool done;
int32_t atomic;
};
#endif

View file

@ -0,0 +1,15 @@
#ifndef BC_STRING_QUICK_NATIVE_PATH_H
#define BC_STRING_QUICK_NATIVE_PATH_H
#define BC_STRING_QUICK_NATIVE_PATH(N) \
typedef struct Blizzard__String__QuickNativePath_##N Blizzard__String__QuickNativePath_##N; \
struct Blizzard__String__QuickNativePath_##N { \
uint32_t length; \
char* path; \
char buffer[N]; \
}
BC_STRING_QUICK_NATIVE_PATH(300);
BC_STRING_QUICK_NATIVE_PATH(1024);
#endif

View file

@ -1,10 +1,35 @@
#ifndef BC_SYSTEM_FILE_STACKED_H
#define BC_SYSTEM_FILE_STACKED_H
#include "system/types.h"
#include "bc/file/stream.h"
#include "bc/file/info.h"
#include "bc/file/processdir.h"
DECLARE_STRUCT(System_File__Stacked__FileParms);
struct System_File__Stacked__FileParms {
uint32_t offset;
// the offset of the file operation
// inside Blizzard::File::Filesystem
uint32_t op; //0x0
// name/path to a file or directory
char* name; //0x4
char* newname; // 0x8
Blizzard__File__StreamRecord* file; // 0xC
Blizzard__File__FileInfo* info;
uint32_t extra[17]; // 0x10
uint32_t flags;
void* data; //
uint32_t count;
int64_t offset;
uint32_t unk__;
char* buffer;
int32_t buffersize;
bool unkbool1;
bool unkbool2;
void* dirwalkparam;
Blizzard__File__ProcessDirCallback dirwalkcallback;
uint32_t extra3[2];
};
#endif

View file

@ -0,0 +1,6 @@
#ifndef BC_TIME_TIMESTAMP_H
#define BC_TIME_TIMESTAMP_H
typedef int64_t Blizzard__Time__Timestamp;
#endif

View file

@ -3,12 +3,12 @@
#include "system/types.h"
#if !defined(DECLARE_HANDLE)
#define DECLARE_HANDLE(name) \
typedef struct name##__ { \
#define DECLARE_HANDLE(I) \
typedef struct I##__ I##__; \
struct I##__ { \
int32_t unused; \
}* name
#endif
}; \
typedef I##__* I
DECLARE_STRUCT(CHandleObject);

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,6 @@ DECLARE_STRUCT(TEXTURECACHE);
DECLARE_STRUCT(TEXTURECACHEROW);
STORM_TS_LIST(CGxFont);
STORM_TS_LIST(CHARCODEDESC);
STORM_TS_HASH(CHARCODEDESC, HASHKEY_NONE);

View file

@ -23,21 +23,23 @@ enum CGxFormat__Format {
struct CGxFormat {
uint32_t unk0;
bool hwTnL;
// TODO: verify this name
bool hwCursor; // 0x5
bool hwCursor; // 0x5, UC
int8_t fixLag;
int8_t window;
uint32_t unk8;
bool aspect; // UC
int32_t maximize;
CGxFormat__Format depthFormat;
C2iVector size;
uint32_t unk1C;
// set by CVGxTripleBufferCallback
uint32_t backbuffers; // buffering? buffer? framebufferCount?
uint32_t sampleCount;
float float24; // multisampleQuality? write at 00769693
float multisampleQuality; // UC, write at 00769693
CGxFormat__Format colorFormat;
uint32_t refreshRate;
uint32_t vsync;
uint32_t unk34;
bool stereoEnabled; // UC, 34
// something to do with fixed function?
// write at 0076AD4C
uint32_t unk38;
uint32_t unk3C;
uint32_t unk40;

View file

@ -15,8 +15,12 @@
#include "bc/file/filesystem.h"
#include "bc/file/stream.h"
#include "bc/file/processdir.h"
#include "bc/lock/do_once.h"
#include "bc/string/quicknativepath.h"
#include "bc/systemfile/stacked.h"
#include "bc/osfile.h"
#include "bc/time/timestamp.h"
#include "camera/camera.h"
@ -125,6 +129,7 @@
#include "storm/array/uint8_t.h"
#include "storm/array/uint32_t.h"
#include "storm/array/float.h"
#include "storm/array/c2ivector.h"
#include "storm/queue/timer_priority_uint32_t.h"

View file

@ -0,0 +1,10 @@
#ifndef STORM_ARRAY_C_2I_VECTOR_H
#define STORM_ARRAY_C_2I_VECTOR_H
#include "tempest/vector.h"
#include "storm/array.h"
STORM_TS_GROWABLE_ARRAY(C2iVector);
#endif

View file

@ -1,7 +1,7 @@
#ifndef SYSTEM_DETECT_H
#define SYSTEM_DETECT_H
#if !defined(IDA) && !defined(GHIDRA) && !defined(BINANA_GENERATOR)
#if !defined(__GNUC__) && !defined(IDA) && !defined(GHIDRA) && !defined(BINANA_GENERATOR)
#error "Preprocessor mode not detected! You must define either IDA or GHIDRA or BINANA_GENERATOR"
#endif

View file

@ -5,6 +5,5 @@
DECLARE_HANDLE(HTEXTBLOCK);
DECLARE_HANDLE(HTEXTFONT);
DECLARE_HANDLE(HFACE);
#endif