diff options
Diffstat (limited to 'berry_fix')
-rw-r--r-- | berry_fix/Makefile | 53 | ||||
-rw-r--r-- | berry_fix/charmap.txt | 4 | ||||
-rw-r--r-- | berry_fix/payload/Makefile | 51 | ||||
-rw-r--r-- | berry_fix/payload/charmap.txt | 4 | ||||
-rw-r--r-- | berry_fix/payload/include/gba/defines.h | 6 | ||||
-rw-r--r-- | berry_fix/payload/include/gba/m4a_internal.h | 2 |
6 files changed, 75 insertions, 45 deletions
diff --git a/berry_fix/Makefile b/berry_fix/Makefile index 0ead3804f..464e5f9e9 100644 --- a/berry_fix/Makefile +++ b/berry_fix/Makefile @@ -1,29 +1,27 @@ TOOLCHAIN := $(DEVKITARM) COMPARE ?= 0 -ifeq ($(CC),) -HOSTCC := gcc -else -HOSTCC := $(CC) +# don't use dkP's base_tools anymore +# because the redefinition of $(CC) conflicts +# with when we want to use $(CC) to preprocess files +# thus, manually create the variables for the bin +# files, or use arm-none-eabi binaries on the system +# if dkP is not installed on this system + +ifneq (,$(TOOLCHAIN)) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) +export PATH := $(TOOLCHAIN)/bin:$(PATH) endif - -ifeq ($(CXX),) -HOSTCXX := g++ -else -HOSTCXX := $(CXX) endif -ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) -include $(TOOLCHAIN)/base_tools -else -export PATH := $(TOOLCHAIN)/bin:$(PATH) PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy -export CC := $(PREFIX)gcc -export AS := $(PREFIX)as -endif -export CPP := $(PREFIX)cpp -export LD := $(PREFIX)ld +AS := $(PREFIX)as +LD := $(PREFIX)ld + +# note: the makefile must be set up so MODERNCC is never called +# if MODERN=0 +MODERNCC := $(PREFIX)gcc ifeq ($(OS),Windows_NT) EXE := .exe @@ -31,6 +29,23 @@ else EXE := endif +# use arm-none-eabi-cpp for macOS +# as macOS's default compiler is clang +# and clang's preprocessor will warn on \u +# when preprocessing asm files, expecting a unicode literal +# we can't unconditionally use arm-none-eabi-cpp +# as installations which install binutils-arm-none-eabi +# don't come with it +ifneq ($(MODERN),1) + ifeq ($(shell uname -s),Darwin) + CPP := $(PREFIX)cpp + else + CPP := $(CC) -E + endif +else + CPP := $(PREFIX)cpp +endif + GAME_CODE := AGBJ MAKER_CODE := 01 REVISION := 0 @@ -166,7 +181,7 @@ $(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) $(DATA_ASM_SUBDIR)/$*.s) endif payload: - @$(MAKE) -C payload COMPARE=$(COMPARE) TOOLCHAIN=$(TOOLCHAIN) + @$(MAKE) -C payload COMPARE=$(COMPARE) TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN) payload/payload.gba: payload diff --git a/berry_fix/charmap.txt b/berry_fix/charmap.txt index 09427dc8d..1c143ada4 100644 --- a/berry_fix/charmap.txt +++ b/berry_fix/charmap.txt @@ -434,8 +434,8 @@ RESUME_MUSIC = FC 18 TRANSPARENT = 00 WHITE = 01 -DARK_GREY = 02 -LIGHT_GREY = 03 +DARK_GRAY = 02 +LIGHT_GRAY = 03 RED = 04 LIGHT_RED = 05 GREEN = 06 diff --git a/berry_fix/payload/Makefile b/berry_fix/payload/Makefile index a121fda93..2779c43ba 100644 --- a/berry_fix/payload/Makefile +++ b/berry_fix/payload/Makefile @@ -1,29 +1,27 @@ TOOLCHAIN := $(DEVKITARM) COMPARE ?= 0 -ifeq ($(CC),) -HOSTCC := gcc -else -HOSTCC := $(CC) +# don't use dkP's base_tools anymore +# because the redefinition of $(CC) conflicts +# with when we want to use $(CC) to preprocess files +# thus, manually create the variables for the bin +# files, or use arm-none-eabi binaries on the system +# if dkP is not installed on this system + +ifneq (,$(TOOLCHAIN)) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) +export PATH := $(TOOLCHAIN)/bin:$(PATH) endif - -ifeq ($(CXX),) -HOSTCXX := g++ -else -HOSTCXX := $(CXX) endif -ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) -include $(TOOLCHAIN)/base_tools -else -export PATH := $(TOOLCHAIN)/bin:$(PATH) PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy -export CC := $(PREFIX)gcc -export AS := $(PREFIX)as -endif -export CPP := $(PREFIX)cpp -export LD := $(PREFIX)ld +AS := $(PREFIX)as +LD := $(PREFIX)ld + +# note: the makefile must be set up so MODERNCC is never called +# if MODERN=0 +MODERNCC := $(PREFIX)gcc ifeq ($(OS),Windows_NT) EXE := .exe @@ -31,6 +29,23 @@ else EXE := endif +# use arm-none-eabi-cpp for macOS +# as macOS's default compiler is clang +# and clang's preprocessor will warn on \u +# when preprocessing asm files, expecting a unicode literal +# we can't unconditionally use arm-none-eabi-cpp +# as installations which install binutils-arm-none-eabi +# don't come with it +ifneq ($(MODERN),1) + ifeq ($(shell uname -s),Darwin) + CPP := $(PREFIX)cpp + else + CPP := $(CC) -E + endif +else + CPP := $(PREFIX)cpp +endif + SHELL := /bin/bash -o pipefail CPPFLAGS := -I ../../tools/agbcc/include -I ../../tools/agbcc -iquote include -nostdinc -undef diff --git a/berry_fix/payload/charmap.txt b/berry_fix/payload/charmap.txt index 09427dc8d..1c143ada4 100644 --- a/berry_fix/payload/charmap.txt +++ b/berry_fix/payload/charmap.txt @@ -434,8 +434,8 @@ RESUME_MUSIC = FC 18 TRANSPARENT = 00 WHITE = 01 -DARK_GREY = 02 -LIGHT_GREY = 03 +DARK_GRAY = 02 +LIGHT_GRAY = 03 RED = 04 LIGHT_RED = 05 GREEN = 06 diff --git a/berry_fix/payload/include/gba/defines.h b/berry_fix/payload/include/gba/defines.h index 289518cf3..4037af584 100644 --- a/berry_fix/payload/include/gba/defines.h +++ b/berry_fix/payload/include/gba/defines.h @@ -1,5 +1,5 @@ -#ifndef GUARD_GBA_DEFINES -#define GUARD_GBA_DEFINES +#ifndef GUARD_GBA_DEFINES_H +#define GUARD_GBA_DEFINES_H #include <stddef.h> @@ -84,4 +84,4 @@ #define RGB_CYAN RGB(0, 31, 31) #define RGB_WHITEALPHA (RGB_WHITE | 0x8000) -#endif // GUARD_GBA_DEFINES +#endif // GUARD_GBA_DEFINES_H diff --git a/berry_fix/payload/include/gba/m4a_internal.h b/berry_fix/payload/include/gba/m4a_internal.h index 339a0774e..1aca67585 100644 --- a/berry_fix/payload/include/gba/m4a_internal.h +++ b/berry_fix/payload/include/gba/m4a_internal.h @@ -419,7 +419,7 @@ void SetPokemonCryPitch(s16 val); void SetPokemonCryLength(u16 val); void SetPokemonCryRelease(u8 val); void SetPokemonCryProgress(u32 val); -int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); +bool32 IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); void SetPokemonCryChorus(s8 val); void SetPokemonCryStereo(u32 val); void SetPokemonCryPriority(u8 val); |