Use Romfile in place of vromStart and vromEnd in structs (#1618)

* DmaEntry

* KaleidoMgrOverlay

* ActorOverlay

* EffectSsOverlay

* GameStateOverlay

* TransitionOverlay
This commit is contained in:
Derek Hensley
2024-05-12 10:08:52 -07:00
committed by GitHub
parent 0e8b225279
commit 6d315fa2ae
20 changed files with 97 additions and 92 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef ROMFILE_H
#define ROMFILE_H
#include "ultra64.h"
#include "libc/stdint.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
+2 -7
View File
@@ -4,6 +4,8 @@
#include "libc/stddef.h"
#include "PR/ultratypes.h"
#include "romfile.h"
#define DECLARE_SEGMENT(name) \
extern u8 _##name##SegmentStart[]; \
extern u8 _##name##SegmentEnd[];
@@ -34,13 +36,6 @@
#define SEGMENT_BSS_END(segment) (_ ## segment ## SegmentBssEnd)
#define SEGMENT_BSS_SIZE(segment) ((uintptr_t)SEGMENT_BSS_END(segment) - (uintptr_t)SEGMENT_BSS_START(segment))
#define ROM_FILE(name) \
{ SEGMENT_ROM_START(name), SEGMENT_ROM_END(name) }
#define ROM_FILE_EMPTY(name) \
{ SEGMENT_ROM_START(name), SEGMENT_ROM_START(name) }
#define ROM_FILE_UNSET \
{ 0, 0 }
DECLARE_SEGMENT(framebuffer_lo)
DECLARE_SEGMENT(boot)
+1 -2
View File
@@ -31,8 +31,7 @@ typedef enum AllocType {
} AllocType;
typedef struct ActorOverlay {
/* 0x00 */ uintptr_t vromStart;
/* 0x04 */ uintptr_t vromEnd;
/* 0x00 */ RomFile file;
/* 0x08 */ void* vramStart;
/* 0x0C */ void* vramEnd;
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
+3 -7
View File
@@ -4,6 +4,8 @@
#include "ultra64.h"
#include "unk.h"
#include "romfile.h"
typedef struct {
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
/* 0x04 */ void* dramAddr; // DRAM address (destination)
@@ -15,14 +17,8 @@ typedef struct {
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
} DmaRequest; // size = 0x20
typedef struct RomFile {
/* 0x0 */ uintptr_t vromStart;
/* 0x4 */ uintptr_t vromEnd;
} RomFile; // size = 0x8
typedef struct {
/* 0x0 */ uintptr_t vromStart;
/* 0x4 */ uintptr_t vromEnd;
/* 0x0 */ RomFile file;
/* 0x8 */ uintptr_t romStart;
/* 0xC */ uintptr_t romEnd;
} DmaEntry; // size = 0x10
+2 -2
View File
@@ -6,6 +6,7 @@
#include "color.h"
#include "z64math.h"
#include "z64dma.h"
#include "z64eff_ss_dead.h"
struct Actor;
@@ -37,8 +38,7 @@ typedef struct EffectSsInit {
} EffectSsInit; // size = 0x8
typedef struct EffectSsOverlay {
/* 0x00 */ uintptr_t vromStart;
/* 0x04 */ uintptr_t vromEnd;
/* 0x00 */ RomFile file;
/* 0x08 */ void* vramStart;
/* 0x0C */ void* vramEnd;
/* 0x10 */ void* loadedRamAddr;
+2 -2
View File
@@ -8,6 +8,7 @@
#include "gamealloc.h"
#include "padmgr.h"
#include "padutils.h"
#include "romfile.h"
#include "tha.h"
#include "unk.h"
@@ -31,8 +32,7 @@ typedef void (*GameStateFunc)(struct GameState* gameState);
typedef struct GameStateOverlay {
/* 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 */ UNK_PTR unk_14;
+2 -2
View File
@@ -2,6 +2,7 @@
#define Z64PAUSE_MENU_H
#include "ultra64.h"
#include "romfile.h"
#include "z64math.h"
#include "z64view.h"
#include "unk.h"
@@ -197,8 +198,7 @@ typedef enum KaleidoMgrOverlayType {
typedef struct KaleidoMgrOverlay {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ uintptr_t vromStart;
/* 0x08 */ uintptr_t vromEnd;
/* 0x04 */ RomFile file;
/* 0x0C */ void* vramStart;
/* 0x10 */ void* vramEnd;
/* 0x14 */ uintptr_t offset; // loadedRamAddr - vramStart
+3 -2
View File
@@ -6,6 +6,8 @@
#include "libc/stdint.h"
#include "unk.h"
#include "romfile.h"
#include "overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h"
#include "overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.h"
#include "overlays/fbdemos/ovl_fbdemo_wipe3/z_fbdemo_wipe3.h"
@@ -71,8 +73,7 @@ typedef struct TransitionOverlay {
} loadInfo;
/* 0x04 */ void* vramStart;
/* 0x08 */ void* vramEnd;
/* 0x0C */ uintptr_t vromStart;
/* 0x10 */ uintptr_t vromEnd;
/* 0x0C */ RomFile file;
/* 0x14 */ TransitionInit* initInfo;
/* 0x18 */ size_t size;
} TransitionOverlay;