diff --git a/BootLoader/Makefile b/BootLoader/Makefile index 44f5ec7..b2d0b66 100755 --- a/BootLoader/Makefile +++ b/BootLoader/Makefile @@ -21,16 +21,16 @@ SPECS := specs #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -mthumb-interwork +ARCH := -mthumb-interwork -march=armv4t -mtune=arm7tdmi CFLAGS := -g -Wall -O2\ - -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ + -fomit-frame-pointer\ -ffast-math \ $(ARCH) CFLAGS += $(INCLUDE) -DARM7 -ASFLAGS := -g $(ARCH) +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS := -nostartfiles -T$(CURDIR)/../load.ld -g $(ARCH) -Wl,-Map,$(TARGET).map LIBS := -lnds7 diff --git a/BootLoader/source/clear_cache.arm9.s b/BootLoader/source/clear_cache.arm9.s index ecac27b..49ec8bb 100755 --- a/BootLoader/source/clear_cache.arm9.s +++ b/BootLoader/source/clear_cache.arm9.s @@ -17,10 +17,11 @@ @ Clears ICache and Dcache, and resets the protection units @ Originally written by Darkain, modified by Chishm -.arm -.global arm9_clearCache +#include -arm9_clearCache: +.arm + +BEGIN_ASM_FUNC arm9_clearCache @ Clean and flush cache mov r1, #0 outer_loop: diff --git a/BootLoader/source/clear_mem.s b/BootLoader/source/clear_mem.s index d853bbc..16a6664 100755 --- a/BootLoader/source/clear_mem.s +++ b/BootLoader/source/clear_mem.s @@ -17,10 +17,12 @@ @ void arm7_clearmem (void* loc, size_t len); @ Clears memory using an stmia loop -.arm -.global arm7_clearmem +#include -arm7_clearmem: +.arm + + +BEGIN_ASM_FUNC arm7_clearmem add r1, r0, r1 stmfd sp!, {r4-r9} mov r2, #0 @@ -32,9 +34,10 @@ arm7_clearmem: mov r8, #0 mov r9, #0 -clearmem_loop: - stmia r0!, {r2-r9} cmp r0, r1 - blt clearmem_loop +clearmem_loop: + stmia r0!, {r2-r9} + cmp r0, r1 + blt clearmem_loop ldmfd sp!, {r4-r9} bx lr diff --git a/BootLoader/source/main.arm7.c b/BootLoader/source/main.arm7.c index ffb0646..a610ddd 100755 --- a/BootLoader/source/main.arm7.c +++ b/BootLoader/source/main.arm7.c @@ -259,7 +259,8 @@ void arm7_main (void) { debugOutput(errorCode); } - debugOutput (ERR_STS_HOOK_BIN); + //debugOutput (ERR_STS_HOOK_BIN); + debugOutput (ERR_STS_START); arm7_startBinary(); diff --git a/BootLoader/source/read_bios.s b/BootLoader/source/read_bios.s index ebb0083..57474ef 100755 --- a/BootLoader/source/read_bios.s +++ b/BootLoader/source/read_bios.s @@ -1,3 +1,5 @@ +#include + @This code comes from a post by CaitSith2 at gbadev.org - THANKS!! @ @Code to dump the complete Nintendo DS ARM7 bios, including the @@ -9,12 +11,12 @@ @Additionally, if the PC is outside the 0x0000 - 0x1204 range, that range of the bios @is completely locked out from reading. -.global readBios + @ void readBios (u8* dest, u32 src, u32 size) - .align -readBios: .arm + +BEGIN_ASM_FUNC readBios adr r3,bios_dump+1 bx r3 .thumb diff --git a/arm7/Makefile b/arm7/Makefile index ad6ed29..b2f56df 100755 --- a/arm7/Makefile +++ b/arm7/Makefile @@ -22,10 +22,10 @@ DATA := #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -mthumb-interwork +ARCH := -mthumb-interwork -march=armv4t -mtune=arm7tdmi CFLAGS := -g -Wall -O2\ - -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ + -fomit-frame-pointer\ -ffast-math \ $(ARCH) @@ -33,7 +33,7 @@ CFLAGS += $(INCLUDE) -DARM7 CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -fno-rtti -ASFLAGS := -g $(ARCH) +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS = -specs=ds_arm7.specs -g $(ARCH) -Wl,-Map,$(notdir $*).map LIBS := -lmm7 -lnds7 diff --git a/arm9/Makefile b/arm9/Makefile index b47cd58..22840bb 100755 --- a/arm9/Makefile +++ b/arm9/Makefile @@ -24,17 +24,17 @@ MUSIC := music #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -mthumb -mthumb-interwork +ARCH := -march=armv5te -mtune=arm946e-s -mthumb -mthumb-interwork CFLAGS := -g -Wall -O2\ - -march=armv5te -mtune=arm946e-s -fomit-frame-pointer\ + -fomit-frame-pointer\ -ffast-math \ $(ARCH) CFLAGS += $(INCLUDE) -DARM9 -fno-strict-aliasing CXXFLAGS := $(CFLAGS) -ASFLAGS := -g $(ARCH) -march=armv5te -mtune=arm946e-s +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)