Merge branch 'tx_debug_system' of https://github.com/TheXaman/pokeemerald into tx_debug_system_rhh

This commit is contained in:
TheXaman 2022-08-29 19:13:11 +02:00
commit 8c9a59ec1c
25 changed files with 3975 additions and 24 deletions

View File

@ -577,6 +577,8 @@ gStdScripts_End::
.include "data/scripts/new_game.inc"
.include "data/scripts/hall_of_fame.inc"
.include "data/scripts/debug.inc"
EventScript_WhiteOut::
call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour
goto EventScript_ResetMrBriney

85
data/scripts/debug.inc Normal file
View File

@ -0,0 +1,85 @@
Debug_ShowFieldMessageStringVar4::
special ShowFieldMessageStringVar4
waitmessage
waitbuttonpress
releaseall
end
Debug_CheckWeekDay_Text:
.string "Aaaaah, yes!\l"
.string "{STR_VAR_1}s are made for dads!\l"
.string "And dad's car!$"
Debug_CheatStart::
lockall
setflag FLAG_SYS_POKEMON_GET
setflag FLAG_RESCUED_BIRCH
setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE
setflag FLAG_ADVENTURE_STARTED
clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH
setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG
setvar VAR_BIRCH_LAB_STATE, 2
setvar VAR_ROUTE101_STATE, 3
givemon SPECIES_TREECKO, 20, ITEM_NONE
givemon SPECIES_TORCHIC, 20, ITEM_NONE
givemon SPECIES_MUDKIP, 20, ITEM_NONE
setflag FLAG_SYS_POKEDEX_GET
special SetUnlockedPokedexFlags
setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH
setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 1
@ setflag FLAG_SYS_NATIONAL_DEX
@ special EnableNationalPokedex
setflag FLAG_RECEIVED_RUNNING_SHOES
setflag FLAG_SYS_B_DASH
setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes
setvar VAR_LITTLEROOT_INTRO_STATE, 7 @ 7: Told to go meet rival
setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 2 @ 2: Met Rival's Mom (and is corresponding gender)
setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender)
setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex
setflag FLAG_RECEIVED_BIKE
giveitem ITEM_ACRO_BIKE
setvar VAR_BRINEY_HOUSE_STATE, 1
setvar VAR_ROUTE116_STATE, 2
setflag FLAG_HIDE_ROUTE_116_MR_BRINEY
clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY
clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO
@ additem ITEM_MAX_REPEL, 10
@ giveitem ITEM_EON_TICKET
@ setflag FLAG_SYS_HAS_EON_TICKET
@ setvar VAR_DISTRIBUTE_EON_TICKET, 0
@ giveitem ITEM_MYSTIC_TICKET
@ setflag FLAG_ENABLE_SHIP_NAVEL_ROCK
@ setflag FLAG_RECEIVED_MYSTIC_TICKET
@ giveitem ITEM_AURORA_TICKET
@ setflag FLAG_ENABLE_SHIP_BIRTH_ISLAND
@ setflag FLAG_RECEIVED_AURORA_TICKET
@ setflag FLAG_BADGE06_GET @ Badge for flying filed move
@ setweather WEATHER_VOLCANIC_ASH
@ doweather
closemessage
release
end
Debug_Script_1::
end
Debug_Script_2::
end
Debug_Script_3::
end
Debug_Script_4::
end
Debug_Script_5::
end
Debug_Script_6::
end
Debug_Script_7::
end
Debug_Script_8::
end

View File

