mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
ccae1f7387
* Split z64.h more * fix speedmeter.h (expect this kind of issue resolution to pop up eventually) * fix z64object.h * fix z64state.h * fix (probably only partially) z64play.h * fix fix speedmeter.h :) * revert making a play header (sadge), add/split transition & transition_instances * move stuff to cutscene, interface * Move `TransitionCircle%` enums to `z64transition_instances.h` * z64state.h -> z64game.h with a "this is not final" comment * forward declare GraphicsContext in z64game.h instead of including the header file for it * don't comment on where the forward declarations are from reasoning: 1) it's easy to go out of sync (like this comment, it was outdated anyway) 2) any IDE can easily find the struct anyway
61 lines
1.9 KiB
C
Executable file
61 lines
1.9 KiB
C
Executable file
#ifndef Z64_DMA_H
|
|
#define Z64_DMA_H
|
|
|
|
#include "ultra64.h"
|
|
#include "alignment.h"
|
|
|
|
typedef struct {
|
|
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
|
|
/* 0x04 */ void* dramAddr; // DRAM address (destination)
|
|
/* 0x08 */ size_t size; // File Transfer size
|
|
/* 0x0C */ const char* filename; // Filename for debugging
|
|
/* 0x10 */ s32 line; // Line for debugging
|
|
/* 0x14 */ s32 unk_14;
|
|
/* 0x18 */ OSMesgQueue* notifyQueue; // Message queue for the notification message
|
|
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
|
|
} DmaRequest; // size = 0x20
|
|
|
|
typedef struct {
|
|
/* 0x00 */ uintptr_t vromStart;
|
|
/* 0x04 */ uintptr_t vromEnd;
|
|
/* 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;
|
|
extern size_t gDmaMgrDmaBuffSize;
|
|
|
|
#define DMAMGR_DEFAULT_BUFSIZE ALIGN16(0x2000)
|
|
|
|
// Standard DMA Requests
|
|
|
|
s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size);
|
|
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, s32 line);
|
|
s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
|
|
OSMesg msg, const char* file, s32 line);
|
|
|
|
// Special-purpose DMA Requests
|
|
|
|
s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size);
|
|
void DmaMgr_DmaFromDriveRom(void* ram, uintptr_t rom, size_t size);
|
|
s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction);
|
|
|
|
// Initialization
|
|
|
|
void DmaMgr_Init(void);
|
|
|
|
#endif
|