42 for (i = 0; i < blocks; i++) {
72 }
while (remaining != 0);
97 }
while (remaining != 0);
127 if (entry->
size > 16) {
154 if (entry->
size > 16) {
171 if (src == (
const void *)-1) {
193 }
while (n <= limit);
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
#define OBJ_VRAM0
Sprite tile memory, as pret names it: the 32 KB from 0x06010000.
#define DMA_COPY_WORDS(n)
static s32 Iwram_ClearWords(void *destination, s32 size)
What every part of the runtime object shares: its includes and the library call two parts make.
A sprite slot of the VRAM cache: the size of its block and where the block starts in OBJ VRAM.
u16 offset
bytes from the start of OBJ VRAM
s32 VramCache_FreeBlocks(s32 id)
Frees every block entry id owns in gResourceBlockOwners.
void VramCache_Reset(void)
Frees every block and every cache entry.
s32 VramCache_AllocEntry(s32 size)
Takes a free cache entry, gives it size bytes of sprite VRAM and returns its number.
s32 VramCache_Reload(s32 no, s32 src)
Copies src again into entry no's VRAM, keeping its size.
s32 VramCache_GetLongestFreeRun(void)
Returns the length, in blocks, of the longest run of free blocks.
s32 VramCache_ReleaseVram(u32 no)
Gives back entry no's blocks but keeps the entry taken, with size 1, so a later VramCache_Load can re...
s32 VramCache_AllocateBlocks(u32 id, u32 size)
Finds the first run of free blocks that holds size bytes and gives it to entry id,...
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).
s32 Resource_FindFreeEntry(void)
Returns the number of the first free cache entry, or VRAM_CACHE_ENTRY_COUNT when all are taken.
s32 VramCache_Load(u32 no, u32 size, const void *src)
Gives cache entry no size bytes of sprite VRAM and copies src there.
struct VramBlockCacheEntry gVramBlockCache[]
u8 gResourceBlockOwners[VRAM_BLOCK_COUNT]