@ -40,13 +40,13 @@
#define FLAG_TEMP_1E (TEMP_FLAGS_START + 0x1E)
#define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F)
#define TEMP_FLAGS_END FLAG_TEMP_1F
#define FLAG_UNUSED_0x020 0x20 // Unused Flag
#define FLAG_UNUSED_0x021 0x21 // Unused Flag
#define FLAG_UNUSED_0x022 0x22 // Unused Flag
#define FLAG_UNUSED_0x023 0x23 // Unused Flag
#define FLAG_UNUSED_0x024 0x24 // Unused Flag
#define FLAG_UNUSED_0x025 0x25 // Unused Flag
#define FLAG_SYS_NO_COLLISION 0x20 // Unused Flag //DEBUG
#define FLAG_SYS_NO_ENCOUNTER 0x21 // Unused Flag //DEBUG
#define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG
#define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG
#define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG
#define FLAG_SYS_PC_FROM_DEBUG_MENU 0x25 // Unused Flag //DEBUG
#define FLAG_UNUSED_0x026 0x26 // Unused Flag
#define FLAG_UNUSED_0x027 0x27 // Unused Flag
#define FLAG_UNUSED_0x028 0x28 // Unused Flag

View File

@ -593,4 +593,6 @@
#define MAP_GROUPS_COUNT 34
// static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0};
#endif // GUARD_CONSTANTS_MAP_GROUPS_H

View File

@ -276,8 +276,10 @@
#define SE_PIKE_CURTAIN_CLOSE 267 // SE_CURTAIN
#define SE_PIKE_CURTAIN_OPEN 268 // SE_CURTAIN1
#define SE_SUDOWOODO_SHAKE 269 // SE_USSOKI
#define END_SE SE_SUDOWOODO_SHAKE
// Music
#define START_MUS 350
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13
#define MUS_CAUGHT 352 // MUS_KACHI22
@ -488,6 +490,7 @@
#define MUS_RG_TRAINER_TOWER 556 // MUS_RG_T_TOWER
#define MUS_RG_SLOW_PALLET 557 // MUS_RG_SLOWMASARA
#define MUS_RG_TEACHY_TV_MENU 558 // MUS_RG_TVNOIZE
#define END_MUS MUS_RG_TEACHY_TV_MENU
#define PH_TRAP_BLEND 559
#define PH_TRAP_HELD 560

11
include/debug.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_DEBUG_H
#define GUARD_DEBUG_H
#define TX_DEBUGGING
#define TX_DEBUG_MENU_OPTION FALSE
void Debug_ShowMainMenu(void);
#endif // GUARD_DEBUG_H

View File

@ -20,10 +20,12 @@ void EnableResetRTC(void);
bool32 CanResetRTC(void);
u16 *GetVarPointer(u16 id);
u16 VarGet(u16 id);
u16 VarGetIfExist(u16 id);
bool8 VarSet(u16 id, u16 value);
u8 VarGetObjectEventGraphicsId(u8 id);
u8 *GetFlagPointer(u16 id);
u8 FlagSet(u16 id);
u8 FlagToggle(u16 id);
u8 FlagClear(u16 id);
bool8 FlagGet(u16 id);

View File

@ -2,6 +2,7 @@
#define GUARD_MAIN_MENU_H
void CB2_InitMainMenu(void);
void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum);
void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f);
void NewGameBirchSpeech_SetDefaultPlayerName(u8);
#endif // GUARD_MAIN_MENU_H

View File

@ -463,6 +463,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg);
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
void CopyMon(void *dest, void *src, size_t size);
u8 GiveMonToPlayer(struct Pokemon *mon);
u8 SendMonToPC(struct Pokemon* mon);
u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void);
u8 GetMonsStateToDoubles(void);

View File

@ -72,4 +72,6 @@ u8 *GetWaldaPhrasePtr(void);
void SetWaldaPhrase(const u8 *src);
bool32 IsWaldaPhraseEmpty(void);
void EnterPokeStorage(u8 boxOption);
#endif // GUARD_POKEMON_STORAGE_SYSTEM_H

View File

