Skip to Content
The Alchemy Project

include/system/definitions.h

The system library's types and constants, as SGL's sl_def.h holds its own: the hardware's registers, and each group's structures, enums and fixed values. More…

Included by glyph_arm.c, window_spans.c, engine_stubs.h, screen_transition.h, globals.h, mul_fx.h and system.h.

Structures

NameDescription
structEVENTAn event: its function's address, its priority (see EVENT_PASS_) and its flags, where EVENT_FLAG_KEEP_RUNNING keeps it running while overlay events are suspended.
unionHEAP_STATEThe heap's 64 slots, the first two holding the next free EWRAM and IWRAM addresses.
structAFFINE_TRANSFORMThe affine group.
unionOAM_MATRIXOne OAM rotation-scaling matrix: pa, pb, pc and pd in 8.8 fixed point, the inverse of the transform the sprite is drawn with.
structDMA_REGISTERSThe dma group.
structSTUBThe stub group.
structARC_TAN_STUBAn entry of the system library's table whose two-argument target the world map's tilt calls, the arctangent.
structTRIG_STUBAn entry of the system library's table whose one-argument target the world map's tilt calls, the sine or the cosine.
structSYSTEM_STUB_TABLEThe start of the system library's stub table, as far as syCos.
structIO_WRITE_QUEUEThe io_write_queue group.
structOAM_WORDSThe oam_words group.
structPOSThe point group.
structPROJECTIONThe projection group.
structBG_SCROLLA background's hardware scroll offsets.
structBUP_SECTOR_HEADERThe header of a save sector in flash: its signature, the part it holds, its checksum and its counter.
structBUP_FILE_SUMMARYA save file's summary for the file list: the leader's name, level and class, the area, play time, coins, Djinn and party.
structBUP_STATEThe save state: which of the 16 flash sectors hold a part, their part ids and counters, one sector's buffer and the three files' summaries.
structSERIAL_PACKETThe serial group.
structSERIAL_STATEThe link cable's runtime: its mode and phase, the consoles heard from, the send position and the packet buffers the interrupt handler fills.
structSERIAL_TRANSFER_STATEA console's block transfer state, exchanged with the partner each VBlank: its block number, its status and flags, and a 20-byte block.
structANIMATION_METADATAThe sprite_metadata group.
structVECTOR3The vector3 group.
structVRAM_CACHE_ENTRYA sprite slot of the VRAM cache: the size of its block and where the block starts in sprite VRAM.

Macros

NameDescription
#defineREG_DISPCNT (*(volatile Uint16 *)0x04000000)Mode, layers, windows.
#defineREG_DISPSTAT (*(volatile Uint16 *)0x04000004)Blank flags and IRQs.
#defineDISPSTAT_VBLANK_INTR 0x0008At the start of each VBlank.
#defineDISPSTAT_HBLANK_INTR 0x0010At the end of each line.
#defineDISPSTAT_VCOUNT_INTR 0x0020On the DISPSTAT_VCOUNT_LINE line.
#defineDISPSTAT_VCOUNT_LINE (line) ((line) << 8)DISPSTAT's high byte: the line the VCount interrupt fires on (the LYC compare).
#defineREG_VCOUNT (*(volatile Uint16 *)0x04000006)Line being drawn, 0..227.
#defineDISPLAY_TOTAL_LINES 228The lines REG_VCOUNT counts through in a tick: the DISPLAY_HEIGHT drawn and those of VBlank.
#defineREG_BG1CNT (*(volatile Uint16 *)0x0400000a)BG1.
#defineREG_BG2CNT (*(volatile Uint16 *)0x0400000c)BG2.
#defineREG_BG3CNT (*(volatile Uint16 *)0x0400000e)BG3.
#defineBGCNT_PRIORITY (n) (n)Draw order, 0 in front to 3 behind.
#defineBGCNT_CHAR_BASE (block) ((block) << 2)The 16 KB character block, 0 to 3, the layer's tiles are read from.
#defineBGCNT_MOSAIC 0x0040Applies REG_MOSAIC's block size.
#defineBGCNT_256_COLORS 0x00808bpp tiles, not 16-colour 4bpp ones.
#defineBGCNT_SCREEN_BASE (block) ((block) << 8)The 2 KB screen block, 0 to 31, the layer's map is read from.
#defineBGCNT_WRAP 0x2000Affine backgrounds only: wrap around off the layer's area, which is otherwise transparent.
#defineBGCNT_SIZE (n) ((n) << 14)The background's size: for an affine one, 0 to 3 are 128, 256, 512 and 1024 pixels square.
#defineDISPCNT_MODE_MASK 0x0007REG_DISPCNT's three video mode bits, which hold a DISPCNT_MODE_ value.
#defineREG_BG1HOFS (*(volatile Uint16 *)0x04000014)The text backgrounds' scroll offsets, write-only: the map pixel, 0 to 511, at the screen's left edge (HOFS) or top edge (VOFS).
#defineREG_BG1VOFS (*(volatile Uint16 *)0x04000016)BG1, vertical
#defineREG_BG2HOFS (*(volatile Uint16 *)0x04000018)BG2, horizontal
#defineREG_BG2VOFS (*(volatile Uint16 *)0x0400001a)BG2, vertical
#defineREG_BG3HOFS (*(volatile Uint16 *)0x0400001c)BG3, horizontal
#defineREG_BG3VOFS (*(volatile Uint16 *)0x0400001e)BG3, vertical
#defineQ_8_8 (n) ((Sint16)((n) * 256))The BG2/BG3 affine matrix entries are signed 8.8 fixed point: texels stepped per screen pixel.
#defineREG_BG2PA (*(volatile Uint16 *)0x04000020)The affine backgrounds' matrices and origins, write-only.
#defineREG_BG2PB (*(volatile Uint16 *)0x04000022)BG2: x step a line
#defineREG_BG2PC (*(volatile Uint16 *)0x04000024)BG2: y step a pixel
#defineREG_BG2PD (*(volatile Uint16 *)0x04000026)BG2: y step a line
#defineREG_BG2X (*(volatile Sint32 *)0x04000028)BG2: origin x
#defineREG_BG2Y (*(volatile Sint32 *)0x0400002c)BG2: origin y
#defineREG_BG3PA (*(volatile Uint16 *)0x04000030)BG3: x step a pixel
#defineREG_BG3PB (*(volatile Uint16 *)0x04000032)BG3: x step a line
#defineREG_BG3PC (*(volatile Uint16 *)0x04000034)BG3: y step a pixel
#defineREG_BG3PD (*(volatile Uint16 *)0x04000036)BG3: y step a line
#defineREG_BG3X (*(volatile Sint32 *)0x04000038)BG3: origin x
#defineREG_BG3Y (*(volatile Sint32 *)0x0400003c)BG3: origin y
#defineDISPLAY_WIDTH 240The screen's size in pixels.
#defineDISPLAY_HEIGHT 160
#defineDISPLAY_TILE_WIDTH (DISPLAY_WIDTH / 8)The screen's size in 8-pixel tiles.
#defineDISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / 8)
#defineREG_WIN0H (*(volatile Uint16 *)0x04000040)The two windows' edges, each a WIN_RANGE value in pixels.
#defineREG_WIN1H (*(volatile Uint16 *)0x04000042)window 1, left and right
#defineREG_WIN0V (*(volatile Uint16 *)0x04000044)window 0, top and bottom
#defineREG_WIN1V (*(volatile Uint16 *)0x04000046)window 1, top and bottom
#defineWIN_RANGE (start, end) (((start) << 8) | (end))A REG_WINxH or REG_WINxV value: the window covers start up to, but not including, end.
#defineREG_WININ (*(volatile Uint16 *)0x04000048)What windows 0 and 1 show.
#defineREG_WINOUT (*(volatile Uint16 *)0x0400004a)What the rest shows.
#defineWININ_WIN0_BG0 0x0001REG_WININ: the layers shown inside window 0 (low byte) and window 1 (high byte).
#defineWININ_WIN0_BG1 0x0002window 0: BG1
#defineWININ_WIN0_BG2 0x0004window 0: BG2
#defineWININ_WIN0_BG3 0x0008window 0: BG3
#defineWININ_WIN0_OBJ 0x0010window 0: sprites
#defineWININ_WIN0_CLR 0x0020window 0: the colour effect
#defineWININ_WIN0_ALL 0x003fwindow 0: everything
#defineWININ_WIN1_BG0 0x0100window 1: BG0
#defineWININ_WIN1_BG1 0x0200window 1: BG1
#defineWININ_WIN1_BG2 0x0400window 1: BG2
#defineWININ_WIN1_BG3 0x0800window 1: BG3
#defineWININ_WIN1_OBJ 0x1000window 1: sprites
#defineWININ_WIN1_CLR 0x2000window 1: the colour effect
#defineWININ_WIN1_ALL 0x3f00window 1: everything
#defineWINOUT_WIN01_BG0 0x0001REG_WINOUT: the layers shown outside both windows (low byte) and inside the sprite window (high byte).
#defineWINOUT_WIN01_BG1 0x0002outside: BG1
#defineWINOUT_WIN01_BG2 0x0004outside: BG2
#defineWINOUT_WIN01_BG3 0x0008outside: BG3
#defineWINOUT_WIN01_OBJ 0x0010outside: sprites
#defineWINOUT_WIN01_CLR 0x0020outside: the colour effect
#defineWINOUT_WIN01_ALL 0x003foutside: everything
#defineWINOUT_WINOBJ_BG0 0x0100sprite window: BG0
#defineWINOUT_WINOBJ_BG1 0x0200sprite window: BG1
#defineWINOUT_WINOBJ_BG2 0x0400sprite window: BG2
#defineWINOUT_WINOBJ_BG3 0x0800sprite window: BG3
#defineWINOUT_WINOBJ_OBJ 0x1000sprite window: sprites
#defineWINOUT_WINOBJ_CLR 0x2000sprite window: the colour effect
#defineWINOUT_WINOBJ_ALL 0x3f00sprite window: everything
#defineREG_MOSAIC (*(volatile Uint16 *)0x0400004c)Mosaic block sizes.
#defineREG_BLDCNT (*(volatile Uint16 *)0x04000050)Colour effect, targets.
#defineBLDCNT_TGT1_BG0 0x0001REG_BLDCNT: the first target layers, the colour effect, then the second target layers that a blend mixes the first ones with.
#defineBLDCNT_TGT1_BG1 0x0002first target: BG1
#defineBLDCNT_TGT1_BG2 0x0004first target: BG2
#defineBLDCNT_TGT1_BG3 0x0008first target: BG3
#defineBLDCNT_TGT1_OBJ 0x0010first target: sprites
#defineBLDCNT_TGT1_BD 0x0020first target: the backdrop
#defineBLDCNT_TGT1_ALL 0x003ffirst target: every layer
#defineBLDCNT_EFFECT_NONE 0x0000no effect, the targets as drawn
#defineBLDCNT_EFFECT_BLEND 0x0040weighted by REG_BLDALPHA
#defineBLDCNT_EFFECT_LIGHTEN 0x0080towards white by REG_BLDY
#defineBLDCNT_EFFECT_DARKEN 0x00c0towards black by REG_BLDY
#defineBLDCNT_TGT2_BG0 0x0100second target: BG0
#defineBLDCNT_TGT2_BG1 0x0200second target: BG1
#defineBLDCNT_TGT2_BG2 0x0400second target: BG2
#defineBLDCNT_TGT2_BG3 0x0800second target: BG3
#defineBLDCNT_TGT2_OBJ 0x1000second target: sprites
#defineBLDCNT_TGT2_BD 0x2000second target: the backdrop
#defineBLDCNT_TGT2_ALL 0x3f00second target: every layer
#defineREG_BLDALPHA (*(volatile Uint16 *)0x04000052)the blend's weights
#defineBLEND_WEIGHT_MAX 16A blend weight's full strength: BLEND_ALPHA(BLEND_WEIGHT_MAX, 0) shows only the top layer.
#defineBLEND_ALPHA (top, bottom) ((top) | ((bottom) << 8))A REG_BLDALPHA value: top and bottom are the two targets' weights, out of BLEND_WEIGHT_MAX.
#defineREG_BLDY (*(volatile Uint16 *)0x04000054)Fade level, 0 to 16.
#defineBLEND_FADE_MAX 16REG_BLDY's whole fade: the targets drawn all white, or all black.
#defineBG_CANVAS_MAP ((volatile Sint16 *)BG_SCREEN_BLOCK(7))Screen block 7: BG2's affine map of a battle effect's canvas, a byte a tile (EFFECT_WRITE_CANVAS_MAP_ROW).
#defineREG_BG0HOFS ((void *)0x04000010)BG0HOFS as an address for a DMA: copies of BgScrollWork over all four backgrounds' scroll registers start here, and Mind Read's HBlank DMA writes one halfword a line into it.
#defineREG_DMA0 ((volatile Uint16 *)0x040000b0)DMA channel 0's registers as halfwords, for the line scrolls that set the whole channel up.
#defineDMA_CNT_H_INDEX 5A DMA channel's control, DMAxCNT_H, as a halfword after its source, destination and count (GBATEK "GBA DMA Transfers").
#defineREG_DMA3 ((volatile Uint32 *)0x040000d4)DMA channel 3's registers as words: the channel syDMAXCopy copies with.
#definePLTT 0x05000000Palette RAM: the background colours, then the sprites'.
#defineBG_PLTT_SIZE 512Bytes of background colours, 256 of them.
#defineBG_PLTT_COLORS (BG_PLTT_SIZE / 2)The background's 256 colours.
#definePLTT_COLORS (2 * BG_PLTT_COLORS)Colours in palette RAM: the background's, then the sprites'.
#definePLTT_BACKDROP (*(volatile Uint16 *)PLTT)Background colour 0, the backdrop shown where no layer draws.
#defineBG_PLTT ((volatile Uint16 *)PLTT)16 palettes of 16 colours.
#definePALETTE_COLORS 16Colours in one 16-colour palette.
#defineBG_PLTT_COLOR (palette, color)Colour color of 16-colour background palette palette.
#defineOBJ_PLTT ((volatile Uint16 *)(PLTT + BG_PLTT_SIZE))The sprites' 256 colours.
#defineOBJ_PLTT_COLOR (palette, color)Colour color of 16-colour sprite palette palette.
#defineRGB (r, g, b) (((b) << BLUE_SHIFT) | ((g) << GREEN_SHIFT) | (r))A 15-bit colour from its red, green and blue levels (0 to 31 each), as the palette stores it: blue in the high bits.
#defineGREEN_SHIFT 5Where a 15-bit colour keeps its green and blue levels, red being in the low bits.
#defineBLUE_SHIFT 10
#defineRGB_RED (color) ((color) & 0x1f)A 15-bit colour's red, green and blue levels, 0 to 31 each.
#defineRGB_GREEN (color) (((color) >> GREEN_SHIFT) & 0x1f)
#defineRGB_BLUE (color) (((color) >> BLUE_SHIFT) & 0x1f)
#defineRGB_LEVEL_MAX 31A colour channel's brightest level.
#defineRGB_WHITE RGB(RGB_LEVEL_MAX, RGB_LEVEL_MAX, RGB_LEVEL_MAX)The brightest colour, every channel at its highest level.
#defineRED_BITS RGB(RGB_LEVEL_MAX, 0, 0)A 15-bit colour's red, green and blue bits.
#defineGREEN_BITS RGB(0, RGB_LEVEL_MAX, 0)
#defineBLUE_BITS RGB(0, 0, RGB_LEVEL_MAX)
#defineIWRAM_START 0x03000000The start of the 32 KB of IWRAM, the CPU's fast internal work memory.
#defineEWRAM_START 0x02000000The start of the 256 KB of EWRAM, the slower external work memory.
#defineEWRAM_END 0x02040000The end of EWRAM: the limit the EWRAM heap's allocators test.
#defineVRAM 0x06000000Video RAM: background tiles and maps, then sprite tiles.
#defineBG_CHAR_SIZE 16384Bytes in a character block, 16 KB.
#defineBG_SCREEN_SIZE 2048Bytes in a screen block, 2 KB.
#defineBG_SCREEN_WIDTH 32Tiles in a row of a screen block, whose map is 32 tiles square.
#defineMAP_ROW_BYTES (BG_SCREEN_WIDTH * 2)The bytes of one row of a text background map, 32 entries.
#defineMAP_ENTRY_PAIR (left, right) ((right) << 16 | (left))Two background map entries side by side, written a word at a time.
#defineBG_TILE_PALETTE (n) ((n) << 12)A screen block entry's 16-colour palette, in its top four bits (its flip bits are window.h's TILE_HFLIP and TILE_VFLIP).
#defineBG_TILE_PALETTE_OF (entry) (((entry) >> 12) & 0xf)The palette a map entry draws its tile with, 0 to 15.
#defineBG_CHAR_BLOCK (n) ((Uint8 *)VRAM + (n) * BG_CHAR_SIZE)Background tile memory's 16 KB character block n, 0 to 3.
#defineBG_SCREEN_BLOCK (n) ((Uint8 *)VRAM + (n) * BG_SCREEN_SIZE)The 2 KB screen block n of VRAM, 0 to 31, that holds a map.
#defineTILE_SIZE_4BPP 32Bytes in an 8x8 tile of 16 colours.
#defineTILE_ROW_SIZE_4BPP (TILE_SIZE_4BPP / 8)The bytes of one pixel row of a 16-colour tile.
#defineTILE_SIZE_8BPP 64Bytes in an 8x8 tile of 256 colours.
#defineSCREEN_TILE_BYTESThe tiles of a picture that fills the screen in 256 colours.
#definePIXELS_4BPP (color) ((color) * 0x11111111u)A word of eight 4-bit pixels, all colour color: one row of a 16-colour tile.
#definePIXELS_8BPP (color) ((color) * 0x01010101u)A word of four 8-bit pixels, all colour color.
#defineOBJ_VRAM0 (VRAM + 0x10000)Sprite tile memory: the 32 KB of sprite tiles after the four character blocks.
#defineREG_TM3CNT (*(volatile Uint32 *)0x0400010c)Timer 3's reload value and control as one word; it paces the serial transfers.
#defineREG_TM3CNT_H (*(volatile Uint16 *)0x0400010e)Timer 3's control.
#defineTIMER_INTR_ENABLE 0x0040TMxCNT_H flags.
#defineTIMER_ENABLE 0x0080Starts the timer counting.
#defineTIMER_256CLK 0x0002Counts every 256 cycles, 65536 times a second.
#defineREG_SIODATA32 ((volatile Uint32 *)0x04000120)The serial data: the 32-bit mode's word, or multiplayer's four received halfwords.
#defineREG_SIOCNT (*(volatile Uint32 *)0x04000128)Serial control read as a word, with SIODATA8 above it.
#defineREG_SIOCNT16 (*(volatile Uint16 *)0x04000128)Serial control alone.
#defineREG_SIODATA8 (*(volatile Uint16 *)0x0400012a)The 8-bit mode's data, which multiplayer mode sends from.
#defineREG_KEYINPUT (*(volatile Uint16 *)0x04000130)A 0 bit is a held key.
#defineREG_KEYCNT (*(volatile Uint16 *)0x04000132)Keys for the keypad IRQ.
#defineREG_RCNT (*(volatile Uint16 *)0x04000134)The serial port's mode.
#defineSIO_115200_BPS 0x0003Multiplayer's fastest baud rate.
#defineSIO_MULTI_SI 0x0004Multiplayer: this console's SI pin, clear on the parent.
#defineSIO_MULTI_SD 0x0008Multiplayer: every console is ready.
#defineSIO_ID 0x0030Multiplayer: this console's id, 0 the parent.
#defineSIO_ID_SHIFT 4SIO_ID's lowest bit.
#defineSIO_ID_OF (control) (((control) << 26) >> 30)The multiplayer id (SIO_ID) in a SIOCNT value, taken out by shifts.
#defineSIO_ERROR 0x0040Multiplayer: the last transfer failed.
#defineSIO_ERROR_OF (control) (((control) << 25) >> 31)The SIO_ERROR bit of a SIOCNT value, taken out by shifts as SIO_ID_OF takes the id.
#defineSIO_START 0x0080Starts a transfer; set while one runs.
#defineSIO_32BIT_MODE 0x1000Normal mode, 32 bits a transfer.
#defineSIO_MULTI_MODE 0x2000Multiplayer mode.
#defineSIO_INTR_ENABLE 0x4000An interrupt when a transfer ends.
#defineRCNT_SIO_MODE 0x0000RCNT's mode: 0 leaves the port to SIOCNT's serial modes; bit 15 alone makes it general-purpose pins.
#defineRCNT_GPIO_MODE 0x8000The port as general-purpose pins.
#defineDMA_DEST_INC 0x0000DMAxCNT_H flags.
#defineDMA_DEST_DEC 0x0020destination steps down
#defineDMA_DEST_FIXED 0x0040destination stays, as for a register
#defineDMA_DEST_RELOAD 0x0060steps up, back to its start each repeat
#defineDMA_SRC_INC 0x0000source steps up
#defineDMA_SRC_DEC 0x0080source steps down
#defineDMA_SRC_FIXED 0x0100source stays, as for a fill
#defineDMA_REPEAT 0x0200runs again at each start condition
#defineDMA_16BIT 0x0000moves halfwords
#defineDMA_32BIT 0x0400moves words
#defineDMA_DREQ_ON 0x0800channel 3: the cartridge requests it
#defineDMA_START_NOW 0x0000as soon as it's enabled
#defineDMA_START_VBLANK 0x1000
#defineDMA_START_HBLANK 0x2000
#defineDMA_START_SPECIAL 0x3000channels 1 and 2: a sound FIFO's request
#defineDMA_INTR_ENABLE 0x4000an interrupt when it ends
#defineDMA_ENABLE 0x8000arms the channel
#defineDMA_BUSY ((Uint32)DMA_ENABLE << 16)DMA_ENABLE in a channel's 32-bit count and control word, which the hardware clears once the transfer is done.
#defineDMA_START_TIMING_DRQ_REPEATA DMA control's start timing (bits 12 and 13), cartridge request (bit 11) and repeat (bit 9): the bits cleared before a channel is stopped.
#defineDMA_COPY_WORDS (n) ((DMA_ENABLE | DMA_32BIT) << 16 | (n))DMA control words: copy n words or halfwords at once, fill n words from one fixed source word, or one halfword or word each HBlank to a register reloaded every line (a scanline table that drives a window edge, a scroll or an affine register).
#defineDMA_FILL_HALFWORDS (n) ((DMA_ENABLE | DMA_SRC_FIXED) << 16 | (n))
#defineDMA_FILL_WORDS (n) ((DMA_ENABLE | DMA_32BIT | DMA_SRC_FIXED) << 16 | (n))
#defineDMA_COPY_HALFWORDS (n) (DMA_ENABLE << 16 | (n))
#defineDMA_COPY_HALFWORDS_DOWN (n)n halfwords copied from the last back to the first, source and destination stepping down, so that a run can move up over itself.
#defineDMA_HBLANK_HALFWORD_PER_LINEA halfword each HBlank, as for a scroll or a window edge.
#defineDMA_HBLANK_WORDS_PER_LINE (n)n words each HBlank, as for the affine registers of a background written together.
#defineDMA_HBLANK_WORD_PER_LINE DMA_HBLANK_WORDS_PER_LINE(1)A word each HBlank, as for a pair of registers written together.
#defineCPU_SET_SRC_FIXED 0x01000000BIOS CpuSet control flags, above its count.
#defineCPU_SET_32BIT 0x04000000Words rather than halfwords.
#defineOAM ((void *)0x07000000)the sprites' attributes
#defineOAM_SIZE 1024OAM's size in bytes: 128 sprites of 8 bytes
#defineOBJ_SIZE_8X8 0x00000000A sprite's attributes 0 and 1 as one word, attr0 | attr1 << 16, the way functions that build their own sprite lists write them; x, 0 to 511, is shifted into the high half and y, 0 to 255, is the low byte.
#defineOBJ_SIZE_16X16 0x40000000
#defineOBJ_SIZE_32X32 0x80000000
#defineOBJ_SIZE_64X64 0xc0000000
#defineOBJ_SIZE_16X8 0x00004000
#defineOBJ_SIZE_32X8 0x40004000
#defineOBJ_SIZE_32X16 0x80004000
#defineOBJ_SIZE_64X32 0xc0004000
#defineOBJ_SIZE_8X16 0x00008000
#defineOBJ_SIZE_16X32 0x80008000
#defineOBJ_SIZE_32X64 0xc0008000
#defineOBJ_AFFINE 0x00000100Drawn through its affine matrix.
#defineOBJ_DOUBLE_SIZE 0x00000200An affine sprite drawn in a box twice its size, so turning never clips it.
#defineOBJ_MODE (mode) ((mode) << 10)An SPR_MODE.
#defineOBJ_256_COLORS 0x000020008bpp tiles, as BGCNT_256_COLORS.
#defineOBJ_HFLIP 0x10000000A plain sprite mirrored left to right.
#defineOBJ_VFLIP 0x20000000A plain sprite mirrored top to bottom.
#defineOBJ_PRIORITY (n) ((n) << 10)Attribute 2 above its tile number: the sprite's priority, 0 in front to 3 behind, and its 16-colour palette.
#defineOBJ_PALETTE (n) ((n) << 12)
#defineOBJ_X (x) ((x) << 16)A sprite's x in the attr01 word of an OAM_WORDS entry, whose attribute 1 is its high half.
#defineOBJ_MATRIX (n) ((n) << 25)An affine sprite's matrix number, attribute 1's bits 9 to 13, in the attr01 word.
#defineOBJ_AFFINE_PARAMETER (value) ((value) << 16)An affine parameter in the high half of an OAM_WORDS entry's attr2 word: the entries 4n to 4n + 3 hold affine matrix n's four.
#defineOBJ_X_MASK 0x1ffAttribute 1's nine bits of x: a sprite left of the screen is at 512 less its distance.
#defineOBJ_POSITION (x, y) (OBJ_X((x) & OBJ_X_MASK) | ((y) & 0xff))A sprite's place in its attr01 word: x in attribute 1's nine bits and y in attribute 0's eight, each wrapped as the screen wraps them.
#defineOBJ_TILE_MASK 0x3ffAttribute 2's ten bits of tile number, counted in 4-bit tiles from the start of sprite VRAM.
#defineSPRITE_TILES (width, height) ((width) / 8 * ((height) / 8))The tile numbers a sprite of width by height pixels takes, of 16 colours and of 256 (two numbers to a tile): a picture's sprites follow one another so in sprite VRAM.
#defineSPRITE_TILES_8BPP (width, height) (2 * SPRITE_TILES(width, height))
#defineOBJ_Y_RANGE 256Attribute 0 holds eight bits of a sprite's y, so its y wraps round at 256 lines.
#defineKEYS_MASK 0x3ffthe ten keys' bits; KEYINPUT reads 0 for a held key
#defineDPAD_INDEX (keys) (((keys) >> 4) & 15)The direction pad's four keys (KEY_RIGHT to KEY_DOWN) as a number 0 to 15, to index a table with a row for each combination held.
#defineREG_BG0CNT (*(volatile Uint16 *)0x04000008)BG0's control (BGCNT_).
#defineREG_BG0VOFS (*(volatile Uint16 *)0x04000012)BG0's vertical scroll.
#defineREG_SOUNDCNT_H (*(volatile Uint16 *)0x04000082)Direct sound's mixing: volumes, speakers, timers and FIFO resets.
#defineSOUND_CGB_MIX_FULL 0x0002Sounds 1 to 4 at full volume.
#defineSOUND_A_MIX_FULL 0x0004Direct sound A at full, not half.
#defineSOUND_B_MIX_FULL 0x0008Direct sound B at full, not half.
#defineSOUND_ALL_MIX_FULLSounds 1 to 4 and both direct sound channels all at full volume.
#defineSOUND_A_RIGHT_OUTPUT 0x0100A to the right speaker.
#defineSOUND_A_LEFT_OUTPUT 0x0200A to the left speaker.
#defineSOUND_A_TIMER_0 0x0000A plays at timer 0's rate.
#defineSOUND_A_FIFO_RESET 0x0800Empties A's FIFO.
#defineSOUND_B_RIGHT_OUTPUT 0x1000B to the right speaker.
#defineSOUND_B_LEFT_OUTPUT 0x2000B to the left speaker.
#defineSOUND_B_TIMER_0 0x0000B plays at timer 0's rate.
#defineSOUND_B_FIFO_RESET 0x8000Empties B's FIFO.
#defineREG_SOUNDBIAS (*(volatile Uint16 *)0x04000088)Output bias, rate.
#defineREG_FIFO_A (*(volatile Uint32 *)0x040000a0)A's samples, 4 a write.
#defineREG_FIFO_B (*(volatile Uint32 *)0x040000a4)B's samples, 4 a write.
#defineREG_DMA0SAD (*(volatile Uint32 *)0x040000b0)The four DMA channels: source, destination, then the count with the control halfword (CNT_H, the DMA_ flags) above it.
#defineREG_DMA0DAD (*(volatile Uint32 *)0x040000b4)channel 0: destination
#defineREG_DMA0CNT
#defineREG_DMA0CNT_H (*(volatile Uint16 *)0x040000ba)channel 0: control
#defineREG_DMA1SAD (*(volatile Uint32 *)0x040000bc)channel 1: source
#defineREG_DMA1DAD (*(volatile Uint32 *)0x040000c0)channel 1: destination
#defineREG_DMA1CNT
#defineREG_DMA1CNT_H (*(volatile Uint16 *)0x040000c6)channel 1: control
#defineREG_DMA2SAD (*(volatile Uint32 *)0x040000c8)channel 2: source
#defineREG_DMA2DAD (*(volatile Uint32 *)0x040000cc)channel 2: destination
#defineREG_DMA2CNT
#defineREG_DMA2CNT_H (*(volatile Uint16 *)0x040000d2)channel 2: control
#defineREG_DMA3SAD (*(volatile Uint32 *)0x040000d4)channel 3: source
#defineREG_DMA3DAD (*(volatile Uint32 *)0x040000d8)channel 3: destination
#defineREG_DMA3CNT
#defineREG_DMA3CNT_H (*(volatile Uint16 *)0x040000de)channel 3: control
#defineREG_TM0CNT_L (*(volatile Uint16 *)0x04000100)Timers 0 to 2: CNT_L is the reload value, and reads back the count; CNT_H takes the TIMER_ flags.
#defineREG_TM0CNT_H (*(volatile Uint16 *)0x04000102)timer 0: control
#defineREG_TM1CNT_L (*(volatile Uint16 *)0x04000104)timer 1: reload
#defineREG_TM1CNT_H (*(volatile Uint16 *)0x04000106)timer 1: control
#defineREG_TM2CNT_L (*(volatile Uint16 *)0x04000108)timer 2: reload
#defineREG_TM2CNT_H (*(volatile Uint16 *)0x0400010a)timer 2: control
#defineREG_IE (*(volatile Uint16 *)0x04000200)The interrupts enabled.
#defineREG_IF (*(volatile Uint16 *)0x04000202)Pending; a 1 written clears.
#defineREG_WAITCNT (*(volatile Uint16 *)0x04000204)Cartridge wait states.
#defineWAITCNT_SRAM_SLOWEST 0x0003WAITCNT's slowest SRAM wait (bits 1 and 0), 8 cycles, pret's WAITCNT_SRAM_8: the wait the flash functions read the chip with; programming and erasing use the chip's wait[0], then restore it.
#defineWAITCNT_SRAM_MASK 0x0003WAITCNT's SRAM wait bits.
#defineREG_IME (*(volatile Uint16 *)0x04000208)All interrupts' master switch.
#defineKEYCNT_SOFT_RESET 0xc00fKEYCNT values: the interrupt fires when all the listed keys are held at once.
#defineKEYCNT_DISARMED
#defineKEYCNT_SHOULDERS_WAKE 0xc300L and R, which wake the sleep
#defineWAITCNT_GAME 0x4014ROM wait states 3 and 1 with the prefetch buffer on, SRAM at 4; written by the power-on set-up.
#defineEVENT_PASS_VBLANK 0x480An event's priority: the high byte picks the pass that runs it, the low byte ranks it within the pass (higher runs first).
#defineEVENT_PASS_TICK 0xc80
#defineEVENT_PASS_VBLANK_FIRST (EVENT_PASS_VBLANK + 127)The highest rank in the VBlank pass: an event added here runs first of the VBlank events, before the tick's first line is drawn.
#defineEVENT_PRIORITY_EMPTY -1An empty slot's priority, sorted last: the sort reads priorities signed.
#defineEVENT_PRIORITY_REMOVED 0x7fffA removed event's priority: its odd high byte matches no pass, and as the highest priority it sorts to the front of the table.
#defineEVENT_STATE_HIGH (task) (((Uint8 *)&(task)->priority)[1])An event's priority's high byte: the pass it runs in.
#defineEVENT_SUSPENDED 1The bit of an event's high priority byte (EVENT_STATE_HIGH) that suspends it.
#defineEVENT_FLAG_KEEP_RUNNING 1The bit of an event's flags that keeps it running while sySuspendOverlayEvents suspends the others.
#defineEVENT_IN_OVERLAY (task) (((task)->callback >> 24) == EWRAM_START >> 24)Whether the event's function is in EWRAM, where a scene's overlay runs.
#defineINTR_FLAG_VBLANK (1 << IRQ_VBLANK)The interrupt sources' bits in REG_IE and REG_IF.
#defineINTR_FLAG_TIMER3 (1 << IRQ_TIMER3)
#defineINTR_FLAG_SERIAL (1 << IRQ_SERIAL)
#defineINTR_FLAG_KEYPAD (1 << IRQ_KEYPAD)
#defineINTR_FLAG_GAMEPAK (1 << IRQ_GAMEPAK)
#defineHEAP_SLOT_BLOCK (n) (*(HeapSlots + (n)))The heap group.
#defineHEAP_SLOT_FROM (slots, from, slot) ((slots)[(slot) - (from)])Heap slot slot read through slots, a pointer to slot from of HeapSlots: code that holds one slot's address reaches its neighbours by their distance from it.
#defineGLOW_SHEET_ROOM 1550The room an effect gives its glow pictures: HEAP_SLOT_BATTLE_SHEET's size, and where an effect's own pictures start in a sheet whose glow pictures come first.
#defineMapGridState (*(void *(*)[]) & HeapSlots[HEAP_SLOT_MAP_GRID])The heap slots from HEAP_SLOT_MAP_GRID on: MapGridState[0] is the map's state (MAP_GRID_SCROLL_STATE, or the world map's WORLD_MAP_VIEW).
#defineMenuState (*(void **)&HeapSlots[HEAP_SLOT_MENU])The menu state, heap slot HEAP_SLOT_MENU: each menu screen and the shop read it through their own struct while they are open.
#defineFieldBlendStateWork (*(void *(*)[]) & HeapSlots[HEAP_SLOT_FIELD_BLEND])The heap slots from HEAP_SLOT_FIELD_BLEND on: FieldBlendStateWork[0] is the field's colour blend state.
#defineScreenTransitionStateWorkThe screen transition's state, heap slot HEAP_SLOT_SCREEN_TRANSITION.
#defineBattleEntryTimer (*(Sint32 **)&HeapSlots[HEAP_SLOT_BATTLE_ENTRY_TIMER])HEAP_SLOT_BATTLE_ENTRY_TIMER: the battle's entry transition timer in ticks.
#defineFieldEffectStateWork (*(void **)&HeapSlots[HEAP_SLOT_FIELD_EFFECT])The running Psynergy effect's state (FIELD_EFFECT_STATE), heap slot HEAP_SLOT_FIELD_EFFECT.
#defineDMA3 ((volatile DMA_REGISTERS *)REG_DMA3)DMA3, the channel the game copies with, as its three registers.
#defineTICKS_PER_SECOND 60The tick group.
#defineIO_WRITE_BYTE (1 << 16)Writes a byte.
#defineIO_WRITE_HALFWORD (2 << 16)Writes a halfword.
#defineIO_WRITE_WORD (3 << 16)Writes a word.
#defineIO_WRITE_SET (4 << 16)ORs the value into the register instead of storing it.
#defineIO_WRITE_CLEAR (8 << 16)Clears the value's bits in the register instead of storing it.
#definesyFixedDivEntryThe iwram_call group.
#definesyWordsClearEntry
#definesyWordsFillEntry
#definesySquartEntry
#definesyDecompressBitRuns
#definesyVectorTransformEntryReads all three word-aligned coordinates before writing the result.
#definesyMultiMatrixEntry
#definesyIntegerDivideEntry
#definesyIntegerDivideUnsignedEntry
#definesyDecompressSpritePictureEntry
#definesyWordsCopyEntry
#definesyWordsCopyOffset FIXED_OFFSET(5000, syIWRAMWordsCopy, syIWRAMIRQMain)Three IWRAM functions' distances in bytes from syIWRAMIRQMain, for code that calls them from the interrupt handler's address.
#definesyDivFXOffset FIXED_OFFSET(316, syIWRAMDivFX, syIWRAMIRQMain)
#definesySquartOffset FIXED_OFFSET(472, syIWRAMSquart, syIWRAMIRQMain)
#definesyWordsCopyLinkedsyWordsCopy reached through the linked IWRAM code's symbol, syIWRAMIRQMain, at its offset rather than at its fixed address (syWordsCopyEntry): the same function at the same address.
#defineBATTLE_PROJECTION_CENTER_X (DISPLAY_WIDTH / 2)Where the battle centres its projection on the screen: across the middle, and 120 pixels down, below the screen's middle.
#defineBATTLE_PROJECTION_CENTER_Y 120
#defineRamMapGridMetatileBufferThe ram_buffer group.
#defineRamDecodeBuffer FIXED_ADDRESS((Uint8 *), 0x0201c000, DecodeBuffer)
#defineRamMetatileTiles FIXED_ADDRESS((Uint8 *), 0x02020000, MetatileTiles)
#defineRamMapGridShapes FIXED_ADDRESS((Uint8 *), 0x0202c000, MapGridShapes)
#defineRamBgTileBuffer FIXED_ADDRESS((Uint8 *), 0x02038000, BgTileBuffer)
#defineRamEnemySpriteSlotsThe battle's enemy sprite slots, 16 KB each, inside the map grid's metatiles.
#defineRamIWRAMHeapEndThe end of the IWRAM heap, which the allocators test against, and the bottom of the stacks.
#defineRamTickWaitStackTopThe stack top sySynch() runs its ticks from: the 512 bytes below it are what the tick loop, its events and the VBlank work always have.
#defineRamVramCacheEntries
#defineRamMapGridState ((void **)&HeapSlots[HEAP_SLOT_MAP_GRID])State pointers in HeapSlots, by name, from the heap group's slot numbers.
#defineRamFieldState ((void **)&HeapSlots[HEAP_SLOT_FIELD])
#defineRamDisplayState ((void **)&HeapSlots[HEAP_SLOT_SCREEN_TRANSITION])
#defineRamFieldEffectState ((void **)&HeapSlots[HEAP_SLOT_FIELD_EFFECT])
#defineBUP_FILE_COUNT 3The save group.
#defineBupStateWork (*(BUP_STATE **)&HeapSlots[HEAP_SLOT_BUP])The save state, heap slot HEAP_SLOT_BUP under its own name; null between save operations.
#defineSECOND_PART_PLAY_TIME_WORD 64The word, counted from SceneLocalState (system/ewram.s), which opens a file's second part, that holds the second copy of the play time (mnSaveBuildFileSummary): InventorySnapshotWork's last, past SceneLocalState.
#defineSERIAL_PACKET_BYTES 32The bytes of one packet buffer in SERIAL_STATE.storage.
#defineSERIAL_BLOCK_NUMBER_MASK 0x7fSERIAL_TRANSFER_STATE.active and SerialBlockNumber hold a block number in their low seven bits, counting up and wrapping; the receiver's, with bit 7 set, asks the sender to rewind to that block (sySerialStepBlockTransfer).
#defineSERIAL_BLOCK_REWIND 0x80Bit 7: rewind to the block number.
#defineSERIAL_STATUS_RUNNING 0x80SERIAL_TRANSFER_STATE.status's bit 7, set when a send or receive starts; the receiver counts its blocks in the low bits (sySerialStepBlockTransfer).
#defineVRAM_CACHE_CLEAR ((const void *)-1)syVRAMCacheLoad's source that clears the entry's VRAM instead of copying.

