23 Commits
Author SHA1 Message Date
Hay1tsme a9ca61f285 touch: add hook for RegisterClassExW 2026-08-24 01:34:24 -04:00
kyoubate-haruka 0e76dd832a diva: input rewrite, dinput/xinput, button alternation, auto-slide, wintouch, printer (#129)
* Rewrote the input handler

Added support for dinput and xinput, full keyboard slider cell binding (#127), hold-takeovers, button alternation and auto-sliding (PS4 behaviour). See segatools.ini for a detailed description about everything.

* Split touch handling into backends and added Wintouch touch emulation

Now you can use actual touchscreens as well as mouse emulation was not the greatest when trying to use an actual touchscreen.

* Fixed input issues

gamebtns was always uninitialized, so good luck trying to do anything. How did nobody ever complain about this? lol

* Fixed resolution issues caused by chaining both gfx hooks

The diva-specific hook is the only one we need. Stacking both has strange effects.

* Added support for the MITSUBISHI CP9550DS printer

Q: Why?
A: /shrug

![https://puu.sh/KQlev/ce2ef0efed.bmp](https://puu.sh/KQlev/ce2ef0efed.bmp)

I am not particularly good at this game (or the pass requirements are insane, 23+12 misses out of ~550 is a fail!?), so if someone could test how this feels as opposed to the PS4 version, that would help a lot!

![https://puu.sh/KQldU/fa4c848ff9.png](https://puu.sh/KQldU/fa4c848ff9.png)

Also something that happens but that I can't reliably reproduce is that my aime card reader randomly becomes NG after a dozen game starts until I delete eeprom.bin.
If that is the case, the only packet sent is SEND_HEX_DATA.

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/129
Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
2026-08-10 15:41:40 +00:00
Dniel97 c92119b4c5 misc: fix path compiling, fix apm3 server detection 2026-07-23 21:25:49 +02:00
kyoubate-haruka 7593176cad fix msvc 2026-07-20 09:43:52 +02:00
kyoubate-haruka d29a3926ab apm: Fix distribution server handling, abaas log symlinks, add extra buttons for dinput (#123)
Requires https://gitea.tendokyu.moe/TeamTofuShop/capnhook/pulls/8

This adds the following:

1. Fixes `am::abaas::FileSearchSuite::isAvailableAbsolutePath: Line259  ERROR: folder is unavailable (Y:\SDEM\log\\SDFU)` by hooking `DeviceIoControl` with `FSCTL_SET_REPARSE_POINT`.

Sega decided to use the most bizzare way possible of creating symbolic links. These are created in the AbaaS log directory inside SDEM and point to the appdata directories for the sub-games.

Magic numbers have been taken from amdaemon decompilation. That whole API is very sparsely documented on the Microsoft side.

2. Fixes distribution server settings not applying.

Unlike most other games, the daemon config files do not have dipswitch filters in them. Instead the distribution setting is determined by running `hwvalue.exe` twice and checking it's exit code. This has been added to `launch.bat` and requires the linked addition for inject.

3. Implemented `get_opbtns` and added extra buttons for dinput.

* `get_opbtns` existed but was never implemented. Added the ability to bind dinput buttons for test/service.
* DirectInput is weird. The controller I'm using is sending directional keys as buttons rather than a D-Pad, so I was unable to bind it. These extra directional buttons can be bound in addition to the bindings that exist for a D-Pad.

4. Fixes audio in Rolling Gunner by setting the CWD to the root of the C:\ drive before starting a game.

lol. lmao even.

5. Add a `DefineDosDevice` for Y:\ to fix Blazblue crashing

They hardcoded the damn path to appdata instead of retrieving it from the apm.dll...

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/123
Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
2026-07-19 08:25:54 +00:00
グローランプ 89bd77e306 IO: Resolve IO DLL paths from environment variables (#119)
## Summary

Adds a unified mechanism for locating third-party IO DLLs through environment
variables, on top of the existing per-game `[xxxio] path=` INI setting.

## Changes

For each IO DLL, the path is resolved in this order:

1. The section-specific INI value, e.g. `[mai2io] path=`.
2. The section-specific environment variable, e.g. `SEGATOOLS_MAI2IO_PATH`.
3. `SEGATOOLS_IO_ROOT` joined with the default IO DLL filename, e.g.
   `%SEGATOOLS_IO_ROOT%\mai2io.dll`.
4. Empty path, which keeps the built-in IO implementation (unchanged default).

INI and environment-variable paths are run through Windows environment-variable
expansion, so values such as `%SEGATOOLS_IO_ROOT%\mai2io.dll` are valid in the
INI directly.

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/119
Co-authored-by: グローランプ <130208311+Gl0w1amp@users.noreply.github.com>
Co-committed-by: グローランプ <130208311+Gl0w1amp@users.noreply.github.com>
2026-07-08 20:23:08 +00:00
kyoubate-haruka 700efa8d85 spike: add ability to change to hex rvas 2026-06-11 10:25:42 +02:00
Hay1tsme 5d330238d8 Merge pull request 'Get amGfetcher working ("DownloadOrder")' (#112) from Haruka/segatools:gfetcher into develop
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/112
2026-06-09 04:11:21 +00:00
Hay1tsme db85fe083e Merge pull request 'sekito: save infrared pattern to file' (#111) from Haruka/segatools:sgt_print_infrared into develop
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/111
2026-05-31 00:13:08 +00:00
kyoubate-haruka de82acf782 reg: allow opening keys multiple times 2026-05-29 12:06:27 +02:00
kyoubate-haruka 6b1f494559 path: hook GetDiskFreeSpaceW for amGfetcher 2026-05-25 11:32:35 +02:00
kyoubate-haruka 0bb318f58c sekito: save infrared pattern to file 2026-05-25 11:30:35 +02:00
kyoubate-haruka abe1a9d77e sekito: fix second page overwriting first page 2026-05-06 11:28:15 +02:00
kyoubate-harukaandDniel97 9c67f53902 Add support for Sangokushi Taisen and Eiketsu Taisen (#85)
This adds full support for the Taisen series of games, namely Sangokushi Taisen and Eiketsu Taisen.

Games added:
* Sangokushi Taisen (SDDD)
* Eiketsu Taisen (SDGY)

Devices added:
* CHC-320 printer (SGT)
* "Printer camera" (SGT, unsure what this actually really is)
* CX-7000 printer (EKT)
* Y3CR BD SIE F720MM (SGT, EKT)

Notable changes in the codebase:

* Renamed everything printer specific to seperate between CHC and CX.
* Many new function and registry hooks were added across the board.
* An error is now logged when segatools.ini (or the path in `SEGATOOLS_CONFIG_PATH`) cannot be found.
* Netenv now redirects UDP broadcasts targeted at the subnet that is specified in the keychip configuration. The terminal announces it's presence by broadcasting UDP to 192.168.189.255, this will be redirected to 255.255.255.255.
* Vfs now seperates between absolute and relative paths in `vfs_fixup_path` via an environment variable called `SEGATOOLS_VFS_RELATIVE_PATH`. This is needed because amcapture accesses files as workingdirectory-relative.
* The Y3 board emulation has support for external Y3 I/O dlls. The default implementation (y3ws) that comes with this is a websocket implementation. The docs are available under `doc\y3ws.txt` and a sample card player .html file is under `dist\ekt\card_player.html`. I already know one person that is hosting a massively improved version of it.
  * For websockets, my own websocket implementation is used as a subproject (MIT license): https://github.com/akechi-haruka/cwinwebsocket
  * For JSON, cJSON was embedded (MIT license): https://github.com/DaveGamble/cJSON
  * y3ws reads all printed cards from `DEVICE\print` by default including card back sides. It's up to the client to merge or skip them.

Remarks:
* SGT takes ~8 minutes to load. This seems to be intentional.
* SGT uses some weird TCP network implementation like IDZ. I have not bothered reversing that yet and I have confirmed everything working from the test menu.
* EKT will throw a network error if no terminal is found. You must run the terminal on another computer to be able to launch the satellite.
* EKT has a very bizzare speed glitch that will speed up the ingame unit movement by several 1000% and also slows down cutscene animations by 90%. When this effect is active, you also take a ton more damage than usual. I do not know what causes this and it seems PC specific.
* EKT is very stutter sensitive and will throw error 6401 (I/O timeout) at random when trying to alt+tab or have other things running.
* EKT features a livestream system called Enbu (or "Dojo Upload"). While you are in a match, regardless of vs. AI or another player, the game will record your screen and live-stream it to the Enbu server as defined by the game server's startup response. The application responsible for that, "AM Capture" will not limit it's recording to the game window, but also anything that overlays the game window (notifications, popups, alt+tabbed windows, web browsers, etc). Since this is live-streamed, killing the process will have no effect afterwards, as the frames showing unwanted things will already have been transmitted. To make people aware of this, a one-time dialog message will pop up when starting EKT. The flag for that is stored in the DEVICE folder.

Closes #25.

Co-authored-by: Dniel97 <Dniel97@noreply.gitea.tendokyu.moe>
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/85
Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
2026-02-26 19:31:45 +00:00
Dniel97 b9e714dd1d touch: always show cursor if enabled 2026-02-11 23:39:09 +01:00
Dniel97 a2bfd840d6 idac: improve DNS hooking 2026-01-09 15:34:30 +01:00
octocat 7c10698ca9 Fix compiler errors for 64bit gcc (#87)
Why would anyone detect ISA at runtime?

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/87
Co-authored-by: octocat <git.rascal570@passinbox.com>
Co-committed-by: octocat <git.rascal570@passinbox.com>
2025-12-24 23:08:08 +00:00
Dniel97 bad219be4c misc: fix path hooks
- Added missing MoveFileExW hook
- Fixed path memory leaks
- Added all CopyFile hooks
2025-12-24 23:21:30 +01:00
Dniel97 0be4b47448 misc: add GetDriveType hook 2025-12-24 14:26:58 +01:00
goldfisher11andgoldfisher11 146550e68c spike_develop (#80)
Co-authored-by: goldfisher11 <goldfish1984@163.com>
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/80
Reviewed-by: Dniel97 <dniel97@noreply.gitea.tendokyu.moe>
Co-authored-by: goldfisher11 <goldfisher11@noreply.gitea.tendokyu.moe>
Co-committed-by: goldfisher11 <goldfisher11@noreply.gitea.tendokyu.moe>
2025-11-02 08:47:18 +00:00
kyoubate-haruka ded1375e88 Vfs: Hook .ini reader functions to fix DLI reading (#75)
Pretty simple, DLI reading (more commonly known as DownloadOrder) calls GetPrivateProfile* with a file path with E:\tmpDli*.ini. This fails right now.

I have only hooked the functions that appear in the latest amdaemon.

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/75
Reviewed-by: Dniel97 <dniel97@noreply.gitea.tendokyu.moe>
Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
2025-07-24 09:16:22 +00:00
kyoubate-haruka e2e4b37e3f APMv3: add hook (#73)
This adds support for APMv3 I/O, menus and the launcher.

* Added a apm3hook dll and I/O based on the usual layout.
* Added C:\Mount\Apm to vfs.
* Added the relevant .dlls to unityhook.
* Added a hook for apmmount.dll that uses `CreateDosDevice` to mount decrypted data to the locations the launcher and games expect files to be. This will conflict with anything that is already at W:\ and X:\, but I do not have better solutions for this.
* `launch.bat` is a bit more involved as it simulates the launcher loop. It can be broken by alt+f4ing or closing the launcher with "X".
* An extra export was added, so rundll32 can be used to get rid of the dosdevices after the launcher was killed.
* Since all the games do everything via `X:\lib\apm.dll`, no game hooks were needed in testing, therefore, `game.bat` files can be used as is.
* Path hooks are applied correctly, so you can go correctly between games, launcher, sub system test mode and game test modes.

A setup guide (some stuff specific to my server) can be found here:
https://gmg.hopto.org:82/gmg/wiki/index.php/All.Net_P-ras_Multi_Menu

Tested with the 2 APM sample apps, Blazblue, Puyo, Guilty Gear and some weird unity puzzle game whose name I forgot.

![Apmv3System_yLRityJVpm.png](/attachments/3d645e71-81e6-42e6-acd4-63c537cda59e)
![puyoe_hJNhnJGFnd.png](/attachments/01664049-71fe-4c38-9c99-39649ab21e56)

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/73
Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
2025-07-20 09:43:56 +00:00
Dniel97 ae3dd666f4 refactor all common parts and games 2025-04-17 19:40:40 +02:00