Alchemy

world_map.c

The world map screen: place markers, the cursor and the place name.

games/tbs/src/object/psynergy_effects/world_map.c on GitHub

The world map screen: place markers, the cursor and the place name. Part of psynergy_effects.c, compiled only through it.

Functions

BattleFx_SetupResourcesAndWindow

void BattleFx_SetupResourcesAndWindow(void)

Sets up the world map screen: the marker tiles and their OAM entries, the cursor where the leader is on the map (or mid-screen when the place is not on it), and the place-name window.

Used by Map_ShowWorldMap.

Line 75

BattleFx_CleanupResourcesAndWindow

void BattleFx_CleanupResourcesAndWindow(void)

Closes the world map screen: returns its VRAM blocks and removes the place-name window.

Used by Map_ShowWorldMap.

Line 177

Map_UpdateWorldMapMarkers

void Map_UpdateWorldMapMarkers(void)

Scheduler callback of the world map screen: shows a marker at each place whose flag is set, moves the cursor with the d-pad (to the current place while L or R is held) and shows the name of the marker nearest the cursor.

Used by Map_ShowWorldMap.

Line 188

Map_ShowWorldMap

void Map_ShowWorldMap(s32 picture)

Borrows the map-cell buffer for the still map until A or B closes it. Field_RunScene reaches this for event -888 in world-map mode. The marker task stops before map graphics are restored, so neither uses the other's scratch storage. The picture argument is unused; the resource is fixed.

Used by Field_RunScene.

Line 427

Field_UpdateObjectVisibilityBounds

void Field_UpdateObjectVisibilityBounds(void)

On the world map, shows only the scene actors within 320 pixels sideways, 600 above and 400 below the camera.

Used by BattleFx_RunVisibilityTransition.

Line 496

BattleFx_RunVisibilityTransition

void BattleFx_RunVisibilityTransition(void)

On the world map, zooms the view out (0x9d89) while L is held, then back.

Used by Field_RunScene.

Line 535

Structures

WorldMapWork

struct WorldMapWork

Scratch work while Map_ShowWorldMap owns gMapCellBuffer. Setup runs before the marker task; cleanup removes its window before map graphics reuse it.

FieldDeclared as
markerVramBlocku16 markerVramBlockowns the four generated marker tiles
cursorVramBlocku16 cursorVramBlockowns the cursor picture's tiles
cursorXunion FieldCoordinate cursorXscreen column, 16.16 pixels
cursorYunion FieldCoordinate cursorYscreen row, 16.16 pixels
padding0cu8 padding0c[6]not read by this screen
namedMarkers16 namedMarkeractor whose name is drawn; -1 clears the name
padding14u8 padding14[4]not read by this screen
cursorSpeeds32 cursorSpeed16.16 screen pixels per frame
nameWindowstruct UiWindow *nameWindowowned until this screen closes
markersunion WorldMapMarkerPart markers[WORLD_MAP_MARKER_CAPACITY + 1]
markersstruct AnimationSpritePart markers[WORLD_MAP_MARKER_CAPACITY + 1]

Used by BattleFx_CleanupResourcesAndWindow, BattleFx_SetupResourcesAndWindow, Map_UpdateWorldMapMarkers.

Line 48

Unions

WorldMapMarkerPart

union WorldMapMarkerPart

The renderer's linked sprite entry and the three words that initialize it.

FieldDeclared as
spritestruct AnimationSpritePart sprite
wordsu32 words[3]

Used by BattleFx_SetupResourcesAndWindow, Map_UpdateWorldMapMarkers.

Line 24

Macros

WORLD_MAP_CURSOR_SNAPS

#define WORLD_MAP_CURSOR_SNAPS 1

The cursor snaps to the nearest place when the d-pad is released.

Used by Map_UpdateWorldMapMarkers.

Line 166

Also, macros without a comment: WORLD_MAP_MARKER_TILE_BYTES, WORLD_MAP_SCREEN_WIDTH, WORLD_MAP_SCREEN_HEIGHT, WORLD_MAP_WORLD_SIZE, WORLD_MAP_X_ORIGIN, WORLD_MAP_FIRST_PLACE_ACTOR, WORLD_MAP_MARKER_CAPACITY, WORLD_MAP_CURSOR_PART, WORLD_MAP_CURSOR_MIN_SPEED, WORLD_MAP_CURSOR_MAX_SPEED, WORLD_MAP_CURSOR_ACCELERATION, WORLD_MAP_MARKER_BLEND_STEPS, WORLD_MAP_CURSOR_MIN_X, WORLD_MAP_CURSOR_MAX_X, WORLD_MAP_CURSOR_MAX_Y, WORLD_MAP_MARKER_VIEW, WORLD_MAP_MARKER_VIEW, WORLD_MAP_MARKER_ALLOCATION_SIZE, WORLD_MAP_MARKER_ALLOCATION_SIZE, WORLD_MAP_NAME_RANGE, WORLD_MAP_NAME_LEFT, WORLD_MAP_CURSOR_SNAPS, WORLD_MAP_NAME_RANGE, WORLD_MAP_NAME_LEFT.

On this page