struct MAIN_ROUTINE_STATE
The game's blocks the system library's RAM holds, complete here so that each variable globals.h declares has its whole type. More…
Declared in definitions.h.
Fields
| Name | Description | |
|---|---|---|
Uint32 | buildStamp | gmBuildStampGetTime's value when the game was last saved; 0 on a new game. |
Uint32 | playTime | Ticks. |
Uint8 | unused [4] | |
Uint32 | summonMask | The summons the party can call, bit n for summon n: the first word of the party's DJINN_RECOVERY_TABLE, which gmDjinnGetRecoveryTable returns from here, its next word running over coins. |
Uint32 | coins | At most COIN_MAX (gmPartyAdjustCoins). |
Uint8 | djinnRecovery [292] | The party's Djinn recovery list (DJINN_RECOVERY_TABLE from its offers on), read through gmDjinnGetRecoveryTable. |
Sint32 | shopCredit | Shop credit, at most COIN_MAX (gmPartyAdjustShopCredit). |
Sint8 | shopGifts | Shop gifts, 0 to SHOP_GIFTS_MAX (gmPartyAdjustShopGifts). |
Uint8 | prizeWeights [15] | The weights of the spring game's 15 prizes: three each of 4, 8, 16, 32 and 64 on a new game; Lemuria's spring halves a prize's weight each time it is won. |
Sint8 | wheelsPrizes [8] | The icons matched on the Lucky Wheels, a prize each, ended by WHEELS_PRIZES_END, for Contigo's attendant to hand out. |
Sint8 | wheelsPrizeCursors [6] | For each icon, which of its three prizes it gave last (scContigoSelectLuckyWheelsPrize). |
Uint8 | unusedAfterWheelsPrizes [134] | No code names it. |
Sint16 | next | The scene the party is in, or bound for once gmTakeExit has chosen an exit. |
Sint16 | entrance | Its entrance, a number of that scene's entrance list. |
Uint16 | restartScene | Where a defeat returns to without a defeat point. |
Uint16 | restartEntrance | Where a defeat returns to without a defeat point. |
Sint16 | returnScene | The default scene: the fallback of both destinations. |
Sint16 | returnEntrance | The default entrance: the fallback of both destinations. |
Sint16 | area | The current scene's group; a new group resets its state. |
Uint16 | afterBattleScene | The after-battle destination, -1 for none: read by gmReturnFromEngine when the party was not defeated, before the default scene and entrance. |
Uint16 | afterBattleEntrance | Its entrance; -1 for none. |
Uint16 | defeatScene | The defeat destination, -1 for none: read by gmReturnFromEngine after a defeat. |
Uint16 | defeatEntrance | Its entrance; -1 for none. |
Sint16 | battleBg | The battle background chosen for the |
Uint8 | unusedAfterBg [2] | scene or terrain. |
Sint16 | mapId | The current scene's map, a row of MapsWork. |
FIXED | x | The leader's position in 16.16 pixels and facing (an angle), set from the entrance taken and noted again each time the field handles a request. |
FIXED | y | |
FIXED | z | |
Sint32 | heading | |
Uint16 | layer | The leader's layer; 0 on taking an entrance. |
Sint16 | battleMusic | The battle music chosen for the encounter. |
Sint16 | sceneMusic | The current scene's field music. |
Uint8 | movementMode | How the leader moves, an LEADER_MOVEMENT_MODE. |
Sint32 | leaderActorId | The leader. |
Uint8 | party [8] | The party in order. |
Uint8 | unusedAfterParty [5] | No code names it. |
Uint8 | windowHue | The "Window color" setting (option 0). |
Uint8 | windowBrightness | The "Window brightness" setting (option 1). |
Uint8 | unusedAfterBrightness [3] | |
Uint8 | speech | Option 3, on or off; 1 on a new game. |
Uint8 | unusedAfterSpeech | 1 on a new game; nothing reads it. |
Uint8 | msgSpeed | Option 2, the message speed, 0 to 2: 1 on a |
Uint8 | unusedAfterMsgSpeed [2] | new game; some scenes set 2 and restore it after. |
Uint8 | sendFlag | Set on saving at the end of the game, marking the file cleared: its data can be sent. |
Uint16 | aKeys | Examine; KEY_A. |
Uint16 | bKeys | KEY_B; held with aKeys, it makes flight climb. |
Uint16 | selectKeys | The menu; KEY_SELECT. |
Uint16 | startKeys | KEY_START. |
Uint16 | firstShortcutKeys | KEY_L. |
Uint16 | secondShortcutKeys | KEY_R. |
Uint16 | dashKeys | KEY_B. |
Sint16 | returnMusic | The music to play on returning, -1 for the scene's own. |
Uint16 | firstShortcut | The shortcuts' assignments, run by |
Uint16 | secondShortcut | firstShortcutKeys and secondShortcutKeys (mnPsynergyMenuSetShortcut: kind << 10 | id). |
Uint8 | perspectiveMap | Set to 1 on the world map. |
Uint8 | unusedAfterPerspective [5] | |
Uint8 | idleSleepEnabled | Option 4, Auto-Sleep, saved from IdleSleepEnabled. |
Uint8 | battleType | An BATTLE_TYPE, set back to BATTLE_TYPE_NORMAL at the end. |
Sint16 | hazardLimit | Hazardous ground: when hazardSteps reaches hazardLimit the party takes hazardDamage and the count starts again. |
Sint16 | hazardMode | |
Sint16 | hazardDamage | |
Uint16 | hazardSteps | Reset on entering a new scene group. |
Sint16 | pendingDjinni | The Djinni battle pending (DJINNI_BATTLE_SCRIPT_FIRST plus its number, flags in bits 15 to 11), or a Mimic's flag with CONDITION_FLAG_SET, resolved on returning to the field. |
Sint16 | engineResult | The last battle's result: the enemies defeated, BATTLE_OUTCOME_FLED or BATTLE_OUTCOME_LOST. |
Sint32 | encounterSteps | Reset on entering a new scene group. |
Uint16 | pendingItem | Cleared with the battle's spoils; no code reads it by name. |
Sint16 | sceneType | The current scene's SCENE_TYPE. |
Sint16 | retreatScene | Where Retreat goes; the group's first entrance. |
Sint16 | retreatEntrance | Where Retreat goes; the group's first entrance. |
FIXED | avoidDistance | Distance left of Avoid, 16.16 pixels; 0 when off. |
Sint8 | avoidByItem | Avoid came from an item (FLAG_PSYNERGY_FROM_ITEM). |
Uint8 | pausedColorMode | The paused object's first animation param. |
Sint16 | haltedActor | The object field Psynergy has stopped, -1 for none. |
Sint8 | sandActive | Nonzero while the leader is sand (fdPsynergySand): ending the pending actions ends Sand too, and the field's push and button handler idles. |
Sint8 | cloaked | Cloak: the leader is hidden. |
Uint8 | unusedAfterCloaked [2] | |
void * | pausedUpdate | The paused object's update, restored on resuming. |
Uint8 | weirdAnswers | The weird answers Felix gives, counted up by fdScriptCountAnswer from 0 on a new game: telling Kraden on Idejima that the Western Sea is not where they go, agreeing with Alhafra's mayor that the party owes him, and others. |
Sint16 | ownerOverride | Nonzero makes actor 8, not leaderActorId, the one scripts control. |
Sint32 | shipX | The ship's x on the world map, where it is moored. |
Sint32 | shipZ | The ship's z on the world map. |
Sint32 | shipFacing | The ship's facing on the world map. |
Uint8 | unusedAfterShipFacing [2] | No code names it. |
Uint8 | clearedFileAtStart | AnyFileCleared as the new game began (gmMainRoutineStateInitDefaults): 1 when a file on the cartridge had been cleared. |
Uint8 | difficulty | The level chosen from a cleared game (Difficulty). |
Uint8 | unusedAfterDifficulty [4] | No code names it. |
Sint32 | transferredCoins | The Broken Seal's coins, kept from the data transfer (gmDataTransferApply) until Isaac's party joins and gmPartyAddIsaacsParty adds them. |
Uint8 | unusedAfterTransferredCoins [44] | No code names it. |
Uint16 | forgeItem | The item left at the forge (mnForgeSetItem). |
Sint16 | teleportScene | Teleport's destination: SCENE_WORLD_MAP once a place is chosen on the map screen (fdMapScreenShow), -1 after cancelling. |
Sint16 | teleportEntrance | The chosen place's flag, which the world map takes as its entrance; -1 after cancelling. |
Sint8 | teleportState | An TELEPORT_STATE: the scene the party lands in plays the arrival and clears it. |
Sint8 | onUpperLevel | Set while the leader stands on the upper level of the Alhafran Cave, where Sand ends; cleared on entering a scene. |
Uint16 | linkTallies [8] | The Link Lobby's records |
Uint8 | unusedAfterTallies [4] | (LINK_TALLY): the wins, losses, best streak and current streak of its monster battles, then the same four of its battles against another player. |
Uint32 | startStamp | gmBuildStampGetTime's value at a |
Uint8 | unusedAfterStartStamp [4] | new game. |
Description
The game's blocks the system library's RAM holds, complete here so that each
variable globals.h declares has its whole type. MainRoutineStateWork, the
state a save file keeps: play time, coins, the scene and the leader's
position, the active party and the options.
struct MAIN_ROUTINE_STATE
Referenced by btDebugBattleRunMenu(), fdActorStartMovementModeScript(), fdDjinnResolvePending(), fdDjinnRestoreActorAfterBattle(), fdEncounterResolveWorldMapZoneAndBackdrop(), fdEngineRun(), fdFindActorTalkCue(), fdGetPartyActor(), fdLeaderStepOntoTightrope(), fdMapScreenShow(), fdPartyApplyPoisonDamage(), fdPartyGetLeaderActor(), fdPlaceAtEntrance(), fdPsynergyDispatch(), fdPsynergyRun(), fdPsynergyWatchSandGround(), fdScriptEnd(), fdScriptSetRestartPoint(), fdScriptStart(), fdSetRestartPoint(), fdTightropeUpdate(), fdUsePsynergy(), fdWorldMapZoomOutWhileLHeld(), gmClearDataApply(), gmDataTransferApply(), gmPartyAdjustCoins(), gmPartyTakeFallDamage(), KNOCK_BACK(), MainRoutineStateWork, mnAreaNameWindowShow(), mnDebugShortcutRun(), mnDebugWarpArafura2(), mnDebugWarpArafura3(), mnDebugWarpChampa2(), mnPsynergyMenuSetShortcut(), scAirsRockWhirlwindClearsWall(), scAnemosInnerSanctumDullahanStepWhilePushing(), scAquaRockArriveFromInside(), scAquaRockDropDownFalls(), scAttekaInletSetUpTheHarbor(), scCavernsJumpAcross(), scClearEnterPassword(), scClearIsRetreatBlocked(), scClearReceiveByLink(), scContigoSelectLuckyWheelsPrize(), scEffectAdvanceMotionAtLeaderPriority(), scGabombaStatueChamberInitIdol(), scGabombaStatueEndRide(), scGaiaRockInsidePlaceDollOnEntranceAltar(), scGetCues() and 40 more.
Definition at line 1350 of file definitions.h.
Fields in detail
buildStamp
Uint32 buildStamp
gmBuildStampGetTime's value when the
game was last saved; 0 on a new
game.
playTime
Uint32 playTime
Ticks.
unused
Uint8 unused[4]
summonMask
Uint32 summonMask
The summons the party can call, bit
n for summon n: the first word of
the party's DJINN_RECOVERY_TABLE,
which gmDjinnGetRecoveryTable
returns from here, its next word
running over coins.
coins
Uint32 coins
At most COIN_MAX
(gmPartyAdjustCoins).
djinnRecovery
Uint8 djinnRecovery[292]
The party's Djinn recovery list
(DJINN_RECOVERY_TABLE from its
offers on), read through
gmDjinnGetRecoveryTable.
shopCredit
Sint32 shopCredit
Shop credit, at most COIN_MAX
(gmPartyAdjustShopCredit).
shopGifts
Sint8 shopGifts
Shop gifts, 0 to SHOP_GIFTS_MAX
(gmPartyAdjustShopGifts).
prizeWeights
Uint8 prizeWeights[15]
The weights of the spring game's 15 prizes: three each of 4, 8, 16, 32 and 64 on a new game; Lemuria's spring halves a prize's weight each time it is won.
wheelsPrizes
Sint8 wheelsPrizes[8]
The icons matched on the Lucky
Wheels, a prize each, ended by
WHEELS_PRIZES_END, for Contigo's
attendant to hand out.
wheelsPrizeCursors
Sint8 wheelsPrizeCursors[6]
For each icon, which of its three
prizes it gave last
(scContigoSelectLuckyWheelsPrize).
unusedAfterWheelsPrizes
Uint8 unusedAfterWheelsPrizes[134]
No code names it.
next
Sint16 next
The scene the party is in, or bound
for once gmTakeExit has chosen an
exit.
entrance
Sint16 entrance
Its entrance, a number of that scene's entrance list.
restartScene
Uint16 restartScene
Where a defeat returns to without a defeat point.
restartEntrance
Uint16 restartEntrance
Where a defeat returns to without a defeat point.
returnScene
Sint16 returnScene
The default scene: the fallback of both destinations.
returnEntrance
Sint16 returnEntrance
The default entrance: the fallback of both destinations.
area
Sint16 area
The current scene's group; a new group resets its state.
afterBattleScene
Uint16 afterBattleScene
The after-battle destination, -1 for
none: read by gmReturnFromEngine
when the party was not defeated,
before the default scene and
entrance.
afterBattleEntrance
Uint16 afterBattleEntrance
Its entrance; -1 for none.
defeatScene
Uint16 defeatScene
The defeat destination, -1 for none:
read by gmReturnFromEngine after a
defeat.
defeatEntrance
Uint16 defeatEntrance
Its entrance; -1 for none.
battleBg
Sint16 battleBg
The battle background chosen for the
unusedAfterBg
Uint8 unusedAfterBg[2]
scene or terrain.
mapId
Sint16 mapId
The current scene's map, a row of
MapsWork.
x
FIXED x
The leader's position in 16.16 pixels and facing (an angle), set from the entrance taken and noted again each time the field handles a request.
y
FIXED y
z
FIXED z
heading
Sint32 heading
layer
Uint16 layer
The leader's layer; 0 on taking an entrance.
battleMusic
Sint16 battleMusic
The battle music chosen for the encounter.
sceneMusic
Sint16 sceneMusic
The current scene's field music.
movementMode
Uint8 movementMode
How the leader moves, an
LEADER_MOVEMENT_MODE.
leaderActorId
Sint32 leaderActorId
The leader.
party
Uint8 party[8]
The party in order.
unusedAfterParty
Uint8 unusedAfterParty[5]
No code names it.
windowHue
Uint8 windowHue
The "Window color" setting (option 0).
windowBrightness
Uint8 windowBrightness
The "Window brightness" setting (option 1).
unusedAfterBrightness
Uint8 unusedAfterBrightness[3]
speech
Uint8 speech
Option 3, on or off; 1 on a new game.
unusedAfterSpeech
Uint8 unusedAfterSpeech
1 on a new game; nothing reads it.
msgSpeed
Uint8 msgSpeed
Option 2, the message speed, 0 to 2: 1 on a
unusedAfterMsgSpeed
Uint8 unusedAfterMsgSpeed[2]
new game; some scenes set 2 and restore it after.
sendFlag
Uint8 sendFlag
Set on saving at the end of the game, marking the file cleared: its data can be sent. Copied to the file's summary as sendFlag.
aKeys
Uint16 aKeys
Examine; KEY_A.
bKeys
Uint16 bKeys
KEY_B; held with aKeys, it makes flight climb.
selectKeys
Uint16 selectKeys
The menu; KEY_SELECT.
startKeys
Uint16 startKeys
firstShortcutKeys
Uint16 firstShortcutKeys
secondShortcutKeys
Uint16 secondShortcutKeys
dashKeys
Uint16 dashKeys
returnMusic
Sint16 returnMusic
The music to play on returning, -1 for the scene's own.
firstShortcut
Uint16 firstShortcut
The shortcuts' assignments, run by
secondShortcut
Uint16 secondShortcut
firstShortcutKeys and secondShortcutKeys
(mnPsynergyMenuSetShortcut: kind << 10 | id).
perspectiveMap
Uint8 perspectiveMap
Set to 1 on the world map.
unusedAfterPerspective
Uint8 unusedAfterPerspective[5]
idleSleepEnabled
Uint8 idleSleepEnabled
Option 4, Auto-Sleep, saved from
IdleSleepEnabled.
battleType
Uint8 battleType
An BATTLE_TYPE, set back to BATTLE_TYPE_NORMAL
at the end.
hazardLimit
Sint16 hazardLimit
Hazardous ground: when hazardSteps reaches hazardLimit the party takes hazardDamage and the count starts again.
hazardMode
Sint16 hazardMode
hazardDamage
Sint16 hazardDamage
hazardSteps
Uint16 hazardSteps
Reset on entering a new scene group.
pendingDjinni
Sint16 pendingDjinni
The Djinni battle pending
(DJINNI_BATTLE_SCRIPT_FIRST plus
its number, flags in bits 15 to
11), or a Mimic's flag with
CONDITION_FLAG_SET, resolved on
returning to the field.
engineResult
Sint16 engineResult
The last battle's result: the
enemies defeated,
BATTLE_OUTCOME_FLED or
BATTLE_OUTCOME_LOST.
encounterSteps
Sint32 encounterSteps
Reset on entering a new scene group.
pendingItem
Uint16 pendingItem
Cleared with the battle's spoils; no code reads it by name.
sceneType
Sint16 sceneType
The current scene's SCENE_TYPE.
retreatScene
Sint16 retreatScene
Where Retreat goes; the group's first entrance.
retreatEntrance
Sint16 retreatEntrance
Where Retreat goes; the group's first entrance.
avoidDistance
FIXED avoidDistance
Distance left of Avoid, 16.16 pixels; 0 when off.
avoidByItem
Sint8 avoidByItem
Avoid came from an item
(FLAG_PSYNERGY_FROM_ITEM).
pausedColorMode
Uint8 pausedColorMode
The paused object's first animation param.
haltedActor
Sint16 haltedActor
The object field Psynergy has stopped, -1 for none.
sandActive
Sint8 sandActive
Nonzero while the leader is sand
(fdPsynergySand): ending the
pending actions ends Sand too,
and the field's push and button
handler idles.
cloaked
Sint8 cloaked
Cloak: the leader is hidden.
unusedAfterCloaked
Uint8 unusedAfterCloaked[2]
pausedUpdate
void *pausedUpdate
The paused object's update, restored on resuming.
weirdAnswers
Uint8 weirdAnswers
The weird answers Felix gives,
counted up by fdScriptCountAnswer
from 0 on a new game: telling
Kraden on Idejima that the
Western Sea is not where they go,
agreeing with Alhafra's mayor
that the party owes him, and
others. Past four, as Felix
answers Ancient Lemuria's guards'
"Do we have your word?", Kraden
says "Sometimes, you can say the
weirdest things..." to a yes and
"Are you INSANE!?" to a no.
ownerOverride
Sint16 ownerOverride
Nonzero makes actor 8, not leaderActorId, the one scripts control.
shipX
Sint32 shipX
The ship's x on the world map, where it is moored.
shipZ
Sint32 shipZ
The ship's z on the world map.
shipFacing
Sint32 shipFacing
The ship's facing on the world map.
unusedAfterShipFacing
Uint8 unusedAfterShipFacing[2]
No code names it.
clearedFileAtStart
Uint8 clearedFileAtStart
AnyFileCleared as the new game
began
(gmMainRoutineStateInitDefaults):
1 when a file on the cartridge
had been cleared. Nothing reads
it back.
difficulty
Uint8 difficulty
The level chosen from a cleared game (Difficulty).
unusedAfterDifficulty
Uint8 unusedAfterDifficulty[4]
No code names it.
transferredCoins
Sint32 transferredCoins
The Broken Seal's coins, kept
from the data transfer
(gmDataTransferApply) until
Isaac's party joins and
gmPartyAddIsaacsParty adds them.
unusedAfterTransferredCoins
Uint8 unusedAfterTransferredCoins[44]
No code names it.
forgeItem
Uint16 forgeItem
The item left at the forge
(mnForgeSetItem).
teleportScene
Sint16 teleportScene
Teleport's destination:
SCENE_WORLD_MAP once a place is
chosen on the map screen
(fdMapScreenShow), -1 after
cancelling.
teleportEntrance
Sint16 teleportEntrance
The chosen place's flag, which the world map takes as its entrance; -1 after cancelling.
teleportState
Sint8 teleportState
An TELEPORT_STATE: the scene the
party lands in plays the arrival
and clears it.
onUpperLevel
Sint8 onUpperLevel
Set while the leader stands on the upper level of the Alhafran Cave, where Sand ends; cleared on entering a scene.
linkTallies
Uint16 linkTallies[8]
The Link Lobby's records
unusedAfterTallies
Uint8 unusedAfterTallies[4]
(LINK_TALLY): the wins, losses,
best streak and current streak of
its monster battles, then the
same four of its battles against
another player.
startStamp
Uint32 startStamp
gmBuildStampGetTime's value at a
unusedAfterStartStamp
Uint8 unusedAfterStartStamp[4]
new game.