Alchemy
Loading...
Searching...
No Matches

test.c

Go to the documentation of this file.
1#include "game_state.h"
2#include "unit/import.h"
3#include "unit/debug/test.h"
6#include "unit/game/game.h"
9#include "unit/menu/menu.h"
10#include "unit/shop/shop.h"
11#include "battle.h"
12#include "keystate.h"
13#include "debug.h"
14#include "field.h"
15#include "game.h"
16#include "graphics.h"
17#include "menu.h"
18#include "minigame.h"
19#include "sound.h"
20#include "system.h"
21#include "edition.h"
22#include "menu_test.h"
23#include "engine_call.h"
24#include "types.h"
25#include "io_reg.h"
26#include "inventory.h"
27#include "dma.h"
28#include "text_render_runtime.h"
29#include "item.h"
30#include "item_ids.h"
31#include "item_gift.h"
32#include "tbs_edition.h"
33#include "text/msg_ids.h"
34#include "ability_ids.h"
35#include "field_scene.h"
36#include "songs.h"
37
39
41
42/// The debug item browser covers IDs 0 through 269.
43#define DEBUG_ITEM_COUNT 270
44#define DEBUG_ITEM_ROW_STEP 10
45#define DEBUG_ITEM_PAGE_STEP 30
46
47/// Recalculates the four heroes after a debug inventory or stat change.
48/// Preserve the original Isaac, Garet, Mia, Ivan order.
49static __inline__ void DebugMenu_RecalculateParty(void) {
54}
55
57
58s32 SceneData_ReturnZero(void) { return 0; }
59
61
63
64#if TBS_PATCH_1
65/// Finishes pending UI work, displays a message, and waits one final frame.
66static void SceneDialogue_ShowMessageAndWait(s32 messageId) {
68 UiText_OpenMessageWindow(messageId, 5, 0, 0x22);
69 while (UiWork_IsComplete() == 0) {
71 }
73}
74
75/// Browses sample dialogue with A/Down and Up; B closes the window.
76/// Other held keys finish the current iteration without a wait.
77static void DebugMenu_BrowseMessageRange(s32 messageId, s32 messageCount) {
78 struct UiWindow *window;
79 s32 messageIndex;
80
82 window = UiWindow_CreateWithSideObject(125, 0, 0, 0);
83 for (messageIndex = 0; messageIndex < messageCount; messageIndex++) {
84 // Supply sample name, item and number substitutions before each message.
87 UiWork_PushValueSlot(0x1e240, 5);
89 for (;;) {
90 if ((gKeysHeld & KEY_B) != 0) {
91 goto end;
92 }
93 if ((gKeysHeld & KEY_A) != 0 || (gKeysHeld & KEY_DOWN) != 0) {
94 messageId++;
95 break;
96 }
97 if ((gKeysHeld & KEY_UP) != 0) {
98 messageId--;
99 break;
100 }
101 if (gKeysHeld == 0) {
103 } else {
104 break;
105 }
106 }
107 }
108end:
111}
112
114 DebugMenu_BrowseMessageRange(MsgWeaponShopWelcome,
115 MsgArmorShopWelcome - MsgWeaponShopWelcome);
116}
117
119 DebugMenu_BrowseMessageRange(MsgArmorShopWelcome,
120 MsgArmorShopWelcome - MsgWeaponShopWelcome);
121}
122
124 DebugMenu_BrowseMessageRange(MsgItemShopWelcome,
125 MsgArmorShopWelcome - MsgWeaponShopWelcome);
126}
127
129 DebugMenu_BrowseMessageRange(MsgSanctumWelcome,
130 MsgWarriorShopWelcome - MsgSanctumWelcome);
131}
132
134 DebugMenu_BrowseMessageRange(MsgWarriorShopWelcome,
135 MsgArmorShopWelcome - MsgWeaponShopWelcome);
136}
137
139 DebugMenu_BrowseMessageRange(MsgWarriorArmorShopWelcome,
140 MsgArmorShopWelcome - MsgWeaponShopWelcome);
141}
142
144 DebugMenu_BrowseMessageRange(MsgWarriorItemShopWelcome,
145 MsgArmorShopWelcome - MsgWeaponShopWelcome);
146}
147#endif
148
149#if TBS_PATCH_2
150/// Submits two sample messages, then waits for the battle message service.
151static void DebugMenu_RunMessageTest(void) {
152 Engine_EventSetMessage(MSGNO(MsgBattleAdditionalPsynergyHelp));
153 Engine_EventSetMessage(MSGNO(MsgValeComeOnHurry));
155}
156#endif
157
158/// Runs the shop test's preset inventory, money and ailment setup.
159static void DebugMenu_RunPresetShop(void) {
161}
162
163UNUSED static void DebugMenu_NoOp(void) {}
164
165/// Opens the shop inventory selector and discards its selected owner and slot.
167 s32 selectedOwner;
168 s32 selectedSlot;
169 Shop_PickUnitItem(&selectedOwner, &selectedSlot);
170}
171
173
174/// Leaves the test actor unchanged when targeted by Psynergy.
175static void DebugMenu_IgnorePsynergy(void) {}
176
178 ((struct BattleFxScene *)gEffectWork)->childMode = 1;
179}
180
181#if TBS_PATCH_3
182/// Gives a Nut through the ordinary party gift and full-inventory dialogue.
183UNUSED static void DebugMenu_GiveItemToParty(void) {
185}
186#endif
187
189
190/// Levels the four heroes to the current debug target, then raises it by ten.
191static void DebugMenu_RaisePartyLevels(void) {
192 s32 *targetLevel;
193
194 UiText_ShowPositionedMessageAndWait(MsgDebugWentLevel, 1);
195 targetLevel = &gMenuTest_SlotOffsets;
196 Unit_LevelUpTo(ISAAC, *targetLevel);
197 Unit_LevelUpTo(GARET, *targetLevel);
198 Unit_LevelUpTo(MIA, *targetLevel);
199 Unit_LevelUpTo(IVAN, *targetLevel);
200 *targetLevel += 10;
202}
203
204/// Attempts each consumable grant in order, including calls after a bag fills.
206 // A repeated-grant loop shrinks this native function from 0x626 to 0x12c;
207 // retain the individual calls and their original insertion order.
208 UiText_ShowPositionedMessageAndWait(MsgDebugGotItem, 1);
401}
402
403/// Runs the Japanese text-buffer benchmark, then grants and sets test Djinn.
404/// Ivan receives six Jupiter Djinn; the other heroes receive seven.
405static void DebugMenu_GivePartyDjinn(void) {
406 /* FAKEMATCH: the benchmark's buffer, unused outside Japanese, keeps the
407 * native's 256 untouched frame bytes; declared inside the benchmark's #if,
408 * 4 instructions differ in tbs-en. */
409 UNUSED u8 benchmarkBuffer[256];
410#if !TBS_PATCH_1
411 s32 pass;
412 s32 characterIndex;
413
414 for (pass = 0; pass < 16; pass++) {
415 for (characterIndex = 0; characterIndex < 256; characterIndex++) {
416 benchmarkBuffer[characterIndex] = 0;
417 }
418 for (characterIndex = 0; characterIndex < pass + 32; characterIndex++) {
419 benchmarkBuffer[characterIndex] = gMenuTest_BenchmarkCharacter + 1;
420 }
424 }
425 }
426#endif
427 // Add and set each element in separate passes, preserving recovery updates.
428 UiText_ShowPositionedMessageAndWait(MsgDebugGotDjinni, 1);
484}
485
486/// Reduces HP and PP, then poisons and haunts Isaac and binds and venoms Garet.
488 // Named BattleUnit stores change address setup and store ordering in the
489 // native build; retain the byte cursor for poison (0x131), haunt (0x140) and
490 // restraint (0x130).
491 u8 *record;
492
493 UiText_ShowPositionedMessageAndWait(MsgDebugBodyTornApart, 1);
494 FieldUnit_AddHp(ISAAC, -100);
495 FieldUnit_AddHp(GARET, -100);
496 FieldUnit_AddHp(IVAN, -33);
497 FieldUnit_AddHp(MIA, -100);
498 Unit_AddPp(ISAAC, -50);
499 Unit_AddPp(GARET, -40);
500 Unit_AddPp(IVAN, -35);
501 Unit_AddPp(MIA, -20);
502 record = (u8 *)UnitGet(ISAAC);
503 record[0x131] = 1;
504 record += 0x140;
505 *record = 1;
506 record = (u8 *)UnitGet(GARET);
507 record[0x130] = 1;
508 record[0x131] = 2;
510}
511
512/// Adds the test equipment in each owner's original inventory order.
514 UiText_ShowPositionedMessageAndWait(MsgDebugGotSturdyEquipment, 1);
550}
551
552/// Browses item definitions and gives the selected item while party bags allow
553/// it.
554static void DebugMenu_SelectItem(void) {
555 struct UiWindow *window;
556 struct UiWindow *details;
557 s32 selectedItemId;
558 s32 redraw;
559 s32 definitionId;
560 s32 itemCount;
561
562 itemCount = DEBUG_ITEM_COUNT;
564 window = Engine_DebugCreateWindow(0, 0, 30, 7, 2);
565 details = Engine_DebugCreateWindow(0, 8, 13, 10, 2);
566 selectedItemId = 1;
567 redraw = 1;
568 // Reuse the item palette for both debug windows.
569 Dma_Set((const void *)OBJ_PLTT, (void *)&BG_PLTT_COLOR(14, 0),
570 DMA_ENABLE << 16 | 0x10, REG_DMA3);
571 Dma_Set((const void *)&BG_PLTT_COLOR(15, 4), (void *)&BG_PLTT_COLOR(14, 14),
572 DMA_ENABLE << 16 | 1, REG_DMA3);
574 while (1) {
575 if (redraw) {
576 redraw = 0;
577 selectedItemId = (selectedItemId + DEBUG_ITEM_COUNT) % itemCount;
581 UiText_DrawNumberAtOffset(selectedItemId, 0, window, 80, 0);
584 definitionId = selectedItemId & 0x1ff;
585 Engine_DebugGetItem(definitionId);
586 UiText_DrawCharacterAtOffset(definitionId + MsgItemName, window, 120,
587 0);
588 UiText_DrawResource(definitionId + MsgItemPlainName, window, 0, 16);
590 Engine_DebugDrawItemDetails(details, selectedItemId);
591 } else {
593 }
594 }
595 // These are independent tests: a single frame can add and move the cursor.
596 if (gKeysPressed & KEY_A) {
597 if (PartyInventory_Add(selectedItemId) == -1) {
599 break;
600 }
602 }
603 if (gKeysPressed & KEY_B) {
605 break;
606 }
607 if (gKeysRepeat & KEY_UP) {
608 selectedItemId--;
609 redraw = 1;
611 }
612 if (gKeysRepeat & KEY_DOWN) {
613 selectedItemId++;
614 redraw = 1;
616 }
617 if (gKeysRepeat & KEY_RIGHT) {
618 selectedItemId += DEBUG_ITEM_ROW_STEP;
619 redraw = 1;
621 }
622 if (gKeysRepeat & KEY_LEFT) {
623 selectedItemId -= DEBUG_ITEM_ROW_STEP;
624 redraw = 1;
626 }
627 if (gKeysRepeat & KEY_R) {
628 selectedItemId += DEBUG_ITEM_PAGE_STEP;
629 redraw = 1;
631 }
632 if (gKeysRepeat & KEY_L) {
633 selectedItemId -= DEBUG_ITEM_PAGE_STEP;
634 redraw = 1;
636 }
638 }
642 Engine_DebugFinalizeWindow(details, 1);
643}
644
646
647/// Adds the original treasure test stock, retaining duplicate tickets and
648/// medals.
650 // Sharing the duplicate grants through a counted loop shrinks this function
651 // from 0x194 to 0x120; retain the original calls.
652 UiText_ShowPositionedMessageAndWait(MsgDebugGotTreasure, 1);
686 Inventory_AddItem(IVAN, 0x102);
687 Inventory_AddItem(IVAN, 0x10b);
688 Inventory_AddItem(IVAN, 0x109);
689 Inventory_AddItem(IVAN, 0xfc);
691 Inventory_AddItem(MIA, 0xc8);
692 Inventory_AddItem(MIA, 0xc9);
693 Inventory_AddItem(MIA, 0xca);
694 Inventory_AddItem(MIA, 0xcb);
695 Inventory_AddItem(MIA, 0xcc);
696 Inventory_AddItem(MIA, 0xcf);
698}
699
700/// Sets the debug party, stock counters and levels; returns zero.
702 // Assemble the test party before adding stock and setting levels.
707 // Populate the original shop counters, retaining repeated increments.
708 Item_AdjustCounter(5, 1);
709 Item_AdjustCounter(5, 1);
710 Item_AdjustCounter(5, 1);
711 Item_AdjustCounter(6, 1);
712 Item_AdjustCounter(6, 1);
713 Item_AdjustCounter(7, 1);
714 Item_AdjustCounter(106, 1);
715 Item_AdjustCounter(108, 1);
716 Item_AdjustCounter(109, 1);
717 Item_AdjustCounter(113, 1);
718 Item_AdjustCounter(123, 1);
719 Item_AdjustCounter(130, 1);
720 Item_AdjustCounter(140, 1);
721 Item_AdjustCounter(151, 1);
722#if !TBS_PATCH_1
723 gGameState.coins = 777777;
724#endif
725#if TBS_PATCH_1
727#else
729#endif
731 Unit_LevelUpTo(MIA, 30);
732 Unit_LevelUpTo(IVAN, 30);
734 return 0;
735}
736
737/// Returns the icon browser's status to the event dispatcher.
739
740#if !TBS_PATCH_1
741/// Returns the Japanese character selector's status.
742static s32 DebugMenu_SelectCharacter(void) {
744}
745#endif
746
747#if !TBS_PATCH_3
748/// Forwards the selected owner and shop confirmation status.
750 return Shop_ConfirmAct(unitId);
751}
752#endif
753
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,
763};
764
765char gDebugItemPrompt[12] = "Item No:";
766
767char gDebugItemCapacityLabel[24] = "A:Get Item B:Return";
768
769char gDebugItemFullLabel[20] = "ITEM FULL........";
770
772 {0, CONDITION_ALWAYS, 60, 0, 94, FACING_NORTH, 0, -1, -1, -1, -1, 0},
774};
775
777 SCENE_EXITS(511),
778};
779
789 {0x1e, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(80), 0, PIXELS(48),
791 {0x1f, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(80), 0, PIXELS(80),
793 {0x20, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(80), 0, PIXELS(112),
795 {0x21, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(80), 0, PIXELS(144),
797 {0x7d, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(120), 0, PIXELS(48),
799 {0x1f, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(120), 0, PIXELS(80),
801 {0x20, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(120), 0, PIXELS(112),
803 {0xf8, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(120), 0, PIXELS(144),
805 {0x23, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(160), 0, PIXELS(48),
807 {0x23, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(160), 0, PIXELS(80),
810};
811
827#if TBS_PATCH_3 && !TBS_PATCH_4
828 {EVENT_TALK, 13, CONDITION_ALWAYS, EVENT_SCRIPT(DebugMenu_GiveItemToParty)},
829#elif TBS_PATCH_4
831 MSGNO(MsgTolbiTolbiShipThenTheyAreDangerous)},
832#else
835#endif
836 {EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgValeKyleAbleStop)},
838#if !TBS_PATCH_1
839 {EVENT_TALK, 16, CONDITION_ALWAYS, EVENT_SCRIPT(DebugMenu_SelectCharacter)},
841#else
842 {0xc400, 16, CONDITION_ALWAYS,
844 {0x8400, 16, CONDITION_ALWAYS,
846 {0x400, 16, CONDITION_ALWAYS,
848 {0x4400, 16, CONDITION_ALWAYS,
850 {0xc400, 17, CONDITION_ALWAYS,
852 {0x8400, 17, CONDITION_ALWAYS,
854 {0x400, 17, CONDITION_ALWAYS,
856#if TBS_PATCH_2
857 {0x4400, 17, CONDITION_ALWAYS, EVENT_SCRIPT(DebugMenu_RunMessageTest)},
858#endif
859#endif
866 {0x10008e15, 15, CONDITION_ALWAYS,
869};
870
872
Ability numbers, named from the English release.
@ ABILITY_CATCH
Definition ability_ids.h:23
@ ELEMENT_MARS
Definition battle_unit.h:38
@ ELEMENT_MERCURY
Definition battle_unit.h:37
@ ELEMENT_VENUS
Definition battle_unit.h:36
@ ELEMENT_JUPITER
Definition battle_unit.h:39
#define GARET
Jerald.
#define MIA
Mary.
#define ISAAC
Robin.
#define JENNA
Jasmine.
#define IVAN
Ivan.
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...
Definition dma.h:62
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)
Definition engine_call.h:83
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EVENTS_END
@ EVENT_TALK
#define SCENE_EXITS(scene)
Definition field_scene.h:72
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ TALK_FACE_PARTY
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
@ ACTOR_STAND
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
#define PIXELS(value)
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.
Definition frames.c:447
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.
Definition frames.c:396
s32 UiWork_IsComplete(void)
Returns 1 when every message channel has finished its text (or is idle), and 0 while one is still typ...
Definition frames.c:210
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.
Definition djinn.c:65
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.
Definition djinn.c:125
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.
Definition inventory.c:99
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.
Definition inventory.c:144
s32 PartyInventory_Add(s32 itemId)
Gives the item to the first party member with room.
Definition inventory.c:189
s32 Item_AdjustCounter(s32 itemId, s32 delta)
Adds delta to the counter of a rare item; ordinary items have none.
Definition inventory.c:488
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 OBJ_PLTT
Definition io_reg.h:159
@ KEY_UP
Definition io_reg.h:249
@ KEY_B
Definition io_reg.h:244
@ KEY_LEFT
Definition io_reg.h:248
@ KEY_RIGHT
Definition io_reg.h:247
@ KEY_R
Definition io_reg.h:251
@ KEY_A
Definition io_reg.h:243
@ KEY_DOWN
Definition io_reg.h:250
@ KEY_L
Definition io_reg.h:252
#define REG_DMA3
Definition io_reg.h:153
#define BG_PLTT_COLOR(palette, color)
Definition io_reg.h:158
#define DMA_ENABLE
Definition io_reg.h:217
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.
@ ITEM_HERMES_WATER
Definition item_ids.h:44
@ ITEM_LUCKY_PEPPER
Definition item_ids.h:55
@ ITEM_GAME_TICKET
Definition item_ids.h:69
@ ITEM_MINT
Definition item_ids.h:54
@ ITEM_ELIXIR
Definition item_ids.h:48
@ ITEM_APPLE
Definition item_ids.h:52
@ ITEM_ANTIDOTE
Definition item_ids.h:47
@ ITEM_BONE
Definition item_ids.h:72
@ ITEM_BLACK_ORB
Definition item_ids.h:80
@ ITEM_NUT
Definition item_ids.h:41
@ ITEM_SMOKE_BOMB
Definition item_ids.h:67
@ ITEM_POWER_BREAD
Definition item_ids.h:50
@ ITEM_WATER_OF_LIFE
Definition item_ids.h:49
@ ITEM_SLEEP_BOMB
Definition item_ids.h:68
@ ITEM_HARD_NUT
Definition item_ids.h:53
@ ITEM_ANCHOR_CHARM
Definition item_ids.h:73
@ ITEM_VIAL
Definition item_ids.h:42
@ ITEM_LUCKY_MEDAL
Definition item_ids.h:70
s32 Shop_PickUnitItem(s32 *selectedUnit, s32 *selectedSlot)
Lets the player choose a party member, then one of its items that may be dropped.
Definition item_picker.c:14
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)
Definition level.c:51
void Unit_LevelUpTo(s32 owner, s32 targetLevel)
Levels character owner up one level at a time until targetLevel, then recomputes its stats.
Definition levels.c:429
s32 Menu_OpenCharacterSelector(void)
Lets the player choose one party member, over the field (the Colosso scenes use it).
Definition status.c:95
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...
Definition name_entry.c:232
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.
Definition events.c:275
void FieldEvent_ShowMessageAndWait(s32 actor, s32 flags)
The event command "show message": opens the current message at actor (UiText_OpenMessageAtObject) and...
Definition messages.c:248
s32 Party_RemoveActiveOwner(s32 owner)
Takes character owner out of the party: clears its game flag and closes the gap it leaves in gGameSta...
Definition party.c:154
s32 Party_AddActiveOwner(s32 owner)
Adds character owner to the end of the party: sets its game flag and appends it to gGameState....
Definition party.c:135
s32 Battle_ApplyPresetItemsAndFlags(s32 unused)
Opens the debug shop with 200000 coins, the ticket counter at its cap, broken equipment for repairs a...
Definition run.c:179
s32 Shop_ConfirmAct(s32 unitId)
Runs the sanctum service menu using the shared shop cursor and window resources.
Definition sanctum.c:111
Song and sound effect ids, indices into gSound_SongTable.
#define SE_MENU_CANCEL
Definition songs.h:106
#define SE_MENU_CURSOR_MOVE
Definition songs.h:104
#define SE_175
Definition songs.h:170
#define SE_MENU_CONFIRM
Definition songs.h:105
void Engine_AudioPlayCue()
void Engine_TaskWait()
void Engine_EventSetMessage()
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
Definition fx_scene.h:31
s8 childMode
set by some scenes: Frost and Force leave the target be
Definition fx_scene.h:53
u8 messageSpeed
0 to 2; 1 on a new game
Definition game_state.h:66
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
Definition field_scene.h:54
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,...
Definition field_scene.h:81
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
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
Definition test.c:45
char gDebugItemFullLabel[20]
Definition test.c:769
static void DebugMenu_RaisePartyLevels(void)
Levels the four heroes to the current debug target, then raises it by ten.
Definition test.c:191
char gDebugItemCapacityLabel[24]
Definition test.c:767
static __inline__ void DebugMenu_RecalculateParty(void)
Recalculates the four heroes after a debug inventory or stat change.
Definition test.c:49
u32 gDebugItemPromptHead[]
Definition test.c:754
s32 gMenuTest_BenchmarkCharacter
Definition test.c:873
u8 * MenuTest_GetExits(void)
Definition test.c:60
static void DebugMenu_BrowseSanctumMessages(void)
Definition test.c:128
s32 CommandTable_ConfigureCommandList(void)
Sets the debug party, stock counters and levels; returns zero.
Definition test.c:701
u32 gMenuTest_Exits[]
Definition test.c:776
static void DebugMenu_BrowseWarriorArmorShopMessages(void)
Definition test.c:138
static void DebugMenu_TestItemSelection(void)
Opens the shop inventory selector and discards its selected owner and slot.
Definition test.c:166
static void SceneDialogue_ShowMessageAndWait(s32 messageId)
Finishes pending UI work, displays a message, and waits one final frame.
Definition test.c:66
s32 gMenuTest_SlotOffsets
Definition test.c:871
u8 * MenuTest_GetPlacements(void)
Definition test.c:62
static void DebugMenu_GiveEquipmentTestStock(void)
Adds the test equipment in each owner's original inventory order.
Definition test.c:513
static UNUSED void DebugMenu_NoOp(void)
Definition test.c:163
struct SceneEntrance gMenuTest_Entrances[]
Definition test.c:771
s32 MenuTest_GetEvents(void)
Definition test.c:188
static void DebugMenu_EnableEffectChildMode(void)
Definition test.c:177
static void DebugMenu_BrowseWeaponShopMessages(void)
Definition test.c:113
static void DebugMenu_EditIsaacName(void)
Definition test.c:172
static void DebugMenu_BrowseMessageRange(s32 messageId, s32 messageCount)
Browses sample dialogue with A/Down and Up; B closes the window.
Definition test.c:77
static void DebugMenu_IgnorePsynergy(void)
Leaves the test actor unchanged when targeted by Psynergy.
Definition test.c:175
static void DebugMenu_BrowseArmorShopMessages(void)
Definition test.c:118
u8 * MenuTest_GetEntrances(void)
Definition test.c:56
static void DebugMenu_RunPresetShop(void)
Runs the shop test's preset inventory, money and ailment setup.
Definition test.c:159
struct SceneEvent gMenuTest_Events[]
Definition test.c:812
struct ScenePlacement gMenuTest_Placements[]
Definition test.c:780
static s32 DebugMenu_ConfirmShopAction(s32 unitId)
Forwards the selected owner and shop confirmation status.
Definition test.c:749
char gDebugItemPrompt[12]
Definition test.c:765
static void DebugMenu_BrowseWarriorItemShopMessages(void)
Definition test.c:143
static void DebugMenu_BrowseWarriorShopMessages(void)
Definition test.c:133
#define DEBUG_ITEM_ROW_STEP
Definition test.c:44
static s32 DebugMenu_OpenIconBrowser(void)
Returns the icon browser's status to the event dispatcher.
Definition test.c:738
static void DebugMenu_GiveConsumableTestStock(void)
Attempts each consumable grant in order, including calls after a bag fills.
Definition test.c:205
static void DebugMenu_SelectItem(void)
Browses item definitions and gives the selected item while party bags allow it.
Definition test.c:554
static void DebugMenu_DamageAndAfflictParty(void)
Reduces HP and PP, then poisons and haunts Isaac and binds and venoms Garet.
Definition test.c:487
static UNUSED void DebugMenu_OpenItemBrowser(void)
Definition test.c:645
static void DebugMenu_GiveTreasureTestStock(void)
Adds the original treasure test stock, retaining duplicate tickets and medals.
Definition test.c:649
#define DEBUG_ITEM_COUNT
The debug item browser covers IDs 0 through 269.
Definition test.c:43
static void DebugMenu_BrowseItemShopMessages(void)
Definition test.c:123
static void DebugMenu_GivePartyDjinn(void)
Runs the Japanese text-buffer benchmark, then grants and sets test Djinn.
Definition test.c:405
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.
Definition text_tiles.c:646
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).
Definition text_tiles.c:538
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.
Definition text_tiles.c:668
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.
Definition text_tiles.c:552
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
void UnitCalc(s32 owner)
Recomputes a unit's stats from its base stats, equipment, set Djinn, class and battle stat levels,...
Definition units.c:149
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...
Definition units.c:787
struct BattleUnit * UnitGet(u32 owner)
Returns the unit record of owner: 0 to 7 are the playable characters in the game state,...
Definition units.c:73
s32 DebugMenu_BrowseIcons(void)
Browses pages of item, Psynergy and status-pattern icons, suspending the menu controller while the br...
Definition debug.c:327
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; ...
Definition messages.c:216
void UiWork_FinalizePendingCore(void)
Closes each message channel's window whose text has ended, then waits ten frames.
Definition messages.c:302
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.
Definition messages.c:525