summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml10
-rw-r--r--INSTALL.md39
-rw-r--r--Makefile10
-rw-r--r--asm/pokemon_summary_screen.s8
-rw-r--r--berry_fix/Makefile7
-rw-r--r--berry_fix/payload/Makefile8
-rw-r--r--berry_fix/payload/src/agb_flash.c4
7 files changed, 57 insertions, 29 deletions
diff --git a/.travis.yml b/.travis.yml
index d12c7ddcb..03be7612f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,10 @@
language: generic
dist: bionic
sudo: false
+env:
+ global:
+ - DEVKITPRO=$HOME
+ - DEVKITARM=$DEVKITPRO/devkitARM
addons:
apt:
packages:
@@ -11,8 +15,10 @@ cache:
apt: true
install:
- pushd $HOME
- - travis_retry git clone https://github.com/luckytyphlosion/agbcc.git -b new_layout_with_libs
- - cd agbcc && make && make install prefix=$TRAVIS_BUILD_DIR
+ - travis_retry wget https://github.com/devkitPro/buildscripts/releases/download/devkitARM_r50/devkitARM_r50-linux.tar.xz
+ - tar xJf devkitARM*.tar.xz
+ - travis_retry git clone https://github.com/pret/agbcc.git
+ - cd agbcc && sh build.sh && sh install.sh $TRAVIS_BUILD_DIR
- popd
matrix:
include:
diff --git a/INSTALL.md b/INSTALL.md
index 1b2ba259e..d4e60bcef 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -15,32 +15,39 @@ Make sure that the `build-essential`, `git`, and `libpng-dev` packages are insta
In the case of Cygwin, [include](https://cygwin.com/cygwin-ug-net/setup-net.html#setup-packages) the `make`, `git`, `gcc-core`, `gcc-g++`, and `libpng-devel` packages.
+Install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and add its environment variables. For Windows versions without the Linux subsystem, the devkitPro [graphical installer](https://github.com/devkitPro/installer/releases) includes a preconfigured MSYS2 environment, thus the steps below are not required.
+
+ sudo (dkp-)pacman -S gba-dev
+ export DEVKITPRO=/opt/devkitpro
+ echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc
+ export DEVKITARM=$DEVKITPRO/devkitARM
+ echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc
+
## Installation
To set up the repository:
- git clone https://github.com/pret/pokefirered
- git clone https://github.com/luckytyphlosion/agbcc -b new_layout_with_libs
+ git clone https://github.com/pret/pokefirered
+ git clone https://github.com/pret/agbcc
- cd ./agbcc
- make
- make install prefix=../pokefirered
- make install-sdk prefix=../pokefirered
+ cd ./agbcc
+ sh build.sh
+ sh install.sh ../pokefirered
- cd ../pokefirered
+ cd ../pokefirered
To build **pokefirered.gba**:
- make -j$(nproc)
+ make -j$(nproc)
To confirm it matches the official ROM image while building, do this instead:
- make compare -j$(nproc)
+ make compare -j$(nproc)
If only `.c` or `.s` files were changed, turn off the dependency scanning temporarily. Changes to any other files will be ignored and the build will either fail or not reflect those changes.
- make -j$(nproc) NODEP=1
+ make -j$(nproc) NODEP=1
Convenient targets have been defined to build Pokémon LeafGreen and the 1.1 revisions of both games:
@@ -56,3 +63,15 @@ To confirm these match the respective official ROM images, prefix `compare_` to
make -j$(nproc) compare_leafgreen
**Note:** If the build command is not recognized on Linux, including the Linux environment used within Windows, run `nproc` and replace `$(nproc)` with the returned value (e.g.: `make -j4`). Because `nproc` is not available on macOS, the alternative is `sysctl -n hw.ncpu`.
+
+###Note for Mac users
+
+The BSD make that comes with Mac XCode can be buggy, so obtain GNU make and sed using [Homebrew](https://brew.sh):
+
+ brew install make gnu-sed
+
+When compiling agbcc, substitute the `build.sh` line for
+
+ gsed 's/^make/gmake/g' build.sh | sh
+
+Finally, use `gmake` instead of `make` to compile the ROM(s).
diff --git a/Makefile b/Makefile
index edaa183ed..8a739ccf4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
+include $(DEVKITARM)/base_tools
+
COMPARE ?= 0
-AS := tools/binutils/bin/arm-none-eabi-as
CPP := $(CC) -E
-LD := tools/binutils/bin/arm-none-eabi-ld
-OBJCOPY := tools/binutils/bin/arm-none-eabi-objcopy
+LD := $(DEVKITARM)/bin/arm-none-eabi-ld
include config.mk
@@ -182,7 +182,7 @@ endif
$(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep)
@$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i
@$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s
- @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s
+ @echo -e ".text\n\t.align\t2, 0 @ Don't pad with nop\n" >> $(C_BUILDDIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s
ifeq ($(NODEP),1)
@@ -224,7 +224,7 @@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_comm
cd $(OBJ_DIR) && sed -f ../../ld_script.sed ../../$< | sed "s#tools/#../../tools/#g" > ld_script.ld
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)
- cd $(OBJ_DIR) && ../../$(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(LIB)
+ cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(LIB)
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent
$(ROM): $(ELF)
diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s
index d14d64ee4..d6c3f548f 100644
--- a/asm/pokemon_summary_screen.s
+++ b/asm/pokemon_summary_screen.s
@@ -10503,7 +10503,9 @@ _08139BA0:
movs r0, 0x2
b _08139C16
.align 2, 0
-_08139BD8: .double 0.8
+@ _08139BD8: .double 0.8
+_08139BD8: .4byte 0x3fe99999
+_08139BDC: .4byte 0x9999999a
_08139BE0: .4byte gUnknown_203B170
_08139BE4:
ldr r3, _08139C04+4 @ =0x33333333
@@ -10521,7 +10523,9 @@ _08139BE4:
movs r0, 0x1
b _08139C16
.align 2, 0
-_08139C04: .double 0.6
+@ _08139C04: .double 0.6
+_08139C04: .4byte 0x3fe33333
+_08139C08: .4byte 0x33333333
_08139C0C: .4byte gUnknown_203B170
_08139C10:
ldr r0, _08139C38 @ =gUnknown_203B170
diff --git a/berry_fix/Makefile b/berry_fix/Makefile
index 44e816c52..1e0f3ee25 100644
--- a/berry_fix/Makefile
+++ b/berry_fix/Makefile
@@ -1,9 +1,8 @@
+include $(DEVKITARM)/base_tools
COMPARE ?= 0
-AS := ../tools/binutils/bin/arm-none-eabi-as
CPP := $(CC) -E
-LD := ../tools/binutils/bin/arm-none-eabi-ld
-OBJCOPY := ../tools/binutils/bin/arm-none-eabi-objcopy
+LD := $(DEVKITARM)/bin/arm-none-eabi-ld
ifeq ($(OS),Windows_NT)
EXE := .exe
@@ -160,7 +159,7 @@ $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s
$(AS) $(ASFLAGS) -I sound -o $@ $<
$(ELF): ld_script.txt $(OBJS)
- cd $(OBJ_DIR) && ../$(LD) $(LDFLAGS) -T ../ld_script.txt -o ../$@
+ cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../ld_script.txt -o ../$@
$(ROM): $(ELF)
$(OBJCOPY) -O binary $< $@
diff --git a/berry_fix/payload/Makefile b/berry_fix/payload/Makefile
index dabbe4582..c87a06c41 100644
--- a/berry_fix/payload/Makefile
+++ b/berry_fix/payload/Makefile
@@ -1,9 +1,8 @@
+include $(DEVKITARM)/base_tools
COMPARE ?= 0
-AS := ../../tools/binutils/bin/arm-none-eabi-as
CPP := $(CC) -E
-LD := ../../tools/binutils/bin/arm-none-eabi-ld
-OBJCOPY := ../../tools/binutils/bin/arm-none-eabi-objcopy
+LD := $(DEVKITARM)/bin/arm-none-eabi-ld
ifeq ($(OS),Windows_NT)
EXE := .exe
@@ -131,6 +130,7 @@ endif
$(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep)
@$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i
@$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CC1FLAGS) -o $(C_BUILDDIR)/$*.s
+ @echo -e ".text\n\t.align 2, 0 @ Don't pad with nop\n" >> $(C_BUILDDIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s
ifeq ($(NODEP),1)
@@ -167,7 +167,7 @@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_comm
cd $(OBJ_DIR) && sed -f ../../ld_script.sed ../$< | sed "s#tools/#../tools/#g" > ld_script.ld
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)
- cd $(OBJ_DIR) && ../$(LD) $(LDFLAGS) -T ld_script.ld -o ../$@ $(LIB)
+ cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../$@ $(LIB)
$(ROM): $(ELF)
$(OBJCOPY) -O binary $< $@
diff --git a/berry_fix/payload/src/agb_flash.c b/berry_fix/payload/src/agb_flash.c
index cda3b73f6..2c2c96e6e 100644
--- a/berry_fix/payload/src/agb_flash.c
+++ b/berry_fix/payload/src/agb_flash.c
@@ -1,5 +1,5 @@
-#include <gba/gba.h>
-#include <gba/flash_internal.h>
+#include "gba/gba.h"
+#include "gba/flash_internal.h"
static u8 sTimerNum;
static u16 sTimerCount;