Skip to content

Commit fdee333

Browse files
Merge pull request #16 from NathanNeurotic/codex/adjust-config-search-logic-for-mc-devices
Align config search order with README
2 parents bfcbe6a + f95f032 commit fdee333

3 files changed

Lines changed: 27 additions & 27 deletions

File tree

include/common.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
#define COMMONDEF
33
typedef enum
44
{
5-
SOURCE_MC0 = 0,
5+
SOURCE_CWD = 0,
66
SOURCE_MC1,
7-
SOURCE_MASS,
8-
SOURCE_MX4SIO,
9-
SOURCE_HDD,
10-
SOURCE_XFROM,
11-
SOURCE_MMCE0,
12-
SOURCE_MMCE1,
7+
SOURCE_MC0,
138
SOURCE_XCONFIG,
14-
SOURCE_CWD,
9+
SOURCE_MMCE1,
10+
SOURCE_MMCE0,
11+
SOURCE_XFROM,
12+
SOURCE_HDD,
13+
SOURCE_MX4SIO,
14+
SOURCE_MASS,
1515
SOURCE_INVALID,
1616
SOURCE_COUNT,
1717
} CONFIG_SOURCES_ID;

src/common.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#include "common.h"
22

33
const char *const SOURCES[SOURCE_COUNT] = {
4-
"mc0",
4+
"CWD",
55
"mc1",
6-
"usb",
7-
"mx4sio",
8-
"hdd",
9-
"xfrom",
10-
"mmce0",
11-
"mmce1",
6+
"mc0",
127
"XCONF",
13-
"CWD",
8+
"mmce1",
9+
"mmce0",
10+
"xfrom",
11+
"hdd",
12+
"mx4sio",
13+
"mass",
1414
"NOT FOUND",
1515
};
1616

src/main.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ typedef struct
2020
CONFIG GLOBCFG;
2121

2222
static const char *const DEFAULT_CONFIG_PATHS[SOURCE_COUNT] = {
23-
"mc0:/SYS-CONF/PS2BBL.INI",
23+
"CONFIG.INI",
2424
"mc1:/SYS-CONF/PS2BBL.INI",
25-
"mass:/PS2BBL/CONFIG.INI",
26-
"massX:/PS2BBL/CONFIG.INI",
27-
"hdd0:__sysconf:pfs:/PS2BBL/CONFIG.INI",
28-
"xfrom:/PS2BBL/CONFIG.INI",
29-
"mmce0:/PS2BBL/PS2BBL.INI",
30-
"mmce1:/PS2BBL/PS2BBL.INI",
25+
"mc0:/SYS-CONF/PS2BBL.INI",
3126
"mc?:/SYS-CONF/PSXBBL.INI",
32-
"CONFIG.INI",
27+
"mmce1:/PS2BBL/PS2BBL.INI",
28+
"mmce0:/PS2BBL/PS2BBL.INI",
29+
"xfrom:/PS2BBL/CONFIG.INI",
30+
"hdd0:__sysconf:pfs:/PS2BBL/CONFIG.INI",
31+
"massX:/PS2BBL/CONFIG.INI",
32+
"mass:/PS2BBL/CONFIG.INI",
3333
"",
3434
};
3535
const char *CONFIG_PATHS[SOURCE_COUNT];
@@ -144,10 +144,10 @@ static void InitConfigPathState(void)
144144
{
145145
memcpy(CONFIG_PATHS, DEFAULT_CONFIG_PATHS, sizeof(CONFIG_PATHS));
146146
memset(config_path_enabled, 0, sizeof(config_path_enabled));
147-
config_path_enabled[SOURCE_MC0] = 1;
147+
config_path_enabled[SOURCE_CWD] = 1;
148148
config_path_enabled[SOURCE_MC1] = 1;
149+
config_path_enabled[SOURCE_MC0] = 1;
149150
config_path_enabled[SOURCE_MASS] = 1;
150-
config_path_enabled[SOURCE_CWD] = 1;
151151
#ifdef PSX
152152
config_path_enabled[SOURCE_XCONFIG] = 1;
153153
#endif
@@ -533,7 +533,7 @@ int main(int argc, char *argv[])
533533
#endif
534534

535535
FILE *fp;
536-
for (x = SOURCE_CWD; x >= SOURCE_MC0; x--) {
536+
for (x = SOURCE_CWD; x < SOURCE_INVALID; x++) {
537537
if (!IsConfigPathEnabled(x))
538538
continue;
539539
char *config_path = strdup(CONFIG_PATHS[x]);

0 commit comments

Comments
 (0)