Skip to Content
The Alchemy Project

src/window/window_debug.c

The debug menus, none of which the game opens: the sound test, a debug menu of five rows ("Full PP and Money" to "Change of hero"), the warp menu's nine story presets, and the grid of field Psynergy to set as a shortcut. More…

Included by window.c.

Macros

NameDescription
#defineSOUND_TEST_PRESETS 5
#defineDEBUG_SHORTCUT_PP 500The PP the shortcut grid gives Felix, Jenna, Sheba and Piers, full.

Enumerations

NameDescription
enumSOUND_TEST_ROW { SOUND_TEST_MUSIC, SOUND_TEST_JINGLE, SOUND_TEST_SOUND_EFFECT … }The sound test's rows (SOUND_TEST_VALUES.values), and how many sound presets its last row steps through.
enumDEBUG_SHORTCUT_TARGET { DEBUG_SHORTCUT_FIELD, DEBUG_SHORTCUT_L, DEBUG_SHORTCUT_R }What the shortcut grid sets the chosen Psynergy as, by the button that chose it.

Functions

NameDescription
voidmnDebugSoundTestStepCursor (void)The sound test's per-tick event: moves the cursor.
voidmnDebugSoundTestInit (void)Allocates the sound test's state and starts its cursor event.
voidmnDebugSoundTestRelease (void)Stops the sound test's cursor event and frees its state.
WINDOW *mnDebugSoundTestOpen (void)Opens the sound test's window and places the cursor on its first row.
Sint32mnDebugSoundTestRun (void)Unused: the debug sound test.
voidmnDebugMenuStepCursor (void)The debug menu's per-tick event: moves the cursor.
voidmnDebugMenuInit (void)Allocates the debug menu's state and starts its cursor event.
voidmnDebugMenuRelease (void)Stops the debug menu's cursor event and frees its state.
WINDOW *mnDebugMenuOpen (void)Opens the debug menu's window: its five rows, from "Full PP and Money" (MsgFullPpAndMoney) to "Change of hero", with a divider under each.
Sint32mnDebugMenuRun (Sint32 index)Unused: shows the debug menu with the cursor on row index, lets Up and Down move it (wrapping), and returns the row A chooses, or -1 for B.
voidmnDebugWarpJupiter (void)Preset 0, "Jupiter": Felix holds the Red Key and the Blue Key.
voidmnDebugWarpArafura2 (void)Preset 1, "Arafura2": Briggs caught and the mayor at the ship, Alhafra's mast still blocking it; Felix holds the Large Bread.
voidmnDebugWarpEnergySample (void)Preset 2, "Energy Sample": does nothing.
voidmnDebugWarpArafura3 (void)Preset 3, "Arafura3": as Arafura2 with the mast cleared.
voidmnDebugWarpChampa2 (void)Preset 4, "CHAMPA2": the Trident's three prongs, and Briggs sailed from Alhafra.
voidmnDebugWarpKaoruSpecial4 (void)Preset 5, "Kaoru Special4": Moapa met in Shaman Village, his tests passed and beaten on the Trial Road.
voidmnDebugWarpKaoruSpecial3 (void)Preset 6, "Kaoru Special3": the Mars beacon lit and Prox's clan met and grateful, saving barred.
voidmnDebugWarpKaoruSpecial2 (void)Preset 7, "Kaoru Special2": to the Mars Lighthouse aerie.
voidmnDebugWarpKaoruSpecial1 (void)Preset 8, "Kaoru Special1": to the Mars Lighthouse's star room, where the battle with the Flame Dragons returns the party.
voidmnDebugWarpStepCursor (void)The debug warp menu's per-tick event: moves the cursor.
voidmnDebugWarpInit (void)Allocates the debug warp menu's state and starts its cursor event.
voidmnDebugWarpRelease (void)Stops the debug warp menu's cursor event and frees its state.
WINDOW *mnDebugWarpOpen (void)Opens the debug warp menu's window: nine preset names 16 pixels apart, with a divider under each but the last.
Sint32mnDebugWarpRun (Sint32 index)Unused: shows the nine warp presets with the cursor on row index, lets Up and Down move it (wrapping), and returns the row A chooses after running its handler, or -1 for B.
voidmnDebugShortcutStepCursor (void)The shortcut grid's per-tick event: moves the cursor.
voidmnDebugShortcutInit (void)Allocates the shortcut grid's state and starts its cursor event.
voidmnDebugShortcutRelease (void)Stops the shortcut grid's cursor event and frees its state.
voidmnDebugShortcutDrawAbility (Sint32 ability, Sint32 window, Sint32 x, Sint32 y)Draws an ability's name in the shortcut grid; ability 0, an empty place, draws DebugShortcutNoAbilityName.
WINDOW *mnDebugShortcutOpen (void)Opens the shortcut grid's window: the four columns of DebugShortcutAbilities in nine rows, a divider under each row but the last.
Sint32gmPartyFindOwnerWithActionStub (Sint32 action)Returns the first party member who knows Psynergy action, or -1.
Sint32mnDebugShortcutRun (void)Unused: the shortcut grid, drawn by mnDebugShortcutOpen.

