3#if DX_DEBUG_MENU || defined(DX_QUICK_LAUNCH_BATTLE)
113#define PRESSED(but) (DebugButtonsPress & (but))
114#define RELEASED(but) (DebugButtonsRelease & (but))
115#define HELD(but) (DebugButtonsHold & (but))
117#define INIT_HOLD_RATE 6
118#define SLOW_HOLD_RATE 4
119#define FAST_HOLD_RATE 2
127 if (hold->delay < 0) {
130 if (hold->triggers < 5) {
132 }
else if (hold->triggers < 15) {
157#define NAV_UP (PRESSED(BUTTON_D_UP) || DebugHoldU.delay == 0)
158#define NAV_DOWN (PRESSED(BUTTON_D_DOWN) || DebugHoldD.delay == 0)
159#define NAV_LEFT (PRESSED(BUTTON_D_LEFT) || DebugHoldL.delay == 0)
160#define NAV_RIGHT (PRESSED(BUTTON_D_RIGHT) || DebugHoldR.delay == 0)
166 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
NULL, 0,
NULL,
SCREEN_WIDTH,
SCREEN_HEIGHT,
NULL);
241 const s32 u = v < min ? min : v;
242 return u > max ? max :
u;
246 const s32 u = v < min ? v + (max - min + 1) : v;
247 return u > max ?
u - (max - min + 1) :
u;
268 cur += (1 + max - min);
271 cur -= (1 + max - min);
294 cur += (1 + max - min);
297 cur -= (1 + max - min);
304 if ((max %
nrows) != 0) {
360 s32 max = num->isHex ? 0xF : 9;
369 char* fmt = num->isHex ?
"%X" :
"%d";
385 out |= (num->digits[
idx] & 0xF);
401 for (
idx = num->size - 1;
idx >= 0;
idx--) {
402 num->digits[
idx] = (
in & 0xF);
406 for (
idx = num->size - 1;
idx >= 0;
idx--) {
407 num->digits[
idx] =
in % 10;
457#define DEBUG_ARROW_ANIM_RATE 6
746 for (i = 0; i <
ncols; i++) {
760 s32 numRows, numCols;
814 for (
j = 0;
j < numRows;
j++) {
817 char* name = maps[
idx].
id;
940 es->scriptedBattle =
TRUE;
943 es->fadeOutAmount = 0;
944 es->substateDelay = 0;
1011 char* fmt = (
idx == 4) ?
"%02X" :
"%X";
1089 .digits = { 0, 0, 0, 0 },
1169 }
else if (level == 2) {
1217#define _MAX_INV_SIZE(a,b,c) MAX(MAX(ARRAY_COUNT(a), ARRAY_COUNT(b)), ARRAY_COUNT(c))
1247 for (
j = 2;
j >= 0;
j--) {
1257 for (
j = 0;
j < 3;
j++) {
1291 for (i = 0; i <
invSize; i++) {
1306 for (i = 0; i <
invSize; i++) {
1322 if (
menu->pos < 0) {
1343 for (i =
menu->startPos; i <=
menu->startPos + 9; i++) {
1373 if (
menu->startPos > 0) {
1573 .digits = { 0, 0, 0 },
1629 .digits = { 0, 0, 0 },
1745#define MAX_DEBUG_TRIS 1024
1808#define LESS(i, j) DebugTris[i].depth > DebugTris[j].depth
1809#define SWAP(i, j) temp = DebugTris[i], DebugTris[i] = DebugTris[j], DebugTris[j] = temp
2169 &&
script->stateFlags != 0
2188 for (i = 0; i < 16; i++) {
2191 for (i = 0; i < 4; i++) {
2246 if (
script->debugPaused) {
2411 #define MAX_VALID_FLOAT 1e9
2416 for (i = 0; i < 16; i++) {
2447 for (i = 0; i < 4; i++) {
2731#define DEBUG_CONSOLE_DEFAULT_TIMELEFT 60
2732#define DEBUG_CONSOLE_MSG_BUF_SIZE 85
2764 while ((
c = *filename++)) {
2835 char* filename = (
char*)*args++;
2837 char* fmt = (
char*)*args++;
2868 char* filename = (
char*)*args++;
2870 char* fmt = (
char*)*args++;
2899#define LESS(i, j) DebugConsole[i]->timeLeft > DebugConsole[j]->timeLeft
2900#define SWAP(i, j) temp = DebugConsole[i], DebugConsole[i] = DebugConsole[j], DebugConsole[j] = temp
2910 if (timeLeft < 20) {
2911 alpha =
round(254 * (timeLeft / 20.0f));
PartnerPopupProperties gPartnerPopupProperties[]
BSS s32 PopupMenu_SelectedIndex
BattleArea gBattleAreas[]
When updating this, make sure you also update:
#define ASSERT(condition)
@ MSG_READ_FUNC_RESTORE_COLOR
@ MSG_READ_FUNC_SAVE_COLOR
@ DEBUG_CONTACT_CANT_TOUCH
@ COLLIDER_FLAG_IGNORE_PLAYER
@ ENCOUNTER_SUBSTATE_PRE_BATTLE_INIT
@ SOUND_STAR_PIECE_BOUNCE
@ SOUND_UNUSED_STAR_SPIRIT_APPEARS
@ SOUND_STAR_POINT_PICKUP
@ ENCOUNTER_STATE_PRE_BATTLE
@ EVT_OP_LOOP
Args: number of repeats (0 = infinite)
@ EVT_OP_EXEC_GET_TID
Args: EvtScript*, container.
@ EVT_OP_MOD
Args: container, expression to divide by.
@ EVT_OP_DEBUG_BREAKPOINT
@ EVT_OP_FBUF_READ2
Args: container.
@ EVT_OP_UNBIND
Unbinds any triggers bound to this script.
@ EVT_OP_ADDF
Args: container, expression to increment by.
@ EVT_OP_FBUF_READ3
Args: container, container.
@ EVT_OP_SET_PRIORITY
Args: priority.
@ EVT_OP_DIVF
Args: container, expression to divide by.
@ EVT_OP_CASE_FLAG
Args: expression to test for.
@ EVT_OP_MULF
Args: container, expression to multiply by.
@ EVT_OP_SUSPEND_OTHERS
Args: group.
@ EVT_OP_SUSPEND_THREAD
Args: ScriptID.
@ EVT_OP_GOTO
Args: index.
@ EVT_OP_EXEC
Args: EvtScript*.
@ EVT_OP_USE_ARRAY
Args: *s32.
@ EVT_OP_MUL
Args: container, expression to multiply by.
@ EVT_OP_END_CASE_GROUP
Ends the case block of EVT_OP_CASE_OR_EQ condition(s).
@ EVT_OP_IF_LE
Args: a, b.
@ EVT_OP_IF_FLAG
Args: a, b.
@ EVT_OP_SET
Args: container, expression.
@ EVT_OP_IF_NE
Args: a, b.
@ EVT_OP_CASE_EQ
Args: expression to test for.
@ EVT_OP_BITWISE_OR_CONST
Args: container, value to bitwise OR with.
@ EVT_OP_USE_FBUF
Identical to USE_BUFFER. Args: f32*.
@ EVT_OP_SETF
Args: container, expression.
@ EVT_OP_CHILD_THREAD
Parallel threads are killed as soon as the parent script returns.
@ EVT_OP_CASE_GE
Args: expression to test for.
@ EVT_OP_IF_GT
Args: a, b.
@ EVT_OP_CASE_OR_EQ
Args: expression to test for.
@ EVT_OP_END_CHILD_THREAD
@ EVT_OP_DEBUG_PRINT_VAR
Args: expression.
@ EVT_OP_BUF_READ3
Args: container, container.
@ EVT_OP_DIV
Integer division. Args: container, expression to divide by.
@ EVT_OP_EXEC_WAIT
Spawns a script and waits for it to return before continuing. Args: EvtScript*.
@ EVT_OP_BUF_READ4
Args: container, container, container.
@ EVT_OP_ADD
Args: container, expression to increment by.
@ EVT_OP_FBUF_READ4
Args: container, container, container.
@ EVT_OP_SET_TIMESCALE
Args: timescale.
@ EVT_OP_USE_BUF
Args: s32*.
@ EVT_OP_USE_FLAGS
Args: *s32.
@ EVT_OP_CASE_RANGE
Args: from, to.
@ EVT_OP_BITWISE_AND_CONST
Args: container, value to bitwise AND with.
@ EVT_OP_SUBF
Args: container, expression to decrement by.
@ EVT_OP_JUMP
Args: EvtScript*.
@ EVT_OP_CASE_AND_EQ
Args: expression to test for.
@ EVT_OP_SWITCH
Args: expression to test against.
@ EVT_OP_CASE_LE
Args: expression to test for.
@ EVT_OP_SUB
Args: container, expression to decrement by.
@ EVT_OP_IF_GE
Args: a, b.
@ EVT_OP_CALL
Args: *function, ...
@ EVT_OP_IF_NOT_FLAG
Args: a, b.
@ EVT_OP_IS_THREAD_RUNNING
Args: ScriptID, container.
@ EVT_OP_IF_LT
Args: a, b.
@ EVT_OP_SWITCH_CONST
Args: value to test against.
@ EVT_OP_CASE_NE
Args: expression to test for.
@ EVT_OP_SET_CONST
Args: container, value.
@ EVT_OP_KILL_THREAD
Args: ScriptID.
@ EVT_OP_LABEL
Args: index.
@ EVT_OP_RESUME_OTHERS
Args: group.
@ EVT_OP_RESUME_THREAD
Args: ScriptID.
@ EVT_OP_BUF_READ2
Args: container.
@ EVT_OP_RESUME_GROUP
Args: group.
@ EVT_OP_BIND_TRIGGER
Args: EvtScript*, trigger flags, s32 target, 1, Trigger*.
@ EVT_OP_BITWISE_AND
Args: container, expression to bitwise AND with.
@ EVT_OP_CASE_GT
Args: expression to test for.
@ EVT_OP_BITWISE_OR
Args: container, expression to bitwise OR with.
@ EVT_OP_SET_GROUP
Args: group.
@ EVT_OP_BIND_PADLOCK
Args: EvtScript*, trigger flags, s32 target, ItemList*, 0, 1.
@ EVT_OP_SUSPEND_GROUP
Args: group.
@ EVT_OP_CASE_LT
Args: expression to test for.
@ EVT_OP_MALLOC_ARRAY
Allocates a new array. Args: length, s32*.
@ EVT_OP_BUF_PEEK
Args: container, container, container, container.
@ EVT_OP_IF_EQ
Args: a, b.
@ EVT_OP_FBUF_PEEK
Args: container, container, container, container.
b32 fio_load_game(s32 saveSlot)
void fio_save_game(s32 saveSlot)
s32 evt_get_variable(Evt *script, Bytecode var)
s32 play_ambient_sounds(s32 fadeInTime, s32 fadeOutTime)
void partner_disable_input(void)
void set_map_transition_effect(ScreenTransition)
s32 disable_player_input(void)
void open_status_bar_quickly(void)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
int _Printf(outfun prout, char *arg, const char *fmt, va_list args)
f32 evt_get_float_variable(Evt *script, Bytecode var)
void set_game_mode(s32 modeID)
s32 remove_item(s32 itemID)
Remove first instance of itemID found in player inventory.
b32 has_item(s32 itemID)
Check whether player has itemID in their inventory.
s32 add_item(s32 itemID)
Add itemID to player inventory and return inventory slot in which it was placed.
void dma_load_msg(u32 msgID, void *dest)
EncounterStatus gCurrentEncounter
void sfx_stop_sound(s32 soundID)
void sfx_play_sound(s32 soundID)
#define QSORT(Q_N, Q_LESS, Q_SWAP)
#define EVT_FIXED_TO_FLOAT(x)
Progammatically converts Float --> f32.
#define PANIC_MSG(msg, args...)
AreaConfig gAreas[29]
Zero-terminated.
BSS s32 gScriptIdList[MAX_SCRIPTS]
BSS s32 gScriptIndexList[MAX_SCRIPTS]
BSS ScriptList * gCurrentScriptListPtr
u8 dx_ascii_char_to_msg(char in)
u8 * dx_string_to_msg(u8 *msg, const char *str)
PlayerStatus * gPlayerStatusPtr
CollisionStatus gCollisionStatus
GameStatus * gGameStatusPtr
PlayerStatus gPlayerStatus
CollisionData gCollisionData
b32 EncounterStateChanged