mirror of
https://gitea.tendokyu.moe/Dniel97/segatools.git
synced 2024-11-23 21:10:57 +01:00
Wacca: Add toggle for LED board hooks
This commit is contained in:
parent
b2db1f230b
commit
87ecd639a2
6
dist/mercury/segatools.ini
vendored
6
dist/mercury/segatools.ini
vendored
@ -43,8 +43,12 @@ coin=0x24
|
|||||||
volup=0x26
|
volup=0x26
|
||||||
voldown=0x28
|
voldown=0x28
|
||||||
|
|
||||||
|
; Hooks related to the touch boards
|
||||||
[touch]
|
[touch]
|
||||||
; Enable or disable touch hook
|
enable=1
|
||||||
|
|
||||||
|
; Hooks related to the LED board (codenamed Elisabeth)
|
||||||
|
[elisabeth]
|
||||||
enable=1
|
enable=1
|
||||||
|
|
||||||
;[mercuryio]
|
;[mercuryio]
|
||||||
|
@ -41,6 +41,21 @@ void touch_config_load(
|
|||||||
filename);
|
filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void elisabeth_config_load(
|
||||||
|
struct elisabeth_config *cfg,
|
||||||
|
const wchar_t *filename)
|
||||||
|
{
|
||||||
|
assert(cfg != NULL);
|
||||||
|
assert(filename != NULL);
|
||||||
|
|
||||||
|
cfg->enable = GetPrivateProfileIntW(
|
||||||
|
L"elisabeth",
|
||||||
|
L"enable",
|
||||||
|
1,
|
||||||
|
filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void mercury_hook_config_load(
|
void mercury_hook_config_load(
|
||||||
struct mercury_hook_config *cfg,
|
struct mercury_hook_config *cfg,
|
||||||
const wchar_t *filename)
|
const wchar_t *filename)
|
||||||
@ -55,4 +70,5 @@ void mercury_hook_config_load(
|
|||||||
gfx_config_load(&cfg->gfx, filename);
|
gfx_config_load(&cfg->gfx, filename);
|
||||||
mercury_dll_config_load(&cfg->dll, filename);
|
mercury_dll_config_load(&cfg->dll, filename);
|
||||||
touch_config_load(&cfg->touch, filename);
|
touch_config_load(&cfg->touch, filename);
|
||||||
|
elisabeth_config_load(&cfg->elisabeth, filename);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "mercuryhook/mercury-dll.h"
|
#include "mercuryhook/mercury-dll.h"
|
||||||
#include "mercuryhook/touch.h"
|
#include "mercuryhook/touch.h"
|
||||||
|
#include "mercuryhook/elisabeth.h"
|
||||||
|
|
||||||
#include "platform/config.h"
|
#include "platform/config.h"
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ struct mercury_hook_config {
|
|||||||
struct gfx_config gfx;
|
struct gfx_config gfx;
|
||||||
struct mercury_dll_config dll;
|
struct mercury_dll_config dll;
|
||||||
struct touch_config touch;
|
struct touch_config touch;
|
||||||
|
struct elisabeth_config elisabeth;
|
||||||
};
|
};
|
||||||
|
|
||||||
void mercury_dll_config_load(
|
void mercury_dll_config_load(
|
||||||
|
@ -83,7 +83,7 @@ static DWORD CALLBACK mercury_pre_startup(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Start elisabeth Hooks for the LED and IO Board DLLs */
|
/* Start elisabeth Hooks for the LED and IO Board DLLs */
|
||||||
elisabeth_hook_init();
|
elisabeth_hook_init(&mercury_hook_cfg.elisabeth);
|
||||||
|
|
||||||
touch_hook_init(&mercury_hook_cfg.touch);
|
touch_hook_init(&mercury_hook_cfg.touch);
|
||||||
|
|
||||||
|
@ -33,8 +33,11 @@ static const struct hook_symbol win32_hooks[] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT elisabeth_hook_init()
|
HRESULT elisabeth_hook_init(struct elisabeth_config *cfg)
|
||||||
{
|
{
|
||||||
|
if (!cfg->enable) {
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
dll_hook_insert_hooks(NULL);
|
dll_hook_insert_hooks(NULL);
|
||||||
dprintf("Elisabeth: Init\n");
|
dprintf("Elisabeth: Init\n");
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
struct led_data {
|
struct led_data {
|
||||||
DWORD unitCount;
|
DWORD unitCount;
|
||||||
uint8_t rgba[480 * 4];
|
uint8_t rgba[480 * 4];
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT elisabeth_hook_init();
|
struct elisabeth_config {
|
||||||
|
bool enable;
|
||||||
|
};
|
||||||
|
|
||||||
|
HRESULT elisabeth_hook_init(struct elisabeth_config *cfg);
|
||||||
|
Loading…
Reference in New Issue
Block a user