Typedefs

NameDescription
typedef void (*EVENT_FUNC )(void);
typedef void (*INTERRUPT_HANDLER )(void);An interrupt source's handler, called by the IWRAM dispatcher.

Enumerations

NameDescription
enumDISPLAY_CONTROL { DISPCNT_MODE_0, DISPCNT_MODE_1, DISPCNT_MODE_2, DISPCNT_OBJ_ … }REG_DISPCNT's video modes and bits: each _ON bit shows its layer or turns its window on.
enumSPR_MODE { OBJ_MODE_NORMAL, OBJ_MODE_SEMI_TRANSPARENT, OBJ_MODE_WINDOW }A sprite's mode, OAM attribute 0's bits 11..10.
enumKEY_MASK { KEY_A, KEY_B, KEY_SELECT, KEY_START, KEY_RIGHT, KEY_LEFT, KE … }The keys' bits as REG_KEYINPUT and REG_KEYCNT lay them out; the game's key state (PerData and the rest) holds them set for a pressed key.
enumEVENT_LIMITS { EVENT_COUNT }The event group.
enumanonymous enum { IRQ_VBLANK, IRQ_HBLANK, IRQ_VCOUNT, IRQ_TIMER0, IRQ_TIMER1, … }The irq group.
enumHEAP_SLOT { HEAP_SLOT_MATRIX_STACK, HEAP_SLOT_SPRITE_ANIMATIONS, HEAP_SL … }The heap slots shared across folders, by index into HeapSlots.
enumanonymous enum { MATRIX_TRANSLATION_X, MATRIX_TRANSLATION_Y, MATRIX_TRANSLATI … }The matrix group.
enumSERIAL_PHASE { SERIAL_PHASE_SEARCHING, SERIAL_PHASE_CONNECTED }SERIAL_STATE.phase.
enumSERIAL_MODE { SERIAL_MODE_CHILD, SERIAL_MODE_CLOCKING }SERIAL_STATE.mode: how this console takes part in the link.
enumLINK_STAT { LINK_STATUS_HEARD_BOTH, LINK_STATUS_CLOCKING, LINK_STATUS_ER … }The link status bits sySerialExchangePayloads returns.
enumSERIAL_CHANNEL_FLAG { SERIAL_CHANNEL_PACKET_COMPLETE, SERIAL_CHANNEL_ERROR }SERIAL_STATE.channelFlags: what the transfer interrupts saw of a console's packets since the last tick.
enumSERIAL_RECEIVE_STATE { SERIAL_RECEIVE_IDLE, SERIAL_RECEIVE_ACTIVE, SERIAL_RECEIVE_D … }SERIAL_TRANSFER_STATE.flags: how far this console's receive has got.
enumSERIAL_SEND_STATE { SERIAL_SEND_IDLE, SERIAL_SEND_MORE, SERIAL_SEND_LAST }SERIAL_TRANSFER_STATE.peerFlags: the kind of block this console sends.
enumVRAM_CACHE_LIMITS { VRAM_CACHE_ENTRY_COUNT, VRAM_BLOCK_COUNT, VRAM_BLOCK_BYTES, … }The vram_cache group.
enumVRAM_CACHE_FIXED_ENTRY { VRAM_CACHE_ENTRY_ACTOR_SHADOW, VRAM_CACHE_ENTRY_GROUND_MASK, … }The cache entries kept for one use each, loaded by number.

Functions

NameDescription
voidBiosCpuSet (const void *src, void *dest, Uint32 control)The system library's functions that the SDK's units call.
Sint32__divsi3 (Sint32 numerator, Sint32 denominator)The C library's signed division and remainder (system/iwram_entry.s), which / and % compile to; declared for the functions that call them by name.
Sint32__modsi3 (Sint32 numerator, Sint32 denominator)

Variables

