Optimizing size

This commit is contained in:
The Gears of Progress 2024-09-25 12:47:13 -04:00
parent be954c2c52
commit be25471bbc
6 changed files with 3158 additions and 3468 deletions

View File

@ -1,3 +1,6 @@
# Build configuration (set to either 'debug' or 'release')
BUILD_TYPE := release
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
@ -42,17 +45,27 @@ CFLAGS := -g -Wall -O2\
-mcpu=arm7tdmi -mtune=arm7tdmi -masm-syntax-unified\
$(ARCH)
CFLAGS += $(INCLUDE) -ffunction-sections -fdata-sections
CFLAGS += $(INCLUDE) -ffunction-sections -fdata-sections -Os -Wall -mthumb -mcpu=arm7tdmi -mtune=arm7tdmi
CXXFLAGS := $(CFLAGS) -g0 -fno-rtti -fno-exceptions -std=c++20 -Wno-volatile -D_GLIBCXX_USE_CXX20_ABI=0
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=c++20 -Wno-volatile -D_GLIBCXX_USE_CXX20_ABI=0
ifeq ($(BUILD_TYPE), debug)
CFLAGS += -g -DDEBUG
CXXFLAGS += -g -DDEBUG
else ifeq ($(BUILD_TYPE), release)
endif
ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) -Wl,--gc-sections
LDFLAGS = -Os -g $(ARCH) -Wl,-Map,$(notdir $*.map) -Wl,--gc-sections -mthumb -mcpu=arm7tdmi -mtune=arm7tdmi
CFLAGS += -flto
LDFLAGS += -flto
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lmm -ltonc -lgba
LIBS := -lmm -ltonc -lgba -lc -lgcc
#---------------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
#define DEBUG_MODE false
#define IGNORE_GAME_PAK true
#define IGNORE_LINK_CABLE true
#define IGNORE_LINK_CABLE false
#define IGNORE_MG_E4_FLAGS true
#define IGNORE_UNRECEIVED_PKMN true
#define FORCE_TUTORIAL false
@ -11,9 +11,9 @@
#define SHOW_INVALID_PKMN false
#define IGNORE_DEX_COMPLETION false
#define DEBUG_GAME EMERALD_ID
#define DEBUG_GAME FIRERED_ID
#define DEBUG_VERS VERS_1_0
#define DEBUG_LANG LANG_JPN
#define DEBUG_LANG LANG_ENG
#define ENABLE_MATCH_PID true
#define ENABLE_OLD_EVENT false

View File

@ -12,7 +12,7 @@ public:
script_obj(int nRun, int nNext); // For commands
script_obj(int nRun, int nNext_if_true, int nNext_if_false); // for conditionals
std::string get_text();
std::string_view get_text();
int get_true_index();
int get_false_index();
int get_cond_id();

View File

@ -1,5 +1,4 @@
#include <tonc.h>
#include <cstring>
#include "sprite_data.h"
#include "text_engine.h"

View File

@ -30,11 +30,11 @@ script_obj::script_obj(int nRun, int nNext_if_true, int nNext_if_false)
next_false_index = nNext_if_false;
}
std::string script_obj::get_text()
std::string_view script_obj::get_text()
{
if (has_text)
{
return std::string(text).data();
return text;
}
else
{