Variables

NameDescription
extern const SOUND_TEST_VALUESDebugSoundTestStartValuesThe sound test's starting music, jingle, sound effect and sound preset.
extern const Uint8SoundTestMusicString [], SoundTestJingleString[], SoundTestSeString[], SoundTestPresetString[]The sound test's row labels: music, jingle, sound effect and sound preset.
extern Uint8MsgFullPpAndMoney []
extern const Uint8DebugShortcutNoAbilityName []An empty ability's name, which the debug menu draws.

Description

The debug menus, none of which the game opens: the sound test, a debug menu of five rows ("Full PP and Money" to "Change of hero"), the warp menu's nine story presets, and the grid of field Psynergy to set as a shortcut. Part of window.c.

Macros in detail

SOUND_TEST_PRESETS

#define SOUND_TEST_PRESETS 5

Referenced by mnDebugSoundTestRun().

Definition at line 27 of file window_debug.c.

DEBUG_SHORTCUT_PP

#define DEBUG_SHORTCUT_PP 500

The PP the shortcut grid gives Felix, Jenna, Sheba and Piers, full.

Referenced by mnDebugShortcutRun().

Definition at line 596 of file window_debug.c.

Enumerations in detail

SOUND_TEST_ROW

enum SOUND_TEST_ROW

The sound test's rows (SOUND_TEST_VALUES.values), and how many sound presets its last row steps through.

EnumeratorValueDescription
SOUND_TEST_MUSIC0
SOUND_TEST_JINGLE1
SOUND_TEST_SOUND_EFFECT2
SOUND_TEST_PRESET3
SOUND_TEST_ROWS4

Definition at line 18 of file window_debug.c.

DEBUG_SHORTCUT_TARGET

enum DEBUG_SHORTCUT_TARGET

What the shortcut grid sets the chosen Psynergy as, by the button that chose it.

EnumeratorValueDescription
DEBUG_SHORTCUT_FIELD0A: the field Psynergy to use
DEBUG_SHORTCUT_L1
DEBUG_SHORTCUT_R2

Definition at line 600 of file window_debug.c.

Functions in detail

mnDebugSoundTestStepCursor

void mnDebugSoundTestStepCursor(void)

The sound test's per-tick event: moves the cursor.

References mnCursorAdvanceStub().

Referenced by mnDebugSoundTestInit() and mnDebugSoundTestRelease().

Definition at line 30 of file window_debug.c.

mnDebugSoundTestInit

void mnDebugSoundTestInit(void)

Allocates the sound test's state and starts its cursor event.

References mnDebugSoundTestStepCursor(), syHeapSlotAllocateEWRAM() and sySetEvent().

Referenced by mnDebugSoundTestRun().

Definition at line 38 of file window_debug.c.

mnDebugSoundTestRelease

