Merged improvements from NitroHax

The following commits were merged:

0fe83d2b25

a87af83597

47ea3da285

66740e751a

No new problems were intreduced however this did not resolve the failure
to boot/read slot-1.
This commit is contained in:
ApacheThunder 2017-02-14 15:17:25 -06:00
parent 89c74797d9
commit e561b44b7f
7 changed files with 29 additions and 22 deletions

View File

@ -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

View File

@ -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 <nds/asminc.h>
arm9_clearCache:
.arm
BEGIN_ASM_FUNC arm9_clearCache
@ Clean and flush cache
mov r1, #0
outer_loop:

View File

@ -17,10 +17,12 @@
@ void arm7_clearmem (void* loc, size_t len);
@ Clears memory using an stmia loop
.arm
.global arm7_clearmem
#include <nds/asminc.h>
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

View File

@ -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();

View File

@ -1,3 +1,5 @@
#include <nds/asminc.h>
@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

View File

@ -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

View File

@ -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)