1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 15:34:41 +00:00

TwoHeadArena and TwoHeadGfxArena docs (#1349)

* TwoHeadArena and TwoHeadGfxArena docs, ALIGNOF macro

* AllocStart -> AllocHead , AllocEnd -> AllocTail

* Format

* Suggested changes

* Fix

* Further suggested changes
This commit is contained in:
Tharo 2022-11-13 23:29:50 +00:00 committed by GitHub
parent c165ed015c
commit 6d5287ff12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 302 additions and 170 deletions

View file

@ -93,10 +93,10 @@ void Graph_InitTHGA(GraphicsContext* gfxCtx) {
pool->headMagic = GFXPOOL_HEAD_MAGIC;
pool->tailMagic = GFXPOOL_TAIL_MAGIC;
THGA_Ct(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer));
THGA_Ct(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer));
THGA_Ct(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer));
THGA_Ct(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer));
THGA_Init(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer));
THGA_Init(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer));
THGA_Init(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer));
THGA_Init(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer));
gfxCtx->polyOpaBuffer = pool->polyOpaBuffer;
gfxCtx->polyXluBuffer = pool->polyXluBuffer;
@ -458,20 +458,20 @@ void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) {
TwoHeadGfxArena* thga = &gfxCtx->polyOpa;
if (HREG(59) == 1) {
osSyncPrintf("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->bufp,
osSyncPrintf("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->start,
thga->p, thga->d);
}
return THGA_AllocEnd(&gfxCtx->polyOpa, ALIGN16(size));
return THGA_AllocTail(&gfxCtx->polyOpa, ALIGN16(size));
}
void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) {
TwoHeadGfxArena* thga = &gfxCtx->polyOpa;
if (HREG(59) == 1) {
osSyncPrintf("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->bufp,
osSyncPrintf("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->start,
thga->p, thga->d);
}
return THGA_AllocEnd(&gfxCtx->polyOpa, ALIGN16(size));
return THGA_AllocTail(&gfxCtx->polyOpa, ALIGN16(size));
}
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line) {