Added d3d11 hook, better touch naming

This commit is contained in:
2022-02-10 12:17:10 -05:00
committed by Hay1tsme
parent 50884d5b19
commit 1964fa766f
11 changed files with 34 additions and 15 deletions

View File

@ -5,6 +5,7 @@
#include "hooklib/config.h"
#include "hooklib/dvd.h"
#include "gfxhook/config.h"
#include "mercuryhook/config.h"
@ -51,6 +52,7 @@ void mercury_hook_config_load(
aime_config_load(&cfg->aime, filename);
dvd_config_load(&cfg->dvd, filename);
io4_config_load(&cfg->io4, filename);
gfx_config_load(&cfg->gfx, filename);
mercury_dll_config_load(&cfg->dll, filename);
touch_config_load(&cfg->touch, filename);
}

View File

@ -5,6 +5,7 @@
#include "board/config.h"
#include "hooklib/dvd.h"
#include "gfxhook/gfx.h"
#include "mercuryhook/mercury-dll.h"
#include "mercuryhook/touch.h"
@ -16,6 +17,7 @@ struct mercury_hook_config {
struct aime_config aime;
struct dvd_config dvd;
struct io4_config io4;
struct gfx_config gfx;
struct mercury_dll_config dll;
struct touch_config touch;
};

View File

@ -9,6 +9,9 @@
#include "hooklib/serial.h"
#include "hooklib/spike.h"
#include "gfxhook/gfx.h"
#include "gfxhook/d3d11.h"
#include "mercuryhook/config.h"
#include "mercuryhook/io4.h"
#include "mercuryhook/mercury-dll.h"
@ -40,6 +43,9 @@ static DWORD CALLBACK mercury_pre_startup(void)
dvd_hook_init(&mercury_hook_cfg.dvd, mercury_hook_mod);
serial_hook_init();
gfx_hook_init(&mercury_hook_cfg.gfx);
gfx_d3d11_hook_init(&mercury_hook_cfg.gfx, mercury_hook_mod);
/* Initialize emulation hooks */
hr = platform_hook_init(

View File

@ -11,6 +11,7 @@ shared_library(
],
link_with : [
aimeio_lib,
gfxhook_lib,
board_lib,
hooklib_lib,
mercuryio_lib,

View File

@ -31,7 +31,7 @@ static HRESULT touch_frame_decode(struct touch_req *dest, struct iobuf *iobuf, i
static uint8_t calc_checksum(const void *ptr, size_t nbytes);
static HRESULT touch_handle_get_sync_board_ver(const struct touch_req *req);
static HRESULT touch_handle_startup(const struct touch_req *req);
static HRESULT touch_handle_next_read(const struct touch_req *req);
static HRESULT touch_handle_get_unit_board_ver(const struct touch_req *req);
static HRESULT touch_handle_mystery1(const struct touch_req *req);
static HRESULT touch_handle_mystery2(const struct touch_req *req);
@ -204,8 +204,8 @@ static HRESULT touch_req_dispatch(const struct touch_req *req)
switch (req->cmd) {
case CMD_GET_SYNC_BOARD_VER:
return touch_handle_get_sync_board_ver(req);
case CMD_STARTUP:
return touch_handle_startup(req);
case CMD_NEXT_READ:
return touch_handle_next_read(req);
case CMD_GET_UNIT_BOARD_VER:
return touch_handle_get_unit_board_ver(req);
case CMD_MYSTERY1:
@ -252,13 +252,13 @@ static HRESULT touch_handle_get_sync_board_ver(const struct touch_req *req)
}
/* TODO: Very ugly please make better before upstreaming */
static HRESULT touch_handle_startup(const struct touch_req *req)
static HRESULT touch_handle_next_read(const struct touch_req *req)
{
struct touch_resp_startup resp;
HRESULT hr;
uint8_t *rev;
dprintf("Wacca Touch%d: Startup %2hx\n", req->side, req->data[2]);
dprintf("Wacca Touch%d: Read section %2hx\n", req->side, req->data[2]);
switch (req->data[2]) {
@ -290,7 +290,7 @@ static HRESULT touch_handle_startup(const struct touch_req *req)
0x20, 0x20, 0x20, 0x34 };
break;
default:
dprintf("Wacca touch: BAD STARTUP REQUEST %2hx\n", req->data[2]);
dprintf("Wacca touch: BAD READ REQUEST %2hx\n", req->data[2]);
return 1;
}
@ -342,7 +342,7 @@ static HRESULT touch_handle_mystery1(const struct touch_req *req)
struct touch_resp_mystery1 resp;
HRESULT hr;
dprintf("Wacca Touch%d: mystery command 1\n", req->side);
dprintf("Wacca Touch%d: Command A2\n", req->side);
resp.cmd = 0xa2;
resp.data = 0x3f;
@ -363,7 +363,7 @@ static HRESULT touch_handle_mystery2(const struct touch_req *req)
struct touch_resp_mystery2 resp;
HRESULT hr;
dprintf("Wacca Touch%d: mystery command 2\n", req->side);
dprintf("Wacca Touch%d: Command 94\n", req->side);
resp.cmd = 0x94;
resp.data = 0;

View File

@ -10,7 +10,7 @@ struct touch_config {
enum touch_cmd {
CMD_GET_SYNC_BOARD_VER = 0xa0,
CMD_STARTUP = 0x72,
CMD_NEXT_READ = 0x72,
CMD_GET_UNIT_BOARD_VER = 0xa8,
CMD_MYSTERY1 = 0xa2,
CMD_MYSTERY2 = 0x94,