Skip to content

Commit b86fe46

Browse files
author
icex2
committed
wip
1 parent ad62c00 commit b86fe46

11 files changed

Lines changed: 537 additions & 111 deletions

File tree

dist/ddr/launcher-18.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="Shift-JIS"?>
2+
<launcher>
3+
<bootstrap>
4+
<file __type="str">prop/bootstrap.xml</file>
5+
<selector __type="str">bemanitools_local_fs</selector>
6+
<config>
7+
<startup>
8+
<bemanitools_local_fs>
9+
<default>
10+
<file dst="/dev/nvram/ea3-config.xml" src="/prop/eamuse-config.xml" />
11+
<file dst="/dev/nvram/coin.xml" src="/prop/coin.xml" />
12+
<file dst="/dev/nvram/eacoin.xml" src="/prop/eacoin.xml" />
13+
<file dst="/dev/nvram/testmode-v.xml" src="/prop/testmode-v.xml" />
14+
</default>
15+
<boot>
16+
<file>prop/avs-config.xml</file>
17+
<heap_avs __type="u32">33554432</heap_avs>
18+
<heap_std __type="u32">1048576</heap_std>
19+
<config>
20+
<fs>
21+
<root>
22+
<device __type="str">.</device>
23+
</root>
24+
<nvram>
25+
<device __type="str">dev/nvram</device>
26+
<fstype __type="str">fs</fstype>
27+
<option __type="str">vf=1,posix=1</option>
28+
</nvram>
29+
<raw>
30+
<device __type="str">dev/raw</device>
31+
<fstype __type="str">fs</fstype>
32+
<option __type="str">vf=1,posix=1</option>
33+
</raw>
34+
</fs>
35+
</config>
36+
</boot>
37+
<log>
38+
<level>info</level>
39+
</log>
40+
<drm>
41+
<dll>kdm.dll</dll>
42+
<device>.</device>
43+
<dst>/</dst>
44+
<fstype>fs</fstype>
45+
</drm>
46+
<eamuse>
47+
<file>/dev/nvram/ea3-config.xml</file>
48+
<config>
49+
<network>
50+
<services>https://eamuse.konami.fun/service/services/services/</services>
51+
</network>
52+
</config>
53+
</eamuse>
54+
<component>
55+
<file>arkmdxp3.dll</file>
56+
<param></param>
57+
</component>
58+
</bemanitools_local_fs>
59+
</startup>
60+
</config>
61+
</bootstrap>
62+
<ea3_ident>
63+
<file __type="str">prop/ea3-ident.xml</file>
64+
<config>
65+
<soft>
66+
<model __type="str">MDX</model>
67+
<dest __type="str">J</dest>
68+
<spec __type="str">B</spec>
69+
<rev __type="str">A</rev>
70+
<ext __type="str">2022020200</ext>
71+
</soft>
72+
<id>
73+
<softid __type="str">0101020304050607083F</softid>
74+
<pcbid __type="str">0101020304050607083F</pcbid>
75+
</id>
76+
</config>
77+
</ea3_ident>
78+
<hook>
79+
<hook_dlls>
80+
</hook_dlls>
81+
<before_hook_dlls>
82+
</before_hook_dlls>
83+
<iat_hook_dlls>
84+
</iat_hook_dlls>
85+
</hook>
86+
<debug>
87+
<remote_debugger __type="bool">false</remote_debugger>
88+
<log_property_configs __type="bool">false</log_property_configs>
89+
</debug>
90+
</launcher>

src/main/launcher/Module.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ src_launcher := \
2020
ea3-ident.c \
2121
eamuse.c \
2222
eamuse-config.c \
23+
launcher-config.c \
2324
logger.c \
2425
main.c \
2526
module.c \

src/main/launcher/avs.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,67 @@ static void _avs_context_create_config_fs_dir(
155155
}
156156
}
157157

