diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-07-04 11:40:05 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-07-04 11:40:05 -0400 |
commit | 231b2aeb83f206396a884c862c669111b9faa078 (patch) | |
tree | ebddc515fb86f2b0bcc3b6a29f43c8ce76f61c5b | |
parent | 2f671f9bd2b1785d1e6be135ddd638daadac62c4 (diff) |
Foundation to support LG, Rev1 in the future
-rw-r--r-- | Makefile | 38 | ||||
-rw-r--r-- | asm/title_screen.s | 4 | ||||
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | include/constants/global.h | 4 | ||||
-rw-r--r-- | src/main.c | 7 |
5 files changed, 45 insertions, 10 deletions
@@ -3,15 +3,41 @@ CPP := $(CC) -E LD := tools/binutils/bin/arm-none-eabi-ld OBJCOPY := tools/binutils/bin/arm-none-eabi-objcopy +GAME_VERSION := FIRERED +REVISION := 0 +GAME_LANGUAGE := ENGLISH + +# So long as baserom.gba is required, we error out if the +# user tries to build any ROM other than FireRed. +ifneq ($(GAME_VERSION),FIRERED) +$(error We can only build English Pokemon FireRed v1.0 currently) +else ifneq ($(REVISION),0) +$(error We can only build English Pokemon FireRed v1.0 currently) +else ifneq ($(GAME_LANGUAGE),ENGLISH) +$(error We can only build English Pokemon FireRed v1.0 currently) +endif + +ifeq ($(GAME_VERSION),FIRERED) TITLE := POKEMON FIRE -GAME_CODE := BPRE +GAME_CODE := BPR +BUILD_NAME := firered +else +TITLE := POKEMON LEAF +GAME_CODE := BPL +BUILD_NAME := leafgreen +endif +ifeq ($(GAME_LANGUAGE),ENGLISH) +GAME_CODE := $(GAME_CODE)E +endif +ifneq ($(REVISION),0) +BUILD_NAME := $(BUILD_NAME)_rev$(REVISION) +endif MAKER_CODE := 01 -REVISION := 0 SHELL := /bin/bash -o pipefail -ROM := pokefirered.gba -OBJ_DIR := build/firered +ROM := poke$(BUILD_NAME).gba +OBJ_DIR := build/$(BUILD_NAME) ELF = $(ROM:.gba=.elf) MAP = $(ROM:.gba=.map) @@ -26,12 +52,12 @@ ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR) DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) -ASFLAGS := -mcpu=arm7tdmi +ASFLAGS := -mcpu=arm7tdmi --defsym $(GAME_VERSION)=1 --defsym REVISION=$(REVISION) --defsym $(GAME_LANGUAGE)=1 CC1 := tools/agbcc/bin/agbcc override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -CPPFLAGS := -I tools/agbcc -I tools/agbcc/include -iquote include -nostdinc -undef +CPPFLAGS := -I tools/agbcc -I tools/agbcc/include -iquote include -nostdinc -undef -D$(GAME_VERSION) -DREVISION=$(REVISION) -D$(GAME_LANGUAGE) LDFLAGS = -Map ../../$(MAP) diff --git a/asm/title_screen.s b/asm/title_screen.s index 1646e6ce4..3801bb4e2 100644 --- a/asm/title_screen.s +++ b/asm/title_screen.s @@ -1056,7 +1056,11 @@ _080791DE: lsrs r5, r0, 24 cmp r5, 0 bne _080792A6 + .ifdef FIRERED movs r0, 0x6 + .else + movs r0, 0x3 + .endif movs r1, 0 bl PlayCry1 ldrb r0, [r4, 0xC] diff --git a/include/config.h b/include/config.h index f094c95bd..491eadf13 100644 --- a/include/config.h +++ b/include/config.h @@ -15,8 +15,6 @@ // since not all baseroms and pointers have been dumped yet and will result in // a broken ROM. -#define ENGLISH - #ifdef ENGLISH #define UNITS_IMPERIAL #else diff --git a/include/constants/global.h b/include/constants/global.h index b1c8fed3e..3cac8d473 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -23,10 +23,12 @@ enum LanguageId { LANGUAGE_ITALIAN = 4, LANGUAGE_GERMAN = 5, // 6 goes unused but the theory is it was meant to be Korean - LANGUAGE_SPANISH = 7, + LANGUAGE_SPANISH = 7, }; +#ifdef ENGLISH #define GAME_LANGUAGE (LANGUAGE_ENGLISH) +#endif #define PC_ITEMS_COUNT 30 #define BAG_ITEMS_COUNT 42 diff --git a/src/main.c b/src/main.c index ae9a33e81..0d4e2ee1e 100644 --- a/src/main.c +++ b/src/main.c @@ -55,7 +55,12 @@ static void VCountIntr(void); static void SerialIntr(void); static void IntrDummy(void); -const u8 gGameVersion = VERSION_FIRE_RED; +#if defined(FIRERED) +#define GAME_VERSION VERSION_FIRE_RED +#elif defined(LEAF_GREEN) +#define GAME_VERSION VERSION_LEAF_GREEN +#endif +const u8 gGameVersion = GAME_VERSION; const u8 gGameLanguage = GAME_LANGUAGE; |