db_mapFile

This commit is contained in:
robojumper
2024-05-24 16:41:33 +02:00
parent d711118601
commit b2d728089e
10 changed files with 403 additions and 45 deletions
+4 -7
View File
@@ -3,17 +3,19 @@
#include <common.h>
#include <m/m_dvd.h>
#include <nw4r/db/db_mapFile.h>
#include <rvl/OS.h>
class DbMapFile {
public:
DbMapFile(): unk_0(0) {}
DbMapFile(): mMapFileHandle(nullptr) {}
~DbMapFile();
void RegisterOnDvd(const char *, const OSModuleInfo *);
void Unregister();
private:
UNKWORD unk_0;
nw4r::db::MapFileHandle mMapFileHandle;
nw4r::db::MapFile mMapFile;
};
// https://github.com/zeldaret/tp/blob/main/include/DynamicLink.h
@@ -75,11 +77,6 @@ struct DynamicModuleControl : DynamicModuleControlBase {
/* 0x2C */ mDvd_callback_c *mDvdCallbackRequest;
/* 0x30 */ EGG::ExpHeap *mHeap;
/* 0x34 */ DbMapFile mpRelMapFile;
// Some of these might be members of DbMapFile
UNKWORD unk1;
UNKWORD unk2;
UNKWORD unk3;
UNKWORD unk4;
static u32 sAllocBytes;
static mDvd_toMainRam_base_c *sDvdFile;
+2 -2
View File
@@ -10,8 +10,8 @@ extern "C" {
int fprintf(FILE* stream, const char* format, ...);
int printf(const char* format, ...);
int sprintf(const char* str, const char* format, ...);
int snprintf(const char* str, size_t n, const char* format, ...);
int sprintf(char* str, const char* format, ...);
int snprintf(char* str, size_t n, const char* format, ...);
int vsnprintf(char* str, size_t n, const char* format, va_list arg);
int vprintf(const char* format, va_list arg);
+26
View File
@@ -0,0 +1,26 @@
#ifndef DB_MAPFILE_H
#define DB_MAPFILE_H
#include <rvl/OS.h>
namespace nw4r {
namespace db {
typedef struct MapFile {
u8 *mapBuf;
const OSModuleInfo *moduleInfo;
s32 fileEntry;
MapFile *next;
} MapFile;
typedef MapFile* MapFileHandle;
MapFileHandle MapFile_RegistOnDvd(void*, const char*, const OSModuleInfo*);
void MapFile_Unregist(MapFileHandle);
void MapFile_UnregistAll();
bool MapFile_QuerySymbol(u32 address, u8 *strBuf, u32 strBufSize);
} // namespace db
} // namespace nw4r
#endif
+1
View File
@@ -105,6 +105,7 @@ BOOL OSLinkFixed(OSModuleInfo* newModule, void* bss);
BOOL OSUnlink(OSModuleInfo* module);
void OSSetStringTable(void* string_table);
void __OSModuleInit(void);
OSModuleInfo* OSSearchModule(void* ptr, u32* section, u32* offset);
#ifdef __cplusplus
};