mirror of
https://github.com/GearsProgress/Poke_Transporter_GB.git
synced 2026-04-25 16:23:20 -05:00
I found another way to optimize the rom space by implementing a custom malloc, free, realloc and calloc function. This reduces rom size by 3 KB and IWRAM usage by 1 KB. (elimination of __malloc_av). The original implementation is much more complex and larger than it needs to be. The custom malloc is implemented as a bitmap allocator. It keeps a bitmap to track which pages of the heap are allocated. Like the original allocator, it uses the free space in EWRAM after the multiboot gba rom. But unlike the original allocator, we control the size with CUSTOM_MALLOC_POOL_SIZE. The custom malloc can be disabled with USE_CUSTOM_MALLOC.
38 lines
1.2 KiB
C
38 lines
1.2 KiB
C
#ifndef DEBUG_MODE_H
|
|
#define DEBUG_MODE_H
|
|
|
|
#define VERSION "v1.2.0b"
|
|
#define PTGB_BUILD_LANGUAGE ENG_ID
|
|
|
|
#define DEBUG_MODE false
|
|
|
|
#define PRINT_LINK_DATA (false && DEBUG_MODE) // This is currently broken... not sure why
|
|
#define INSTANT_TEXT_SPEED (false && 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)
|
|
#define DONT_REMOVE_PKMN (false && DEBUG_MODE)
|
|
#define DONT_HIDE_INVALID_PKMN (false && DEBUG_MODE)
|
|
#define IGNORE_DEX_COMPLETION (false && DEBUG_MODE)
|
|
#define FORCE_ALL_CAUGHT (true && DEBUG_MODE)
|
|
#define WRITE_CABLE_DATA_TO_SAVE (false && DEBUG_MODE)
|
|
#define SHOW_DATA_PACKETS (false && DEBUG_MODE)
|
|
#define DISPLAY_CONTROL_CHAR (false && DEBUG_MODE)
|
|
#define PAYLOAD_EXPORT_TEST (false && DEBUG_MODE)
|
|
|
|
#define DEBUG_GAME EMERALD_ID
|
|
#define DEBUG_VERS VERS_1_0
|
|
#define DEBUG_LANG LANG_ENG
|
|
|
|
#define ENABLE_MATCH_PID true
|
|
#define ENABLE_OLD_EVENT false
|
|
#define ENABLE_DEBUG_SCREEN true
|
|
|
|
#define USE_CUSTOM_MALLOC 1
|
|
// needs to be a value divisible by 4
|
|
#define CUSTOM_MALLOC_POOL_SIZE 8192
|
|
|
|
#endif |