void mnDebugSoundTestRelease(void)

Stops the sound test's cursor event and frees its state.

References mnDebugSoundTestStepCursor(), syCloseEvent() and syHeapSlotRelease().

Referenced by mnDebugSoundTestRun().

Definition at line 48 of file window_debug.c.

mnDebugSoundTestOpen

WINDOW *mnDebugSoundTestOpen(void)

Opens the sound test's window and places the cursor on its first row.

References mnCursorSetPosImmediateStub(), mnPointingHandLoadIntoFreeSlot(), mnWindowCreate() and mnWindowSpriteCreate().

Referenced by mnDebugSoundTestRun().

Definition at line 55 of file window_debug.c.

mnDebugSoundTestRun

Sint32 mnDebugSoundTestRun(void)

Unused: the debug sound test. Four values (music, jingle, sound effect, sound preset) start from DebugSoundTestStartValues; up and down pick one, left and right step it by 1, L and R by DEBUG_LARGE_STEP; A plays it (the fourth loads its preset parameters), START fades out the sound and stops the music, and B leaves.

References DebugSoundTestStartValues, mnCursorSetStub(), mnDebugSoundTestInit(), mnDebugSoundTestOpen(), mnDebugSoundTestRelease(), mnTextDrawNumberInWindow(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowDrawDividerLine(), mnWindowSpriteRedrawSavedRect(), PerWork, Sint32, SoundTestJingleString, SoundTestMusicString, SoundTestPresetString, SoundTestSeString, sySoundLoadReverbCode(), sySoundPlayStub() and sySynch().

Definition at line 77 of file window_debug.c.

mnDebugMenuStepCursor

void mnDebugMenuStepCursor(void)

The debug menu's per-tick event: moves the cursor.

References mnCursorAdvanceStub().

Referenced by mnDebugMenuInit() and mnDebugMenuRelease().

Definition at line 175 of file window_debug.c.

mnDebugMenuInit

void mnDebugMenuInit(void)

Allocates the debug menu's state and starts its cursor event.

References mnDebugMenuStepCursor(), syHeapSlotAllocateEWRAM() and sySetEvent().

Referenced by mnDebugMenuRun().

Definition at line 183 of file window_debug.c.

mnDebugMenuRelease

void mnDebugMenuRelease(void)

Stops the debug menu's cursor event and frees its state.

References mnDebugMenuStepCursor(), syCloseEvent() and syHeapSlotRelease().

Referenced by mnDebugMenuRun().

Definition at line 193 of file window_debug.c.

mnDebugMenuOpen

WINDOW *mnDebugMenuOpen(void)

Opens the debug menu's window: its five rows, from "Full PP and Money" (MsgFullPpAndMoney) to "Change of hero", with a divider under each.

References mnPointingHandLoadIntoFreeSlot(), mnTextDrawMessage(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSpriteCreate(), MsgFullPpAndMoney and Sint32.

Referenced by mnDebugMenuRun().

Definition at line 201 of file window_debug.c.

mnDebugMenuRun

Sint32 mnDebugMenuRun(Sint32 index)

Unused: shows the debug menu with the cursor on row index, lets Up and Down move it (wrapping), and returns the row A chooses, or -1 for B.

References mnCursorSetPosImmediateStub(), mnCursorSetStub(), mnDebugMenuInit(), mnDebugMenuOpen(), mnDebugMenuRelease(), mnWindowClose(), PerWork, Sint32, sySoundPlayStub() and sySynch().

Definition at line 225 of file window_debug.c.

mnDebugWarpJupiter

void mnDebugWarpJupiter(void)

Preset 0, "Jupiter": Felix holds the Red Key and the Blue Key. To Jupiter Lighthouse's locked doors room, at its entrance 4 (216x408 on the map), in sight of a red door.

References fdScriptSetDestinationStub() and gmInventoryAddItemStub().

Referenced by DebugWarpPresets.

Definition at line 290 of file window_debug.c.

mnDebugWarpArafura2

void mnDebugWarpArafura2(void)

Preset 1, "Arafura2": Briggs caught and the mayor at the ship, Alhafra's mast still blocking it; Felix holds the Large Bread. To Alhafra.

References fdScriptSetDestinationStub(), gmInventoryAddItemStub(), MainRoutineStateWork, syGameFlagClear() and syGameFlagSet().

Referenced by DebugWarpPresets.

Definition at line 299 of file window_debug.c.

mnDebugWarpEnergySample

void mnDebugWarpEnergySample(void)

Preset 2, "Energy Sample": does nothing.

Referenced by DebugWarpPresets.

Definition at line 314 of file window_debug.c.

mnDebugWarpArafura3

void mnDebugWarpArafura3(void)

Preset 3, "Arafura3": as Arafura2 with the mast cleared. To eastern Alhafra.

References fdScriptSetDestinationStub(), MainRoutineStateWork and syGameFlagSet().

Referenced by DebugWarpPresets.

Definition at line 319 of file window_debug.c.

mnDebugWarpChampa2

void mnDebugWarpChampa2(void)

Preset 4, "CHAMPA2": the Trident's three prongs, and Briggs sailed from Alhafra. To Champa.

References fdScriptSetDestinationStub(), gmPartyInventoryAddStub(), MainRoutineStateWork and syGameFlagSet().

Referenced by DebugWarpPresets.

Definition at line 334 of file window_debug.c.

mnDebugWarpKaoruSpecial4

void mnDebugWarpKaoruSpecial4(void)

Preset 5, "Kaoru Special4": Moapa met in Shaman Village, his tests passed and beaten on the Trial Road. To the Shaman Village inn.

References fdScriptSetDestinationStub() and syGameFlagSet().

Referenced by DebugWarpPresets.

Definition at line 350 of file window_debug.c.

mnDebugWarpKaoruSpecial3

void mnDebugWarpKaoruSpecial3(void)

Preset 6, "Kaoru Special3": the Mars beacon lit and Prox's clan met and grateful, saving barred. To Prox.

References fdScriptSetDestinationStub() and syGameFlagSet().

Referenced by DebugWarpPresets.

Definition at line 363 of file window_debug.c.

mnDebugWarpKaoruSpecial2

void mnDebugWarpKaoruSpecial2(void)

Preset 7, "Kaoru Special2": to the Mars Lighthouse aerie.

References fdScriptSetDestinationStub().

Referenced by DebugWarpPresets.

Definition at line 376 of file window_debug.c.

mnDebugWarpKaoruSpecial1

void mnDebugWarpKaoruSpecial1(void)

Preset 8, "Kaoru Special1": to the Mars Lighthouse's star room, where the battle with the Flame Dragons returns the party.

References fdScriptSetDestinationStub().

Referenced by DebugWarpPresets.

Definition at line 384 of file window_debug.c.

mnDebugWarpStepCursor

void mnDebugWarpStepCursor(void)

The debug warp menu's per-tick event: moves the cursor.

References mnCursorAdvanceStub().

Referenced by mnDebugWarpInit() and mnDebugWarpRelease().

Definition at line 392 of file window_debug.c.

mnDebugWarpInit

void mnDebugWarpInit(void)

Allocates the debug warp menu's state and starts its cursor event.

References mnDebugWarpStepCursor(), syHeapSlotAllocateEWRAM() and sySetEvent().

Referenced by mnDebugWarpRun().

Definition at line 400 of file window_debug.c.

mnDebugWarpRelease

void mnDebugWarpRelease(void)

Stops the debug warp menu's cursor event and frees its state.

References mnDebugWarpStepCursor(), syCloseEvent() and syHeapSlotRelease().

Referenced by mnDebugWarpRun().

Definition at line 410 of file window_debug.c.

mnDebugWarpOpen

WINDOW *mnDebugWarpOpen(void)

Opens the debug warp menu's window: nine preset names 16 pixels apart, with a divider under each but the last.

References DebugWarpPresets, mnPointingHandLoadIntoFreeSlot(), mnTextDrawStringInWindow(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSpriteCreate() and Sint32.

Referenced by mnDebugWarpRun().

Definition at line 418 of file window_debug.c.

mnDebugWarpRun

Sint32 mnDebugWarpRun(Sint32 index)

Unused: shows the nine warp presets with the cursor on row index, lets Up and Down move it (wrapping), and returns the row A chooses after running its handler, or -1 for B.

References DebugWarpPresets, mnCursorSetPosImmediateStub(), mnCursorSetStub(), mnDebugWarpInit(), mnDebugWarpOpen(), mnDebugWarpRelease(), mnWindowClose(), PerWork, Sint32, sySoundPlayStub() and sySynch().

Definition at line 455 of file window_debug.c.

mnDebugShortcutStepCursor

void mnDebugShortcutStepCursor(void)

The shortcut grid's per-tick event: moves the cursor.

References mnCursorAdvanceStub().

Referenced by mnDebugShortcutInit() and mnDebugShortcutRelease().

Definition at line 521 of file window_debug.c.

mnDebugShortcutInit

void mnDebugShortcutInit(void)

Allocates the shortcut grid's state and starts its cursor event.

References mnDebugShortcutStepCursor(), syHeapSlotAllocateEWRAM() and sySetEvent().

Referenced by mnDebugShortcutRun().

Definition at line 529 of file window_debug.c.

mnDebugShortcutRelease

void mnDebugShortcutRelease(void)

Stops the shortcut grid's cursor event and frees its state.

References mnDebugShortcutStepCursor(), syCloseEvent() and syHeapSlotRelease().

Referenced by mnDebugShortcutRun().

Definition at line 539 of file window_debug.c.

mnDebugShortcutDrawAbility

void mnDebugShortcutDrawAbility(Sint32 ability, Sint32 window, Sint32 x, Sint32 y)

Draws an ability's name in the shortcut grid; ability 0, an empty place, draws DebugShortcutNoAbilityName.

References DebugShortcutNoAbilityName, mnTextDrawMessageAsTiles(), mnTextDrawStringInWindow() and Sint32.

Referenced by mnDebugShortcutOpen().

Definition at line 547 of file window_debug.c.

mnDebugShortcutOpen

WINDOW *mnDebugShortcutOpen(void)

Opens the shortcut grid's window: the four columns of DebugShortcutAbilities in nine rows, a divider under each row but the last.

References DebugShortcutAbilities, mnDebugShortcutDrawAbility(), mnPointingHandLoadIntoFreeSlot(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSpriteCreate() and Sint32.

Referenced by mnDebugShortcutRun().

Definition at line 562 of file window_debug.c.

mnDebugShortcutRun

Sint32 mnDebugShortcutRun(void)

Unused: the shortcut grid, drawn by mnDebugShortcutOpen. The cursor moves over four columns of nine field Psynergy (DebugShortcutAbilities); A makes the chosen one, with the party member who knows it, the field Psynergy to use (FIELD_STATE.psynergy), L and R the L or R shortcut, and each fills Felix's, Jenna's, Sheba's and Piers's PP to DEBUG_SHORTCUT_PP; B cancels. Returns the DEBUG_SHORTCUT_TARGET set, or -1.

References DebugShortcutAbilities, gmPartyFindOwnerWithActionStub(), gmUnitGet(), MainRoutineStateWork, mnCursorSetPosImmediateStub(), mnCursorSetStub(), mnDebugShortcutInit(), mnDebugShortcutOpen(), mnDebugShortcutRelease(), mnWindowClose(), PerWork, result, Sint32, sySoundPlayStub() and sySynch().

Definition at line 613 of file window_debug.c.

Variables in detail

MsgFullPpAndMoney

extern Uint8 MsgFullPpAndMoney[]

Referenced by mnDebugMenuOpen().

Definition at line 13 of file window_debug.c.