mirror of
https://github.com/GearsProgress/Poke_Transporter_GB.git
synced 2026-05-01 04:36:51 -05:00
Updating make files to use debug mode
This commit is contained in:
parent
5e7e9b4df7
commit
e1c3d1a4c2
24
Makefile
24
Makefile
|
|
@ -4,12 +4,18 @@ BUILD_TYPES := release debug
|
||||||
# defaults
|
# defaults
|
||||||
BUILD_LANG ?= english
|
BUILD_LANG ?= english
|
||||||
BUILD_TYPE ?= release
|
BUILD_TYPE ?= release
|
||||||
GIT_VERSION ?= $(shell git describe --tags --abbrev=0)
|
GIT_SUFFIX := $(shell git describe --tags --long --dirty | sed -E 's/^[^-]+-([0-9]+)-g[0-9a-f]+(-dirty)?$$/\1/')
|
||||||
GIT_FULL ?= $(shell git describe --tags --always --dirty 2>/dev/null)
|
GIT_FULL := $(shell git describe --tags --always --dirty 2>/dev/null)
|
||||||
|
|
||||||
|
ifeq ($(GIT_SUFFIX),0)
|
||||||
|
GIT_VERSION = $(shell git describe --tags --abbrev=0)
|
||||||
|
else
|
||||||
|
GIT_VERSION = $(shell git describe --tags --abbrev=0)b
|
||||||
|
endif
|
||||||
|
|
||||||
CMD_GOALS := $(filter-out build,$(MAKECMDGOALS))
|
CMD_GOALS := $(filter-out build,$(MAKECMDGOALS))
|
||||||
|
|
||||||
LANG_INDEX := $(shell echo $(BUILD_LANGS) | tr ' ' '\n' | nl -v0 | grep -w $(BUILD_LANG) | awk '{print $$1}')
|
LANG_INDEX := $(shell echo $(BUILD_LANGS) | tr ' ' '\n' | nl -v0 | grep -w $(BUILD_LANG) | awk '{print $$1 + 1}')
|
||||||
TYPE_INDEX := $(shell echo $(BUILD_TYPES) | tr ' ' '\n' | nl -v0 | grep -w $(BUILD_TYPE) | awk '{print $$1}')
|
TYPE_INDEX := $(shell echo $(BUILD_TYPES) | tr ' ' '\n' | nl -v0 | grep -w $(BUILD_TYPE) | awk '{print $$1}')
|
||||||
|
|
||||||
CPPFLAGS += -DPTGB_BUILD_LANGUAGE=$(LANG_INDEX)
|
CPPFLAGS += -DPTGB_BUILD_LANGUAGE=$(LANG_INDEX)
|
||||||
|
|
@ -19,16 +25,6 @@ CPPFLAGS += -DBUILD_INFO=\"$(GIT_FULL)\"
|
||||||
CFLAGS += $(CPPFLAGS)
|
CFLAGS += $(CPPFLAGS)
|
||||||
CXXFLAGS += $(CPPFLAGS)
|
CXXFLAGS += $(CPPFLAGS)
|
||||||
|
|
||||||
# detect language
|
|
||||||
ifneq ($(filter $(BUILD_LANGS),$(CMD_GOALS)),)
|
|
||||||
BUILD_LANG := $(filter $(BUILD_LANGS),$(CMD_GOALS))
|
|
||||||
endif
|
|
||||||
|
|
||||||
# detect build type
|
|
||||||
ifneq ($(filter $(BUILD_TYPES),$(CMD_GOALS)),)
|
|
||||||
BUILD_TYPE := $(filter $(BUILD_TYPES),$(CMD_GOALS))
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
@ -193,7 +189,7 @@ generate_data:
|
||||||
CXXFLAGS= \
|
CXXFLAGS= \
|
||||||
LDFLAGS= \
|
LDFLAGS= \
|
||||||
AR=ar \
|
AR=ar \
|
||||||
$(MAKE) -C tools/payload-generator
|
$(MAKE) -C tools/payload-generator BUILD_LANG=$(BUILD_LANG) BUILD_TYPE=$(BUILD_TYPE)
|
||||||
@echo
|
@echo
|
||||||
@echo "----------------------------------------------------------------"
|
@echo "----------------------------------------------------------------"
|
||||||
@echo
|
@echo
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@
|
||||||
#define DONT_TRANSFER_POKEMON_AT_INDEX_X (false && DEBUG_MODE)
|
#define DONT_TRANSFER_POKEMON_AT_INDEX_X (false && DEBUG_MODE)
|
||||||
#define POKEMON_INDEX_TO_SKIP 5
|
#define POKEMON_INDEX_TO_SKIP 5
|
||||||
#define ENABLE_TEXT_DEBUG_SCREEN (true && DEBUG_MODE)
|
#define ENABLE_TEXT_DEBUG_SCREEN (true && DEBUG_MODE)
|
||||||
|
#define DEBUG_PAYLOADS (false && DEBUG_MODE)
|
||||||
|
|
||||||
|
|
||||||
#define DEBUG_GAME EMERALD_ID
|
#define DEBUG_GAME EMERALD_ID
|
||||||
#define DEBUG_VERS VERS_1_0
|
#define DEBUG_VERS VERS_1_0
|
||||||
|
|
|
||||||
|
|
@ -507,9 +507,11 @@ def generate_cpp_file():
|
||||||
for section in textSections:
|
for section in textSections:
|
||||||
cppFile.write("#include \"" + section.upper() + "_" + lang.name.lower() + "_lz10_bin.h\"\n")
|
cppFile.write("#include \"" + section.upper() + "_" + lang.name.lower() + "_lz10_bin.h\"\n")
|
||||||
|
|
||||||
for lang in Languages:
|
|
||||||
cppFile.write(f"\n#if PTGB_BUILD_LANGUAGE == {lang.value + 1}\n")
|
cppFile.write("\nconst u8* get_compressed_text_table(int table_index)\n")
|
||||||
cppFile.write("const u8* get_compressed_text_table(int table_index)\n")
|
|
||||||
|
for i, lang in enumerate(Languages):
|
||||||
|
cppFile.write(f"\n#{"el" if i > 0 else ""}if PTGB_BUILD_LANGUAGE == {lang.value + 1}\n")
|
||||||
cppFile.write("{\n")
|
cppFile.write("{\n")
|
||||||
cppFile.write("\tswitch (table_index)\n\t{\n")
|
cppFile.write("\tswitch (table_index)\n\t{\n")
|
||||||
for section in textSections:
|
for section in textSections:
|
||||||
|
|
@ -519,8 +521,8 @@ def generate_cpp_file():
|
||||||
cppFile.write("\t\treturn " + section + "_" + lang.name.lower() + "_lz10_bin;\n")
|
cppFile.write("\t\treturn " + section + "_" + lang.name.lower() + "_lz10_bin;\n")
|
||||||
cppFile.write("\t\tbreak;\n")
|
cppFile.write("\t\tbreak;\n")
|
||||||
cppFile.write("\t}\n")
|
cppFile.write("\t}\n")
|
||||||
cppFile.write("}\n\n")
|
cppFile.write("}\n")
|
||||||
cppFile.write(f"#endif\n\n\n")
|
cppFile.write(f"#else\n#error \"Unsupported PTGB_BUILD_LANGUAGE\"\n#endif")
|
||||||
|
|
||||||
def output_json_file():
|
def output_json_file():
|
||||||
print("\tOutputting json file")
|
print("\tOutputting json file")
|
||||||
|
|
@ -566,7 +568,11 @@ class Font:
|
||||||
def build_h():
|
def build_h():
|
||||||
print("Building font.h")
|
print("Building font.h")
|
||||||
with open(fontDir + "/include/fonts.h", 'w') as f:
|
with open(fontDir + "/include/fonts.h", 'w') as f:
|
||||||
f.write(f'''#include "debug_mode.h"
|
f.write(f'''#ifndef PTGB_BUILD_LANGUAGE
|
||||||
|
#error "PTGB_BUILD_LANGUAGE not defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "debug_mode.h"
|
||||||
#include "pokemon_data.h"
|
#include "pokemon_data.h"
|
||||||
|
|
||||||
#ifndef __FONTS_H__
|
#ifndef __FONTS_H__
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,27 @@
|
||||||
|
|
||||||
|
BUILD_LANGS := japanese english french german italian spanish-eu spanish-la
|
||||||
|
BUILD_TYPES := release debug
|
||||||
|
|
||||||
|
# defaults
|
||||||
|
BUILD_LANG ?= english
|
||||||
|
BUILD_TYPE ?= release
|
||||||
|
GIT_VERSION ?= $(shell git describe --tags --abbrev=0)
|
||||||
|
GIT_FULL ?= $(shell git describe --tags --always --dirty 2>/dev/null)
|
||||||
|
|
||||||
|
CMD_GOALS := $(filter-out build,$(MAKECMDGOALS))
|
||||||
|
|
||||||
|
LANG_INDEX := $(shell echo $(BUILD_LANGS) | tr ' ' '\n' | nl -v0 | grep -w $(BUILD_LANG) | awk '{print $$1 + 1}')
|
||||||
|
TYPE_INDEX := $(shell echo $(BUILD_TYPES) | tr ' ' '\n' | nl -v0 | grep -w $(BUILD_TYPE) | awk '{print $$1}')
|
||||||
|
|
||||||
|
CPPFLAGS += -DPTGB_BUILD_LANGUAGE=$(LANG_INDEX)
|
||||||
|
CPPFLAGS += -DDEBUG_MODE=$(TYPE_INDEX)
|
||||||
|
CPPFLAGS += -DBUILD_INFO=\"$(GIT_FULL)\"
|
||||||
|
|
||||||
|
CFLAGS += $(CPPFLAGS)
|
||||||
|
CXXFLAGS += $(CPPFLAGS)
|
||||||
|
|
||||||
# # Compiler flags
|
# # Compiler flags
|
||||||
CXXFLAGS := -std=c++20 -fno-rtti -fno-exceptions -fno-unwind-tables -Wall -Wextra -I $(CURDIR)/include -g
|
CXXFLAGS += -std=c++20 -fno-rtti -fno-exceptions -fno-unwind-tables -Wall -Wextra -I $(CURDIR)/include -g
|
||||||
|
|
||||||
# Source files directory
|
# Source files directory
|
||||||
SRC_DIR := ./src
|
SRC_DIR := ./src
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#define DATA_LOC (SHOW_DATA_PACKETS ? curr_rom.transferStringLocation : curr_rom.wEnemyMonSpecies)
|
#define DATA_LOC (SHOW_DATA_PACKETS ? curr_rom.transferStringLocation : curr_rom.wEnemyMonSpecies)
|
||||||
#define DEBUG_PAYLOADS (false && DEBUG_MODE)
|
|
||||||
|
|
||||||
void init_payload(byte *payload_buffer, const GB_ROM &curr_rom, int type, bool debug)
|
void init_payload(byte *payload_buffer, const GB_ROM &curr_rom, int type, bool debug)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user