diff --git a/platform/config.c b/platform/config.c index 17bf659..993290e 100644 --- a/platform/config.c +++ b/platform/config.c @@ -9,7 +9,20 @@ #include "platform/config.h" -void nu_config_load(struct nu_config *cfg,const wchar_t *filename) +void alls_config_load(struct alls_config *cfg, const wchar_t *filename) +{ + assert(cfg != NULL); + assert(filename != NULL); + + amvideo_config_load(&cfg->amvideo, filename); + hwmon_config_load(&cfg->hwmon, filename); + misc_config_load(&cfg->misc, filename); + pcbid_config_load(&cfg->pcbid, filename); + nusec_config_load(&cfg->nusec, 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); diff --git a/platform/config.h b/platform/config.h index 64d979b..fccc661 100644 --- a/platform/config.h +++ b/platform/config.h @@ -49,7 +49,18 @@ struct nu_config { struct vfs_config vfs; }; -void nu_config_load(struct nu_config *cfg,const wchar_t *filename); +struct alls_config { + struct amvideo_config amvideo; + struct hwmon_config hwmon; + struct misc_config misc; + struct pcbid_config pcbid; + struct nusec_config nusec; + 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 amvideo_config_load(struct amvideo_config *cfg, const wchar_t *filename); void hwmon_config_load(struct hwmon_config *cfg, const wchar_t *filename); void misc_config_load(struct misc_config *cfg, const wchar_t *filename); diff --git a/platform/platform.c b/platform/platform.c index 3e48400..9b8b12b 100644 --- a/platform/platform.c +++ b/platform/platform.c @@ -7,9 +7,58 @@ #include "platform/hwmon.h" #include "platform/misc.h" #include "platform/nusec.h" +#include "platform/pcbid.h" #include "platform/platform.h" #include "platform/vfs.h" +HRESULT platform_hook_init_alls( + const struct alls_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 = hwmon_hook_init(&cfg->hwmon); + + if (FAILED(hr)) { + return hr; + } + + hr = misc_hook_init(&cfg->misc, platform_id); + + if (FAILED(hr)) { + return hr; + } + + hr = nusec_hook_init(&cfg->nusec, game_id, platform_id); + + if (FAILED(hr)) { + return hr; + } + + pcbid_hook_init(&cfg->pcbid); + + hr = vfs_hook_init(&cfg->vfs); + + if (FAILED(hr)) { + return hr; + } + + return S_OK; +} + HRESULT platform_hook_init_nu( const struct nu_config *cfg, const char *game_id, diff --git a/platform/platform.h b/platform/platform.h index bf948a3..a610c6d 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -4,6 +4,12 @@ #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, const char *game_id,