[apm3, idac] improved launch.bat, removed zinput
This commit is contained in:
3
dist/apm3/launch.bat
vendored
3
dist/apm3/launch.bat
vendored
@ -20,7 +20,8 @@ pushd %~dp0
|
||||
qprocess amdaemon.exe > NUL
|
||||
IF %ERRORLEVEL% NEQ 0 start /min "AM Daemon" inject -d -k apm3hook.dll amdaemon.exe -c daemon_config\common.json daemon_config\server.json config_hook.json
|
||||
|
||||
inject -d -k apm3hook.dll APMV3System -screen-fullscreen 0 -screen-width 1920 -screen-height 1080 -popupWindow -logFile output_log.txt
|
||||
REM Add "-screen-fullscreen 0 -popupWindow" if you want to run in windowed mode
|
||||
inject -d -k apm3hook.dll APMV3System -logFile output_log.txt
|
||||
|
||||
if exist %tmp%\segaboot (
|
||||
del %tmp%\segaboot
|
||||
|
@ -88,18 +88,9 @@ void idac_hook_config_load(
|
||||
platform_config_load(&cfg->platform, filename);
|
||||
aime_config_load(&cfg->aime, filename);
|
||||
idac_dll_config_load(&cfg->dll, filename);
|
||||
zinput_config_load(&cfg->zinput, filename);
|
||||
dvd_config_load(&cfg->dvd, filename);
|
||||
io4_config_load(&cfg->io4, filename);
|
||||
ffb_config_load(&cfg->ffb, filename);
|
||||
led15070_config_load(&cfg->led15070, filename);
|
||||
indrun_config_load(&cfg->indrun, filename);
|
||||
}
|
||||
|
||||
void zinput_config_load(struct zinput_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
|
||||
cfg->enable = GetPrivateProfileIntW(L"zinput", L"enable", 1, filename);
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "hooklib/dvd.h"
|
||||
|
||||
#include "idachook/idac-dll.h"
|
||||
#include "idachook/zinput.h"
|
||||
#include "idachook/indrun.h"
|
||||
|
||||
#include "platform/platform.h"
|
||||
@ -21,7 +20,6 @@ struct idac_hook_config {
|
||||
struct io4_config io4;
|
||||
struct ffb_config ffb;
|
||||
struct idac_dll_config dll;
|
||||
struct zinput_config zinput;
|
||||
struct led15070_config led15070;
|
||||
struct indrun_config indrun;
|
||||
};
|
||||
@ -34,10 +32,6 @@ void idac_hook_config_load(
|
||||
struct idac_hook_config *cfg,
|
||||
const wchar_t *filename);
|
||||
|
||||
void zinput_config_load(
|
||||
struct zinput_config *cfg,
|
||||
const wchar_t *filename);
|
||||
|
||||
void indrun_config_load(
|
||||
struct indrun_config *cfg,
|
||||
const wchar_t *filename);
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "idachook/idac-dll.h"
|
||||
#include "idachook/io4.h"
|
||||
#include "idachook/ffb.h"
|
||||
#include "idachook/zinput.h"
|
||||
|
||||
#include "platform/platform.h"
|
||||
|
||||
@ -55,7 +54,6 @@ static DWORD CALLBACK idac_pre_startup(void)
|
||||
/* Hook Win32 APIs */
|
||||
|
||||
serial_hook_init();
|
||||
zinput_hook_init(&idac_hook_cfg.zinput);
|
||||
dvd_hook_init(&idac_hook_cfg.dvd, idac_hook_mod);
|
||||
|
||||
/* Initialize emulation hooks */
|
||||
|
@ -25,8 +25,6 @@ shared_library(
|
||||
'idac-dll.h',
|
||||
'io4.c',
|
||||
'io4.h',
|
||||
'zinput.c',
|
||||
'zinput.h',
|
||||
'indrun.c',
|
||||
'indrun.h',
|
||||
'ffb.c',
|
||||
|
@ -1,187 +0,0 @@
|
||||
#include <windows.h>
|
||||
#include <dinput.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "idachook/config.h"
|
||||
#include "idachook/zinput.h"
|
||||
|
||||
#include "hook/table.h"
|
||||
|
||||
#include "util/dprintf.h"
|
||||
|
||||
HRESULT WINAPI hook_DirectInput8Create(
|
||||
HINSTANCE hinst,
|
||||
DWORD dwVersion,
|
||||
REFIID riidltf,
|
||||
LPVOID *ppvOut,
|
||||
LPUNKNOWN punkOuter);
|
||||
|
||||
static unsigned long WINAPI hook_AddRef(IUnknown *self);
|
||||
|
||||
static unsigned long WINAPI hook_Release(IUnknown *self);
|
||||
|
||||
static HRESULT WINAPI hook_CreateDevice(
|
||||
IDirectInput8W *self,
|
||||
REFGUID rguid,
|
||||
LPDIRECTINPUTDEVICE8W * lplpDirectInputDevice,
|
||||
LPUNKNOWN pUnkOuter);
|
||||
|
||||
static HRESULT WINAPI hook_EnumDevices(
|
||||
IDirectInput8W *self,
|
||||
DWORD dwDevType,
|
||||
LPDIENUMDEVICESCALLBACKW lpCallback,
|
||||
LPVOID pvRef,
|
||||
DWORD dwFlags);
|
||||
|
||||
static HRESULT WINAPI hook_SetDataFormat(
|
||||
IDirectInputDevice8W *self,
|
||||
LPCDIDATAFORMAT lpdf);
|
||||
|
||||
static HRESULT WINAPI hook_SetCooperativeLevel(
|
||||
IDirectInputDevice8W *self,
|
||||
HWND hwnd,
|
||||
DWORD flags);
|
||||
|
||||
static HRESULT WINAPI hook_Acquire(IDirectInputDevice8W *self);
|
||||
|
||||
static HRESULT WINAPI hook_Unacquire(IDirectInputDevice8W *self);
|
||||
|
||||
static HRESULT WINAPI hook_GetDeviceState(
|
||||
IDirectInputDevice8W *self,
|
||||
DWORD cbData,
|
||||
LPVOID lpvData);
|
||||
|
||||
static const IDirectInput8WVtbl api_vtbl = {
|
||||
.AddRef = (void *) hook_AddRef,
|
||||
.Release = (void *) hook_Release,
|
||||
.CreateDevice = hook_CreateDevice,
|
||||
.EnumDevices = hook_EnumDevices,
|
||||
};
|
||||
|
||||
static const IDirectInput8W api = { (void *) &api_vtbl };
|
||||
|
||||
static const IDirectInputDevice8WVtbl dev_vtbl = {
|
||||
.AddRef = (void *) hook_AddRef,
|
||||
.Release = (void *) hook_Release,
|
||||
.SetDataFormat = hook_SetDataFormat,
|
||||
.SetCooperativeLevel= hook_SetCooperativeLevel,
|
||||
.Acquire = hook_Acquire,
|
||||
.Unacquire = hook_Unacquire,
|
||||
.GetDeviceState = hook_GetDeviceState,
|
||||
};
|
||||
|
||||
static const IDirectInputDevice8W dev = { (void *) &dev_vtbl };
|
||||
|
||||
static const struct hook_symbol zinput_hook_syms[] = {
|
||||
{
|
||||
.name = "DirectInput8Create",
|
||||
.patch = hook_DirectInput8Create,
|
||||
}
|
||||
};
|
||||
|
||||
HRESULT zinput_hook_init(struct zinput_config *cfg)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
|
||||
if (!cfg->enable) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
hook_table_apply(
|
||||
NULL,
|
||||
"dinput8.dll",
|
||||
zinput_hook_syms,
|
||||
_countof(zinput_hook_syms));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI hook_DirectInput8Create(
|
||||
HINSTANCE hinst,
|
||||
DWORD dwVersion,
|
||||
REFIID riidltf,
|
||||
LPVOID *ppvOut,
|
||||
LPUNKNOWN punkOuter)
|
||||
{
|
||||
dprintf("ZInput: Blocking built-in DirectInput support\n");
|
||||
*ppvOut = (void *) &api;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static unsigned long WINAPI hook_AddRef(IUnknown *self)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static unsigned long WINAPI hook_Release(IUnknown *self)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_CreateDevice(
|
||||
IDirectInput8W *self,
|
||||
REFGUID rguid,
|
||||
LPDIRECTINPUTDEVICE8W *lplpDirectInputDevice,
|
||||
LPUNKNOWN pUnkOuter)
|
||||
{
|
||||
dprintf("ZInput: %s\n", __func__);
|
||||
*lplpDirectInputDevice = (void *) &dev;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_EnumDevices(
|
||||
IDirectInput8W *self,
|
||||
DWORD dwDevType,
|
||||
LPDIENUMDEVICESCALLBACKW lpCallback,
|
||||
LPVOID pvRef,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
dprintf("ZInput: %s\n", __func__);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_SetDataFormat(
|
||||
IDirectInputDevice8W *self,
|
||||
LPCDIDATAFORMAT lpdf)
|
||||
{
|
||||
dprintf("ZInput: %s\n", __func__);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_SetCooperativeLevel(
|
||||
IDirectInputDevice8W *self,
|
||||
HWND hwnd,
|
||||
DWORD flags)
|
||||
{
|
||||
dprintf("ZInput: %s\n", __func__);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_Acquire(IDirectInputDevice8W *self)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_Unacquire(IDirectInputDevice8W *self)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI hook_GetDeviceState(
|
||||
IDirectInputDevice8W *self,
|
||||
DWORD cbData,
|
||||
LPVOID lpvData)
|
||||
{
|
||||
memset(lpvData, 0, cbData);
|
||||
|
||||
return S_OK;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
struct zinput_config {
|
||||
bool enable;
|
||||
};
|
||||
|
||||
HRESULT zinput_hook_init(struct zinput_config *cfg);
|
Reference in New Issue
Block a user