Toolchain sync fixes

This commit is contained in:
GriffinR 2024-09-12 12:59:51 -04:00
parent 2ed7806380
commit 93b4a7b815
6 changed files with 107 additions and 32 deletions

View File

@ -89,8 +89,14 @@ else
PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC) PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC)
CC1 := $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet CC1 := $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet
override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast
LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" LIBPATH := -L $(shell dirname $(shell $(PATH_MODERNCC) -print-file-name=libgcc.a)) -L $(shell dirname $(shell $(PATH_MODERNCC) -print-file-name=libc.a))
LIB := $(LIBPATH) -lgcc -lc -lnosys LIB := $(LIBPATH) -lc -lgcc
ifneq ($(DEVKITARM),)
ifeq ($(TOOLCHAIN),$(DEVKITARM))
LIB += -lsysbase -lc
endif
endif
LIB += -lnosys
endif endif
# Enable debug info if set # Enable debug info if set
ifeq ($(DINFO),1) ifeq ($(DINFO),1)
@ -194,7 +200,6 @@ endif
syms: $(SYM) syms: $(SYM)
clean: tidy clean-tools clean-generated clean-assets clean: tidy clean-tools clean-generated clean-assets
# @$(MAKE) clean -C libagbsyscall
clean-assets: clean-assets:
rm -f $(MID_SUBDIR)/*.s rm -f $(MID_SUBDIR)/*.s
@ -371,15 +376,11 @@ LD_SCRIPT := ld_script_modern.ld
LD_SCRIPT_DEPS := LD_SCRIPT_DEPS :=
endif endif
$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS)
sed "s#tools/#tools/#g" $(LD_SCRIPT) > $(OBJ_DIR)/ld_script.ld
# Final rules # Final rules
# Elf from object files # Elf from object files
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) $(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS)
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>" @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent
# Builds the rom from the elf file # Builds the rom from the elf file

View File

@ -25,12 +25,12 @@ BUILD_DIR := build
ifeq ($(GAME_VERSION),FIRERED) ifeq ($(GAME_VERSION),FIRERED)
TITLE := POKEMON FIRE TITLE := POKEMON FIRE
GAME_CODE := BPR GAME_CODE := BPR
BUILD_NAME := firered BUILD_NAME := firered
else else
ifeq ($(GAME_VERSION),LEAFGREEN) ifeq ($(GAME_VERSION),LEAFGREEN)
TITLE := POKEMON LEAF TITLE := POKEMON LEAF
GAME_CODE := BPG GAME_CODE := BPG
BUILD_NAME := leafgreen BUILD_NAME := leafgreen
else else
$(error unknown version $(GAME_VERSION)) $(error unknown version $(GAME_VERSION))
endif endif

View File

@ -279,4 +279,71 @@
#define PLACEHOLDER_ID_GROUDON 0xC #define PLACEHOLDER_ID_GROUDON 0xC
#define PLACEHOLDER_ID_KYOGRE 0xD #define PLACEHOLDER_ID_KYOGRE 0xD
// Note that while all dot combinations are represented in
// the Braille font, they are not all meaningful characters.
// Only those that have direct single-character translations are listed.
#define BRAILLE_CHAR_SPACE 0x00
#define BRAILLE_CHAR_A 0x01
//
#define BRAILLE_CHAR_C 0x03
#define BRAILLE_CHAR_COMMA 0x04
#define BRAILLE_CHAR_B 0x05
#define BRAILLE_CHAR_I 0x06
#define BRAILLE_CHAR_F 0x07
//
#define BRAILLE_CHAR_E 0x09
//
#define BRAILLE_CHAR_D 0x0B
#define BRAILLE_CHAR_COLON 0x0C
#define BRAILLE_CHAR_H 0x0D
#define BRAILLE_CHAR_J 0x0E
#define BRAILLE_CHAR_G 0x0F
#define BRAILLE_CHAR_APOSTROPHE 0x10
#define BRAILLE_CHAR_K 0x11
#define BRAILLE_CHAR_SLASH 0x12
#define BRAILLE_CHAR_M 0x13
#define BRAILLE_CHAR_SEMICOLON 0x14
#define BRAILLE_CHAR_L 0x15
#define BRAILLE_CHAR_S 0x16
#define BRAILLE_CHAR_P 0x17
//
#define BRAILLE_CHAR_O 0x19
//
#define BRAILLE_CHAR_N 0x1B
#define BRAILLE_CHAR_EXCL_MARK 0x1C
#define BRAILLE_CHAR_R 0x1D
#define BRAILLE_CHAR_T 0x1E
#define BRAILLE_CHAR_Q 0x1F
//
#define BRAILLE_CHAR_PERIOD 0x2C
//
#define BRAILLE_CHAR_W 0x2E
//
#define BRAILLE_CHAR_HYPHEN 0x30
#define BRAILLE_CHAR_U 0x31
//
#define BRAILLE_CHAR_X 0x33
#define BRAILLE_CHAR_QUESTION_MARK 0x34 // Also double quote left
#define BRAILLE_CHAR_V 0x35
//
#define BRAILLE_CHAR_DBL_QUOTE_RIGHT 0x38
#define BRAILLE_CHAR_Z 0x39
#define BRAILLE_CHAR_NUMBER 0x3A
#define BRAILLE_CHAR_Y 0x3B
#define BRAILLE_CHAR_PAREN 0x3C
//
#define NUM_BRAILLE_CHARS 0x40
// Digits must be preceded by BRAILLE_CHAR_NUMBER
#define BRAILLE_CHAR_1 BRAILLE_CHAR_A
#define BRAILLE_CHAR_2 BRAILLE_CHAR_B
#define BRAILLE_CHAR_3 BRAILLE_CHAR_C
#define BRAILLE_CHAR_4 BRAILLE_CHAR_D
#define BRAILLE_CHAR_5 BRAILLE_CHAR_E
#define BRAILLE_CHAR_6 BRAILLE_CHAR_F
#define BRAILLE_CHAR_7 BRAILLE_CHAR_G
#define BRAILLE_CHAR_8 BRAILLE_CHAR_H
#define BRAILLE_CHAR_9 BRAILLE_CHAR_I
#define BRAILLE_CHAR_0 BRAILLE_CHAR_J
#endif // GUARD_CHARACTERS_H #endif // GUARD_CHARACTERS_H

View File

@ -640,79 +640,79 @@ static const union AnimCmd *const sAnims_SwitchMapCursor[] = {
static const struct DungeonMapInfo sDungeonInfo[] = { static const struct DungeonMapInfo sDungeonInfo[] = {
{ {
.id = MAPSEC_VIRIDIAN_FOREST, .id = MAPSEC_VIRIDIAN_FOREST,
.name = sMapsecName_VIRIDIANFOREST, .name = sMapsecName_VIRIDIAN_FOREST,
.desc = gText_RegionMap_AreaDesc_ViridianForest .desc = gText_RegionMap_AreaDesc_ViridianForest
}, { }, {
.id = MAPSEC_MT_MOON, .id = MAPSEC_MT_MOON,
.name = sMapsecName_MTMOON, .name = sMapsecName_MT__MOON,
.desc = gText_RegionMap_AreaDesc_MtMoon .desc = gText_RegionMap_AreaDesc_MtMoon
}, { }, {
.id = MAPSEC_DIGLETTS_CAVE, .id = MAPSEC_DIGLETTS_CAVE,
.name = sMapsecName_DIGLETTSCAVE, .name = sMapsecName_DIGLETT_S_CAVE,
.desc = gText_RegionMap_AreaDesc_DiglettsCave .desc = gText_RegionMap_AreaDesc_DiglettsCave
}, { }, {
.id = MAPSEC_KANTO_VICTORY_ROAD, .id = MAPSEC_KANTO_VICTORY_ROAD,
.name = sMapsecName_VICTORYROAD, .name = sMapsecName_VICTORY_ROAD,
.desc = gText_RegionMap_AreaDesc_VictoryRoad .desc = gText_RegionMap_AreaDesc_VictoryRoad
}, { }, {
.id = MAPSEC_POKEMON_MANSION, .id = MAPSEC_POKEMON_MANSION,
.name = sMapsecName_POKMONMANSION, .name = sMapsecName_POK__MON_MANSION,
.desc = gText_RegionMap_AreaDesc_PokemonMansion .desc = gText_RegionMap_AreaDesc_PokemonMansion
}, { }, {
.id = MAPSEC_KANTO_SAFARI_ZONE, .id = MAPSEC_KANTO_SAFARI_ZONE,
.name = sMapsecName_SAFARIZONE, .name = sMapsecName_SAFARI_ZONE,
.desc = gText_RegionMap_AreaDesc_SafariZone .desc = gText_RegionMap_AreaDesc_SafariZone
}, { }, {
.id = MAPSEC_ROCK_TUNNEL, .id = MAPSEC_ROCK_TUNNEL,
.name = sMapsecName_ROCKTUNNEL, .name = sMapsecName_ROCK_TUNNEL,
.desc = gText_RegionMap_AreaDesc_RockTunnel .desc = gText_RegionMap_AreaDesc_RockTunnel
}, { }, {
.id = MAPSEC_SEAFOAM_ISLANDS, .id = MAPSEC_SEAFOAM_ISLANDS,
.name = sMapsecName_SEAFOAMISLANDS, .name = sMapsecName_SEAFOAM_ISLANDS,
.desc = gText_RegionMap_AreaDesc_SeafoamIslands .desc = gText_RegionMap_AreaDesc_SeafoamIslands
}, { }, {
.id = MAPSEC_POKEMON_TOWER, .id = MAPSEC_POKEMON_TOWER,
.name = sMapsecName_POKMONTOWER, .name = sMapsecName_POK__MON_TOWER,
.desc = gText_RegionMap_AreaDesc_PokemonTower .desc = gText_RegionMap_AreaDesc_PokemonTower
}, { }, {
.id = MAPSEC_CERULEAN_CAVE, .id = MAPSEC_CERULEAN_CAVE,
.name = sMapsecName_CERULEANCAVE, .name = sMapsecName_CERULEAN_CAVE,
.desc = gText_RegionMap_AreaDesc_CeruleanCave .desc = gText_RegionMap_AreaDesc_CeruleanCave
}, { }, {
.id = MAPSEC_POWER_PLANT, .id = MAPSEC_POWER_PLANT,
.name = sMapsecName_POWERPLANT, .name = sMapsecName_POWER_PLANT,
.desc = gText_RegionMap_AreaDesc_PowerPlant .desc = gText_RegionMap_AreaDesc_PowerPlant
}, { }, {
.id = MAPSEC_MT_EMBER, .id = MAPSEC_MT_EMBER,
.name = sMapsecName_MTEMBER, .name = sMapsecName_MT__EMBER,
.desc = gText_RegionMap_AreaDesc_MtEmber .desc = gText_RegionMap_AreaDesc_MtEmber
}, { }, {
.id = MAPSEC_BERRY_FOREST, .id = MAPSEC_BERRY_FOREST,
.name = sMapsecName_BERRYFOREST, .name = sMapsecName_BERRY_FOREST,
.desc = gText_RegionMap_AreaDesc_BerryForest .desc = gText_RegionMap_AreaDesc_BerryForest
}, { }, {
.id = MAPSEC_ICEFALL_CAVE, .id = MAPSEC_ICEFALL_CAVE,
.name = sMapsecName_ICEFALLCAVE, .name = sMapsecName_ICEFALL_CAVE,
.desc = gText_RegionMap_AreaDesc_IcefallCave .desc = gText_RegionMap_AreaDesc_IcefallCave
}, { }, {
.id = MAPSEC_LOST_CAVE, .id = MAPSEC_LOST_CAVE,
.name = sMapsecName_LOSTCAVE, .name = sMapsecName_LOST_CAVE,
.desc = gText_RegionMap_AreaDesc_LostCave .desc = gText_RegionMap_AreaDesc_LostCave
}, { }, {
.id = MAPSEC_TANOBY_CHAMBERS, .id = MAPSEC_TANOBY_CHAMBERS,
.name = sMapsecName_TANOBYCHAMBERS, .name = sMapsecName_TANOBY_CHAMBERS,
.desc = gText_RegionMap_AreaDesc_TanobyRuins .desc = gText_RegionMap_AreaDesc_TanobyRuins
}, { }, {
.id = MAPSEC_ALTERING_CAVE, .id = MAPSEC_ALTERING_CAVE,
.name = sMapsecName_ALTERINGCAVE, .name = sMapsecName_ALTERING_CAVE,
.desc = gText_RegionMap_AreaDesc_AlteringCave .desc = gText_RegionMap_AreaDesc_AlteringCave
}, { }, {
.id = MAPSEC_PATTERN_BUSH, .id = MAPSEC_PATTERN_BUSH,
.name = sMapsecName_PATTERNBUSH, .name = sMapsecName_PATTERN_BUSH,
.desc = gText_RegionMap_AreaDesc_PatternBush .desc = gText_RegionMap_AreaDesc_PatternBush
}, { }, {
.id = MAPSEC_DOTTED_HOLE, .id = MAPSEC_DOTTED_HOLE,
.name = sMapsecName_DOTTEDHOLE, .name = sMapsecName_DOTTED_HOLE,
.desc = gText_RegionMap_AreaDesc_DottedHole .desc = gText_RegionMap_AreaDesc_DottedHole
} }
}; };
@ -3806,7 +3806,7 @@ u8 *GetMapName(u8 *dst0, u16 mapsec, u16 fill)
if ((idx = mapsec - MAPSECS_KANTO) <= MAPSEC_SPECIAL_AREA - MAPSECS_KANTO) if ((idx = mapsec - MAPSECS_KANTO) <= MAPSEC_SPECIAL_AREA - MAPSECS_KANTO)
{ {
if (IsCeladonDeptStoreMapsec(mapsec) == TRUE) if (IsCeladonDeptStoreMapsec(mapsec) == TRUE)
dst = StringCopy(dst0, sMapsecName_CELADONDEPT); dst = StringCopy(dst0, sMapsecName_CELADON_DEPT_);
else else
dst = StringCopy(dst0, sMapNames[idx]); dst = StringCopy(dst0, sMapNames[idx]);
} }

View File

@ -45,6 +45,13 @@ int main(int argc, char *argv[])
return "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from " + jsonfilepath +" and Inja template " + templateFilepath + "\n//\n"; return "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from " + jsonfilepath +" and Inja template " + templateFilepath + "\n//\n";
}); });
env.add_callback("contains", 2, [](Arguments& args) {
string word = args.at(0)->get<string>();
string check = args.at(1)->get<string>();
return word.find(check) != std::string::npos;
});
env.add_callback("subtract", 2, [](Arguments& args) { env.add_callback("subtract", 2, [](Arguments& args) {
int minuend = args.at(0)->get<int>(); int minuend = args.at(0)->get<int>();
int subtrahend = args.at(1)->get<int>(); int subtrahend = args.at(1)->get<int>();