1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-14 08:07:37 +01:00
segatools-dniel97/platform/platform.c

133 lines
2.3 KiB
C
Raw Normal View History

2019-05-18 05:10:09 +02:00
#include <windows.h>
#include <assert.h>
#include "platform/amvideo.h"
2019-10-15 05:18:18 +02:00
#include "platform/clock.h"
2019-05-18 05:10:09 +02:00
#include "platform/config.h"
#include "platform/dns.h"
2019-05-18 05:10:09 +02:00
#include "platform/hwmon.h"
#include "platform/misc.h"
2019-05-18 05:10:09 +02:00
#include "platform/nusec.h"
2019-08-31 00:46:57 +02:00
#include "platform/pcbid.h"
2019-05-18 05:10:09 +02:00
#include "platform/platform.h"
#include "platform/vfs.h"
2019-05-18 05:10:09 +02:00
2019-08-31 00:46:57 +02:00
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;
}
2019-10-15 05:18:18 +02:00
hr = clock_hook_init(&cfg->clock);
if (FAILED(hr)) {
return hr;
}
hr = dns_platform_hook_init(&cfg->dns);
if (FAILED(hr)) {
return hr;
}
2019-08-31 00:46:57 +02:00
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;
}
2019-05-18 05:10:09 +02:00
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;
}
2019-10-15 05:18:18 +02:00
hr = clock_hook_init(&cfg->clock);
if (FAILED(hr)) {
return hr;
}
hr = dns_platform_hook_init(&cfg->dns);
if (FAILED(hr)) {
return hr;
}
2019-05-18 05:10:09 +02:00
hr = hwmon_hook_init(&cfg->hwmon);
if (FAILED(hr)) {
return hr;
}
hr = misc_hook_init(&cfg->misc, platform_id);
if (FAILED(hr)) {
return hr;
}
2019-05-18 05:10:09 +02:00
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;
}
2019-05-18 05:10:09 +02:00
return S_OK;
}