forked from TeamTofuShop/segatools
platform: Re-fuse Nu and ALLS platforms
There's basically no difference at the platform level except for the addition of the ALLS PCBID hook, which is harmless on Nu.
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
|
||||
#include "platform/config.h"
|
||||
|
||||
void alls_config_load(struct alls_config *cfg, const wchar_t *filename)
|
||||
void platform_config_load(struct platform_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
@ -27,21 +27,6 @@ void alls_config_load(struct alls_config *cfg, const wchar_t *filename)
|
||||
vfs_config_load(&cfg->vfs, filename);
|
||||
}
|
||||
|
||||
void nu_config_load(struct nu_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
|
||||
amvideo_config_load(&cfg->amvideo, filename);
|
||||
clock_config_load(&cfg->clock, filename);
|
||||
dns_config_load(&cfg->dns, filename);
|
||||
hwmon_config_load(&cfg->hwmon, filename);
|
||||
misc_config_load(&cfg->misc, filename);
|
||||
netenv_config_load(&cfg->netenv, filename);
|
||||
nusec_config_load(&cfg->nusec, filename);
|
||||
vfs_config_load(&cfg->vfs, filename);
|
||||
}
|
||||
|
||||
void amvideo_config_load(struct amvideo_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
|
@ -62,18 +62,7 @@ struct vfs_config {
|
||||
wchar_t appdata[MAX_PATH];
|
||||
};
|
||||
|
||||
struct nu_config {
|
||||
struct amvideo_config amvideo;
|
||||
struct clock_config clock;
|
||||
struct dns_config dns;
|
||||
struct hwmon_config hwmon;
|
||||
struct misc_config misc;
|
||||
struct netenv_config netenv;
|
||||
struct nusec_config nusec;
|
||||
struct vfs_config vfs;
|
||||
};
|
||||
|
||||
struct alls_config {
|
||||
struct platform_config {
|
||||
struct amvideo_config amvideo;
|
||||
struct clock_config clock;
|
||||
struct dns_config dns;
|
||||
@ -85,8 +74,9 @@ struct alls_config {
|
||||
struct vfs_config vfs;
|
||||
};
|
||||
|
||||
void alls_config_load(struct alls_config *cfg, const wchar_t *filename);
|
||||
void nu_config_load(struct nu_config *cfg, const wchar_t *filename);
|
||||
void platform_config_load(
|
||||
struct platform_config *cfg,
|
||||
const wchar_t *filename);
|
||||
|
||||
void amvideo_config_load(struct amvideo_config *cfg, const wchar_t *filename);
|
||||
void clock_config_load(struct clock_config *cfg, const wchar_t *filename);
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "platform/platform.h"
|
||||
#include "platform/vfs.h"
|
||||
|
||||
HRESULT platform_hook_init_alls(
|
||||
const struct alls_config *cfg,
|
||||
HRESULT platform_hook_init(
|
||||
const struct platform_config *cfg,
|
||||
const char *game_id,
|
||||
const char *platform_id,
|
||||
HMODULE redir_mod)
|
||||
@ -79,67 +79,3 @@ HRESULT platform_hook_init_alls(
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT platform_hook_init_nu(
|
||||
const struct nu_config *cfg,
|
||||
const char *game_id,
|
||||
const char *platform_id,
|
||||
HMODULE redir_mod)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
assert(cfg != NULL);
|
||||
assert(game_id != NULL);
|
||||
assert(platform_id != NULL);
|
||||
assert(redir_mod != NULL);
|
||||
|
||||
hr = amvideo_hook_init(&cfg->amvideo, redir_mod);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = clock_hook_init(&cfg->clock);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = dns_platform_hook_init(&cfg->dns);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = hwmon_hook_init(&cfg->hwmon);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = misc_hook_init(&cfg->misc, platform_id);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = netenv_hook_init(&cfg->netenv, &cfg->nusec);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = nusec_hook_init(&cfg->nusec, game_id, platform_id);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = vfs_hook_init(&cfg->vfs);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -4,14 +4,8 @@
|
||||
|
||||
#include "platform/config.h"
|
||||
|
||||
HRESULT platform_hook_init_alls(
|
||||
const struct alls_config *cfg,
|
||||
const char *game_id,
|
||||
const char *platform_id,
|
||||
HMODULE redir_mod);
|
||||
|
||||
HRESULT platform_hook_init_nu(
|
||||
const struct nu_config *cfg,
|
||||
HRESULT platform_hook_init(
|
||||
const struct platform_config *cfg,
|
||||
const char *game_id,
|
||||
const char *platform_id,
|
||||
HMODULE redir_mod);
|
||||
|
Reference in New Issue
Block a user