NameDescription
STATIC_ASSERT(offsetof (HEAP_STATE, heap.nextIwram)
extern Uint8syIWRAMIRQMain []The interrupt dispatcher at the start of the IWRAM-resident code, whose other functions are reached at fixed offsets from it (the iwram_call group in system/definitions.h).
extern Uint8syIWRAMDivFX []
extern Uint8syIWRAMWordsClear []The IWRAM function that clears a run of words, which the OAM build calls by its address.
extern Uint8syIWRAMWordsFill []
extern Uint8syIWRAMSquart []
extern Uint8syIWRAMExpandBitRuns []
extern Uint8syIWRAMTransformVector []
extern Uint8syIWRAMMultiMatrix []
extern Uint8syIWRAMSignedDivide []
extern Uint8syIWRAMUnsignedDivide []
extern Uint8syIWRAMDecompress []
extern Uint8syIWRAMWordsCopy []
extern Uint8TickWaitStackTop []

Description

The system library's types and constants, as SGL's sl_def.h holds its own: the hardware's registers, and each group's structures, enums and fixed values. system.h includes it; a file built by another compiler can include it alone.

Macros in detail

REG_DISPCNT

#define REG_DISPCNT (*(volatile Uint16 *)0x04000000)

Mode, layers, windows.

Referenced by btDebugBattleViewMessages(), btEffectApplyWindowBlendRegisters(), btEffectConfigureEffectDisplay(), btEffectEndCanvasLayer(), btEffectHideBg1AndRestoreBackdrop(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunShatteringOpening(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btElementGlowEnd(), btElementGlowPlay(), btRun(), btStagingRunAttack(), btTransitionRun(), btTransitionRunMosaicFadeOut(), fdActorSystemResumeProjectionAndHideLayers(), fdActorSystemSuspendProjectionAndShowSprites(), fdLuckyDiceRun(), fdLuckyDiceStart(), fdLuckyWheelsRun(), fdLuckyWheelsStart(), fdMapGridLoadMap(), fdMapScreenShow(), fdScreenTransitionStart(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdateScanline(), fdScreenTransitionUpdateScanlineTable(), fdSpriteViewerRun(), fdWorldMapApplyAffinePage(), fdWorldMapInitPerspective(), mnBattleCommandRowRun(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scAltinPeakFlickerWaterOut(), scBabiPalaceWakeFromFinalsDream(), scTitleRevealScreen(), syInit() and sySynch().

Definition at line 18 of file definitions.h.

REG_DISPSTAT

#define REG_DISPSTAT (*(volatile Uint16 *)0x04000004)

Blank flags and IRQs.

Referenced by syInstallIWRAMAndIRQs() and syIntFunction().

Definition at line 20 of file definitions.h.

DISPSTAT_VBLANK_INTR

#define DISPSTAT_VBLANK_INTR 0x0008

At the start of each VBlank.

Referenced by syIntFunction().

Definition at line 25 of file definitions.h.

DISPSTAT_HBLANK_INTR

#define DISPSTAT_HBLANK_INTR 0x0010

At the end of each line.

Definition at line 27 of file definitions.h.

DISPSTAT_VCOUNT_INTR

#define DISPSTAT_VCOUNT_INTR 0x0020

On the DISPSTAT_VCOUNT_LINE line.

Definition at line 29 of file definitions.h.

DISPSTAT_VCOUNT_LINE

#define DISPSTAT_VCOUNT_LINE(line) ((line) << 8)

DISPSTAT's high byte: the line the VCount interrupt fires on (the LYC compare).

Referenced by syIntFunction().

Definition at line 32 of file definitions.h.

REG_VCOUNT

#define REG_VCOUNT (*(volatile Uint16 *)0x04000006)

Line being drawn, 0..227.

Referenced by fdScreenTransitionUpdateScanline(), scCrossboneIsleSteppingStonesJitterBackgroundScroll(), scKolimaForestFloodgateChangeRiverLines(), scTretTreeBranchApplyBg3ScrollAtScanline() and sySynch().

Definition at line 34 of file definitions.h.

DISPLAY_TOTAL_LINES

#define DISPLAY_TOTAL_LINES 228

The lines REG_VCOUNT counts through in a tick: the DISPLAY_HEIGHT drawn and those of VBlank. A line's HBlank comes before the next line is drawn, the last line's before line 0.

Referenced by scCrossboneIsleSteppingStonesJitterBackgroundScroll() and scKolimaForestFloodgateChangeRiverLines().

Definition at line 38 of file definitions.h.

REG_BG1CNT

#define REG_BG1CNT (*(volatile Uint16 *)0x0400000a)

BG1.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btEffectRunAttackSlash(), btEffectRunCriticalHit(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectSetupCanvasTileMap(), btTransitionRun(), btTransitionRunMosaicFadeOut(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridLoadMap(), fdMapScreenShow(), fdWorldMapEndStillImage(), fdWorldMapInitPerspective(), fdWorldMapPresentStillImage(), mnCommandRowPutBg1Behind(), mnCommandRowPutBg1InFront(), mnTitleLoadIntroBackgrounds(), scInit() and scLemurianShipRaiseTheShip().

Definition at line 43 of file definitions.h.

REG_BG2CNT

#define REG_BG2CNT (*(volatile Uint16 *)0x0400000c)

BG2.

Referenced by btBackgroundShowZoomedPage(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunDragonFire(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTorch(), btEffectStartCanvasLayer(), btEffectStartTiledCanvas(), btElementGlowPlay(), btTransitionRunMosaicFadeOut(), fdLuckyWheelsRun(), fdMapGridLoadMap(), fdWorldMapInitPerspective(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scFileScreenLoadBackground(), scInit(), scLemurianShipRaiseTheShip() and scTitleLoadBackground().

Definition at line 45 of file definitions.h.

REG_BG3CNT

#define REG_BG3CNT (*(volatile Uint16 *)0x0400000e)

BG3.

Referenced by btTransitionRunMosaicFadeOut(), fdMapGridLoadMap(), fdWorldMapInitPerspective(), mnCreditsRun(), scInit() and scLemurianShipRaiseTheShip().

Definition at line 47 of file definitions.h.

BGCNT_PRIORITY

#define BGCNT_PRIORITY(n) (n)

Draw order, 0 in front to 3 behind.

Referenced by btEffectEndCanvasLayer(), btEffectOpenAndCloseTiledCanvas(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBind(), btEffectRunBladeRain(), btEffectRunBolt(), btEffectRunBreak(), btEffectRunCriticalHit(), btEffectRunCurse(), btEffectRunDouse(), btEffectRunDragonFire(), btEffectRunDrain(), btEffectRunEruption(), btEffectRunFire(), btEffectRunFrost(), btEffectRunFroth(), btEffectRunGaia(), btEffectRunGatheringLights(), btEffectRunGrowingColumns(), btEffectRunIce(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunLobbedShells(), btEffectRunMoteFountain(), btEffectRunNeptune(), btEffectRunOrbitingSkulls(), btEffectRunPlasma(), btEffectRunProjectileVolley(), btEffectRunQuake(), btEffectRunRagnarok(), btEffectRunShatteringOpening(), btEffectRunShiningStar(), btEffectRunSparkGroups(), btEffectRunSpiderWeb(), btEffectRunSpire(), btEffectRunStarfieldFall(), btEffectRunStreakVolley(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTitanBlade(), btEffectRunTorch(), btEffectRunVine(), btEffectRunVolcano(), btEffectRunWhirlwind(), btEffectSetupCanvasTileMap(), btTransitionRun(), fdLuckyDiceRun() and 14 more.

Definition at line 50 of file definitions.h.

BGCNT_CHAR_BASE

#define BGCNT_CHAR_BASE(block) ((block) << 2)

The 16 KB character block, 0 to 3, the layer's tiles are read from.

Referenced by btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunCriticalHit(), btEffectRunDragonFire(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTorch(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btEffectStartTiledCanvas(), btElementGlowPlay(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridLoadMap(), fdWorldMapInitPerspective(), mnCreditsRun() and mnTitleShowCamelotLogo().

Definition at line 52 of file definitions.h.

BGCNT_MOSAIC

#define BGCNT_MOSAIC 0x0040

Applies REG_MOSAIC's block size.

Referenced by btTransitionRunMosaicFadeOut() and mnTitleLoadIntroBackgrounds().

Definition at line 54 of file definitions.h.

BGCNT_256_COLORS

#define BGCNT_256_COLORS 0x0080

8bpp tiles, not 16-colour 4bpp ones.

Referenced by btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunCriticalHit(), btEffectRunDragonFire(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTorch(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btEffectStartTiledCanvas(), btElementGlowPlay(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapScreenShow(), fdWorldMapPresentStillImage(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo() and mnTitleShowTitleScreen().

Definition at line 56 of file definitions.h.

BGCNT_SCREEN_BASE

#define BGCNT_SCREEN_BASE(block) ((block) << 8)

The 2 KB screen block, 0 to 31, the layer's map is read from.

Referenced by btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunCriticalHit(), btEffectRunDragonFire(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTorch(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btEffectStartTiledCanvas(), btElementGlowPlay(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridLoadMap(), fdMapScreenShow(), fdWorldMapEndStillImage(), fdWorldMapInitPerspective(), fdWorldMapPresentStillImage(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen() and syPrintClear().

Definition at line 58 of file definitions.h.

BGCNT_WRAP

#define BGCNT_WRAP 0x2000

Affine backgrounds only: wrap around off the layer's area, which is otherwise transparent.

Referenced by btCameraSetRange(), btEffectRunAtalanta(), btEffectRunDouse(), btEffectRunIce(), btEffectRunJudgment(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTorch(), btEffectStartTiledCanvas() and fdWorldMapInitPerspective().

Definition at line 61 of file definitions.h.

BGCNT_SIZE

#define BGCNT_SIZE(n) ((n) << 14)

The background's size: for an affine one, 0 to 3 are 128, 256, 512 and 1024 pixels square.

Referenced by btEffectStartTiledCanvas() and fdWorldMapInitPerspective().

Definition at line 64 of file definitions.h.

DISPCNT_MODE_MASK

#define DISPCNT_MODE_MASK 0x0007

REG_DISPCNT's three video mode bits, which hold a DISPCNT_MODE_ value.

Referenced by fdScreenTransitionUpdateScanline() and fdWorldMapApplyAffinePage().

Definition at line 87 of file definitions.h.

REG_BG1HOFS

#define REG_BG1HOFS (*(volatile Uint16 *)0x04000014)

The text backgrounds' scroll offsets, write-only: the map pixel, 0 to 511, at the screen's left edge (HOFS) or top edge (VOFS).

BG1, horizontal

Referenced by fdLineScrollArmDMA(), fdLuckyDiceRun(), fdLuckyWheelsRun(), scCrossboneIsleSteppingStonesJitterBackgroundScroll() and scKolimaForestFloodgateChangeRiverLines().

Definition at line 91 of file definitions.h.

REG_BG1VOFS

#define REG_BG1VOFS (*(volatile Uint16 *)0x04000016)

BG1, vertical

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 92 of file definitions.h.

REG_BG2HOFS

#define REG_BG2HOFS (*(volatile Uint16 *)0x04000018)

BG2, horizontal

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun(), scCrossboneIsleSteppingStonesJitterBackgroundScroll() and scKolimaForestFloodgateChangeRiverLines().

Definition at line 93 of file definitions.h.

REG_BG2VOFS

#define REG_BG2VOFS (*(volatile Uint16 *)0x0400001a)

BG2, vertical

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 94 of file definitions.h.

REG_BG3HOFS

#define REG_BG3HOFS (*(volatile Uint16 *)0x0400001c)

BG3, horizontal

Referenced by fdLineScrollArmDMA() and scTretTreeBranchApplyBg3ScrollAtScanline().

Definition at line 95 of file definitions.h.

REG_BG3VOFS

#define REG_BG3VOFS (*(volatile Uint16 *)0x0400001e)

BG3, vertical

Definition at line 96 of file definitions.h.

Q_8_8

#define Q_8_8(n) ((Sint16)((n) * 256))

The BG2/BG3 affine matrix entries are signed 8.8 fixed point: texels stepped per screen pixel.

Referenced by btCameraSetCommandView(), btCameraSetRange(), btEffectDrawClippedCanvasLine(), btEffectResetBg2Pa(), btEffectRunAtalanta(), btEffectRunBind(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunHealingMotes(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunMirroredWall(), btEffectRunNeptune(), btEffectRunQuake(), btEffectRunRay(), btEffectRunSpiderWeb(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTorch(), btEffectRunVine(), btEffectSetBg2AffineScaleHalf(), btEffectStartElementStreaks(), btElementGlowInitStarField(), fdWorldMapInitPerspective(), mnBattleCommandRowRun(), mnBattleTargetRunSelection(), mnConfirmSelection(), mnIconMenuDrawIcons(), mnSelectionMenuScroll(), mnSelectionMenuSetupIcon(), mnTextMeasureAllPages(), mnTextMeasureDecoded(), mnWindowSpriteUpdateAll() and mnWindowSpriteUpdateScaleAnimation().

Definition at line 100 of file definitions.h.

REG_BG2PA

#define REG_BG2PA (*(volatile Uint16 *)0x04000020)

The affine backgrounds' matrices and origins, write-only.

BG2: x step a pixel

Referenced by btBackgroundShowZoomedPage(), btEffectResetBg2Pa(), btEffectRunAtalanta(), btEffectRunBind(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunHealingMotes(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunMirroredWall(), btEffectRunNeptune(), btEffectRunQuake(), btEffectRunRay(), btEffectRunSpiderWeb(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTorch(), btEffectRunVine(), btEffectSetBg2AffineScaleHalf(), btEffectStartElementStreaks(), btElementGlowInitStarField(), fdWorldMapApplyAffinePage() and fdWorldMapInitPerspective().

Definition at line 103 of file definitions.h.

REG_BG2PB

#define REG_BG2PB (*(volatile Uint16 *)0x04000022)

BG2: x step a line

Referenced by btElementGlowInitStarField() and fdWorldMapInitPerspective().

Definition at line 104 of file definitions.h.

REG_BG2PC

#define REG_BG2PC (*(volatile Uint16 *)0x04000024)

BG2: y step a pixel

Referenced by btElementGlowInitStarField() and fdWorldMapInitPerspective().

Definition at line 105 of file definitions.h.

REG_BG2PD

#define REG_BG2PD (*(volatile Uint16 *)0x04000026)

BG2: y step a line

Referenced by btElementGlowInitStarField() and fdWorldMapInitPerspective().

Definition at line 106 of file definitions.h.

REG_BG2X

#define REG_BG2X (*(volatile Sint32 *)0x04000028)

BG2: origin x

Referenced by btEffectAdvanceBg2OnInterval(), btEffectApplyBg2Reference(), btEffectArmBg2AffineHBlankDMA(), btEffectRunBind(), btEffectRunBladeRain(), btEffectRunCastingImpact(), btEffectRunCurse(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunFrost(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunHealingMotes(), btEffectRunHelmSplitter(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunMirroredWall(), btEffectRunOrbitingSkulls(), btEffectRunQuake(), btEffectRunRay(), btEffectRunSleep(), btEffectRunSpiderWeb(), btEffectRunSpire(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunStatReduction(), btEffectRunSwirlSwipe(), btEffectRunThorn(), btEffectRunUndeadSword(), btEffectRunUnusedOrbitingSpirals(), btEffectRunUnusedTriangleStrike(), btEffectRunVine(), btElementGlowInitStarField(), btElementGlowPlay() and fdWorldMapInitPerspective().

Definition at line 107 of file definitions.h.

REG_BG2Y

#define REG_BG2Y (*(volatile Sint32 *)0x0400002c)

BG2: origin y

Referenced by btEffectAdvanceBg2OnInterval(), btEffectApplyBg2Reference(), btEffectRunStarfieldFall(), btElementGlowInitStarField() and fdWorldMapInitPerspective().

Definition at line 108 of file definitions.h.

REG_BG3PA

#define REG_BG3PA (*(volatile Uint16 *)0x04000030)

BG3: x step a pixel

Referenced by fdWorldMapInitPerspective().

Definition at line 109 of file definitions.h.

REG_BG3PB

#define REG_BG3PB (*(volatile Uint16 *)0x04000032)

BG3: x step a line

Referenced by fdWorldMapInitPerspective().

Definition at line 110 of file definitions.h.

REG_BG3PC

#define REG_BG3PC (*(volatile Uint16 *)0x04000034)

BG3: y step a pixel

Referenced by fdWorldMapInitPerspective().

Definition at line 111 of file definitions.h.

REG_BG3PD

#define REG_BG3PD (*(volatile Uint16 *)0x04000036)

BG3: y step a line

Referenced by fdWorldMapInitPerspective().

Definition at line 112 of file definitions.h.

REG_BG3X

#define REG_BG3X (*(volatile Sint32 *)0x04000038)

BG3: origin x

Referenced by fdWorldMapInitPerspective().

Definition at line 113 of file definitions.h.

REG_BG3Y

#define REG_BG3Y (*(volatile Sint32 *)0x0400003c)

BG3: origin y

Referenced by fdWorldMapInitPerspective().

Definition at line 114 of file definitions.h.

DISPLAY_WIDTH

#define DISPLAY_WIDTH 240

The screen's size in pixels.

Referenced by btEffectBuildWindowEdgeTable(), btEffectRunKirin(), btEffectRunRamses(), btElementGlowPlay(), btStagingRunAttack(), btTransitionRun(), fdApplyEntrance(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsUpdate(), fdMapGridUpdateLayerScroll(), fdRenderApplyProjectedPlacement(), fdRenderPlaceProjectedSprite(), fdScreenTransitionUpdateScanlineTable(), fdWeatherUpdateRain(), fdWorldMapInitPerspective(), fdWorldMapUpdateView(), mnTitleLoadIntroBackgrounds(), mnTitleShowTitleScreen(), scLemurianShipUpdateGlowSwellAndSpray() and scTitleLoadSprites().

Definition at line 117 of file definitions.h.

DISPLAY_HEIGHT

#define DISPLAY_HEIGHT 160

Referenced by btCameraSetRange(), btEffectBuildWindowEdgeTable(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunStarfieldFall(), btEffectRunStreakVolley(), btEffectRunTargetMotes(), btEffectRunTorch(), btEffectRunUnusedOrbitingSpirals(), fdApplyEntrance(), fdEffectUpdateSparkles(), fdLineScrollBuildPage(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsSetUpBetting(), fdMapGridUpdateLayerScroll(), fdMotesUpdate(), fdPsynergyUpdateMindReadWave(), fdRenderApplyProjectedPlacement(), fdRenderPlaceProjectedSprite(), fdScreenTransitionFinish(), fdScreenTransitionStart(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdate(), fdScreenTransitionUpdateFromCenter(), fdScreenTransitionUpdateScanline(), fdScreenTransitionUpdateScanlineTable(), fdWeatherUpdateRain(), fdWorldMapApplyAffinePage(), fdWorldMapBuildScanlineTable(), fdWorldMapInitPerspective(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadDefaultMetatilesAndUpdateBlock(), fdWorldMapUpdateAffineLines(), fdWorldMapUpdateView(), mnIconMenuDrawIcons(), mnScanlineWindowFillSpans(), mnTitleLoadIntroBackgrounds(), mnTitleShowTitleScreen(), mnTitleUpdateIntroSprites(), scLemurianShipUpdateGlowSwellAndSpray(), scSolSanctumStatueUpdateScrollingSprites(), scTitleLoadSprites(), syPerspective() and sySynch().

Definition at line 118 of file definitions.h.

DISPLAY_TILE_WIDTH

#define DISPLAY_TILE_WIDTH (DISPLAY_WIDTH / 8)

The screen's size in 8-pixel tiles.

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMessageShowAtActor(), fdWorldMapLoadGraphics(), mnAreaNameWindowShow(), mnBattleCommandRowRun(), mnBattleTargetRunSelection(), mnDjinnMenuRun(), mnFieldMessageShow(), mnFieldMessageShowCentered(), mnIconMenuCenter(), mnItemMenuRun(), mnPartyMemberChooserOpen(), mnPartyStatusBuildLayoutBounds(), mnScanlineWindowBuildEdges(), mnStatusScreenRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), mnWindowDrawBorder(), mnWindowEraseBorderRect(), mnWindowFillTilemapRect(), mnWindowFitOnScreen(), mnWindowHighlightRect(), mnWindowMapTextCanvasTiles(), mnWindowMarkVisibleTextTiles(), mnWindowSetHighlightRect(), mnWindowSetInteriorPalette(), mnWindowSetInteriorPaletteBit(), mnWindowSetRectPalette() and scFileScreenLoadBackground().

Definition at line 120 of file definitions.h.

DISPLAY_TILE_HEIGHT

#define DISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / 8)

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMessageShowAtActor(), fdScreenTransitionFillTilemapAndColorTile(), fdWorldMapLoadGraphics(), mnDjinnMenuRun(), mnFieldMessageShow(), mnItemMenuRun(), mnPartyMemberChooserOpen(), mnPauseMenuOpen(), mnScanlineWindowBuildEdges(), mnStatusScreenRun(), mnTextDrawMessageAsTiles(), mnTextDrawPrefixedNumberAtOffset(), mnTextDrawStringAtOffset(), mnTextDrawWideStringAsTiles(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), mnWindowEraseBorderRect(), mnWindowFillTilemapRect(), mnWindowFitOnScreen(), mnWindowHighlightRect(), mnWindowMarkVisibleTextTiles(), mnWindowPutGlyph(), mnWindowSetHighlightRect(), mnWindowSetInteriorPalette(), mnWindowSetInteriorPaletteBit(), mnWindowSetRectPalette() and scFileScreenLoadBackground().

Definition at line 121 of file definitions.h.

REG_WIN0H

#define REG_WIN0H (*(volatile Uint16 *)0x04000040)

The two windows' edges, each a WIN_RANGE value in pixels.

window 0, left and right

Referenced by btEffectApplyWindowBlendRegisters(), btEffectArmWin0HBlankDMA(), btEffectBuildWindowEdgeTable(), btEffectRunBoreas(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunRamses(), btElementGlowPlay(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionStartWindowHBlankDMA() and mnTitleLoadIntroBackgrounds().

Definition at line 124 of file definitions.h.

REG_WIN1H

#define REG_WIN1H (*(volatile Uint16 *)0x04000042)

window 1, left and right

Referenced by btEffectApplyWindowBlendRegisters(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionStartWindowHBlankDMA() and mnTitleLoadIntroBackgrounds().

Definition at line 125 of file definitions.h.

REG_WIN0V

#define REG_WIN0V (*(volatile Uint16 *)0x04000044)

window 0, top and bottom

Referenced by btEffectApplyWindowBlendRegisters(), btElementGlowPlay(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionStartWindowHBlankDMA() and mnTitleLoadIntroBackgrounds().

Definition at line 126 of file definitions.h.

REG_WIN1V

#define REG_WIN1V (*(volatile Uint16 *)0x04000046)

window 1, top and bottom

Referenced by btEffectApplyWindowBlendRegisters(), btEffectRunRamses(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionStartWindowHBlankDMA() and mnTitleLoadIntroBackgrounds().

Definition at line 127 of file definitions.h.

WIN_RANGE

#define WIN_RANGE(start, end) (((start) << 8) | (end))

A REG_WINxH or REG_WINxV value: the window covers start up to, but not including, end.

Referenced by btEffectBuildWindowEdgeTable(), btEffectRunBoreas(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunRamses(), btElementGlowPlay(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionStartWindowHBlankDMA() and mnTitleLoadIntroBackgrounds().

Definition at line 131 of file definitions.h.

REG_WININ

#define REG_WININ (*(volatile Uint16 *)0x04000048)

What windows 0 and 1 show.

Referenced by btEffectApplyWindowBlendRegisters(), btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunBoreas(), btEffectRunDouse(), btEffectRunIce(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunRamses(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btElementGlowPlay(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionStartWindowHBlankDMA() and mnTitleLoadIntroBackgrounds().

Definition at line 133 of file definitions.h.

REG_WINOUT

#define REG_WINOUT (*(volatile Uint16 *)0x0400004a)

What the rest shows.

Referenced by btEffectApplyWindowBlendRegisters(), btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btElementGlowPlay(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btPlaybackRun(), btStagingRunAttack(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun() and fdScreenTransitionStartWindowHBlankDMA().

Definition at line 135 of file definitions.h.

WININ_WIN0_BG0

#define WININ_WIN0_BG0 0x0001

REG_WININ: the layers shown inside window 0 (low byte) and window 1 (high byte). CLR lets the colour effect of REG_BLDCNT apply there.

window 0: BG0

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun() and fdScreenTransitionUpdateScanlineTable().

Definition at line 139 of file definitions.h.

WININ_WIN0_BG1

#define WININ_WIN0_BG1 0x0002

window 0: BG1

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun() and mnTitleLoadIntroBackgrounds().

Definition at line 140 of file definitions.h.

WININ_WIN0_BG2

#define WININ_WIN0_BG2 0x0004

window 0: BG2

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun() and mnTitleLoadIntroBackgrounds().

Definition at line 141 of file definitions.h.

WININ_WIN0_BG3

#define WININ_WIN0_BG3 0x0008

window 0: BG3

Definition at line 142 of file definitions.h.

WININ_WIN0_OBJ

#define WININ_WIN0_OBJ 0x0010

window 0: sprites

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun() and mnTitleLoadIntroBackgrounds().

Definition at line 143 of file definitions.h.

WININ_WIN0_CLR

#define WININ_WIN0_CLR 0x0020

window 0: the colour effect

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 144 of file definitions.h.

WININ_WIN0_ALL

#define WININ_WIN0_ALL 0x003f

window 0: everything

Referenced by btElementGlowPlay(), fdScreenTransitionFinish(), fdScreenTransitionStart() and fdScreenTransitionStartHeldWindow().

Definition at line 145 of file definitions.h.

WININ_WIN1_BG0

#define WININ_WIN1_BG0 0x0100

window 1: BG0

Referenced by btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunBoreas(), btEffectRunDouse(), btEffectRunIce(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunRamses(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 146 of file definitions.h.

WININ_WIN1_BG1

#define WININ_WIN1_BG1 0x0200

window 1: BG1

Referenced by btEffectRunDouse(), btEffectRunIce(), btEffectRunKirin(), btEffectRunRamses(), fdLuckyDiceRun(), fdLuckyWheelsRun() and mnTitleLoadIntroBackgrounds().

Definition at line 147 of file definitions.h.

WININ_WIN1_BG2

#define WININ_WIN1_BG2 0x0400

window 1: BG2

Referenced by btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunKirin(), btEffectRunRamses(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), fdLuckyDiceRun(), fdLuckyWheelsRun() and mnTitleLoadIntroBackgrounds().

Definition at line 148 of file definitions.h.

WININ_WIN1_BG3

#define WININ_WIN1_BG3 0x0800

window 1: BG3

Definition at line 149 of file definitions.h.

WININ_WIN1_OBJ

#define WININ_WIN1_OBJ 0x1000

window 1: sprites

Referenced by btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunDouse(), btEffectRunIce(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), fdLuckyDiceRun(), fdLuckyWheelsRun() and mnTitleLoadIntroBackgrounds().

Definition at line 150 of file definitions.h.

WININ_WIN1_CLR

#define WININ_WIN1_CLR 0x2000

window 1: the colour effect

Referenced by btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunBoreas(), btEffectRunDouse(), btEffectRunIce(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunRamses(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 151 of file definitions.h.

WININ_WIN1_ALL

#define WININ_WIN1_ALL 0x3f00

window 1: everything

Referenced by fdScreenTransitionStartHeldWindow().

Definition at line 152 of file definitions.h.

WINOUT_WIN01_BG0

#define WINOUT_WIN01_BG0 0x0001

REG_WINOUT: the layers shown outside both windows (low byte) and inside the sprite window (high byte).

outside: BG0

Referenced by btElementGlowPlay(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdScreenTransitionFinish(), fdScreenTransitionStart(), fdScreenTransitionStartHeldWindow(), fdScreenTransitionUpdateScanlineTable(), scBabiPalaceWakeAfterFinals() and ScreenTransitionShapes.

Definition at line 156 of file definitions.h.

WINOUT_WIN01_BG1

#define WINOUT_WIN01_BG1 0x0002

outside: BG1

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 157 of file definitions.h.

WINOUT_WIN01_BG2

#define WINOUT_WIN01_BG2 0x0004

outside: BG2

Referenced by btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btPlaybackRun() and fdLuckyWheelsRun().

Definition at line 158 of file definitions.h.

WINOUT_WIN01_BG3

#define WINOUT_WIN01_BG3 0x0008

outside: BG3

Definition at line 159 of file definitions.h.

WINOUT_WIN01_OBJ

#define WINOUT_WIN01_OBJ 0x0010

outside: sprites

Referenced by btElementGlowPlay(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt() and btPlaybackRun().

Definition at line 160 of file definitions.h.

WINOUT_WIN01_CLR

#define WINOUT_WIN01_CLR 0x0020

outside: the colour effect

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun() and scBabiPalaceWakeAfterFinals().

Definition at line 161 of file definitions.h.

WINOUT_WIN01_ALL

#define WINOUT_WIN01_ALL 0x003f

outside: everything

Referenced by scBabiPalaceWakeAfterFinals().

Definition at line 162 of file definitions.h.

WINOUT_WINOBJ_BG0

#define WINOUT_WINOBJ_BG0 0x0100

sprite window: BG0

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 163 of file definitions.h.

WINOUT_WINOBJ_BG1

#define WINOUT_WINOBJ_BG1 0x0200

sprite window: BG1

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 164 of file definitions.h.

WINOUT_WINOBJ_BG2

#define WINOUT_WINOBJ_BG2 0x0400

sprite window: BG2

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 165 of file definitions.h.

WINOUT_WINOBJ_BG3

#define WINOUT_WINOBJ_BG3 0x0800

sprite window: BG3

Definition at line 166 of file definitions.h.

WINOUT_WINOBJ_OBJ

#define WINOUT_WINOBJ_OBJ 0x1000

sprite window: sprites

Definition at line 167 of file definitions.h.

WINOUT_WINOBJ_CLR

#define WINOUT_WINOBJ_CLR 0x2000

sprite window: the colour effect

Referenced by fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 168 of file definitions.h.

WINOUT_WINOBJ_ALL

#define WINOUT_WINOBJ_ALL 0x3f00

sprite window: everything

Definition at line 169 of file definitions.h.

REG_MOSAIC

#define REG_MOSAIC (*(volatile Uint16 *)0x0400004c)

Mosaic block sizes.

Referenced by btTransitionRunMosaicFadeOut(), fdMapGridLoadMap() and fdWorldMapInitPerspective().

Definition at line 172 of file definitions.h.

REG_BLDCNT

#define REG_BLDCNT (*(volatile Uint16 *)0x04000050)

Colour effect, targets.

Referenced by btAutoBattleRunPsynergy(), btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btBackgroundSetBlendControl(), btBackgroundStepHighlightBlend(), btEffectApplyWindowBlendRegisters(), btEffectConfigureEffectDisplay(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunBladeRain(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCurse(), btEffectRunCybele(), btEffectRunDouse(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunIce(), btEffectRunImpactBurst(), btEffectRunProjectileVolley(), btEffectRunQuake(), btEffectRunShatteringOpening(), btEffectRunSleep(), btEffectRunSpire(), btEffectRunStarfieldFall(), btEffectRunThorn(), btEffectRunVine(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btElementGlowPlay(), btHighlightSetModes(), btMotionLeapToward(), btRun(), btStagingRunFullScreen(), btTransitionRun(), btTransitionRunMosaicFadeOut(), fdBlendScriptRun(), fdEffectStartGroundMask(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsSetUpBetting(), fdLuckyWheelsUpdate(), fdMapGridLoadMap(), fdMapScreenUpdateMarkers(), fdMotesStart(), fdSpriteViewerRun(), fdWeatherStartRain() and 23 more.

Definition at line 174 of file definitions.h.

BLDCNT_TGT1_BG0

#define BLDCNT_TGT1_BG0 0x0001

REG_BLDCNT: the first target layers, the colour effect, then the second target layers that a blend mixes the first ones with.

first target: BG0

Referenced by scFileScreenFadeInBlend() and scWorldMapUpdateTransitionBlend().

Definition at line 178 of file definitions.h.

BLDCNT_TGT1_BG1

#define BLDCNT_TGT1_BG1 0x0002

first target: BG1

Referenced by btEffectRunCybele(), btEffectRunFlare(), btEffectRunGaia(), btEffectRunImpactBurst(), btEffectRunStarfieldFall(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btTransitionRunMosaicFadeOut(), fdEffectStartGroundMask(), fdSpriteViewerRun(), fdWorldMapInitPerspective(), scCottageRoomsBHurryToThePlaza(), scCrossboneIsleKeysInitStatues(), scInit(), scTitleRevealScreen(), scTolbiSpringDrainSpring() and scTretTreeBranchRevealFades().

Definition at line 179 of file definitions.h.

BLDCNT_TGT1_BG2

#define BLDCNT_TGT1_BG2 0x0004

first target: BG2

Referenced by btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btEffectOpenCanvasLayer(), btEffectRunBladeRain(), btEffectRunCybele(), btEffectRunDouse(), btEffectRunFlare(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunIce(), btEffectRunImpactBurst(), btEffectRunShatteringOpening(), btEffectRunThorn(), btEffectSetupBlendedDisplay(), btEffectStartCanvasLayer(), btElementGlowPlay(), btTransitionRunMosaicFadeOut(), fdEffectStartGroundMask(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsUpdate(), fdWorldMapInitPerspective(), mnCreditsRun(), mnTitleLoadIntroBackgrounds() and scTitleRevealScreen().

Definition at line 180 of file definitions.h.

BLDCNT_TGT1_BG3

#define BLDCNT_TGT1_BG3 0x0008

first target: BG3

Referenced by btTransitionRunMosaicFadeOut(), fdEffectStartGroundMask(), fdWorldMapInitPerspective(), scInit() and scTitleRevealScreen().

Definition at line 181 of file definitions.h.

BLDCNT_TGT1_OBJ

#define BLDCNT_TGT1_OBJ 0x0010

first target: sprites

Referenced by btBackgroundStepHighlightBlend(), fdEffectStartGroundMask(), fdLuckyWheelsUpdate(), fdWorldMapInitPerspective(), mnTitleShowTitleScreen(), mnTitleUpdateIntroSprites() and scFileScreenFadeInBlend().

Definition at line 182 of file definitions.h.

BLDCNT_TGT1_BD

#define BLDCNT_TGT1_BD 0x0020

first target: the backdrop

Referenced by btTransitionRunMosaicFadeOut().

Definition at line 183 of file definitions.h.

BLDCNT_TGT1_ALL

#define BLDCNT_TGT1_ALL 0x003f

first target: every layer

Referenced by btBackgroundSetBlendControl(), mnTitleLoadIntroBackgrounds() and scLemurianShipRaiseTheShip().

Definition at line 184 of file definitions.h.

BLDCNT_EFFECT_NONE

#define BLDCNT_EFFECT_NONE 0x0000

no effect, the targets as drawn

Definition at line 185 of file definitions.h.

BLDCNT_EFFECT_BLEND

#define BLDCNT_EFFECT_BLEND 0x0040

weighted by REG_BLDALPHA

Referenced by btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btEffectOpenCanvasLayer(), btEffectRunBladeRain(), btEffectRunCybele(), btEffectRunDouse(), btEffectRunFlare(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunIce(), btEffectRunImpactBurst(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThorn(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btElementGlowPlay(), fdBlendScriptRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsUpdate(), fdSpriteViewerRun(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowTitleScreen(), mnTitleUpdateIntroSprites(), scCottageRoomsBHurryToThePlaza(), scCrossboneIsleKeysInitStatues(), scFileScreenFadeInBlend(), scInit(), scTolbiSpringDrainSpring(), scTretTreeBranchRevealFades() and scWorldMapUpdateTransitionBlend().

Definition at line 186 of file definitions.h.

BLDCNT_EFFECT_LIGHTEN

#define BLDCNT_EFFECT_LIGHTEN 0x0080

towards white by REG_BLDY

Referenced by btBackgroundSetBlendControl(), btBackgroundStepHighlightBlend(), fdEffectStartGroundMask(), fdWorldMapInitPerspective(), mnTitleLoadIntroBackgrounds() and scLemurianShipRaiseTheShip().

Definition at line 187 of file definitions.h.

BLDCNT_EFFECT_DARKEN

#define BLDCNT_EFFECT_DARKEN 0x00c0

towards black by REG_BLDY

Referenced by btTransitionRunMosaicFadeOut(), fdLuckyWheelsUpdate() and scTitleRevealScreen().

Definition at line 188 of file definitions.h.

BLDCNT_TGT2_BG0

#define BLDCNT_TGT2_BG0 0x0100

second target: BG0

Referenced by mnTitleShowTitleScreen(), scColossoFadeInWarrior() and scTitleRevealScreen().

Definition at line 189 of file definitions.h.

BLDCNT_TGT2_BG1

#define BLDCNT_TGT2_BG1 0x0200

second target: BG1

Referenced by btTransitionRunMosaicFadeOut(), mnTitleShowTitleScreen(), scColossoFadeInWarrior(), scFileScreenFadeInBlend(), scInit() and scTitleRevealScreen().

Definition at line 190 of file definitions.h.

BLDCNT_TGT2_BG2

#define BLDCNT_TGT2_BG2 0x0400

second target: BG2

Referenced by btTransitionRunMosaicFadeOut(), mnTitleShowTitleScreen(), scColossoFadeInWarrior(), scFileScreenFadeInBlend(), scInit() and scTitleRevealScreen().

Definition at line 191 of file definitions.h.

BLDCNT_TGT2_BG3

#define BLDCNT_TGT2_BG3 0x0800

second target: BG3

Referenced by btTransitionRunMosaicFadeOut(), mnCreditsRun(), mnTitleShowTitleScreen(), scColossoFadeInWarrior(), scFileScreenFadeInBlend() and scTitleRevealScreen().

Definition at line 192 of file definitions.h.

BLDCNT_TGT2_OBJ

#define BLDCNT_TGT2_OBJ 0x1000

second target: sprites

Referenced by btTransitionRunMosaicFadeOut().

Definition at line 193 of file definitions.h.

BLDCNT_TGT2_BD

#define BLDCNT_TGT2_BD 0x2000

second target: the backdrop

Referenced by btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btTransitionRunMosaicFadeOut(), mnCreditsRun(), mnTitleShowTitleScreen(), scFileScreenFadeInBlend(), scInit() and scTitleRevealScreen().

Definition at line 194 of file definitions.h.

BLDCNT_TGT2_ALL

#define BLDCNT_TGT2_ALL 0x3f00

second target: every layer

Referenced by btBackgroundStepHighlightBlend(), btEffectOpenCanvasLayer(), btEffectRunBladeRain(), btEffectRunCybele(), btEffectRunDouse(), btEffectRunFlare(), btEffectRunGaia(), btEffectRunGrowingColumns(), btEffectRunIce(), btEffectRunImpactBurst(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThorn(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btElementGlowPlay(), fdEffectStartGroundMask(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsUpdate(), fdMapScreenUpdateMarkers(), fdMotesStart(), fdSpriteViewerRun(), fdWeatherStartRain(), fdWorldMapInitPerspective(), mnTitleLoadIntroBackgrounds(), mnTitleUpdateIntroSprites(), scColossoUpdateLettering(), scCottageRoomsBHurryToThePlaza(), scCrossboneIsleKeysInitStatues(), scInit(), scTolbiSpringDrainSpring(), scTretTreeBranchRevealFades() and scWorldMapUpdateTransitionBlend().

Definition at line 195 of file definitions.h.

REG_BLDALPHA

#define REG_BLDALPHA (*(volatile Uint16 *)0x04000052)

the blend's weights

Referenced by btAutoBattleRunPsynergy(), btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btBackgroundStepHighlightBlend(), btEffectApplyWindowBlendRegisters(), btEffectConfigureEffectDisplay(), btEffectOpenCanvasLayer(), btEffectRunBladeRain(), btEffectRunBoreas(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunDjinniEntrance(), btEffectRunDragonCloud(), btEffectRunDragonFire(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlurry(), btEffectRunFroth(), btEffectRunGaia(), btEffectRunGround(), btEffectRunGrowingColumns(), btEffectRunHail(), btEffectRunJudgment(), btEffectRunJupiter(), btEffectRunKirin(), btEffectRunLobbedShells(), btEffectRunNeptune(), btEffectRunNereid(), btEffectRunOrbitingSkulls(), btEffectRunPlasma(), btEffectRunPrism(), btEffectRunRagnarok(), btEffectRunShatteringOpening(), btEffectRunSparkGroups(), btEffectRunSpiderWeb(), btEffectRunStarfieldFall(), btEffectRunStreakVolley(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTitanBlade(), btEffectRunTorch(), btEffectRunVenus(), btEffectRunVolcano(), btEffectRunWhirlwind(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap() and 46 more.

Definition at line 198 of file definitions.h.

BLEND_WEIGHT_MAX

#define BLEND_WEIGHT_MAX 16

A blend weight's full strength: BLEND_ALPHA(BLEND_WEIGHT_MAX, 0) shows only the top layer.

Referenced by btAutoBattleRunPsynergy(), btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btBackgroundStepHighlightBlend(), btEffectRunAtalanta(), btEffectRunBoreas(), btEffectRunCastingImpact(), btEffectRunJudgment(), btEffectRunNeptune(), btEffectRunRamses(), btEffectRunThor(), btElementGlowPlay(), btHighlightSetModes(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btStagingRunFullScreen(), btTransitionRun(), fdMapScreenUpdateMarkers(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowTitleScreen(), scAltmillerCaveRestoreBabiAndInviteParty(), scColossoFadeInWarrior(), scColossoUpdateLettering(), scCottageRoomsBHurryToThePlaza(), scFileScreenFadeInBlend(), scSuhallaDesertRaiseStorm(), scSuhallaDesertSetUpFirstMapStorms(), scSuhallaDesertSetUpSecondMapStorms() and scTitleRevealScreen().

Definition at line 201 of file definitions.h.

BLEND_ALPHA

#define BLEND_ALPHA(top, bottom) ((top) | ((bottom) << 8))

A REG_BLDALPHA value: top and bottom are the two targets' weights, out of BLEND_WEIGHT_MAX.

Referenced by btAutoBattleRunPsynergy(), btBackgroundFadeAlphaIn(), btBackgroundFadeAlphaOut(), btBackgroundStepHighlightBlend(), btEffectRunCastingImpact(), btEffectRunFroth(), btElementGlowPlay(), btHighlightSetModes(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btStagingRunFullScreen(), btTransitionRun(), fdEffectStartGroundMask(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsUpdate(), fdMotesStart(), fdWeatherStartRain(), fdWorldMapInitPerspective(), mnTitleLoadIntroBackgrounds(), mnTitleShowTitleScreen(), mnTitleUpdateIntroSprites(), scAltmillerCaveApplyFadeBlend(), scAltmillerCaveRestoreBabiAndInviteParty(), scAltmillerCaveStartReveal(), scColossoFadeInWarrior(), scCottageRoomsBHurryToThePlaza(), scCrossboneIsleKeysCastRevealInStatueRoom(), scCrossboneIsleKeysInitStatues(), scCrossboneIsleKeysRevealEndsInStatueRoom(), scFileScreenFadeInBlend(), scInit(), scLemurianShipRaiseTheShip(), scSuhallaDesertRaiseStorm(), scTitleRevealScreen(), scTretTreeBranchRevealFades(), scWorldMapPlayLighthouseTransition(), scWorldMapUpdateTransitionBlend() and TolbiSpringAlphaSteps.

Definition at line 204 of file definitions.h.

REG_BLDY

#define REG_BLDY (*(volatile Uint16 *)0x04000054)

Fade level, 0 to 16.

Referenced by btBackgroundStepHighlightBlend(), btHighlightSetModes(), fdBlendScriptRun(), fdEffectStartGroundMask(), fdLuckyWheelsUpdate(), fdMotesStart(), fdWeatherStartRain(), fdWorldMapInitPerspective(), scLemurianShipRaiseTheShip(), scTitleRevealScreen() and syScreenFadeUpdate().

Definition at line 206 of file definitions.h.

BLEND_FADE_MAX

#define BLEND_FADE_MAX 16

REG_BLDY's whole fade: the targets drawn all white, or all black.

Referenced by scLemurianShipRaiseTheShip() and scTitleRevealScreen().

Definition at line 208 of file definitions.h.

BG_CANVAS_MAP

#define BG_CANVAS_MAP ((volatile Sint16 *)BG_SCREEN_BLOCK(7))

Screen block 7: BG2's affine map of a battle effect's canvas, a byte a tile (EFFECT_WRITE_CANVAS_MAP_ROW).

Referenced by btEffectRunShatteringOpening() and btEffectStartTiledCanvas().

Definition at line 212 of file definitions.h.

REG_BG0HOFS

#define REG_BG0HOFS ((void *)0x04000010)

BG0HOFS as an address for a DMA: copies of BgScrollWork over all four backgrounds' scroll registers start here, and Mind Read's HBlank DMA writes one halfword a line into it.

Referenced by fdMindReadStartRipple(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), scFileScreenLoadBackground(), scTitleLoadBackground() and syVBlankHandler().

Definition at line 216 of file definitions.h.

REG_DMA0

#define REG_DMA0 ((volatile Uint16 *)0x040000b0)

DMA channel 0's registers as halfwords, for the line scrolls that set the whole channel up.

Referenced by btEffectArmBg2AffineHBlankDMA(), btEffectArmPaletteHBlankDMA(), btEffectArmWin0HBlankDMA(), btEffectBuildWindowEdgeTable(), fdLineScrollArmDMA(), fdLineScrollStop(), fdLuckyWheelsUpdate(), fdMindReadStartRipple(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdateDissolve(), fdScreenTransitionUpdateScanlineTable(), fdWorldMapApplyAffinePage() and scLemurianShipStopRipple().

Definition at line 220 of file definitions.h.

DMA_CNT_H_INDEX

#define DMA_CNT_H_INDEX 5

A DMA channel's control, DMAxCNT_H, as a halfword after its source, destination and count (GBATEK "GBA DMA Transfers").

Referenced by fdLineScrollArmDMA(), fdLineScrollStop(), fdLuckyWheelsUpdate(), fdMindReadStartRipple(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdateDissolve(), fdScreenTransitionUpdateScanlineTable(), fdWorldMapApplyAffinePage() and scLemurianShipStopRipple().

Definition at line 223 of file definitions.h.

REG_DMA3

#define REG_DMA3 ((volatile Uint32 *)0x040000d4)

DMA channel 3's registers as words: the channel syDMAXCopy copies with.

Referenced by btAutoBattleBuildActions(), btBackgroundLoad(), btBackgroundSetMode(), btBackgroundSetPaletteLevel(), btBackgroundShowZoomedPage(), btDMAStopDMA3(), btEffectRunTorch(), btElementGlowInitStarField(), btShiftVRAMTiles(), btTransitionRun(), btTransitionUploadTileVariant(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdActorRestore(), fdActorSnapshot(), fdBlendScriptStart(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsStepSparkColors(), fdLuckyWheelsTransferCanvas(), fdLuckyWheelsUpdate(), fdMapScreenShow(), fdPaletteCycleAdd(), fdPaletteCycleStep(), fdPaletteFadeBuild(), fdPaletteFadeInit(), fdPsynergyFadeToCastColor(), fdScreenTransitionFillTilemapAndColorTile(), fdSpriteComposePicture(), fdTilesetAnimationUpdate(), fdWeatherUpdateLightning(), fdWorldMapEndStillImage(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics(), fdWorldMapPresentStillImage(), fdWorldMapStartStillImage(), fdWorldMapWriteLayerMetatileTile(), mnBattleCommandRowLoadIconTiles(), mnColossoMenuChoose(), mnCreditsUpdateTextSprites(), mnGlyphDraw(), mnIconLoadWithPalette(), mnItemMenuSelectGiveQuantity(), mnNameEntryEditMemberName(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDrawBars(), mnSettingsMenuOpen() and 57 more.

Definition at line 226 of file definitions.h.

PLTT

#define PLTT 0x05000000

Palette RAM: the background colours, then the sprites'.

Referenced by fdMapGridLoadMap().

Definition at line 229 of file definitions.h.

BG_PLTT_SIZE

#define BG_PLTT_SIZE 512

Bytes of background colours, 256 of them.

Referenced by fdLuckyWheelsRun(), mnTitleLoadIntroBackgrounds(), mnTitlePaletteFadeBuildColors(), mnTitlePaletteFadeInit(), mnTitlePaletteFadeUpdate() and mnTitleShowTitleScreen().

Definition at line 231 of file definitions.h.

BG_PLTT_COLORS

#define BG_PLTT_COLORS (BG_PLTT_SIZE / 2)

The background's 256 colours.

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun(), mnTitlePaletteFadeBuildColors(), mnTitlePaletteFadeInit() and mnTitlePaletteFadeUpdate().

Definition at line 233 of file definitions.h.

PLTT_COLORS

#define PLTT_COLORS (2 * BG_PLTT_COLORS)

Colours in palette RAM: the background's, then the sprites'.

Referenced by mnTitlePaletteFadeBuildColors() and mnTitlePaletteFadeUpdate().

Definition at line 235 of file definitions.h.

PLTT_BACKDROP

#define PLTT_BACKDROP (*(volatile Uint16 *)PLTT)

Background colour 0, the backdrop shown where no layer draws.

Referenced by btEffectRunBoreas(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunRamses(), btEffectRunStarfieldFall(), btEffectRunThor(), fdEngineRun(), fdScreenTransitionStart(), fdSpriteViewerRun(), fdStartEncounterTransition(), scLemurianShipRaiseTheShip(), scLemurianShipSetSail(), scLemurianShipWalkBackToShack(), scSolSanctumLunaSolRoomsArriveAfterWiseOnesRescue(), scSolSanctumLunaSolRoomsClearBackdropColor(), scVenusLighthouseAerieEruptBeacon(), scWorldMapShowIslandDrifting(), sySynch() and syWindowLoadGraphics().

Definition at line 238 of file definitions.h.

BG_PLTT

#define BG_PLTT ((volatile Uint16 *)PLTT)

16 palettes of 16 colours.

Referenced by btEffectArmPaletteHBlankDMA(), btEffectConvertBackgroundToBlueRamp(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBind(), btEffectRunBreak(), btEffectRunBurstShower(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunDjinniEntrance(), btEffectRunDragonFire(), btEffectRunDrain(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunEruption(), btEffectRunFlurry(), btEffectRunFroth(), btEffectRunGaia(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunJudgment(), btEffectRunLobbedShells(), btEffectRunMars(), btEffectRunMirroredWall(), btEffectRunMoteFountain(), btEffectRunNereid(), btEffectRunOrbitingSkulls(), btEffectRunPlanetDiver(), btEffectRunPlasma(), btEffectRunProcne(), btEffectRunProjectileVolley(), btEffectRunRamses(), btEffectRunRushingStrike(), btEffectRunShatteringOpening(), btEffectRunShiningStar(), btEffectRunSparkGroups(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunStatReduction(), btEffectRunStreakVolley(), btEffectRunSwirlSwipe(), btEffectRunTargetBursts(), btEffectRunTargetMotes(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunTorch() and 38 more.

Definition at line 240 of file definitions.h.

PALETTE_COLORS

#define PALETTE_COLORS 16

Colours in one 16-colour palette.

Referenced by btEffectConvertBackgroundToBlueRamp(), btPaletteCopyWithBrightnessOffset(), btPaletteUpdatePulseBrightness(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdLuckyWheelsDarkenStep(), fdPaletteCycleAdd(), fdPaletteCycleStep(), fdPaletteEditorRun(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics(), mnCreditsClearBuffer(), mnCreditsLoadBackground(), mnDjinnMenuAdjustPalettes(), mnGraphicsExpandVRAMTilesByColorTable(), mnIconLoadWithPalette(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnPaletteLoadIconsIntoHighlight(), mnSettingsMenuOpen(), mnTextDrawStringAsTiles(), mnTextSetColor(), scTretPaletteUpdateMapTint() and scWorldMapPlayLighthouseTransition().

Definition at line 242 of file definitions.h.

BG_PLTT_COLOR

#define BG_PLTT_COLOR(palette, color)

Colour color of 16-colour background palette palette.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btEffectConvertBackgroundToBlueRamp(), btEffectDarkenBackgroundStep(), btEffectRunBoreas(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunThor(), btPaletteUpdatePulseBrightness(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsRun(), fdPsynergyGreyMindReadPalette(), fdPsynergyRestoreMindReadPalette(), fdStartEncounterTransition(), mnColossoMenuChoose(), mnCreditsClearBuffer(), mnCreditsLoadBackground(), mnDjinnMenuRun(), mnFileListUpdateGlow(), mnNameEntryEditMemberName(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDrawBars(), mnStatusScreenLoadIconPalettes(), scAltinPeakStepPaletteAnimation(), scLemurianShipCycleGlow(), scMercuryLighthouseClearPalette(), scMercuryLighthouseCycleEntrancePalette(), scMercuryLighthouseCyclePalette(), scMercuryLighthouseCycleWaterfallPalette(), scMercuryLighthouseFadePaletteToBlack(), scMercuryLighthouseFadePaletteToWhite(), scTretPaletteUpdateMapTint(), scWorldMapPlayLighthouseTransition() and syWindowLoadGraphics().

Definition at line 244 of file definitions.h.

OBJ_PLTT

#define OBJ_PLTT ((volatile Uint16 *)(PLTT + BG_PLTT_SIZE))

The sprites' 256 colours.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdLuckyDiceRun(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsRun(), fdPaletteFadeInit(), fdPaletteFadeUpdate(), mnBattleCommandRowLoadIconTiles(), mnPaletteLoadIconsIntoHighlight(), mnStatusScreenLoadIconPalettes(), mnTitleLoadIntroBackgrounds(), mnTitlePaletteFadeInit(), mnTitlePaletteFadeUpdate(), scKolimaPaletteCapture(), scTitleLoadSprites(), syPaletteLoadBasicSpriteColors() and syWindowLoadGraphics().

Definition at line 247 of file definitions.h.

OBJ_PLTT_COLOR

#define OBJ_PLTT_COLOR(palette, color)

Colour color of 16-colour sprite palette palette.

Referenced by fdLuckyWheelsRun(), mnIconLoadWithPalette(), mnSettingsMenuOpen(), scColossoDrawGauge(), scColossoLoadLettering() and scHeatGaugeDraw().

Definition at line 249 of file definitions.h.

RGB

#define RGB(r, g, b) (((b) << BLUE_SHIFT) | ((g) << GREEN_SHIFT) | (r))

A 15-bit colour from its red, green and blue levels (0 to 31 each), as the palette stores it: blue in the high bits.

Referenced by btBackgroundSetMode(), btEffectConvertBackgroundToBlueRamp(), btEffectRunBurstShower(), btEffectRunCybele(), btEffectRunEruption(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunTorch(), btEffectStepPaletteToResource(), btEffectUpdatePhasePalette(), btGraphicsScaleRGB555Clamped(), btPaletteBrightenBgEntries(), btPaletteCopyWithBrightnessOffset(), btPaletteUpdatePulseBrightness(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMarsJoinEffect(), fdDjinnRunMercuryJoinEffect(), fdDjinnRunVenusJoinEffect(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsRun(), fdLuckyWheelsStepSparkColors(), fdPaletteEditorRun(), fdPaletteScaleRGB555(), fdPartyAddHp(), fdPartyApplyPoisonDamage(), fdPsynergyEndReveal(), fdPsynergyRestoreMindReadPalette(), fdPsynergyStartMindReadWave(), fdPsynergyUpdateMindReadWave(), fdSpriteViewerRun(), fdStartEncounterTransition(), FieldPsynergyCastColors, LemurianShipGlowColors, mnColossoMenuChoose(), mnDjinnMenuAdjustPalettes(), mnFileListUpdateGlow(), mnNameEntryEditMemberName(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnSanctumRunMemberIconBurst(), mnTitleShowTitleScreen(), scAltmillerCaveReleaseWallBurst(), scColosseumEntranceExplainPartySupport(), scFuchinFallsCaveEndRevealLighting(), scFuchinFallsCaveLightDragonWithEye(), scFuchinTempleAnimateRevealLesson(), scHeatGaugeDraw(), scImilFuchinFallsPrepareRoom() and 37 more.

Definition at line 254 of file definitions.h.

GREEN_SHIFT

#define GREEN_SHIFT 5

Where a 15-bit colour keeps its green and blue levels, red being in the low bits.

Referenced by fdPaletteFadeUpdate(), mnTitlePaletteFadeBuildColors(), mnTitlePaletteFadeUpdate(), scKolimaPaletteCurseColor() and scVaultCaveRunRumble().

Definition at line 257 of file definitions.h.

BLUE_SHIFT

#define BLUE_SHIFT 10

Referenced by fdPaletteFadeClampShiftedChannel(), fdPaletteFadeUpdate(), mnPaletteLightenHighlight(), mnTitlePaletteFadeBuildColors(), mnTitlePaletteFadeUpdate(), scKolimaPaletteCurseColor(), scSanctumLeaveAfterRefusing() and scVaultCaveRunRumble().

Definition at line 258 of file definitions.h.

RGB_RED

#define RGB_RED(color) ((color) & 0x1f)

A 15-bit colour's red, green and blue levels, 0 to 31 each.

Referenced by btBackgroundSetMode(), btEffectConvertBackgroundToBlueRamp(), btEffectRunCybele(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btEffectStepPaletteToResource(), btPaletteBrightenBgEntries(), btPaletteCopyWithBrightnessOffset(), btPaletteUpdatePulseBrightness(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsStepSparkColors(), fdPaletteEditorRun(), fdPaletteFadeBuild(), mnDjinnMenuAdjustPalettes(), mnPaletteLightenHighlight(), mnTitlePaletteFadeBuildColors(), scHeatGaugeDraw(), scKolimaPaletteCurseColor(), scMercuryLighthouseCyclePalette(), scMercuryLighthouseFadePaletteToBlack(), scMercuryLighthouseFadePaletteToWhite() and scTretPaletteUpdateMapTint().

Definition at line 260 of file definitions.h.

RGB_GREEN

#define RGB_GREEN(color) (((color) >> GREEN_SHIFT) & 0x1f)

Referenced by btBackgroundSetMode(), btEffectConvertBackgroundToBlueRamp(), btEffectRunCybele(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btEffectStepPaletteToResource(), btPaletteBrightenBgEntries(), btPaletteCopyWithBrightnessOffset(), btPaletteUpdatePulseBrightness(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsStepSparkColors(), fdPaletteEditorRun(), fdPaletteFadeBuild(), mnDjinnMenuAdjustPalettes(), mnPaletteLightenHighlight(), mnTitlePaletteFadeBuildColors(), scHeatGaugeDraw(), scKolimaPaletteCurseColor(), scMercuryLighthouseFadePaletteToBlack(), scMercuryLighthouseFadePaletteToWhite() and scTretPaletteUpdateMapTint().

Definition at line 261 of file definitions.h.

RGB_BLUE

#define RGB_BLUE(color) (((color) >> BLUE_SHIFT) & 0x1f)

Referenced by btBackgroundSetMode(), btEffectConvertBackgroundToBlueRamp(), btEffectRunCybele(), btEffectRunGaia(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btEffectStepPaletteToResource(), btPaletteBrightenBgEntries(), btPaletteCopyWithBrightnessOffset(), btPaletteUpdatePulseBrightness(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsStepSparkColors(), fdPaletteEditorRun(), fdPaletteFadeBuild(), mnDjinnMenuAdjustPalettes(), mnTitlePaletteFadeBuildColors(), scHeatGaugeDraw(), scKolimaPaletteCurseColor(), scMercuryLighthouseFadePaletteToBlack(), scMercuryLighthouseFadePaletteToWhite() and scTretPaletteUpdateMapTint().

Definition at line 262 of file definitions.h.

RGB_LEVEL_MAX

#define RGB_LEVEL_MAX 31

A colour channel's brightest level.

Referenced by btEffectConvertBackgroundToBlueRamp(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectUpdatePhasePalette(), btGraphicsScaleRGB555Clamped(), btPaletteBrightenBgEntries(), btPaletteCopyWithBrightnessOffset(), btPaletteUpdatePulseBrightness(), fdEffectCalculateHueChannels(), fdMindReadAdvanceTint(), fdPaletteEditorRun(), fdPaletteFadeClampChannel(), fdPaletteFadeClampShiftedChannel(), fdStartEncounterTransition(), mnColorScaleComponents(), mnDjinnMenuAdjustPalettes(), mnPaletteLightenHighlight(), mnTitlePaletteFadeClampChannel(), mnWindowColorApply(), mnWindowColorCalculateTint(), mnWindowColorScaleTint(), scHeatGaugeDraw(), scKolimaPaletteCurseColor(), scLemurianShipRaiseTheShip(), scMercuryLighthouseCyclePalette(), scMercuryLighthouseFadePaletteToWhite() and scSanctumLeaveAfterRefusing().

Definition at line 264 of file definitions.h.

RGB_WHITE

#define RGB_WHITE RGB(RGB_LEVEL_MAX, RGB_LEVEL_MAX, RGB_LEVEL_MAX)

The brightest colour, every channel at its highest level.

Referenced by btEffectRunJudgment(), btEffectRunShatteringOpening(), fdPaletteEditorRun(), fdPsynergyRestoreMindReadPalette(), fdStartEncounterTransition(), scKolimaForestEntranceWitnessForestCurse(), scKolimaForestTreeRestoreTret(), scKolimaWitnessForestCurse(), scMercuryLighthouseAeriePartyArrives(), scMercuryLighthousePlyOpensWaterfallPassage(), scSolSanctumEruptionPlayHostageScript(), scSolSanctumEruptionPlayWiseOneRescue(), scSolSanctumLunaSolRoomsArriveAfterWiseOnesRescue(), scValePrologueShowBoulderSweepingDownriver(), scVenusLighthouseAerieCombineSaturosAndMenardi(), scVenusLighthouseAerieEruptBeacon(), scVenusLighthouseAerieFlashScreen(), scVenusLighthouseAerieRestorePartyOnBrokenAerie(), scVenusLighthouseAerieUpdateBeaconRise(), scVenusLighthouseSearchStatue(), scWorldMapShowIslandDrifting() and sySynch().

Definition at line 266 of file definitions.h.

RED_BITS

#define RED_BITS RGB(RGB_LEVEL_MAX, 0, 0)

A 15-bit colour's red, green and blue bits.

Referenced by fdPaletteFadeUpdate(), mnTitlePaletteFadeBuildColors() and mnTitlePaletteFadeUpdate().

Definition at line 268 of file definitions.h.

GREEN_BITS

#define GREEN_BITS RGB(0, RGB_LEVEL_MAX, 0)

Referenced by fdPaletteFadeUpdate(), mnTitlePaletteFadeBuildColors() and mnTitlePaletteFadeUpdate().

Definition at line 269 of file definitions.h.

BLUE_BITS

#define BLUE_BITS RGB(0, 0, RGB_LEVEL_MAX)

Referenced by fdPaletteFadeUpdate(), mnTitlePaletteFadeBuildColors(), mnTitlePaletteFadeClampShiftedChannel() and mnTitlePaletteFadeUpdate().

Definition at line 270 of file definitions.h.

IWRAM_START

#define IWRAM_START 0x03000000

The start of the 32 KB of IWRAM, the CPU's fast internal work memory.

Referenced by syInit().

Definition at line 273 of file definitions.h.

EWRAM_START

#define EWRAM_START 0x02000000

The start of the 256 KB of EWRAM, the slower external work memory.

Definition at line 275 of file definitions.h.

EWRAM_END

#define EWRAM_END 0x02040000

The end of EWRAM: the limit the EWRAM heap's allocators test.

Referenced by syHeapAllocate(), syHeapAllocateEWRAM(), syHeapGetRemainingEWRAM(), syHeapSlotAllocate() and syHeapSlotAllocateEWRAM().

Definition at line 277 of file definitions.h.

VRAM

#define VRAM 0x06000000

Video RAM: background tiles and maps, then sprite tiles.

Definition at line 279 of file definitions.h.

BG_CHAR_SIZE

#define BG_CHAR_SIZE 16384

Bytes in a character block, 16 KB.

Referenced by btEffectRunQuake(), btElementGlowEnd(), btElementGlowPlay(), btElementGlowUploadStarField(), fdMapGridLoadMap(), mnDjinnMenuDrawStatPreview(), mnDjinnMenuRunPreview() and mnTitleShowCamelotLogo().

Definition at line 281 of file definitions.h.

BG_SCREEN_SIZE

#define BG_SCREEN_SIZE 2048

Bytes in a screen block, 2 KB.

Referenced by btBackgroundLoad(), fdLuckyWheelsRun() and mnTitleShowCamelotLogo().

Definition at line 283 of file definitions.h.

BG_SCREEN_WIDTH

#define BG_SCREEN_WIDTH 32

Tiles in a row of a screen block, whose map is 32 tiles square.

Referenced by btBackgroundLoad(), btEffectSetupCanvasTileMap(), btTransitionDrawRows(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridRenderMetatileTilesColumn(), fdMapGridRenderMetatileTilesRow(), fdMapGridSetCameraCenter(), fdPaletteEditorRun(), fdScreenTransitionFillTilemapAndColorTile(), mnBattleCommandRowRun(), mnBgScreenFillRect(), mnDjinnMenuRunPreview(), mnPartyStatusDrawBars(), mnScanlineWindowBuildEdges(), mnTextDrawMessageAsTiles(), mnTextDrawPrefixedNumberAtOffset(), mnTextDrawStringAtOffset(), mnTextDrawWideStringAsTiles(), mnTitleShowTitleScreen(), mnWindowClearInteriorTiles(), mnWindowClearTextTilesInRect(), mnWindowCopyTilemapRegion(), mnWindowDrawBorder(), mnWindowDrawColumnBorders(), mnWindowDrawDividerLine(), mnWindowEraseBorderRect(), mnWindowFillTilemapRect(), mnWindowHighlightRect(), mnWindowMapTextCanvasTiles(), mnWindowMarkVisibleTextTiles(), mnWindowPutGlyph(), mnWindowSetRectPalette(), mnWindowSetTilemapEntry(), scFileScreenFillTileGridByGridWidth(), scFileScreenFillTileGridByWindowWidth(), scMapGridDrawMetatilePanel() and sySerialTestRun().

Definition at line 285 of file definitions.h.

MAP_ROW_BYTES

#define MAP_ROW_BYTES (BG_SCREEN_WIDTH * 2)

The bytes of one row of a text background map, 32 entries.

Referenced by btEffectSetupCanvasTileMap(), btTransitionBuildFlatTilemap() and mnWindowSetInteriorPalette().

Definition at line 287 of file definitions.h.

MAP_ENTRY_PAIR

#define MAP_ENTRY_PAIR(left, right) ((right) << 16 | (left))

Two background map entries side by side, written a word at a time.

Referenced by btTransitionBuildFlatTilemap(), fdWorldMapLoadGraphics() and mnCreditsBuildBackgroundTilemap().

Definition at line 289 of file definitions.h.

BG_TILE_PALETTE

#define BG_TILE_PALETTE(n) ((n) << 12)

A screen block entry's 16-colour palette, in its top four bits (its flip bits are window.h's TILE_HFLIP and TILE_VFLIP).

Referenced by fdLuckyWheelsRun(), fdPaletteEditorRun(), fdScreenTransitionFillTilemapAndColorTile(), mnDjinnMenuRunPreview(), mnDjinnMenuShowMemberStatus(), mnTextDrawStringAsTiles(), mnWindowFillTilemapRect(), mnWindowHighlightRect(), mnWindowSetHighlightRect(), mnWindowSetInteriorPalette(), mnWindowSetInteriorPaletteBit(), mnWindowSetRectPalette(), mnWindowSetTilemapEntry(), syPrint() and sySerialTestRun().

Definition at line 292 of file definitions.h.

BG_TILE_PALETTE_OF

#define BG_TILE_PALETTE_OF(entry) (((entry) >> 12) & 0xf)

The palette a map entry draws its tile with, 0 to 15.

Referenced by mnWindowSetRectPalette().

Definition at line 294 of file definitions.h.

BG_CHAR_BLOCK

#define BG_CHAR_BLOCK(n) ((Uint8 *)VRAM + (n) * BG_CHAR_SIZE)

Background tile memory's 16 KB character block n, 0 to 3.

Referenced by btBackgroundLoad(), btCastingImpactEndPrelude(), btEffectConvertBackgroundToBlueRamp(), btEffectEndCanvasLayer(), btEffectEndElementStreaks(), btEffectOpenCanvasLayer(), btEffectRunCastingImpact(), btEffectRunCriticalHit(), btEffectRunDjinniEntrance(), btEffectRunImpactBurst(), btEffectRunQuake(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btEffectTransferCanvas(), btEffectTransferFullScreenImage(), btElementGlowEnd(), btElementGlowPlay(), btElementGlowUploadStarField(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridLoadMap(), fdMapScreenShow(), fdPaletteEditorRun(), fdScreenTransitionFillTilemapAndColorTile(), fdScreenTransitionUpdateDissolve(), fdTilesetAnimationUpdate(), fdWorldMapEndStillImage(), fdWorldMapLoadGraphics(), fdWorldMapPresentStillImage(), fdWorldMapStartStillImage(), mnBattleCollectPartyCommands(), mnBattleCommandRowLoadIconTiles(), mnBuildPatternTiles(), mnCreditsClearBuffer(), mnCreditsLoadBackground(), mnDjinnMenuRun(), mnGraphicsExpandVRAMTilesByColorTable(), mnItemMenuRun(), mnOpenBackdropScreen(), mnPageArrowsDraw(), mnRangeIconBuildTiles(), mnStatusScreenRun(), mnTextDrawStringAsTiles(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), mnVRAMCopyTile() and 6 more.

Definition at line 297 of file definitions.h.

BG_SCREEN_BLOCK

#define BG_SCREEN_BLOCK(n) ((Uint8 *)VRAM + (n) * BG_SCREEN_SIZE)

The 2 KB screen block n of VRAM, 0 to 31, that holds a map.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btTransitionDrawRows(), btTransitionRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridRenderMetatileTilesColumn(), fdMapGridRenderMetatileTilesRow(), fdMapGridSetCameraCenter(), fdScreenTransitionFillTilemapAndColorTile(), fdWorldMapDrawMetatileColumn(), fdWorldMapDrawMetatileRow(), fdWorldMapLoadGraphics(), fdWorldMapWriteLayerMetatileTile(), mnBattleCommandRowRun(), mnCreditsRun(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scMapGridDrawMetatilePanel() and sySerialTestRun().

Definition at line 299 of file definitions.h.

TILE_SIZE_4BPP

#define TILE_SIZE_4BPP 32

Bytes in an 8x8 tile of 16 colours.

Referenced by btTransitionRun(), btTransitionUploadTileVariant(), fdEffectSpawnScaledArcActors(), fdGroundMaskDrawMarks(), fdLuckyWheelsRun(), fdMapScreenInit(), fdPaletteEditorRun(), fdScreenTransitionFillTilemapAndColorTile(), fdScreenTransitionUpdateDissolve(), fdSpriteComposePicture(), fdTilesetAnimationUpdate(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuRun(), mnBattleDjinnMenuShowChangePreview(), mnBuildPatternTiles(), mnDjinnMenuDrawStatPreview(), mnDjinnMenuRunPreview(), mnGlyphDraw(), mnGraphicsExpandVRAMTilesByColorTable(), mnIconBuildAbilityIconTiles(), mnIconBuildCommandIconTiles(), mnIconBuildItemIconTiles(), mnIconBuildMiscellaneousIconTiles(), mnIconLoadWithPalette(), mnItemIconLoadLayersIntoSlot(), mnNameEntryEditMemberName(), mnNameEntryLoadCaretTiles(), mnNameEntryLoadPointingHandTiles(), mnOpenBackdropScreen(), mnPageArrowsDraw(), mnRangeIconBuildTiles(), mnShopCreatePriceSprite(), mnShopDrawPriceDigit(), mnShopSelectQuantity(), mnTextDrawStringAsTiles(), mnTitleLoadIntroBackgrounds(), mnVRAMCopyTile(), mnWindowOverlayTilePattern(), mnWindowSystemInitBattle(), scColosseumSatrageMatchStartRaceGauge(), scColossoDrawGauge(), scColossoStartRaceGauge(), scColossoUpdateLettering(), scInit(), scSpawnGoldenRing(), scSpawnPsynergyRings(), scWorldMapPlayLighthouseTransition(), sySerialTestRun() and syVRAMCacheLoad().

Definition at line 301 of file definitions.h.

TILE_ROW_SIZE_4BPP

#define TILE_ROW_SIZE_4BPP (TILE_SIZE_4BPP / 8)

The bytes of one pixel row of a 16-colour tile.

Referenced by mnQuantityBarFill(), mnShopDrawPriceDigit() and mnWindowSystemInitBattle().

Definition at line 303 of file definitions.h.

TILE_SIZE_8BPP

#define TILE_SIZE_8BPP 64

Bytes in an 8x8 tile of 256 colours.

Referenced by btEffectSetupCanvasTileMap(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapScreenShow(), fdSpriteDissolveStep(), fdWorldMapPresentStillImage(), mnBattleCommandRowLoadIconTiles(), mnTitleShowCamelotLogo() and mnTitleShowTitleScreen().

Definition at line 305 of file definitions.h.

SCREEN_TILE_BYTES

#define SCREEN_TILE_BYTES

The tiles of a picture that fills the screen in 256 colours.

Referenced by mnTitleShowPublisherLogo(), mnTitleShowTitleScreen() and scFileScreenLoadBackground().

Definition at line 307 of file definitions.h.

PIXELS_4BPP

#define PIXELS_4BPP(color) ((color) * 0x11111111u)

A word of eight 4-bit pixels, all colour color: one row of a 16-colour tile.

Referenced by btTransitionRun(), fdEffectStartGroundMask(), mnCreditsInitTextSprites(), mnItemMenuRun(), mnOpenBackdropScreen(), mnPartyStatusDrawBars(), mnPsynergyMenuRun(), mnStatusScreenRun(), scHeatGaugeDraw() and scLemurianShipStartCurtains().

Definition at line 311 of file definitions.h.

PIXELS_8BPP

#define PIXELS_8BPP(color) ((color) * 0x01010101u)

A word of four 8-bit pixels, all colour color.

Referenced by mnCreditsClearBuffer(), mnCreditsLoadBackground() and mnTextDrawStringAsTiles().

Definition at line 313 of file definitions.h.

OBJ_VRAM0

#define OBJ_VRAM0 (VRAM + 0x10000)

Sprite tile memory: the 32 KB of sprite tiles after the four character blocks.

Referenced by btPlaybackRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdSpriteComposePicture(), fdSpriteDissolveStep(), mnCreditsInitTextSprites(), mnGlyphDraw(), mnTitleLoadIntroBackgrounds() and syVRAMCacheLoad().

Definition at line 316 of file definitions.h.

REG_TM3CNT

#define REG_TM3CNT (*(volatile Uint32 *)0x0400010c)

Timer 3's reload value and control as one word; it paces the serial transfers.

Referenced by sySerialDisableTransfer() and sySerialStartClocking().

Definition at line 320 of file definitions.h.

REG_TM3CNT_H

#define REG_TM3CNT_H (*(volatile Uint16 *)0x0400010e)

Timer 3's control.

Referenced by sySerialHandleTransferInterrupt() and sySerialPrepareSendPacket().

Definition at line 322 of file definitions.h.

TIMER_INTR_ENABLE

#define TIMER_INTR_ENABLE 0x0040

TMxCNT_H flags.

Referenced by sySerialHandleTransferInterrupt() and sySerialPrepareSendPacket().

Definition at line 325 of file definitions.h.

TIMER_ENABLE

#define TIMER_ENABLE 0x0080

Starts the timer counting.

Referenced by sySerialHandleTransferInterrupt() and sySerialPrepareSendPacket().

Definition at line 327 of file definitions.h.

TIMER_256CLK

#define TIMER_256CLK 0x0002

Counts every 256 cycles, 65536 times a second.

Definition at line 329 of file definitions.h.

REG_SIODATA32

#define REG_SIODATA32 ((volatile Uint32 *)0x04000120)

The serial data: the 32-bit mode's word, or multiplayer's four received halfwords.

Referenced by sySerialHandleTransferInterrupt().

Definition at line 333 of file definitions.h.

REG_SIOCNT

#define REG_SIOCNT (*(volatile Uint32 *)0x04000128)

Serial control read as a word, with SIODATA8 above it.

Referenced by scBattleArenaPeerSlotMatches(), scInit(), sySerialExchangePayloads(), sySerialHandleTransferInterrupt(), sySerialInit(), sySerialPollAndTransfer(), sySerialPollStatus(), sySerialStepBlockTransfer() and sySerialWaitForStatusMask().

Definition at line 335 of file definitions.h.

REG_SIOCNT16

#define REG_SIOCNT16 (*(volatile Uint16 *)0x04000128)

Serial control alone.

Referenced by sySerialDisableTransfer(), sySerialHandleTransferInterrupt() and sySerialInit().

Definition at line 337 of file definitions.h.

REG_SIODATA8

#define REG_SIODATA8 (*(volatile Uint16 *)0x0400012a)

The 8-bit mode's data, which multiplayer mode sends from.

Definition at line 339 of file definitions.h.

REG_KEYINPUT

#define REG_KEYINPUT (*(volatile Uint16 *)0x04000130)

A 0 bit is a held key.

Referenced by syVBlankHandler().

Definition at line 341 of file definitions.h.

REG_KEYCNT

#define REG_KEYCNT (*(volatile Uint16 *)0x04000132)

Keys for the keypad IRQ.

Referenced by syInit(), syInputHandleKeyInterrupt(), syInstallIWRAMAndIRQs() and sySynch().

Definition at line 343 of file definitions.h.

REG_RCNT

#define REG_RCNT (*(volatile Uint16 *)0x04000134)

The serial port's mode.

Referenced by sySerialInit().

Definition at line 345 of file definitions.h.

SIO_115200_BPS

#define SIO_115200_BPS 0x0003

Multiplayer's fastest baud rate.

Referenced by sySerialDisableTransfer() and sySerialInit().

Definition at line 350 of file definitions.h.

SIO_MULTI_SI

#define SIO_MULTI_SI 0x0004

Multiplayer: this console's SI pin, clear on the parent.

Referenced by sySerialPollAndTransfer() and sySerialPollStatus().

Definition at line 352 of file definitions.h.

SIO_MULTI_SD

#define SIO_MULTI_SD 0x0008

Multiplayer: every console is ready.

Referenced by sySerialPollAndTransfer() and sySerialPollStatus().

Definition at line 354 of file definitions.h.

SIO_ID

#define SIO_ID 0x0030

Multiplayer: this console's id, 0 the parent.

Referenced by sySerialPollAndTransfer().

Definition at line 356 of file definitions.h.

SIO_ID_SHIFT

#define SIO_ID_SHIFT 4

SIO_ID's lowest bit.

Definition at line 358 of file definitions.h.

SIO_ID_OF

#define SIO_ID_OF(control) (((control) << 26) >> 30)

The multiplayer id (SIO_ID) in a SIOCNT value, taken out by shifts.

Referenced by scBattleArenaPeerSlotMatches(), scInit(), sySerialGetLinkStatus(), sySerialStepBlockTransfer() and sySerialWaitForStatusMask().

Definition at line 360 of file definitions.h.

SIO_ERROR

#define SIO_ERROR 0x0040

Multiplayer: the last transfer failed.

Definition at line 362 of file definitions.h.

SIO_ERROR_OF

#define SIO_ERROR_OF(control) (((control) << 25) >> 31)

The SIO_ERROR bit of a SIOCNT value, taken out by shifts as SIO_ID_OF takes the id.

Referenced by sySerialHandleTransferInterrupt().

Definition at line 365 of file definitions.h.

SIO_START

#define SIO_START 0x0080

Starts a transfer; set while one runs.

Referenced by sySerialHandleTransferInterrupt(), sySerialPollAndTransfer() and sySerialPollStatus().

Definition at line 367 of file definitions.h.

SIO_32BIT_MODE

#define SIO_32BIT_MODE 0x1000

Normal mode, 32 bits a transfer.

Referenced by sySerialInit().

Definition at line 369 of file definitions.h.

SIO_MULTI_MODE

#define SIO_MULTI_MODE 0x2000

Multiplayer mode.

Referenced by sySerialDisableTransfer() and sySerialInit().

Definition at line 371 of file definitions.h.

SIO_INTR_ENABLE

#define SIO_INTR_ENABLE 0x4000

An interrupt when a transfer ends.

Referenced by sySerialInit() and sySerialStartClocking().

Definition at line 373 of file definitions.h.

RCNT_SIO_MODE

#define RCNT_SIO_MODE 0x0000

RCNT's mode: 0 leaves the port to SIOCNT's serial modes; bit 15 alone makes it general-purpose pins.

Referenced by sySerialInit().

Definition at line 377 of file definitions.h.

RCNT_GPIO_MODE

#define RCNT_GPIO_MODE 0x8000

The port as general-purpose pins.

Referenced by sySerialInit().

Definition at line 379 of file definitions.h.

DMA_DEST_INC

#define DMA_DEST_INC 0x0000

DMAxCNT_H flags. A 32-bit control word takes them shifted above its count: (DMA_ENABLE | DMA_32BIT) << 16 | words.

destination steps up

Definition at line 383 of file definitions.h.

DMA_DEST_DEC

#define DMA_DEST_DEC 0x0020

destination steps down

Definition at line 384 of file definitions.h.

DMA_DEST_FIXED

#define DMA_DEST_FIXED 0x0040

destination stays, as for a register

Definition at line 385 of file definitions.h.

DMA_DEST_RELOAD

#define DMA_DEST_RELOAD 0x0060

steps up, back to its start each repeat

Referenced by fdWorldMapApplyAffinePage().

Definition at line 386 of file definitions.h.

DMA_SRC_INC

#define DMA_SRC_INC 0x0000

source steps up

Definition at line 387 of file definitions.h.

DMA_SRC_DEC

#define DMA_SRC_DEC 0x0080

source steps down

Definition at line 388 of file definitions.h.

DMA_SRC_FIXED

#define DMA_SRC_FIXED 0x0100

source stays, as for a fill

Definition at line 389 of file definitions.h.

DMA_REPEAT

#define DMA_REPEAT 0x0200

runs again at each start condition

Referenced by fdWorldMapApplyAffinePage().

Definition at line 390 of file definitions.h.

DMA_16BIT

#define DMA_16BIT 0x0000

moves halfwords

Definition at line 391 of file definitions.h.

DMA_32BIT

#define DMA_32BIT 0x0400

moves words

Referenced by fdWorldMapApplyAffinePage().

Definition at line 392 of file definitions.h.

DMA_DREQ_ON

#define DMA_DREQ_ON 0x0800

channel 3: the cartridge requests it

Definition at line 393 of file definitions.h.

DMA_START_NOW

#define DMA_START_NOW 0x0000

as soon as it's enabled

Definition at line 394 of file definitions.h.

DMA_START_VBLANK

#define DMA_START_VBLANK 0x1000

Definition at line 395 of file definitions.h.

DMA_START_HBLANK

#define DMA_START_HBLANK 0x2000

Referenced by fdWorldMapApplyAffinePage().

Definition at line 396 of file definitions.h.

DMA_START_SPECIAL

#define DMA_START_SPECIAL 0x3000

channels 1 and 2: a sound FIFO's request

Definition at line 397 of file definitions.h.

DMA_INTR_ENABLE

#define DMA_INTR_ENABLE 0x4000

an interrupt when it ends

Definition at line 398 of file definitions.h.

DMA_ENABLE

#define DMA_ENABLE 0x8000

arms the channel

Referenced by btDMAStop(), fdLineScrollArmDMA(), fdLineScrollStop(), fdLuckyWheelsUpdate(), fdMindReadStartRipple(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdateDissolve(), fdScreenTransitionUpdateScanlineTable(), fdWorldMapApplyAffinePage() and scLemurianShipStopRipple().

Definition at line 399 of file definitions.h.

DMA_BUSY

#define DMA_BUSY ((Uint32)DMA_ENABLE << 16)

DMA_ENABLE in a channel's 32-bit count and control word, which the hardware clears once the transfer is done.

Referenced by scTitleLoadSprites(), scWaitDMA(), syDMAWait() and sySynch().

Definition at line 403 of file definitions.h.

DMA_START_TIMING_DRQ_REPEAT

#define DMA_START_TIMING_DRQ_REPEAT

A DMA control's start timing (bits 12 and 13), cartridge request (bit 11) and repeat (bit 9): the bits cleared before a channel is stopped.

Referenced by btDMAStop(), fdLineScrollArmDMA(), fdLineScrollStop(), fdLuckyWheelsUpdate(), fdMindReadStartRipple(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdateDissolve(), fdScreenTransitionUpdateScanlineTable(), fdWorldMapApplyAffinePage() and scLemurianShipStopRipple().

Definition at line 406 of file definitions.h.

DMA_COPY_WORDS

#define DMA_COPY_WORDS(n) ((DMA_ENABLE | DMA_32BIT) << 16 | (n))

DMA control words: copy n words or halfwords at once, fill n words from one fixed source word, or one halfword or word each HBlank to a register reloaded every line (a scanline table that drives a window edge, a scroll or an affine register).

Referenced by btAutoBattleBuildActions(), btBackgroundLoad(), btBackgroundShowZoomedPage(), btDMAStopDMA3(), btElementGlowInitStarField(), btElementGlowPlay(), btTransitionRun(), btTransitionUploadTileVariant(), fdActorRestore(), fdActorSnapshot(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdLuckyWheelsStepSparkColors(), fdLuckyWheelsTransferCanvas(), fdLuckyWheelsUpdate(), fdMapScreenShow(), fdPaletteFadeBuild(), fdPaletteFadeInit(), fdPaletteFadeUpdate(), fdPsynergyFadeToCastColor(), fdScreenTransitionFillTilemapAndColorTile(), fdScreenTransitionUpdateDissolve(), fdSpriteComposePicture(), fdTilesetAnimationUpdate(), fdWeatherUpdateLightning(), fdWorldMapEndStillImage(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics(), fdWorldMapPresentStillImage(), fdWorldMapStartStillImage(), fdWorldMapWriteLayerMetatileTile(), mnBattleCommandRowLoadIconTiles(), mnColossoMenuChoose(), mnCreditsLoadBackground(), mnCreditsUpdateTextSprites(), mnGlyphDraw(), mnItemMenuSelectGiveQuantity(), mnNameEntryEditMemberName(), mnPaletteLightenHighlight(), mnShopCreatePriceSprite(), mnShopSaveAndTintFieldPalette(), mnShopSelectQuantity(), mnTextScrollCanvasUp(), mnTitleLoadIntroBackgrounds(), mnTitlePaletteFadeBuildColors(), mnTitlePaletteFadeInit(), mnTitlePaletteFadeUpdate(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen() and 39 more.

Definition at line 413 of file definitions.h.

DMA_FILL_HALFWORDS

#define DMA_FILL_HALFWORDS(n) ((DMA_ENABLE | DMA_SRC_FIXED) << 16 | (n))

Referenced by mnTitleShowTitleScreen().

Definition at line 414 of file definitions.h.

DMA_FILL_WORDS

#define DMA_FILL_WORDS(n) ((DMA_ENABLE | DMA_32BIT | DMA_SRC_FIXED) << 16 | (n))

Referenced by fdBlendScriptStart(), mnWindowSystemInitBattle() and mnWindowSystemInitField().

Definition at line 415 of file definitions.h.

DMA_COPY_HALFWORDS

#define DMA_COPY_HALFWORDS(n) (DMA_ENABLE << 16 | (n))

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btBackgroundSetPaletteLevel(), btEffectRunTorch(), btShiftVRAMTiles(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdLuckyWheelsStepSparkColors(), fdPaletteCycleAdd(), fdPaletteCycleStep(), fdPaletteFadeBuild(), mnIconLoadWithPalette(), mnOpenBackdropScreen(), mnPaletteLightenHighlight(), mnPaletteLoadIconsIntoHighlight(), mnPartyStatusDrawBars(), mnSettingsMenuOpen(), mnStatusScreenLoadIconPalettes(), mnTitleLoadIntroBackgrounds(), mnTitlePaletteFadeBuildColors(), mnTitleShowTitleScreen(), mnWindowSystemInitBattle(), scAltinPeakStepPaletteAnimation(), scColossoDrawGauge(), scHeatGaugeDraw(), scLemurianShipCycleGlow(), scWorldMapPlayLighthouseTransition(), syPaletteLoadBasicSpriteColors() and syWindowLoadGraphics().

Definition at line 416 of file definitions.h.

DMA_COPY_HALFWORDS_DOWN

#define DMA_COPY_HALFWORDS_DOWN(n)

n halfwords copied from the last back to the first, source and destination stepping down, so that a run can move up over itself.

Referenced by btEffectRunTorch().

Definition at line 419 of file definitions.h.

DMA_HBLANK_HALFWORD_PER_LINE

#define DMA_HBLANK_HALFWORD_PER_LINE

A halfword each HBlank, as for a scroll or a window edge.

Referenced by btBackgroundShowZoomedPage(), btEffectArmPaletteHBlankDMA(), btEffectArmWin0HBlankDMA(), btEffectBuildWindowEdgeTable(), fdLuckyWheelsUpdate() and fdMindReadStartRipple().

Definition at line 422 of file definitions.h.

DMA_HBLANK_WORDS_PER_LINE

#define DMA_HBLANK_WORDS_PER_LINE(n)

n words each HBlank, as for the affine registers of a background written together.

Referenced by fdLineScrollArmDMA().

Definition at line 426 of file definitions.h.

DMA_HBLANK_WORD_PER_LINE

#define DMA_HBLANK_WORD_PER_LINE DMA_HBLANK_WORDS_PER_LINE(1)

A word each HBlank, as for a pair of registers written together.

Referenced by btEffectArmBg2AffineHBlankDMA(), fdLineScrollArmDMA() and fdScreenTransitionStartWindowHBlankDMA().

Definition at line 432 of file definitions.h.

CPU_SET_SRC_FIXED

#define CPU_SET_SRC_FIXED 0x01000000

BIOS CpuSet control flags, above its count.

Definition at line 435 of file definitions.h.

CPU_SET_32BIT

#define CPU_SET_32BIT 0x04000000

Words rather than halfwords.

Definition at line 437 of file definitions.h.

OAM

#define OAM ((void *)0x07000000)

the sprites' attributes

Referenced by fdLuckyDiceRun(), fdLuckyWheelsUpdate(), mnCreditsUpdateTextSprites(), mnTitleUpdateIntroSprites() and syVBlankHandler().

Definition at line 449 of file definitions.h.

OAM_SIZE

#define OAM_SIZE 1024

OAM's size in bytes: 128 sprites of 8 bytes

Referenced by fdLuckyDiceRun(), fdLuckyWheelsUpdate(), mnCreditsUpdateTextSprites() and syVBlankHandler().

Definition at line 450 of file definitions.h.

OBJ_SIZE_8X8

#define OBJ_SIZE_8X8 0x00000000

A sprite's attributes 0 and 1 as one word, attr0 | attr1 << 16, the way functions that build their own sprite lists write them; x, 0 to 511, is shifted into the high half and y, 0 to 255, is the low byte.

Referenced by fdSpriteCreate().

Definition at line 463 of file definitions.h.

OBJ_SIZE_16X16

#define OBJ_SIZE_16X16 0x40000000

Referenced by btMessageWaitForAdvanceAt(), fdEffectInitSparkles(), fdGroundMaskDrawMarks(), fdLuckyDiceRun(), fdLuckyWheelsUpdate(), fdMapScreenInit(), fdMotesStart(), fdSpriteCreate(), fdWeatherStartRain(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuShowChangePreview(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnBattleTargetRunSelection(), mnTitleUpdateIntroSprites(), scColossoDrawGauge(), scColossoUpdatePointer() and scHeatGaugeDraw().

Definition at line 464 of file definitions.h.

OBJ_SIZE_32X32

#define OBJ_SIZE_32X32 0x80000000

Referenced by fdLuckyDiceRun(), fdLuckyWheelsUpdate(), fdSpriteCreate(), mnBattleCollectPartyCommands(), mnBattleCommandRowLoadIcon(), mnBattleStatusScreenRun(), mnDjinnShowJoinedMessage(), mnIconMenuDrawIcons(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnTitleUpdateIntroSprites() and scColossoUpdateLettering().

Definition at line 465 of file definitions.h.

OBJ_SIZE_64X64

#define OBJ_SIZE_64X64 0xc0000000

Referenced by fdSpriteCreate(), mnBattleStatusScreenRun() and mnTitleUpdateIntroSprites().

Definition at line 466 of file definitions.h.

OBJ_SIZE_16X8

#define OBJ_SIZE_16X8 0x00004000

Referenced by fdSpriteCreate().

Definition at line 467 of file definitions.h.

OBJ_SIZE_32X8

#define OBJ_SIZE_32X8 0x40004000

Referenced by mnCreditsInitTextSprites(), mnCreditsUpdateTextSprites(), mnTitleShowTitleScreen() and scSolSanctumStatueInitScrollingSprites().

Definition at line 468 of file definitions.h.

OBJ_SIZE_32X16

#define OBJ_SIZE_32X16 0x80004000

Referenced by fdLuckyWheelsUpdate(), fdSpriteCreate(), mnCreditsInitTextSprites(), scColossoUpdateLettering() and scLemurianShipCloseCurtains().

Definition at line 469 of file definitions.h.

OBJ_SIZE_64X32

#define OBJ_SIZE_64X32 0xc0004000

Referenced by fdLuckyDiceRun() and fdSpriteCreate().

Definition at line 470 of file definitions.h.

OBJ_SIZE_8X16

#define OBJ_SIZE_8X16 0x00008000

Referenced by btMessageWaitForAdvance(), btPlaybackRun(), fdSpriteCreate() and scColossoDrawGauge().

Definition at line 471 of file definitions.h.

OBJ_SIZE_16X32

#define OBJ_SIZE_16X32 0x80008000

Referenced by fdSpriteCreate() and scHeatGaugeDraw().

Definition at line 472 of file definitions.h.

OBJ_SIZE_32X64

#define OBJ_SIZE_32X64 0xc0008000

Referenced by fdSpriteCreate().

Definition at line 473 of file definitions.h.

OBJ_AFFINE

#define OBJ_AFFINE 0x00000100

Drawn through its affine matrix.

Referenced by fdLuckyDiceRun(), mnIconMenuDrawIcons() and scColossoUpdateLettering().

Definition at line 475 of file definitions.h.

OBJ_DOUBLE_SIZE

#define OBJ_DOUBLE_SIZE 0x00000200

An affine sprite drawn in a box twice its size, so turning never clips it.

Referenced by fdLuckyDiceRun(), mnIconMenuDrawIcons() and scColossoUpdateLettering().

Definition at line 477 of file definitions.h.

OBJ_MODE

#define OBJ_MODE(mode) ((mode) << 10)

An SPR_MODE.

Referenced by btMessageWaitForAdvance(), fdEffectInitSparkles(), fdGroundMaskDrawMarks(), fdLuckyWheelsUpdate(), fdMotesStart(), fdWeatherStartRain(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuShowChangePreview(), mnBattleStatusScreenRun(), mnTitleUpdateIntroSprites(), scColossoUpdateLettering() and scTitleUpdateSpriteReveal().

Definition at line 479 of file definitions.h.

OBJ_256_COLORS

#define OBJ_256_COLORS 0x00002000

8bpp tiles, as BGCNT_256_COLORS.

Referenced by btMessageWaitForAdvance(), btPlaybackRun(), fdLuckyDiceRun(), fdLuckyWheelsUpdate(), fdSpriteCreate(), mnBattleCollectPartyCommands(), mnBattleCommandRowLoadIcon(), mnBattleStatusScreenRun(), mnBattleTargetRunSelection(), mnIconMenuDrawIcons(), mnTitleUpdateIntroSprites() and scTitleUpdateSpriteReveal().

Definition at line 481 of file definitions.h.

OBJ_HFLIP

#define OBJ_HFLIP 0x10000000

A plain sprite mirrored left to right.

Referenced by fdLuckyDiceRun(), fdLuckyWheelsUpdate(), scColossoDrawGauge() and scColossoUpdatePointer().

Definition at line 483 of file definitions.h.

OBJ_VFLIP

#define OBJ_VFLIP 0x20000000

A plain sprite mirrored top to bottom.

Referenced by fdLuckyWheelsUpdate().

Definition at line 485 of file definitions.h.

OBJ_PRIORITY

#define OBJ_PRIORITY(n) ((n) << 10)

Attribute 2 above its tile number: the sprite's priority, 0 in front to 3 behind, and its 16-colour palette.

Referenced by fdActorShowEmoteById(), fdEffectInitSparkles(), fdEffectSetAttached(), fdGroundMaskDrawMarks(), fdLuckyDiceRun(), fdLuckyWheelsUpdate(), fdMapScreenInit(), fdMotesStart(), fdWeatherStartRain(), mnTitleUpdateIntroSprites(), scColossoDrawGauge(), scColossoUpdateLettering(), scColossoUpdatePointer(), scHeatGaugeDraw() and scSolSanctumStatueInitScrollingSprites().

Definition at line 488 of file definitions.h.

OBJ_PALETTE

#define OBJ_PALETTE(n) ((n) << 12)

Referenced by fdEffectInitSparkles(), fdLuckyWheelsUpdate(), fdMotesStart(), fdWeatherStartRain(), mnDjinnShowJoinedMessage(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), scColossoDrawGauge(), scColossoUpdateLettering(), scHeatGaugeDraw() and scSolSanctumStatueInitScrollingSprites().

Definition at line 489 of file definitions.h.

OBJ_X

#define OBJ_X(x) ((x) << 16)

A sprite's x in the attr01 word of an OAM_WORDS entry, whose attribute 1 is its high half.

Referenced by fdLuckyDiceRun(), fdLuckyWheelsUpdate(), mnCreditsInitTextSprites(), mnCreditsUpdateTextSprites(), mnDjinnShowJoinedMessage(), mnIconMenuDrawIcons(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnTitleUpdateIntroSprites(), mnWindowSpriteCreate(), scColossoDrawGauge(), scColossoUpdateLettering(), scColossoUpdatePointer(), scHeatGaugeDraw(), scLemurianShipCloseCurtains() and scTitleUpdateSpriteReveal().

Definition at line 492 of file definitions.h.

OBJ_MATRIX

#define OBJ_MATRIX(n) ((n) << 25)

An affine sprite's matrix number, attribute 1's bits 9 to 13, in the attr01 word.

Referenced by fdLuckyDiceRun(), mnIconMenuDrawIcons() and scColossoUpdateLettering().

Definition at line 495 of file definitions.h.

OBJ_AFFINE_PARAMETER

#define OBJ_AFFINE_PARAMETER(value) ((value) << 16)

An affine parameter in the high half of an OAM_WORDS entry's attr2 word: the entries 4n to 4n + 3 hold affine matrix n's four.

Referenced by fdLuckyDiceRun().

Definition at line 498 of file definitions.h.

OBJ_X_MASK

#define OBJ_X_MASK 0x1ff

Attribute 1's nine bits of x: a sprite left of the screen is at 512 less its distance.

Referenced by fdLuckyDiceRun(), fdLuckyWheelsUpdate(), mnWindowSpriteCreate(), scColossoUpdateLettering() and scHeatGaugeDraw().

Definition at line 501 of file definitions.h.

OBJ_POSITION

#define OBJ_POSITION(x, y) (OBJ_X((x) & OBJ_X_MASK) | ((y) & 0xff))

A sprite's place in its attr01 word: x in attribute 1's nine bits and y in attribute 0's eight, each wrapped as the screen wraps them.

Referenced by fdLuckyDiceRun().

Definition at line 504 of file definitions.h.

OBJ_TILE_MASK

#define OBJ_TILE_MASK 0x3ff

Attribute 2's ten bits of tile number, counted in 4-bit tiles from the start of sprite VRAM.

Referenced by fdEffectSpawnScaledArcActors(), scCottageRoomsBSpawnRingPair(), scSolSanctumEruptionRaiseGoldenRings(), scSpawnGoldenRing(), scSpawnPsynergyRings() and scValePlazaSpawnEffectPair().

Definition at line 507 of file definitions.h.

SPRITE_TILES

#define SPRITE_TILES(width, height) ((width) / 8 * ((height) / 8))

The tile numbers a sprite of width by height pixels takes, of 16 colours and of 256 (two numbers to a tile): a picture's sprites follow one another so in sprite VRAM.

Referenced by fdLuckyWheelsUpdate().

Definition at line 511 of file definitions.h.

SPRITE_TILES_8BPP

#define SPRITE_TILES_8BPP(width, height) (2 * SPRITE_TILES(width, height))

Referenced by fdLuckyDiceRun() and fdLuckyWheelsUpdate().

Definition at line 512 of file definitions.h.

OBJ_Y_RANGE

#define OBJ_Y_RANGE 256

Attribute 0 holds eight bits of a sprite's y, so its y wraps round at 256 lines.

Referenced by fdLuckyWheelsUpdate() and scLemurianShipCloseCurtains().

Definition at line 515 of file definitions.h.

KEYS_MASK

#define KEYS_MASK 0x3ff

the ten keys' bits; KEYINPUT reads 0 for a held key

Referenced by syVBlankHandler().

Definition at line 537 of file definitions.h.

DPAD_INDEX

#define DPAD_INDEX(keys) (((keys) >> 4) & 15)

The direction pad's four keys (KEY_RIGHT to KEY_DOWN) as a number 0 to 15, to index a table with a row for each combination held.

Referenced by fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorUpdatePlayerControl(), fdInputGetDpadAngle(), fdMapScreenUpdateMarkers(), scActorSteerByPad(), scLeaderSlideOnIce() and scMercuryLighthouseHopAcrossPool().

Definition at line 541 of file definitions.h.

REG_BG0CNT

#define REG_BG0CNT (*(volatile Uint16 *)0x04000008)

BG0's control (BGCNT_).

Referenced by btTransitionRun(), btTransitionRunMosaicFadeOut() and syPrintClear().

Definition at line 544 of file definitions.h.

REG_BG0VOFS

#define REG_BG0VOFS (*(volatile Uint16 *)0x04000012)

BG0's vertical scroll.

Referenced by btClearBg0Vofs(), btTransitionClearBg0Vofs() and mnGraphicsInstallBg1VCountHandler().

Definition at line 546 of file definitions.h.

REG_SOUNDCNT_H

#define REG_SOUNDCNT_H (*(volatile Uint16 *)0x04000082)

Direct sound's mixing: volumes, speakers, timers and FIFO resets.

Definition at line 548 of file definitions.h.

SOUND_CGB_MIX_FULL

#define SOUND_CGB_MIX_FULL 0x0002

Sounds 1 to 4 at full volume.

Definition at line 554 of file definitions.h.

SOUND_A_MIX_FULL

#define SOUND_A_MIX_FULL 0x0004

Direct sound A at full, not half.

Definition at line 556 of file definitions.h.

SOUND_B_MIX_FULL

#define SOUND_B_MIX_FULL 0x0008

Direct sound B at full, not half.

Definition at line 558 of file definitions.h.

SOUND_ALL_MIX_FULL

#define SOUND_ALL_MIX_FULL

Sounds 1 to 4 and both direct sound channels all at full volume.

Definition at line 560 of file definitions.h.

SOUND_A_RIGHT_OUTPUT

#define SOUND_A_RIGHT_OUTPUT 0x0100

A to the right speaker.

Definition at line 563 of file definitions.h.

SOUND_A_LEFT_OUTPUT

#define SOUND_A_LEFT_OUTPUT 0x0200

A to the left speaker.

Definition at line 565 of file definitions.h.

SOUND_A_TIMER_0

#define SOUND_A_TIMER_0 0x0000

A plays at timer 0's rate.

Definition at line 567 of file definitions.h.

SOUND_A_FIFO_RESET

#define SOUND_A_FIFO_RESET 0x0800

Empties A's FIFO.

Definition at line 569 of file definitions.h.

SOUND_B_RIGHT_OUTPUT

#define SOUND_B_RIGHT_OUTPUT 0x1000

B to the right speaker.

Definition at line 571 of file definitions.h.

SOUND_B_LEFT_OUTPUT

#define SOUND_B_LEFT_OUTPUT 0x2000

B to the left speaker.

Definition at line 573 of file definitions.h.

SOUND_B_TIMER_0

#define SOUND_B_TIMER_0 0x0000

B plays at timer 0's rate.

Definition at line 575 of file definitions.h.

SOUND_B_FIFO_RESET

#define SOUND_B_FIFO_RESET 0x8000

Empties B's FIFO.

Definition at line 577 of file definitions.h.

REG_SOUNDBIAS

#define REG_SOUNDBIAS (*(volatile Uint16 *)0x04000088)

Output bias, rate.

Definition at line 580 of file definitions.h.

REG_FIFO_A

#define REG_FIFO_A (*(volatile Uint32 *)0x040000a0)

A's samples, 4 a write.

Definition at line 582 of file definitions.h.

REG_FIFO_B

#define REG_FIFO_B (*(volatile Uint32 *)0x040000a4)

B's samples, 4 a write.

Definition at line 584 of file definitions.h.

REG_DMA0SAD

#define REG_DMA0SAD (*(volatile Uint32 *)0x040000b0)

The four DMA channels: source, destination, then the count with the control halfword (CNT_H, the DMA_ flags) above it.

channel 0: source

Referenced by btBackgroundShowZoomedPage().

Definition at line 588 of file definitions.h.

REG_DMA0DAD

#define REG_DMA0DAD (*(volatile Uint32 *)0x040000b4)

channel 0: destination

Definition at line 589 of file definitions.h.

REG_DMA0CNT

#define REG_DMA0CNT

Definition at line 590 of file definitions.h.

REG_DMA0CNT_H

#define REG_DMA0CNT_H (*(volatile Uint16 *)0x040000ba)

channel 0: control

Definition at line 593 of file definitions.h.

REG_DMA1SAD

#define REG_DMA1SAD (*(volatile Uint32 *)0x040000bc)

channel 1: source

Definition at line 594 of file definitions.h.

REG_DMA1DAD

#define REG_DMA1DAD (*(volatile Uint32 *)0x040000c0)

channel 1: destination

Definition at line 595 of file definitions.h.

REG_DMA1CNT

#define REG_DMA1CNT

Definition at line 596 of file definitions.h.

REG_DMA1CNT_H

#define REG_DMA1CNT_H (*(volatile Uint16 *)0x040000c6)

channel 1: control

Definition at line 599 of file definitions.h.

REG_DMA2SAD

#define REG_DMA2SAD (*(volatile Uint32 *)0x040000c8)

channel 2: source

Definition at line 600 of file definitions.h.

REG_DMA2DAD

#define REG_DMA2DAD (*(volatile Uint32 *)0x040000cc)

channel 2: destination

Definition at line 601 of file definitions.h.

REG_DMA2CNT

#define REG_DMA2CNT

Definition at line 602 of file definitions.h.

REG_DMA2CNT_H

#define REG_DMA2CNT_H (*(volatile Uint16 *)0x040000d2)

channel 2: control

Definition at line 605 of file definitions.h.

REG_DMA3SAD

#define REG_DMA3SAD (*(volatile Uint32 *)0x040000d4)

channel 3: source

Definition at line 606 of file definitions.h.

REG_DMA3DAD

#define REG_DMA3DAD (*(volatile Uint32 *)0x040000d8)

channel 3: destination

Definition at line 607 of file definitions.h.

REG_DMA3CNT

#define REG_DMA3CNT

Definition at line 608 of file definitions.h.

REG_DMA3CNT_H

#define REG_DMA3CNT_H (*(volatile Uint16 *)0x040000de)

channel 3: control

Definition at line 611 of file definitions.h.

REG_TM0CNT_L

#define REG_TM0CNT_L (*(volatile Uint16 *)0x04000100)

Timers 0 to 2: CNT_L is the reload value, and reads back the count; CNT_H takes the TIMER_ flags.

timer 0: reload

Definition at line 615 of file definitions.h.

REG_TM0CNT_H

#define REG_TM0CNT_H (*(volatile Uint16 *)0x04000102)

timer 0: control

Definition at line 616 of file definitions.h.

REG_TM1CNT_L

#define REG_TM1CNT_L (*(volatile Uint16 *)0x04000104)

timer 1: reload

Definition at line 617 of file definitions.h.

REG_TM1CNT_H

#define REG_TM1CNT_H (*(volatile Uint16 *)0x04000106)

timer 1: control

Definition at line 618 of file definitions.h.

REG_TM2CNT_L

#define REG_TM2CNT_L (*(volatile Uint16 *)0x04000108)

timer 2: reload

Definition at line 619 of file definitions.h.

REG_TM2CNT_H

#define REG_TM2CNT_H (*(volatile Uint16 *)0x0400010a)

timer 2: control

Definition at line 620 of file definitions.h.

REG_IE

#define REG_IE (*(volatile Uint16 *)0x04000200)

The interrupts enabled.

Referenced by syInstallIWRAMAndIRQs(), syIntFunction(), sySerialDisableTransfer(), sySerialInit() and sySerialStartClocking().

Definition at line 623 of file definitions.h.

REG_IF

#define REG_IF (*(volatile Uint16 *)0x04000202)

Pending; a 1 written clears.

Referenced by sySerialDisableTransfer(), sySerialInit() and sySerialStartClocking().

Definition at line 625 of file definitions.h.

REG_WAITCNT

#define REG_WAITCNT (*(volatile Uint16 *)0x04000204)

Cartridge wait states.

Referenced by syInit().

Definition at line 627 of file definitions.h.

WAITCNT_SRAM_SLOWEST

#define WAITCNT_SRAM_SLOWEST 0x0003

WAITCNT's slowest SRAM wait (bits 1 and 0), 8 cycles, pret's WAITCNT_SRAM_8: the wait the flash functions read the chip with; programming and erasing use the chip's wait[0], then restore it.

Definition at line 631 of file definitions.h.

WAITCNT_SRAM_MASK

#define WAITCNT_SRAM_MASK 0x0003

WAITCNT's SRAM wait bits.

Definition at line 633 of file definitions.h.

REG_IME

#define REG_IME (*(volatile Uint16 *)0x04000208)

All interrupts' master switch.

Referenced by btEffectRunJudgment(), btElementGlowPlay(), syInstallIWRAMAndIRQs(), syIRQLock(), syIRQUnlock(), sySerialCollectReceivedPayloads(), sySerialDisableTransfer(), sySerialInit(), sySerialStartClocking() and sySoftReset().

Definition at line 635 of file definitions.h.

KEYCNT_SOFT_RESET

#define KEYCNT_SOFT_RESET 0xc00f

KEYCNT values: the interrupt fires when all the listed keys are held at once.

A, B, Select and Start

Referenced by syInit() and sySynch().

Definition at line 638 of file definitions.h.

KEYCNT_DISARMED

#define KEYCNT_DISARMED

Referenced by syInputHandleKeyInterrupt() and syInstallIWRAMAndIRQs().

Definition at line 639 of file definitions.h.

KEYCNT_SHOULDERS_WAKE

#define KEYCNT_SHOULDERS_WAKE 0xc300

L and R, which wake the sleep

Referenced by sySynch().

Definition at line 642 of file definitions.h.

WAITCNT_GAME

#define WAITCNT_GAME 0x4014

ROM wait states 3 and 1 with the prefetch buffer on, SRAM at 4; written by the power-on set-up.

Referenced by syInit().

Definition at line 646 of file definitions.h.

EVENT_PASS_VBLANK

#define EVENT_PASS_VBLANK 0x480

An event's priority: the high byte picks the pass that runs it, the low byte ranks it within the pass (higher runs first). An odd high byte means the event is suspended, so no pass matches it.

The two passes: the VBlank handler runs EVENT_PASS_VBLANK's events, and sySynch() runs EVENT_PASS_TICK's once a tick. Each ranks 0x80, the middle of the low byte, so an event added at EVENT_PASS_TICK + 10 runs before those added at EVENT_PASS_TICK.

Referenced by btEffectRunAnnihilation(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunBoreas(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCurse(), btEffectRunDeathPlunge(), btEffectRunDouse(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFroth(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunIce(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunOrbitingSkulls(), btEffectRunProjectileVolley(), btEffectRunRamses(), btEffectRunShiningStar(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunTargetMotes(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTorch(), btEffectRunUnusedOrbitingSpirals(), btEffectStartElementStreaks(), btHighlightSetModes(), btTransitionRun(), fdLuckyWheelsRun(), fdPsynergyGreyMindReadPalette(), fdScreenTransitionFinish(), fdScreenTransitionStart(), fdScreenTransitionStartHeldWindow(), fdWorldMapInitPerspective(), mnBattleCommandRowRun(), mnCreditsInitTextSprites(), mnCreditsRun(), mnTitleShowTitleScreen(), mnWindowSystemInitBattle(), mnWindowSystemInitField(), scLineScrollInitWave() and syVBlankHandler().

Definition at line 680 of file definitions.h.

EVENT_PASS_TICK

#define EVENT_PASS_TICK 0xc80

Referenced by btEffectOpenCanvasLayer(), btEffectRunCriticalHit(), btEffectStartCanvasLayer(), btEffectStartElementStreaks(), btElementGlowInitStarField(), btPlaybackSchedulePhase(), btRun(), btStagingRunAttack(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunPsynergyCast(), btTransitionRun(), fdActorSystemInit(), fdBlendScriptStart(), fdEffectInitSlots(), fdEffectInitSparkles(), fdEffectStartGroundMask(), fdMapGridLoadMap(), fdMapScreenShow(), fdMotesStart(), fdPaletteCycleStart(), fdPaletteFadeInit(), fdPsynergyAvoid(), fdPsynergyLoadResources(), fdPsynergyResumeCloakCheck(), fdPsynergyReveal(), fdPsynergyStartCloak(), fdPsynergyStartMindReadWave(), fdPsynergySteerLiftedTarget(), fdScreenTransitionFinish(), fdScreenTransitionStart(), fdScreenTransitionStartDissolveHeld(), fdScreenTransitionStartHeldWindow(), fdScriptStart(), fdSpriteViewerRun(), fdTilesetAnimationStartAll(), fdWeatherStartLightning(), fdWeatherStartLightningFlash(), fdWeatherStartRain(), fdWorldMapInitPerspective(), fdWorldMapStartZoom(), mnAreaNameWindowShow(), mnBattleCollectPartyCommands(), mnCreatePartyFigures(), mnCreditsInitTextSprites(), mnDebugSceneSelectSchedule(), mnDjinnFiguresInitBottomRow(), mnDjinnFiguresInitTopRow(), mnDjinnMenuRunPreview(), mnDjinnMenuShowHelp() and 114 more.

Definition at line 681 of file definitions.h.

EVENT_PASS_VBLANK_FIRST

#define EVENT_PASS_VBLANK_FIRST (EVENT_PASS_VBLANK + 127)

The highest rank in the VBlank pass: an event added here runs first of the VBlank events, before the tick's first line is drawn.

Referenced by btBackgroundLoad() and btBackgroundSetMode().

Definition at line 684 of file definitions.h.

EVENT_PRIORITY_EMPTY

#define EVENT_PRIORITY_EMPTY -1

An empty slot's priority, sorted last: the sort reads priorities signed.

Referenced by syInitEvent().

Definition at line 686 of file definitions.h.

EVENT_PRIORITY_REMOVED

#define EVENT_PRIORITY_REMOVED 0x7fff

A removed event's priority: its odd high byte matches no pass, and as the highest priority it sorts to the front of the table.

Referenced by syCloseEvent().

Definition at line 689 of file definitions.h.

EVENT_STATE_HIGH

#define EVENT_STATE_HIGH(task) (((Uint8 *)&(task)->priority)[1])

An event's priority's high byte: the pass it runs in.

Referenced by syExecuteEvent(), syResumeEvent(), syResumeOverlayEvents(), sySuspendEvent() and sySuspendOverlayEvents().

Definition at line 692 of file definitions.h.

EVENT_SUSPENDED

#define EVENT_SUSPENDED 1

The bit of an event's high priority byte (EVENT_STATE_HIGH) that suspends it.

Referenced by syResumeEvent(), syResumeOverlayEvents(), sySuspendEvent() and sySuspendOverlayEvents().

Definition at line 694 of file definitions.h.

EVENT_FLAG_KEEP_RUNNING

#define EVENT_FLAG_KEEP_RUNNING 1

The bit of an event's flags that keeps it running while sySuspendOverlayEvents suspends the others.

Referenced by scBattleArenaEnterBattle(), scInit() and sySuspendOverlayEvents().

Definition at line 697 of file definitions.h.

EVENT_IN_OVERLAY

#define EVENT_IN_OVERLAY(task) (((task)->callback >> 24) == EWRAM_START >> 24)

Whether the event's function is in EWRAM, where a scene's overlay runs.

Referenced by syResumeOverlayEvents() and sySuspendOverlayEvents().

Definition at line 699 of file definitions.h.

INTR_FLAG_VBLANK

#define INTR_FLAG_VBLANK (1 << IRQ_VBLANK)

The interrupt sources' bits in REG_IE and REG_IF.

Referenced by syInstallIWRAMAndIRQs().

Definition at line 724 of file definitions.h.

INTR_FLAG_TIMER3

#define INTR_FLAG_TIMER3 (1 << IRQ_TIMER3)

Referenced by sySerialDisableTransfer(), sySerialInit() and sySerialStartClocking().

Definition at line 725 of file definitions.h.

INTR_FLAG_SERIAL

#define INTR_FLAG_SERIAL (1 << IRQ_SERIAL)

Referenced by sySerialDisableTransfer(), sySerialInit() and sySerialStartClocking().

Definition at line 726 of file definitions.h.

INTR_FLAG_KEYPAD

#define INTR_FLAG_KEYPAD (1 << IRQ_KEYPAD)

Referenced by syInstallIWRAMAndIRQs().

Definition at line 727 of file definitions.h.

INTR_FLAG_GAMEPAK

#define INTR_FLAG_GAMEPAK (1 << IRQ_GAMEPAK)

Referenced by syInstallIWRAMAndIRQs().

Definition at line 728 of file definitions.h.

HEAP_SLOT_BLOCK

#define HEAP_SLOT_BLOCK(n) (*(HeapSlots + (n)))

The heap group. The heap's slots and HEAP_STATE.

The heap is two stacks of blocks, one in IWRAM and one in EWRAM; "The heap" in the system library's README gives the allocators and the lifetime rule. Every scene change resets both pools and clears every slot (syHeapInit, from the main routine in game/main_routine.c), so no block outlives the scene, battle or minigame that took it. Slot n's block, or null before it is allocated.

Referenced by btBackgroundLoad(), btBackgroundShowZoomedPage(), btCameraApplyPhasedDelta(), btCameraSetRange(), btCameraShake(), btEffectAdvanceBg2OnInterval(), btEffectAdvanceScrollOnInterval(), btEffectApplyBg2Reference(), btEffectApplyWindowBlendRegisters(), btEffectArmBg2AffineHBlankDMA(), btEffectArmPaletteHBlankDMA(), btEffectClearTintTimers(), btEffectConvertBackgroundToBlueRamp(), btEffectCountDownBattlerTints(), btEffectCreateSprites(), btEffectDarkenBackgroundStep(), btEffectDrawClippedCanvasLine(), btEffectDrawStreaks(), btEffectEndCanvasLayer(), btEffectHideBg1AndRestoreBackdrop(), btEffectOpenCanvasLayer(), btEffectPlaceFormationSprites(), btEffectReadKeysForEnemyTarget(), btEffectRunAnnihilation(), btEffectRunAstralBlast(), btEffectRunAttackSlash(), btEffectRunBind(), btEffectRunBolt(), btEffectRunBoreas(), btEffectRunBreak(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCriticalHit(), btEffectRunCurse(), btEffectRunCybele(), btEffectRunDeathPlunge(), btEffectRunDjinnBeams(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunDouse(), btEffectRunDragonCloud(), btEffectRunDragonFire(), btEffectRunDrain(), btEffectRunEruption(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFromTable(), btEffectRunFrost() and 88 more.

Definition at line 741 of file definitions.h.

HEAP_SLOT_FROM

#define HEAP_SLOT_FROM(slots, from, slot) ((slots)[(slot) - (from)])

Heap slot slot read through slots, a pointer to slot from of HeapSlots: code that holds one slot's address reaches its neighbours by their distance from it.

Referenced by btCameraSetCommandView(), btCameraUpdate(), btEffectRunAtalanta(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunNeptune(), btEffectRunProcne(), btEffectRunTitanBlade(), btEffectRunUndeadSword(), btEffectSetupBlendedDisplay(), btElementGlowPlay() and btTransitionAdvanceOpening().

Definition at line 746 of file definitions.h.

GLOW_SHEET_ROOM

#define GLOW_SHEET_ROOM 1550

The room an effect gives its glow pictures: HEAP_SLOT_BATTLE_SHEET's size, and where an effect's own pictures start in a sheet whose glow pictures come first. The largest glow sheet, BlueGlowSheet's ten flares from 2x2 to 20x20, takes 1540 bytes of it.

Referenced by btEffectRunByIdRange(), btEffectRunElementBurst(), btEffectRunElementPillar(), fdLuckyDiceRun() and fdLuckyWheelsRun().

Definition at line 939 of file definitions.h.

MapGridState

#define MapGridState (*(void *(*)[]) & HeapSlots[HEAP_SLOT_MAP_GRID])

The heap slots from HEAP_SLOT_MAP_GRID on: MapGridState[0] is the map's state (MAP_GRID_SCROLL_STATE, or the world map's WORLD_MAP_VIEW).

Referenced by fdActorGetCueMetatileAheadOfCurrent(), fdActorGetScreenPos(), fdActorMoveOnWorldMap(), fdActorResetForLeader(), fdActorRestore(), fdActorSystemPlaceSprites(), fdActorUpdatePlayerControl(), fdApplyEntrance(), fdAssignViewFlags(), fdBlendScriptRun(), fdBlendScriptStart(), fdCameraFollowActor(), fdCameraFollowLeaderInBounds(), fdCameraMoveWithinMapBounds(), fdCameraWorldToScreen(), fdEffectInitSparkles(), fdEffectSpawnRevealMarkers(), fdEffectUpdateSparkles(), fdGetCollisionAheadOfLeader(), fdGroundMaskDrawMarks(), fdMapGridCenterOnFollowedPoint(), fdMapGridCheckCollision(), fdMapGridCopyMetatileIndexRect(), fdMapGridCopyMetatileRect(), fdMapGridCopyMetatileTilesRect(), fdMapGridGetMetatileBehaviorAt(), fdMapGridGetScreenRelativePos(), fdMapGridGetTerrainHeight(), fdMapGridGetTerrainKindAt(), fdMapGridIsWallAt(), fdMapGridSetCameraBounds(), fdMapGridSetCameraCenter(), fdMapGridSetMetatileBehaviorAt(), fdMapGridSetScreenShake(), fdMapGridSetShownLayers(), fdMapGridUpdateLayerScroll(), fdMapGridWaitForShakeToSettle(), fdMapScreenShow(), fdMotesStart(), fdMotesUpdate(), fdPlaceTreasureSpots(), fdPsynergyCheckCloakTile(), fdPsynergyEnd(), fdPsynergyLoadResources(), fdScreenTransitionHideBackgrounds(), fdScreenTransitionStart(), fdScreenTransitionUpdateScanline(), fdScreenTransitionUpdateScanlineTable(), fdScriptWaitForZoomTransition(), fdTilesetAnimationPause() and 73 more.

Definition at line 947 of file definitions.h.

#define MenuState (*(void **)&HeapSlots[HEAP_SLOT_MENU])

The menu state, heap slot HEAP_SLOT_MENU: each menu screen and the shop read it through their own struct while they are open.

Referenced by mnAbilityApplyToTargets(), mnCreatePartyFigures(), mnCursorPlace(), mnCursorPos(), mnCursorSlide(), mnCursorStep(), mnDjinnCheckGiveBalance(), mnDjinnCountOwned(), mnDjinnFiguresInitBottomRow(), mnDjinnFiguresInitTopRow(), mnDjinnFiguresReplaceSlot(), mnDjinnFiguresSetSlotPhase(), mnDjinnFiguresSetSlotPos(), mnDjinnFiguresUpdateAllPositions(), mnDjinnFiguresUpdateBottomRow(), mnDjinnMarkTradeOnlyRecipients(), mnDjinnMenuBuildLists(), mnDjinnMenuDrawElementList(), mnDjinnMenuDrawPairPreview(), mnDjinnMenuDrawStatPreview(), mnDjinnMenuPlacePartyFigures(), mnDjinnMenuRunPreview(), mnDjinnMenuRunScreen(), mnDjinnMenuSelectDjinn(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnEquipmentMenuStopCompatibilityIndicators(), mnEquipmentMenuUpdateCompatibilityIndicators(), mnFileListHideDjinnSprites(), mnFileListHidePartySprites(), mnFileListPlaceDjinnSprites(), mnFileListPlacePartySprites(), mnFileListShowDjinnSprites(), mnFileListShowPartySprites(), mnHideEmptyEntryIcons(), mnHideEntryIcons(), mnIconCreateDjinnArrow(), mnIconCreateStatChangeArrow(), mnIconMenuReleaseArrows(), mnInitState(), mnInnCheckIn(), mnInnRoomPrice(), mnItemMenuBuildCommands(), mnItemMenuBuildPagedList(), mnItemMenuChooseCommand(), mnItemMenuClose(), mnItemMenuConfirmEquip(), mnItemMenuDrawEquipment(), mnItemMenuDrawEquipPreview(), mnItemMenuDrawIcons() and 111 more.

Definition at line 950 of file definitions.h.

FieldBlendStateWork

#define FieldBlendStateWork (*(void *(*)[]) & HeapSlots[HEAP_SLOT_FIELD_BLEND])

The heap slots from HEAP_SLOT_FIELD_BLEND on: FieldBlendStateWork[0] is the field's colour blend state.

Referenced by fdWeatherUpdateLightning(), scCottageRoomsBDoraWakesIsaac(), scCottageRoomsBHurryToThePlaza() and scInit().

Definition at line 954 of file definitions.h.

ScreenTransitionStateWork

#define ScreenTransitionStateWork

The screen transition's state, heap slot HEAP_SLOT_SCREEN_TRANSITION.

Referenced by fdPsynergyEndReveal(), fdScreenTransitionFillTilemapAndColorTile(), fdScreenTransitionStartWindowHBlankDMA(), fdScreenTransitionUpdateScanlineTable(), mnIconMenuDrawIcons(), scAltmillerCaveInitDarkness(), scAltmillerCaveRestoreBabiAndInviteParty(), scBabiPalaceWakeAfterFinals(), scHeatGaugeDraw(), scInit() and scTretTreeBranchRevealFades().

Definition at line 956 of file definitions.h.

BattleEntryTimer

#define BattleEntryTimer (*(Sint32 **)&HeapSlots[HEAP_SLOT_BATTLE_ENTRY_TIMER])

HEAP_SLOT_BATTLE_ENTRY_TIMER: the battle's entry transition timer in ticks.

Referenced by btTransitionDrawRows() and btTransitionUploadTileVariant().

Definition at line 960 of file definitions.h.

FieldEffectStateWork

#define FieldEffectStateWork (*(void **)&HeapSlots[HEAP_SLOT_FIELD_EFFECT])

The running Psynergy effect's state (FIELD_EFFECT_STATE), heap slot HEAP_SLOT_FIELD_EFFECT.

Referenced by dbIncreaseItemAndLevelKeepPortraitBrowserInPlace(), dbMenuTestKeepIvyInPlace(), fdActorSpawn(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMarsJoinEffect(), fdDjinnRunMercuryJoinEffect(), fdDjinnRunVenusJoinEffect(), fdEffectReleaseSlots(), fdEffectRunSparkEmitter(), fdEffectSpawnBurstParticleField(), fdEffectSpawnDescendingArcParticles(), fdEffectSpawnFallingParticles(), fdEffectSpawnScaledArcActors(), fdEffectUpdateEffectSlots(), fdEffectUpdateHaltParticle(), fdEffectUpdateRadialBurst(), fdEffectUpdateShrinkingOrbitActor(), fdPsynergyAvoid(), fdPsynergyCatch(), fdPsynergyDispatch(), fdPsynergyDouse(), fdPsynergyEnd(), fdPsynergyEndReveal(), fdPsynergyFinishMindRead(), fdPsynergyForce(), fdPsynergyFrost(), fdPsynergyFrostOnTarget(), fdPsynergyGrowth(), fdPsynergyGrowthOnTarget(), fdPsynergyHalt(), fdPsynergyHaltOnTarget(), fdPsynergyLiftOnTarget(), fdPsynergyLoadResources(), fdPsynergyMove(), fdPsynergyPly(), fdPsynergyRetreat(), fdPsynergyRun(), fdPsynergyRunEnd(), fdPsynergySetupActorPair(), fdPsynergySteerLiftedTarget(), fdPsynergySteerPushedTarget(), fdPsynergyStopCasterUpdate(), fdPsynergyWhirlwind(), fdRetreatUpdateSpark(), scAltmillerCaveCheckPuddleCovered(), scAltmillerCaveEndReveal(), scAltmillerCaveFreezePuddle(), scAltmillerCaveReleaseWallBurst(), scAltmillerCaveStartRetreat(), scBabiLighthouseLandCarriedPillarInPuffs() and 13 more.

Definition at line 963 of file definitions.h.

DMA3

#define DMA3 ((volatile DMA_REGISTERS *)REG_DMA3)

DMA3, the channel the game copies with, as its three registers.

Referenced by gmMainRoutineStateInitDefaults(), scColossoLoadLettering(), scCrossboneIsleSteppingStonesMovePillar(), scCrossboneIsleSteppingStonesReadMapGridMetatile(), scCrossboneIsleSteppingStonesSortPillarActors() and sySynch().

Definition at line 1000 of file definitions.h.

TICKS_PER_SECOND

#define TICKS_PER_SECOND 60

The tick group. The tick loop's globals: the frames a tick takes, the CPU load display and the VBlank flags.

sySynch() (system/system_frame.c) and the VBlank handler share these metatiles; those marked volatile are changed by an interrupt or counted by sySynch() while other code reads them. Ticks in a second: the screen refreshes about 60 times a second.

Referenced by mnBattleMenuUpdate(), mnStringFormatPlayTime(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), scActorWaitUntilLanded(), scAltinPeakPlayHydrosRumble(), scColosseumNavampaMatchTalkToWallWedgeAttendant(), scColossoShowMatchResult(), scColossoShowOpeningLettering() and scVaultRevisitJumpActorToAndWait().

Definition at line 1051 of file definitions.h.

IO_WRITE_BYTE

#define IO_WRITE_BYTE (1 << 16)

Writes a byte.

Definition at line 1068 of file definitions.h.

IO_WRITE_HALFWORD

#define IO_WRITE_HALFWORD (2 << 16)

Writes a halfword.

Referenced by btBackgroundSetMode(), btEffectConfigureEffectDisplay(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btEffectStartCanvasLayer(), btTransitionRun(), fdMapScreenShow(), fdMapScreenUpdateMarkers(), fdScreenTransitionStart(), mnBattleCommandRowRun(), mnTitleShowTitleScreen(), scColossoFadeInWarrior(), scColossoUpdateLettering(), scFileScreenFadeInBlend(), scSuhallaDesertRaiseStorm(), scSuhallaDesertSetUpFirstMapStorms(), scSuhallaDesertSetUpSecondMapStorms() and scTitleRevealScreen().

Definition at line 1070 of file definitions.h.

IO_WRITE_WORD

#define IO_WRITE_WORD (3 << 16)

Writes a word.

Referenced by btEffectRunJudgment().

Definition at line 1072 of file definitions.h.

IO_WRITE_SET

#define IO_WRITE_SET (4 << 16)

ORs the value into the register instead of storing it.

Definition at line 1074 of file definitions.h.

IO_WRITE_CLEAR

#define IO_WRITE_CLEAR (8 << 16)

Clears the value's bits in the register instead of storing it.

Definition at line 1076 of file definitions.h.

syFixedDivEntry

#define syFixedDivEntry

The iwram_call group. The IWRAM call layer: the functions the game keeps resident in IWRAM, each at its fixed address, and one typed inline per function that every call goes through. The IWRAM-resident functions at their fixed addresses, each called through the inline below it.

Referenced by syDivFX().

Definition at line 1098 of file definitions.h.

syWordsClearEntry

#define syWordsClearEntry

Referenced by syWordsClear().

Definition at line 1101 of file definitions.h.

syWordsFillEntry

#define syWordsFillEntry

Referenced by syWordsFill().

Definition at line 1104 of file definitions.h.

sySquartEntry

#define sySquartEntry

Referenced by sySquartIWRAM().

Definition at line 1108 of file definitions.h.

syDecompressBitRuns

#define syDecompressBitRuns

Referenced by mnTextDrawGlyphPair().

Definition at line 1110 of file definitions.h.

syVectorTransformEntry

#define syVectorTransformEntry

Reads all three word-aligned coordinates before writing the result. Input may be an array or a record's coordinate prefix; output may overlap it.

Referenced by syCalcPoint().

Definition at line 1117 of file definitions.h.

syMultiMatrixEntry

#define syMultiMatrixEntry

Referenced by syMultiMatrix().

Definition at line 1121 of file definitions.h.

syIntegerDivideEntry

#define syIntegerDivideEntry

Referenced by syIntegerDivide().

Definition at line 1124 of file definitions.h.

syIntegerDivideUnsignedEntry

#define syIntegerDivideUnsignedEntry

Referenced by syIntegerDivideUnsigned().

Definition at line 1128 of file definitions.h.

syDecompressSpritePictureEntry

#define syDecompressSpritePictureEntry

Referenced by syDecompressSpritePicture().

Definition at line 1132 of file definitions.h.

syWordsCopyEntry

#define syWordsCopyEntry

Referenced by fdMapGridLoadMap() and syWordsCopy().

Definition at line 1136 of file definitions.h.

syWordsCopyOffset

#define syWordsCopyOffset FIXED_OFFSET(5000, syIWRAMWordsCopy, syIWRAMIRQMain)

Three IWRAM functions' distances in bytes from syIWRAMIRQMain, for code that calls them from the interrupt handler's address.

Definition at line 1143 of file definitions.h.

syDivFXOffset

#define syDivFXOffset FIXED_OFFSET(316, syIWRAMDivFX, syIWRAMIRQMain)

Definition at line 1144 of file definitions.h.

sySquartOffset

#define sySquartOffset FIXED_OFFSET(472, syIWRAMSquart, syIWRAMIRQMain)

Definition at line 1145 of file definitions.h.

syWordsCopyLinked

#define syWordsCopyLinked

syWordsCopy reached through the linked IWRAM code's symbol, syIWRAMIRQMain, at its offset rather than at its fixed address (syWordsCopyEntry): the same function at the same address.

Referenced by mnItemMenuRunCommands().

Definition at line 1149 of file definitions.h.

BATTLE_PROJECTION_CENTER_X

#define BATTLE_PROJECTION_CENTER_X (DISPLAY_WIDTH / 2)

Where the battle centres its projection on the screen: across the middle, and 120 pixels down, below the screen's middle.

Referenced by btCameraSetView(), btCameraSetViewAtDepth(), btCameraShake(), btCameraUpdate(), btEffectEndCanvasLayer() and btEffectRunProcne().

Definition at line 1205 of file definitions.h.

BATTLE_PROJECTION_CENTER_Y

#define BATTLE_PROJECTION_CENTER_Y 120

Referenced by btCameraSetCommandView(), btCameraSetView(), btCameraSetViewAtDepth(), btCameraShake(), btCameraUpdate(), btEffectEndCanvasLayer() and btEffectSetupBlendedDisplay().

Definition at line 1206 of file definitions.h.

RamMapGridMetatileBuffer

#define RamMapGridMetatileBuffer

The ram_buffer group. The buffers and IWRAM variables the code reaches at fixed addresses, and the state pointers of HeapSlots by name. The map and decode buffers, from here to RamBgTileBuffer, follow the overlay area at fixed addresses because code reaches across their boundaries by arithmetic: the map grid's metatiles fill 64 KB from RamMapGridMetatileBuffer, through the sprite slots and the decode buffer.

Referenced by btEffectDrawStreaks(), btEffectRunAnnihilation(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBreak(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectRunCybele(), btEffectRunDouse(), btEffectRunDragonCloud(), btEffectRunFlashingStrike(), btEffectRunFroth(), btEffectRunGaia(), btEffectRunIce(), btEffectRunMercury(), btEffectRunQuake(), btEffectRunRushingStrike(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunSwirlSwipe(), btEffectRunThor(), btEffectRunTorch(), btEffectTransferFullScreenImage(), fdActorMoveByKeys(), fdEngineRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridCheckCollision(), fdMapGridGetTerrainHeight(), fdMapGridLoadMap(), fdMapScreenUpdateMarkers(), fdSpriteViewerRun(), fdTileMapConvertBuffer(), fdTileMapDecodeStagedBuffer(), fdWorldMapCopyMetatileTiles(), fdWorldMapInitPerspective(), fdWorldMapWriteLayerMetatileTile(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scFileScreenLoadBackground(), scMapGridDrawMetatilePanel(), scMercuryLighthouseRestoreLights() and scTitleLoadBackground().

Definition at line 1214 of file definitions.h.

RamDecodeBuffer

#define RamDecodeBuffer FIXED_ADDRESS((Uint8 *), 0x0201c000, DecodeBuffer)

Referenced by fdTilesetAnimationUpdate().

Definition at line 1216 of file definitions.h.

RamMetatileTiles

#define RamMetatileTiles FIXED_ADDRESS((Uint8 *), 0x02020000, MetatileTiles)

Referenced by fdActorGetCueMetatileAheadOfCurrent(), fdMapGridCopyMetatileTilesHalfColumn(), fdMapGridCopyMetatileTilesToScreen(), fdTilesetAnimationUpdate(), fdUpdateWalking(), fdWorldMapDrawMetatileColumn(), fdWorldMapDrawMetatileRow(), fdWorldMapWriteLayerMetatileTile() and scMapGridDrawMetatilePanel().

Definition at line 1217 of file definitions.h.

RamMapGridShapes

#define RamMapGridShapes FIXED_ADDRESS((Uint8 *), 0x0202c000, MapGridShapes)

Referenced by fdMapGridCheckCollision(), fdMapGridGetTerrainHeight(), fdMapGridGetTerrainKindAt(), fdMapGridLoadMap(), fdWorldMapGetCollision() and fdWorldMapInitPerspective().

Definition at line 1218 of file definitions.h.

RamBgTileBuffer

#define RamBgTileBuffer FIXED_ADDRESS((Uint8 *), 0x02038000, BgTileBuffer)

Referenced by fdWorldMapLoadAreaGraphics() and fdWorldMapLoadGraphics().

Definition at line 1219 of file definitions.h.

RamEnemySpriteSlots

#define RamEnemySpriteSlots

The battle's enemy sprite slots, 16 KB each, inside the map grid's metatiles.

Referenced by btEnemySpriteLoadIntoSlots() and fdSpriteViewerRun().

Definition at line 1222 of file definitions.h.

RamIWRAMHeapEnd

#define RamIWRAMHeapEnd

The end of the IWRAM heap, which the allocators test against, and the bottom of the stacks.

Referenced by syHeapAllocate(), syHeapAllocateEWRAM(), syHeapSlotAllocate() and syHeapSlotAllocateEWRAM().

Definition at line 1227 of file definitions.h.

RamTickWaitStackTop

#define RamTickWaitStackTop

The stack top sySynch() runs its ticks from: the 512 bytes below it are what the tick loop, its events and the VBlank work always have.

Referenced by sySynch().

Definition at line 1232 of file definitions.h.

RamVramCacheEntries

#define RamVramCacheEntries

Referenced by mnWindowSpriteCreate().

Definition at lines 1243 and 1246 of file definitions.h.

RamMapGridState

#define RamMapGridState ((void **)&HeapSlots[HEAP_SLOT_MAP_GRID])

State pointers in HeapSlots, by name, from the heap group's slot numbers.

Referenced by fdScreenTransitionUpdate() and fdScreenTransitionUpdateFromCenter().

Definition at line 1251 of file definitions.h.

RamFieldState

#define RamFieldState ((void **)&HeapSlots[HEAP_SLOT_FIELD])

Referenced by fdPsynergyStartCast().

Definition at line 1252 of file definitions.h.

RamDisplayState

#define RamDisplayState ((void **)&HeapSlots[HEAP_SLOT_SCREEN_TRANSITION])

Referenced by fdScreenTransitionUpdate(), fdScreenTransitionUpdateDissolve() and fdScreenTransitionUpdateFromCenter().

Definition at line 1253 of file definitions.h.

RamFieldEffectState

#define RamFieldEffectState ((void **)&HeapSlots[HEAP_SLOT_FIELD_EFFECT])

Referenced by fdPsynergyStartCast().

Definition at line 1254 of file definitions.h.

BUP_FILE_COUNT

#define BUP_FILE_COUNT 3

The save group. The save state: sector headers and file summaries. The save files; file n is parts n and n + BUP_FILE_COUNT.

Referenced by mnFileListSelectAction(), mnFileListSelectFile(), mnSaveChooseAndLoadFile(), mnSaveCopyFile(), mnSaveCountFilesExcludingSent(), mnSaveEraseSelectedFile(), mnSaveFindFreeFile(), mnSaveScanFileSummaries(), mnSaveToChosenFile(), mnSaveWriteCurrentFile(), mnSaveWriteFile() and syBupLoadFileSummaries().

Definition at line 1258 of file definitions.h.

BupStateWork

#define BupStateWork (*(BUP_STATE **)&HeapSlots[HEAP_SLOT_BUP])

The save state, heap slot HEAP_SLOT_BUP under its own name; null between save operations.

Referenced by mnFileListSelectFile(), mnSaveCountFilesExcludingSent(), mnSaveFindFreeFile(), mnSaveScanFileSummaries(), mnSaveToChosenFile(), syBupChecksumSector(), syBupFindLatestSector(), syBupGetLatestCounter(), syBupInvalidateSector(), syBupLoadFileSummaries(), syBupReadPart(), syBupReadSector(), syBupSelectWriteSector(), syBupWritePart() and syBupWriteSector().

Definition at line 1344 of file definitions.h.

SECOND_PART_PLAY_TIME_WORD

#define SECOND_PART_PLAY_TIME_WORD 64

The word, counted from SceneLocalState (system/ewram.s), which opens a file's second part, that holds the second copy of the play time (mnSaveBuildFileSummary): InventorySnapshotWork's last, past SceneLocalState.

Referenced by mnSaveBuildFileSummary().

Definition at line 1349 of file definitions.h.

SERIAL_PACKET_BYTES

#define SERIAL_PACKET_BYTES 32

The bytes of one packet buffer in SERIAL_STATE.storage.

Referenced by sySerialInit().

Definition at line 1401 of file definitions.h.

SERIAL_BLOCK_NUMBER_MASK

#define SERIAL_BLOCK_NUMBER_MASK 0x7f

SERIAL_TRANSFER_STATE.active and SerialBlockNumber hold a block number in their low seven bits, counting up and wrapping; the receiver's, with bit 7 set, asks the sender to rewind to that block (sySerialStepBlockTransfer).

Referenced by sySerialStepBlockTransfer().

Definition at line 1495 of file definitions.h.

SERIAL_BLOCK_REWIND

#define SERIAL_BLOCK_REWIND 0x80

Bit 7: rewind to the block number.

Referenced by sySerialStepBlockTransfer().

Definition at line 1497 of file definitions.h.

SERIAL_STATUS_RUNNING

#define SERIAL_STATUS_RUNNING 0x80

SERIAL_TRANSFER_STATE.status's bit 7, set when a send or receive starts; the receiver counts its blocks in the low bits (sySerialStepBlockTransfer).

Referenced by sySerialResetTransferState(), sySerialStartReceive(), sySerialStartSend() and sySerialStepBlockTransfer().

Definition at line 1500 of file definitions.h.

VRAM_CACHE_CLEAR

#define VRAM_CACHE_CLEAR ((const void *)-1)

syVRAMCacheLoad's source that clears the entry's VRAM instead of copying.

Referenced by syVRAMCacheLoad().

Definition at line 1635 of file definitions.h.

Typedefs in detail

EVENT_FUNC

typedef void (*EVENT_FUNC)(void);

Referenced by fdScreenTransitionUpdateScanlineTable(), fdWorldMapStartZoom(), fdWorldMapStepZoom(), mnDebugSceneSelectSchedule(), scAltinPeakCelebrateHydrosVictory(), scBattleArenaEnterBattle(), scColosseumAzartMatchResetBrokenBridge(), scColosseumNavampaMatchPlayPostBattleReunion(), scColosseumNavampaMatchResetWallWedge(), scCottageRoomsAGaretComesHome(), scFuchinTempleEnterWaterfallGrotto(), scInit(), scTreeRoomsPlayPostBattleConversation(), scValePrologueWatchBoulderFall(), scXianStrikeTrainingTreeWithForce(), syCloseEvent(), syExecuteEvent(), syFindEvent(), syResumeEvent(), sySetEvent(), sySetEventFlags(), sySetOrUpdateTickEvent(), sySetTickEvent() and sySuspendEvent().

Definition at line 655 of file definitions.h.

INTERRUPT_HANDLER

typedef void (*INTERRUPT_HANDLER)(void);

An interrupt source's handler, called by the IWRAM dispatcher.

Referenced by IrqHandlers and syIntFunction().

Definition at line 731 of file definitions.h.

Enumerations in detail

DISPLAY_CONTROL

enum DISPLAY_CONTROL

REG_DISPCNT's video modes and bits: each _ON bit shows its layer or turns its window on.

EnumeratorValueDescription
DISPCNT_MODE_00x0000Four text backgrounds.
DISPCNT_MODE_10x0001BG0 and BG1 text, BG2 affine.
DISPCNT_MODE_20x0002BG2 and BG3 affine.
DISPCNT_OBJ_1D_MAP0x0040Sprite tiles in one run, not a 2D sheet.
DISPCNT_BG0_ON0x0100
DISPCNT_BG1_ON0x0200
DISPCNT_BG2_ON0x0400
DISPCNT_BG3_ON0x0800
DISPCNT_OBJ_ON0x1000
DISPCNT_WIN0_ON0x2000
DISPCNT_WIN1_ON0x4000
DISPCNT_OBJWIN_ON0x8000The sprite window OBJ_MODE_WINDOW draws.

Definition at line 68 of file definitions.h.

SPR_MODE

enum SPR_MODE

A sprite's mode, OAM attribute 0's bits 11..10.

EnumeratorValueDescription
OBJ_MODE_NORMAL0
OBJ_MODE_SEMI_TRANSPARENT1blended as BLDCNT's first target
OBJ_MODE_WINDOW2drawn into the OBJ window, not shown

Definition at line 453 of file definitions.h.

KEY_MASK

enum KEY_MASK

The keys' bits as REG_KEYINPUT and REG_KEYCNT lay them out; the game's key state (PerData and the rest) holds them set for a pressed key.

EnumeratorValueDescription
KEY_A0x001
KEY_B0x002
KEY_SELECT0x004
KEY_START0x008
KEY_RIGHT0x010
KEY_LEFT0x020
KEY_UP0x040
KEY_DOWN0x080
KEY_R0x100
KEY_L0x200
KEYS_HORIZONTALKEY_RIGHT | KEY_LEFT
KEYS_VERTICALKEY_UP | KEY_DOWN
KEYS_DPADKEYS_HORIZONTAL | KEYS_VERTICAL
KEYS_SHOULDERSKEY_R | KEY_L

Definition at line 519 of file definitions.h.

EVENT_LIMITS

enum EVENT_LIMITS

The event group. Events, their priorities and the event runner's state. The most events that can run at once.

EnumeratorValueDescription
EVENT_COUNT20

Definition at line 650 of file definitions.h.

anonymous enum

enum { IRQ_VBLANK, IRQ_HBLANK, IRQ_VCOUNT, IRQ_TIMER0, … }

The irq group. The hardware's interrupt sources and the interrupt handler table. The hardware's interrupt sources: each one's bit number in IE and IF, and its slot in IrqHandlers.

EnumeratorValueDescription
IRQ_VBLANK
IRQ_HBLANK
IRQ_VCOUNT
IRQ_TIMER0
IRQ_TIMER1
IRQ_TIMER2
IRQ_TIMER3
IRQ_SERIAL
IRQ_DMA0
IRQ_DMA1
IRQ_DMA2
IRQ_DMA3
IRQ_KEYPAD
IRQ_GAMEPAK
IRQ_COUNT

Definition at line 704 of file definitions.h.

HEAP_SLOT

enum HEAP_SLOT

The heap slots shared across folders, by index into HeapSlots.

EnumeratorValueDescription
HEAP_SLOT_MATRIX_STACK2The 3D transform's one saved level.
HEAP_SLOT_SPRITE_ANIMATIONS3The sprite animations (SPR_ANIMATION) of the actor system's sprites (SpriteAnimations).
HEAP_SLOT_SPRITES4The actor system's sprite pool (SPR).
HEAP_SLOT_ACTORS5The 64 actors (ACTOR).
HEAP_SLOT_ACTOR_SYSTEM6The actor system's state (ACTOR_SYSTEM_STATE, ActorSystemStateWork), taken by fdActorSystemInit.
HEAP_SLOT_WORLD_MAP_AFFINE7The world map's affine state (WORLD_MAP_AFFINE_STATE).
HEAP_SLOT_MAP_GRID8The field map's scrolling state (MAP_GRID_SCROLL_STATE), or on the world map its perspective view (WORLD_MAP_VIEW); MapGridState.
HEAP_SLOT_BATTLE9A battle's BATTLE_STATE (BattleStateWork), from btRun to the next scene change.
HEAP_SLOT_BATTLE_SCANLINES10The battle background's scanline state (BATTLE_AFFINE_HDMA).
HEAP_SLOT_BATTLE_UNUSED11Unused: 640 bytes btRun allocates with the battle's other blocks, which nothing reads or writes.
HEAP_SLOT_CAMERA12The 3D camera (BATTLE_CAMERA, BattleCameraWork) of a battle, the world map or Lucky Dice.
HEAP_SLOT_TILE_SCRATCH14A scratch buffer, usually 1 KB, that a picture is decoded into and released as soon as its tiles are in VRAM.
HEAP_SLOT_WINDOW15The window renderer's state (WIN_STATE, WindowStateWork).
HEAP_SLOT_PARTY_STATUS16The party status window's layout (PARTY_STAT_WINDOW).
HEAP_SLOT_ICON_TRANSFER17The buffers an icon or portrait is decoded through (ICON_TRANSFER).
HEAP_SLOT_SELECTION_MENU18The selection screen's state (SELECTION_MENU_STATE).
HEAP_SLOT_SELECTION_STATE19The selection state mnAllocateSelectionState allocates, which nothing calls.
HEAP_SLOT_SETTINGS_MENU20The settings menu's state (SETTINGS_MENU_STATE, OptionMenuState).
HEAP_SLOT_MIND_READ22Mind Read's wave state (MIND_READ_STATE, MindReadStateWork).
HEAP_SLOT_FIELD27A field scene's FIELD_STATE, which scenes read as FIELD_STATE (FieldStateWork); fdEngineRun takes it and frees it on the way out.
HEAP_SLOT_PALETTE_CYCLES28The palette cycles (PALETTE_CYCLE_STATE).
HEAP_SLOT_WEATHER29The running ground particles, motes or sparkles (struct WEATHER_STATE).
HEAP_SLOT_FIELD_BLEND30The field's colour blend state (FieldBlendStateWork): the struct FIELD_BLEND_STATE the storm's lightning and fdWeatherStartLightningFlash allocate.
HEAP_SLOT_SCREEN_TRANSITION31The screen transition (SCREEN_TRANSITION_STATE, ScreenTransitionStateWork): the window edges and dissolve of a scene change.
HEAP_SLOT_PALETTE_FADE32The palette fade (PaletteFadeState) that moves the BG and sprite palettes toward target colours: the PALETTE_FADE fdPaletteFadeInit allocates on scene load, or the title intro's TITLE_PALETTE_FADE.
HEAP_SLOT_SOL_SANCTUM_LIGHTS33The floating lights of Sol Sanctum's Elemental Star room (struct SOL_SANCTUM_LIGHT_LIST, sol_sanctum_elemental_star_lights.c).
HEAP_SLOT_LINE_SCROLL34The line scroll's state (LINE_SCROLL_STATE).
HEAP_SLOT_MERCURY_LIGHTHOUSE_LIGHTS35Where Mercury Lighthouse keeps a pointer to the state of the lights that carry the leader over its pools (MERCURY_LIGHTHOUSE_LIGHTS).
HEAP_SLOT_GROUND_MASK36The ground mask's state (GROUND_MASK_STATE).
HEAP_SLOT_BATTLE_MESSAGE37The battle message window's state (BATTLE_MESSAGE_STATE).
HEAP_SLOT_BATTLE_EFFECT39The running battle effect's own state (BattleEffectStateWork). Lucky Dice keeps its own state in this slot and the next two.
HEAP_SLOT_BATTLE_CANVAS40The running battle effect's pixel canvas.
HEAP_SLOT_BATTLE_SHEET41The running battle effect's tile sheet, or its set of mote metatiles.
HEAP_SLOT_BATTLE_ENTRY_TIMER42The battle's entry transition timer, in ticks (BattleEntryTimer).
HEAP_SLOT_TITLE_INTRO43The title intro's state (INTRO_STATE).
HEAP_SLOT_BATTLE_BACKGROUND44The battle background's view and entry transition (32 bytes), from btRun.
HEAP_SLOT_LUCKY_GAME45Lucky Dice's sprites (1,560 bytes), for as long as the game runs.
HEAP_SLOT_RAM_CODE46A function run from RAM: the canvas drawing function btEffectBuildBlitter writes, called as a DRAW_RECTANGLE and released before its canvas, or the world map's copy of fdWorldMapUpdateAffineLines.
HEAP_SLOT_RAM_CODE_PAIRED47A second function as HEAP_SLOT_RAM_CODE, released before it: always a btEffectBuildBlitter function, the second of a pair whose first is in HEAP_SLOT_RAM_CODE.
HEAP_SLOT_RAM_CODE_TEMP49Copied field row drawer or window tile decoder, released after each call.
HEAP_SLOT_MESSAGE_DECODER50The message decoder function (TextDecodeSymbol), copied here to run for the length of one message's decoding (mnMessageDecode), or of one mnMessageDecodeRaw call when the slot is empty.
HEAP_SLOT_BUP51The save state (BUP_STATE), from syBupInitState to syBupReleaseState around each save, load, copy or delete and each scan of the files, as the main menu's (mnSaveScanFileSummaries).
HEAP_SLOT_TICK_SCRATCH52Lives for one tick: sySynch() builds the OAM list in it, and the field sprite decoder keeps its code there between its own uses.
HEAP_SLOT_PICTURE_UPLOADER53A RAM copy of fdTileCopyStrided, which uploads field sprite pictures to VRAM; loaded with the animation pools.
HEAP_SLOT_ENEMY_UNITS54Each linked console's party (ENEMY_UNITS_SIZE bytes), from the Battle Arena and btRun.
HEAP_SLOT_MENU55The menu state (MENU_STATE_SIZE bytes) shared by the field menu's screens and the shop; each takes it on opening and releases it on closing.
HEAP_SLOT_FIELD_EFFECT56The Psynergy effect's state (FIELD_EFFECT_STATE, FieldEffectStateWork).
HEAP_SLOT_BATTLE_MENU57The battle command menus' state (BATTLE_MENU_STATE).
HEAP_SLOT_ICON_MENU58A command icon menu's state (ICON_MENU_STATE).
HEAP_SLOT_COLOSSO_RACE59The Colosso finals' race state (COLOSSO_RACE_STATE), which ColossoState reads by its own name.

Definition at line 769 of file definitions.h.

anonymous enum

enum { MATRIX_TRANSLATION_X, MATRIX_TRANSLATION_Y, MATRIX_TRANSLATION_Z, MATRIX_WORDS }

The matrix group. The 3D transform and its stack. A transform's twelve 16.16 words: a 3x3 rotation, then the translation's x, y and z.

EnumeratorValueDescription
MATRIX_TRANSLATION_XM30
MATRIX_TRANSLATION_YM31
MATRIX_TRANSLATION_ZM32
MATRIX_WORDS12

Definition at line 1155 of file definitions.h.

SERIAL_PHASE

enum SERIAL_PHASE

SERIAL_STATE.phase.

EnumeratorValueDescription
SERIAL_PHASE_SEARCHING0looking for the partner
SERIAL_PHASE_CONNECTED1

Definition at line 1375 of file definitions.h.

SERIAL_MODE

enum SERIAL_MODE

SERIAL_STATE.mode: how this console takes part in the link.

EnumeratorValueDescription
SERIAL_MODE_CHILD0
SERIAL_MODE_CLOCKINGSIO_MULTI_SDSIO_MULTI_SD alone of SIOCNT's SIO_START and SIO_MULTI_SD: this console armed timer 3 and clocks the transfers.

Definition at line 1382 of file definitions.h.

enum LINK_STAT

The link status bits sySerialExchangePayloads returns.

EnumeratorValueDescription
LINK_STATUS_HEARD_BOTH3both consoles heard from this tick
LINK_STATUS_CLOCKING0x80this console clocks the transfers
LINK_STATUS_ERROR0x1000last transfer IRQ found SIOCNT's SIO_ERROR bit set
LINK_STATUS_EXTRA_CONSOLE0x2000SIOCNT's multiplayer id is 2 or more

Definition at line 1391 of file definitions.h.

SERIAL_CHANNEL_FLAG

enum SERIAL_CHANNEL_FLAG

SERIAL_STATE.channelFlags: what the transfer interrupts saw of a console's packets since the last tick.

EnumeratorValueDescription
SERIAL_CHANNEL_PACKET_COMPLETE1Its fourteenth halfword arrived.
SERIAL_CHANNEL_ERROR2A transfer interrupt found SIOCNT's error bit (SIO_ERROR) set.

Definition at line 1469 of file definitions.h.

SERIAL_RECEIVE_STATE

enum SERIAL_RECEIVE_STATE

SERIAL_TRANSFER_STATE.flags: how far this console's receive has got.

EnumeratorValueDescription
SERIAL_RECEIVE_IDLE0
SERIAL_RECEIVE_ACTIVE1
SERIAL_RECEIVE_DONE2the last block taken

Definition at line 1477 of file definitions.h.

SERIAL_SEND_STATE

enum SERIAL_SEND_STATE

SERIAL_TRANSFER_STATE.peerFlags: the kind of block this console sends.

EnumeratorValueDescription
SERIAL_SEND_IDLE0
SERIAL_SEND_MORE1a block with more to follow
SERIAL_SEND_LAST2

Definition at line 1485 of file definitions.h.

VRAM_CACHE_LIMITS

enum VRAM_CACHE_LIMITS

The vram_cache group. The sprite VRAM block cache and its owners. The sprite VRAM cache's sizes and its free marks. Sprite tile memory, from OBJ_VRAM0, is split into blocks that the cache entries own.

EnumeratorValueDescription
VRAM_CACHE_ENTRY_COUNT96Cache entries; syVRAMCacheFindFreeEntry returns this when none is free.
VRAM_BLOCK_COUNT512Blocks of sprite VRAM.
VRAM_BLOCK_BYTES64
VRAM_BLOCK_OWNER_FREE255VramCacheBlockOwners of a free block.
VRAM_CACHE_OFFSET_FREE65535VRAM_CACHE_ENTRY.offset of a free entry.
VRAM_CACHE_SIZE_NO_BLOCKS16The largest size an entry has while it holds no blocks: syVRAMCacheReleaseVRAM leaves 1, which keeps the entry taken.
VRAM_CACHE_LOAD_MAX8192The most bytes syVRAMCacheLoad takes at once: 128 blocks, a quarter of sprite VRAM.

Definition at line 1591 of file definitions.h.

VRAM_CACHE_FIXED_ENTRY

enum VRAM_CACHE_FIXED_ENTRY

The cache entries kept for one use each, loaded by number.

EnumeratorValueDescription
VRAM_CACHE_ENTRY_ACTOR_SHADOW93The actors' shared shadow (ActorShadowTiles), each sprite animation's part 1 (fdActorSystemConfigure).
VRAM_CACHE_ENTRY_GROUND_MASK94The ground mask's solid tiles (fdEffectStartGroundMask).
VRAM_CACHE_ENTRY_GLYPH_TILES95The window sprites' glyph tiles (WIN_STATE.glyphTiles).

Definition at line 1611 of file definitions.h.

Functions in detail

BiosCpuSet

void BiosCpuSet(const void *src, void *dest, Uint32 control)

The system library's functions that the SDK's units call. They cannot include system.h, so the prototypes are here with the constants they take. The BIOS CpuSet call (system/bios.s): copies or fills by halfwords or words, as the CPU_SET_ flags above the count say.

Definition at line 443 of file definitions.h.

__divsi3

Sint32 __divsi3(Sint32 numerator, Sint32 denominator)

The C library's signed division and remainder (system/iwram_entry.s), which / and % compile to; declared for the functions that call them by name.

Definition at line 446 of file definitions.h.

__modsi3

Sint32 __modsi3(Sint32 numerator, Sint32 denominator)

Definition at line 447 of file definitions.h.

Variables in detail

offsetof

STATIC_ASSERT(offsetof(HEAP_STATE, heap.nextIwram)

STATIC_ASSERT(offsetof(HEAP_STATE, heap.blocks)

Definition at lines 765 and 766 of file definitions.h.

syIWRAMWordsFill

extern Uint8 syIWRAMWordsFill[]

Definition at line 1082 of file definitions.h.

syIWRAMExpandBitRuns

extern Uint8 syIWRAMExpandBitRuns[]

Definition at line 1084 of file definitions.h.

syIWRAMTransformVector

extern Uint8 syIWRAMTransformVector[]

Definition at line 1085 of file definitions.h.

syIWRAMMultiMatrix

extern Uint8 syIWRAMMultiMatrix[]

Definition at line 1086 of file definitions.h.

syIWRAMSignedDivide

extern Uint8 syIWRAMSignedDivide[]

Definition at line 1087 of file definitions.h.

syIWRAMUnsignedDivide

extern Uint8 syIWRAMUnsignedDivide[]

Definition at line 1088 of file definitions.h.

syIWRAMDecompress

extern Uint8 syIWRAMDecompress[]

Definition at line 1089 of file definitions.h.

syIWRAMWordsCopy

extern Uint8 syIWRAMWordsCopy[]

Definition at line 1090 of file definitions.h.

TickWaitStackTop

extern Uint8 TickWaitStackTop[]

Definition at line 1091 of file definitions.h.

On this page

StructuresMacrosTypedefsEnumerationsFunctionsVariablesDescriptionMacros in detailREG_DISPCNTREG_DISPSTATDISPSTAT_VBLANK_INTRDISPSTAT_HBLANK_INTRDISPSTAT_VCOUNT_INTRDISPSTAT_VCOUNT_LINEREG_VCOUNTDISPLAY_TOTAL_LINESREG_BG1CNTREG_BG2CNTREG_BG3CNTBGCNT_PRIORITYBGCNT_CHAR_BASEBGCNT_MOSAICBGCNT_256_COLORSBGCNT_SCREEN_BASEBGCNT_WRAPBGCNT_SIZEDISPCNT_MODE_MASKREG_BG1HOFSREG_BG1VOFSREG_BG2HOFSREG_BG2VOFSREG_BG3HOFSREG_BG3VOFSQ_8_8REG_BG2PAREG_BG2PBREG_BG2PCREG_BG2PDREG_BG2XREG_BG2YREG_BG3PAREG_BG3PBREG_BG3PCREG_BG3PDREG_BG3XREG_BG3YDISPLAY_WIDTHDISPLAY_HEIGHTDISPLAY_TILE_WIDTHDISPLAY_TILE_HEIGHTREG_WIN0HREG_WIN1HREG_WIN0VREG_WIN1VWIN_RANGEREG_WININREG_WINOUTWININ_WIN0_BG0WININ_WIN0_BG1WININ_WIN0_BG2WININ_WIN0_BG3WININ_WIN0_OBJWININ_WIN0_CLRWININ_WIN0_ALLWININ_WIN1_BG0WININ_WIN1_BG1WININ_WIN1_BG2WININ_WIN1_BG3WININ_WIN1_OBJWININ_WIN1_CLRWININ_WIN1_ALLWINOUT_WIN01_BG0WINOUT_WIN01_BG1WINOUT_WIN01_BG2WINOUT_WIN01_BG3WINOUT_WIN01_OBJWINOUT_WIN01_CLRWINOUT_WIN01_ALLWINOUT_WINOBJ_BG0WINOUT_WINOBJ_BG1WINOUT_WINOBJ_BG2WINOUT_WINOBJ_BG3WINOUT_WINOBJ_OBJWINOUT_WINOBJ_CLRWINOUT_WINOBJ_ALLREG_MOSAICREG_BLDCNTBLDCNT_TGT1_BG0BLDCNT_TGT1_BG1BLDCNT_TGT1_BG2BLDCNT_TGT1_BG3BLDCNT_TGT1_OBJBLDCNT_TGT1_BDBLDCNT_TGT1_ALLBLDCNT_EFFECT_NONEBLDCNT_EFFECT_BLENDBLDCNT_EFFECT_LIGHTENBLDCNT_EFFECT_DARKENBLDCNT_TGT2_BG0BLDCNT_TGT2_BG1BLDCNT_TGT2_BG2BLDCNT_TGT2_BG3BLDCNT_TGT2_OBJBLDCNT_TGT2_BDBLDCNT_TGT2_ALLREG_BLDALPHABLEND_WEIGHT_MAXBLEND_ALPHAREG_BLDYBLEND_FADE_MAXBG_CANVAS_MAPREG_BG0HOFSREG_DMA0DMA_CNT_H_INDEXREG_DMA3PLTTBG_PLTT_SIZEBG_PLTT_COLORSPLTT_COLORSPLTT_BACKDROPBG_PLTTPALETTE_COLORSBG_PLTT_COLOROBJ_PLTTOBJ_PLTT_COLORRGBGREEN_SHIFTBLUE_SHIFTRGB_REDRGB_GREENRGB_BLUERGB_LEVEL_MAXRGB_WHITERED_BITSGREEN_BITSBLUE_BITSIWRAM_STARTEWRAM_STARTEWRAM_ENDVRAMBG_CHAR_SIZEBG_SCREEN_SIZEBG_SCREEN_WIDTHMAP_ROW_BYTESMAP_ENTRY_PAIRBG_TILE_PALETTEBG_TILE_PALETTE_OFBG_CHAR_BLOCKBG_SCREEN_BLOCKTILE_SIZE_4BPPTILE_ROW_SIZE_4BPPTILE_SIZE_8BPPSCREEN_TILE_BYTESPIXELS_4BPPPIXELS_8BPPOBJ_VRAM0REG_TM3CNTREG_TM3CNT_HTIMER_INTR_ENABLETIMER_ENABLETIMER_256CLKREG_SIODATA32REG_SIOCNTREG_SIOCNT16REG_SIODATA8REG_KEYINPUTREG_KEYCNTREG_RCNTSIO_115200_BPSSIO_MULTI_SISIO_MULTI_SDSIO_IDSIO_ID_SHIFTSIO_ID_OFSIO_ERRORSIO_ERROR_OFSIO_STARTSIO_32BIT_MODESIO_MULTI_MODESIO_INTR_ENABLERCNT_SIO_MODERCNT_GPIO_MODEDMA_DEST_INCDMA_DEST_DECDMA_DEST_FIXEDDMA_DEST_RELOADDMA_SRC_INCDMA_SRC_DECDMA_SRC_FIXEDDMA_REPEATDMA_16BITDMA_32BITDMA_DREQ_ONDMA_START_NOWDMA_START_VBLANKDMA_START_HBLANKDMA_START_SPECIALDMA_INTR_ENABLEDMA_ENABLEDMA_BUSYDMA_START_TIMING_DRQ_REPEATDMA_COPY_WORDSDMA_FILL_HALFWORDSDMA_FILL_WORDSDMA_COPY_HALFWORDSDMA_COPY_HALFWORDS_DOWNDMA_HBLANK_HALFWORD_PER_LINEDMA_HBLANK_WORDS_PER_LINEDMA_HBLANK_WORD_PER_LINECPU_SET_SRC_FIXEDCPU_SET_32BITOAMOAM_SIZEOBJ_SIZE_8X8OBJ_SIZE_16X16OBJ_SIZE_32X32OBJ_SIZE_64X64OBJ_SIZE_16X8OBJ_SIZE_32X8OBJ_SIZE_32X16OBJ_SIZE_64X32OBJ_SIZE_8X16OBJ_SIZE_16X32OBJ_SIZE_32X64OBJ_AFFINEOBJ_DOUBLE_SIZEOBJ_MODEOBJ_256_COLORSOBJ_HFLIPOBJ_VFLIPOBJ_PRIORITYOBJ_PALETTEOBJ_XOBJ_MATRIXOBJ_AFFINE_PARAMETEROBJ_X_MASKOBJ_POSITIONOBJ_TILE_MASKSPRITE_TILESSPRITE_TILES_8BPPOBJ_Y_RANGEKEYS_MASKDPAD_INDEXREG_BG0CNTREG_BG0VOFSREG_SOUNDCNT_HSOUND_CGB_MIX_FULLSOUND_A_MIX_FULLSOUND_B_MIX_FULLSOUND_ALL_MIX_FULLSOUND_A_RIGHT_OUTPUTSOUND_A_LEFT_OUTPUTSOUND_A_TIMER_0SOUND_A_FIFO_RESETSOUND_B_RIGHT_OUTPUTSOUND_B_LEFT_OUTPUTSOUND_B_TIMER_0SOUND_B_FIFO_RESETREG_SOUNDBIASREG_FIFO_AREG_FIFO_BREG_DMA0SADREG_DMA0DADREG_DMA0CNTREG_DMA0CNT_HREG_DMA1SADREG_DMA1DADREG_DMA1CNTREG_DMA1CNT_HREG_DMA2SADREG_DMA2DADREG_DMA2CNTREG_DMA2CNT_HREG_DMA3SADREG_DMA3DADREG_DMA3CNTREG_DMA3CNT_HREG_TM0CNT_LREG_TM0CNT_HREG_TM1CNT_LREG_TM1CNT_HREG_TM2CNT_LREG_TM2CNT_HREG_IEREG_IFREG_WAITCNTWAITCNT_SRAM_SLOWESTWAITCNT_SRAM_MASKREG_IMEKEYCNT_SOFT_RESETKEYCNT_DISARMEDKEYCNT_SHOULDERS_WAKEWAITCNT_GAMEEVENT_PASS_VBLANKEVENT_PASS_TICKEVENT_PASS_VBLANK_FIRSTEVENT_PRIORITY_EMPTYEVENT_PRIORITY_REMOVEDEVENT_STATE_HIGHEVENT_SUSPENDEDEVENT_FLAG_KEEP_RUNNINGEVENT_IN_OVERLAYINTR_FLAG_VBLANKINTR_FLAG_TIMER3INTR_FLAG_SERIALINTR_FLAG_KEYPADINTR_FLAG_GAMEPAKHEAP_SLOT_BLOCKHEAP_SLOT_FROMGLOW_SHEET_ROOMMapGridStateMenuStateFieldBlendStateWorkScreenTransitionStateWorkBattleEntryTimerFieldEffectStateWorkDMA3TICKS_PER_SECONDIO_WRITE_BYTEIO_WRITE_HALFWORDIO_WRITE_WORDIO_WRITE_SETIO_WRITE_CLEARsyFixedDivEntrysyWordsClearEntrysyWordsFillEntrysySquartEntrysyDecompressBitRunssyVectorTransformEntrysyMultiMatrixEntrysyIntegerDivideEntrysyIntegerDivideUnsignedEntrysyDecompressSpritePictureEntrysyWordsCopyEntrysyWordsCopyOffsetsyDivFXOffsetsySquartOffsetsyWordsCopyLinkedBATTLE_PROJECTION_CENTER_XBATTLE_PROJECTION_CENTER_YRamMapGridMetatileBufferRamDecodeBufferRamMetatileTilesRamMapGridShapesRamBgTileBufferRamEnemySpriteSlotsRamIWRAMHeapEndRamTickWaitStackTopRamVramCacheEntriesRamMapGridStateRamFieldStateRamDisplayStateRamFieldEffectStateBUP_FILE_COUNTBupStateWorkSECOND_PART_PLAY_TIME_WORDSERIAL_PACKET_BYTESSERIAL_BLOCK_NUMBER_MASKSERIAL_BLOCK_REWINDSERIAL_STATUS_RUNNINGVRAM_CACHE_CLEARTypedefs in detailEVENT_FUNCINTERRUPT_HANDLEREnumerations in detailDISPLAY_CONTROLSPR_MODEKEY_MASKEVENT_LIMITSanonymous enumHEAP_SLOTanonymous enumSERIAL_PHASESERIAL_MODELINK_STATSERIAL_CHANNEL_FLAGSERIAL_RECEIVE_STATESERIAL_SEND_STATEVRAM_CACHE_LIMITSVRAM_CACHE_FIXED_ENTRYFunctions in detailBiosCpuSet__divsi3__modsi3Variables in detailoffsetofsyIWRAMWordsFillsyIWRAMExpandBitRunssyIWRAMTransformVectorsyIWRAMMultiMatrixsyIWRAMSignedDividesyIWRAMUnsignedDividesyIWRAMDecompresssyIWRAMWordsCopyTickWaitStackTop