Skip to content

Commit

Permalink
update makefiles, allow loading files from ./uxn, re-enable NitroFS o…
Browse files Browse the repository at this point in the history
…n NDS
  • Loading branch information
asiekierka committed Dec 16, 2023
1 parent de13455 commit 7fb9120
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile.blocksds.arm7
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ SOURCES_CPP := $(shell find -L $(SOURCEDIRS) -name "*.cpp")

DEFINES += -D__NDS__ -DARM7

ARCH := -mcpu=arm7tdmi -mtune=arm7tdmi
ARCH := -mcpu=arm7tdmi

WARNFLAGS := -Wall

Expand Down Expand Up @@ -106,6 +106,7 @@ CXXFLAGS += -std=gnu++14 $(WARNFLAGS) $(DEFINES) $(ARCH) \
LDFLAGS := -mthumb -mthumb-interwork $(LIBDIRSFLAGS) \
-Wl,-Map,$(MAP) -Wl,--gc-sections -nostdlib \
-T$(BLOCKSDS)/sys/crts/ds_arm7.ld \
-Wl,--no-warn-rwx-segments \
-Wl,--start-group $(LIBS) -lgcc -Wl,--end-group

# Intermediate build files
Expand Down
3 changes: 2 additions & 1 deletion Makefile.blocksds.arm9
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ SOURCES_CPP := $(shell find -L $(SOURCEDIRS) -maxdepth 1 -name "*.cpp")

DEFINES += -D__NDS__ -DARM9 -DBLOCKSDS

ARCH := -march=armv5te -mtune=arm946e-s
ARCH := -mcpu=arm946e-s+nofp

WARNFLAGS := -Wall

Expand Down Expand Up @@ -141,6 +141,7 @@ LDFLAGS := -Wl,--defsym=vfprintf=__i_vfprintf -Wl,--defsym=vfscanf=__i_vfscanf
-Wl,-Map,$(MAP) -Wl,--gc-sections -nostdlib \
-T$(BLOCKSDS)/sys/crts/ds_arm9.mem \
-T$(BLOCKSDS)/sys/crts/ds_arm9.ld \
-Wl,--no-warn-rwx-segments -Wl,--use-blx \
-Wl,--start-group $(LIBS) -lgcc -Wl,--end-group

# Intermediate build files
Expand Down
10 changes: 7 additions & 3 deletions arm9/source/emulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,17 @@ profiler_ticks(Uint32 tticks, int pos, const char *name)
static int
uxn_load_boot(Uxn *u)
{
/* if(system_load(u, "nitro:/boot.rom")) {
if(system_load(u, "nitro:/boot.rom")) {
chdir("nitro:/");
return 1;
} */
}
if(system_load(u, "boot.rom")) {
return 1;
}
if(system_load(u, "./uxn/boot.rom")) {
chdir("./uxn");
return 1;
}
if(system_load(u, "/uxn/boot.rom")) {
chdir("/uxn");
return 1;
Expand Down Expand Up @@ -505,7 +509,7 @@ main(int argc, char **argv)
return error("Boot", "Failed");
if(!fatInitDefault())
return error("FAT init", "Failed");
// nitroFSInit(NULL); // no big deal if this one fails
nitroFSInit(NULL); // no big deal if this one fails
if(!uxn_load_boot(&u)) {
dprintf("Halted: Missing input rom.\n");
return error("Load", "Failed");
Expand Down
4 changes: 4 additions & 0 deletions source/3ds/emulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ uxn_load_boot(Uxn *u)
if(system_load(u, "boot.rom")) {
return 1;
}
if(system_load(u, "./uxn/boot.rom")) {
chdir("./uxn");
return 1;
}
if(system_load(u, "/uxn/boot.rom")) {
chdir("/uxn");
return 1;
Expand Down

0 comments on commit 7fb9120

Please sign in to comment.