Added support to compile for both brahma and a9lh
This commit is contained in:
parent
2c3870dbad
commit
4f1fd1a32b
41
Makefile
41
Makefile
@ -36,19 +36,26 @@ CFLAGS := -g -Wall -Wextra -Wpedantic -O2 -flto\
|
|||||||
-ffast-math -std=c11\
|
-ffast-math -std=c11\
|
||||||
$(ARCH)
|
$(ARCH)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -DARM9 -Werror-implicit-function-declaration -Wcast-align\
|
CFLAGS += $(INCLUDE) -DARM9 -Werror-implicit-function-declaration -Wcast-align \
|
||||||
-Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op \
|
-Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self \
|
||||||
-Wmissing-declarations -Wmissing-include-dirs -Wredundant-decls -Wshadow \
|
-Wlogical-op -Wmissing-declarations -Wmissing-include-dirs \
|
||||||
-Wsign-conversion -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused
|
-Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow=5 \
|
||||||
|
-Wswitch-default -Wundef -Wno-unused
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||||
|
|
||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
LDFLAGS = -nostartfiles -g --specs=../stub.specs $(ARCH) -Wl,-Map,$(TARGET).map
|
LDFLAGS = -nostartfiles -g --specs=../stub.specs $(ARCH) -Wl,-Map,$(TARGET).map
|
||||||
OCFLAGS=--set-section-flags .bss=alloc,load,contents
|
OCFLAGS= --set-section-flags .bss=alloc,load,contents
|
||||||
|
|
||||||
LIBS :=
|
LIBS :=
|
||||||
|
|
||||||
|
ifeq ($(EXEC_METHOD),BRAHMA)
|
||||||
|
CFLAGS += -DBRAHMA #can't use CPPFLAGS because 3ds_rules doesn't use them
|
||||||
|
else ifeq ($(EXEC_METHOD), A9LH)
|
||||||
|
CFLAGS += -DA9LH #can't use CPPFLAGS because 3ds_rules doesn't use them
|
||||||
|
endif
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# list of directories containing libraries, this must be the top level containing
|
# list of directories containing libraries, this must be the top level containing
|
||||||
# include and lib
|
# include and lib
|
||||||
@ -97,20 +104,32 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
|||||||
|
|
||||||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
||||||
|
|
||||||
.PHONY: $(BUILD) clean all
|
.PHONY: common clean all brahma a9lh release
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
all: $(BUILD)
|
all: release
|
||||||
|
|
||||||
$(BUILD):
|
common:
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $(BUILD) ] || mkdir -p $(BUILD)
|
||||||
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
|
||||||
|
a9lh: common
|
||||||
|
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile EXEC_METHOD=A9LH
|
||||||
cp $(OUTPUT).bin arm9loaderhax.bin
|
cp $(OUTPUT).bin arm9loaderhax.bin
|
||||||
|
|
||||||
|
brahma: common
|
||||||
|
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile EXEC_METHOD=BRAHMA
|
||||||
|
cp $(OUTPUT).bin uncart_brahma.bin
|
||||||
|
|
||||||
|
release:
|
||||||
|
@rm -fr $(BUILD) $(OUTPUT).bin $(OUTPUT).elf
|
||||||
|
@make --no-print-directory a9lh
|
||||||
|
@rm -fr $(BUILD) $(OUTPUT).bin $(OUTPUT).elf
|
||||||
|
@make --no-print-directory brahma
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
clean:
|
clean:
|
||||||
@echo clean ...
|
@echo clean ...
|
||||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).bin arm9payload.bin
|
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).bin arm9payload.bin uncart_brahma.bin
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
@ -14,15 +14,20 @@
|
|||||||
|
|
||||||
#define RGB(r,g,b) (r<<24|b<<16|g<<8|r)
|
#define RGB(r,g,b) (r<<24|b<<16|g<<8|r)
|
||||||
|
|
||||||
//#define TOP_SCREEN0 (u8*)(0x20000000)
|
#ifdef BRAHMA
|
||||||
//#define TOP_SCREEN1 (u8*)(0x20046500)
|
#define TOP_SCREEN0 (u8*)(0x20000000)
|
||||||
//#define BOT_SCREEN0 (u8*)(0x2008CA00)
|
#define TOP_SCREEN1 (u8*)(0x20046500)
|
||||||
//#define BOT_SCREEN1 (u8*)(0x200C4E00)
|
#define BOT_SCREEN0 (u8*)(0x2008CA00)
|
||||||
|
#define BOT_SCREEN1 (u8*)(0x200C4E00)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef A9LH
|
||||||
|
#define TOP_SCREEN0 (u8*)(*(u32*)0x23FFFE00)
|
||||||
|
#define TOP_SCREEN1 (u8*)(*(u32*)0x23FFFE00)
|
||||||
|
#define BOT_SCREEN0 (u8*)(*(u32*)0x23FFFE08)
|
||||||
|
#define BOT_SCREEN1 (u8*)(*(u32*)0x23FFFE08)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TOP_SCREEN0 (u8*)(0x18300000)
|
|
||||||
#define TOP_SCREEN1 (u8*)(0x18300000)
|
|
||||||
#define BOT_SCREEN0 (u8*)(0x18346500)
|
|
||||||
#define BOT_SCREEN1 (u8*)(0x18346500)
|
|
||||||
extern size_t current_y;
|
extern size_t current_y;
|
||||||
|
|
||||||
void ClearScreen(unsigned char *screen, int color);
|
void ClearScreen(unsigned char *screen, int color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user