Alchemy
Loading...
Searching...
No Matches

vertices.c File Reference

Go to the source code of this file.

Data Structures

struct  RuntimeUnusedEntry
 An eight-byte runtime entry contains the ldr/bx instructions and a target word. More...
struct  RuntimeMathBinaryEntry
 A runtime table entry whose two-argument target this routine calls, the arctangent. More...
struct  RuntimeMathUnaryEntry
 A runtime table entry whose one-argument target this routine calls, the sine or the cosine. More...
struct  RuntimeMathTable
 The runtime table's prefix through Trig_Cos, in its assembly order. More...
struct  Position
 The camera's eye or target point, as this routine reads it. More...
struct  ScanVertex
 One scanline of the world map's ground plane. More...
struct  BgAffine
 One background's affine registers, BG2PA to BG2Y. More...

Macros

#define VISIBLE_SCANLINES   160
 visible scanlines

Functions

 STATIC_ASSERT (sizeof(struct RuntimeUnusedEntry)==8)
 STATIC_ASSERT (sizeof(struct RuntimeMathBinaryEntry)==8)
 STATIC_ASSERT (sizeof(struct RuntimeMathUnaryEntry)==8)
 STATIC_ASSERT (offsetof(struct RuntimeMathTable, atan2)==64)
 STATIC_ASSERT (offsetof(struct RuntimeMathTable, sin)==88)
 STATIC_ASSERT (offsetof(struct RuntimeMathTable, cos)==96)
void Transform_UpdateVertices (struct Position *eye, struct Position *target, struct ScanVertex *line, struct BgAffine *affine)
 Builds the world map's per-scanline affine table for one frame: the ground plane seen from eye towards target.

Variables

const struct RuntimeMathTable FarCall_RuntimeTable
u32 gScanlineAngle

Macro Definition Documentation

◆ VISIBLE_SCANLINES

#define VISIBLE_SCANLINES   160

visible scanlines

Definition at line 8 of file vertices.c.

Referenced by Transform_UpdateVertices().

Function Documentation

◆ STATIC_ASSERT() [1/6]

STATIC_ASSERT ( sizeof(struct RuntimeUnusedEntry) = =8)

◆ STATIC_ASSERT() [2/6]

STATIC_ASSERT ( sizeof(struct RuntimeMathBinaryEntry) = =8)

◆ STATIC_ASSERT() [3/6]

STATIC_ASSERT ( sizeof(struct RuntimeMathUnaryEntry) = =8)

◆ STATIC_ASSERT() [4/6]

STATIC_ASSERT ( offsetof(struct RuntimeMathTable, atan2) = =64)

◆ STATIC_ASSERT() [5/6]

STATIC_ASSERT ( offsetof(struct RuntimeMathTable, sin) = =88)

◆ STATIC_ASSERT() [6/6]

STATIC_ASSERT ( offsetof(struct RuntimeMathTable, cos) = =96)

◆ Transform_UpdateVertices()

void Transform_UpdateVertices ( struct Position * eye,
struct Position * target,
struct ScanVertex * line,
struct BgAffine * affine )

Builds the world map's per-scanline affine table for one frame: the ground plane seen from eye towards target.

line points at the 160 scanlines' ground terms, whose rotation terms stay cached while the yaw (gScanlineAngle) is unchanged; affine receives each line's parameters twice, for BG2 and then BG3, as the HBlank DMA writes both. Copied to RAM (heap slot 46) by Map_InitializePerspectiveScene, which runs it once, and run from there each frame by WorldMap_UpdateView into the affine page of the frame's parity. Writes gScanlineAngle when the yaw changes.

Definition at line 88 of file vertices.c.

Referenced by Map_InitializePerspectiveScene(), and Transform_UpdateVertices().

Variable Documentation

◆ FarCall_RuntimeTable

const struct RuntimeMathTable FarCall_RuntimeTable
extern

◆ gScanlineAngle