1
0
mirror of synced 2024-11-27 23:10:49 +01:00

usio: impl fake board name

This commit is contained in:
Kevin Trocolli 2023-12-10 18:46:56 -05:00
parent 77aa77496d
commit 5a130705d3

View File

@ -25,6 +25,7 @@
#include "util/dump.h" #include "util/dump.h"
static const wchar_t usio_path[] = L"$usio"; static const wchar_t usio_path[] = L"$usio";
static const wchar_t usio_name[] = L"NBGI.REAL_USIO";
static int my_bnusio_Open(); static int my_bnusio_Open();
static int my_bnusio_Close(); static int my_bnusio_Close();
@ -43,6 +44,7 @@ static int my_bnusio_GetCoin(uint8_t id);
static int my_bnusio_GetCoinError(uint8_t id); static int my_bnusio_GetCoinError(uint8_t id);
static int my_bnusio_GetService(uint8_t id); static int my_bnusio_GetService(uint8_t id);
static int my_bnusio_GetServiceError(uint8_t id); static int my_bnusio_GetServiceError(uint8_t id);
static intptr_t my_bnusio_GetIoBoardName();
static struct hook_symbol usio_syms[] = { static struct hook_symbol usio_syms[] = {
{ {
@ -113,6 +115,10 @@ static struct hook_symbol usio_syms[] = {
.name = "bnusio_GetServiceError", .name = "bnusio_GetServiceError",
.patch = my_bnusio_GetServiceError .patch = my_bnusio_GetServiceError
}, },
{
.name = "bnusio_GetIoBoardName",
.patch = my_bnusio_GetIoBoardName
},
{ {
.name = "Open", .name = "Open",
.patch = my_bnusio_Open .patch = my_bnusio_Open
@ -180,6 +186,10 @@ static struct hook_symbol usio_syms[] = {
{ {
.name = "GetServiceError", .name = "GetServiceError",
.patch = my_bnusio_GetServiceError .patch = my_bnusio_GetServiceError
},
{
.name = "GetIoBoardName",
.patch = my_bnusio_GetIoBoardName
} }
}; };
@ -357,3 +367,10 @@ static int my_bnusio_GetSwIn()
return opbtn_out; return opbtn_out;
} }
static intptr_t my_bnusio_GetIoBoardName()
{
intptr_t ret = (intptr_t)malloc(sizeof(usio_name) / 2);
wcstombs((char *)ret, usio_name, sizeof(usio_name) / 2);
return ret;
}