Skip to content

Commit 224232f

Browse files
committed
arm11 branch merge start
1 parent dac8f54 commit 224232f

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project(CtrBootManager)
33
enable_language(ASM)
44

55
#set(CMAKE_VERBOSE_MAKEFILE on)
6-
set(NETLOAD_IP "192.168.1.14")
6+
set(NETLOAD_IP "172.20.138.31")
77

88
# Note that you must copy the cmake folder and the DevkitArm3DS.cmake file in this directory
99
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) # Add the cmake folder to the modules paths, so that we can use the tools and find_package for ctrulib
@@ -44,7 +44,7 @@ set(CMAKE_C_FLAGS "-DARM9")
4444
add_executable(CtrBootManager ${SOURCE_FILES}) # Create the elf file
4545
set(ARCH "-march=armv6k -mtune=mpcore -mfloat-abi=hard")
4646
set_target_properties(CtrBootManager PROPERTIES COMPILE_FLAGS
47-
"-mword-relocations ${ARCH} -fomit-frame-pointer -ffast-math -O2 -mtp=soft -D_3DS -DARM11 -DHAVE_CONFIG_H")
47+
"-mword-relocations ${ARCH} -fomit-frame-pointer -ffast-math -O2 -mtp=soft -D_3DS -DARM11 -DHAVE_CONFIG_H -DINI_USE_STACK")
4848
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DKA_SUGGESTED_CXX_FLAGS}")
4949

5050
find_package(CTRULIB REQUIRED) # Look for ctrulib

source/config.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ static int handler(void *user, const char *section, const char *name,
114114
} else if (MATCH("entry", "offset")) {
115115
config->entries[config->count].offset = strtoul(item, NULL, 16);
116116
} else if (MATCH("entry", "key")) {
117-
config->entries[config->count].key = atoi(item);
118-
config->count++;
117+
if(strlen(config->entries[config->count].title) > 0) {
118+
config->entries[config->count].key = atoi(item);
119+
config->count++;
120+
}
119121
}
120122
else {
121123
return 0;
@@ -147,7 +149,7 @@ int configInit() {
147149
memset(config, 0, sizeof(boot_config_s));
148150

149151
config->timeout = 3;
150-
config->autobootfix = 100;
152+
config->autobootfix = 8;
151153
config->index = 0;
152154
config->recovery = 2;
153155
config->count = 0;
@@ -158,16 +160,19 @@ int configInit() {
158160
if (!size) {
159161
return -1;
160162
}
163+
161164
char buffer[size];
162165
memset(buffer, 0, size);
163166
if (fileRead(CONFIG_PATH, buffer, size) != 0) {
167+
debug("Could not read config file, creating one...");
164168
configSave(); // write new config file
165169
return -1;
166170
}
167171
ctx.ptr = buffer;
168172
ctx.bytes_left = strlen(ctx.ptr);
169173

170174
if (ini_parse_stream((ini_reader) ini_buffer_reader, &ctx, handler, config) < 0) {
175+
debug("Could not parse config file, creating one...");
171176
configSave(); // write new config file
172177
return -1;
173178
}

source/loader.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#ifndef ARM9
2+
23
#include <string.h>
34
#include <3ds.h>
45
#include "brahma.h"
6+
57
#else
68

79
#include "gfx.h"
@@ -64,6 +66,7 @@ int load_bin(char *path, long offset) {
6466

6567
return 0;
6668
}
69+
6770
#endif
6871

6972
int load(char *path, long offset) {
@@ -73,17 +76,17 @@ int load(char *path, long offset) {
7376
} else if (strcasecmp(path, "shutdown") == 0) {
7477
poweroff();
7578
#ifndef ARM9
76-
} else if (strcasecmp(path, "homemenu") == 0) {
77-
return load_homemenu();
79+
} else if (strcasecmp(path, "homemenu") == 0) {
80+
return load_homemenu();
7881
#endif
7982
} else {
8083
const char *ext = get_filename_ext(path);
8184
if (strcasecmp(ext, "bin") == 0
8285
|| strcasecmp(ext, "dat") == 0) {
8386
return load_bin(path, offset);
8487
#ifndef ARM9
85-
} else if (strcasecmp(ext, "3dsx") == 0) {
86-
return load_3dsx(path);
88+
} else if (strcasecmp(ext, "3dsx") == 0) {
89+
return load_3dsx(path);
8790
#endif
8891
} else {
8992
debug("Invalid file: %s\n", path);

source/menu_boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int menu_boot() {
108108
if(menu_more() == 0) {
109109
break;
110110
}
111-
} else if (boot(boot_index)) {
111+
} else if (boot(boot_index) == 0) {
112112
break;
113113
}
114114
}

0 commit comments

Comments
 (0)