diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2023-07-29 10:23:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-29 13:23:35 -0400 |
| commit | ea9f4c68bb2afee5529aa1027b6762542d20bb8f (patch) | |
| tree | afd499f6f9a900ac655eca4a73e84d5db2e1b80d /include | |
| parent | 632ff4b2abec60e91be7b71e0cf40043bed75f32 (diff) | |
LoadFragment 2 OK (#2)
* load_fragment2
* dma.h
* og DoRelocation
* comment format
* A few more docs
* symbol
* remove _ from loadfragment2
* ptrdiff_t
* z_std_dma.h
* Format
* load.h -> loadfragment.h
* laodframgnet2 file optflags
* Small notes
* Per directory O2
Diffstat (limited to 'include')
| -rw-r--r-- | include/loadfragment.h | 38 | ||||
| -rw-r--r-- | include/z_std_dma.h | 2 |
2 files changed, 39 insertions, 1 deletions
diff --git a/include/loadfragment.h b/include/loadfragment.h new file mode 100644 index 0000000..37a747c --- /dev/null +++ b/include/loadfragment.h @@ -0,0 +1,38 @@ +#ifndef LOADFRAGMENT_H +#define LOADFRAGMENT_H + +#include "ultra64.h" + +extern s32 gOverlayLogSeverity; + +#define RELOC_SECTION(reloc) ((reloc) >> 30) +#define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF) +#define RELOC_TYPE_MASK(reloc) ((reloc) & 0x3F000000) +#define RELOC_TYPE_SHIFT 24 + +/* MIPS Relocation Types, matches the MIPS ELF spec */ +#define R_MIPS_32 2 +#define R_MIPS_26 4 +#define R_MIPS_HI16 5 +#define R_MIPS_LO16 6 + +typedef enum { + /* 0 */ RELOC_SECTION_NULL, + /* 1 */ RELOC_SECTION_TEXT, + /* 2 */ RELOC_SECTION_DATA, + /* 3 */ RELOC_SECTION_RODATA, + /* 4 */ RELOC_SECTION_MAX +} RelocSectionId; + +typedef struct OverlayRelocationSection { + /* 0x00 */ u32 textSize; + /* 0x04 */ u32 dataSize; + /* 0x08 */ u32 rodataSize; + /* 0x0C */ u32 bssSize; + /* 0x10 */ u32 nRelocations; + /* 0x14 */ u32 relocations[1]; // size is nRelocations +} OverlayRelocationSection; // size >= 0x18 + +s32 Overlay_Load(void *vromStart, void *vromEnd, void *ovlStart, void *ovlEnd, void *vramStart, void *vramEnd, void *allocatedRamAddr, OverlayRelocationSection *ovlRelocs); + +#endif diff --git a/include/z_std_dma.h b/include/z_std_dma.h index e152956..7096e50 100644 --- a/include/z_std_dma.h +++ b/include/z_std_dma.h @@ -23,7 +23,7 @@ extern DmaEntry gDmaDataTable[]; // void func_80026828_jp(); // void func_800269E4_jp(); // void func_80026A64_jp(); -// void func_80026B44_jp(); +void DmaMgr_RequestSync(void* ram, void* vrom, size_t size); // void func_80026BC0_jp(); // void func_80026C00_jp(); // void func_80026C28_jp(); |