@ -105,6 +105,7 @@ SECTIONS {
src/random.o(.text);
src/util.o(.text);
src/daycare.o(.text);
src/debug.o(.text);
src/egg_hatch.o(.text);
src/battle_interface.o(.text);
src/battle_anim_smokescreen.o(.text);
@ -495,6 +496,7 @@ SECTIONS {
src/trig.o(.rodata);
src/util.o(.rodata);
src/daycare.o(.rodata);
src/debug.o(.rodata);
src/egg_hatch.o(.rodata);
src/battle_gfx_sfx_util.o(.rodata);
src/battle_interface.o(.rodata);

View File

@ -16,6 +16,7 @@
#include "berry.h"
#include "bg.h"
#include "data.h"
#include "debug.h"
#include "decompress.h"
#include "dma3.h"
#include "event_data.h"
@ -4000,13 +4001,21 @@ static void HandleTurnActionSelectionState(void)
}
break;
case B_ACTION_USE_ITEM:
if ((gBattleTypeFlags & (BATTLE_TYPE_LINK
#ifdef TX_DEBUGGING
if (FlagGet(FLAG_SYS_NO_BAG_USE) || (gBattleTypeFlags & (BATTLE_TYPE_LINK //DEBUG
| BATTLE_TYPE_FRONTIER_NO_PYRAMID
| BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_RECORDED_LINK))
// Or if currently held by Sky Drop
|| gStatuses3[gActiveBattler] & STATUS3_SKY_DROPPED)
{
#else //DEBUG
if (gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_FRONTIER_NO_PYRAMID
| BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_RECORDED_LINK))
{
#endif
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed;
gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT;

3669
src/debug.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -184,6 +184,14 @@ u16 VarGet(u16 id)
return *ptr;
}
u16 VarGetIfExist(u16 id)
{
u16 *ptr = GetVarPointer(id);
if (!ptr)
return 65535;
return *ptr;
}
bool8 VarSet(u16 id, u16 value)
{
u16 *ptr = GetVarPointer(id);
@ -216,6 +224,14 @@ u8 FlagSet(u16 id)
return 0;
}
u8 FlagToggle(u16 id)
{
u8 *ptr = GetFlagPointer(id);
if (ptr)
*ptr ^= 1 << (id & 7);
return 0;
}
u8 FlagClear(u16 id)
{
u8 *ptr = GetFlagPointer(id);

View File

@ -2,6 +2,7 @@
#include "malloc.h"
#include "battle_pyramid.h"
#include "berry.h"
#include "debug.h"
#include "decoration.h"
#include "event_data.h"
#include "event_object_movement.h"
@ -4628,6 +4629,12 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction)
u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
{
u8 direction = dir;
#ifdef TX_DEBUGGING //DEBUG
if (FlagGet(FLAG_SYS_NO_COLLISION))
return COLLISION_NONE;
#endif //
if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y))
return COLLISION_OUTSIDE_RANGE;
else if (MapGridGetCollisionAt(x, y) || GetMapBorderIdAt(x, y) == CONNECTION_INVALID || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction))

View File

@ -3,6 +3,7 @@
#include "bike.h"
#include "coord_event_weather.h"
#include "daycare.h"
#include "debug.h"
#include "faraway_island.h"
#include "event_data.h"
#include "event_object_movement.h"
@ -129,6 +130,37 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
input->dpadDirection = DIR_WEST;
else if (heldKeys & DPAD_RIGHT)
input->dpadDirection = DIR_EAST;
//DEBUG
#ifdef TX_DEBUGGING
if (!TX_DEBUG_MENU_OPTION)
{
if (heldKeys & R_BUTTON)
{
if(input->pressedSelectButton)
{
input->input_field_1_0 = TRUE;
input->pressedSelectButton = FALSE;
}else if(input->pressedStartButton)
{
input->input_field_1_2 = TRUE;
input->pressedStartButton = FALSE;
}
}
if (heldKeys & L_BUTTON)
{
if(input->pressedSelectButton)
{
input->input_field_1_1 = TRUE;
input->pressedSelectButton = FALSE;
}else if(input->pressedStartButton)
{
input->input_field_1_3 = TRUE;
input->pressedStartButton = FALSE;
}
}
}
#endif
}
int ProcessPlayerFieldInput(struct FieldInput *input)
@ -188,6 +220,18 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
return TRUE;
#ifdef TX_DEBUGGING
if (!TX_DEBUG_MENU_OPTION)
{
if (input->input_field_1_2)
{
PlaySE(SE_WIN_OPEN);
Debug_ShowMainMenu();
return TRUE;
}
}
#endif
return FALSE;
}
@ -668,6 +712,11 @@ void RestartWildEncounterImmunitySteps(void)
static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
{
#ifdef TX_DEBUGGING
if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) //DEBUG
return FALSE;//
#endif
if (sWildEncounterImmunitySteps < 4)
{
sWildEncounterImmunitySteps++;
@ -683,7 +732,7 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
}
sPreviousPlayerMetatileBehavior = metatileBehavior;
return FALSE;
return FALSE;
}
static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction)

