segatools/platform
Mahuyo a1611afffc Mai2: Add touch and led15070 hook (#55)
In this PR, I have added the `mai2` touch and `led15070` hooks to provide an example for handling custom peripherals. This change allows users to implement the touch and `led15070` logic by writing appropriate `mai2io` scripts.

#### **Touch Hook**:
- The touch hook simulates touch points based on keyboard combinations. For example, to trigger the A1 touch point, the user must press the A and 1 keys on the keyboard. Input for the 1p requires Caps Lock to be off, while 2p requires Caps Lock to be on.
- The hook allows for independent control of whether device simulation is enabled for "1p" and "2p" and whether keyboard input mapping is enabled.
- **Note**: The current touch hook is not yet functional as it requires modifications to the `capnhook` for proper completion of the `sinmai` hook.

#### **LED15070 Hook**:
- This hook implements basic device simulation. Peripherals requiring lighting data should complete the logic as needed.
- **Note**: The LED data refresh can flood the console logs, so I’ve added a `DEBUG` flag to control whether the debug logging is enabled or not.

#### **Other Changes**:
- In certain versions of `sinmai`, key inputs for 1p and 2p can be directly read from the keyboard without requiring simulation via the `amdaemon io4` hook. I’ve added a switch to control this behavior to prevent redundant input.
- **Benefit**: This ensures that key input is only read when `sinmai` is in the foreground.

If you'd like to learn more about the touch and `led15070` features, my research findings are available here:
[Mai2Touch](https://github.com/Sucareto/Mai2Touch)

Co-authored-by: Sucareto <28331534+Sucareto@users.noreply.github.com>
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/55
Co-authored-by: Mahuyo <mahuyo@noreply.gitea.tendokyu.moe>
Co-committed-by: Mahuyo <mahuyo@noreply.gitea.tendokyu.moe>
2025-02-16 12:49:58 +00:00
..
amvideo.c Add carolhook for Wonderland Wars 2023-02-13 03:08:40 -05:00
amvideo.h platform: Shift config structs around 2019-11-05 19:31:11 -05:00
clock.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
clock.h unity: timezone spoofing fixed, close #27 2024-08-06 11:14:27 +02:00
config.c Revert: Add automatically apply OpenSSL patch for Intel Gen 10+ CPUs 2024-12-27 14:12:58 +00:00
config.h Revert: Add automatically apply OpenSSL patch for Intel Gen 10+ CPUs 2024-12-27 14:12:58 +00:00
dns.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
dns.h dns: add port overriding support 2024-12-12 02:28:02 +08:00
epay.c Mai2: Add touch and led15070 hook (#55) 2025-02-16 12:49:58 +00:00
epay.h remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
hwmon.c replace hardcoded enums with #define CTL_CODEs 2024-12-23 21:48:30 +01:00
hwmon.h platform: Shift config structs around 2019-11-05 19:31:11 -05:00
hwreset.c replace hardcoded enums with #define CTL_CODEs 2024-12-23 21:48:30 +01:00
hwreset.h platform: Add basic hwreset implementation for ALLS 2021-08-12 23:14:31 +00:00
meson.build Revert: Add automatically apply OpenSSL patch for Intel Gen 10+ CPUs 2024-12-27 14:12:58 +00:00
misc.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
misc.h platform: Shift config structs around 2019-11-05 19:31:11 -05:00
netenv.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
netenv.h platform: Shift config structs around 2019-11-05 19:31:11 -05:00
nusec.c nusec: add full IOCTL list without handlers 2025-01-28 01:41:03 -05:00
nusec.h platform: make billing type configurable 2023-02-13 03:08:40 -05:00
pcbid.c platform/pcbid.c: Return HRESULT for consistency 2019-11-03 19:54:31 -05:00
pcbid.h platform: Shift config structs around 2019-11-05 19:31:11 -05:00
platform.c Revert: Add automatically apply OpenSSL patch for Intel Gen 10+ CPUs 2024-12-27 14:12:58 +00:00
platform.h Revert: Add automatically apply OpenSSL patch for Intel Gen 10+ CPUs 2024-12-27 14:12:58 +00:00
system.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
system.h renamed [gpio] dipsw settings to [system] 2024-08-20 10:48:08 +02:00
vfs.c Fix build with Microsoft Visual C++, Fix gfxhook and felica issue (#48) 2024-11-11 16:28:24 +00:00
vfs.h Fixed option loading, thanks @Hay1tsme, close #16 2024-06-09 00:50:54 +02:00