diff --git a/board/usio.c b/board/usio.c index f479a39..f9d2d62 100644 --- a/board/usio.c +++ b/board/usio.c @@ -25,6 +25,7 @@ #include "util/dump.h" 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_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_GetService(uint8_t id); static int my_bnusio_GetServiceError(uint8_t id); +static intptr_t my_bnusio_GetIoBoardName(); static struct hook_symbol usio_syms[] = { { @@ -113,6 +115,10 @@ static struct hook_symbol usio_syms[] = { .name = "bnusio_GetServiceError", .patch = my_bnusio_GetServiceError }, + { + .name = "bnusio_GetIoBoardName", + .patch = my_bnusio_GetIoBoardName + }, { .name = "Open", .patch = my_bnusio_Open @@ -180,6 +186,10 @@ static struct hook_symbol usio_syms[] = { { .name = "GetServiceError", .patch = my_bnusio_GetServiceError + }, + { + .name = "GetIoBoardName", + .patch = my_bnusio_GetIoBoardName } }; @@ -356,4 +366,11 @@ static int my_bnusio_GetSwIn() opbtn_out = (state.p2_btns << 16) | (state.p1_btns << 8) | state.op_btns; 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; } \ No newline at end of file