Applying formatting and moving libraries into specific folders

This commit is contained in:
GearsProgress
2026-10-18 11:07:35 -04:00
parent 1e90aa40ce
commit f1e2b62e4a
74 changed files with 6147 additions and 5199 deletions

View File

@@ -1,16 +1,16 @@
#include "rom_data.h"
#include "dbg/debug_mode.h"
#include "pokemon_data.h"
#include "text_engine.h"
#include "ptgb_save_data_manager.h"
#include "gba_rom_values/gba_rom_values.h"
#include "libraries/nanoprintf/nanoprintf.h"
#include "gba_rom_values_eng_lz10_bin.h"
#include "gba_rom_values_fre_lz10_bin.h"
#include "gba_rom_values_ger_lz10_bin.h"
#include "gba_rom_values_ita_lz10_bin.h"
#include "gba_rom_values_jpn_lz10_bin.h"
#include "gba_rom_values_spa_lz10_bin.h"
#include "libraries/nanoprintf/nanoprintf.h"
#include "pokemon_data.h"
#include "ptgb_save_data_manager.h"
#include "text_engine.h"
extern rom_data curr_GBA_rom;
@@ -69,7 +69,8 @@ bool rom_data::load_rom(bool debug)
}*/
// byte 2-4 of the compressed data store the decompressed size
rom_list_size = compressed_rom_list[1] | (compressed_rom_list[2] << 8) | (compressed_rom_list[3] << 16);
rom_list_size = compressed_rom_list[1] | (compressed_rom_list[2] << 8) |
(compressed_rom_list[3] << 16);
LZ77UnCompWram(compressed_rom_list, rom_list_buffer);
cur = rom_list_buffer;
@@ -78,7 +79,8 @@ bool rom_data::load_rom(bool debug)
{
const ROM_DATA *rom_values = reinterpret_cast<const ROM_DATA *>(cur);
if (rom_values->is_valid && rom_values->gamecode == gamecode &&
rom_values->version == version && (rom_values->entrypoint == entrypoint || debug))
rom_values->version == version &&
(rom_values->entrypoint == entrypoint || debug))
{
fill_values(rom_values);
rom_loaded = true;
@@ -103,11 +105,20 @@ void rom_data::fill_values(const ROM_DATA *rom_values)
offset_wondercard = rom_values->offset_wondercard;
offset_script = rom_values->offset_script;
e4_flag = rom_values->e4_flag; // The flag that is set when you become champion. Often listed as "GAME_CLEAR"
mg_flag = rom_values->mg_flag; // The flag that is set when you enable Mystery Gift. Known as "EXDATA_ENABLE" in RS
unused_flag_start = rom_values->unused_flag_start; // The start of the unused flags and must have 31 open flags in a row
all_collected_flag = rom_values->unused_flag_start; // The flag for if everything has been collected
pkmn_collected_flag_start = rom_values->unused_flag_start + 1; // The beginning of the flags for each of the Pokemon
e4_flag = rom_values->e4_flag; // The flag that is set when you become
// champion. Often listed as "GAME_CLEAR"
mg_flag =
rom_values->mg_flag; // The flag that is set when you enable Mystery
// Gift. Known as "EXDATA_ENABLE" in RS
unused_flag_start =
rom_values->unused_flag_start; // The start of the unused flags and must
// have 31 open flags in a row
all_collected_flag =
rom_values->unused_flag_start; // The flag for if everything has been
// collected
pkmn_collected_flag_start =
rom_values->unused_flag_start +
1; // The beginning of the flags for each of the Pokemon
map_bank = rom_values->map_bank;
map_id = rom_values->map_id;
@@ -120,7 +131,8 @@ void rom_data::fill_values(const ROM_DATA *rom_values)
bool rom_data::is_hoenn()
{
return (gamecode == RUBY_ID || gamecode == SAPPHIRE_ID || gamecode == EMERALD_ID);
return (gamecode == RUBY_ID || gamecode == SAPPHIRE_ID ||
gamecode == EMERALD_ID);
}
bool rom_data::is_ruby_sapphire()
@@ -154,7 +166,8 @@ void rom_data::print_rom_info()
break;
}
npf_snprintf(buffer, sizeof(buffer), "%c-%d-%c", gameTypeChar, version, language);
npf_snprintf(
buffer, sizeof(buffer), "%c-%d-%c", gameTypeChar, version, language);
ptgb_write_simple(reinterpret_cast<const byte *>(buffer), true);
}
@@ -162,9 +175,10 @@ void rom_data::print_rom_info()
bool rom_data::verify_rom()
{
// This should really be replaced with a "cart pulled" interrupt
return !rom_loaded ||
g_debug_options.ignore_game_pak ||
((gamecode == ((*(vu8 *)(0x80000AC)) << 0x10 | (*(vu8 *)(0x80000AD)) << 0x08 | (*(vu8 *)(0x80000AE)) << 0x00)) &&
(language == (*(vu8 *)(0x80000AF))) &&
(version == (*(vu8 *)(0x80000BC))));
return !rom_loaded || g_debug_options.ignore_game_pak ||
((gamecode ==
((*(vu8 *)(0x80000AC)) << 0x10 | (*(vu8 *)(0x80000AD)) << 0x08 |
(*(vu8 *)(0x80000AE)) << 0x00)) &&
(language == (*(vu8 *)(0x80000AF))) &&
(version == (*(vu8 *)(0x80000BC))));
}