mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-18 12:52:51 -04:00
9649319ec4
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
#include <dolphin/gd.h>
|
|
#include <dolphin/os.h>
|
|
|
|
GDLObj* __GDCurrentDL = NULL;
|
|
static GDOverflowCb overflowcb = NULL;
|
|
|
|
void GDInitGDLObj(GDLObj* dl, void* start, u32 length) {
|
|
ASSERTMSGLINE(40, !((u32)start & 0x1F), "start must be aligned to 32 bytes");
|
|
ASSERTMSGLINE(41, !((u32)length & 0x1F), "length must be aligned to 32 bytes");
|
|
dl->start = start;
|
|
dl->ptr = start;
|
|
dl->top = (u8*)start + length;
|
|
dl->length = length;
|
|
}
|
|
|
|
void GDFlushCurrToMem(void) {
|
|
DCFlushRange(__GDCurrentDL->start, __GDCurrentDL->length);
|
|
}
|
|
|
|
void GDPadCurr32(void) {
|
|
u32 n;
|
|
|
|
n = (u32)__GDCurrentDL->ptr & 0x1F;
|
|
if (n != 0) {
|
|
for (; n < 32; n = n + 1) {
|
|
__GDWrite(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
void GDOverflowed(void) {
|
|
if (overflowcb) {
|
|
(*overflowcb)();
|
|
} else {
|
|
ASSERTMSGLINE(77, 0, "GDWrite: display list overflowed");
|
|
}
|
|
}
|
|
|
|
void GDSetOverflowCallback(GDOverflowCb callback) {
|
|
overflowcb = callback;
|
|
}
|
|
|
|
GDOverflowCb GDGetOverflowCallback(void) {
|
|
return overflowcb;
|
|
}
|