include/field/field_engine_functions.h
The field-engine module's functions, declared in the order of its stub table. More…
Included by field_engine.h.
Functions
| Name | Description | |
|---|---|---|
Sint32 | fdEngineRun (Sint32 entrance) | The field-engine module's functions in the order of its stub table (src/field/engine_stubs.s). |
void | gmMainRoutineRun (Sint32 start) | The main routine: runs one engine after another and never returns. start, a GAME_START, chooses the first scene. |
void | fdScriptWait (Sint32 ticks) | Waits the requested ticks through sySynch(), unless debug fast-forward (fdScriptUpdateDebugSkip) is on: the wait scripts use. |
void | fdScriptStart (void) | Begins a script: closes any area name window, stops the leader, resets the message and timing state, and starts the debug fast-forward event with the leader as the message speaker. |
void | fdScriptEnd (void) | Ends a script: stops the debug fast-forward event, gives the camera back to the leader and refreshes FLAG_LURE_CAP (gmFlagRefreshLureCap). |
void | fdScriptRunActorUpdateAndWait (struct ACTOR_PLACE *table) | Respawns the scene's actors from an actor placement table and waits one tick for them to appear. |
void | fdScriptAppendActorPlacements (struct ACTOR_PLACE *table) | Spawns the actors of an actor placement table after the last actor in use. |
void | fdAssignViewFlags (struct ACTOR_PLACE *entry) | Gives each actor placement with condition 0 a condition saying whether it lies within the map's view bounds, so that only those inside appear. |
void | fdScriptSetCues (const struct CUE *cues) | Sets the scene's cue table, which the field checks as the leader moves: Altin Peak's script calls it. |
void | fdScriptAddPartyMember (Sint32 unit, Sint32 announce) | Adds unit to the party. |
void | fdScriptAddPartyMemberPair (Sint32 first, Sint32 second) | Adds two units to the party and announces them together. |
void | fdPartyRemoveMemberRestored (Sint32 unit) | Takes unit out of the party, fully restoring its HP and PP and curing its poison. |
Sint32 | fdPartyInventoryGiveItem (Sint32 item, Sint32 unused) | Gives item to the first party member with room for it and says so; when every bag is full the player picks something to drop. |
Sint32 | fdInventoryTryAddAndReturnMember (Sint32 item, Sint32 unused, Sint32 unit) | Gives item to one party member. |
Sint32 | fdScriptAskYesNoWithActorAnimation (Sint32 actorId, Sint32 forceBottom) | Once the message on screen has been read, asks yes or no below it, or above it when the message windows reach past YES_NO_BELOW_LAST_ROW, unless forceBottom is set; the actor then nods for yes or shakes its head for no. |
void | fdPartyLearnAbility (Sint32 unit, Sint32 ability) | Teaches unit the Psynergy ability and says so with its jingle, waiting for the player to read it. |
struct ACTOR * | fdActorGetById (Sint32 actorId) | Returns an actor, or NULL if it does not exist. |
void | fdActorReleaseById (Sint32 actorId) | Releases the actor and empties its slot, writing NULL to its place in the field state's actor table. |
void | fdActorSetSpeedParams (Uint32 actorId, FIXED speedLimit, FIXED acceleration) | Sets an actor's top speed and acceleration, in 16.16 pixels per tick. |
void | fdActorSetMovementTypeById (Uint32 actorId, Sint32 movement) | Gives an actor a movement type or actor script (fdActorSetMovementType) and makes it face where it moves (ACTOR_FACES_MOTION). |
void | fdActorWaitForScriptEndById (Uint32 actorId) | Waits, at most 300 ticks, for an actor's script to reach its end (SC_END). |
void | fdActorStop (Uint32 actorId) | Stops an actor's movement type and puts it back under script control, on the idle script (a lone SC_END), and sets ACTOR_FACES_MOTION. |
void | fdActorSetMovementTypeAndWaitById (Uint32 actorId, Sint32 movement) | Starts a movement type or supplied actor script, as fdActorSetMovementTypeById does, then waits up to 300 ticks for its script to end. |
void | fdActorSetDestinationById (Uint32 actorId, Sint32 x, Sint32 z) | Sends an actor toward (x, z), in pixels, keeping its current animation. |
void | fdActorMoveToAndWaitById (Uint32 actorId, Sint32 x, Sint32 z) | As fdActorSetDestinationById, then waits (at most 600 ticks) for the actor to arrive. |
void | fdActorWalkToById (Uint32 actorId, Sint32 x, Sint32 z) | Walks an actor toward (x, z), in pixels. |
void | fdActorWalkToAndWaitById (Uint32 actorId, Sint32 x, Sint32 z) | Walks the actor to (x, z), in pixels, waits for it to arrive and stands it still. |
void | fdActorCenterOnColumn (Uint32 actorId, Sint32 priority, Sint32 zOffset) | Walks the actor sideways to the middle of its 16-pixel column, sets its sprite priority to priority (fdActorSetSpritePriority), then sends it zOffset pixels along z. |
void | fdActorSetDestinationOffsetById (Uint32 actorId, Sint32 xOffset, Sint32 zOffset) | Sends an actor (xOffset, zOffset) pixels from where it stands, keeping its current animation. |
void | fdActorWaitForMoveById (Uint32 actorId) | Waits (at most 600 ticks) for the actor to arrive and stands it still. |
void | fdActorSetHorizontalPosWithTerrain (Uint32 actorId, FIXED x, FIXED z) | Puts the actor at (x, z), 16.16 pixels, at rest. |
void | fdActorSetPosWithTerrain (Uint32 actorId, FIXED x, FIXED y, FIXED z) | Puts the actor at (x, y, z), 16.16 pixels, at rest; an actor that follows the ground (ACTOR_FOLLOWS_TERRAIN) is raised by the ground height there, read as fdActorSetHorizontalPosWithTerrain reads it. |
void | fdActorSetAnimationById (Uint32 actorId, Sint32 animation) | Switches an actor to an animation (an ACTOR_ANIMATION: ANIM_STAND, ANIM_WALK, ANIM_NOD, ANIM_SHAKE_HEAD and so on). |
void | fdActorSetAnimationSpeedById (Uint32 actorId, Sint32 steps) | Sets the animation timer steps of each of an actor's sprites (fdSpriteSetAnimationSpeed). |
void | fdActorSetAnimationAndWait (Uint32 actorId, Sint32 animation) | Plays an animation and waits for it to end. |
void | fdActorWaitForAnimationChange (Uint32 actorId) | Waits, at most 90 ticks, for an actor's animation to change. |
void | fdActorNoOperation (void) | An empty function, reached only through an unnamed stub in the stub call table of this object's module. |
void | fdActorJump (Uint32 actorId, Sint32 speed, Sint32 ticks) | Throws the actor upward at speed pixels per tick with a jump sound (a higher one above 5), then waits ticks ticks. |
void | fdActorStartRepeatedMotion (Uint32 actorId, Sint32 count) | Makes an actor squash and spring back count times (1 to REPEATED_MOTION_MAX), through RepeatedSquashScript. |
void | fdActorRunRepeatedMotion (Uint32 actorId, Sint32 count) | As fdActorStartRepeatedMotion, then waits for it to end. |
void | fdActorJumpDownLedge (Sint32 actorId, Uint32 pose, Sint32 dustColor) | Makes an actor jump down off a ledge in front of it (the field runs it for the leader when the player presses down at a ledge): it shows pose for 10 ticks, hops 12 pixels south, turns toward FACING_SOUTH_SOUTHWEST (1/16 turn past FACING_SOUTH) while sinking 28 pixels with a dust puff every other tick in the colour mode dustColor (none when it is -1), then jumps on to 16 pixels south of where it started and lands. |
void | fdActorFaceActorById (Sint32 firstId, Sint32 secondId, Sint32 ticks) | Turns the first actor at once to face the second, then waits the given number of ticks. |
void | fdActorTurnToFaceEachOther (Sint32 firstId, Sint32 secondId, Sint32 ticks) | Turns two actors toward each other, then waits the given number of ticks. |
void | fdActorConfigureSpriteColor (Sint32 actorId, Sint32 color) | Gives every sprite part of an actor the colour mode color (fdActorSetSpriteColor), or with SPRITE_COLOR_BLINK makes it blink. |
void | fdActorSetSpriteColor (struct ACTOR *actor, Sint32 color) | Sets the colour mode of every animated part of an actor's sprite. |
void | fdActorWatchAndStartScript (Uint32 actorId, Sint32 targetId, const void *script) | Makes an actor follow the actor in targetId's ACTOR_WATCH_ACTOR_MASK bits and starts script on it. |
void | fdScriptSetMessageId (Sint32 msg) | Sets the number of the script's next message. |
struct WINDOW * | fdMessageShowAtActor (Sint32 speaker, Sint32 unusedFlags) | Opens the script's current message in a speech window next to the speaking actor, with the speaker's portrait beside it when it has one, and moves on to the next message. speaker is the actor id with SPEAKER_ bits above it; the script's flags argument is not read. |
void | fdScriptShowMessageAndWait (Sint32 actorId, Sint32 flags) | Opens the current message at actorId (fdMessageShowAtActor) and waits until it has been read and its window has closed; the speaker's portrait is closed once the text is typed out. |
void | fdScriptShowMessageThenWait (Sint32 actorId, Sint32 flags, Sint32 ticks) | Shows the message, then waits the given number of ticks. |
Sint32 | fdScriptAskYesNoAndShowResponse (Sint32 actorId, Sint32 flags) | Opens the question at actorId, lets the leader answer, then shows the next message for yes or the one after it for no. |
void | fdScriptShowSpeakerMessage (Sint32 speaker) | Unused: reached only through a bare stub in field/engine_stubs.s, which has no symbol, so no code can call it. |
void | fdScriptForwardShowMessageAtPos (Sint32 unusedA, Sint32 unusedB, Sint32 x, Sint32 y) | Unused: reached only through a bare stub in engine_stubs.s; forwards its arguments to fdScriptShowMessageAtPos. |
void | fdScriptShowMessageAtPos (Sint32 unusedA, Sint32 unusedB, Sint32 x, Sint32 y) | Unused: reached only through a bare stub in engine_stubs.s. |
void | fdActorFaceDirectionById (Sint32 actorId, Sint32 angle, Sint32 ticks) | Turns an actor toward angle (TRIG_TURN a full turn; fdActorStepAngle), then the script waits the given number of ticks. |
void | fdActorClearDestinationAndStand (Uint32 actorId) | Clears an actor's destination, puts it under script control and stands it still. |
void | fdActorClosePortrait (Sint32 actorId) | Closes the portrait of an actor's sprite, if it has one. |
void | fdScriptShowTwoMessagesAndWait (Sint32 first, Sint32 firstX, Sint32 firstY, Sint32 firstPortraitX, Sint32 firstPortraitY, Sint32 second, Sint32 secondX, Sint32 secondY, Sint32 secondPortraitX, Sint32 secondPortraitY) | Two actors speak at once, each message at its own (x, y) with its portrait at (portraitX, portraitY), all in tiles. |
void | fdMessageSetVoiceFromActor (Sint32 actorId) | Sets the voice of the messages that follow to that of actorId's sprite, at the rate the message speed option picks (MessageSpeedVoiceRates); MESSAGE_VOICE_NONE clears it. |
void | fdActorSetSpritePriority (Sint32 actorId, Sint32 priority) | Fixes the priority of the actor's sprite, which then no longer follows its depth: clears ACTOR_PRIORITY_AUTOMATIC. |
void | fdActorShowEmoteById (Sint32 actorId, Sint32 emote, Sint32 ticks) | The script command "actor show emote": shows an emote bubble (SPRITE_EMOTE) over an actor, then waits the given number of ticks. |
void | fdEffectSetAttached (Sint32 actorId, Sint32 flags) | The script command "actor set attached effect", by ATTACHED_EFFECT_FLAG: removes the actor attached to an actor, attaches one (SPRITE_ATTACHED_EFFECT, animation 1) or shows a one-off one (animation 2) that ends by itself (ActorWaitScript, 40 ticks). |
void | fdActorCopyGraphics (Uint32 targetId, Uint32 srcId) | Makes the target actor's sprite show the source actor's graphics (its VRAM block and tile). |
void | fdCameraFollowActor (Sint32 actorId, Sint32 keepPos) | Makes the camera, the script's view centre, follow actorId. |
void | fdCameraSetSpeedParams (FIXED speedLimit, FIXED acceleration) | Sets the camera's top speed and acceleration, in 16.16 pixels per tick. |
void | fdCameraMoveWithinMapBounds (FIXED requestedX, FIXED requestedY, FIXED requestedZ, Sint32 glide) | Pans the camera to a point in 16.16 pixels (CAMERA_KEEP keeps that axis), or cuts there when glide is 0, kept far enough inside the map that the screen never shows past its edge. |
void | fdCameraWaitForArrival (void) | Waits (at most 600 ticks) for the camera to arrive, then 2 ticks more. |
void | fdCameraMoveToActorById (Sint32 actorId, Sint32 glide) | Moves the camera to an actor's x and z, as fdCameraMoveWithinMapBounds does to a point. |
struct ACTOR * | fdCameraGetActor (void) | Returns the camera actor. |
void | fdMapGridSetCameraBounds (Sint32 minX, Sint32 minY, Sint32 maxX, Sint32 maxY) | The script command "set view bounds": the camera keeps the screen inside these map coordinates (fdCameraMoveWithinMapBounds). |
void | fdScriptSetDestination (Sint32 sceneId, Sint32 entrance) | Makes the script leave for the given entrance of the given scene: raises the exit request EXIT_KEEP_DESTINATION and writes MainRoutineStateWork.next and entrance. |
void | fdScriptSetRestartPoint (Uint16 sceneId, Uint16 entrance) | Makes the script leave and records scene and entrance as the restart point. |
void | fdScriptSetExitRequest (Uint16 request) | Sets the field's exit request, which ends the scene: an exit kind, or EXIT_KEEP_DESTINATION for MainRoutineStateWork's next and entrance. |
void | fdRequestBattleFromEncounterTable (Sint32 zone, Sint32 slot) | Sets up a battle with the formation in slot of encounter table zone. |
void | fdRequestDjinnBattle (Sint32 actorAndHop, Sint32 djinni) | Sets up the battle with Djinni number djinni. |
void | fdScriptSetAfterBattleDestination (Sint32 sceneId, Sint32 entrance) | Sets the after-battle destination (MainRoutineStateWork.afterBattleScene and afterBattleEntrance), where the party goes once the coming battle is won. |
void | fdScriptSetDefeatDestination (Sint32 sceneId, Sint32 entrance) | Sets where the party wakes up after losing a battle (MainRoutineStateWork.defeatScene and defeatEntrance). |
void | fdScriptLeaveFor (Uint16 sceneId, Uint16 entrance) | Sends the party to an entrance of another scene: the field engine leaves on its next pass (EXIT_KEEP_DESTINATION). |
Sint32 | fdActorGetScreenPos (Sint32 actorId, Sint32 *pos) | Finds where an actor is on screen: position[0] and position[1] receive its x and y in pixels, y at the top of its sprite. |
Sint32 | fdActorGetCueMetatileAheadOfCurrent (void) | Returns the metatile behavior of the map metatile 16 pixels ahead of the party leader when there is something to search there: a fixed search spot (METATILE_BEHAVIOR_JAR to METATILE_BEHAVIOR_WELL) whose ground is level with the leader or up to 64 pixels above it, or a behavior the scene has an examine cue for. |
Sint32 | fdPartyGetCharacterSprite (Sint32 character) | Returns the sprite of character, which is the character itself except that FLAG_CHILDHOOD gives Isaac and Garet SPRITE_ISAAC_CHILD and SPRITE_GARET_CHILD, and FLAG_ISAAC_WEARS_TUNIC gives grown Isaac sprite SPRITE_ISAAC_TUNIC. |
void | fdPsynergySteerPushedTarget (Sint32 targetId) | When Move is cast on a target, the pushing hand appears beside it and pushes it 16 pixels the way the d-pad points, for as long as the player pushes; A, B, L or R end it. |
void | fdPsynergyStartCloak (void) | The leader blinks 10 times and hides (cloaked set), and the metatile check starts; where the leader cannot hide it shows again at once. |
Sint32 | fdTryJumpForward (void) | Makes the leader jump two metatiles forward, over the metatile in front, when the map allows it (fdMapGridCheckCollision). |
Sint32 | fdClimbDown (void) | Climbs the leader down onto a climbable wall below it, or lets go of the wall it is on (the player presses down at a climbable wall); -1 when there is none to climb. |
Sint32 | fdClimbUp (void) | Jumps the leader onto a climbable wall ahead, or climbs it over the top of the wall it is on (the player presses up at a climbable wall); -1 when there is none to climb. |
void | fdLeaderStopMoving (void) | Stops the leader where it stands: no horizontal velocity, the normal walking speed (1.0) and acceleration (0.5), no destination, and the standing pose, or the clinging pose while the leader is on a climbable wall. |
void | fdWeatherStartRain (void) | Starts the rain (fdWeatherUpdateRain) with its sound, SE_AMBIENT_WATER: loads the splash tiles and puts 32 drops under the leader with staggered timers, drawn semi-transparent. |
void | fdWeatherStartLightning (void) | Starts the storm's lightning (fdWeatherUpdateLightning): builds the dark (PALETTE_TINT_DIM) and lit (PALETTE_TINT_PALE) BG colours and their 12-step fade, and arms the first burst to end in 600 ticks, repeating. |
void | fdWeatherStopLightning (void) | Stops the lightning: no flash for 32767 ticks, and none after. |
void | fdWeatherLastLightning (void) | One last burst of lightning, its first flash two ticks from now (timer 12; fdWeatherUpdateLightning flashes at 11), then no more. |
void | fdWeatherResumeLightning (void) | Restarts the lightning: the next burst ends in 128 ticks, its first flash 118 ticks from now, and bursts repeat. |
void | fdWeatherStartLightningFlash (Sint32 from, Sint32 to) | Flashes the palette with the storm's event: one burst of three flashes of palette to, each fading back to palette from (fdPaletteFadeBuild modes) on the BG colours, ending 120 ticks from now, and no more after. |
void | fdMotesStart (void) | Starts the floating motes (fdMotesUpdate): loads their tiles and puts 32 of them under the leader with staggered timers, drawn semi-transparent. |
void | fdEffectInitSparkles (void) | Starts the sparkles (fdEffectUpdateSparkles): loads their tiles and clears the 32 sparkles. |
void | fdScreenTransitionStartHeldWindow (Sint32 mode) | Starts window transition mode at value 0, with no duration: the caller moves it. |
void | fdScreenTransitionStartDissolveHeld (Sint32 mode) | Unused: nothing calls it, by name or through its stub. |
void | fdScreenTransitionStart (Sint32 mode, Sint32 ticks) | Fades the screen in over ticks ticks. mode is a SCENE_TRANSITION: its high byte an SCREEN_TRANSITION_STYLE (from black, from the backdrop colour, a window transition whose low byte is an WINDOW_TRANSITION_MODE, a dissolve, or opening from the centre line, which a non-zero low byte makes flicker). |
void | fdScreenTransitionFinish (Sint32 mode, Sint32 ticks) | Fades the screen out over ticks ticks, as fdScreenTransitionStart fades it in. |
void | fdScreenTransitionHideBackgrounds (Sint32 clearBg3, Sint32 clearBg2, Sint32 clearBg1) | Clears the map's display-control bits for backgrounds 3, 2 and 1 (DISPCNT_BG3_ON, DISPCNT_BG2_ON and DISPCNT_BG1_ON) for each argument that is set. |
void | fdPaletteFadeInit (void) | Sets up the palette fade (PaletteFadeState) from the BG and OBJ palettes and starts updating the palettes from it each tick. |
void | fdPaletteFadeSetTarget (Sint32 mode, Sint32 half) | Sets the colours the buffer moves toward (see fdPaletteFadeBuild); does nothing without a palette fade. |
void | fdPaletteFadeSetSource (Sint32 mode, Sint32 half) | Sets the colours the buffer shows now (see fdPaletteFadeBuild). |
void | fdPaletteFadeCalculateSteps (Sint16 *src, Sint16 *target, Sint16 *step, Sint32 ticks) | Sets each channel of step (three for each of the 448 colours) to the amount to add each tick for source to reach target in ticks ticks; with ticks 0 or less step is left as it was. |
void | fdPaletteFadeStartInterpolation (Sint32 ticks) | Starts moving the shown colours to the target colours over ticks ticks: sets state->duration, clears state->step and fills state->delta. |
void | fdPaletteFadeRelease (void) | Stops the palette fade and frees it. |
void | fdPaletteFadeSetBackdrop (Uint32 color) | Sets the buffer's source backdrop colour (BG colour 0 of its palette copy). |
void | fdScriptStartScreenTransition (void) | Starts the script's screen transition, as FIELD_STATE.transition and transitionFrame give it. |
void | fdScriptFinishScreenTransition (void) | Finishes the script's screen transition. |
void | fdScriptWaitTransitionTicks (void) | Waits as long as the script's screen transition runs. |
void | scLineScrollInitWave (Sint32 mode, FIXED frequencyX, Sint32 stepX, FIXED ampX, FIXED frequencyY, Sint32 stepY, FIXED ampY) | Starts the ripple: for x and y, the wave's frequency, its step each tick and its amplitude. |
void | fdLineScrollStop (void) | Stops the line scroll: removes its two events and stops DMA 0. |
Sint32 | fdChestOpenAndShowItem (Sint32 actorId, Sint32 target, Sint32 itemId) | Opens the chest that is actor target (SE_CHEST_OPEN, the lid lifting on treasure) and, 12 ticks later, shows itemId in front of actor actorId with sparkles; returns the actor that shows the item, or 0 when there is no chest. |
void | fdItemDisplayShowPicture (void *object, Sint32 flags) | Shows a found item's picture, with sparkles (ITEM_DISPLAY_SPARKLES) or held up by the leader (ITEM_DISPLAY_RAISED); with both it sparkles for 60 ticks before he raises it, and he holds it 80. |
void | fdItemDisplayShowItem (Sint32 item, Sint32 flags) | Shows the picture of item 36 pixels above the party leader for 80 ticks, with sparkles (ITEM_DISPLAY_SPARKLES) or held up as a found item (ITEM_DISPLAY_RAISED). |
struct ACTOR * | fdTreasureSpotGetActor (Sint32 id) | Returns the actor of treasure spot id, or NULL when no slot has it. |
void | fdTreasureSpotOpenChest (Sint32 id) | Opens the chest of treasure spot id with SE_CHEST_OPEN, and waits 12 ticks. |
void | fdTreasureSpotCloseChest (Sint32 id) | Closes the chest of treasure spot id again (its item could not be carried), with SE_CHEST_CLOSE. |
void | fdTreasureSpotShowOpened (Sint32 id) | Shows the chest of treasure spot id open, with no sound. |
void | fdTreasureSpotSetActorPos (Sint32 id, FIXED x, FIXED z) | Moves the actor of treasure spot id to (x, z) on the ground; -1 keeps the centre of its metatile on that axis. |
void | fdTreasureSpotHide (Sint32 id) | Hides the actor of treasure spot id; the actor stays in its slot. |
void | fdTreasureSpotMoveLeaderAway (void) | Keeps the party leader off the treasure spots: a leader within 16 pixels of a treasure spot's centre is moved 20 pixels from that centre, in the direction it stood, and loses its move target. |
void | fdWorldMapFreeze (void) | Before a script or menu on the World Map: ends any screen transition in progress, stops the camera and holds the view as a still image. |
void | fdWorldMapUnfreeze (void) | Ends what fdWorldMapFreeze started: on the World Map, reloads the area's graphics and lets the camera move again. |
void | fdActorResetForLeader (struct ACTOR_PLACE *table) | Creates a scene's actors on entering it: the party leader where the main routine's state puts it, then the scene's actor placement table from actor slot 8, and the camera that follows the leader. |
void | fdScriptSpawnActorPlacements (struct ACTOR_PLACE *entry, Sint32 slot) | Creates the actors of a scene's actor placement table (ended by sprite -1), and records the table among the scene's tables. |
void | fdActorReleaseAtIndex (Sint32 actorIndex) | Releases the actor in slot actorIndex, if there is one, and empties the slot. |
void * | fdActorLookup (Uint32 actorIndex) | Returns the actor in slot actorIndex (below LOOKUP_ID_COUNT), or NULL. |
void | fdEffectStartGroundMask (void *object) | Starts the ground mask on object (the party leader when NULL): loads its solid tiles, sets the blending and draws it each tick. |
void | fdGroundMaskSuspend (void) | Stops drawing the ground mask, keeping its state. |
void | fdGroundMaskResume (void) | Draws the ground mask again after fdGroundMaskSuspend. |
void | fdPsynergyRunHandler (Sint32 kind) | Runs one step of the current field Psynergy: an FIELD_PSYNERGY_HANDLER. |
void | fdPsynergyLoadResources (Sint32 abilityId, Sint32 mode) | Prepares the state of the field Psynergy for abilityId (HEAP_SLOT_FIELD_EFFECT) and loads its spark tiles; mode is where it runs, an ACTOR_SYSTEM_MODE. |
void | fdPsynergySetupActorPair (Sint32 userId, Sint32 targetId) | Records the caster and the target of a field Psynergy, and where it takes place: on the target, or 16 pixels in front of the caster with none. |
void | fdPsynergyStopCasterUpdate (void) | Stops the caster's update function and restores its colours, then waits a tick. |
void | fdPsynergyEnd (void) | Ends a field Psynergy: frees the field effect sprites still in use and, unless another is being resolved, waits (at most END_ARC_WAIT_TICKS) for the swelling arcs to end, stops the slot event, releases its tiles, restores the map's shake, plays the queued sound and releases its state. |
void | fdPsynergyStartCast (void) | Starts casting: the caster raises its hand (ANIM_CAST_PSYNERGY_START) and stops; with FLAG_PLAY_PSYNERGY_CAST it goes on to ANIM_CAST_PSYNERGY_END. |
void | fdPsynergyFadeToCastColor (void) | Saves the palettes for the Psynergy and fades them toward one of the eight cast colours (FieldPsynergyCastColors), picked by the tick counter or forced by FLAG_PSYNERGY_TINT(0) to (7), over 8 ticks. |
void | fdPsynergyFadeFromCastColor (void) | Fades the palettes back from a cast's colours to the saved ones over 8 ticks; while Reveal is active the BG half fades to Reveal's grey instead (PALETTE_TINT_GRAYSCALE). |
void | fdEndBusyAndReveal (void) | Clears the field's busy flag and, while Reveal is active, ends it: Reveal used with ACT_PACKED runs its ending scripts. |
void | fdPsynergyStartMindReadWave (Sint32 casterId, Sint32 targetId) | Starts the wave effect of casterId on targetId (actor ids): fades the palettes toward a hue that shifts with the tick counter, and starts its per-tick update (fdPsynergyUpdateMindReadWave) after 8 ticks. |
void | fdPsynergyStopMindReadWave (void) | Stops the wave effect: restores the caster's colours and the palettes and releases the Psynergy's state. |
void | fdPsynergyGreyMindReadPalette (void) | Turns WINDOW_PALETTE's white, black, window colours and border greys one grey, and starts the BG0 line scroll (fdMindReadStartRipple) at each VBlank. |
void | fdPsynergyRestoreMindReadPalette (void) | Stops the BG0 line scroll and restores WINDOW_PALETTE. |
Bool | fdHasPsynergyCue (Sint32 group) | Returns whether the scene has a Psynergy cue, in any phase, for Psynergy of group and what the leader faces. |
Uint32 | fdHasItemCue (Uint16 item) | Returns whether the scene has a script for item and what the leader faces. |
struct SPR * | fdSpriteShareVRAMCacheEntry (struct SPR *srcSprite, struct SPR *sharedSprite) | Makes srcSprite share sharedSprite's VRAM block, releasing its own; with no sharedSprite it keeps its block. |
Sint16 | fdBattleBackgroundGetSelected (void) | Returns the battle background chosen for the current scene. |
struct ACTOR * | fdEffectSpawnMoveHand (struct ACTOR *caster) | Spawns Move's hand (SPRITE_MOVE_HAND) 16 pixels above the caster, at quarter size, and moves it 16 pixels the way the caster faces (to the nearest quarter turn), with 8 sparkles scattering from it. |
void | fdEffectGrowHandAndWait (struct ACTOR *actor) | Sets an actor's scale at once to full size (its first step of 1/16 past toFIXED(1) - 1: exactly toFIXED(1) from a multiple of 1/16) when it is smaller, then waits, at most 600 ticks, for it to arrive at its target. |
void | fdEffectBurstHand (struct ACTOR *hand) | Ends a hand: over 31 ticks it rises 1 pixel, turns 1/8 turn and shrinks by 1/32 of full size a tick, then bursts into 8 sparkles and is released. |
void | fdPartyAddPp (Sint32 amount, Sint32 unused) | Gives each character in the party amount PP (PP regenerates as the party walks). |
void | fdPartyAddHp (Sint32 amount, Sint32 percent) | Changes each party member's HP by amount, or by that percentage of maximum HP when percent is set. |
Sint32 | fdVRAMCacheCountFreeBlocks (void) | |
Sint32 | fdYesNoAsk (Sint32 atBottom) | Asks yes or no at the top of the screen, or at the bottom with atBottom set. |
Uint16 | fdEncounterGetFormationAtSlot (Sint32 zone, Sint32 slot) | Returns the formation in slot (0 to 7) of zone, read from EncounterZones as halfwords. |
Sint16 | fdEncounterGetDjinnFormation (Sint32 djinni) | Returns the formation of Djinni battle djinni, which the table gives as a zone and slot. |
void | gmPlayMusic (void) | Starts the current scene's field music, chosen by fdChooseMusic. |
void | fdDjinnJoinParty (Sint32 actorId, Sint32 element, Sint32 djinn) | A Djinni joins the party: djinn (0 to 19) of element goes to the party member with the fewest Djinn, or to no one and only its flag while FLAG_DJINN_LESSON is set. |
void | fdParticleUpdate (FIELD_PARTICLE *effect) | Updates one field effect sprite: counts its age, runs its callback (after any delay), moves it and draws it. |
Uint32 | fdParticleHasPendingTarget (FIELD_PARTICLE *effect) | Returns 1 while a field effect sprite that stops at its target still has one (it has not arrived), 0 once it has arrived or when it never stops. |
void | fdParticleSetPos (FIELD_PARTICLE *effect, Sint32 x, Sint32 z) | Places a field effect sprite at (x, z), at rest with no target. |
void | fdParticleSetAnimation (FIELD_PARTICLE *effect, Sint32 mode) | Sets the animation of a field effect sprite. |
void | fdParticleSetCallback (FIELD_PARTICLE *effect, EFFECT_CALLBACK callback) | Gives a field effect sprite its per-tick callback, starting at state 0. |
void | fdParticleInit (FIELD_PARTICLE *effect, Sint32 kind, Sint32 x, FIXED z) | Gives a field effect sprite a new sprite of kind at (x, z): stopping at its target, top speed 2, acceleration and scale 1, drawn, animation 1. |
void | fdParticleFree (FIELD_PARTICLE *effect) | Frees a field effect sprite and its sprite, clearing it to zero (inactive). |
void | fdCameraWorldToScreen (struct VECTOR3 *pos) | Converts a world position (16.16 pixels) to the screen: x and z receive the screen's x and y and y becomes 0. |
Sint32 | fdSpeakerGetVoice (Uint32 spriteId) | Returns the voice of sprite spriteId's messages: the first of its four blip sounds, SE_VOICE_FIRST plus its definition's value, or 0 for none (SPEAKER_VOICE_NONE) or with the Speech option off (MainRoutineStateWork.speech). |
void | fdPartyClearUnusableShortcuts (void) | Clears each button shortcut whose Psynergy can no longer be cast: zeroes MainRoutineStateWork.firstShortcut or secondShortcut. |
void | fdEffectInitSlots (void) | Allocates and clears the field effect sprites (HEAP_SLOT_FIELD_EFFECT) and starts their update event. |
void | fdEffectReleaseSlots (void) | Stops the field effect sprites: removes their event, frees every slot still in use and releases their heap block, FieldEffectStateWork with it. |
void | fdActorClearOutOfBounds (void) | Releases the placed actors far from the view's centre: more than 160 pixels to either side, 200 pixels north or 100 pixels south. |
void | fdActorRespawn (void) | Releases every placed actor and places the scene's actors again from its first actor placement table after the leader's. |
void | fdActorLaunchFromLeader (Uint32 actorId, Sint32 xOffset, Sint32 zOffset, Sint32 facing) | Places an actor on the leader and sends it walking (xOffset, zOffset) pixels away at speed 0.6 and acceleration 0.3; once there, the launch script turns it to face facing. |
void | fdActorWalkByById (Uint32 actorId, Sint32 xOffset, Sint32 zOffset) | Walks the actor (xOffset, zOffset) pixels from where it stands. |
void | fdActorWalkByAndWaitById (Uint32 actorId, Sint32 xOffset, Sint32 zOffset) | Walks the actor (xOffset, zOffset) pixels, waits for it to arrive and stands it still. |
void | fdActorWatchAndSetScript (Uint32 actorId, Uint32 watchedActorId) | Makes an actor follow another (the watched actor script): writes its watchedActor. |
void | fdPsynergyHaltActor (Sint32 actorId) | Halts actorId, keeping its per-tick update and, if it is animated, its first animation's colour mode in MainRoutineStateWork. |
void | fdPsynergyResumeHaltedActor (Sint32 actorId) | Resumes actorId with the update and colour mode fdPsynergyHaltActor kept. |
Sint32 | fdActorFindBySprite (Sint32 sprite) | Returns the first of the scene's actors (ACTOR_FIRST_PLACED to ACTOR_LAST_ID) showing sprite, or -1. |
Sint32 | fdActorGetSpriteById (Sint32 actorId) | Returns the sprite (the first animation's id) of the actor in the low 12 bits of actorId, or -1 if there is no such animated actor. |
void | fdActorSnapshot (void) | Saves up to 32 actors (only the party's 8 on the World Map) into ActorSnapshotWork, with each one's slot, animation, sprite flags and priority, so that fdActorRestore can put them back. |
void | fdActorRestore (void) | Puts back the actors fdActorSnapshot saved, and moves the camera to the party leader's height. |
void | fdWorldMapStartZoom (FIXED zoom, Sint32 ticks) | Starts a zoom to zoom (16.16) over ticks ticks, on the World Map only. |
void | fdScriptWaitForZoomTransition (void) | Waits for a zoom transition to end (on the World Map only, at most 300 ticks). |
Sint32 | fdAreaGetNameIndex (Sint32 sceneId, Sint32 entrance) | Returns the area name of sceneId and entrance, from the first rule matching the scene or its area; 0, the Title's name, when none does. |
void | fdActorSetMovementType (struct ACTOR *actor, Sint32 movement) | Starts an actor's movement type: an MOVEMENT_TYPE, or any other value as the actor script to run itself. |
void | fdQueueMusic (Sint32 soundId) | Changes the scene's music to soundId and remembers it for fdPlayQueuedMusic; -1 fades the music out and remembers none. |
void | fdPlayQueuedMusic (void) | Plays the sound fdQueueMusic remembered, if any. |
Sint32 | fdPartyGetCharacterSpriteForChildhood (Sint32 character, Sint32 childhood) | Returns the sprite of character as fdPartyGetCharacterSprite would with FLAG_CHILDHOOD set to childhood (as recorded in a save file's summary). |
void | fdEffectReleaseRevealSparkles (void) | While Reveal is active, releases all its sparkles, leaving its marks. |
void | fdEncounterSelectMapZones (Sint32 useRules) | Chooses the current scene's encounter zones, one for each kind of ground the party can stand on (FieldStateWork->encounterZones, read by fdEncounterRollMapStep), from the first rule matching the scene and entrance. |
Sint32 | fdEncounterResolveWorldMapZoneAndBackdrop (void *pos) | Returns the World Map encounter zone for the ground at pos (0 for none), and chooses the battle background for its battle environment (MainRoutineStateWork.battleBg). |
Sint32 | fdEncounterCountStepsAndSelectFormation (Sint32 zone, FIXED steps) | Advances the encounter counter for zone and returns the formation to fight (a row of formations.c), or 0 for no battle. steps (16.16) scales how far the counter moves; a battle starts once it reaches encounterThreshold. |
Sint32 | fdEncounterRollMapStep (Uint32 terrain, FIXED steps) | Rolls a random battle on the encounter zone of the ground underfoot. terrain: the ground, an index into state->encounterZones: 0 for ordinary ground, 1 and 2 for METATILE_BEHAVIOR_ENCOUNTER_GROUND_A and _B metatiles. steps: the step weight, passed on to fdEncounterCountStepsAndSelectFormation. |
Sint32 | fdEncounterRollWorldMap (Sint32 pos, FIXED steps) | Rolls a random battle on the World Map, taking the zone from the metatile at pos. |
void | fdChooseMusic (void) | Chooses the current scene's field music (MainRoutineStateWork.sound) from the first rule matching the scene or its area and the entrance; SOUND_KEEP_BGM when none does. |
void | fdSetRestartPoint (void) | Sets the scene the party returns to after a defeat (MainRoutineStateWork.restartScene and restartEntrance), from the first rule of SceneRestartRules that matches the current scene and entrance: {scene, entrance (-1 for any), return scene, return entrance}, ended by scene -1. |
void | fdBattleBackgroundSelectForMap (void) | Chooses the battle background for the current scene. |
void | fdBattleBackgroundSelectForEnvironment (Sint32 behavior) | Chooses the battle background for a World Map battle environment (enum BATTLE_ENVIRONMENT; any other gives Sol Sanctum's) and sets MainRoutineStateWork.battleBg. |
void | fdEncounterSelectBattleMusic (Sint32 zone, Sint32 slot) | Chooses the battle music for slot of zone (MainRoutineStateWork.battleMusic). |
void | fdEffectShrinkActorAndDestroySlow (struct ACTOR *actor) | Spins an actor an eighth of a turn and shrinks it by 7/1024 of its size a tick, then releases it: 119 ticks from full size. |
void | fdEffectShrinkActorAndDestroyFast (struct ACTOR *actor) | Spins an actor an eighth of a turn and shrinks it by 1/64 of its size a tick, then releases it: 53 ticks from full size. |
void | fdPsynergyLift (void) | Two hands appear 16 pixels above the spot in front of the caster, 32 pixels to either side, then close in 24 pixels and clap, and sparkles scatter. |
void | fdPsynergyCarry (void) | When Carry is cast with no target, two hands appear 16 pixels above the spot in front of the caster and 32 pixels to either side, close in 24 pixels and clap, and sparkles scatter. |
Sint32 | fdActorFindLastActiveId (void) | Returns the slot after the last placed actor (8 when there is none), or -1 when the last slot is occupied. |
void * | fdActorGetSlotAddress (Uint32 actorIndex) | Unused: returns the address of actor slot index in the field state. |
void | fdActorClearAll (void) | Empties all the actor slots, without releasing the actors. |
void | fdClearRequests (void) | Clears the field's twelve pending requests (see FIELD_STATE). |
Sint32 | fdCountRequests (void) | Returns the sum of the field's twelve pending requests (counting the talk request twice): non-zero while any request is pending. |
Sint32 | fdGetCollisionAheadOfLeader (void) | Returns the metatile behavior of the map metatile 16 pixels ahead of the party leader (a World Map metatile's tiles on the World Map), or 0 without a leader. |
void | fdCheckExitRegions (FIXED posX, FIXED posY, FIXED posZ) | Takes the exit of the first of the scene's exit regions that contains the position (x, y, z), in 16.16 pixels, and whose condition holds: records the region's exit value for fdEngineRun, plays the exit sound and starts leaving the scene. |
void | fdUpdateWalking (Sint32 layer, FIXED x, FIXED y, FIXED z) | Handles one tick of the party leader's walking onto the metatile at (x, y, z) of map grid layer: records step cues and push metatiles, takes exits, and while walking advances the encounter counter, regenerates PP, hurts the party with poison and hazardous ground, and wears Avoid off. |
Sint32 | fdPartyApplyPoisonDamage (void) | Hurts each poisoned character in the party: poison takes a twentieth of their maximum HP and deadly poison a tenth, rounded to the nearest and at least 1. |
void | fdApplyEntrance (void) | Places the party at the entrance it came in by (the first matching entry, or the scene's first one) unless it keeps its position, and sets the map's scroll bounds, at least a screen (240 x 160 pixels) wide and tall. |
void | fdPaletteEditorRun (void) | The debug palette editor (L on the Pause menu in debug mode). |
struct ACTOR_PLACE * | fdFindActorPlacement (Sint32 id) | Returns the actor placement of actor id in the scene's actor placement tables, or NULL: for a party character (0 to 7) the row with its sprite, and for a placed actor (8 on) the row it was created from, counting the placed rows in order. |
Sint32 | fdGameFlagIsConditionActive (Sint32 condition) | Returns whether a script condition holds: -1 always holds; a condition with CONDITION_FLAG_SET holds while that flag is set, any other while its flag is clear. |
Uint32 | fdExamineCueIgnoresCondition (Sint32 flags, Sint32 result) | Returns 1 for an examine cue (CUE_EXAMINE) that holds whatever its condition: one with more flags than its kind, unless its result is a mimic battle (FIND_MIMIC). |
const struct CUE * | fdFindCue (Sint32 kind, Sint32 target) | Returns the first of the scene's cues of kind for target whose condition holds, or NULL. |
void | fdOverlayCallInit (void) | Unused: runs the loaded overlay's initialize entry. |
const struct CUE * | fdFindActorTalkCue (Sint32 id) | Returns the talk cue of actor id, or 0: for the actor stopped with Halt (MainRoutineStateWork.haltedActor), its CUE_TALK_HALTED script if it has one, the script for talking to it while it is stopped (Crossbone Isle's Bane has one). |
Sint32 | fdTalkToActor (Sint32 id) | Talks to actor id: shows its script's message or calls its script function, with the actor stopped and turned as its placement says. |
Sint32 | fdRunRaisedCue (Sint32 value) | Runs the scene's raised cue (CUE_RAISED) for value: its message or its function. |
Sint32 | fdRunStepCueOrExit (Sint32 value) | Runs the step cue (CUE_STEP) of what the leader touched, or else takes its exit (CUE_EXIT): plays the exit's sound (and effect) and records where it leads. |
Sint32 | fdRunPushMetatile (Sint32 behavior) | Runs the script of a metatile the leader pushes against (METATILE_BEHAVIOR_LEDGE to METATILE_BEHAVIOR_JUMP_FORWARD, and METATILE_BEHAVIOR_JUMP_FORWARD_UNREACHED), once it has pushed for more than FIELD_PUSH_TICKS ticks; the count then restarts. |
Sint32 | fdExamineMetatile (Sint32 tile) | Searches the metatile ahead with the given metatile behavior. |
Sint32 | fdGetPsynergyTargetRange (Sint32 kind) | Returns how far, in pixels, a field Psynergy of the given kind reaches: FieldEffectTargetRangeByMode (field_engine_tables.c) pairs kinds with ranges, ended by -1. |
Sint32 | fdFindNearbyTalkTarget (Sint32 id) | Returns the actor nearest to actor id that it could talk to, or -1: within 48 pixels of height and 32 pixels of distance (an ACTOR_NEAR_TALK actor's counted ten thirteenths) and, beyond 11 pixels, within 3/16 of a turn (67.5 degrees) of the direction it faces. |
Sint32 | fdFindNearbyPsynergyTarget (Sint32 id, Sint32 kind) | Returns the actor nearest in front of actor id that a field Psynergy of the given kind can reach, or -1: within its range (an ACTOR_NEAR_PSYNERGY actor's counted two thirds), within 8 pixels of height (more for Catch, Douse and Mind Read) and, beyond 11 pixels, within a cone either side of its facing's quarter turn, narrower beyond 19 pixels and wider for Mind Read. |
void | fdActorSetLayersColorMode (struct ACTOR *actor, Sint32 colorModePlusOne) | Gives each running layer of an actor's one sprite the colour mode colorModePlusOne - 1 (SPRITE_COLOR_NORMAL for 1), or for 0 the next of Mind Read's caster cycle, a mode every 2 ticks; a hidden layer stays hidden. |
const struct CUE * | fdFindItemCue (Sint32 item) | Returns the scene's item cue (CUE_ITEM) for item that applies to what the leader faces, or 0 (item 0 matches any item). |
Sint32 | fdUseItem (Sint32 packedItem, Sint32 slot) | Uses an item on the field. packedItem holds the item (bits 0 to 9) and the character using it (bits 10 to 13; UNIT_NONE for whoever holds it in the most inventory slots); slot is its inventory slot. |
void * | fdFindPsynergyCue (Sint32 eventFlags, Sint32 group, Sint32 *target) | Returns the scene's Psynergy cue (CUE_PSYNERGY) for Psynergy of the given group that applies to what the leader faces, or NULL; stores the actor the Psynergy would target in *target. eventFlags gives the script's phase and kind (PSYNERGY_CUE_ANY for any phase). |
Sint32 | fdUsePsynergy (Uint32 code) | Uses Psynergy on the field. code holds the Psynergy (bits 0 to 9), its user (bits 10 to 13; UNIT_NONE for ISAAC) and ACT_PACKED to use it without paying PP. |
void | fdActorSnapToTerrain (void *object) | Sets an actor's y and groundHeight to the map's height at its x and z. |
void | fdPlaceTreasureSpots (void) | Places an actor at each of the map's treasure spots (ids 100 to 239) that the scene has a script for, up to ten: a chest for a chest script, shown open once its flag is set and gone once its mimic was beaten, and a Psynergy Stone for an examine cue giving one, until it is taken. |
Sint32 | fdTreasureSpotFindSlot (Sint32 id) | Returns the treasure spot slot (below TREASURE_SPOT_MAX) whose script cue is id, or -1. |
void | fdTreasureSpotReservedNoOperation (void) | Unused: empty. |
void | fdTreasureSpotLaunchMimic (Sint32 id) | Makes the chest of treasure spot id jump up as a mimic: after 18 ticks it turns into the mimic with a cry (SE_ENEMY_CRY) and leaps up at 8 pixels a tick, its shadow showing. |
void | fdItemDisplayEmitSparkles (struct ACTOR *actor) | Each tick of a found item's picture: one time in ten, a sparkle appears within 16 pixels of it. |
struct ACTOR * | fdItemDisplayShowItemInFront (Sint32 actorId, Sint32 item) | Shows the picture of item (0 for none) at the centre of the metatile 16 pixels in front of character actorId, at a height of 16 pixels whatever the actor's, with sparkles. |
void | fdActorReleaseIfPresent (void *object) | Releases object unless it is NULL. |
void | fdItemDisplayRaiseAboveLeader (struct ACTOR *actor) | Raises a found item's picture to 36 pixels above the party leader, who holds it up (ANIM_LEADER_ARMS_RAISED) facing the screen. |
void | fdRevealEmitSparkles (struct ACTOR *actor) | Each tick of a Reveal marker: one time in ten, a sparkle appears within 16 pixels of it. |
void | fdEffectSpawnRevealMarkers (void) | Reveal: marks with sparkles the hidden things within 8 metatiles left or right and 5 up or down of the leader: treasure spots (ids 100 to 239) with no actor placed, whose examine cue (CUE_EXAMINE) gives an item, coins, a Psynergy Stone or a mimic and whose flag is not yet set. |
void | fdScreenTransitionStartWindowHBlankDMA (void) | Each VBlank, before drawing: turns windows 0 and 1 on, writes the first four values of the shown page into WININ, WINOUT, WIN0H and WIN1H, and has DMA 0 copy the rest into WIN0H and WIN1H one word each HBlank, so that every line of the screen gets its own window edges. |
void | fdScreenTransitionUpdateScanlineTable (void) | Each tick of a window transition: advances its value toward its end (and at the end turns the windows off, or moves to the next mode), then builds the next page of window edges, WININ and WINOUT first and then a (left << 8 | right) pair for each of the 160 lines. |
void | fdScreenTransitionSuspendCallbacks (void) | Unused: suspends the window transition's two events. |
struct SCREEN_TRANSITION_STATE * | fdScreenTransitionAllocateAndClearState (void) | Allocates the screen transition state (HEAP_SLOT_SCREEN_TRANSITION) and clears it. |
void | fdScreenTransitionUpdate (void) | Each tick of the centre-line transition: moves the value toward its end and sets the two lines where the screen switches between shown and blank. |
void | fdScreenTransitionUpdateFromCenter (void) | As fdScreenTransitionUpdate, but the lines flicker every other tick. |
void | fdScreenTransitionUpdateScanline (void) | The HBlank interrupt of the centre-line transition: switches the display to DISPCNT_MODE_2 (nothing shown) at the first line and back to DISPCNT_MODE_0 at the second. |
void | fdScreenTransitionUpdateDissolve (void) | Unused, as no scene dissolves. |
void | fdScreenTransitionFillTilemapAndColorTile (Sint32 color) | Unused, as the dissolve is: fills background screen block 4 with tile 0 in WINDOW_PALETTE and, unless color is -1, makes tile 0 solid color. |
void | fdPaletteFadeUpdate (void) | Each tick (unless FLAG_PALETTE_BLEND_HELD is set): moves the palette fade one step toward its target, packs it into RGB555 and queues it for the BG and OBJ palettes. |
void | fdPaletteFadeBuild () | Builds palette fade colours from the palette src into dest, three channels a colour. mode is one RGB555 colour, below PALETTE_TINT_FROM_SOURCE, for every colour alike; PALETTE_TINT_FROM_SOURCE for the backdrop colour alike; a PALETTE_TINT_* value to tint each colour; or the address of ready channels to copy. half is the palette selection: PALETTES_ALL for all 448 colours, PALETTES_BG for the BG's 224, PALETTES_SPRITES for the OBJ's 224. |
Sint32 | fdPaletteFadeClampChannel (Sint32 value) | Clamps a 5-bit colour channel to 0 to 31. |
Sint32 | fdPaletteFadeClampShiftedChannel (Sint32 value) | Clamps a colour channel in its place (bits 14..10) to at most the brightest level. |
void | fdGroundMaskDrawMarks (void) | Each tick of the ground mask: on each of the two metatiles beside the actor (left and right of it), where the ground one or two metatiles south rises above the actor's floor, draws a semi-transparent 16-pixel-wide sprite of colour 1 at the height of that ground, which hides what of the actor is below that ground's edge. |
const struct SPEAKER_DEFINITION * | fdSpeakerFindDefinition (Uint32 id) | Returns the speaker definition of sprite id from SpeakerDefinitions, or its last entry, the default, when there is none. |
Sint32 | fdSpeakerGetActorSprite (Sint32 id) | Returns the sprite id actor id shows, its one sprite's first animation's, or 0 when it shows no single sprite or that animation is absent. |
Sint32 | fdSpeakerGetHaltedLines (Sint32 id) | Returns SPEAKER_DEFINITION.haltedLines of actor id's sprite: the pair of lines fdTalkToActor gives it while Halted, or SPEAKER_HALTED_LINES_NONE when Halt passes it over (fdPsynergyFilterHaltTarget). |
Description
The field-engine module's functions, declared in the order of its stub table.
field_engine.h includes it for everyone else.
Functions in detail
fdVRAMCacheCountFreeBlocks
Sint32 fdVRAMCacheCountFreeBlocks(void)
Referenced by fdPsynergyLoadResources() and void().
Definition at line 219 of file field_engine_functions.h.