Support for non-dkA toolchains

This commit is contained in:
PikalaxALT 2019-06-28 22:26:11 -04:00
parent 7a02a9ef36
commit e92e9a184c
5 changed files with 32 additions and 4 deletions

View File

@ -101,3 +101,16 @@ If you've only changed `.c` or `.s` files, you can turn off the dependency scann
`make NODEP=1` `make NODEP=1`
# Building with devkitARM's C compiler
This project supports the `arm-none-eabi-gcc` compiler which ships with devkitARM r52. To build this target, simply run:
make modern
# Building with your own toolchain
To build Pokemon Emerald with a toolchain other than devkitARM, override the `DEVKITARM` environment variable with the path to your toolchain. Example:
make compare DEVKITARM=/usr/local/arm-none-eabi
The path you pass to the `DEVKITARM` variable must contain the subdirectory `bin`. If you compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present.

View File

@ -1,4 +1,11 @@
ifneq (,$(wildcard $(DEVKITARM)/base_tools))
include $(DEVKITARM)/base_tools include $(DEVKITARM)/base_tools
else
PREFIX := $(DEVKITARM)/bin/arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy
CC := $(PREFIX)gcc
AS := $(PREFIX)as
endif
export CPP := $(PREFIX)cpp export CPP := $(PREFIX)cpp
export LD := $(PREFIX)ld export LD := $(PREFIX)ld
@ -48,7 +55,14 @@ OBJ_DIR := build/modern
LIBPATH := -L $(DEVKITARM)/lib/gcc/arm-none-eabi/*/thumb -L $(DEVKITARM)/arm-none-eabi/lib/thumb LIBPATH := -L $(DEVKITARM)/lib/gcc/arm-none-eabi/*/thumb -L $(DEVKITARM)/arm-none-eabi/lib/thumb
endif endif
CPPFLAGS := -I tools/agbcc/include -I tools/agbcc -iquote include -Wno-trigraphs -DMODERN=$(MODERN) ifeq ($(DEBUG),1)
CFLAGS += -g
endif
CPPFLAGS := -iquote include -Wno-trigraphs -DMODERN=$(MODERN)
ifeq ($(MODERN),0)
CPPFLAGS += -I tools/agbcc/include -I tools/agbcc
endif
LDFLAGS = -Map ../../$(MAP) LDFLAGS = -Map ../../$(MAP)

View File

@ -23,9 +23,9 @@ int GetMapBorderIdAt(int x, int y);
int CanCameraMoveInDirection(int direction); int CanCameraMoveInDirection(int direction);
u16 GetBehaviorByMetatileId(u16 metatileId); u16 GetBehaviorByMetatileId(u16 metatileId);
void GetCameraFocusCoords(u16 *x, u16 *y); void GetCameraFocusCoords(u16 *x, u16 *y);
u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y); u8 MapGridGetMetatileLayerTypeAt(int x, int y);
u8 MapGridGetZCoordAt(int x, int y); u8 MapGridGetZCoordAt(int x, int y);
u8 CameraMove(s32 deltaX, s32 deltaY); bool8 CameraMove(int deltaX, int deltaY);
struct MapConnection *sub_8088950(u8 direction, int x, int y); struct MapConnection *sub_8088950(u8 direction, int x, int y);
bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection); bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection);
bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset); bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset);

View File

@ -2,6 +2,7 @@
#define GUARD_GLOBAL_H #define GUARD_GLOBAL_H
#include <string.h> #include <string.h>
#include <limits.h>
#include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines. #include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.
#include "gba/gba.h" #include "gba/gba.h"
#include "constants/global.h" #include "constants/global.h"

View File

@ -278,7 +278,7 @@ bool32 sub_8011B90(void);
void sub_800FE50(u16 *a0); void sub_800FE50(u16 *a0);
bool32 sub_800E540(u16 id, u8 *name); bool32 sub_800E540(u16 id, u8 *name);
void sub_8011DE0(u32 arg0); void sub_8011DE0(u32 arg0);
u8 sub_801100C(int a0); u8 sub_801100C(s32 a0);
void sub_800EF7C(void); void sub_800EF7C(void);
bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx);
bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx);