mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Use Romfile in place of vromStart and vromEnd in structs (#1742)
* KaleidoMgrOverlay * GameStateOverlay * ActorOverlay * EffectSsOverlay * MapMarkDataOverlay * Missed DEFINE_ACTOR_UNSET * ROM_FILE_UNSET * DEFINE_OBJECT_EMPTY * DmaEntry * ACTOR_UNSET * romfile.h * newline * Format
This commit is contained in:
parent
7a2c46d4eb
commit
1b60dcf6dd
18 changed files with 126 additions and 118 deletions
18
include/romfile.h
Normal file
18
include/romfile.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef ROMFILE_H
|
||||
#define ROMFILE_H
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
} RomFile; // size = 0x8
|
||||
|
||||
#define ROM_FILE(name) \
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) \
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0, 0 }
|
||||
|
||||
#endif
|
|
@ -5,7 +5,7 @@
|
|||
* - Argument 1: Name of the object segment in spec
|
||||
* - Argument 2: Enum value for this object
|
||||
*
|
||||
* DEFINE_OBJECT_UNSET and DEFINE_OBJECT_NULL are needed to define empty entries from the original game
|
||||
* DEFINE_OBJECT_UNSET and DEFINE_OBJECT_EMPTY are needed to define empty entries from the original game
|
||||
*/
|
||||
/* 0x0000 */ DEFINE_OBJECT_UNSET(OBJECT_INVALID) // Object ID 0 isn't usable and should remain unset
|
||||
/* 0x0001 */ DEFINE_OBJECT(gameplay_keep, OBJECT_GAMEPLAY_KEEP)
|
||||
|
@ -234,7 +234,7 @@
|
|||
/* 0x00E0 */ DEFINE_OBJECT(object_ma1, OBJECT_MA1)
|
||||
/* 0x00E1 */ DEFINE_OBJECT(object_ganon, OBJECT_GANON)
|
||||
/* 0x00E2 */ DEFINE_OBJECT(object_sst, OBJECT_SST)
|
||||
/* 0x00E3 */ DEFINE_OBJECT_NULL(object_ny, OBJECT_NY_UNUSED) // unused duplicate with size 0
|
||||
/* 0x00E3 */ DEFINE_OBJECT_EMPTY(object_ny, OBJECT_NY_UNUSED) // unused duplicate with size 0
|
||||
/* 0x00E4 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_E4)
|
||||
/* 0x00E5 */ DEFINE_OBJECT(object_ny, OBJECT_NY)
|
||||
/* 0x00E6 */ DEFINE_OBJECT(object_fr, OBJECT_FR)
|
||||
|
@ -257,7 +257,7 @@
|
|||
/* 0x00F7 */ DEFINE_OBJECT(object_gi_grass, OBJECT_GI_GRASS)
|
||||
/* 0x00F8 */ DEFINE_OBJECT(object_gi_longsword, OBJECT_GI_LONGSWORD)
|
||||
/* 0x00F9 */ DEFINE_OBJECT(object_spot01_objects, OBJECT_SPOT01_OBJECTS)
|
||||
/* 0x00FA */ DEFINE_OBJECT_NULL(object_md, OBJECT_MD_UNUSED) // unused duplicate with size 0
|
||||
/* 0x00FA */ DEFINE_OBJECT_EMPTY(object_md, OBJECT_MD_UNUSED) // unused duplicate with size 0
|
||||
/* 0x00FB */ DEFINE_OBJECT(object_md, OBJECT_MD)
|
||||
/* 0x00FC */ DEFINE_OBJECT(object_km1, OBJECT_KM1)
|
||||
/* 0x00FD */ DEFINE_OBJECT(object_kw1, OBJECT_KW1)
|
||||
|
|
|
@ -194,8 +194,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ uintptr_t vromStart;
|
||||
/* 0x08 */ uintptr_t vromEnd;
|
||||
/* 0x04 */ RomFile file;
|
||||
/* 0x0C */ void* vramStart;
|
||||
/* 0x10 */ void* vramEnd;
|
||||
/* 0x14 */ u32 offset; // loadedRamAddr - vramStart
|
||||
|
@ -558,8 +557,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ uintptr_t vromStart; // if applicable
|
||||
/* 0x08 */ uintptr_t vromEnd; // if applicable
|
||||
/* 0x04 */ RomFile file; // if applicable
|
||||
/* 0x0C */ void* vramStart; // if applicable
|
||||
/* 0x10 */ void* vramEnd; // if applicable
|
||||
/* 0x14 */ void* unk_14;
|
||||
|
|
|
@ -89,8 +89,7 @@ typedef struct {
|
|||
#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x00 */ RomFile file;
|
||||
/* 0x08 */ void* vramStart;
|
||||
/* 0x0C */ void* vramEnd;
|
||||
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "ultra64.h"
|
||||
#include "alignment.h"
|
||||
#include "romfile.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
|
||||
|
@ -16,24 +17,11 @@ typedef struct {
|
|||
} DmaRequest; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x00 */ RomFile file;
|
||||
/* 0x08 */ uintptr_t romStart;
|
||||
/* 0x0C */ uintptr_t romEnd;
|
||||
} DmaEntry;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
} RomFile; // size = 0x8
|
||||
|
||||
#define ROM_FILE(name) \
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) \
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0 }
|
||||
|
||||
extern DmaEntry gDmaDataTable[];
|
||||
|
||||
extern u32 gDmaMgrVerbose;
|
||||
|
|
|
@ -202,8 +202,7 @@ typedef struct {
|
|||
} EffectSsInit; // size = 0x08
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x00 */ RomFile file;
|
||||
/* 0x08 */ void* vramStart;
|
||||
/* 0x0C */ void* vramEnd;
|
||||
/* 0x10 */ void* loadedRamAddr;
|
||||
|
|
|
@ -23,7 +23,7 @@ typedef struct {
|
|||
} ObjectContext; // size = 0x518
|
||||
|
||||
#define DEFINE_OBJECT(_0, enum) enum,
|
||||
#define DEFINE_OBJECT_NULL(_0, enum) enum,
|
||||
#define DEFINE_OBJECT_EMPTY(_0, enum) enum,
|
||||
#define DEFINE_OBJECT_UNSET(enum) enum,
|
||||
|
||||
typedef enum {
|
||||
|
@ -32,7 +32,7 @@ typedef enum {
|
|||
} ObjectId;
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_EMPTY
|
||||
#undef DEFINE_OBJECT_UNSET
|
||||
|
||||
#endif
|
||||
|
|
|
@ -286,8 +286,8 @@ const char* DmaMgr_FindFileName(uintptr_t vrom) {
|
|||
DmaEntry* iter = gDmaDataTable;
|
||||
const char** name = sDmaMgrFileNames;
|
||||
|
||||
while (iter->vromEnd != 0) {
|
||||
if (vrom >= iter->vromStart && vrom < iter->vromEnd) {
|
||||
while (iter->file.vromEnd != 0) {
|
||||
if (vrom >= iter->file.vromStart && vrom < iter->file.vromEnd) {
|
||||
return *name;
|
||||
}
|
||||
|
||||
|
@ -343,8 +343,8 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
|
||||
// Iterate through the DMA data table until the region containing the vrom address for this request is found
|
||||
iter = gDmaDataTable;
|
||||
while (iter->vromEnd != 0) {
|
||||
if (vrom >= iter->vromStart && vrom < iter->vromEnd) {
|
||||
while (iter->file.vromEnd != 0) {
|
||||
if (vrom >= iter->file.vromStart && vrom < iter->file.vromEnd) {
|
||||
// Found the region this request falls into
|
||||
|
||||
if (0) {
|
||||
|
@ -357,7 +357,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
// romEnd of 0 indicates that the file is uncompressed. Files that are stored uncompressed can have
|
||||
// only part of their content loaded into RAM, so DMA only the requested region.
|
||||
|
||||
if (iter->vromEnd < vrom + size) {
|
||||
if (iter->file.vromEnd < vrom + size) {
|
||||
// Error, vrom + size ends up in a different file than it started in
|
||||
|
||||
// "DMA transfers cannot cross segment boundaries"
|
||||
|
@ -365,7 +365,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
"セグメント境界をまたがってDMA転送することはできません", "../z_std_dma.c", 726);
|
||||
}
|
||||
|
||||
DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->vromStart), ram, size);
|
||||
DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->file.vromStart), ram, size);
|
||||
found = true;
|
||||
|
||||
if (0) {
|
||||
|
@ -377,7 +377,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
romStart = iter->romStart;
|
||||
romSize = iter->romEnd - iter->romStart;
|
||||
|
||||
if (vrom != iter->vromStart) {
|
||||
if (vrom != iter->file.vromStart) {
|
||||
// Error, requested vrom is not the start of a file
|
||||
|
||||
// "DMA transfer cannot be performed from the middle of a compressed segment"
|
||||
|
@ -385,7 +385,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
"圧縮されたセグメントの途中からはDMA転送することはできません", "../z_std_dma.c", 746);
|
||||
}
|
||||
|
||||
if (size != iter->vromEnd - iter->vromStart) {
|
||||
if (size != iter->file.vromEnd - iter->file.vromStart) {
|
||||
// Error, only part of the file was requested
|
||||
|
||||
// "It is not possible to DMA only part of a compressed segment"
|
||||
|
@ -557,13 +557,14 @@ void DmaMgr_Init(void) {
|
|||
|
||||
// Check if the ROM is compressed (romEnd not 0)
|
||||
sDmaMgrIsRomCompressed = false;
|
||||
while (iter->vromEnd != 0) {
|
||||
while (iter->file.vromEnd != 0) {
|
||||
if (iter->romEnd != 0) {
|
||||
sDmaMgrIsRomCompressed = true;
|
||||
}
|
||||
|
||||
PRINTF("%3d %08x %08x %08x %08x %08x %c %s\n", idx, iter->vromStart, iter->vromEnd, iter->romStart,
|
||||
iter->romEnd, (iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->vromEnd - iter->vromStart,
|
||||
PRINTF("%3d %08x %08x %08x %08x %08x %c %s\n", idx, iter->file.vromStart, iter->file.vromEnd, iter->romStart,
|
||||
iter->romEnd,
|
||||
(iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->file.vromEnd - iter->file.vromStart,
|
||||
(((iter->romEnd != 0) ? iter->romEnd - iter->romStart : 0) > 0x10000) ? '*' : ' ', name ? *name : "");
|
||||
|
||||
idx++;
|
||||
|
@ -576,9 +577,9 @@ void DmaMgr_Init(void) {
|
|||
#endif
|
||||
|
||||
// Ensure that the boot segment always follows after the makerom segment.
|
||||
if ((uintptr_t)_bootSegmentRomStart != gDmaDataTable[0].vromEnd) {
|
||||
if ((uintptr_t)_bootSegmentRomStart != gDmaDataTable[0].file.vromEnd) {
|
||||
PRINTF("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart,
|
||||
gDmaDataTable[0].vromEnd);
|
||||
gDmaDataTable[0].file.vromEnd);
|
||||
//! @bug The main code file where fault.c resides is not yet loaded
|
||||
Fault_AddHungupAndCrash("../z_std_dma.c", 1055);
|
||||
}
|
||||
|
|
|
@ -6,24 +6,24 @@ u32 gObjectTableSize = ARRAY_COUNT(gObjectTable);
|
|||
|
||||
// Object linker symbol declarations (used in the table below)
|
||||
#define DEFINE_OBJECT(name, _1) DECLARE_ROM_SEGMENT(name)
|
||||
#define DEFINE_OBJECT_NULL(_0, _1)
|
||||
#define DEFINE_OBJECT_EMPTY(_0, _1)
|
||||
#define DEFINE_OBJECT_UNSET(_0)
|
||||
|
||||
#include "tables/object_table.h"
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_EMPTY
|
||||
#undef DEFINE_OBJECT_UNSET
|
||||
|
||||
// Object Table definition
|
||||
#define DEFINE_OBJECT(name, _1) ROM_FILE(name),
|
||||
#define DEFINE_OBJECT_NULL(name, _1) ROM_FILE_EMPTY(name),
|
||||
#define DEFINE_OBJECT_UNSET(_0) { 0 },
|
||||
#define DEFINE_OBJECT_EMPTY(name, _1) ROM_FILE_EMPTY(name),
|
||||
#define DEFINE_OBJECT_UNSET(_0) ROM_FILE_UNSET,
|
||||
|
||||
RomFile gObjectTable[] = {
|
||||
#include "tables/object_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_EMPTY
|
||||
#undef DEFINE_OBJECT_UNSET
|
||||
|
|
|
@ -10,7 +10,7 @@ void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
|
|||
if (overlayEntry->vramStart == NULL) {
|
||||
overlayEntry->unk_28 = 0;
|
||||
} else {
|
||||
overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->file.vromStart, overlayEntry->file.vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd);
|
||||
|
||||
if (overlayEntry->loadedRamAddr == NULL) {
|
||||
|
|
|
@ -2877,8 +2877,8 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
overlayEntry->loadedRamAddr);
|
||||
Overlay_Load(overlayEntry->file.vromStart, overlayEntry->file.vromEnd, overlayEntry->vramStart,
|
||||
overlayEntry->vramEnd, overlayEntry->loadedRamAddr);
|
||||
|
||||
PRINTF(VT_FGCOL(GREEN));
|
||||
PRINTF("OVL(a):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
|
|
|
@ -26,34 +26,41 @@
|
|||
#if OOT_DEBUG
|
||||
|
||||
#define DEFINE_ACTOR(name, _1, allocType, nameString) \
|
||||
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
nameString, \
|
||||
allocType, \
|
||||
0 },
|
||||
{ \
|
||||
ROM_FILE(ovl_##name), \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
nameString, \
|
||||
allocType, \
|
||||
0, \
|
||||
},
|
||||
|
||||
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \
|
||||
{ 0, 0, NULL, NULL, NULL, &name##_InitVars, nameString, allocType, 0 },
|
||||
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \
|
||||
{ \
|
||||
ROM_FILE_UNSET, NULL, NULL, NULL, &name##_InitVars, nameString, allocType, 0, \
|
||||
},
|
||||
|
||||
#else
|
||||
|
||||
// Actor name is set to NULL in retail builds
|
||||
#define DEFINE_ACTOR(name, _1, allocType, _3) \
|
||||
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
NULL, \
|
||||
allocType, \
|
||||
0 },
|
||||
#define DEFINE_ACTOR(name, _1, allocType, _3) \
|
||||
{ \
|
||||
ROM_FILE(ovl_##name), \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
NULL, \
|
||||
allocType, \
|
||||
0, \
|
||||
},
|
||||
|
||||
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, _3) { 0, 0, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0 },
|
||||
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, _3) \
|
||||
{ \
|
||||
ROM_FILE_UNSET, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0, \
|
||||
},
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -80,7 +87,7 @@ void ActorOverlayTable_LogPrint(void) {
|
|||
PRINTF("RomStart RomEnd SegStart SegEnd allocp profile segname\n");
|
||||
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < (u32)gMaxActorId; i++, overlayEntry++) {
|
||||
PRINTF("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
PRINTF("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->file.vromStart, overlayEntry->file.vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr, &overlayEntry->initInfo->id,
|
||||
overlayEntry->name != NULL ? overlayEntry->name : "?");
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
|
|||
for (i = 0; i < ARRAY_COUNT(gEffectSsOverlayTable); i++) {
|
||||
overlay = &gEffectSsOverlayTable[i];
|
||||
PRINTF("effect index %3d:size=%6dbyte romsize=%6dbyte\n", i,
|
||||
(uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart, overlay->vromEnd - overlay->vromStart);
|
||||
(uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart,
|
||||
overlay->file.vromEnd - overlay->file.vromStart);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -205,13 +206,13 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) {
|
|||
return;
|
||||
}
|
||||
|
||||
Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
overlayEntry->loadedRamAddr);
|
||||
Overlay_Load(overlayEntry->file.vromStart, overlayEntry->file.vromEnd, overlayEntry->vramStart,
|
||||
overlayEntry->vramEnd, overlayEntry->loadedRamAddr);
|
||||
|
||||
PRINTF(VT_FGCOL(GREEN));
|
||||
PRINTF("EFFECT SS OVL:SegRom %08x %08x, Seg %08x %08x, RamStart %08x, type: %d\n", overlayEntry->vromStart,
|
||||
overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr,
|
||||
type);
|
||||
PRINTF("EFFECT SS OVL:SegRom %08x %08x, Seg %08x %08x, RamStart %08x, type: %d\n",
|
||||
overlayEntry->file.vromStart, overlayEntry->file.vromEnd, overlayEntry->vramStart,
|
||||
overlayEntry->vramEnd, overlayEntry->loadedRamAddr, type);
|
||||
PRINTF(VT_RST);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,18 +19,15 @@
|
|||
#undef DEFINE_EFFECT_SS_UNSET
|
||||
|
||||
// Effect SS Overlay Table definition
|
||||
#define DEFINE_EFFECT_SS(name, _1) \
|
||||
{ \
|
||||
(uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
1, \
|
||||
#define DEFINE_EFFECT_SS(name, _1) \
|
||||
{ \
|
||||
ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, NULL, &name##_InitVars, 1, \
|
||||
},
|
||||
|
||||
#define DEFINE_EFFECT_SS_UNSET(_0) { 0 },
|
||||
#define DEFINE_EFFECT_SS_UNSET(_0) \
|
||||
{ \
|
||||
ROM_FILE_UNSET, NULL, NULL, NULL, NULL, 0, \
|
||||
},
|
||||
|
||||
EffectSsOverlay gEffectSsOverlayTable[] = {
|
||||
#include "tables/effect_ss_table.h"
|
||||
|
|
|
@ -10,22 +10,26 @@
|
|||
#undef DEFINE_GAMESTATE_INTERNAL
|
||||
|
||||
// Gamestate Overlay Table definition
|
||||
#define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) \
|
||||
{ NULL, 0, 0, NULL, NULL, NULL, typeName##_Init, typeName##_Destroy, NULL, NULL, 0, sizeof(typeName##State) },
|
||||
#define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) \
|
||||
{ \
|
||||
NULL, ROM_FILE_UNSET, NULL, NULL, NULL, typeName##_Init, typeName##_Destroy, NULL, NULL, \
|
||||
0, sizeof(typeName##State), \
|
||||
},
|
||||
|
||||
#define DEFINE_GAMESTATE(typeName, enumName, name) \
|
||||
{ NULL, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
typeName##_Init, \
|
||||
typeName##_Destroy, \
|
||||
NULL, \
|
||||
NULL, \
|
||||
0, \
|
||||
sizeof(typeName##State) },
|
||||
{ \
|
||||
NULL, \
|
||||
ROM_FILE(ovl_##name), \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
typeName##_Init, \
|
||||
typeName##_Destroy, \
|
||||
NULL, \
|
||||
NULL, \
|
||||
0, \
|
||||
sizeof(typeName##State), \
|
||||
},
|
||||
|
||||
GameStateOverlay gGameStateOverlayTable[] = {
|
||||
#include "tables/gamestate_table.h"
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
#include "global.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#define KALEIDO_OVERLAY(name, nameString) \
|
||||
{ \
|
||||
NULL, (uintptr_t)_ovl_##name##SegmentRomStart, (uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, \
|
||||
}
|
||||
#define KALEIDO_OVERLAY(name, nameString) \
|
||||
{ NULL, ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, }
|
||||
|
||||
KaleidoMgrOverlay gKaleidoMgrOverlayTable[] = {
|
||||
KALEIDO_OVERLAY(kaleido_scope, "kaleido_scope"),
|
||||
|
@ -20,7 +17,7 @@ void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) {
|
|||
LOG_UTILS_CHECK_NULL_POINTER("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 99);
|
||||
|
||||
ovl->loadedRamAddr = sKaleidoAreaPtr;
|
||||
Overlay_Load(ovl->vromStart, ovl->vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr);
|
||||
Overlay_Load(ovl->file.vromStart, ovl->file.vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr);
|
||||
|
||||
PRINTF(VT_FGCOL(GREEN));
|
||||
PRINTF("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr,
|
||||
|
|
|
@ -16,8 +16,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr; // original name: "allocp"
|
||||
/* 0x04 */ uintptr_t vromStart;
|
||||
/* 0x08 */ uintptr_t vromEnd;
|
||||
/* 0x04 */ RomFile file;
|
||||
/* 0x0C */ void* vramStart;
|
||||
/* 0x10 */ void* vramEnd;
|
||||
/* 0x14 */ void* vramTable;
|
||||
|
@ -43,12 +42,7 @@ static MapMarkInfo sMapMarkInfoTable[] = {
|
|||
};
|
||||
|
||||
static MapMarkDataOverlay sMapMarkDataOvl = {
|
||||
NULL,
|
||||
(uintptr_t)_ovl_map_mark_dataSegmentRomStart,
|
||||
(uintptr_t)_ovl_map_mark_dataSegmentRomEnd,
|
||||
_ovl_map_mark_dataSegmentStart,
|
||||
_ovl_map_mark_dataSegmentEnd,
|
||||
gMapMarkDataTable,
|
||||
NULL, ROM_FILE(ovl_map_mark_data), _ovl_map_mark_dataSegmentStart, _ovl_map_mark_dataSegmentEnd, gMapMarkDataTable,
|
||||
};
|
||||
|
||||
static MapMarkData** sLoadedMarkDataTable;
|
||||
|
@ -60,7 +54,8 @@ void MapMark_Init(PlayState* play) {
|
|||
overlay->loadedRamAddr = GAME_STATE_ALLOC(&play->state, overlaySize, "../z_map_mark.c", 235);
|
||||
LOG_UTILS_CHECK_NULL_POINTER("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236);
|
||||
|
||||
Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr);
|
||||
Overlay_Load(overlay->file.vromStart, overlay->file.vromEnd, overlay->vramStart, overlay->vramEnd,
|
||||
overlay->loadedRamAddr);
|
||||
|
||||
sLoadedMarkDataTable = gMapMarkDataTable;
|
||||
sLoadedMarkDataTable =
|
||||
|
|
|
@ -10,8 +10,12 @@
|
|||
#undef DEFINE_DMA_ENTRY
|
||||
|
||||
// dmadata Table definition
|
||||
#define DEFINE_DMA_ENTRY(name, _1) \
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomEnd, (uintptr_t)_##name##SegmentRomStart, 0 },
|
||||
#define DEFINE_DMA_ENTRY(name, _1) \
|
||||
{ \
|
||||
ROM_FILE(name), \
|
||||
(uintptr_t)_##name##SegmentRomStart, \
|
||||
0, \
|
||||
},
|
||||
|
||||
DmaEntry gDmaDataTable[] = {
|
||||
#include "tables/dmadata_table.h"
|
||||
|
|
Loading…
Reference in a new issue