1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-10 19:13:42 +00:00
oot/src/libultra/audio/heapalloc.c
Tharo afa0842de4
[iQue] Import libultra audio library files (#2433)
Note about comments in these files:
The libultra audio library was originally available to developers in
source code form, unlike most of libultra. These files are based on
these source code forms, adapted to meet the style of this project.
The comments in the files as of this commit are, apart from the style,
comments from the original SGI authors.
2025-01-21 15:21:48 -05:00

15 lines
344 B
C

#include "libaudio.h"
#include "synthInternals.h"
void* alHeapDBAlloc(u8* file, s32 line, ALHeap* hp, s32 num, s32 size) {
s32 bytes;
u8* ptr = NULL;
bytes = (num * size + AL_CACHE_ALIGN) & ~AL_CACHE_ALIGN;
if (hp->cur + bytes <= hp->base + hp->len) {
ptr = hp->cur;
hp->cur += bytes;
}
return ptr;
}