Working on debugging

This commit is contained in:
The Gears of Progress 2025-12-03 22:08:35 -05:00
parent 37bbc0c2d2
commit 9ca5c650d0
7 changed files with 35 additions and 27 deletions

View File

@ -1,5 +1,5 @@
# Build configuration (set to either 'debug' or 'release')
BUILD_TYPE := release
BUILD_TYPE := debug
#---------------------------------------------------------------------------------
.SUFFIXES:

View File

@ -1,16 +1,16 @@
#ifndef DEBUG_MODE_H
#define DEBUG_MODE_H
#define VERSION "v1.2.0"
#define VERSION "v1.3.0b"
#define PTGB_BUILD_LANGUAGE 2
#define DEBUG_MODE false
#define DEBUG_MODE true
#define PRINT_LINK_DATA (true && DEBUG_MODE)
#define PRINT_LINK_DATA (false && DEBUG_MODE)
#define INSTANT_TEXT_SPEED (false && DEBUG_MODE)
#define IGNORE_GAME_PAK (false && DEBUG_MODE)
#define IGNORE_GAME_PAK_SPRITES (true && DEBUG_MODE)
#define IGNORE_LINK_CABLE (true && DEBUG_MODE)
#define IGNORE_GAME_PAK (true && DEBUG_MODE)
#define IGNORE_GAME_PAK_SPRITES (false && DEBUG_MODE)
#define IGNORE_LINK_CABLE (false && DEBUG_MODE)
#define IGNORE_MG_E4_FLAGS (true && DEBUG_MODE)
#define IGNORE_UNRECEIVED_PKMN (true && DEBUG_MODE)
#define FORCE_TUTORIAL (false && DEBUG_MODE)
@ -22,6 +22,8 @@
#define SHOW_DATA_PACKETS (false && DEBUG_MODE)
#define DISPLAY_CONTROL_CHAR (false && DEBUG_MODE)
#define PAYLOAD_EXPORT_TEST (false && DEBUG_MODE)
#define DONT_TRANSFER_POKEMON_AT_INDEX_X (false && DEBUG_MODE)
#define POKEMON_INDEX_TO_SKIP 5
#define DEBUG_GAME EMERALD_ID
#define DEBUG_VERS VERS_1_0

View File

@ -598,7 +598,10 @@ byte exchange_remove_array(byte curr_in, PokeBox *box, bool cancel_connection)
if (box->getGen3Pokemon(i)->isValid && !cancel_connection)
{
box->removePokemon(i);
return i;
if (!(DONT_TRANSFER_POKEMON_AT_INDEX_X && i == POKEMON_INDEX_TO_SKIP))
{
return i;
}
}
}
return 0xFF;

View File

@ -78,21 +78,6 @@ bool inject_mystery(PokeBox* box)
erase_sector(memory_section_array[4]);
copy_ram_to_save(&global_memory_buffer[0], memory_section_array[4], 0x1000);
if (WRITE_CABLE_DATA_TO_SAVE)
{
for (int i = 0; i < 1122; i++)
{
// global_memory_buffer[i] = incoming_box_data.box_data_array[i];
while(true){}
// This is currently not possible(?)
}
for (int i = 0; i < 0x1000 - 1122; i++)
{
global_memory_buffer[i + 1122] = 0xAA;
}
copy_ram_to_save(&global_memory_buffer[0], 0x0000, 0x1000);
}
// Set flags
int memory_section = 1 + ((curr_GBA_rom.offset_flags + (curr_GBA_rom.unused_flag_start / 8)) / 0xF80); // This sets the correct memory section, since flags stretch between section 1 and 2.
copy_save_to_ram(memory_section_array[memory_section], &global_memory_buffer[0], 0x1000);

File diff suppressed because one or more lines are too long

View File

@ -904,7 +904,7 @@ bool run_conditional(int index)
return true;
case CMD_IS_A_VALID_PKMN:
return party_data.box.getNumValid() > 0;
return party_data.box.getNumValid() > 0 || DONT_HIDE_INVALID_PKMN;
case CMD_CANCEL_LINK:
party_data.continue_link(true);

View File

@ -963,7 +963,7 @@ void init_payload(byte *payload_buffer, const GB_ROM &curr_rom, int type, bool d
#if PAYLOAD_EXPORT_TEST
#include <cstdio>
#include "gb_rom_values/gb_rom_values.h"
int main() // Rename to "main" to send the payload to test_payload.txt
int main()
{
byte buffer[672] = {0};
freopen("test_payload.txt", "w", stdout);