|
resonance 1.0.1
|
One entry of the GS video memory palette table. More...
#include <vram.h>

Public Member Functions | |
| int | GetSlotIndex () const |
| Slot index of the record's blocks within the palette region. | |
| void | ClearLockMask () |
| Release every lock on the record. | |
| int | GetBlockAddr () |
| Mark the record as used this packet and return the GS address of its palette. | |
| int | UploadClut (const void *pSource, int nWidth, int nHeight, int nBitsPerPixel, int nPsm) |
| Move a palette into the record's slot, allocating the slot first when needed. | |
| void | FreeSelf () |
| Release the record, freeing its slot and returning itself to the free list. | |
Static Public Member Functions | |
| static int | AllocBlock () |
| Take a free palette slot, evicting unlocked palettes when every slot is taken. | |
| static int | SwapOutOldest () |
| Release up to sixteen unlocked palettes, oldest first. | |
Public Attributes | |
| unsigned short | mMemAddr |
| First block of the slot, zero while the record is not resident. | |
| unsigned short | mLockMask |
| Generation bits. | |
| int | mLastUsed |
| Value of Rnd::VRAM::mFlushCount at the last GetBlockAddr(). | |
| VramPalEntry * | mpPrev |
| Previous record, towards the most recently used end of the chain. | |
| VramPalEntry * | mpNext |
| Next record, towards the least recently used end. | |
One entry of the GS video memory palette table.
The title is inferred, from the diagnostics "VRAM pal entry should have lockmask %d set" and "No unlocked VRAM pal entries to swap out!". mMemAddr, mpPrev, and mpNext are attested verbatim by "Pal entry in chain has mMemAddr of 0 (mpPrev: %p, mpNext: %p)".
A palette occupies kVramPalBlocks blocks inside the region Rnd::VRAM::Init() reserves below the texture pool, and which slots of that region are taken is tracked in a bitmap rather than in a free list. Resident records form one chain, most recently used first, which is the order SwapOutOldest() walks backwards.
The image records no access control. Every member and method below is reached from Rnd::VRAM or from Rnd::PsTex. A friend declaration fits the image as well as the public section written here.
|
static |
Take a free palette slot, evicting unlocked palettes when every slot is taken.
The routine is the one place in the unit whose title is attested by a literal, its own diagnostic "AllocBlock: trying to set vpalIndex: %d, already set".
|
static |
Release up to sixteen unlocked palettes, oldest first.
| int VramPalEntry::GetSlotIndex | ( | ) | const |
Slot index of the record's blocks within the palette region.
| void VramPalEntry::ClearLockMask | ( | ) |
Release every lock on the record.
| int VramPalEntry::GetBlockAddr | ( | ) |
Mark the record as used this packet and return the GS address of its palette.
| int VramPalEntry::UploadClut | ( | const void * | pSource, |
| int | nWidth, | ||
| int | nHeight, | ||
| int | nBitsPerPixel, | ||
| int | nPsm ) |
Move a palette into the record's slot, allocating the slot first when needed.
| pSource | Palette entries to move. |
| nWidth | Palette width in entries. |
| nHeight | Palette height in entries. |
| nBitsPerPixel | Bits per entry. The routine does not read it. |
| nPsm | GS pixel storage mode. |
| void VramPalEntry::FreeSelf | ( | ) |
Release the record, freeing its slot and returning itself to the free list.
| unsigned short VramPalEntry::mMemAddr |
First block of the slot, zero while the record is not resident.
Attested.
| unsigned short VramPalEntry::mLockMask |
Generation bits.
The literals write it "lockmask".
| int VramPalEntry::mLastUsed |
Value of Rnd::VRAM::mFlushCount at the last GetBlockAddr().
| VramPalEntry* VramPalEntry::mpPrev |
Previous record, towards the most recently used end of the chain.
Attested.
| VramPalEntry* VramPalEntry::mpNext |
Next record, towards the least recently used end.
Attested.