Alchemy
Loading...
Searching...
No Matches

facing.c File Reference

Go to the source code of this file.

Variables

const u8 gAnimationFacing_Kind1 [16]
 Facing tables: for each animation kind, the frame to draw for each sector of the facing angle.
const u8 gAnimationFacing_Kind22 [8]
const u8 gAnimationFacing_Kind2 [8]
const u8 gAnimationFacing_Kind3 [16]
const u8 gAnimationFacing_Kind5 [16]
const u8 gAnimationFacing_Kind8 [8]
const u8 gAnimationFacing_Kind88 [8]
const u8 gAnimationFacing_Kind4 [64]
const u8 gAnimationFacing_Kind6 [64]
const u8 gMap_TileDissolveOrder [64]
 The order in which the 64 pixels of a sprite's tile in OBJ VRAM dissolve; read by Map_RenderAnimatedTileFrame (objects.c).
const u16 gMap_TileDissolveTail = 0x01ff
 Two bytes after the dissolve order; no code in The Broken Seal names them.
const s32 gCamera_FixedViewMatrix [12]
 The fixed camera's view matrix (Q16): identity with a -0.8 shear of y by x.
const s32 gScriptObject_CycleTable [32]
 One period of a triangle wave, which bobs a floating object up and down.
const s32 gScript_MainScript [1]
 The idle script an object returns to when its own one ends: a lone SC_END, which reloads it.
const s16 gScript_MainScriptTail [8]
 Halfwords that follow the main script; no code in The Broken Seal names them.
const u16 gWorldMap_KeyHeadings [16]
 The heading for each state of the direction pad (bits 4-7 of the keys); 0xffff means no direction is held, or only an opposite pair.
const s32 gWorldMap_FootprintActions [6]
 Two scripts for the world map's footprint and dust effects: wait 120 or 30 frames, then release the object.
const s32 gWorldMap_KeyYaws [16]
 The world map camera's turn rate for each state of the direction pad, read by Object_MoveOnWorldMap.

Variable Documentation

◆ gAnimationFacing_Kind1

const u8 gAnimationFacing_Kind1[16]
Initial value:
= {
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00,
0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80,
}

Facing tables: for each animation kind, the frame to draw for each sector of the facing angle.

Sprite_ComposeAnimationFrame adds the low three bits to the animation's base frame, and bit 7 (0x80) mirrors the sprite. Kinds 1, 2 and 22 have eight sectors, 3 and 5 sixteen, 4 and 6 sixty-four; kinds 8 and 88 have eight sectors centred on the eight compass directions. Kind 20 uses kind 2's table. Kind 1's table has 16 entries, but a 16-bit angle shifted down 13 reads only the first eight.

Definition at line 13 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind22

const u8 gAnimationFacing_Kind22[8]
Initial value:
= {
0x80, 0x80, 0x00, 0x00, 0x01, 0x01, 0x81, 0x81,
}

Definition at line 18 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind2

const u8 gAnimationFacing_Kind2[8]
Initial value:
= {
0x00, 0x00, 0x80, 0x80, 0x01, 0x01, 0x81, 0x81,
}

Definition at line 22 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind3

const u8 gAnimationFacing_Kind3[16]
Initial value:
= {
0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 0x81, 0x81,
0x81, 0x81, 0x82, 0x82, 0x02, 0x02, 0x02, 0x01,
}

Definition at line 26 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind5

const u8 gAnimationFacing_Kind5[16]
Initial value:
= {
0x01, 0x00, 0x00, 0x03, 0x03, 0x80, 0x80, 0x81,
0x81, 0x82, 0x82, 0x04, 0x04, 0x02, 0x02, 0x01,
}

Definition at line 31 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind8

const u8 gAnimationFacing_Kind8[8]
Initial value:
= {
0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04, 0x03,
}

Definition at line 36 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind88

const u8 gAnimationFacing_Kind88[8]
Initial value:
= {
0x01, 0x00, 0x03, 0x85, 0x86, 0x87, 0x04, 0x02,
}

Definition at line 40 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind4

const u8 gAnimationFacing_Kind4[64]
Initial value:
= {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
0x81, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x83,
0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01,
}

Definition at line 44 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gAnimationFacing_Kind6

const u8 gAnimationFacing_Kind6[64]
Initial value:
= {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
0x81, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x83,
0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x05,
0x05, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01,
}

Definition at line 55 of file facing.c.

Referenced by Sprite_ComposeAnimationFrame().

◆ gMap_TileDissolveOrder

