From bd97821ba67cf7e43a149ecee2d27affc035baca Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Wed, 19 Jun 2024 19:10:52 +0200 Subject: [PATCH] added underscore to charmap.txt, updated tools/preproc --- charmap.txt | 1 + include/config/battle.h | 2 +- src/debug.c | 51 ++++++++++++++-------------------------- tools/preproc/c_file.cpp | 10 ++++++-- 4 files changed, 28 insertions(+), 36 deletions(-) diff --git a/charmap.txt b/charmap.txt index 7898fb519..66b8b5393 100644 --- a/charmap.txt +++ b/charmap.txt @@ -78,6 +78,7 @@ SUPER_RE = A0 '?' = AC '.' = AD '-' = AE +'_' = AE '·' = AF '…' = B0 '“' = B1 diff --git a/include/config/battle.h b/include/config/battle.h index 6bcd7b3cb..e0bb6d548 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -123,7 +123,7 @@ #define B_HEAL_BELL_SOUNDPROOF GEN_LATEST // In Gen5, Heal Bell affects all mons with Soundproof. In Gen6-8 it affects inactive mons, but not battlers. In Gen9 it always affects the user. // Ability settings -#define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. +#define B_EXPANDED_ABILITY_NAMES FALSE // If TRUE, ability names are increased from 12 characters to 16 characters. #define B_ABILITY_WEATHER GEN_LATEST // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability. #define B_GALE_WINGS GEN_LATEST // In Gen7+ requires full HP to trigger. #define B_STANCE_CHANGE_FAIL GEN_LATEST // In Gen7+, Stance Change fails if the Pokémon is unable to use a move because of confusion, paralysis, etc. In Gen6, it doesn't. diff --git a/src/debug.c b/src/debug.c index 1d038fb40..0e7efe539 100644 --- a/src/debug.c +++ b/src/debug.c @@ -4374,50 +4374,35 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) #undef tInput #undef tDigit -// #define SOUND_LIST_BGM -// X(MUS_CAUGHT) +#define SOUND_LIST_BGM \ + X(MUS_CAUGHT) \ -// #define SOUND_LIST_SE -// X(SE_USE_ITEM) +#define SOUND_LIST_SE \ + X(SE_USE_ITEM) \ -// // Create BGM list -// #define X(songId) static const u8 sBGMName_##songId[] = _(#songId); -// SOUND_LIST_BGM -// #undef X - -// #define X(songId) sBGMName_##songId, -// static const u8 *const sBGMNames[] = -// { -// SOUND_LIST_BGM -// }; -// #undef X - -// // Create SE list -// #define X(songId) static const u8 sSEName_##songId[] = _(#songId); -// SOUND_LIST_SE -// #undef X - -// #define X(songId) sSEName_##songId, -// static const u8 *const sSENames[] = -// { -// SOUND_LIST_SE -// }; -// #undef X - - -static const u8 sBGMName_MUS_Caught[] = _("Caught"); +// Create BGM list +#define X(songId) static const u8 sBGMName_##songId[] = _(#songId); +SOUND_LIST_BGM +#undef X +#define X(songId) sBGMName_##songId, static const u8 *const sBGMNames[] = { -sBGMName_MUS_Caught, +SOUND_LIST_BGM }; +#undef X -static const u8 sSEName_SE_UseItem[] = _("UseItem"); +// Create SE list +#define X(songId) static const u8 sSEName_##songId[] = _(#songId); +SOUND_LIST_SE +#undef X +#define X(songId) sSEName_##songId, static const u8 *const sSENames[] = { -sSEName_SE_UseItem, +SOUND_LIST_SE }; +#undef X // ******************************* // Actions Party/Boxes diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 508c62873..2548f38dc 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -321,10 +321,10 @@ int ExtractData(const std::unique_ptr& buffer, int offset, int void CFile::TryConvertIncbin() { - std::string idents[6] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32" }; + std::string idents[8] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32", "DUMMY_PLACEHOLDER", "INCBIN_COMP"}; int incbinType = -1; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 8; i++) { if (CheckIdentifier(idents[i])) { @@ -337,6 +337,8 @@ void CFile::TryConvertIncbin() return; int size = 1 << (incbinType / 2); + if (size > 4) + size = 4; bool isSigned = ((incbinType % 2) == 0); long oldPos = m_pos; @@ -389,6 +391,10 @@ void CFile::TryConvertIncbin() std::string path(&m_buffer[startPos], m_pos - startPos); + // INCBIN_COMP; include *compressed* version of file + if (incbinType == 7) + path = path.append(".lz"); + m_pos++; int fileSize;