Skip to Content
The Alchemy Project

src/field/field_internal.h

What every part of the field object shares: its includes and the few names more than one part uses. More…

Included by field.c, field_actor_camera.c, field_actor_motion.c, field_actors.c, field_decompress.c, field_map_grid.c, field_player_control.c, field_script_commands.c, field_sprite_animation.c, field_sprite_draw.c, field_sprite_viewer.c, field_terrain.c, field_tile_animation.c, field_view.c and field_world_map.c.

Structures

NameDescription
structSPR_PICTURE_CACHE_SOURCEA row of SpritePictureCacheSources: the packed resource that holds an animation number's pictures, ending at number 0.

Macros

NameDescription
#defineMAPGRID_ANIMATION_SCRIPT (RamMapGridShapes + 4096)Where a layout's tileset animation and blend scripts are decoded, in the space after the shapes; the world map decodes its tileset animation there too.
#defineMAPGRID_BLEND_SCRIPT (RamMapGridShapes + 7680)
#defineWORLD_MAP_TILE_SET_BYTES 8192One of the world map area's four tile sets, half a character block; they are decoded one after another into BgTileBuffer.

Enumerations

NameDescription
enumANIMATION_COMMAND { ANIMCMD_END, ANIMCMD_SET_KIND, ANIMCMD_HOLD, ANIMCMD_WAIT, A … }Animation script commands.
enumanonymous enum { RESOURCE_SLOT_COUNT, ANIM_OBJECT_COUNT, ANIM_LAYER_COUNT, SP … }The field's pool sizes, and a sprite animation's timer step at normal speed.
enumanonymous enum { FIELD_VIEW_FOCUS_X, FIELD_VIEW_FOCUS_Y, FIELD_VIEW_WIDTH, FI … }Layered-map viewport distances in 16.16 pixels.
enumanonymous enum { FIELD_SPRITE_RIPPLE, FIELD_SPRITE_FOOTPRINT }Sprite ids the field engine's own code creates actors of.
enumMETATILE_TILES_PACKING { METATILE_TILES_PACKING_RAW, METATILE_TILES_PACKING_SPLIT_DEL … }How a layout's metatile tiles are packed: the method byte fdTileMapDecodeStagedBuffer reads before the halfwords.

Variables

NameDescription
extern SPR_PICTURE_CACHE_SOURCESpritePictureCacheSources []

Description

What every part of the field object shares: its includes and the few names more than one part uses. field.c includes it before the parts, and each part includes it too, so that a part read on its own still resolves. It places no bytes.

Macros in detail

MAPGRID_ANIMATION_SCRIPT

#define MAPGRID_ANIMATION_SCRIPT (RamMapGridShapes + 4096)

Where a layout's tileset animation and blend scripts are decoded, in the space after the shapes; the world map decodes its tileset animation there too.

Referenced by fdMapGridLoadMap() and fdWorldMapInitPerspective().

Definition at line 82 of file field_internal.h.

MAPGRID_BLEND_SCRIPT

#define MAPGRID_BLEND_SCRIPT (RamMapGridShapes + 7680)

Referenced by fdMapGridLoadMap().

Definition at line 83 of file field_internal.h.

WORLD_MAP_TILE_SET_BYTES

#define WORLD_MAP_TILE_SET_BYTES 8192

One of the world map area's four tile sets, half a character block; they are decoded one after another into BgTileBuffer.

Referenced by fdTileMapDrawRowsFromRam(), fdWorldMapEndStillImage(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics() and fdWorldMapStartStillImage().

Definition at line 87 of file field_internal.h.

Enumerations in detail

ANIMATION_COMMAND

enum ANIMATION_COMMAND

Animation script commands.

EnumeratorValueDescription
ANIMCMD_END239blank the layer and stop its script
ANIMCMD_SET_KIND240use facing table arg
ANIMCMD_HOLD241stay on this command and tick for good
ANIMCMD_WAIT245keep the current tick arg ticks longer
ANIMCMD_JUMP253continue at script position arg
ANIMCMD_PLAY254switch to animation arg
ANIMCMD_BLANK255show nothing for arg

Definition at line 28 of file field_internal.h.

anonymous enum

enum { RESOURCE_SLOT_COUNT, ANIM_OBJECT_COUNT, ANIM_LAYER_COUNT, SPRITE_ANIMATION_NORMAL_STEP }

The field's pool sizes, and a sprite animation's timer step at normal speed.

EnumeratorValueDescription
RESOURCE_SLOT_COUNT8ACTOR_SYSTEM_STATE.pictureCaches
ANIM_OBJECT_COUNT64sprites and sprite animations
ANIM_LAYER_COUNT4SPR.entries
SPRITE_ANIMATION_NORMAL_STEP161/16 ticks taken off animation timer per tick (1 tick)

Definition at line 40 of file field_internal.h.

anonymous enum

enum { FIELD_VIEW_FOCUS_X, FIELD_VIEW_FOCUS_Y, FIELD_VIEW_WIDTH, FIELD_VIEW_HEIGHT }

Layered-map viewport distances in 16.16 pixels. The followed point is below the vertical centre; scroll bounds and camera following share this origin.

EnumeratorValueDescription
FIELD_VIEW_FOCUS_XtoFIXED(120)followed point from the left edge
FIELD_VIEW_FOCUS_YtoFIXED(96)followed point from the top edge
FIELD_VIEW_WIDTHtoFIXED(240)the screen's width
FIELD_VIEW_HEIGHTtoFIXED(160)the screen's height

Definition at line 51 of file field_internal.h.

anonymous enum

enum { FIELD_SPRITE_RIPPLE, FIELD_SPRITE_FOOTPRINT }

Sprite ids the field engine's own code creates actors of.

EnumeratorValueDescription
FIELD_SPRITE_RIPPLE24the ripple behind the leader in shallow water
FIELD_SPRITE_FOOTPRINT25a footprint, on maps that show them

Definition at line 60 of file field_internal.h.

METATILE_TILES_PACKING

enum METATILE_TILES_PACKING

How a layout's metatile tiles are packed: the method byte fdTileMapDecodeStagedBuffer reads before the halfwords.

EnumeratorValueDescription
METATILE_TILES_PACKING_RAW0copied as it is
METATILE_TILES_PACKING_SPLIT_DELTA1All the high bytes, then all the low bytes; each value is XORed with the one before.
METATILE_TILES_PACKING_DELTA2each value is XORed with the one before

Definition at line 69 of file field_internal.h.

Variables in detail

SpritePictureCacheSources

extern SPR_PICTURE_CACHE_SOURCE SpritePictureCacheSources[]

Referenced by fdSpritePictureCacheLoad().

Definition at line 97 of file field_internal.h.