33#include "text/msg_ids.h"
43#define DEBUG_ITEM_COUNT 270
44#define DEBUG_ITEM_ROW_STEP 10
45#define DEBUG_ITEM_PAGE_STEP 30
83 for (messageIndex = 0; messageIndex < messageCount; messageIndex++) {
115 MsgArmorShopWelcome - MsgWeaponShopWelcome);
120 MsgArmorShopWelcome - MsgWeaponShopWelcome);
125 MsgArmorShopWelcome - MsgWeaponShopWelcome);
130 MsgWarriorShopWelcome - MsgSanctumWelcome);
135 MsgArmorShopWelcome - MsgWeaponShopWelcome);
140 MsgArmorShopWelcome - MsgWeaponShopWelcome);
145 MsgArmorShopWelcome - MsgWeaponShopWelcome);
151static void DebugMenu_RunMessageTest(
void) {
183UNUSED static void DebugMenu_GiveItemToParty(
void) {
414 for (pass = 0; pass < 16; pass++) {
415 for (characterIndex = 0; characterIndex < 256; characterIndex++) {
416 benchmarkBuffer[characterIndex] = 0;
418 for (characterIndex = 0; characterIndex < pass + 32; characterIndex++) {
584 definitionId = selectedItemId & 0x1ff;
742static s32 DebugMenu_SelectCharacter(
void) {
755 0x500050, 0, 80, 0x500000, 0x10003, 2, 0,
756 0x780078, 0, 120, 0x780000, 0x10003, 2, 0,
757 0x28003c, 0, 128, 0x800000, 0x10002, 1, 0,
758 0x28003c, 0, 128, 0x800000, 0x10002, 3, 0,
759 0x800080, 0, 128, 0x800000, 0x20003, 1, 0,
760 0x800080, 0, 128, 0x800000, 0x20003, 1, 0,
761 0x200020, 0, 0, 0, 0, 0, 0,
762 0x800080, 0, 128, 0x800000, 0x20003, 1, 0,
772 {0,
CONDITION_ALWAYS, 60, 0, 94,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
827#if TBS_PATCH_3 && !TBS_PATCH_4
831 MSGNO(MsgTolbiTolbiShipThenTheyAreDangerous)},
Ability numbers, named from the English release.
The engine calls the debug menus import, and their palette swatch tiles.
void Engine_DebugClearWindow(struct UiWindow *window)
void Engine_DebugDrawItemDetails(struct UiWindow *window, s32 item)
struct ItemDefinition * Engine_DebugGetItem(s32 item)
void Engine_DebugRedrawWindow(struct UiWindow *window)
DMA channel registers, and the DMA and CPU fills.
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldUnit_AddHp(s32 owner, s32 delta)
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
void UiText_ShowPositionedMessageAndWait(s32 message, s32 flags)
Shows a message in a window centred on the screen, waits until it is typed out and closes it.
struct UiWindow * UiText_OpenMessageWindow(s32 message, s32 x, s32 y, u32 packed)
Opens a window sized to a message near tile (x, y) and starts typing the message into it.
s32 UiWork_IsComplete(void)
Returns 1 when every message channel has finished its text (or is idle), and 0 while one is still typ...
s32 Djinn_AddToOwner(s32 owner, s32 element, s32 djinnIndex)
Gives Djinni djinnIndex of element to a unit: sets its bit in djinnAvailable and counts it.
s32 Djinn_Activate(s32 owner, s32 element, s32 djinnIndex)
Sets a ready Djinni on the unit, counts it and works out the unit's class again.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
void Engine_DebugFinalizeWindow(struct UiWindow *work, s32 release)
struct UiWindow * Engine_DebugCreateWindow(s32 x, s32 y, s32 width, s32 height, s32 attrs)
s32 PartyInventory_HasSpace(void)
Returns 1 when the selected character or any party member has a free inventory slot.
s32 Inventory_AddItem(s32 owner, s32 itemId)
Gives a unit one item, joining its first matching stack (up to 30) or taking the first free slot.
s32 PartyInventory_Add(s32 itemId)
Gives the item to the first party member with room.
s32 Item_AdjustCounter(s32 itemId, s32 delta)
Adds delta to the counter of a rare item; ordinary items have none.
gOverflowItem, an item slot the spoils code uses when items are handed out.
The hardware's I/O registers and their bits, as pret names them.
#define BG_PLTT_COLOR(palette, color)
Items: their definitions, types, flags and effects.
Declares nothing of its own: it only includes types.h, edition.h and farcall.h.
Item numbers, named from the English release.
s32 Shop_PickUnitItem(s32 *selectedUnit, s32 *selectedSlot)
Lets the player choose a party member, then one of its items that may be dropped.
The keypad state the VBlank interrupt keeps.
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysPressed
Keys that went down this frame.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
s32 SceneData_ReturnZero(void)
void Unit_LevelUpTo(s32 owner, s32 targetLevel)
Levels character owner up one level at a time until targetLevel, then recomputes its stats.
The reel game's title lettering.
s32 NameEntry_EditOwnerName(s32 member)
The name entry screen for party member member: the player types a name of up to NAME_MAX_LETTERS lett...
s32 PartyInventory_GiveItem(s32 item, s32 unused)
The event command "give item": gives item to the first party member with room for it and says so.
void FieldEvent_ShowMessageAndWait(s32 actor, s32 flags)
The event command "show message": opens the current message at actor (UiText_OpenMessageAtObject) and...
s32 Party_RemoveActiveOwner(s32 owner)
Takes character owner out of the party: clears its game flag and closes the gap it leaves in gGameSta...
s32 Party_AddActiveOwner(s32 owner)
Adds character owner to the end of the party: sets its game flag and appends it to gGameState....
s32 Battle_ApplyPresetItemsAndFlags(s32 unused)
Opens the debug shop with 200000 coins, the ticket counter at its cap, broken equipment for repairs a...
s32 Shop_ConfirmAct(s32 unitId)
Runs the sanctum service menu using the shared shop cursor and window resources.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_MENU_CURSOR_MOVE
void Engine_AudioPlayCue()
void Engine_EventSetMessage()
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
s8 childMode
set by some scenes: Frost and Force leave the target be
u8 messageSpeed
0 to 2; 1 on a new game
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
#define DEBUG_ITEM_PAGE_STEP
char gDebugItemFullLabel[20]
static void DebugMenu_RaisePartyLevels(void)
Levels the four heroes to the current debug target, then raises it by ten.
char gDebugItemCapacityLabel[24]
static __inline__ void DebugMenu_RecalculateParty(void)
Recalculates the four heroes after a debug inventory or stat change.
u32 gDebugItemPromptHead[]
s32 gMenuTest_BenchmarkCharacter
u8 * MenuTest_GetExits(void)
static void DebugMenu_BrowseSanctumMessages(void)
s32 CommandTable_ConfigureCommandList(void)
Sets the debug party, stock counters and levels; returns zero.
static void DebugMenu_BrowseWarriorArmorShopMessages(void)
static void DebugMenu_TestItemSelection(void)
Opens the shop inventory selector and discards its selected owner and slot.
static void SceneDialogue_ShowMessageAndWait(s32 messageId)
Finishes pending UI work, displays a message, and waits one final frame.
s32 gMenuTest_SlotOffsets
u8 * MenuTest_GetPlacements(void)
static void DebugMenu_GiveEquipmentTestStock(void)
Adds the test equipment in each owner's original inventory order.
static UNUSED void DebugMenu_NoOp(void)
struct SceneEntrance gMenuTest_Entrances[]
s32 MenuTest_GetEvents(void)
static void DebugMenu_EnableEffectChildMode(void)
static void DebugMenu_BrowseWeaponShopMessages(void)
static void DebugMenu_EditIsaacName(void)
static void DebugMenu_BrowseMessageRange(s32 messageId, s32 messageCount)
Browses sample dialogue with A/Down and Up; B closes the window.
static void DebugMenu_IgnorePsynergy(void)
Leaves the test actor unchanged when targeted by Psynergy.
static void DebugMenu_BrowseArmorShopMessages(void)
u8 * MenuTest_GetEntrances(void)
static void DebugMenu_RunPresetShop(void)
Runs the shop test's preset inventory, money and ailment setup.
struct SceneEvent gMenuTest_Events[]
struct ScenePlacement gMenuTest_Placements[]
static s32 DebugMenu_ConfirmShopAction(s32 unitId)
Forwards the selected owner and shop confirmation status.
char gDebugItemPrompt[12]
static void DebugMenu_BrowseWarriorItemShopMessages(void)
static void DebugMenu_BrowseWarriorShopMessages(void)
#define DEBUG_ITEM_ROW_STEP
static s32 DebugMenu_OpenIconBrowser(void)
Returns the icon browser's status to the event dispatcher.
static void DebugMenu_GiveConsumableTestStock(void)
Attempts each consumable grant in order, including calls after a bag fills.
static void DebugMenu_SelectItem(void)
Browses item definitions and gives the selected item while party bags allow it.
static void DebugMenu_DamageAndAfflictParty(void)
Reduces HP and PP, then poisons and haunts Isaac and binds and venoms Garet.
static UNUSED void DebugMenu_OpenItemBrowser(void)
static void DebugMenu_GiveTreasureTestStock(void)
Adds the original treasure test stock, retaining duplicate tickets and medals.
#define DEBUG_ITEM_COUNT
The debug item browser covers IDs 0 through 269.
static void DebugMenu_BrowseItemShopMessages(void)
static void DebugMenu_GivePartyDjinn(void)
Runs the Japanese text-buffer benchmark, then grants and sets test Djinn.
Declares nothing of its own: it only includes edition.h and render_input.h.
void UiText_DrawStringInWindow(const u8 *text, struct UiWindow *window, u32 x, u32 y)
Draws a byte string into a window's tilemap at pixel (x, y) of its interior, rounded down to tiles.
void UiText_DrawResource(s32 message, struct UiWindow *window, s32 x, s32 y)
Decodes a message and draws it into a text canvas window at pixel (x, y).
void UiText_DrawNumberAtOffset(s32 value, s32 width, const struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) as tiles in a window at pixel (x, y) of its interior.
void UiText_DrawCharacterAtOffset(s32 message, const struct UiWindow *window, u32 offsetX, u32 offsetY)
Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior.
The integer types, TRUE, UNUSED and the fixed-address macros.
void UnitCalc(s32 owner)
Recomputes a unit's stats from its base stats, equipment, set Djinn, class and battle stat levels,...
s16 Unit_AddPp(s32 owner, s32 delta)
Adds delta to the PP of unit owner, clamped to 0..maxPp, recomputes its gauges and returns the new PP...
struct BattleUnit * UnitGet(u32 owner)
Returns the unit record of owner: 0 to 7 are the playable characters in the game state,...
s32 DebugMenu_BrowseIcons(void)
Browses pages of item, Psynergy and status-pattern icons, suspending the menu controller while the br...
void UiWork_PushValueSlot(u32 value, u32 kind)
Adds a message argument of kind (MSG_ARG_) with value to the first free place of the argument table; ...
void UiWork_FinalizePendingCore(void)
Closes each message channel's window whose text has ended, then waits ten frames.
struct UiWindow * UiWindow_CreateWithSideObject(s32 speaker, s32 portraitOption, s32 x, s32 y)
Opens a portrait window at tile (x, y) showing the speaker's portrait.