const u8 gMap_TileDissolveOrder[64]
Initial value:
= {
4, 63, 12, 10, 44, 5, 1, 60, 46, 41, 3, 23, 29, 55, 51, 15,
50, 25, 26, 57, 19, 49, 16, 61, 8, 58, 37, 17, 27, 31, 59, 53,
11, 56, 33, 7, 30, 35, 36, 32, 42, 62, 21, 13, 2, 22, 45, 14,
6, 48, 52, 9, 43, 28, 0, 40, 24, 34, 20, 47, 54, 39, 38, 18,
}

The order in which the 64 pixels of a sprite's tile in OBJ VRAM dissolve; read by Map_RenderAnimatedTileFrame (objects.c).

Definition at line 68 of file facing.c.

Referenced by Map_RenderAnimatedTileFrame().

◆ gMap_TileDissolveTail

const u16 gMap_TileDissolveTail = 0x01ff

Two bytes after the dissolve order; no code in The Broken Seal names them.

Definition at line 76 of file facing.c.

◆ gCamera_FixedViewMatrix

const s32 gCamera_FixedViewMatrix[12]
Initial value:
= {
0x10000, 0, 0,
-0xcccc, 0x10000, 0,
0, 0, 0x10000,
0, 0, 0,
}

The fixed camera's view matrix (Q16): identity with a -0.8 shear of y by x.

ObjectSystem_UpdateCameraFixed applies it while battle commands are chosen.

Definition at line 80 of file facing.c.

Referenced by ObjectSystem_UpdateCameraFixed().

◆ gScriptObject_CycleTable

const s32 gScriptObject_CycleTable[32]
Initial value:
= {
1, 2, 3, 4, 5, 6, 7, 8,
7, 6, 5, 4, 3, 2, 1, 0,
-1, -2, -3, -4, -5, -6, -7, -8,
-7, -6, -5, -4, -3, -2, -1, 0,
}

One period of a triangle wave, which bobs a floating object up and down.

Object_UpdateAllThumb reads it at half the object's phase, scaled by its gravity.

Definition at line 90 of file facing.c.

Referenced by Object_UpdateAllThumb().

◆ gScript_MainScript

const s32 gScript_MainScript[1]
Initial value:
= {
}
#define SC_END
Return to the main script.
Definition objcmd.h:32

The idle script an object returns to when its own one ends: a lone SC_END, which reloads it.

Script_End (SC_END) points an object here.

Definition at line 99 of file facing.c.

Referenced by Script_End().

◆ gScript_MainScriptTail

const s16 gScript_MainScriptTail[8]
Initial value:
= {
0x1000, -0x2000, 0x3000, -0x4000, 0x6000, -0x8000, 0x4000, 0x0,
}

Halfwords that follow the main script; no code in The Broken Seal names them.

Definition at line 105 of file facing.c.

◆ gWorldMap_KeyHeadings

const u16 gWorldMap_KeyHeadings[16]
Initial value:
= {
0xffff, 0x0000, 0x8000, 0xffff, 0xc000, 0xe000, 0xa000, 0xc000,
0x4000, 0x2000, 0x6000, 0x4000, 0xffff, 0x0000, 0x8000, 0xffff,
}

The heading for each state of the direction pad (bits 4-7 of the keys); 0xffff means no direction is held, or only an opposite pair.

Read by FieldObject_UpdatePlayerControl, Object_MoveOnWorldMap and Object_MoveByKeys.

Definition at line 113 of file facing.c.

Referenced by FieldObject_UpdatePlayerControl(), Object_MoveByKeys(), and Object_MoveOnWorldMap().

◆ gWorldMap_FootprintActions

const s32 gWorldMap_FootprintActions[6]
Initial value:
= {
}
#define SC_FREE
Release.
Definition objcmd.h:43
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16

Two scripts for the world map's footprint and dust effects: wait 120 or 30 frames, then release the object.

FieldObject_UpdatePlayerControl starts the first and Object_MoveOnWorldMap the second (three words in).

Definition at line 121 of file facing.c.

Referenced by FieldObject_UpdatePlayerControl(), and Object_MoveOnWorldMap().

◆ gWorldMap_KeyYaws

const s32 gWorldMap_KeyYaws[16]
Initial value:
= {
0, -512, 512, 0,
0, -384, 384, 0,
0, -384, 384, 0,
0, 0, 0, 0,
}

The world map camera's turn rate for each state of the direction pad, read by Object_MoveOnWorldMap.

Definition at line 128 of file facing.c.

Referenced by Object_MoveOnWorldMap().