27 x = offsetX + (window->
x * 8) + 8;
28 y = offsetY + (window->
y * 8) + 8;
37 words[0] = (
x << 16) |
y | oamFlags;
41 __builtin_memcpy(&output->
oam, words,
sizeof(words));
44 *(
u32 *)&output->
oam = (x << 16) | y | oamFlags;
170 if (portrait !=
NULL) {
242 if (tilemap ==
NULL) {
248 routine(spans, tilemap);
264 if (column < width) {
269 }
while (column < width);
273 }
while (row < height);
What every part of the menu object shares: its includes, edition values, macros and the link round st...
#define OUTPUT_SIZE_32X32
#define PORTRAIT_SLOT_EMPTY
#define OUTPUT_SIZE_16X16
OAM attribute bits a sprite output is created with: the size field of attribute 1 (bits 30-31 of the ...
#define Dma_Fill16(value, destination, size)
Fills size bytes at destination with the halfword value by DMA3, from a volatile copy of it on the st...
s32 GameFlag_TestFar(s32 flag)
#define FLAG_CHILDHOOD
the prologue: Isaac and Garet are children
void Tile_BuildMetatiles(u16 *scanlineBounds, u16 *frameTiles)
Builds the hardware window's horizontal extent for each of the screen's 160 scanlines from frameTiles...
u8 Tile_BuildMetatilesCodeSize[]
void MemFree(void *buffer)
void UiWindow_FillFromScene(void *spans)
Fills spans with the horizontal extent of the windows on each of the 20 tile rows,...
void RenderOutput_SetAnimation(struct RenderOutput *out, s32 mode)
Switches the sprite output out to animation mode from its first step.
struct RenderOutput * RenderOutput_Create(s32 slot, s32 oamFlags, struct UiWindow *window, s32 offsetX, s32 offsetY)
Creates a sprite output for the VRAM cache slot slot and attaches it to window, placed at (offsetX,...
struct RenderOutput * RenderOutput_CreateFromTable(s32 tableEntry, struct UiWindow *window, s32 x, s32 y)
Loads the pattern at the start of gRenderResource_PairSourceTable into a free VRAM slot and shows it ...
struct RenderOutput * RenderOutput_CreateFromResource(s32 mode, s32 resource, struct UiWindow *window, s32 x, s32 y)
Loads resource resource in loading mode mode into a VRAM slot and shows it as a 16x16 sprite at (x,...
struct RenderOutput * RenderOutput_CreateWithTransform(s32 icon, struct UiWindow *window, s32 x, s32 y)
Builds a 16x16 icon from frame pattern 1 with overlay pattern icon drawn over it, and shows it at (x,...
void Ui_LoadCharacterEntryForSlot(u32 side, s32 character, s32 unused)
Reloads the portrait image of character into portrait slot side (0 or 1), keeping its sprite: used to...
void UiWindow_FillScreenBlockRect(s32 unused0, s32 unused1, u32 width, u32 height, s32 value)
Fills the top-left width x height tiles of the 32-tile-wide BG screen block at 0x06002000 with the ti...
void RenderOutput_SetInvertedSentinel(void *output, s32 priority)
Sets the draw layer of the sprite output output to 255 - priority, so a higher priority draws on a lo...
struct RenderOutput * RenderOutput_CreateLoaded(s32 icon, s32 layers, struct UiWindow *window, s32 x, s32 y)
Copies icon icon (with layers passed on to the copier) into a free VRAM slot and shows it as a 16x16 ...
void(*) WindowSpanRoutine(u16 *spans, u16 *tilemap)
struct RenderOutput * CreateSideObject(s32 character, s32 unused, s32 side, struct UiWindow *window, s32 x, s32 y)
Shows the 32x32 portrait of character at (x, y) in window, in portrait slot side (0 or 1,...
#define Ram_VramBlockCache
#define RamCode_Load(to, code, bytes)
Allocates a heap copy; release it with MemFree when finished.
s32 Resource_LoadByMode(s32 mode, s32 value)
Loads the icon of an entry of kind mode (1 and 6 commands, 2 items, 4 Psynergy, 9 fixed images) into ...
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
u8 sentinel
depth slot it is drawn at (254 for glyphs)
s8 active
its UI_SPRITE_ motion; 0 while free
struct RenderOutput * next
the next output in its list
u16 animStep
step of its motion's animation
s8 kind
0 for a glyph; otherwise it owns VRAM cache slot index, freed with it, and 2 (a portrait) also its pa...
s8 index
VRAM cache slot, or a glyph's tile after glyphTiles.
The window system's work: the windows' tilemap, the windows, the three text channels,...
u8 mode
Set while Mind Read shows thoughts: round frame corners, colour 8 text with no shadow,...
u16 outputIds[2]
VRAM cache slot of each portrait slot's picture.
u16 resourceIds[2]
picture shown in each portrait slot; 999 when free
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
struct RenderOutputList output
the sprites the window carries
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
#define UI_TILEMAP_VRAM
The UI tilemap in VRAM (BG screen block 4), which UiWork_UploadDirtyBlocks copies the work block's ti...
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 UiIcon_CopyResourceToSlot(s32 inventoryCode, s32 layers, s32 cacheSlot)
Composes an inventory icon with the requested layers and loads it into cacheSlot.
s32 RenderResource_LoadTableEntry(u32 value, s32 unused, u32 slot)
Loads one of four small fixed images into the sprite tile slot named by slot.
void Ui_BuildPairedPatternsToSlot(s32 overlayIcon, s32 frameIcon, s32 *slot, s32 *tileOut, s32 reuse)
Builds a command icon (overlay overlayIcon over frame frameIcon) and loads it into a sprite tile slot...
void UiGlyph_LoadEntryWithPalette(u32 icon, s32 unused, s32 *slot, s32 *tile, s32 palette, s32 reuse)
Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is se...
s32 Localization_LookupEntryId(u32 value)
Returns the portrait of a character (ids below 20) or another speaker's sprite (128 and up for those)...
void RenderOutput_AppendToList(struct RenderOutputList *list, struct RenderOutput *node)
Adds a render output to the end of a list; NULL lists are ignored.
struct RenderOutput * RenderOutput_AcquireFree(void)
Takes the first render output from the free list, or returns NULL when every output is in use.