119 obj->
oam.
x = obj->
x + 0xfff0;
120 obj->
oam.
y = (
u8)obj->
y + 0xf0;
127#define RANGE_PATTERN_SET_COUNT 2
128#define RANGE_PATTERN_COUNT 6
129#define RANGE_PATTERN_PAIR_WORDS 16
139 u32 *vram = (
u32 *)0x06006280;
151 for (row = 1; row <= 7; row++) {
152 s32 sourcePattern = patternIndex;
154 if (patternSet == 1 && row <= 1) {
157 if (patternSet == 0 && patternIndex > row - 2) {
158 sourcePattern = row - 2;
159 if (sourcePattern < 0) {
177 s32 pattern,
s32 unused) {
180 s32 pattern,
s32 unused) {
182 s32 patternOffset = pattern * 2;
183 s32 rightTile = patternOffset + 0xF315;
200 oppositeShift = -shift;
202 rightShift = oppositeShift * 4;
203 leftShift = shift * 4;
215 shifted >>= rightShift;
217 shifted <<= leftShift;
222 if (shifted > 0x0FFFFFFF)
223 result += shifted >> 28;
225 result += fallback >> 28;
229 }
while (pixel >= 0);
248 (
u32 *)offset, -phase);
251 (
u32 *)(offset + 32), phase);
258 s32 paletteOffset = 0;
259 s32 destinationBank = 0;
263 s32 destinationOffset = (destinationBank + bank) << 6;
266 u16 *output = (
u16 *)((
u8 *)dst + destinationOffset);
267 u16 *source = (
u16 *)((
u8 *)0x06000600 + (row << 5));
271 u32 packed = *source++;
281 }
while (nibble <= 3);
284 *output++ = expanded;
285 }
while (column <= 15);
288 destinationOffset += 32;
292 destinationBank += 4;
385#if LANGUAGE == LANGUAGE_SPANISH || LANGUAGE == LANGUAGE_FRENCH
386#define LINK_COUNTDOWN_DRAW_HEADING UiText_DrawStringAtOffset
388#define LINK_COUNTDOWN_DRAW_HEADING UiText_DrawStringInWindow
406 void *target = (
void *)((
u32)offsetTable + offsetTable[icon]);
431 decoded->
encoded = font + ((
u16 *)font)[glyph];
434 source = decoded->
input;
435 destination = remapped;
436 for (i = 0; i < 0x400; i++) {
438 if (palette->
slot[index] == 255) {
440 if (palette->
count < 64) {
445 *destination++ = palette->
slot[index];
484 u32 address = 0x04000012;
487 *(
volatile u16 *)address = zero;
What every part of the menu object shares: its includes, edition values, macros and the link round st...
#define OUTPUT_SIZE_32X32
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...
void Runtime_RemapBytesByTableFar(u8 *buf, s32 cnt)
s32 GameFlag_TestFar(s32 flag)
#define FLAG_CHILDHOOD
the prologue: Isaac and Garet are children
void Runtime_SetIrqHandler(u32 irq, s32 vcount, InterruptHandler handler)
Installs handler for interrupt irq and enables that interrupt, or with a null handler disables it and...
u32 gFrameTick
Counted up by every VBlank.
volatile u32 gFrameCount
Frames WaitFrames has finished.
const u8 gUi_PairBobOffsets[]
s32 gUi_ObjectPulseScales[]
s32 gUi_FixedTileBlocks[]
const u8 Tile_Decompress4bpp[]
const struct TileMask gMenu_BarPatternRows[]
u8 Tile_Decompress4bppCodeSize[]
u16 gGraphics_ExpandNibbleTable[]
void * MemAlloc(s32 size)
Allocates size bytes (rounded up to words) with no slot, from IWRAM when they fit and EWRAM otherwise...
void * Runtime_AllocateBlock(s32 kind, s32 size)
As Runtime_AllocateHeapBlock, but tries EWRAM first, for blocks that need room more than speed: the b...
void * Runtime_AllocateHeapBlock(s32 kind, s32 size)
Returns heap slot kind's block, first allocating size bytes for it (rounded up to words),...
@ HEAP_SLOT_TEMP_RENDERER
Copied field row drawer or window tile decoder, released after each call.
#define BGCNT_PRIORITY(n)
void(*) InterruptHandler(void)
static s32 Iwram_FillWords(void *destination, s32 size, u32 value)
void Runtime_ReleaseHeapBlock(s32 slot)
void MemFree(void *buffer)
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,...
const u8 * gRenderResource_PairSourceTable[]
void UiText_DrawCharacter(struct SelectionWork *work, s32 index, u32 icon)
Loads a selection icon, initializes its sprite and binds the decoded tiles.
void UiText_LoadRemappedGlyph(struct GlyphPalette *palette, s32 glyph, s32 tile)
Loads a command icon into 8bpp OBJ VRAM, sharing a compact palette across the selection's icons.
s32 Resource_LoadIndexedIntoBuffer(s32 slotIndex, s32 icon)
Decodes a command-icon table entry in temporary transfer work and reload the requested cache slot.
void Graphics_SetBg1Priority3(void)
Puts BG1 behind the other priority levels while the command strip is active.
#define RANGE_PATTERN_PAIR_WORDS
UNUSED void Graphics_InstallBg1VCountHandler(void)
Clears BG0 vertical scroll and installs the BG1 priority change at line 136.
s32 Ui_GetTableWordZero(s32 no)
Return gUi_FixedTileBlocks[0]; treat any nonzero no as 0 as well.
void Graphics_SetBg1Priority0(void)
Restores BG1 priority 0; the VCount handler applies this below the strip.
struct RenderOutput * RenderResource_CreateFrame(s32 icon, s32 remap, struct UiWindow *window, s32 x, s32 y)
Shows command icon icon (see RenderResource_LoadFrame) as a 32x32 256-colour sprite at (x,...
#define LINK_COUNTDOWN_DRAW_HEADING
struct RenderOutput * RenderResource_CreatePair(s32 picture, struct UiWindow *window, s32 x, s32 y)
Shows picture picture of gRenderResource_PairSourceTable as two 32x32 sprites side by side at (x,...
struct UiWindow * Link_CreateCountdownLabelWindow(void)
Creates the link timer window and draws its fixed time heading.
void RenderResource_LoadFrame(s32 icon, s32 slot, s32 remap)
Decompresses command icon icon (a 32x32 picture of 256 colours, 1 KB) into VRAM slot slot,...
s32 Resource_LoadIndexedEntryToBuffer(s32 resource, s32 index)
Builds the ability glyph in temporary transfer work, reloads the requested cache slot and returns its...
#define RANGE_PATTERN_COUNT
void RenderResource_LoadPair(s32 picture, s32 slot)
Decompresses picture picture of gRenderResource_PairSourceTable (two 32x32 sprites side by side,...
void Link_DrawShiftedTilePair(s32 offset)
Animates the two link indicator tiles with opposing two/three-pixel shifts.
UNUSED void UiIcon_Decompress(GlyphTransfer *work)
Copies the 4bpp decoder into RAM, calls it with the transfer's encoded source and byte buffer,...
s32 ItemIcon_LoadIntoSlot(s32 resource, s32 index)
Composes the item icon with style 0x1a in temporary transfer work and reload the requested cache slot...
void Ui_ApplyTableScaleToObject(struct RenderOutput *obj)
Makes the sprite obj pulse: scales it about its centre by gUi_ObjectPulseScales (in 1/65536,...
s32 Resource_LoadTableEntryToBuffer(s32 resource, s32 index)
Composes a table-entry glyph in temporary transfer work, reloads its cache slot, then releases the te...
s32 UiGlyph_LoadPortrait(u32 member, s32 cacheSlot)
Loads a party portrait into the supplied cache slot and returns its tile.
void Graphics_ExpandVramTilesByColorTable(u16 *dst)
Expands two palette variants of the ten source tile rows at 0x06000600, mapping each packed nibble th...
int UiWindow_DrawThreeTileColumn(struct UiWindow *window, s32 x, s32 y, s32 pattern, s32 unused)
void Graphics_MergeShiftedTileRows(u32 *first, u32 *second, u32 *output, s32 shift)
Merges two 8x8 4bpp tiles row by row.
#define RANGE_PATTERN_SET_COUNT
s32 Menu_BuildLocalizedPatternTiles(void)
void RenderOutput_BobPair(struct RenderOutput *obj)
Bobs the two sprites of a pair (see RenderResource_CreatePair) up and down by gUi_PairBobOffsets,...
#define RamCode_LoadSlot(slot, code, bytes)
Allocates a work-slot copy; release it with Runtime_ReleaseHeapBlock.
s32 AffineMatrix_BuildForEffect(struct AffineTransform *source)
Hands out the next OAM affine matrix for a sprite drawn with source's scale and rotation and fills it...
char ResourceId_CommandIcons
s32 Resource_DecodeByteLz(const void *source, void *destination)
Decodes a byte-oriented LZ resource and returns its unpacked byte count.
A compact palette shared by a selection's command icons: the slot each icon colour was given,...
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)
struct RenderOutput * next
the next output in its list
The command icon row's work block and one of its icons: pictures.c loads the icons,...
The command icon row's work block: the icons' shared palette, up to six icons, the label window,...
struct GlyphPalette palette
struct SelectionEntry entries[6]
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
u8 gLink_TimeLabelString[]
The heap's 64 work slots, the first two holding the next free EWRAM and IWRAM addresses.
#define DMA_COPY32(count)
The DMA control word that copies count words.
s32 VramCache_Reload(s32 no, s32 src)
Copies src again into entry no's VRAM, keeping its size.
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.
s32 ItemIcon_Compose(u32 code, u32 layers)
Draws an item's icon into the glyph work buffer from its inventory code (item id in the low 9 bits,...
void Ability_LoadGlyph(s32 action, s32 withBase, s32 *slot, s32 *tile, s32 reuse)
Builds the Psynergy icon of a battle action, as UiIcon_BuildAbilityIconTiles.
void Ui_PrepareTransferFromTableEntry(u32 iconIndex)
Draws one of the other icons into the glyph work buffer.
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...
void UiWindow_SetTilemapEntry(struct UiWindow *window, s32 value, s32 x, s32 y, u32 mode)
Writes value into a window's tilemap at tile (x, y) of its interior, with the palette mode names (TIL...
struct UiWindow * UiWindow_Create(s32 x, s32 y, s32 width, s32 height, s32 attrs)
Opens a window at tile (x, y) of width by height tiles in the first free window slot,...