158+
static void avs_config_setup(
159+
struct bootstrap_config *bootstrap_config,
160+
const char* dev_nvram_raw_path,
161+
bool override_loglevel_enabled,
162+
enum log_level loglevel,
163+
struct property **avs_config_property)
158164
void avs_init(
165+
const struct bootstrap_avs_config *config,
159166
struct property *config_prop,
160167
struct property_node *config_node,
161168
uint32_t avs_heap_size,
162169
uint32_t std_heap_size)
163170
{
171+
log_assert(bootstrap_config);
172+
log_assert(avs_config_property);
173+
174+
175+
176+
*avs_config_property = avs_config_load_from_file_path(config->config_file);
177+
178+
if (dev_nvram_raw_path) {
179+
if (!path_exists(dev_nvram_raw_path)) {
180+
log_warning("Override local file system dev/nvram and dev/raw path %s does not exist, creating",
181+
dev_nvram_raw_path);
182+
183+
if (!path_mkdir(dev_nvram_raw_path)) {
184+
log_fatal("Creating directory %s failed", dev_nvram_raw_path);
185+
}
186+
}
187+
188+
avs_config_set_local_fs_path_dev_nvram_and_raw(
189+
*avs_config_property,
190+
dev_nvram_raw_path);
191+
}
192+
193+
if (override_loglevel_enabled) {
194+
avs_config_set_log_level(*avs_config_property, loglevel);
195+
}
196+
197+
198+
199+
200+
201+
202+
avs_config_set_mode_product(avs_property, true);
203+
avs_config_set_net_raw(avs_property, true);
204+
avs_config_set_net_eaudp(avs_property, true);
205+
avs_config_set_sntp_ea(avs_property, true);
206+
207+
if (config->startup.drm.device[0]) {
208+
avs_config_set_fs_root_device(avs_property, config->startup.drm.device);
209+
}
210+
211+
if (config->log_node) {
212+
avs_config_set_logging(avs_property, config);
213+
}
214+
215+
216+
217+
218+
164219
log_assert(config_prop);
165220
log_assert(config_node);
166221

src/main/launcher/bootstrap-config.c

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ PSMAP_END
195195
#define ROOT_NODE "/config"
196196
#define MODULE_PATH_PREFIX "modules/"
197197

198+
#define DEFAULT_HEAP_SIZE 16777216
199+
198200
const char *const inherited_nodes[] = {
199201
"develop",
200202
"default",
@@ -212,7 +214,17 @@ const char *const inherited_nodes[] = {
212214

213215
void bootstrap_config_init(struct bootstrap_config *config)
214216
{
215-
memset(config, 0, sizeof(*config));
217+
log_assert(config);
218+
219+
memset(config, 0, sizeof(*config));
220+
221+
str_cpy(config->startup.avs.config_file, sizeof(config->startup.avs.config_file), "prop/avs-config.xml");
222+
config->startup.avs.avs_heap_size = DEFAULT_HEAP_SIZE;
223+
config->startup.avs.std_heap_size = DEFAULT_HEAP_SIZE;
224+
225+
str_cpy(config->startup.log.level, sizeof(config->startup.log.level), "info");
226+
227+
// TODO what else?
216228
}
217229

218230
bool bootstrap_config_from_property(
@@ -374,23 +386,6 @@ bool bootstrap_config_from_property(
374386
return true;
375387
}
376388

377-
void bootstrap_config_update_avs(
378-
const struct bootstrap_config *config, struct property *avs_property)
379-
{
380-
avs_config_set_mode_product(avs_property, true);
381-
avs_config_set_net_raw(avs_property, true);
382-
avs_config_set_net_eaudp(avs_property, true);
383-
avs_config_set_sntp_ea(avs_property, true);
384-
385-
if (config->startup.drm.device[0]) {
386-
avs_config_set_fs_root_device(avs_property, config->startup.drm.device);
387-
}
388-
389-
if (config->log_node) {
390-
avs_config_set_logging(avs_property, config);
391-
}
392-
}
393-
394389
bool bootstrap_config_iter_default_file(
395390
struct bootstrap_config *config,
396391
struct bootstrap_default_file_config *default_file)

src/main/launcher/bootstrap-config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ bool bootstrap_config_from_property(
138138
const char *profile);
139139

140140
// TODO this should rather move somewhere else?
141-
void bootstrap_config_update_avs(
142-
const struct bootstrap_config *config, struct property *avs_property);
143141
bool bootstrap_config_iter_default_file(
144142
struct bootstrap_config *config,
145143
struct bootstrap_default_file_config *default_file);

0 commit comments

Comments
 (0)