mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-10 11:13:45 -04:00
d489dc996b
* most of dolsdk copied over * add some gf stuff * trk wip * ode/amc stuff * build fix
38 lines
897 B
C
38 lines
897 B
C
#include "dolphin/gd/GDBase.h"
|
|
#include "dolphin/os/OS.h"
|
|
|
|
GDLObj* __GDCurrentDL = NULL;
|
|
static GDOverflowCallback 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");
|
|
}
|
|
}
|