View File

@ -9,6 +9,7 @@
#include "bike.h"
#include "coins.h"
#include "data.h"
#include "debug.h"
#include "event_data.h"
#include "event_object_lock.h"
#include "event_object_movement.h"
@ -981,6 +982,14 @@ static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThe
static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p");
void ItemUseInBattle_PokeBall(u8 taskId)
{
#ifdef TX_DEBUGGING
if (FlagGet(FLAG_SYS_NO_CATCHING)){ //DEBUG
static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p");
DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage);
return;
}
#endif
switch (GetBallThrowableState())
{
case BALL_THROW_ABLE:

View File

@ -12,6 +12,7 @@
#include "international_string_util.h"
#include "link.h"
#include "main.h"
#include "main_menu.h"
#include "menu.h"
#include "list_menu.h"
#include "mystery_event_menu.h"
@ -223,7 +224,6 @@ static void Task_NewGameBirchSpeech_WaitForWhatsYourNameToPrint(u8);
static void Task_NewGameBirchSpeech_WaitPressBeforeNameChoice(u8);
static void Task_NewGameBirchSpeech_StartNamingScreen(u8);
static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void);
static void NewGameBirchSpeech_SetDefaultPlayerName(u8);
static void Task_NewGameBirchSpeech_CreateNameYesNo(u8);
static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8);
void CreateYesNoMenuParameterized(u8, u8, u16, u16, u8, u8);
@ -2100,7 +2100,7 @@ static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void)
return Menu_ProcessInputNoWrap();
}
static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
{
const u8 *name;
u8 i;

View File

@ -90,7 +90,7 @@ static void InitPlayerTrainerId(void)
// L=A isnt set here for some reason.
static void SetDefaultOptions(void)
{
gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID;
gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_FAST;
gSaveBlock2Ptr->optionsWindowFrameType = 0;
gSaveBlock2Ptr->optionsSound = OPTIONS_SOUND_MONO;
gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT;

View File

@ -65,7 +65,6 @@ static void DecryptBoxMon(struct BoxPokemon *boxMon);
static void Task_PlayMapChosenOrBattleBGM(u8 taskId);
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
static bool8 ShouldSkipFriendshipChange(void);
static u8 SendMonToPC(struct Pokemon *mon);
static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv);
void TrySpecialOverworldEvo();
@ -5148,7 +5147,7 @@ u8 GiveMonToPlayer(struct Pokemon *mon)
return MON_GIVEN_TO_PARTY;
}
static u8 SendMonToPC(struct Pokemon *mon)
u8 SendMonToPC(struct Pokemon* mon)
{
s32 boxNo, boxPos;

View File

@ -579,7 +579,6 @@ EWRAM_DATA static bool8 sAutoActionOn = 0;
EWRAM_DATA static bool8 sJustOpenedBag = 0;
// Main tasks
static void EnterPokeStorage(u8);
static void Task_InitPokeStorage(u8);
static void Task_PlaceMon(u8);
static void Task_ChangeScreen(u8);
@ -1670,10 +1669,15 @@ static void FieldTask_ReturnToPcMenu(void)
MainCallback vblankCb = gMain.vblankCallback;
SetVBlankCallback(NULL);
taskId = CreateTask(Task_PCMainMenu, 80);
gTasks[taskId].tState = 0;
gTasks[taskId].tSelectedOption = sPreviousBoxOption;
Task_PCMainMenu(taskId);
if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) {
taskId = CreateTask(Task_PCMainMenu, 80);
gTasks[taskId].tState = 0;
gTasks[taskId].tSelectedOption = sPreviousBoxOption;
Task_PCMainMenu(taskId);
} else {
FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU);
ScriptContext_Enable();
}
SetVBlankCallback(vblankCb);
FadeInFromBlack();
}
@ -2003,7 +2007,7 @@ static void CB2_PokeStorage(void)
BuildOamBuffer();
}
static void EnterPokeStorage(u8 boxOption)
void EnterPokeStorage(u8 boxOption)
{
ResetTasks();
sCurrentBoxOption = boxOption;

View File

@ -3,6 +3,7 @@
#include "battle_pyramid.h"
#include "battle_pyramid_bag.h"
#include "bg.h"
#include "debug.h"
#include "event_data.h"
#include "event_object_movement.h"
#include "event_object_lock.h"
@ -62,7 +63,8 @@ enum
MENU_ACTION_PLAYER_LINK,
MENU_ACTION_REST_FRONTIER,
MENU_ACTION_RETIRE_FRONTIER,
MENU_ACTION_PYRAMID_BAG
MENU_ACTION_PYRAMID_BAG,
MENU_ACTION_DEBUG,
};
// Save status
@ -103,6 +105,7 @@ static bool8 StartMenuSafariZoneRetireCallback(void);
static bool8 StartMenuLinkModePlayerNameCallback(void);
static bool8 StartMenuBattlePyramidRetireCallback(void);
static bool8 StartMenuBattlePyramidBagCallback(void);
static bool8 StartMenuDebugCallback(void);
// Menu callbacks
static bool8 SaveStartCallback(void);
@ -154,6 +157,8 @@ static const u8 *const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] =
static const struct WindowTemplate sPyramidFloorWindowTemplate_2 = {0, 1, 1, 0xA, 4, 0xF, 8};
static const struct WindowTemplate sPyramidFloorWindowTemplate_1 = {0, 1, 1, 0xC, 4, 0xF, 8};
static const u8 gText_MenuDebug[] = _("DEBUG");
static const struct MenuAction sStartMenuItems[] =
{
[MENU_ACTION_POKEDEX] = {gText_MenuPokedex, {.u8_void = StartMenuPokedexCallback}},
@ -168,7 +173,8 @@ static const struct MenuAction sStartMenuItems[] =
[MENU_ACTION_PLAYER_LINK] = {gText_MenuPlayer, {.u8_void = StartMenuLinkModePlayerNameCallback}},
[MENU_ACTION_REST_FRONTIER] = {gText_MenuRest, {.u8_void = StartMenuSaveCallback}},
[MENU_ACTION_RETIRE_FRONTIER] = {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}},
[MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}}
[MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}},
[MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}},
};
static const struct BgTemplate sBgTemplates_LinkBattleSave[] =
@ -212,6 +218,7 @@ static const struct WindowTemplate sSaveInfoWindowTemplate = {
static void BuildStartMenuActions(void);
static void AddStartMenuAction(u8 action);
static void BuildNormalStartMenu(void);
static void BuildDebugStartMenu(void);
static void BuildSafariZoneStartMenu(void);
static void BuildLinkModeStartMenu(void);
static void BuildUnionRoomStartMenu(void);
@ -240,6 +247,7 @@ static void CB2_SaveAfterLinkBattle(void);
static void ShowSaveInfoWindow(void);
static void RemoveSaveInfoWindow(void);
static void HideStartMenuWindow(void);
static void HideStartMenuDebug(void);
void SetDexPokemonPokenavFlags(void) // unused
{
@ -276,10 +284,17 @@ static void BuildStartMenuActions(void)
{
BuildMultiPartnerRoomStartMenu();
}
#if defined(TX_DEBUGGING) && TX_DEBUG_MENU_OPTION
else
{
BuildDebugStartMenu();
}
#else
else
{
BuildNormalStartMenu();
}
#endif
}
static void AddStartMenuAction(u8 action)
@ -311,6 +326,30 @@ static void BuildNormalStartMenu(void)
AddStartMenuAction(MENU_ACTION_EXIT);
}
static void BuildDebugStartMenu(void)
{
if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE)
{
AddStartMenuAction(MENU_ACTION_POKEDEX);
}
if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)
{
AddStartMenuAction(MENU_ACTION_POKEMON);
}
AddStartMenuAction(MENU_ACTION_BAG);
if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE)
{
AddStartMenuAction(MENU_ACTION_POKENAV);
}
AddStartMenuAction(MENU_ACTION_PLAYER);
AddStartMenuAction(MENU_ACTION_SAVE);
AddStartMenuAction(MENU_ACTION_OPTION);
AddStartMenuAction(MENU_ACTION_DEBUG);
}
static void BuildSafariZoneStartMenu(void)
{
AddStartMenuAction(MENU_ACTION_RETIRE_SAFARI);
@ -592,6 +631,7 @@ static bool8 HandleStartMenuInput(void)
if (gMenuCallback != StartMenuSaveCallback
&& gMenuCallback != StartMenuExitCallback
&& gMenuCallback != StartMenuDebugCallback
&& gMenuCallback != StartMenuSafariZoneRetireCallback
&& gMenuCallback != StartMenuBattlePyramidRetireCallback)
{
@ -727,6 +767,18 @@ static bool8 StartMenuExitCallback(void)
return TRUE;
}
static bool8 StartMenuDebugCallback(void)
{
RemoveExtraStartMenuWindows();
HideStartMenuDebug(); // Hide start menu without enabling movement
#ifdef TX_DEBUGGING
Debug_ShowMainMenu();
#endif
return TRUE;
}
static bool8 StartMenuSafariZoneRetireCallback(void)
{
RemoveExtraStartMenuWindows();
@ -736,6 +788,13 @@ static bool8 StartMenuSafariZoneRetireCallback(void)
return TRUE;
}
static void HideStartMenuDebug(void)
{
PlaySE(SE_SELECT);
ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE);
RemoveStartMenuWindow();
}
static bool8 StartMenuLinkModePlayerNameCallback(void)
{
if (!gPaletteFade.active)

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "battle_setup.h"
#include "debug.h"
#include "event_data.h"
#include "event_object_movement.h"
#include "field_effect.h"
@ -192,6 +193,11 @@ bool8 CheckForTrainersWantingBattle(void)
{
u8 i;
#ifdef TX_DEBUGGING //DEBUG
if (FlagGet(FLAG_SYS_NO_TRAINER_SEE))
return FALSE;
#endif //
gNoOfApproachingTrainers = 0;
gApproachingTrainerId = 0;

View File

@ -148,3 +148,4 @@
.include "src/faraway_island.o"
.include "src/trainer_hill.o"
.include "src/rayquaza_scene.o"
.include "src/debug.o"

View File

@ -393,11 +393,14 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
int group_num = 0;
vector<int> map_count_vec; //DEBUG
for (auto &group : groups_data["group_order"].array_items()) {
text << "// " << group.string_value() << "\n";
vector<Json> map_ids;
size_t max_length = 0;
size_t max_length = 0; //DEBUG
int map_count = 0; //DEBUG
for (auto &map_name : groups_data[group.string_value()].array_items()) {
string header_filepath = file_dir + map_name.string_value() + dir_separator + "map.json";
@ -406,6 +409,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
map_ids.push_back(map_data["id"]);
if (map_data["id"].string_value().length() > max_length)
max_length = map_data["id"].string_value().length();
map_count++; //DEBUG
}
int map_id_num = 0;
@ -416,9 +420,17 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
text << "\n";
group_num++;
map_count_vec.push_back(map_count); //DEBUG
}
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG
for(int i=0; i<group_num; i++){ //DEBUG
text << map_count_vec[i] << ", "; //DEBUG
} //DEBUG
text << "0};\n\n"; //DEBUG
text << "#endif // GUARD_CONSTANTS_MAP_GROUPS_H\n";
return text.str();