7#define MAP_SHAKE_SETTLE_FRAMES 300
8#define MAP_SHAKE_SETTLE_MAX_AMPLITUDE (Q16_ONE / 256 - 1)
9#define TILEMAP_TILE_BANK_BYTES (256 * (8 * 8))
10#define TILEMAP_MAP_BANK_BYTES (64 * 64)
57 const u8 *tiles,
const u8 *map);
94 s32 *cameraCoordinates;
99 s32 horizontalSquared;
109 SET_VECTOR(groundPoint, position[0], zero, position[2]);
111 cameraCoordinates = cameraPoint;
113 cameraCoordinates[1] -
Iwram_MulQ16(cameraCoordinates[2], pitchSlope);
121 difference = distance - pitchSlope;
136 horizontal = (cameraCoordinates[2] - scale) >> 4;
137 vertical = (diagonal - cameraCoordinates[1]) >> 4;
138 horizontalSquared =
Iwram_MulQ16(horizontal, horizontal);
140 verticalSquared =
Iwram_Sqrt(horizontalSquared + verticalSquared) << 12;
143 verticalSquared = -verticalSquared;
155#undef MAP_SHAKE_SETTLE_FRAMES
156#undef MAP_SHAKE_SETTLE_MAX_AMPLITUDE
157#undef TILEMAP_TILE_BANK_BYTES
158#undef TILEMAP_MAP_BANK_BYTES
void TileMap_DrawRowsFromRam(const struct MapAffinePair *lines, u8 *pixels)
Draws the current affine page into the world map's still-view pixels.
#define TILEMAP_MAP_BANK_BYTES
void Map_WaitForShakeToSettle(void)
Waits until both shake amplitudes are below 1/256 pixel, with a 300-frame limit for a shake whose dec...
#define MAP_SHAKE_SETTLE_MAX_AMPLITUDE
#define TILEMAP_TILE_BANK_BYTES
void(*) TileMapRowDrawer(const struct MapAffinePair *lines, u8 *pixels, const u8 *tiles, const u8 *map)
The copied ARM kernel reads the BG2 affine row from each 32-byte pair and writes 240 by 160 pixels as...
void Map_SetScreenShake(s32 shakeX, s32 shakeY, s32 shakeDecay)
Changes the shake without restarting an axis whose argument is negative.
#define MAP_SHAKE_SETTLE_FRAMES
void WorldMap_BuildScanlineTable(s32 pitchSlope, s32 *position, struct MapScanline *scanline)
Rebuilds the ground plane's scanline terms when the world map pitch changes.
const u8 TileMap_DrawRows[]
u8 TileMap_DrawRowsCodeSize[]
What every part of the field object shares: its includes and the few names more than one part uses.
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
@ HEAP_SLOT_TEMP_RENDERER
Copied field row drawer or window tile decoder, released after each call.
static s32 Iwram_RatioMulQ14(s32 divisor, s32 value)
All calls go through this layer.
static s32 Iwram_Sqrt(s32 value)
#define Iwram_MulQ16(left, right)
static s32 Iwram_TransformVector(const void *vector, s32 *result)
#define SET_VECTOR(v, x, y, z)
Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step,...
void Runtime_ReleaseHeapBlock(s32 slot)
struct Projection gProjection
#define RamCode_LoadSlot(slot, code, bytes)
Allocates a work-slot copy; release it with Runtime_ReleaseHeapBlock.
One screen line's affine parameters for BG2 and BG3.
One screen line's ground-plane terms on the world map: its width scale and distance,...