mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-09-15 11:55:10 -05:00
Compare commits
129 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37384c15ec | ||
|
|
f0d62cc938 | ||
|
|
bf067de633 | ||
|
|
f3b07aeb0a | ||
|
|
a1a67697c4 | ||
|
|
ce5b1b2eac | ||
|
|
3f2aed65e4 | ||
|
|
22f3845609 | ||
|
|
de0d70d808 | ||
|
|
12c52bb0d8 | ||
|
|
279d4de4b3 | ||
|
|
2b52fbe211 | ||
|
|
78e7c05876 | ||
|
|
9a5418f6a3 | ||
|
|
2363498f73 | ||
|
|
edbbe5ae67 | ||
|
|
d799b69d12 | ||
|
|
91f83cd975 | ||
|
|
adeabbea19 | ||
|
|
41187091b0 | ||
|
|
5658658d3a | ||
|
|
79a74b2d2f | ||
|
|
51484b1d3d | ||
|
|
df8f3bc96a | ||
|
|
ec435e7a7b | ||
|
|
f8a01ed92f | ||
|
|
2b1dd866d0 | ||
|
|
7d129a3e63 | ||
|
|
29db89cebe | ||
|
|
f7e1c8b3f9 | ||
|
|
f667ae5601 | ||
|
|
4b061bdf8f | ||
|
|
13600db1d5 | ||
|
|
e4126500ef | ||
|
|
049f1b4564 | ||
|
|
687c000000 | ||
|
|
1b593a8e23 | ||
|
|
24178121f0 | ||
|
|
62ad4e0616 | ||
|
|
c348a41d22 | ||
|
|
ef377f40d8 | ||
|
|
0c88518a1f | ||
|
|
0bc87db8da | ||
|
|
53f8cb3bf3 | ||
|
|
41edfec702 | ||
|
|
c6c3bdb075 | ||
|
|
b3a89012ca | ||
|
|
f0bc87f1d6 | ||
|
|
7508c43119 | ||
|
|
34be731211 | ||
|
|
bac1ce62e5 | ||
|
|
58689bbc30 | ||
|
|
d5e186ffe2 | ||
|
|
34c95561c4 | ||
|
|
81d697d59a | ||
|
|
3bdda4d123 | ||
|
|
ea8842b58a | ||
|
|
e89889806b | ||
|
|
b3b2f8f433 | ||
|
|
1cdf330cbf | ||
|
|
89c3ada28f | ||
|
|
d9cb953b67 | ||
|
|
7ebb80d600 | ||
|
|
e737d60893 | ||
|
|
f39843b41f | ||
|
|
98d0debd05 | ||
|
|
950584f025 | ||
|
|
e4081c057f | ||
|
|
8c3030354a | ||
|
|
9777eddaa0 | ||
|
|
671723febd | ||
|
|
c1f6166e1b | ||
|
|
538650f7ac | ||
|
|
efd243fd9d | ||
|
|
383b301d3c | ||
|
|
a9d201691a | ||
|
|
ebb6f811b4 | ||
|
|
9e96cf074f | ||
|
|
e6766d4a3b | ||
|
|
843d78bc4b | ||
|
|
0792b29f3d | ||
|
|
e1d4810743 | ||
|
|
2110abc269 | ||
|
|
fc22f76988 | ||
|
|
3d4df4cd64 | ||
|
|
be5a773cb7 | ||
|
|
3ed6ac6290 | ||
|
|
e49149b03d | ||
|
|
af507e6dcb | ||
|
|
a9ebc30ea7 | ||
|
|
4f3135439d | ||
|
|
2d1c09d4e6 | ||
|
|
164d56b6eb | ||
|
|
1712f10f66 | ||
|
|
128496901e | ||
|
|
65a45740d2 | ||
|
|
8bd0f44e24 | ||
|
|
7733912ae2 | ||
|
|
55c9f5a521 | ||
|
|
917dc88826 | ||
|
|
475d438ec7 | ||
|
|
f23d3531a2 | ||
|
|
32c3428c59 | ||
|
|
ee034a1f08 | ||
|
|
54b321c7d9 | ||
|
|
de894ae5ce | ||
|
|
1d25abc10b | ||
|
|
beea9e7bb7 | ||
|
|
fbb69d4550 | ||
|
|
e0fe9bcf94 | ||
|
|
f9c0733af3 | ||
|
|
a016f27652 | ||
|
|
3a1005f1f8 | ||
|
|
f1700ca551 | ||
|
|
60b081b01c | ||
|
|
89989ae49c | ||
|
|
ff1b9ff9a2 | ||
|
|
4c0f60fc93 | ||
|
|
caba39843f | ||
|
|
f028bdeb20 | ||
|
|
bfbb7103ef | ||
|
|
95e073271f | ||
|
|
cdefc2b09e | ||
|
|
9246e7f9e0 | ||
|
|
bbb5157460 | ||
|
|
69ef963451 | ||
|
|
86517bd001 | ||
|
|
172c83a854 | ||
|
|
c7137659bc |
@@ -8,7 +8,8 @@
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
## Detailed Description
|
||||
<!--- Provide a detailed description of the issue. Include links to screenshots or videos if necessary -->
|
||||
<!--- Provide a detailed description of the issue. Include links to screenshots or videos if
|
||||
necessary -->
|
||||
|
||||
## Steps to reproduce
|
||||
<!--- Provide a detailed step by step description how to reproduce this issue -->
|
||||
@@ -29,16 +30,43 @@
|
||||
|
||||
### Log output
|
||||
See attachment.
|
||||
<!--- Provide log output as attachment. Make sure to censor sensitive data like PCBIDs or device names if necessary -->
|
||||
<!---
|
||||
Provide FULL log output, e.g. inject.log or launcher.log. Please do not guess which things
|
||||
are relevant or not. Without knowing, you might leave out things that are relevant for the developers. You have to enable log output explicitly if not done already.
|
||||
|
||||
For inject.exe and launcher.exe, add `-Y logfile.log` to the command line args to output to a file, e.g. `gamestart.bat -Y logfile.log`.
|
||||
|
||||
!!!!!!
|
||||
REMOVE ANY SENSITIVE DATA LIKE PCBIDS OR DEVICE NAMES BY REPLACING IT THEM WITH
|
||||
|
||||
[REDACTED]
|
||||
|
||||
BEFORE UPLOADING/POSTING ANY LOG DATA!!!
|
||||
|
||||
Use the search and replace feature of any kind of text editor.
|
||||
!!!!!!
|
||||
-->
|
||||
|
||||
### Configuration files
|
||||
See attachment.
|
||||
<!--- Provide any configuration files that you used, e.g. iidxhook-XX.conf. Make sure to censor sensitive data like
|
||||
PCBIDs -->
|
||||
<!--- Provide any configuration files that you used, e.g. iidxhook-XX.conf. This file is located in
|
||||
the same directory as launcher.exe or inject.exe.
|
||||
|
||||
!!!!!!
|
||||
REMOVE ANY SENSITIVE DATA LIKE PCBIDS OR DEVICE NAMES BY REPLACING IT THEM WITH
|
||||
|
||||
[REDACTED]
|
||||
|
||||
BEFORE UPLOADING/POSTING ANY LOG DATA!!!
|
||||
|
||||
Use the search and replace feature of any kind of text editor.
|
||||
!!!!!!
|
||||
-->
|
||||
|
||||
### Command line arguments
|
||||
<!--- Provide how you run the game from the command line, e.g. which gamestart.bat you used and any additional arguments
|
||||
that you provided to it. Also provide the contents of the gamestart.bat you used if you altered it. -->
|
||||
<!--- Provide how you run the game from the command line, e.g. which gamestart.bat you used and any
|
||||
additional arguments that you provided to it. Also provide the contents of the gamestart.bat you
|
||||
used if you altered it. -->
|
||||
|
||||
### APIs used
|
||||
* <!--- List all APIs you used as a bullet list, e.g. iidxio-keyboard, eamio-keyboard -->
|
||||
|
||||
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,4 +1,25 @@
|
||||
# Release history
|
||||
## 5.34
|
||||
* IIDX: Support IO and card reader feature switches to disable emulation in iidxhook4-7
|
||||
* Jubeat: jbio implementation for magicbox hardware
|
||||
* Misc: Various documentation improvements
|
||||
* IIDX: Turntable multiplier (can also be used as inverted) for iidxhook9
|
||||
* IIDX: iidxhook9, add force screen resolution option to fix sometimes wrong auto res detection by
|
||||
iidx27 causing inaccurate/wrong refresh rates on monitor check
|
||||
* IIDX: iidxio BIO2 implementation -> Use BIO2 hardware with any iidxhook or other software
|
||||
supporting BT5's iidxio interface
|
||||
* IIDX: BIO2 exit hook, exit the game pressing Start P1 + Start P2, Effect and VEFX
|
||||
* launcher: Allow overriding service URL from command line
|
||||
* IIDX: vigem-iidxio, tool to allow using iidxio (ezusb, ezusb2 or bio2) to emulate XBOX controllers
|
||||
to play other non arcade games that support xinput, e.g. Lunatic Rave (note: Infinitas does not
|
||||
work with this since it only supports direct input)
|
||||
|
||||
## 5.33
|
||||
* iidxhook9: Support for IIDX27
|
||||
* sdvxio-bio2: Driver for real sdvx5 cabinet IO hardware
|
||||
* vigem-sdvxio: Tool to allow using sdvxio (kfca or bio2) to emulate an xbox controller
|
||||
* Various bugfixes and refactoring for inject and launcher
|
||||
|
||||
## 5.32
|
||||
* Various bugfixes
|
||||
|
||||
|
||||
@@ -1,30 +1,83 @@
|
||||
# Contributing
|
||||
Please have a look at the issue board about what's currently going on. If you see an issue that is not assigned yet and
|
||||
that you can and want to work on, please leave a comment to reach out to one of our developers. You can also ask
|
||||
questions and discuss the issue.
|
||||
This document outlines different types of contributions and how YOU can help us to improve the
|
||||
project. Read it, as it provides guidelines that are there to help you and the maintainers.
|
||||
|
||||
# Bug reports
|
||||
Please check if the bug was already reported by searching the existing issues. If it does, feel free to leave a comment
|
||||
that you also have this issue. Add additional information, screenshots, log files etc. The more information and details
|
||||
we have, the easier it might get to solve the issue.
|
||||
## Reporting and discussions: Issues section on gitlab
|
||||
In order to avoid having to manage ongoing discussions and bug reports on different communication
|
||||
channels, e.g. forums, messangers or other closed groups, we ask everyone to treat the issue
|
||||
section on gitlab as the place to open their relevant discussions and bug reports regarding the
|
||||
project.
|
||||
|
||||
When creating new issues, use our template for reporting bugs. It tells you what kind of information we need.
|
||||
The maintainers of the project do not have the time nor motivation to micromanage on the various
|
||||
channels and enter all data here to have it collected. This is a simple task that *ANYONE* can do
|
||||
allowing the maintainers and developers to spend their time on the codebase.
|
||||
|
||||
# Pull requests: bugfixes, new features or other code contributions
|
||||
Pull requests are welcome! May it be a PR to an already known issue or a new feature that you consider as a valuable
|
||||
contribution, please open a PR. If you want to start working on a new feature that was proposed in an issue, yet, it
|
||||
is recommended to reach out to the developers about this, first, to discuss if this contribution is valuable to the
|
||||
project. Otherwise, you might waste your time on implementing something that won't make it into master.
|
||||
## Bug reports
|
||||
Follow these steps when reporting bugs to ensure you provide all information we *always* need and
|
||||
make your report valuable and actionable.
|
||||
|
||||
Please read our [development guidelines](doc/development.md) as they contain valuable information that your contribution
|
||||
meets our standards.
|
||||
1. On the bemanitools repository, go `Issues` on the left-hand sidebar.
|
||||
1. Use the search function to check if there is an already open issue regarding what you want to
|
||||
report
|
||||
1. If that applies, read the open issue to check what's already covered regarding the bug
|
||||
1. Provide additional information or things that are missing. Upload your log files,
|
||||
screenshots, videos etc. Be careful to remove sensitive information like PCBIDs
|
||||
1. Give a thumbs up to the issue to show you are interested/affected as well
|
||||
1. If no existing issue avilable, create a new one
|
||||
1. Come up with a descriptive title
|
||||
1. **USE OUR BUG REPORTING TEMPLATE**: Pick it by selecting `Bug` on the `Description` section
|
||||
1. Follow the sections and their instructions provided by the template and fill them in. All fields
|
||||
are mandatory to provide a comprehensive report if not stated otherwise
|
||||
1. When finished, submit the issue
|
||||
|
||||
Fork the upstream repository and start developing on your personal fork. Make sure to test your changes with games that
|
||||
are affected by them. Pay attention to the target platform/hardware you are testing on! This is valuable information
|
||||
that should be included in the PR.
|
||||
## Pull requests: bugfixes, new features or other code contributions
|
||||
Pull requests are welcome! May it be a merge request to an already known issue or a new feature that
|
||||
you consider as a valuable contribution, please open a MR.
|
||||
|
||||
Once you completed your implementation, open a pull request on the upstream repository to propose your changes. We will review your contribution and get back to you about any changes or when we merge them to our upstream repository. Your changes, once approved, will be included in the next release.
|
||||
**!!! Maintaining documentation by adding new or improving existing documentation is as important as
|
||||
code !!!**
|
||||
|
||||
# Roadmap
|
||||
No concrete roadmap or timeline exists. We want to continue adding support for new games as well as old games (some of
|
||||
the old games supported by BT4 are not supported, yet).
|
||||
If you want to start working on a new feature that was proposed in an issue, yet, it is recommended
|
||||
to reach out to the active developers about this, first, to discuss if this contribution is valuable
|
||||
to the project. Otherwise, you might waste your time on implementing something that won't make it
|
||||
into master.
|
||||
|
||||
Please read our [development guidelines](doc/development.md) as they contain valuable information
|
||||
that your contribution meets our standards. This is not meant to annoy people but ensures
|
||||
consistency that the project stays maintainable for everyone.
|
||||
|
||||
Steps for contributing to the repository using a merge request:
|
||||
1. If you are new to git, take a bit of time to learn the basics which are very simple, e.g. Google
|
||||
for "git tutorial for non-programmers"
|
||||
1. Fork the upstream repository (Fork button on the top right on the main page of the repository)
|
||||
1. You can start editing files like documentation easily inside gitlab which might be the prefered
|
||||
option for many non-coders
|
||||
1. Clone your fork to your local machine and start working on stuff
|
||||
1. Ensure you push your changes to your fork on gitlab
|
||||
1. When done, go to the `Merge Requests` section on the left sidebar of the upstream repository
|
||||
1. Hit the `New merge request` button
|
||||
1. Select the `master` branch as the source branch
|
||||
1. Select whatever branch you worked, likely `master` if you didn't change that, as the target
|
||||
branch
|
||||
1. Hit `Compare branches and continue`
|
||||
1. Provide a descriptive title of what your change is about
|
||||
1. **USE OUR MR TEMPLATES**
|
||||
1. If you submit a bugfix, use the `Bugfix` tempalte and fill in the sections
|
||||
1. If you submit a new feature, use the `Feature` template and fill in the sections
|
||||
1. If you submit some minor fixes or documentation improvements, there is no template for that.
|
||||
Please provide a expressive description what you did and *why* you did that
|
||||
1. If any of your changes are tied to one or multiple issues, link them in the description
|
||||
1. When done, hit `Submit merge request`
|
||||
|
||||
The maintainers will take a look at your submission and provide their feedback. The intention of
|
||||
this process is to ensure the contribution meets the quality standards. Please also see this is
|
||||
a learning opportunity, especially with your first contribution, if a lot of comments and change
|
||||
requests are being made. The maintainers are open to discuss their suggestions/feedback if
|
||||
reasonable feedback is given back to them.
|
||||
|
||||
Once all discussion is resolved and the involved maintainers approved your submission, it will be
|
||||
merged into master and also included in the next release.
|
||||
|
||||
## Roadmap
|
||||
No concrete roadmap or timeline exists. We want to continue adding support for new games as well as
|
||||
old games (some of the old games supported by BT4 are not supported, yet).
|
||||
21
GNUmakefile
21
GNUmakefile
@@ -26,7 +26,7 @@ toolchain_64 := x86_64-w64-mingw32-
|
||||
gitrev := $(shell git rev-parse HEAD)
|
||||
cppflags := -I src -I src/main -I src/test -DGITREV=$(gitrev)
|
||||
cflags := -O2 -pipe -ffunction-sections -fdata-sections \
|
||||
-Wall -std=c99
|
||||
-Wall -std=c99 -DPSAPI_VERSION=1
|
||||
cflags_release := -Werror
|
||||
ldflags := -Wl,--gc-sections -static-libgcc
|
||||
|
||||
@@ -58,27 +58,26 @@ print-building \
|
||||
version
|
||||
|
||||
print-building:
|
||||
@echo "Build gitrev "$(gitrev)"..."
|
||||
$(V)echo "Build gitrev "$(gitrev)"..."
|
||||
|
||||
print-release:
|
||||
@echo "Starting release build..."
|
||||
$(V)echo "Starting release build..."
|
||||
|
||||
clean:
|
||||
@echo "Cleaning up..."
|
||||
$(V)echo "Cleaning up..."
|
||||
$(V)rm -rf $(BUILDDIR)
|
||||
|
||||
code-format:
|
||||
@echo "Applying clang-format..."
|
||||
# -style=file enables reading .clang-format
|
||||
@find src/ -iname *.h -o -iname *.c | xargs clang-format -i -style=file
|
||||
$(V)echo "Applying clang-format..."
|
||||
$(V)find src/ -name '*.c' -o -name '*.h' | xargs clang-format -i -style=file
|
||||
|
||||
run-tests:
|
||||
@echo "Running tests..."
|
||||
@./run-tests-wine.sh
|
||||
$(V)echo "Running tests..."
|
||||
$(V)./run-tests-wine.sh
|
||||
|
||||
# Generate a version file to identify the build
|
||||
version:
|
||||
@echo "$(gitrev)" > version
|
||||
$(V)echo "$(gitrev)" > version
|
||||
|
||||
build-docker:
|
||||
$(V)docker rm -f $(docker_container_name) 2> /dev/null || true
|
||||
@@ -257,7 +256,7 @@ impdef_$1_$2_$3 ?= src/imports/import_$1_$2_$3.def
|
||||
|
||||
$$(bindir_$1_$2)/lib$3.a: $$(impdef_$1_$2_$3) | $$(bindir_$1_$2)
|
||||
$(V)echo ... $$@ [dlltool]
|
||||
$(V)$$(toolchain_$1)dlltool -l $$@ -d $$<
|
||||
$(V)$$(toolchain_$1)dlltool --kill-at -l $$@ -d $$<
|
||||
|
||||
endef
|
||||
|
||||
|
||||
131
Module.mk
131
Module.mk
@@ -54,9 +54,11 @@
|
||||
#
|
||||
# 17: Patch 0: beatmania IIDX 25 CANNON BALLERS
|
||||
# beatmania IIDX 26 Rootage
|
||||
# beatmania IIDX 27 HEROIC VERSE
|
||||
#
|
||||
# Patch 3: SOUND VOLTEX VIVID WAVE
|
||||
#
|
||||
#
|
||||
|
||||
cflags += \
|
||||
-DWIN32_LEAN_AND_MEAN \
|
||||
@@ -78,6 +80,8 @@ include src/main/aciodrv/Module.mk
|
||||
include src/main/acioemu/Module.mk
|
||||
include src/main/aciotest/Module.mk
|
||||
include src/main/asio/Module.mk
|
||||
include src/main/bio2drv/Module.mk
|
||||
include src/main/bio2emu-iidx/Module.mk
|
||||
include src/main/bio2emu/Module.mk
|
||||
include src/main/bsthook/Module.mk
|
||||
include src/main/bstio/Module.mk
|
||||
@@ -86,29 +90,30 @@ include src/main/cconfig/Module.mk
|
||||
include src/main/config/Module.mk
|
||||
include src/main/d3d9exhook/Module.mk
|
||||
include src/main/ddrhook/Module.mk
|
||||
include src/main/ddrio/Module.mk
|
||||
include src/main/ddrio-smx/Module.mk
|
||||
include src/main/ddrio-mm/Module.mk
|
||||
include src/main/ddrio-smx/Module.mk
|
||||
include src/main/ddrio/Module.mk
|
||||
include src/main/dinput/Module.mk
|
||||
include src/main/eamio/Module.mk
|
||||
include src/main/eamio-icca/Module.mk
|
||||
include src/main/eamio/Module.mk
|
||||
include src/main/eamiotest/Module.mk
|
||||
include src/main/ezusb/Module.mk
|
||||
include src/main/ezusb-emu/Module.mk
|
||||
include src/main/ezusb-iidx/Module.mk
|
||||
include src/main/ezusb-iidx-emu/Module.mk
|
||||
include src/main/ezusb-iidx-fpga-flash/Module.mk
|
||||
include src/main/ezusb-iidx-sram-flash/Module.mk
|
||||
include src/main/ezusb-iidx/Module.mk
|
||||
include src/main/ezusb-tool/Module.mk
|
||||
include src/main/ezusb2/Module.mk
|
||||
include src/main/ezusb/Module.mk
|
||||
include src/main/ezusb2-dbg-hook/Module.mk
|
||||
include src/main/ezusb2-emu/Module.mk
|
||||
include src/main/ezusb2-iidx/Module.mk
|
||||
include src/main/ezusb2-iidx-emu/Module.mk
|
||||
include src/main/ezusb2-iidx/Module.mk
|
||||
include src/main/ezusb2-tool/Module.mk
|
||||
include src/main/ezusb-iidx-emu/Module.mk
|
||||
include src/main/ezusb2/Module.mk
|
||||
include src/main/geninput/Module.mk
|
||||
include src/main/hook/Module.mk
|
||||
include src/main/hooklib/Module.mk
|
||||
include src/main/iidx-bio2-exit-hook/Module.mk
|
||||
include src/main/iidx-ezusb-exit-hook/Module.mk
|
||||
include src/main/iidx-ezusb2-exit-hook/Module.mk
|
||||
include src/main/iidx-irbeat-patch/Module.mk
|
||||
@@ -121,14 +126,18 @@ include src/main/iidxhook5/Module.mk
|
||||
include src/main/iidxhook6/Module.mk
|
||||
include src/main/iidxhook7/Module.mk
|
||||
include src/main/iidxhook8/Module.mk
|
||||
include src/main/iidxio/Module.mk
|
||||
include src/main/iidxhook9/Module.mk
|
||||
include src/main/iidxio-bio2/Module.mk
|
||||
include src/main/iidxio-ezusb/Module.mk
|
||||
include src/main/iidxio-ezusb2/Module.mk
|
||||
include src/main/iidxio/Module.mk
|
||||
include src/main/iidxiotest/Module.mk
|
||||
include src/main/inject/Module.mk
|
||||
include src/main/jbio/Module.mk
|
||||
include src/main/jbhook/Module.mk
|
||||
include src/main/jbhook1/Module.mk
|
||||
include src/main/jbio-magicbox/Module.mk
|
||||
include src/main/jbio/Module.mk
|
||||
include src/main/jbiotest/Module.mk
|
||||
include src/main/launcher/Module.mk
|
||||
include src/main/mempatch-hook/Module.mk
|
||||
include src/main/mm/Module.mk
|
||||
@@ -137,22 +146,26 @@ include src/main/p3ioemu/Module.mk
|
||||
include src/main/p4ioemu/Module.mk
|
||||
include src/main/pcbidgen/Module.mk
|
||||
include src/main/sdvxhook/Module.mk
|
||||
include src/main/sdvxhook2/Module.mk
|
||||
include src/main/sdvxhook2-cn/Module.mk
|
||||
include src/main/sdvxio/Module.mk
|
||||
include src/main/sdvxhook2/Module.mk
|
||||
include src/main/sdvxio-bio2/Module.mk
|
||||
include src/main/sdvxio-kfca/Module.mk
|
||||
include src/main/sdvxio/Module.mk
|
||||
include src/main/security/Module.mk
|
||||
include src/main/unicorntail/Module.mk
|
||||
include src/main/util/Module.mk
|
||||
include src/main/vefxio/Module.mk
|
||||
include src/main/vigem-iidxio/Module.mk
|
||||
include src/main/vigem-sdvxio/Module.mk
|
||||
include src/main/vigemstub/Module.mk
|
||||
|
||||
include src/test/cconfig/Module.mk
|
||||
include src/test/d3d9hook/Module.mk
|
||||
include src/test/iidxhook-util/Module.mk
|
||||
include src/test/iidxhook8/Module.mk
|
||||
include src/test/security/Module.mk
|
||||
include src/test/test/Module.mk
|
||||
include src/test/util/Module.mk
|
||||
include src/test/iidxhook8/Module.mk
|
||||
|
||||
#
|
||||
# Distribution build rules
|
||||
@@ -169,8 +182,10 @@ $(zipdir)/tools.zip: \
|
||||
build/bin/indep-32/ezusb-iidx-fpga-flash.exe \
|
||||
build/bin/indep-32/ezusb-iidx-sram-flash.exe \
|
||||
build/bin/indep-32/iidxiotest.exe \
|
||||
build/bin/indep-32/iidx-bio2-exit-hook.dll \
|
||||
build/bin/indep-32/iidx-ezusb-exit-hook.dll \
|
||||
build/bin/indep-32/iidx-ezusb2-exit-hook.dll \
|
||||
build/bin/indep-32/jbiotest.exe \
|
||||
build/bin/indep-32/pcbidgen.exe \
|
||||
dist/iidx/ezusb-boot.bat \
|
||||
dist/iidx/ezusb2-boot.bat \
|
||||
@@ -186,8 +201,11 @@ $(zipdir)/tools-x64.zip: \
|
||||
build/bin/indep-64/aciotest.exe \
|
||||
build/bin/indep-64/eamiotest.exe \
|
||||
build/bin/indep-64/iidxiotest.exe \
|
||||
build/bin/indep-64/iidx-bio2-exit-hook.dll \
|
||||
build/bin/indep-64/iidx-ezusb-exit-hook.dll \
|
||||
build/bin/indep-64/iidx-ezusb2-exit-hook.dll \
|
||||
build/bin/indep-64/jbiotest.exe \
|
||||
build/bin/indep-64/mempatch-hook.dll \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
@@ -196,11 +214,8 @@ $(zipdir)/iidx-09-to-12.zip: \
|
||||
build/bin/indep-32/iidxhook1.dll \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
build/bin/indep-32/inject.exe \
|
||||
dist/iidx/config.bat \
|
||||
@@ -224,11 +239,8 @@ $(zipdir)/iidx-13.zip: \
|
||||
build/bin/avs2_0-32/iidxhook2.dll \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
build/bin/indep-32/inject.exe \
|
||||
dist/iidx/config.bat \
|
||||
@@ -243,11 +255,8 @@ $(zipdir)/iidx-14-to-17.zip: \
|
||||
build/bin/avs2_0-32/iidxhook3.dll \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
build/bin/indep-32/inject.exe \
|
||||
dist/iidx/config.bat \
|
||||
@@ -269,11 +278,8 @@ $(zipdir)/iidx-18.zip: \
|
||||
build/bin/avs2_1101-32/launcher.exe \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
dist/iidx/config.bat \
|
||||
dist/iidx/gamestart-18.bat \
|
||||
@@ -288,11 +294,8 @@ $(zipdir)/iidx-19.zip: \
|
||||
build/bin/avs2_1304-32/launcher.exe \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
dist/iidx/config.bat \
|
||||
dist/iidx/gamestart-19.bat \
|
||||
@@ -307,11 +310,8 @@ $(zipdir)/iidx-20.zip: \
|
||||
build/bin/avs2_1508-32/launcher.exe \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
dist/iidx/config.bat \
|
||||
dist/iidx/gamestart-20.bat \
|
||||
@@ -326,11 +326,8 @@ $(zipdir)/iidx-21-to-24.zip: \
|
||||
build/bin/avs2_1601-32/launcher.exe \
|
||||
build/bin/indep-32/config.exe \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/iidxio.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
build/bin/indep-32/vefxio.dll \
|
||||
dist/iidx/config.bat \
|
||||
dist/iidx/gamestart-21.bat \
|
||||
@@ -351,11 +348,8 @@ $(zipdir)/iidx-25-to-26.zip: \
|
||||
build/bin/avs2_1700-64/launcher.exe \
|
||||
build/bin/indep-64/config.exe \
|
||||
build/bin/indep-64/eamio.dll \
|
||||
build/bin/indep-64/eamio-icca.dll \
|
||||
build/bin/indep-64/geninput.dll \
|
||||
build/bin/indep-64/iidxio.dll \
|
||||
build/bin/indep-64/iidxio-ezusb.dll \
|
||||
build/bin/indep-64/iidxio-ezusb2.dll \
|
||||
build/bin/indep-64/vefxio.dll \
|
||||
dist/iidx/config.bat \
|
||||
dist/iidx/gamestart-25.bat \
|
||||
@@ -367,6 +361,46 @@ $(zipdir)/iidx-25-to-26.zip: \
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/iidx-27.zip: \
|
||||
build/bin/avs2_1700-64/iidxhook9.dll \
|
||||
build/bin/avs2_1700-64/launcher.exe \
|
||||
build/bin/indep-64/config.exe \
|
||||
build/bin/indep-64/eamio.dll \
|
||||
build/bin/indep-64/geninput.dll \
|
||||
build/bin/indep-64/iidxio.dll \
|
||||
build/bin/indep-64/vefxio.dll \
|
||||
dist/iidx/config.bat \
|
||||
dist/iidx/gamestart-27.bat \
|
||||
dist/iidx/iidxhook-27.conf \
|
||||
dist/iidx/vefx.txt \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/iidx-hwio-x86.zip: \
|
||||
build/bin/indep-32/eamio-icca.dll \
|
||||
build/bin/indep-32/iidxio-bio2.dll \
|
||||
build/bin/indep-32/iidxio-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
dist/iidx/iidxio-bio2.conf \
|
||||
build/bin/indep-32/vigem-iidxio.exe \
|
||||
dist/iidx/vigem-iidxio.conf \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/iidx-hwio-x64.zip: \
|
||||
build/bin/indep-64/eamio-icca.dll \
|
||||
build/bin/indep-64/iidxio-bio2.dll \
|
||||
build/bin/indep-64/iidxio-ezusb.dll \
|
||||
build/bin/indep-64/iidxio-ezusb2.dll \
|
||||
dist/iidx/iidxio-bio2.conf \
|
||||
build/bin/indep-64/vigem-iidxio.exe \
|
||||
dist/iidx/vigem-iidxio.conf \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/jb-01.zip: \
|
||||
build/bin/avs2_803-32/jbhook1.dll \
|
||||
build/bin/indep-32/inject.exe \
|
||||
@@ -414,7 +448,6 @@ $(zipdir)/sdvx-01-to-04.zip: \
|
||||
build/bin/indep-32/eamio.dll \
|
||||
build/bin/indep-32/geninput.dll \
|
||||
build/bin/indep-32/sdvxio.dll \
|
||||
build/bin/indep-32/sdvxio-kfca.dll \
|
||||
dist/sdvx/config.bat \
|
||||
dist/sdvx/gamestart.bat \
|
||||
| $(zipdir)/
|
||||
@@ -428,7 +461,6 @@ $(zipdir)/sdvx-05.zip: \
|
||||
build/bin/indep-64/eamio.dll \
|
||||
build/bin/indep-64/geninput.dll \
|
||||
build/bin/indep-64/sdvxio.dll \
|
||||
build/bin/indep-64/sdvxio-kfca.dll \
|
||||
dist/sdvx5/config.bat \
|
||||
dist/sdvx5/gamestart.bat \
|
||||
dist/sdvx5/sdvxhook2.conf \
|
||||
@@ -450,6 +482,22 @@ $(zipdir)/sdvx-05-cn.zip: \
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/sdvx-hwio-x86.zip: \
|
||||
build/bin/indep-32/sdvxio-kfca.dll \
|
||||
build/bin/indep-32/sdvxio-bio2.dll \
|
||||
build/bin/indep-32/vigem-sdvxio.exe \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/sdvx-hwio-x64.zip: \
|
||||
build/bin/indep-64/sdvxio-kfca.dll \
|
||||
build/bin/indep-64/sdvxio-bio2.dll \
|
||||
build/bin/indep-64/vigem-sdvxio.exe \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/ddr-12-to-16.zip: \
|
||||
build/bin/avs2_1508-32/launcher.exe \
|
||||
build/bin/avs2_1508-32/ddrhook.dll \
|
||||
@@ -548,12 +596,17 @@ $(BUILDDIR)/bemanitools.zip: \
|
||||
$(zipdir)/iidx-20.zip \
|
||||
$(zipdir)/iidx-21-to-24.zip \
|
||||
$(zipdir)/iidx-25-to-26.zip \
|
||||
$(zipdir)/iidx-27.zip \
|
||||
$(zipdir)/iidx-hwio-x86.zip \
|
||||
$(zipdir)/iidx-hwio-x64.zip \
|
||||
$(zipdir)/jb-01.zip \
|
||||
$(zipdir)/jb-05-to-07.zip \
|
||||
$(zipdir)/jb-08.zip \
|
||||
$(zipdir)/sdvx-01-to-04.zip \
|
||||
$(zipdir)/sdvx-05.zip \
|
||||
$(zipdir)/sdvx-05-cn.zip \
|
||||
$(zipdir)/sdvx-hwio-x86.zip \
|
||||
$(zipdir)/sdvx-hwio-x64.zip \
|
||||
$(zipdir)/tools.zip \
|
||||
$(zipdir)/tools-x64.zip \
|
||||
CHANGELOG.md \
|
||||
|
||||
47
README.md
47
README.md
@@ -1,7 +1,8 @@
|
||||
# Bemanitools 5
|
||||
[](https://dev.s-ul.eu/djhackers/bemanitools/commits/master)
|
||||
|
||||
Version: 5.32</br>
|
||||
Version: 5.34
|
||||
|
||||
[Release history](CHANGELOG.md)
|
||||
|
||||
A collection of tools to run [various Bemani arcade games](#list-of-supported-games).
|
||||
@@ -11,7 +12,21 @@ BT5 uses a cleaner approach than BT4 did; specifically, all input and lighting i
|
||||
spoken by the real IO PCBs, instead of replacing chunks of game code like BT4. The benefits of this approach are a more
|
||||
authentic gameplay experience, and easier support for a broader range of releases from each game series.
|
||||
|
||||
# List of supported games
|
||||
## Documentation
|
||||
Browse our [documentation](doc/README.md) as it might already cover various questions and concerns
|
||||
you are looking for or about to ask.
|
||||
|
||||
## Contributions and bug reporting
|
||||
[Read the dedicated CONTRIBUTING.md documentation](CONTRIBUTING.md).
|
||||
|
||||
The tl;dr version and golden rules of the sections in the document:
|
||||
* **EVERYONE** can contribute, this is **NOT** limited to people coding
|
||||
* [Open an issue on gitlab for discussions, feature requests and bug reports](CONTRIBUTING.md#reporting-and-discussions-issues-section-on-github)
|
||||
* [ALWAYS report bugs as issues and ALWAYS use the available bug template](CONTRIBUTING.md#bug-reports)
|
||||
* [Everyone is allowed to submit changes which are not just limited to code by opening merge requests](CONTRIBUTING.md#pull-requests-bugfixes-new-features-or-other-code-contributions)
|
||||
* [Documentation improvements can and even should be contributed by non developers](CONTRIBUTING.md#pull-requests-bugfixes-new-features-or-other-code-contributions)
|
||||
|
||||
## List of supported games (hook libraries)
|
||||
* BeatStream
|
||||
* BeatStream (bst.zip) using bsthook
|
||||
* BeatStream アニムトライヴ (bst.zip) using bsthook
|
||||
@@ -40,6 +55,7 @@ authentic gameplay experience, and easier support for a broader range of release
|
||||
* Beatmania IIDX 24 SINOBUZ (iidx-21-to-24.zip) using [iidxhook7](doc/iidxhook/iidxhook7.md)
|
||||
* Beatmania IIDX 25 CANNON BALLERS (iidx-25-to-26.zip) using [iidxhook8](doc/iidxhook/iidxhook8.md)
|
||||
* Beatmania IIDX 26 Rootage (iidx-25-to-26.zip) using [iidxhook8](doc/iidxhook/iidxhook8.md)
|
||||
* Beatmania IIDX 27 Heroic Verse (iidx-27.zip) using [iidxhook9](doc/iidxhook/iidxhook9.md)
|
||||
* jubeat
|
||||
* jubeat (experimental/buggy) (jb-01.zip) using [jbhook1](doc/jbhook1/jbhook1.md)
|
||||
* jubeat saucer (fulfill) (jb-05-to-07.zip) using jbhook
|
||||
@@ -53,13 +69,19 @@ authentic gameplay experience, and easier support for a broader range of release
|
||||
* SOUND VOLTEX IV HEAVENLY HAVEN (sdvx-01-to-04.zip) using sdvxhook
|
||||
* SOUND VOLTEX Vivid Wave (sdvx-05.zip) using sdvxhook2
|
||||
|
||||
# Supported platforms
|
||||
## ViGEm clients: Expose BT5 APIs as XBOX game controllers
|
||||
Play your favorite non-bemani arcade games with any hardware, e.g. real cabinet hardware, that
|
||||
implements BT5 APIs.
|
||||
|
||||
See the dedicated [readme](docs/vigem/README.md) for details.
|
||||
|
||||
## Supported platforms
|
||||
Our main platforms are currently Windows XP and Windows 7 which are also the target platforms on the original hardware
|
||||
of those games. However, as it gets more difficult to get and maintain hardware comptible with Windows XP, this might
|
||||
change in the future. Many games also run on very recent Windows 10 builds but bear with us that it's hard to keep up
|
||||
with Windows updates breaking legacy software.
|
||||
|
||||
# Distribution contents
|
||||
## Distribution contents
|
||||
Check the [list of supported games](#list-of-supported-games) to grab the right files for your game. BT5 also includes
|
||||
a *tools* subpackage (tools.zip) as well as the full source code (src.zip).
|
||||
|
||||
@@ -67,7 +89,7 @@ You will find *.md files in various sub-packages that give you further instructi
|
||||
or FAQ. We advice you to read them as your questions and concerns might already be answered by them. If not, let us
|
||||
know if there is any information that you consider helpful or important to know and should be added.
|
||||
|
||||
# Setup and dependencies
|
||||
## Setup and dependencies
|
||||
Most (older generation) games were developed for Windows XP Embedded but should run fine on any
|
||||
consumer version of Windows XP. Newer versions of Windows, e.g. Windows 7, 8 and 10, should be fine
|
||||
as well. Some hooks also include fixes required to run the games on a more recent version.
|
||||
@@ -77,21 +99,18 @@ Depending on the game, you also need the following dependencies installed:
|
||||
* Microsoft Visual C++ Redistributables 2010 **and** 2013: Depends on the game and age but both
|
||||
should cover most if not all of the games so far
|
||||
|
||||
# Contributions
|
||||
Please refer to the [dedicated documentation](CONTRIBUTING.md).
|
||||
## Development
|
||||
### Building
|
||||
See the [development document](doc/development.md).
|
||||
|
||||
# Development
|
||||
## Building
|
||||
See the [development document](doc/development).
|
||||
|
||||
## Architecture
|
||||
### Architecture
|
||||
A dedicate [architecture document](doc/architecture.md) outlines the architecture of Bemanitools and points out the most
|
||||
important aspects you should know before you get started with development.
|
||||
|
||||
## API
|
||||
### API
|
||||
Please refer to the [API documentation](doc/api.md).
|
||||
|
||||
# License
|
||||
## License
|
||||
Source code license is the Unlicense; you are permitted to do with this as thou wilt. For details, please refer to the
|
||||
[LICENSE file](LICENSE) included with the source code.
|
||||
|
||||
|
||||
16
dist/iidx/gamestart-27.bat
vendored
Normal file
16
dist/iidx/gamestart-27.bat
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
cd /d %~dp0
|
||||
|
||||
if not exist dev mkdir dev
|
||||
if not exist dev\e mkdir dev\e
|
||||
if not exist dev\g mkdir dev\g
|
||||
if not exist dev\nvram mkdir dev\nvram
|
||||
if not exist dev\raw mkdir dev\raw
|
||||
if not exist dev\raw\log mkdir dev\raw\log
|
||||
if not exist dev\raw\fscache mkdir dev\raw\fscache
|
||||
|
||||
for /R prop\defaults %%D in (*.*) do (
|
||||
if not exist dev\nvram\%%~nxD copy /y prop\defaults\%%~nxD dev\nvram
|
||||
)
|
||||
|
||||
launcher -H 134217728 -B iidxhook9.dll bm2dx.dll --config iidxhook-27.conf %*
|
||||
6
dist/iidx/iidxhook-18.conf
vendored
6
dist/iidx/iidxhook-18.conf
vendored
@@ -36,3 +36,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
6
dist/iidx/iidxhook-19.conf
vendored
6
dist/iidx/iidxhook-19.conf
vendored
@@ -33,3 +33,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
6
dist/iidx/iidxhook-20.conf
vendored
6
dist/iidx/iidxhook-20.conf
vendored
@@ -33,3 +33,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
6
dist/iidx/iidxhook-21.conf
vendored
6
dist/iidx/iidxhook-21.conf
vendored
@@ -33,3 +33,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
6
dist/iidx/iidxhook-22.conf
vendored
6
dist/iidx/iidxhook-22.conf
vendored
@@ -33,3 +33,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
6
dist/iidx/iidxhook-23.conf
vendored
6
dist/iidx/iidxhook-23.conf
vendored
@@ -33,3 +33,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
6
dist/iidx/iidxhook-24.conf
vendored
6
dist/iidx/iidxhook-24.conf
vendored
@@ -33,3 +33,9 @@ gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM1 (for games supporting slotted/wavepass readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware
|
||||
io.disable_io_emu=false
|
||||
72
dist/iidx/iidxhook-27.conf
vendored
Normal file
72
dist/iidx/iidxhook-27.conf
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM0 (for games supporting slotted readers)
|
||||
io.disable_card_reader_emu=false
|
||||
|
||||
# Disable BIO2 emulation and enable usage of real BIO2 hardware
|
||||
io.disable_bio2_emu=false
|
||||
|
||||
# Disables the poll limiter, warning very high CPU usage may arise
|
||||
io.disable_poll_limiter=false
|
||||
|
||||
# Lightning cab mode (requires additional IO emulation)
|
||||
io.lightning_mode=false
|
||||
|
||||
# Disable camera connection
|
||||
io.disable_cams=false
|
||||
|
||||
# Disables the built in file hooks, requiring manual file creation
|
||||
io.disable_file_hooks=false
|
||||
|
||||
# Turntable sensitivity multiplier (1.0 is default)
|
||||
io.tt_multiplier=1.0
|
||||
|
||||
# Disables the camera emulation
|
||||
cam.disable_emu=false
|
||||
|
||||
# Override camera device ID detection (copy from device manager, do not escape)
|
||||
cam.device_id1=
|
||||
|
||||
# Override camera device ID detection (copy from device manager, do not escape)
|
||||
cam.device_id2=
|
||||
|
||||
# Run the game in a framed window (requires windowed option)
|
||||
gfx.framed=true
|
||||
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Confine mouse coursor to window
|
||||
gfx.confined=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
|
||||
# Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors)
|
||||
gfx.forced_refresh_rate=-1
|
||||
|
||||
# D3D9ex device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Orientation to force monitor into, -1 to use default, 0, 1, 2, 3 to do 0, 90, 180, 270 degrees
|
||||
gfx.force_orientation=-1
|
||||
|
||||
# Force a screen resolution (width), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
|
||||
gfx.force_screen_res.width=-1
|
||||
|
||||
# Force a screen resolution (height), -1 to disable. Use this if the game does not auto detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.
|
||||
gfx.force_screen_res.height=-1
|
||||
|
||||
# IP of adapter to force override with
|
||||
adapter.override_ip=
|
||||
|
||||
# Force ASIO audio mode/device (if applicable / TDJ default)
|
||||
asio.force_asio=false
|
||||
|
||||
# Force WASAPI audio mode (if applicable / LDJ default)
|
||||
asio.force_wasapi=true
|
||||
|
||||
# The ASIO device name to use
|
||||
asio.device_name=XONAR SOUND CARD(64)
|
||||
|
||||
8
dist/iidx/iidxio-bio2.conf
vendored
Normal file
8
dist/iidx/iidxio-bio2.conf
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Autodetect BIO2 port (default: on)
|
||||
bio2.autodetect=true
|
||||
|
||||
# BIO2 serial port. Optional, if autodetect property is turned on
|
||||
bio2.port=COM4
|
||||
|
||||
# BIO2 bus baudrate (real devices expect 115200)
|
||||
bio2.baud=115200
|
||||
26
dist/iidx/vigem-iidxio.conf
vendored
Normal file
26
dist/iidx/vigem-iidxio.conf
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# Use relative mode analog mapping instead of absolute analog values
|
||||
vigem.iidxio.tt.anlog.relative=false
|
||||
|
||||
# Sensitivity value for relative mode (1 to 32767). Tweak if you are having issues with jittering/misfiring/unresponsiveness
|
||||
vigem.iidxio.tt.anlog.relative_sensitivity=1024
|
||||
|
||||
# Button turntable: "debounce" value (1 to 50, recommend 20). Tweak if you are having issues with TT button misfiring/unresponsiveness
|
||||
vigem.iidxio.tt.button.debounce=20
|
||||
|
||||
# Button turntable: minimum ticks required within (debounce * 2) ms to register movement (1 to 4, recommend 2). Tweak if you button input is too (un-) responsive
|
||||
vigem.iidxio.tt.button.threshold=2
|
||||
|
||||
# Print verbose debug output to the console for debugging turntable sensitivity issues
|
||||
vigem.iidxio.tt.debug_output=false
|
||||
|
||||
# Enable input based key lighting
|
||||
vigem.iidxio.cab_light.enable_keylight=true
|
||||
|
||||
# Different cabinet light modes: 0 = off, 1 = neons sequence, 2 = neons flash on TT spin
|
||||
vigem.iidxio.cab_light.light_mode=0
|
||||
|
||||
# Display text on 16seg. If text exceeds 9 char display limit, it will scroll + cycle
|
||||
vigem.iidxio.cab_light.text_16seg=
|
||||
|
||||
# Cycle time/scroll speed for text exceeding 16seg display length (9) to scroll from right
|
||||
vigem.iidxio.cab_light.text_scroll_cycle_time_ms=500
|
||||
2
dist/jb/gamestart.bat
vendored
2
dist/jb/gamestart.bat
vendored
@@ -7,4 +7,4 @@ if not exist dev\nvram\coin.xml copy prop\defaults\coin.xml dev\nvram\coin.xml
|
||||
if not exist dev\nvram\eacoin.xml copy prop\defaults\eacoin.xml dev\nvram\eacoin.xml
|
||||
if not exist dev\raw mkdir dev\raw
|
||||
|
||||
launcher -K jbhook.dll jubeat.dll
|
||||
launcher -H 33554432 -K jbhook.dll jubeat.dll
|
||||
|
||||
3
dist/sdvx5/sdvxhook2.conf
vendored
3
dist/sdvx5/sdvxhook2.conf
vendored
@@ -10,6 +10,9 @@ io.disable_poll_limiter=false
|
||||
# Forces game to think headphones are attached
|
||||
io.force_headphones=false
|
||||
|
||||
# Disables the built in file hooks, requiring manual file creation (/dev/raw/j.dest)
|
||||
io.disable_file_hooks=false
|
||||
|
||||
# Run the game in a framed window (requires windowed option)
|
||||
gfx.framed=true
|
||||
|
||||
|
||||
21
doc/README.md
Normal file
21
doc/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Bemanitools 5 documentation
|
||||
This folder contains various types of documentation.
|
||||
|
||||
Table of contents:
|
||||
* Key tools
|
||||
* [Inject](inject.md): Readme for one of BT5's key applications, `inject.exe`
|
||||
* [Launcher](launcher.md): Readme for another one of BT5's key applications, `launcher.exe`
|
||||
* [Tools](tools/README.md): Documentation for additional user and development tooling
|
||||
* Game hooks
|
||||
* [ddrhook](ddrhook/README.md): Documentation relevant to `ddrhook` implementations
|
||||
* [iidxhook](iidxhook/README.md): Documentation relevant to `iidxhook` implementations
|
||||
* [jbhook](jbhook/README.md): Documentation relevant to `jbhook` implementations
|
||||
* [sdvxhook](sdvxhook/README.md): Documentation relevant to `sdvxhook` implementations
|
||||
* Development
|
||||
* [API](api.md): Available APIs for BT5 and instructions how to use them
|
||||
* [Architecture](architecture.md): Outline of BT5's architecture, how things are designed and why
|
||||
* [Development](development.md): Development environment, building, releasing, etc.
|
||||
* [Developer documentation](dev/README.md): Various lose documentation/notes by developers
|
||||
* [Tools](tools/README.md): Documentation for additional user and development tooling
|
||||
* Hardware
|
||||
* [Hardware](hardware/README.md): Anything related to hardware, e.g. IO boards
|
||||
@@ -22,12 +22,15 @@ The following implementations are already shipped with BT5.
|
||||
* ddrio-smx.dll: StepManiaX platforms
|
||||
* Beatmania IIDX
|
||||
* iidxio.dll (default): Keyboard, joystick and mouse input
|
||||
* iidxio-ezusb.dll: Ezusb (C02 IO) driver
|
||||
* iidxio-ezusb2.dll: Ezusb FX2 (IO2) driver
|
||||
* [iidxio-bio2.dll](iidxhook/iidxio-bio2.md): BIO2 driver
|
||||
* [iidxio-ezusb.dll](iidxhook/iidxio-ezusb.md): Ezusb (C02 IO) driver
|
||||
* [iidxio-ezusb2.dll](iidxhook/iidxio-ezusb2.md): Ezusb FX2 (IO2) driver
|
||||
* jubeat
|
||||
* jbio.dll (default): Keyboard, joystick and mouse input
|
||||
* SOUND VOLTEX
|
||||
* sdvxio.dll (default): Keyboard, joystick and mouse input
|
||||
* [sdvxio-bio2.dll](sdvxhook/sdvxio-bio2.md): BIO2 driver
|
||||
* [sdvxio-kfca.dll](sdvxhook/sdvxio-kfca.md): KFCA IO board driver
|
||||
|
||||
Eamuse hardware support is implemented separately:
|
||||
* eamio.dll (default): Keyboard and joystick input
|
||||
|
||||
3
doc/dev/README.md
Normal file
3
doc/dev/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Development documentation and notes
|
||||
This folder contains various lose documentation snippets created by the developers. These can be
|
||||
helpful as future reference.
|
||||
192
doc/dev/acio-bio2-iidx-package-dump.md
Normal file
192
doc/dev/acio-bio2-iidx-package-dump.md
Normal file
@@ -0,0 +1,192 @@
|
||||
# ACIO BIO2 IIDX package dump
|
||||
Package dump excerpt of the init sequence of a original Konami IIDX BIO2 with sub IO connected.
|
||||
This was used to identify a missing piece of information that needs to be communicated to the BIO2
|
||||
for IIDX to initialize the sub IO correctly.
|
||||
|
||||
The dump was cut off after two polls as the sequence just keeps on repeating from that point on.
|
||||
|
||||
## Findings for problem to solve
|
||||
With the previous implemention of the BIO2 driver, which was created off references of SDVX KFCA,
|
||||
a BIO2 used with IIDX and the sub IO (to upgrade older C02, IO2 cabinets) connected didn't
|
||||
initialize properly. This resulted in no inputs/outputs other than 14 keys working.
|
||||
|
||||
The problem identified was a different byte, exact meaning not known, that is sent in
|
||||
[exchange 4](#exchange-4-ac-io-cmd-clear). Instead of `0x3B` from the SDVX KFCA based
|
||||
implementation, it needs to be set to `0x2D`.
|
||||
|
||||
## Exchange 1: AC_IO_CMD_ASSIGN_ADDRS
|
||||
### Write
|
||||
```text
|
||||
AA 00 00 01 00 01 00 02
|
||||
|
||||
AA: SOF
|
||||
00: addr
|
||||
0001: AC_IO_CMD_ASSIGN_ADDRS
|
||||
00: seq_no
|
||||
01: nbytes
|
||||
data: 00
|
||||
02: checksum
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 00 00 01 00 01 01 03
|
||||
|
||||
AA: SOF
|
||||
AA: SOF
|
||||
00: addr
|
||||
0001: addr
|
||||
00: seq_no
|
||||
01: nbytes
|
||||
01: data
|
||||
03: checksum
|
||||
```
|
||||
|
||||
## Exchange 2: AC_IO_CMD_GET_VERSION
|
||||
### Write
|
||||
```
|
||||
AA 01 00 02 00 00 03
|
||||
|
||||
AA: SOF
|
||||
01: addr, node 1
|
||||
0002: AC_IO_CMD_GET_VERSION
|
||||
00: seq_no
|
||||
00: nbytes
|
||||
03: checksum
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 81 00 02 00 2C 0D 06 00 00 ...
|
||||
|
||||
AA: SOF
|
||||
AA: SOF
|
||||
81: Response flag + node 1
|
||||
0002: AC_IO_CMD_GET_VERSION
|
||||
00: seq_no
|
||||
2C: nbytes
|
||||
0D 06 00 00 ...: data
|
||||
XX: checksum
|
||||
```
|
||||
|
||||
## Exchange 3: AC_IO_CMD_START_UP
|
||||
### Write
|
||||
```
|
||||
AA 01 00 03 00 00 04
|
||||
|
||||
AA: SOF
|
||||
01: addr
|
||||
0003: AC_IO_CMD_START_UP
|
||||
00: seq_no
|
||||
00: nbytes
|
||||
04: checksum
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 81 00 03 00 01 00 85
|
||||
|
||||
AA: SOF
|
||||
AA: SOF
|
||||
81: Response flag + node 1
|
||||
0003: AC_IO_CMD_START_UP
|
||||
00: seq_no
|
||||
01: nbytes
|
||||
00: data
|
||||
85: checksum
|
||||
```
|
||||
|
||||
## Exchange 4: AC_IO_CMD_CLEAR
|
||||
### Write
|
||||
```
|
||||
AA 01 01 00 00 01 2D 30
|
||||
|
||||
AA: SOF
|
||||
01: addr
|
||||
0100: AC_IO_CMD_CLEAR
|
||||
00: seq_no
|
||||
01: nbytes
|
||||
2D: data
|
||||
30: checksum
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 81 01 00 00 01 00 83
|
||||
|
||||
AA: SOF
|
||||
AA: SOF
|
||||
81: Response flag + node 1
|
||||
0100: AC_IO_CMD_CLEAR
|
||||
00: seq_no
|
||||
01: nbytes
|
||||
00: data
|
||||
83: checksum
|
||||
```
|
||||
|
||||
## Exchange 5: BIO2_BI2A_CMD_WATCHDOG
|
||||
### Write
|
||||
```
|
||||
AA 01 01 20 00 02 00 00 24
|
||||
|
||||
AA: SOF
|
||||
01: addr
|
||||
0120: BIO2_BI2A_CMD_WATCHDOG
|
||||
00: seq_no
|
||||
02: nbytes
|
||||
00 00: data
|
||||
24: checksum
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 81 01 20 00 01 00 A3
|
||||
|
||||
AA: SOF
|
||||
AA: SOF
|
||||
81: Response flag + node 1
|
||||
0120: BIO2_BI2A_CMD_WATCHDOG
|
||||
00: seq_no
|
||||
01: nbytes
|
||||
00: data
|
||||
A3: checksum
|
||||
```
|
||||
|
||||
## Exchange 6: BIO2_BI2A_CMD_POLL
|
||||
### Write
|
||||
```
|
||||
AA 01 01 52 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84
|
||||
|
||||
AA: SOF
|
||||
01: addr
|
||||
0152: BIO2_BI2A_CMD_POLL
|
||||
00: seq_no
|
||||
30: nbtes
|
||||
...: data
|
||||
84: checksum
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 81 01 52 00 2E 00 00 B0 00 F0 00 F0 F0 00 00 00 00 00 02 00 5F 11 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F3
|
||||
|
||||
AA: SOF
|
||||
AA: SOF
|
||||
81: Response flag + node 1
|
||||
0152: BIO2_BI2A_CMD_POLL
|
||||
00: seq_no
|
||||
2E: nbytes
|
||||
...: data
|
||||
F3: checksum
|
||||
```
|
||||
|
||||
## Exchange 7: BIO2_BI2A_CMD_POLL
|
||||
### Write
|
||||
```
|
||||
AA 01 01 52 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84
|
||||
```
|
||||
|
||||
### Read
|
||||
```
|
||||
AA AA 81 01 52 00 2E 00 00 B0 00 F0 00 F0 F0 00 00 00 00 00 02 00 64 11 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F8
|
||||
```
|
||||
54
doc/hardware/bio2-sub-io-turntable-bypass-cable.md
Normal file
54
doc/hardware/bio2-sub-io-turntable-bypass-cable.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# BIO2 sub IO turntable bypass cable
|
||||
If you upgraded a C02/IO2 wired cabinet, the turntables are connected to the
|
||||
sub IO via a serial line that goes to another sub IO behind the front panel
|
||||
next to the 16seg display. This introduces additional latency as the input
|
||||
data needs to pass through multiple systems/PCBs until it reaches the game.
|
||||
|
||||
This can be reduced by using a so-called "bypass" cable, that connects the
|
||||
turntables directly to the BIO2 sub IO board reducing latency significantly.
|
||||
|
||||
This cable could be ordered with any IIDX upgrade kit including the BIO sub IO
|
||||
board but can also be easily created from scratch.
|
||||
|
||||
## Parts
|
||||
* Some wires
|
||||
* [JST HL](https://jst.de/file/download/219/pitch-3-96-mm-wtw-hl2-pdf) 2x4 pin female connector
|
||||
* [JST HVQ](https://jst.de/file/download/637/hvq) 8 pin female connector
|
||||
* Matching terminals for the connectors
|
||||
|
||||
## Pinout
|
||||
```text
|
||||
JST HL 2x4 pin front view connector
|
||||
|
||||
notch at top
|
||||
___
|
||||
|---------|
|
||||
| 1 2 3 4 |
|
||||
| 5 6 7 8 |
|
||||
|---------|
|
||||
```
|
||||
|
||||
```
|
||||
JST HVQ 8 pin front view connector
|
||||
Numbering on connector matches
|
||||
|
||||
notch at top
|
||||
___________________
|
||||
-------------------
|
||||
|-----------------|
|
||||
| 1 2 3 4 5 6 7 8 |
|
||||
|-----------------|
|
||||
|
||||
```
|
||||
|
||||
Pins of the two connectors need to be connected like this:
|
||||
| JST HL 2x4 pin | JST 8 pin |
|
||||
|----------------|-----------|
|
||||
| 1 | 1 |
|
||||
| 2 | 1 |
|
||||
| 3 | 3 |
|
||||
| 4 | 2 |
|
||||
| 5 | 5 |
|
||||
| 6 | 4 |
|
||||
| 7 | 8 |
|
||||
| 8 | 8 |
|
||||
51
doc/hardware/ezusb-iidx-rj45-to-din8-pinout.md
Normal file
51
doc/hardware/ezusb-iidx-rj45-to-din8-pinout.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Ezusb 1/2 RJ45 to DIN8 connector pinout
|
||||
This was created from using the BIO2 sub IO board to connect pre IIDX 25 cabinet hardware to the
|
||||
BIO2 IO board. The two connector types from different generation IO boards, RJ45 on the ezusb FX
|
||||
(C02) board and a round DIN8 connector on the ezusb FX2 (IO2) board are just different connectors to
|
||||
the same hardware on the PCB.
|
||||
|
||||
Therefore, any C02 wired cabinet can be easily upgraded to IO2 wiring and vice versa by building
|
||||
a simple RJ45 -> DIN8 or DIN8 -> RJ45 adapter.
|
||||
|
||||
The following connection information was traced on a original Konami BIO2 sub IO board.
|
||||
|
||||
RJ45 (female) connector, top view:
|
||||
```text
|
||||
plug insert
|
||||
|
|
||||
|
|
||||
v
|
||||
|-----------|
|
||||
| Top view |
|
||||
| |
|
||||
| Pins |
|
||||
| 7 5 3 1 |
|
||||
| 8 6 4 2 |
|
||||
|-----------|
|
||||
```
|
||||
|
||||
DIN8 (female) connector, top view:
|
||||
```text
|
||||
plug insert
|
||||
|
|
||||
|
|
||||
v
|
||||
|-----------|
|
||||
| Top view |
|
||||
| Pins |
|
||||
| 3 1 2 6 |
|
||||
| 7 4 5 8 9 |
|
||||
|-----------|
|
||||
```
|
||||
|
||||
The two connectors are interconnected on the PCB like this:
|
||||
| RJ45 pins | DIN8 pins |
|
||||
|-----------|-----------|
|
||||
| 1 | 1 |
|
||||
| 2 | 7 |
|
||||
| 3 | 4 |
|
||||
| 4 | 6 |
|
||||
| 5 | 5 |
|
||||
| 6 | 3 |
|
||||
| 7 | 2 |
|
||||
| 8 | 1 |
|
||||
@@ -1,5 +1,4 @@
|
||||
# iidxhook
|
||||
|
||||
iidxhook is a collection of hook libraries for BeatmaniaIIDX providing
|
||||
emulation and various patches to run these games on non BemaniPC hardware and
|
||||
newer Windows versions.
|
||||
@@ -9,8 +8,7 @@ The hook libraries must be bootstrapped either using [inject](../inject.md) or
|
||||
instructions are given in dedicated readme files for each iidxhook version
|
||||
(see below).
|
||||
|
||||
# Versions
|
||||
|
||||
## Versions
|
||||
iidxhook comes in a few different flavors. The game and its engine changed over
|
||||
the years. Some game versions might require patches/parameters enabled which
|
||||
others don't need or have different AVS versions. Here is the list of supported
|
||||
@@ -23,14 +21,14 @@ games:
|
||||
* [iidxhook6](iidxhook6.md): Tricoro
|
||||
* [iidxhook7](iidxhook7.md): SPADA, PENDUAL, copula, SINOBUZ
|
||||
* [iidxhook8](iidxhook8.md): CANNON BALLERS, Rootage
|
||||
* [iidxhook8](iidxhook9.md): Heroic Verse
|
||||
|
||||
When building kactools, independent packages are created for each set of games
|
||||
which are ready to be dropped on top of vanilla AC data dumps. We recommend
|
||||
using prestine dumps to avoid any conflicts with other hardcoded hacks or
|
||||
binary patches.
|
||||
|
||||
# How to run
|
||||
|
||||
## How to run
|
||||
To run your game with iidxhook, you have to use the inject tool to inject the
|
||||
DLL to the game process. *dist/iidx* contains bat scripts with all the
|
||||
important parameters configured. Further parameters can be added but might not
|
||||
@@ -38,7 +36,15 @@ be required to run the game with default settings.
|
||||
Further information on how to setup the data for each specific version are
|
||||
elaborated in their dedicated readme files.
|
||||
|
||||
# Command line options
|
||||
|
||||
## Command line options
|
||||
Add the argument *-h* when running inject with iidxhook to print help/usage
|
||||
information with a list of parameters you can apply to tweak various things.
|
||||
|
||||
## iidxio API
|
||||
Available implementations that can be swapped out depending on which kind of
|
||||
IO hardware you want to use:
|
||||
* `iidxio`: Default implementation supporting keyboard, mouse and USB
|
||||
game controllers
|
||||
* [iidxio-bio2](iidxhook/iidxio-bio2.md): Support BIO2 hardware
|
||||
* [iidxio-ezusb](iidxhook/iidxio-ezusb.md): Support C02 ezusb FX hardware
|
||||
* [iidxio-ezusb2](iidxhook/iidxio-ezusb2.md): Support IO2 ezusb FX2 hardware
|
||||
@@ -126,6 +126,16 @@ happens, run the game again.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
|
||||
## The game is running (very) slow in fullscreen mode but is fine in window mode
|
||||
If you are using a AMD GPU, try disabling "GPU scaling" which you can find in AMD
|
||||
settings UI under "Settings" -> "Display".
|
||||
|
||||
This issue only observed on 9th Style so far.
|
||||
|
||||
Use
|
||||
[bemanitool's built in upscaling feature](#over-underscan-bad-image-quality-or-latency-caused-by-my-monitorsTV-upscaler) if the game is not
|
||||
scaled properly in full screen.
|
||||
|
||||
## Window mode or any other gfx related options do not work when changing them in the config file or using cmd args
|
||||
|
||||
See [this](#Use-d3d8to9-wrapper) section.
|
||||
|
||||
@@ -85,17 +85,29 @@ cycle the machine (i.e. quit the game and restart it).
|
||||
|
||||
## USB IO (ezusb)
|
||||
|
||||
Use the specific iidxio API implementations, e.g. iidxio-ezusb2.dll to use
|
||||
the IO2 EZUSB board, to run the game on real hardware. Thanks to a common
|
||||
abstraction layer, you can also use custom IO boards or whatever Konami hardware
|
||||
is going to be available in the future. Obviously, someone has to write a
|
||||
driver, first.
|
||||
You have the following options:
|
||||
* Set `io.disable_io_emu=true` in the `iidxhook.conf` file to not hook ezusb
|
||||
IO communication with an emulation layer. The game will directly talk to the IO.
|
||||
The game supports the ezusb (C02) as well as ezusb FX2 (IO2) boards.
|
||||
* Set `io.disable_io_emu=false` in the `iidxhook.conf` file.
|
||||
Use the specific iidxio API implementations, e.g. `iidxio-ezusb2.dll` to use
|
||||
the IO2 EZUSB board. The common `iidxio` abstraction layer also allows you to
|
||||
use custom IO boards or whatever Konami hardware is going to be available in
|
||||
the future. Obviously, someone has to write an imlementation of the `iidxio`
|
||||
API, first.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
Replace the default *eamio.dll* with the *eamio-icca.dll* and have either your
|
||||
You have the following options:
|
||||
* Set `io.disable_card_reader_emu=true` in the `iidxhook.conf` file to not hook
|
||||
card reader communication with an emulation layer. The game will directly talk
|
||||
to the real readers though this only supports whatever readers the game
|
||||
directly supports (slotted readers)
|
||||
* Set `io.disable_card_reader_emu=false` in the `iidxhook.conf` file.
|
||||
Replace the default `eamio.dll` with the `eamio-icca.dll` and have either your
|
||||
slotted (IIDX, DDR Supernova or GF/DM type) or new wave pass card readers
|
||||
conencted and and assigned to *COM1*.
|
||||
conencted and and assigned to `COM1`. Other custom implementations of of the
|
||||
`eamio` API also work.
|
||||
|
||||
### ICCA device settings (device manager)
|
||||
* Port: COM1
|
||||
@@ -112,7 +124,7 @@ mainboard.
|
||||
# Known bugs
|
||||
## USBIO (FM-DL TIMEOUT)
|
||||
IIDX occasionally fails to boot with a "USBIO (FM-DL TIMEOUT)" error. If this
|
||||
happens, run the game again.
|
||||
happens, run the game again.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
|
||||
|
||||
@@ -85,17 +85,29 @@ cycle the machine (i.e. quit the game and restart it).
|
||||
|
||||
## USB IO (ezusb)
|
||||
|
||||
Use the specific iidxio API implementations, e.g. iidxio-ezusb2.dll to use
|
||||
the IO2 EZUSB board, to run the game on real hardware. Thanks to a common
|
||||
abstraction layer, you can also use custom IO boards or whatever Konami hardware
|
||||
is going to be available in the future. Obviously, someone has to write a
|
||||
driver, first.
|
||||
You have the following options:
|
||||
* Set `io.disable_io_emu=true` in the `iidxhook.conf` file to not hook ezusb
|
||||
IO communication with an emulation layer. The game will directly talk to the IO.
|
||||
The game supports the ezusb (C02) as well as ezusb FX2 (IO2) boards.
|
||||
* Set `io.disable_io_emu=false` in the `iidxhook.conf` file.
|
||||
Use the specific iidxio API implementations, e.g. `iidxio-ezusb2.dll` to use
|
||||
the IO2 EZUSB board. The common `iidxio` abstraction layer also allows you to
|
||||
use custom IO boards or whatever Konami hardware is going to be available in
|
||||
the future. Obviously, someone has to write an imlementation of the `iidxio`
|
||||
API, first.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
Replace the default *eamio.dll* with the *eamio-icca.dll* and have either your
|
||||
You have the following options:
|
||||
* Set `io.disable_card_reader_emu=true` in the `iidxhook.conf` file to not hook
|
||||
card reader communication with an emulation layer. The game will directly talk
|
||||
to the real readers though this only supports whatever readers the game
|
||||
directly supports (wave pass readers)
|
||||
* Set `io.disable_card_reader_emu=false` in the `iidxhook.conf` file.
|
||||
Replace the default `eamio.dll` with the `eamio-icca.dll` and have either your
|
||||
slotted (IIDX, DDR Supernova or GF/DM type) or new wave pass card readers
|
||||
conencted and and assigned to *COM1*.
|
||||
conencted and and assigned to `COM1`. Other custom implementations of of the
|
||||
`eamio` API also work.
|
||||
|
||||
### ICCA device settings (device manager)
|
||||
* Port: COM1
|
||||
|
||||
@@ -96,17 +96,29 @@ cycle the machine (i.e. quit the game and restart it).
|
||||
|
||||
## USB IO (ezusb)
|
||||
|
||||
Use the specific iidxio API implementations, e.g. iidxio-ezusb2.dll to use
|
||||
the IO2 EZUSB board, to run the game on real hardware. Thanks to a common
|
||||
abstraction layer, you can also use custom IO boards or whatever Konami hardware
|
||||
is going to be available in the future. Obviously, someone has to write a
|
||||
driver, first.
|
||||
You have the following options:
|
||||
* Set `io.disable_io_emu=true` in the `iidxhook.conf` file to not hook ezusb
|
||||
IO communication with an emulation layer. The game will directly talk to the IO.
|
||||
The game supports the ezusb (C02) as well as ezusb FX2 (IO2) boards.
|
||||
* Set `io.disable_io_emu=false` in the `iidxhook.conf` file.
|
||||
Use the specific iidxio API implementations, e.g. `iidxio-ezusb2.dll` to use
|
||||
the IO2 EZUSB board. The common `iidxio` abstraction layer also allows you to
|
||||
use custom IO boards or whatever Konami hardware is going to be available in
|
||||
the future. Obviously, someone has to write an imlementation of the `iidxio`
|
||||
API, first.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
Replace the default *eamio.dll* with the *eamio-icca.dll* and have either your
|
||||
You have the following options:
|
||||
* Set `io.disable_card_reader_emu=true` in the `iidxhook.conf` file to not hook
|
||||
card reader communication with an emulation layer. The game will directly talk
|
||||
to the real readers though this only supports whatever readers the game
|
||||
directly supports (wave pass readers)
|
||||
* Set `io.disable_card_reader_emu=false` in the `iidxhook.conf` file.
|
||||
Replace the default `eamio.dll` with the `eamio-icca.dll` and have either your
|
||||
slotted (IIDX, DDR Supernova or GF/DM type) or new wave pass card readers
|
||||
conencted and and assigned to *COM1*.
|
||||
conencted and and assigned to `COM1`. Other custom implementations of of the
|
||||
`eamio` API also work.
|
||||
|
||||
### ICCA device settings (device manager)
|
||||
* Port: COM1
|
||||
|
||||
@@ -101,17 +101,29 @@ cycle the machine (i.e. quit the game and restart it).
|
||||
|
||||
## USB IO (ezusb)
|
||||
|
||||
Use the specific iidxio API implementations, e.g. iidxio-ezusb2.dll to use
|
||||
the IO2 EZUSB board, to run the game on real hardware. Thanks to a common
|
||||
abstraction layer, you can also use custom IO boards or whatever Konami hardware
|
||||
is going to be available in the future. Obviously, someone has to write a
|
||||
driver, first.
|
||||
You have the following options:
|
||||
* Set `io.disable_io_emu=true` in the `iidxhook.conf` file to not hook ezusb
|
||||
IO communication with an emulation layer. The game will directly talk to the IO.
|
||||
The game supports the ezusb (C02) as well as ezusb FX2 (IO2) boards.
|
||||
* Set `io.disable_io_emu=false` in the `iidxhook.conf` file.
|
||||
Use the specific iidxio API implementations, e.g. `iidxio-ezusb2.dll` to use
|
||||
the IO2 EZUSB board. The common `iidxio` abstraction layer also allows you to
|
||||
use custom IO boards or whatever Konami hardware is going to be available in
|
||||
the future. Obviously, someone has to write an imlementation of the `iidxio`
|
||||
API, first.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
Replace the default *eamio.dll* with the *eamio-icca.dll* and have either your
|
||||
You have the following options:
|
||||
* Set `io.disable_card_reader_emu=true` in the `iidxhook.conf` file to not hook
|
||||
card reader communication with an emulation layer. The game will directly talk
|
||||
to the real readers though this only supports whatever readers the game
|
||||
directly supports (wave pass readers)
|
||||
* Set `io.disable_card_reader_emu=false` in the `iidxhook.conf` file.
|
||||
Replace the default `eamio.dll` with the `eamio-icca.dll` and have either your
|
||||
slotted (IIDX, DDR Supernova or GF/DM type) or new wave pass card readers
|
||||
conencted and and assigned to *COM1*.
|
||||
conencted and and assigned to `COM1`. Other custom implementations of of the
|
||||
`eamio` API also work.
|
||||
|
||||
### ICCA device settings (device manager)
|
||||
* Port: COM1
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* CANNON BALLERS
|
||||
* Rootage
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
@@ -96,22 +97,31 @@ cycle the machine (i.e. quit the game and restart it).
|
||||
|
||||
### BIO2 hardware
|
||||
|
||||
Set the *io.disable_bio2_emu* configuration value to *1* to disable BIO2
|
||||
emulation to run the game using real BIO2 hardware.
|
||||
Set `io.disable_bio2_emu=true` in the `iidxhook.conf` file to not hook the BIO2
|
||||
communication with an emulation layer. The game will directly talk to the IO.
|
||||
In this mode, tthe game supports the BIO2 board only.
|
||||
|
||||
### Ezusb and other
|
||||
|
||||
Use the specific iidxio API implementations, e.g. iidxio-ezusb2.dll to use
|
||||
the IO2 EZUSB board, to run the game on real hardware. Thanks to a common
|
||||
abstraction layer, you can also use custom IO boards or whatever Konami hardware
|
||||
is going to be available in the future. Obviously, someone has to write a
|
||||
driver, first.
|
||||
Set `io.disable_bio2_emu=false` in the `iidxhook.conf` file.
|
||||
Use the specific iidxio API implementations, e.g. `iidxio-ezusb2.dll` to use
|
||||
the IO2 EZUSB board. The common `iidxio` abstraction layer also allows you to
|
||||
use custom IO boards or whatever Konami hardware is going to be available in
|
||||
the future. Obviously, someone has to write an imlementation of the `iidxio`
|
||||
API, first.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
Replace the default *eamio.dll* with the *eamio-icca.dll* and have either your
|
||||
You have the following options:
|
||||
* Set `io.disable_card_reader_emu=true` in the `iidxhook.conf` file to not hook
|
||||
card reader communication with an emulation layer. The game will directly talk
|
||||
to the real readers though this only supports whatever readers the game
|
||||
directly supports (wave pass readers)
|
||||
* Set `io.disable_card_reader_emu=false` in the `iidxhook.conf` file.
|
||||
Replace the default `eamio.dll` with the `eamio-icca.dll` and have either your
|
||||
slotted (IIDX, DDR Supernova or GF/DM type) or new wave pass card readers
|
||||
conencted and and assigned to *COM1*.
|
||||
conencted and and assigned to `COM1`. Other custom implementations of of the
|
||||
`eamio` API also work.
|
||||
|
||||
### ICCA device settings (device manager)
|
||||
* Port: COM1
|
||||
@@ -127,6 +137,16 @@ mainboard.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
|
||||
## The monitor check is showing high fps and I am using a monitor with high refresh rate features, e.g. 120/144hz
|
||||
Sync and timing might be screwed up since the game was never meant to run on
|
||||
such refresh rates. Try setting the option `gfx.forced_refresh_rate` to either
|
||||
`59` or `60`.
|
||||
|
||||
Note: Your GPU driver settings must be configured to allow application overrides
|
||||
on vertical sync/refresh rate options.
|
||||
|
||||
On AMD GPUs, set the "V-Sync" option to `On, unless application specifies`.
|
||||
|
||||
## The game does not run "well" (frame drops, drifting offsync etc)
|
||||
This can be related to various issues:
|
||||
* Make sure to run the game as (true) Administrator especially on Windows 7 and
|
||||
|
||||
236
doc/iidxhook/iidxhook9.md
Normal file
236
doc/iidxhook/iidxhook9.md
Normal file
@@ -0,0 +1,236 @@
|
||||
# Game list
|
||||
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* Heroic Verse
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
## Supported versions of Windows
|
||||
|
||||
This version requires at least Win 7 x64 and will not run, like the
|
||||
former versions, on Win XP x86!
|
||||
|
||||
## Dependencies
|
||||
|
||||
Make sure to have the following dependencies installed:
|
||||
* DirectX 9
|
||||
* Visual C++ 2010 Redistributable Package (x64)
|
||||
|
||||
## Data setup
|
||||
|
||||
We assume that you are using a clean/vanilla data dump. Ensure your ("concents")
|
||||
folder with your unpacked data looks like this:
|
||||
- data
|
||||
- modules
|
||||
- prop
|
||||
|
||||
* Copy/Move all files from the *modules* directory to the root folder, so they
|
||||
are located next to the *data* and *prop* folders.
|
||||
* Copy all files from *prop/defaults* to the *prop* folder.
|
||||
* Setup proper paths for *dev/nvram* and *dev/raw* in *prop/avs-config.xml* by
|
||||
replacing the *<fs>*-block in that file with the following block:
|
||||
```
|
||||
<fs>
|
||||
<root>
|
||||
<device __type="str">.</device>
|
||||
</root>
|
||||
<mounttable>
|
||||
<vfs name="boot" fstype="fs" src="dev/raw" dst="/dev/raw" opt="vf=1,posix=1"/>
|
||||
<vfs name="boot" fstype="fs" src="dev/nvram" dst="/dev/nvram" opt="vf=0,posix=1"/>
|
||||
</mounttable>
|
||||
<nr_mountpoint __type="u16">256</nr_mountpoint>
|
||||
<nr_filedesc __type="u16">256</nr_filedesc>
|
||||
</fs>
|
||||
```
|
||||
* Unpack the package containing iidxhook9 into the root folder so iidxhook9.dll
|
||||
and all other files are located in the same folder as *data*, *prop*,
|
||||
*bm2dx.dll*, etc.
|
||||
* Run the gamestart-XX.bat file as admin. Where XX matches the version you
|
||||
want to run.
|
||||
|
||||
* Note: if you know what you're doing and would like to keep all the dlls in the
|
||||
*modules* folder then you extract iidxhook9 into that directory, move
|
||||
gamestart-XX.bat up, and edit the paths.
|
||||
|
||||
# Configuring iidxhook
|
||||
|
||||
The hook library can be configured via cmd arguments or a configuration file.
|
||||
The latter is generated (*iidxhook-XX.conf* in the same directory) on the first
|
||||
start of the game using the gamestart-XX.bat file (again, XX matches your target
|
||||
game version). It contains default values for all available parameters and
|
||||
comments explaining each parameter. Please follow the comments when configuring
|
||||
your setup.
|
||||
|
||||
Add the argument *-h* when running gamestart-XX.bat
|
||||
(e.g. *gamestart-XX.bat -h*) to print help/usage information with a list of
|
||||
all available parameters. Every parameter can be either set as command line
|
||||
argument or using a configuration file.
|
||||
|
||||
To set a parameter from the command line, just add it as an argument after
|
||||
the bat file like this
|
||||
```
|
||||
gamestart-09.bat -p gfx.windowed=true -p gfx.framed=true
|
||||
```
|
||||
|
||||
The syntax for the "key=value" is the same as in the config file. Make sure
|
||||
to have a pre-ceeding "-p" for every parameter added.
|
||||
|
||||
However, if a parameter is specifed in the configuration file and as a command
|
||||
line argument, the command line argument overrides the config file's value.
|
||||
|
||||
# Eamuse network setup
|
||||
|
||||
If you want to run the games online, you need a valid PCBID and the service URL.
|
||||
Open *prop/ea3-config.xml* and set the values of the *ea3/id/pcbid* and
|
||||
*ea3/network/services* nodes accordingly.
|
||||
|
||||
Run the game with the gamestart-XX.bat file and enable network on the operator
|
||||
menu. When enabled, the game seems to hang and expects you to power
|
||||
cycle the machine (i.e. quit the game and restart it).
|
||||
|
||||
# Real hardware support
|
||||
|
||||
## The game does not go into either 640x480 (SD) or 1280x720 (HD) as expected but rather picks a resolution like 1386x768
|
||||
The graphics backend of the game is auto detecting the resolution and refresh
|
||||
rate based on the supported specs reported by the monitor. Depending on that
|
||||
output, this can lead to the game picking some "odd" resolution like 1386x768
|
||||
even the game is set to HD mode (expecting 1280x720).
|
||||
|
||||
Furthermore, this can lead to different refresh rate values on the automatic
|
||||
monitor check, e.g. compared to previous versions (59.94 on Rootage but 60.02
|
||||
on Heroic Verse). Ultimately, the result can be a very offsync gameplay
|
||||
experience with extremely delayed input.
|
||||
|
||||
If that happens, try forcing the resolution to `1280x720` when the game is
|
||||
set to HD mode in the operator menu. Note: Your monitor must also be capable
|
||||
of handling the resolution.
|
||||
|
||||
iidxhook.conf:
|
||||
```text
|
||||
gfx.force_screen_res.width=1280
|
||||
gfx.force_screen_res.height=720
|
||||
```
|
||||
|
||||
## The monitor check is showing high fps and I am using a monitor with high refresh rate features, e.g. 120/144hz
|
||||
Sync and timing might be screwed up since the game was never meant to run on
|
||||
such refresh rates. Try setting the option `gfx.forced_refresh_rate` to either
|
||||
`59` or `60`.
|
||||
|
||||
Note: Your GPU driver settings must be configured to allow application overrides
|
||||
on vertical sync/refresh rate options.
|
||||
|
||||
On AMD GPUs, set the "V-Sync" option to `On, unless application specifies`.
|
||||
|
||||
### BIO2 hardware
|
||||
|
||||
Set `io.disable_bio2_emu=true` in the `iidxhook.conf` file to not hook the BIO2
|
||||
communication with an emulation layer. The game will directly talk to the IO.
|
||||
In this mode, the game supports the BIO2 board only.
|
||||
|
||||
## Driver notes
|
||||
You can use the default driver that Windows (7/10) automatically installs once
|
||||
you connect the BIO2 board via USB to your host. However, these drivers will
|
||||
not allow the game to detect the board correctly, throwing an IO error.
|
||||
The drivers will work fine when using the iidxio API implementation
|
||||
[iidxio-bio2](iidxio-bio2.md).
|
||||
|
||||
If you want to use the BIO2 with the game without the emulation layer, as
|
||||
suggested above, you need to install Konami's original driver which is
|
||||
identical to the stock Windows driver except the device name is different
|
||||
(which is the crucial part for the stock game's automatic detection).
|
||||
|
||||
The driver is available in the bemanitools-supplement repository.
|
||||
|
||||
### Ezusb and other
|
||||
|
||||
Set `io.disable_bio2_emu=false` in the `iidxhook.conf` file.
|
||||
Use the specific iidxio API implementations, e.g. `iidxio-ezusb2.dll` to use
|
||||
the IO2 EZUSB board. The common `iidxio` abstraction layer also allows you to
|
||||
use custom IO boards or whatever Konami hardware is going to be available in
|
||||
the future. Obviously, someone has to write an imlementation of the `iidxio`
|
||||
API, first.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
You have the following options:
|
||||
* Set `io.disable_card_reader_emu=true` in the `iidxhook.conf` file to not hook
|
||||
card reader communication with an emulation layer. The game will directly talk
|
||||
to the real readers though this only supports whatever readers the game
|
||||
directly supports (wave pass readers)
|
||||
* Set `io.disable_card_reader_emu=false` in the `iidxhook.conf` file.
|
||||
Replace the default `eamio.dll` with the `eamio-icca.dll` and have either your
|
||||
slotted (IIDX, DDR Supernova or GF/DM type) or new wave pass card readers
|
||||
conencted and and assigned to `COM1`. Other custom implementations of of the
|
||||
`eamio` API also work.
|
||||
|
||||
### ICCA device settings (device manager)
|
||||
* Port: COM1
|
||||
* BAUD rate: 57600
|
||||
* Data bits: 8
|
||||
* Parity: None
|
||||
* Stop bits: 1
|
||||
* Flow control: None
|
||||
|
||||
If you encounter issues after the game opened the device, e.g. application
|
||||
stuck, try a USB <-> COM dongle instead of using one of the COM ports of the
|
||||
mainboard.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
## The turntable input feels laggy/delayed with my BIO2 + sub IO
|
||||
See the [this readme](hardware/bio2-sub-io-turntable-bypass-cable.md) for
|
||||
information about the bypass cable.
|
||||
|
||||
## The game does not run "well" (frame drops, drifting offsync etc)
|
||||
This can be related to various issues:
|
||||
* Make sure to run the game as (true) Administrator especially on Windows 7 and
|
||||
newer. This will also get rid of various other errors (see below) that are
|
||||
related to permission issues.
|
||||
* Run the game's process with a higher priority:
|
||||
```
|
||||
start "" /relatime "gamestart.bat"
|
||||
```
|
||||
* Enforce v-sync enabled in your GPU settings.
|
||||
* Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx)
|
||||
that is not jumping around. Use the timebase feature of one of the newer games to
|
||||
check that or enable iidxhook's timebase and check the log output for the
|
||||
determined value. Run this a few times and check if the results differ.
|
||||
|
||||
## "NETWORK WARNING" instead of "NETWORK OK"
|
||||
This can be caused by:
|
||||
* Invalid PCBID
|
||||
* Firewall blocking connections
|
||||
* Invalid eamuse url or port specified
|
||||
* Game is not run using the Administrator account
|
||||
Make sure to check these things first
|
||||
|
||||
## My songs are offsync
|
||||
From IIDX 20 (or Lincle very final revision) onwards, the game comes with
|
||||
a built-in auto timebase option ("monitor check" on startup) which
|
||||
dynamically, detects the refresh rate of your current setup. Thus, BT5's
|
||||
timebase option is not included from this hook version onwards, anymore.
|
||||
Ensure that refresh rate displayed is very stable, e.g. 60.00x hz, and the
|
||||
game should be able to provide you with a smooth and sync game experience.
|
||||
|
||||
## My game runs too fast
|
||||
iidxhook can limit the frame rate for you (refer to help/config file)
|
||||
|
||||
## My game crashes when I try fullscreen
|
||||
Use dxwnd and set settings like "Acquire admin caps" and "Fullscreen only"
|
||||
|
||||
## Background videos aren't working. When starting a song, windows is playing the error sound and a message box appears
|
||||
You are missing a codec to decode and play the videos. There are different
|
||||
methods available to get background videos working. Probably, the easiest
|
||||
solution: grab the CLVSD.ax file and go to Start -> Run -> regsvr32 clvsd.ax
|
||||
Make sure to run cmd.exe as Administrator, otherwise you will get errors caused
|
||||
by invalid permissions.
|
||||
|
||||
## I installed the CLVSD.ax codec but the game crashes or displays a message box that tells me to disable my debugger
|
||||
If songs keep crashing upon start and you get an error message that says
|
||||
```
|
||||
DirectShow Texture3D Sample
|
||||
Could not create source filter to graph! hr=0x80040266
|
||||
```
|
||||
despite having the codec (CLVSD.ax) installed, remove the debug flag (*-D*)
|
||||
from gamestart or use a CLVSD.ax codec which has the debugger checks removed.
|
||||
21
doc/iidxhook/iidxio-bio2.md
Normal file
21
doc/iidxhook/iidxio-bio2.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# IIDXIO API implementation with BIO2 driver
|
||||
This implementation of BT5's iidxio API allows you to use native BIO2 hardware with anything that
|
||||
supports BT5's iidxio API, e.g. all iidxhooks of BT5. Thus, you can play your favorite old IIDX
|
||||
games with the latest generation of hardware.5.
|
||||
|
||||
## Setup
|
||||
* Have `iidxio-bio2.dll` in the same folder as your `iidxhookX.dll`
|
||||
* Rename `iidxio-bio2.dll` to `iidxio.dll`
|
||||
* Ensure that your `gamestart.bat` actually injects the appropriate iidxhook dll, for example:
|
||||
```bat
|
||||
inject iidxhook3.dll bm2dx.exe ...*
|
||||
```
|
||||
or
|
||||
```bat
|
||||
launcher -K iidxhook4.dll bm2dx.dll ...*
|
||||
```
|
||||
* This assumes that the BIO2 is already flashed to the correct firmware. The firmware perists once
|
||||
flashed and does not need to be re-flashed after a power cycle.
|
||||
|
||||
## Driver notes
|
||||
See [here](iidxhook9.md#driver-notes).
|
||||
13
doc/jbhook/jbio-magicbox.md
Normal file
13
doc/jbhook/jbio-magicbox.md
Normal file
@@ -0,0 +1,13 @@
|
||||
This library talks to a MagicBox cab's IO and implements the jbio API of BT5.
|
||||
Thus, it allows you to use a MagicBox cab with *any* version of jubeat that is supported by BT5.
|
||||
|
||||
# Setup
|
||||
* Rename `jbio-magicbox.dll` to `jbio.dll`.
|
||||
* Make sure `jbio.dll` is in the same folder as both `jbhook.dll` and `jubeat.dll`
|
||||
* Make sure that you have a copy of the `ch341dll.dll` that comes with MagicBox.
|
||||
* Ensure that your `gamestart.bat` actually injects the appropriate jbhook dll
|
||||
for example:
|
||||
```
|
||||
launcher -K jbhook.dll jubeat.dll ...*
|
||||
```
|
||||
or that the application otherwise uses `jbio.dll`
|
||||
18
doc/sdvxhook/sdvxio-bio2.md
Normal file
18
doc/sdvxhook/sdvxio-bio2.md
Normal file
@@ -0,0 +1,18 @@
|
||||
This library talks to a BIO2 BI2A node and implements the sdvxio API of BT5.
|
||||
Thus, it allows you to use a BIO2 SDVX device board with *any* version of SDVX that is supported by BT5.
|
||||
|
||||
# Setup
|
||||
* Make sure that your BIO2 is flashed with a SDVX firmware (if you can boot SDVX5 with it, it's already the right firmware)
|
||||
* The firmware persists between boots, so as long as it's flashed to the correct firmware, you no longer need to do this step
|
||||
* Rename sdvxio-kfca.dll to sdvxio.dll.
|
||||
* Ensure that your gamestart.bat actually injects the appropriate sdvxhook dll
|
||||
for example:
|
||||
```
|
||||
launcher -K sdvxhook.dll soundvoltex.dll ...*
|
||||
```
|
||||
or that the application otherwise uses sdvxio.dll
|
||||
|
||||
* sdvxio-bio2 implements BIO2 device autodetection
|
||||
* if this fails please make a bug report, and set the port manually in the config
|
||||
* You can change the port and baudrate by editing the sdvxio-bio2.conf that should be created by default
|
||||
* Please connect any additional acio devices to their own port (ex: SDVX5 expects an ICCA by itself on COM2)
|
||||
38
doc/tools/README.md
Normal file
38
doc/tools/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Tools
|
||||
Documentation about various additional tooling that is fundamentally not required to run any of
|
||||
BT5's supported games, but provides additional features for users and developers alike.
|
||||
|
||||
## BT5 API
|
||||
Various command line tools for quick and easy testing of BT5 API implementations witohut having
|
||||
to run any target games.
|
||||
|
||||
* [eamiotest](eamiotest.md): `eamio` API
|
||||
* [iidxiotest](iidxiotest.md): `iidxio` API
|
||||
* [jbiotest](jbiotest.md): `jbio` API
|
||||
|
||||
## IO related
|
||||
### ACIO
|
||||
* [aciotest](aciotest.md): Command line tool for quick and easy testing of ACIO devices without
|
||||
having to run a game.
|
||||
|
||||
### Ezusb
|
||||
* [ezusb-iidx-fpga-flash](ezusb-iidx-fpga-flash.md): Tool for flashing the FPGA on ezusb 1 boards.
|
||||
Required if you want to run games without native ezusb support using BT5's iidxio API.
|
||||
* [ezusb-iidx-sram-flash](ezusb-iidx-sram-flash.md): Tool for flashing data to the SRAM of ezusb
|
||||
FX 2 boards. Required if you want to run games without native ezusb FX 2 support using BT5's iidxio
|
||||
API.
|
||||
* [ezusb-tool](ezusb-tool.md): Fundamental tool for flashing the base firmware to ezusb 1/2 boards.
|
||||
Required if you want to run games without native ezusb 1/2 support using BT5's iidxio API.
|
||||
|
||||
### IIDX exit hooks
|
||||
Exit hooks allow you to exit the game using a combination of inputs on native IO hardware.
|
||||
|
||||
Supported IO hardware:
|
||||
* [ezusb](iidx-ezusb-exit-hook.md)
|
||||
* [ezusb 2](iidx-ezusb2-exit-hook.md)
|
||||
* [bio2](iidx-bio2-exit-hook.md)
|
||||
|
||||
## Misc
|
||||
* [mempatch-hook]: Hook library to dynamically apply memory address patches during runtime before
|
||||
your application starts execution. Should be prefered over hardcoded hex-edits if applicable.
|
||||
* [pcbidgen]: Command line tool to generate random PCBIDs
|
||||
17
doc/tools/iidx-bio2-exit-hook.md
Normal file
17
doc/tools/iidx-bio2-exit-hook.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# IIDX BIO2 exit hook
|
||||
A hook library that can be used with BeatmaniaIIDX games that run the BIO2 IO board either natively,
|
||||
e.g. 25+, or using the [iidxio-bio2 backend](../iidxhook/iidx-bio2.md). It allows the player to
|
||||
exit the game by pressing the buttons `Start P1 + Start P2 + VEFX + Effect` simultaneously. This can
|
||||
be useful if you want an option to exit back to your desktop without having a keyboard attached.
|
||||
|
||||
The exit hook lib must be loaded like any other hook lib you are already injecting to the game
|
||||
using either `inject` or `launcher` (depending on the game version). The order for the hook libs is important as they are loaded in the order specified for the inject/launcher call. The entry in the `gamestart.bat` file should look like this for inject:
|
||||
```bat
|
||||
inject iidxhook3.dll -K iidx-bio2-exit-hook.dll bm2dx.exe ...
|
||||
```
|
||||
...and for launcher:
|
||||
```bat
|
||||
launcher -K iidxhook8.dll -K iidx-bio2-exit-hook.dll bm2dx.dll ...
|
||||
```
|
||||
|
||||
Where `iidxhook3.dll` is used for versions 14-15 and `iidxhook8.dll` for versions 25-26.
|
||||
3
doc/tools/jbiotest.md
Normal file
3
doc/tools/jbiotest.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Testing tool for development of jbio libraries used for emulating the main io
|
||||
hardware on bemanitools for jubeat. Just place jbiotest.exe and your
|
||||
custom jbio.dll in the same folder and run jbiotest.exe.
|
||||
13
doc/vigem/README.md
Normal file
13
doc/vigem/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# ViGEm: Virtual Gamepad Emulation Framework
|
||||
Virtual game controller emulation library. Allows us to create in code emulated XBOX controllers.
|
||||
|
||||
This is used to hook up BT5's various IO API libraries allowing you to use any of their
|
||||
implemtations as a game controller on Windows.
|
||||
|
||||
References:
|
||||
* [ViGEmBus](https://github.com/ViGEm/ViGEmBus)
|
||||
* [ViGEmClient](https://github.com/ViGEm/ViGEmClient)
|
||||
|
||||
Available ViGEm client implementations:
|
||||
* [vigem-iidxio](vigem-iidxio.md): Exposes inputs provided by the iidxio API as three XBOX gamepads
|
||||
* [vigem-sdvxio](vigem-sdvxio.md): Exposes inputs provided by the sdvxio API as one XBOX gamepad
|
||||
62
doc/vigem/vigem-iidxio.md
Normal file
62
doc/vigem/vigem-iidxio.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# ViGEm IIDXIO
|
||||
This application allows you to use any iidxio backend, e.g. `iidxio-ezusb.dll`, `iidxio-ezusb2.dll`
|
||||
or `iidxio-bio2.dll`, to be exposed as three XBOX 360 game controller on Windows.
|
||||
|
||||
Thus, it allows you to use a real cabinet with all its IO with *any* game that supports xinput.
|
||||
|
||||
Note: This will not work with games that require Direct Input (dinput), e.g. IIDX Infinitas.
|
||||
|
||||
## Setup
|
||||
* Install [ViGEmBus](https://github.com/ViGEm/ViGEmBus/releases)
|
||||
* Source for compiled binaries: [bemanitools-supplement](https://dev.s-ul.eu/djhackers/bemanitools-supplement)
|
||||
* Place the following in the same folder as `vigem-iidxio.exe`:
|
||||
* Get a copy of [ViGEmClient.dll](https://bin.jvnv.net/file/ZgMJK/ViGEmClient.zip) (or from bemanitools-supplements)
|
||||
* Rename your corresponding `iidxio-XXX.dll`, e.g. `iidxio-bio2.dll`, to `iidxio.dll`.
|
||||
* Run `vigem-iidxio.exe` so that the config file gets created (on first start)
|
||||
* Edit `vigem-iidxio.conf` if needed. Available options are explained in the file
|
||||
|
||||
## Usage
|
||||
* Depending on the iidxio implementation used, you might have to do some setup, e.g. flashing your
|
||||
IO board for [ezusb](../iidxhook/iidxio-ezusb.md#setup) or
|
||||
[ezusb2](../iidxhook/iidxio-ezusb2.md#setup)
|
||||
* Run `vigem-iidxio.exe` and keep it open/running
|
||||
* To quit the program, hit the `TEST` and `SERVICE` buttons at the same time
|
||||
|
||||
## Input mappings
|
||||
| Cabinet | XBOX Gamepad 1 | XBOX Gamepad 2 | XBOX Gamepad 3 |
|
||||
|------------|--------------------|--------------------|--------------------|
|
||||
| P1 Key 1 | A | | |
|
||||
| P1 Key 2 | B | | |
|
||||
| P1 Key 3 | X | | |
|
||||
| P1 Key 4 | Y | | |
|
||||
| P1 Key 5 | Left shoulder | | |
|
||||
| P1 Key 6 | Rights houlder | | |
|
||||
| P1 Key 7 | Start | | |
|
||||
| P2 Key 1 | | A | |
|
||||
| P2 Key 2 | | B | |
|
||||
| P2 Key 3 | | X | |
|
||||
| P2 Key 4 | | Y | |
|
||||
| P2 Key 5 | | Left shoulder | |
|
||||
| P2 Key 6 | | Rights houlder | |
|
||||
| P2 Key 7 | | Start | |
|
||||
| Start P1 | Back | | |
|
||||
| Start P2 | | Back | |
|
||||
| VEFX | | | B |
|
||||
| Effect | | | A |
|
||||
| Test | | | X |
|
||||
| Service | | | Y |
|
||||
| Coin | | | Start |
|
||||
| TT P1 Up | Thumbstick X axis+ | | |
|
||||
| TT P1 Down | Thumbstick X axis- | | |
|
||||
| TT P2 Up | | Thumbstick X axis+ | |
|
||||
| TT P2 Down | | Thumbstick X axis- | |
|
||||
|
||||
Turntables are either in absolute or relative mode depending on how it's defined in the
|
||||
`vigem-iidxio.conf`.
|
||||
|
||||
## Additional Notes For Cabinets (Running on embedded Windows 7):
|
||||
* Make sure that you follow the instructions exactly from the release page
|
||||
([Prerequisites for Windows 7](https://github.com/ViGEm/ViGEmBus/wiki/Prerequisites-for-Windows-7))
|
||||
* If you get an error while trying to install KB3033929, re-enable windows update
|
||||
* Make sure to ewfmgr C: -commit and reboot after installing the drivers (this only needs to be
|
||||
done once)
|
||||
24
doc/vigem/vigem-sdvxio.md
Normal file
24
doc/vigem/vigem-sdvxio.md
Normal file
@@ -0,0 +1,24 @@
|
||||
This application allows you to use any sdvxio backend, e.g. `sdvxio-kfca.dll`, to be available as a XBOX 360 game controller on windows.
|
||||
Thus, it allows you to use a real cab with *any* game that supports xinput.
|
||||
|
||||
# Setup
|
||||
* Install [ViGEmBus](https://github.com/ViGEm/ViGEmBus/releases)
|
||||
* Place the following in the same folder as vigem-sdvxio:
|
||||
* Get a copy of [ViGEmClient.dll](https://bin.jvnv.net/file/ZgMJK/ViGEmClient.zip) (or from bemanitools-supplements)
|
||||
* Rename your corresponding `sdvxio-XXX.dll`, e.g. `sdvxio-kfca.dll`, to `sdvxio.dll`.
|
||||
* Run `vigem-sdvxio.exe` so that the config file gets created
|
||||
* Edit `vigem-sdvxio.conf` so that the config file gets created as needed
|
||||
|
||||
# Usage
|
||||
* Run `vigem-sdvxio.exe`
|
||||
* To quit the program, hit the TEST + SERVICE button at the same time
|
||||
|
||||
# Mapping
|
||||
* BT ABCD are mapped to ABXY
|
||||
* FX LR are mapped to LB/RB
|
||||
* VOL LR are mapped to L thumbstick X/Y (either in absolute or relative mode depending on the config)
|
||||
|
||||
# Additional Notes For Cabinets (Running on embedded Windows 7):
|
||||
* Make sure that you follow the instructions exactly from the release page ([Prerequisites for Windows 7](https://github.com/ViGEm/ViGEmBus/wiki/Prerequisites-for-Windows-7))
|
||||
* If you get an error while trying to install KB3033929, re-enable windows update
|
||||
* Make sure to ewfmgr C: -commit and reboot after installing the drivers (this only needs to be done once)
|
||||
519
src/imports/ViGEm/Client.h
Normal file
519
src/imports/ViGEm/Client.h
Normal file
@@ -0,0 +1,519 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2019 Nefarius Software Solutions e.U. and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ViGEmClient_h__
|
||||
#define ViGEmClient_h__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ViGEm/Common.h"
|
||||
|
||||
#ifdef VIGEM_DYNAMIC
|
||||
#ifdef VIGEM_EXPORTS
|
||||
#define VIGEM_API __declspec(dllexport)
|
||||
#else
|
||||
#define VIGEM_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define VIGEM_API
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \typedef enum _VIGEM_ERRORS
|
||||
*
|
||||
* \brief Defines an alias representing the ViGEm errors.
|
||||
*/
|
||||
typedef enum _VIGEM_ERRORS {
|
||||
VIGEM_ERROR_NONE = 0x20000000,
|
||||
VIGEM_ERROR_BUS_NOT_FOUND = 0xE0000001,
|
||||
VIGEM_ERROR_NO_FREE_SLOT = 0xE0000002,
|
||||
VIGEM_ERROR_INVALID_TARGET = 0xE0000003,
|
||||
VIGEM_ERROR_REMOVAL_FAILED = 0xE0000004,
|
||||
VIGEM_ERROR_ALREADY_CONNECTED = 0xE0000005,
|
||||
VIGEM_ERROR_TARGET_UNINITIALIZED = 0xE0000006,
|
||||
VIGEM_ERROR_TARGET_NOT_PLUGGED_IN = 0xE0000007,
|
||||
VIGEM_ERROR_BUS_VERSION_MISMATCH = 0xE0000008,
|
||||
VIGEM_ERROR_BUS_ACCESS_FAILED = 0xE0000009,
|
||||
VIGEM_ERROR_CALLBACK_ALREADY_REGISTERED = 0xE0000010,
|
||||
VIGEM_ERROR_CALLBACK_NOT_FOUND = 0xE0000011,
|
||||
VIGEM_ERROR_BUS_ALREADY_CONNECTED = 0xE0000012,
|
||||
VIGEM_ERROR_BUS_INVALID_HANDLE = 0xE0000013,
|
||||
VIGEM_ERROR_XUSB_USERINDEX_OUT_OF_RANGE = 0xE0000014,
|
||||
VIGEM_ERROR_INVALID_PARAMETER = 0xE0000015
|
||||
|
||||
} VIGEM_ERROR;
|
||||
|
||||
/**
|
||||
* \def VIGEM_SUCCESS(_val_) (_val_ == VIGEM_ERROR_NONE);
|
||||
*
|
||||
* \brief A macro that defines success.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param _val_ The VIGEM_ERROR value.
|
||||
*/
|
||||
#define VIGEM_SUCCESS(_val_) (_val_ == VIGEM_ERROR_NONE)
|
||||
|
||||
/**
|
||||
* \typedef struct _VIGEM_CLIENT_T *PVIGEM_CLIENT
|
||||
*
|
||||
* \brief Defines an alias representing a driver connection object.
|
||||
*/
|
||||
typedef struct _VIGEM_CLIENT_T *PVIGEM_CLIENT;
|
||||
|
||||
/**
|
||||
* \typedef struct _VIGEM_TARGET_T *PVIGEM_TARGET
|
||||
*
|
||||
* \brief Defines an alias representing a target device object.
|
||||
*/
|
||||
typedef struct _VIGEM_TARGET_T *PVIGEM_TARGET;
|
||||
|
||||
typedef _Function_class_(EVT_VIGEM_TARGET_ADD_RESULT) VOID CALLBACK
|
||||
EVT_VIGEM_TARGET_ADD_RESULT(
|
||||
PVIGEM_CLIENT Client, PVIGEM_TARGET Target, VIGEM_ERROR Result);
|
||||
|
||||
typedef EVT_VIGEM_TARGET_ADD_RESULT *PFN_VIGEM_TARGET_ADD_RESULT;
|
||||
|
||||
typedef _Function_class_(EVT_VIGEM_X360_NOTIFICATION) VOID CALLBACK
|
||||
EVT_VIGEM_X360_NOTIFICATION(
|
||||
PVIGEM_CLIENT Client,
|
||||
PVIGEM_TARGET Target,
|
||||
UCHAR LargeMotor,
|
||||
UCHAR SmallMotor,
|
||||
UCHAR LedNumber,
|
||||
LPVOID UserData);
|
||||
|
||||
typedef EVT_VIGEM_X360_NOTIFICATION *PFN_VIGEM_X360_NOTIFICATION;
|
||||
|
||||
typedef _Function_class_(EVT_VIGEM_DS4_NOTIFICATION) VOID CALLBACK
|
||||
EVT_VIGEM_DS4_NOTIFICATION(
|
||||
PVIGEM_CLIENT Client,
|
||||
PVIGEM_TARGET Target,
|
||||
UCHAR LargeMotor,
|
||||
UCHAR SmallMotor,
|
||||
DS4_LIGHTBAR_COLOR LightbarColor,
|
||||
LPVOID UserData);
|
||||
|
||||
typedef EVT_VIGEM_DS4_NOTIFICATION *PFN_VIGEM_DS4_NOTIFICATION;
|
||||
|
||||
/**
|
||||
* \fn PVIGEM_CLIENT vigem_alloc(void);
|
||||
*
|
||||
* \brief Allocates an object representing a driver connection.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \return A new driver connection object.
|
||||
*/
|
||||
VIGEM_API PVIGEM_CLIENT vigem_alloc(void);
|
||||
|
||||
/**
|
||||
* \fn void vigem_free(PVIGEM_CLIENT vigem);
|
||||
*
|
||||
* \brief Frees up memory used by the driver connection object.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
*/
|
||||
VIGEM_API void vigem_free(PVIGEM_CLIENT vigem);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_connect(PVIGEM_CLIENT vigem);
|
||||
*
|
||||
* \brief Initializes the driver object and establishes a connection to the
|
||||
* emulation bus driver. Returns an error if no compatible bus device has been
|
||||
* found.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_connect(PVIGEM_CLIENT vigem);
|
||||
|
||||
/**
|
||||
* \fn void vigem_disconnect(PVIGEM_CLIENT vigem);
|
||||
*
|
||||
* \brief Disconnects from the bus device and resets the driver object state.
|
||||
* The driver object may be reused again after calling this function. When
|
||||
* called, all targets which may still be connected will be destroyed
|
||||
* automatically. Be aware, that allocated target objects won't be automatically
|
||||
* freed, this has to be taken care of by the caller.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
*/
|
||||
VIGEM_API void vigem_disconnect(PVIGEM_CLIENT vigem);
|
||||
|
||||
/**
|
||||
* \fn PVIGEM_TARGET vigem_target_x360_alloc(void);
|
||||
*
|
||||
* \brief Allocates an object representing an Xbox 360 Controller device.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \return A PVIGEM_TARGET representing an Xbox 360 Controller device.
|
||||
*/
|
||||
VIGEM_API PVIGEM_TARGET vigem_target_x360_alloc(void);
|
||||
|
||||
/**
|
||||
* \fn PVIGEM_TARGET vigem_target_ds4_alloc(void);
|
||||
*
|
||||
* \brief Allocates an object representing a DualShock 4 Controller device.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \return A PVIGEM_TARGET representing a DualShock 4 Controller device.
|
||||
*/
|
||||
VIGEM_API PVIGEM_TARGET vigem_target_ds4_alloc(void);
|
||||
|
||||
/**
|
||||
* \fn void vigem_target_free(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Frees up memory used by the target device object. This does not
|
||||
* automatically remove the associated device from the bus, if present. If the
|
||||
* target device doesn't get removed before this call, the device becomes
|
||||
* orphaned until the owning process is terminated.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*/
|
||||
VIGEM_API void vigem_target_free(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_add(PVIGEM_CLIENT vigem, PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Adds a provided target device to the bus driver, which is equal to a
|
||||
* device plug-in event of a physical hardware device. This function blocks
|
||||
* until the target device is in full operational mode.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR
|
||||
vigem_target_add(PVIGEM_CLIENT vigem, PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_add_async(PVIGEM_CLIENT vigem, PVIGEM_TARGET
|
||||
* target, PVIGEM_TARGET_ADD_RESULT result);
|
||||
*
|
||||
* \brief Adds a provided target device to the bus driver, which is equal to a
|
||||
* device plug-in event of a physical hardware device. This function immediately
|
||||
* returns. An optional callback may be registered which gets called on error or
|
||||
* if the target device has become fully operational.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
* \param result An optional function getting called when the target device
|
||||
* becomes available.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_target_add_async(
|
||||
PVIGEM_CLIENT vigem,
|
||||
PVIGEM_TARGET target,
|
||||
PFN_VIGEM_TARGET_ADD_RESULT result);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_remove(PVIGEM_CLIENT vigem, PVIGEM_TARGET
|
||||
* target);
|
||||
*
|
||||
* \brief Removes a provided target device from the bus driver, which is equal
|
||||
* to a device unplug event of a physical hardware device. The target device
|
||||
* object may be reused after this function is called. If this function is never
|
||||
* called on target device objects, they will be removed from the bus when the
|
||||
* owning process terminates.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR
|
||||
vigem_target_remove(PVIGEM_CLIENT vigem, PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_x360_register_notification(PVIGEM_CLIENT vigem,
|
||||
* PVIGEM_TARGET target, PVIGEM_X360_NOTIFICATION notification);
|
||||
*
|
||||
* \brief Registers a function which gets called, when LED index or vibration
|
||||
* state changes occur on the provided target device. This function fails if the
|
||||
* provided target device isn't fully operational or in an erroneous state.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
* \param notification The notification callback.
|
||||
* \param userData The user data passed to the notification callback.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_target_x360_register_notification(
|
||||
PVIGEM_CLIENT vigem,
|
||||
PVIGEM_TARGET target,
|
||||
PFN_VIGEM_X360_NOTIFICATION notification,
|
||||
LPVOID userData);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_ds4_register_notification(PVIGEM_CLIENT vigem,
|
||||
* PVIGEM_TARGET target, PVIGEM_DS4_NOTIFICATION notification);
|
||||
*
|
||||
* \brief Registers a function which gets called, when LightBar or vibration
|
||||
* state changes occur on the provided target device. This function fails if the
|
||||
* provided target device isn't fully operational or in an erroneous state.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
* \param notification The notification callback.
|
||||
* \param userData The user data passed to the notification callback.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_target_ds4_register_notification(
|
||||
PVIGEM_CLIENT vigem,
|
||||
PVIGEM_TARGET target,
|
||||
PFN_VIGEM_DS4_NOTIFICATION notification,
|
||||
LPVOID userData);
|
||||
|
||||
/**
|
||||
* \fn void vigem_target_x360_unregister_notification(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Removes a previously registered callback function from the provided
|
||||
* target object.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*/
|
||||
VIGEM_API void vigem_target_x360_unregister_notification(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn void vigem_target_ds4_unregister_notification(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Removes a previously registered callback function from the provided
|
||||
* target object.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*/
|
||||
VIGEM_API void vigem_target_ds4_unregister_notification(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn void vigem_target_set_vid(PVIGEM_TARGET target, USHORT vid);
|
||||
*
|
||||
* \brief Overrides the default Vendor ID value with the provided one.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
* \param vid The Vendor ID to set.
|
||||
*/
|
||||
VIGEM_API void vigem_target_set_vid(PVIGEM_TARGET target, USHORT vid);
|
||||
|
||||
/**
|
||||
* \fn void vigem_target_set_pid(PVIGEM_TARGET target, USHORT pid);
|
||||
*
|
||||
* \brief Overrides the default Product ID value with the provided one.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
* \param pid The Product ID to set.
|
||||
*/
|
||||
VIGEM_API void vigem_target_set_pid(PVIGEM_TARGET target, USHORT pid);
|
||||
|
||||
/**
|
||||
* \fn USHORT vigem_target_get_vid(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Returns the Vendor ID of the provided target device object.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return The Vendor ID.
|
||||
*/
|
||||
VIGEM_API USHORT vigem_target_get_vid(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn USHORT vigem_target_get_pid(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Returns the Product ID of the provided target device object.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return The Product ID.
|
||||
*/
|
||||
VIGEM_API USHORT vigem_target_get_pid(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_x360_update(PVIGEM_CLIENT vigem, PVIGEM_TARGET
|
||||
* target, XUSB_REPORT report);
|
||||
*
|
||||
* \brief Sends a state report to the provided target device.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
* \param report The report to send to the target device.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_target_x360_update(
|
||||
PVIGEM_CLIENT vigem, PVIGEM_TARGET target, XUSB_REPORT report);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_ERROR vigem_target_ds4_update(PVIGEM_CLIENT vigem, PVIGEM_TARGET
|
||||
* target, DS4_REPORT report);
|
||||
*
|
||||
* \brief Sends a state report to the provided target device.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
* \param report The report to send to the target device.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_target_ds4_update(
|
||||
PVIGEM_CLIENT vigem, PVIGEM_TARGET target, DS4_REPORT report);
|
||||
|
||||
/**
|
||||
* \fn ULONG vigem_target_get_index(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Returns the internal index (serial number) the bus driver assigned
|
||||
* to the provided target device object. Note that this value is specific to the
|
||||
* inner workings of the bus driver, it does not reflect related values like
|
||||
* player index or device arrival order experienced by other APIs. It may be
|
||||
* used to identify the target device object for its lifetime. This value
|
||||
* becomes invalid once the target device is removed from the bus and may change
|
||||
* on the next addition of the device.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return The internally used index of the target device.
|
||||
*/
|
||||
VIGEM_API ULONG vigem_target_get_index(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_TARGET_TYPE vigem_target_get_type(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Returns the type of the provided target device object.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 28.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return A VIGEM_TARGET_TYPE.
|
||||
*/
|
||||
VIGEM_API VIGEM_TARGET_TYPE vigem_target_get_type(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn BOOL vigem_target_is_attached(PVIGEM_TARGET target);
|
||||
*
|
||||
* \brief Returns TRUE if the provided target device object is currently
|
||||
* attached to the bus, FALSE otherwise.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 30.08.2017
|
||||
*
|
||||
* \param target The target device object.
|
||||
*
|
||||
* \return TRUE if device is attached to the bus, FALSE otherwise.
|
||||
*/
|
||||
VIGEM_API BOOL vigem_target_is_attached(PVIGEM_TARGET target);
|
||||
|
||||
/**
|
||||
* \fn VIGEM_API VIGEM_ERROR vigem_target_x360_get_user_index(PVIGEM_CLIENT
|
||||
* vigem, PVIGEM_TARGET target, PULONG index);
|
||||
*
|
||||
* \brief Returns the user index of the emulated Xenon device. This value
|
||||
* correspondents to the (zero-based) index number representing the player
|
||||
* number via LED present on a physical controller and is compatible to the
|
||||
* dwUserIndex propery of the XInput* APIs.
|
||||
*
|
||||
* \author Benjamin "Nefarius" H<>glinger
|
||||
* \date 10.05.2018
|
||||
*
|
||||
* \param vigem The driver connection object.
|
||||
* \param target The target device object.
|
||||
* \param index The (zero-based) user index of the Xenon device.
|
||||
*
|
||||
* \return A VIGEM_ERROR.
|
||||
*/
|
||||
VIGEM_API VIGEM_ERROR vigem_target_x360_get_user_index(
|
||||
PVIGEM_CLIENT vigem, PVIGEM_TARGET target, PULONG index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ViGEmClient_h__
|
||||
191
src/imports/ViGEm/Common.h
Normal file
191
src/imports/ViGEm/Common.h
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2019 Nefarius Software Solutions e.U. and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// Represents the desired target type for the emulated device.
|
||||
//
|
||||
typedef enum _VIGEM_TARGET_TYPE {
|
||||
//
|
||||
// Microsoft Xbox 360 Controller (wired)
|
||||
//
|
||||
Xbox360Wired = 0,
|
||||
//
|
||||
// Sony DualShock 4 (wired)
|
||||
//
|
||||
DualShock4Wired = 2 // NOTE: 1 skipped on purpose to maintain compatibility
|
||||
|
||||
} VIGEM_TARGET_TYPE,
|
||||
*PVIGEM_TARGET_TYPE;
|
||||
|
||||
//
|
||||
// Possible XUSB report buttons.
|
||||
//
|
||||
typedef enum _XUSB_BUTTON {
|
||||
XUSB_GAMEPAD_DPAD_UP = 0x0001,
|
||||
XUSB_GAMEPAD_DPAD_DOWN = 0x0002,
|
||||
XUSB_GAMEPAD_DPAD_LEFT = 0x0004,
|
||||
XUSB_GAMEPAD_DPAD_RIGHT = 0x0008,
|
||||
XUSB_GAMEPAD_START = 0x0010,
|
||||
XUSB_GAMEPAD_BACK = 0x0020,
|
||||
XUSB_GAMEPAD_LEFT_THUMB = 0x0040,
|
||||
XUSB_GAMEPAD_RIGHT_THUMB = 0x0080,
|
||||
XUSB_GAMEPAD_LEFT_SHOULDER = 0x0100,
|
||||
XUSB_GAMEPAD_RIGHT_SHOULDER = 0x0200,
|
||||
XUSB_GAMEPAD_GUIDE = 0x0400,
|
||||
XUSB_GAMEPAD_A = 0x1000,
|
||||
XUSB_GAMEPAD_B = 0x2000,
|
||||
XUSB_GAMEPAD_X = 0x4000,
|
||||
XUSB_GAMEPAD_Y = 0x8000
|
||||
|
||||
} XUSB_BUTTON,
|
||||
*PXUSB_BUTTON;
|
||||
|
||||
//
|
||||
// Represents an XINPUT_GAMEPAD-compatible report structure.
|
||||
//
|
||||
typedef struct _XUSB_REPORT {
|
||||
USHORT wButtons;
|
||||
BYTE bLeftTrigger;
|
||||
BYTE bRightTrigger;
|
||||
SHORT sThumbLX;
|
||||
SHORT sThumbLY;
|
||||
SHORT sThumbRX;
|
||||
SHORT sThumbRY;
|
||||
|
||||
} XUSB_REPORT, *PXUSB_REPORT;
|
||||
|
||||
//
|
||||
// Initializes a _XUSB_REPORT structure.
|
||||
//
|
||||
VOID FORCEINLINE XUSB_REPORT_INIT(_Out_ PXUSB_REPORT Report)
|
||||
{
|
||||
RtlZeroMemory(Report, sizeof(XUSB_REPORT));
|
||||
}
|
||||
|
||||
//
|
||||
// The color value (RGB) of a DualShock 4 Lightbar
|
||||
//
|
||||
typedef struct _DS4_LIGHTBAR_COLOR {
|
||||
//
|
||||
// Red part of the Lightbar (0-255).
|
||||
//
|
||||
UCHAR Red;
|
||||
|
||||
//
|
||||
// Green part of the Lightbar (0-255).
|
||||
//
|
||||
UCHAR Green;
|
||||
|
||||
//
|
||||
// Blue part of the Lightbar (0-255).
|
||||
//
|
||||
UCHAR Blue;
|
||||
|
||||
} DS4_LIGHTBAR_COLOR, *PDS4_LIGHTBAR_COLOR;
|
||||
|
||||
//
|
||||
// DualShock 4 digital buttons
|
||||
//
|
||||
typedef enum _DS4_BUTTONS {
|
||||
DS4_BUTTON_THUMB_RIGHT = 1 << 15,
|
||||
DS4_BUTTON_THUMB_LEFT = 1 << 14,
|
||||
DS4_BUTTON_OPTIONS = 1 << 13,
|
||||
DS4_BUTTON_SHARE = 1 << 12,
|
||||
DS4_BUTTON_TRIGGER_RIGHT = 1 << 11,
|
||||
DS4_BUTTON_TRIGGER_LEFT = 1 << 10,
|
||||
DS4_BUTTON_SHOULDER_RIGHT = 1 << 9,
|
||||
DS4_BUTTON_SHOULDER_LEFT = 1 << 8,
|
||||
DS4_BUTTON_TRIANGLE = 1 << 7,
|
||||
DS4_BUTTON_CIRCLE = 1 << 6,
|
||||
DS4_BUTTON_CROSS = 1 << 5,
|
||||
DS4_BUTTON_SQUARE = 1 << 4
|
||||
|
||||
} DS4_BUTTONS,
|
||||
*PDS4_BUTTONS;
|
||||
|
||||
//
|
||||
// DualShock 4 special buttons
|
||||
//
|
||||
typedef enum _DS4_SPECIAL_BUTTONS {
|
||||
DS4_SPECIAL_BUTTON_PS = 1 << 0,
|
||||
DS4_SPECIAL_BUTTON_TOUCHPAD = 1 << 1
|
||||
|
||||
} DS4_SPECIAL_BUTTONS,
|
||||
*PDS4_SPECIAL_BUTTONS;
|
||||
|
||||
//
|
||||
// DualShock 4 directional pad (HAT) values
|
||||
//
|
||||
typedef enum _DS4_DPAD_DIRECTIONS {
|
||||
DS4_BUTTON_DPAD_NONE = 0x8,
|
||||
DS4_BUTTON_DPAD_NORTHWEST = 0x7,
|
||||
DS4_BUTTON_DPAD_WEST = 0x6,
|
||||
DS4_BUTTON_DPAD_SOUTHWEST = 0x5,
|
||||
DS4_BUTTON_DPAD_SOUTH = 0x4,
|
||||
DS4_BUTTON_DPAD_SOUTHEAST = 0x3,
|
||||
DS4_BUTTON_DPAD_EAST = 0x2,
|
||||
DS4_BUTTON_DPAD_NORTHEAST = 0x1,
|
||||
DS4_BUTTON_DPAD_NORTH = 0x0
|
||||
|
||||
} DS4_DPAD_DIRECTIONS,
|
||||
*PDS4_DPAD_DIRECTIONS;
|
||||
|
||||
//
|
||||
// DualShock 4 HID Input report
|
||||
//
|
||||
typedef struct _DS4_REPORT {
|
||||
BYTE bThumbLX;
|
||||
BYTE bThumbLY;
|
||||
BYTE bThumbRX;
|
||||
BYTE bThumbRY;
|
||||
USHORT wButtons;
|
||||
BYTE bSpecial;
|
||||
BYTE bTriggerL;
|
||||
BYTE bTriggerR;
|
||||
|
||||
} DS4_REPORT, *PDS4_REPORT;
|
||||
|
||||
//
|
||||
// Sets the current state of the D-PAD on a DualShock 4 report.
|
||||
//
|
||||
VOID FORCEINLINE
|
||||
DS4_SET_DPAD(_Out_ PDS4_REPORT Report, _In_ DS4_DPAD_DIRECTIONS Dpad)
|
||||
{
|
||||
Report->wButtons &= ~0xF;
|
||||
Report->wButtons |= (USHORT) Dpad;
|
||||
}
|
||||
|
||||
VOID FORCEINLINE DS4_REPORT_INIT(_Out_ PDS4_REPORT Report)
|
||||
{
|
||||
RtlZeroMemory(Report, sizeof(DS4_REPORT));
|
||||
|
||||
Report->bThumbLX = 0x80;
|
||||
Report->bThumbLY = 0x80;
|
||||
Report->bThumbRX = 0x80;
|
||||
Report->bThumbRY = 0x80;
|
||||
|
||||
DS4_SET_DPAD(Report, DS4_BUTTON_DPAD_NONE);
|
||||
}
|
||||
68
src/imports/ViGEm/Util.h
Normal file
68
src/imports/ViGEm/Util.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
#include "ViGEm/Common.h"
|
||||
#include <limits.h>
|
||||
|
||||
VOID FORCEINLINE
|
||||
XUSB_TO_DS4_REPORT(_Out_ PXUSB_REPORT Input, _Out_ PDS4_REPORT Output)
|
||||
{
|
||||
if (Input->wButtons & XUSB_GAMEPAD_BACK)
|
||||
Output->wButtons |= DS4_BUTTON_SHARE;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_START)
|
||||
Output->wButtons |= DS4_BUTTON_OPTIONS;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_LEFT_THUMB)
|
||||
Output->wButtons |= DS4_BUTTON_THUMB_LEFT;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_RIGHT_THUMB)
|
||||
Output->wButtons |= DS4_BUTTON_THUMB_RIGHT;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_LEFT_SHOULDER)
|
||||
Output->wButtons |= DS4_BUTTON_SHOULDER_LEFT;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_RIGHT_SHOULDER)
|
||||
Output->wButtons |= DS4_BUTTON_SHOULDER_RIGHT;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_GUIDE)
|
||||
Output->bSpecial |= DS4_SPECIAL_BUTTON_PS;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_A)
|
||||
Output->wButtons |= DS4_BUTTON_CROSS;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_B)
|
||||
Output->wButtons |= DS4_BUTTON_CIRCLE;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_X)
|
||||
Output->wButtons |= DS4_BUTTON_SQUARE;
|
||||
if (Input->wButtons & XUSB_GAMEPAD_Y)
|
||||
Output->wButtons |= DS4_BUTTON_TRIANGLE;
|
||||
|
||||
Output->bTriggerL = Input->bLeftTrigger;
|
||||
Output->bTriggerR = Input->bRightTrigger;
|
||||
|
||||
if (Input->bLeftTrigger > 0)
|
||||
Output->wButtons |= DS4_BUTTON_TRIGGER_LEFT;
|
||||
if (Input->bRightTrigger > 0)
|
||||
Output->wButtons |= DS4_BUTTON_TRIGGER_RIGHT;
|
||||
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_UP)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_NORTH);
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_RIGHT)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_EAST);
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_DOWN)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_SOUTH);
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_LEFT)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_WEST);
|
||||
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_UP &&
|
||||
Input->wButtons & XUSB_GAMEPAD_DPAD_RIGHT)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_NORTHEAST);
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_RIGHT &&
|
||||
Input->wButtons & XUSB_GAMEPAD_DPAD_DOWN)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_SOUTHEAST);
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_DOWN &&
|
||||
Input->wButtons & XUSB_GAMEPAD_DPAD_LEFT)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_SOUTHWEST);
|
||||
if (Input->wButtons & XUSB_GAMEPAD_DPAD_LEFT &&
|
||||
Input->wButtons & XUSB_GAMEPAD_DPAD_UP)
|
||||
DS4_SET_DPAD(Output, DS4_BUTTON_DPAD_NORTHWEST);
|
||||
|
||||
Output->bThumbLX = ((Input->sThumbLX + ((USHRT_MAX / 2) + 1)) / 257);
|
||||
Output->bThumbLY = (-(Input->sThumbLY + ((USHRT_MAX / 2) - 1)) / 257);
|
||||
Output->bThumbLY = (Output->bThumbLY == 0) ? 0xFF : Output->bThumbLY;
|
||||
Output->bThumbRX = ((Input->sThumbRX + ((USHRT_MAX / 2) + 1)) / 257);
|
||||
Output->bThumbRY = (-(Input->sThumbRY + ((USHRT_MAX / 2) + 1)) / 257);
|
||||
Output->bThumbRY = (Output->bThumbRY == 0) ? 0xFF : Output->bThumbRY;
|
||||
}
|
||||
399
src/imports/ViGEm/km/BusShared.h
Normal file
399
src/imports/ViGEm/km/BusShared.h
Normal file
@@ -0,0 +1,399 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2019 Nefarius Software Solutions e.U. and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
//
|
||||
// GUID identifying the bus device. Used by client library to detect and
|
||||
// communicate.
|
||||
//
|
||||
// IMPORTANT: make sure to change this value if you fork it or introduce
|
||||
// breaking changes!
|
||||
//
|
||||
// {96E42B22-F5E9-42F8-B043-ED0F932F014F}
|
||||
DEFINE_GUID(
|
||||
GUID_DEVINTERFACE_BUSENUM_VIGEM,
|
||||
0x96E42B22,
|
||||
0xF5E9,
|
||||
0x42F8,
|
||||
0xB0,
|
||||
0x43,
|
||||
0xED,
|
||||
0x0F,
|
||||
0x93,
|
||||
0x2F,
|
||||
0x01,
|
||||
0x4F);
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ViGEm/Common.h"
|
||||
|
||||
//
|
||||
// Common version for user-mode library and driver compatibility
|
||||
//
|
||||
// On initialization, the user-mode library has this number embedded
|
||||
// and sends it to the bus on its enumeration. The bus compares this
|
||||
// number to the one it was compiled with. If they match, the bus
|
||||
// access is permitted and success reported. If they mismatch, an
|
||||
// error is reported and the user-mode library skips this instance.
|
||||
//
|
||||
#define VIGEM_COMMON_VERSION 0x0001
|
||||
|
||||
#define FILE_DEVICE_BUSENUM FILE_DEVICE_BUS_EXTENDER
|
||||
#define BUSENUM_IOCTL(_index_) \
|
||||
CTL_CODE(FILE_DEVICE_BUSENUM, _index_, METHOD_BUFFERED, FILE_READ_DATA)
|
||||
#define BUSENUM_W_IOCTL(_index_) \
|
||||
CTL_CODE(FILE_DEVICE_BUSENUM, _index_, METHOD_BUFFERED, FILE_WRITE_DATA)
|
||||
#define BUSENUM_R_IOCTL(_index_) \
|
||||
CTL_CODE(FILE_DEVICE_BUSENUM, _index_, METHOD_BUFFERED, FILE_READ_DATA)
|
||||
#define BUSENUM_RW_IOCTL(_index_) \
|
||||
CTL_CODE( \
|
||||
FILE_DEVICE_BUSENUM, \
|
||||
_index_, \
|
||||
METHOD_BUFFERED, \
|
||||
FILE_WRITE_DATA | FILE_READ_DATA)
|
||||
|
||||
#define IOCTL_VIGEM_BASE 0x801
|
||||
|
||||
//
|
||||
// IO control codes
|
||||
//
|
||||
#define IOCTL_VIGEM_PLUGIN_TARGET BUSENUM_W_IOCTL(IOCTL_VIGEM_BASE + 0x000)
|
||||
#define IOCTL_VIGEM_UNPLUG_TARGET BUSENUM_W_IOCTL(IOCTL_VIGEM_BASE + 0x001)
|
||||
#define IOCTL_VIGEM_CHECK_VERSION BUSENUM_W_IOCTL(IOCTL_VIGEM_BASE + 0x002)
|
||||
|
||||
#define IOCTL_XUSB_REQUEST_NOTIFICATION \
|
||||
BUSENUM_RW_IOCTL(IOCTL_VIGEM_BASE + 0x200)
|
||||
#define IOCTL_XUSB_SUBMIT_REPORT BUSENUM_W_IOCTL(IOCTL_VIGEM_BASE + 0x201)
|
||||
#define IOCTL_DS4_SUBMIT_REPORT BUSENUM_W_IOCTL(IOCTL_VIGEM_BASE + 0x202)
|
||||
#define IOCTL_DS4_REQUEST_NOTIFICATION BUSENUM_W_IOCTL(IOCTL_VIGEM_BASE + 0x203)
|
||||
//#define IOCTL_XGIP_SUBMIT_REPORT BUSENUM_W_IOCTL (IOCTL_VIGEM_BASE +
|
||||
//0x204) #define IOCTL_XGIP_SUBMIT_INTERRUPT BUSENUM_W_IOCTL
|
||||
//(IOCTL_VIGEM_BASE + 0x205)
|
||||
#define IOCTL_XUSB_GET_USER_INDEX BUSENUM_RW_IOCTL(IOCTL_VIGEM_BASE + 0x206)
|
||||
|
||||
//
|
||||
// Data structure used in PlugIn and UnPlug ioctls
|
||||
//
|
||||
|
||||
#pragma region Plugin
|
||||
|
||||
//
|
||||
// Data structure used in IOCTL_VIGEM_PLUGIN_TARGET requests.
|
||||
//
|
||||
typedef struct _VIGEM_PLUGIN_TARGET {
|
||||
//
|
||||
// sizeof (struct _BUSENUM_HARDWARE)
|
||||
//
|
||||
IN ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
IN ULONG SerialNo;
|
||||
|
||||
//
|
||||
// Type of the target device to emulate.
|
||||
//
|
||||
VIGEM_TARGET_TYPE TargetType;
|
||||
|
||||
//
|
||||
// If set, the vendor ID the emulated device is reporting
|
||||
//
|
||||
USHORT VendorId;
|
||||
|
||||
//
|
||||
// If set, the product ID the emulated device is reporting
|
||||
//
|
||||
USHORT ProductId;
|
||||
|
||||
} VIGEM_PLUGIN_TARGET, *PVIGEM_PLUGIN_TARGET;
|
||||
|
||||
//
|
||||
// Initializes a VIGEM_PLUGIN_TARGET structure.
|
||||
//
|
||||
VOID FORCEINLINE VIGEM_PLUGIN_TARGET_INIT(
|
||||
_Out_ PVIGEM_PLUGIN_TARGET PlugIn,
|
||||
_In_ ULONG SerialNo,
|
||||
_In_ VIGEM_TARGET_TYPE TargetType)
|
||||
{
|
||||
RtlZeroMemory(PlugIn, sizeof(VIGEM_PLUGIN_TARGET));
|
||||
|
||||
PlugIn->Size = sizeof(VIGEM_PLUGIN_TARGET);
|
||||
PlugIn->SerialNo = SerialNo;
|
||||
PlugIn->TargetType = TargetType;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Unplug
|
||||
|
||||
//
|
||||
// Data structure used in IOCTL_VIGEM_UNPLUG_TARGET requests.
|
||||
//
|
||||
typedef struct _VIGEM_UNPLUG_TARGET {
|
||||
//
|
||||
// sizeof (struct _REMOVE_HARDWARE)
|
||||
//
|
||||
IN ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
ULONG SerialNo;
|
||||
|
||||
} VIGEM_UNPLUG_TARGET, *PVIGEM_UNPLUG_TARGET;
|
||||
|
||||
//
|
||||
// Initializes a VIGEM_UNPLUG_TARGET structure.
|
||||
//
|
||||
VOID FORCEINLINE
|
||||
VIGEM_UNPLUG_TARGET_INIT(_Out_ PVIGEM_UNPLUG_TARGET UnPlug, _In_ ULONG SerialNo)
|
||||
{
|
||||
RtlZeroMemory(UnPlug, sizeof(VIGEM_UNPLUG_TARGET));
|
||||
|
||||
UnPlug->Size = sizeof(VIGEM_UNPLUG_TARGET);
|
||||
UnPlug->SerialNo = SerialNo;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Check version
|
||||
|
||||
typedef struct _VIGEM_CHECK_VERSION {
|
||||
IN ULONG Size;
|
||||
|
||||
IN ULONG Version;
|
||||
|
||||
} VIGEM_CHECK_VERSION, *PVIGEM_CHECK_VERSION;
|
||||
|
||||
VOID FORCEINLINE VIGEM_CHECK_VERSION_INIT(
|
||||
_Out_ PVIGEM_CHECK_VERSION CheckVersion, _In_ ULONG Version)
|
||||
{
|
||||
RtlZeroMemory(CheckVersion, sizeof(VIGEM_CHECK_VERSION));
|
||||
|
||||
CheckVersion->Size = sizeof(VIGEM_CHECK_VERSION);
|
||||
CheckVersion->Version = Version;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region XUSB(aka Xbox 360 device) section
|
||||
|
||||
//
|
||||
// Data structure used in IOCTL_XUSB_REQUEST_NOTIFICATION requests.
|
||||
//
|
||||
typedef struct _XUSB_REQUEST_NOTIFICATION {
|
||||
//
|
||||
// sizeof(struct _XUSB_REQUEST_NOTIFICATION)
|
||||
//
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
ULONG SerialNo;
|
||||
|
||||
//
|
||||
// Vibration intensity value of the large motor (0-255).
|
||||
//
|
||||
UCHAR LargeMotor;
|
||||
|
||||
//
|
||||
// Vibration intensity value of the small motor (0-255).
|
||||
//
|
||||
UCHAR SmallMotor;
|
||||
|
||||
//
|
||||
// Index number of the slot/LED that XUSB.sys has assigned.
|
||||
//
|
||||
UCHAR LedNumber;
|
||||
|
||||
} XUSB_REQUEST_NOTIFICATION, *PXUSB_REQUEST_NOTIFICATION;
|
||||
|
||||
//
|
||||
// Initializes a XUSB_REQUEST_NOTIFICATION structure.
|
||||
//
|
||||
VOID FORCEINLINE XUSB_REQUEST_NOTIFICATION_INIT(
|
||||
_Out_ PXUSB_REQUEST_NOTIFICATION Request, _In_ ULONG SerialNo)
|
||||
{
|
||||
RtlZeroMemory(Request, sizeof(XUSB_REQUEST_NOTIFICATION));
|
||||
|
||||
Request->Size = sizeof(XUSB_REQUEST_NOTIFICATION);
|
||||
Request->SerialNo = SerialNo;
|
||||
}
|
||||
|
||||
//
|
||||
// Data structure used in IOCTL_XUSB_SUBMIT_REPORT requests.
|
||||
//
|
||||
typedef struct _XUSB_SUBMIT_REPORT {
|
||||
//
|
||||
// sizeof(struct _XUSB_SUBMIT_REPORT)
|
||||
//
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
ULONG SerialNo;
|
||||
|
||||
//
|
||||
// Report to submit to the target device.
|
||||
//
|
||||
XUSB_REPORT Report;
|
||||
|
||||
} XUSB_SUBMIT_REPORT, *PXUSB_SUBMIT_REPORT;
|
||||
|
||||
//
|
||||
// Initializes an XUSB report.
|
||||
//
|
||||
VOID FORCEINLINE
|
||||
XUSB_SUBMIT_REPORT_INIT(_Out_ PXUSB_SUBMIT_REPORT Report, _In_ ULONG SerialNo)
|
||||
{
|
||||
RtlZeroMemory(Report, sizeof(XUSB_SUBMIT_REPORT));
|
||||
|
||||
Report->Size = sizeof(XUSB_SUBMIT_REPORT);
|
||||
Report->SerialNo = SerialNo;
|
||||
}
|
||||
|
||||
typedef struct _XUSB_GET_USER_INDEX {
|
||||
//
|
||||
// sizeof(struct _XUSB_GET_USER_INDEX)
|
||||
//
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
ULONG SerialNo;
|
||||
|
||||
//
|
||||
// User index of target device.
|
||||
//
|
||||
OUT ULONG UserIndex;
|
||||
|
||||
} XUSB_GET_USER_INDEX, *PXUSB_GET_USER_INDEX;
|
||||
|
||||
//
|
||||
// Initializes XUSB_GET_USER_INDEX structure.
|
||||
//
|
||||
VOID FORCEINLINE XUSB_GET_USER_INDEX_INIT(
|
||||
_Out_ PXUSB_GET_USER_INDEX GetRequest, _In_ ULONG SerialNo)
|
||||
{
|
||||
RtlZeroMemory(GetRequest, sizeof(XUSB_GET_USER_INDEX));
|
||||
|
||||
GetRequest->Size = sizeof(XUSB_GET_USER_INDEX);
|
||||
GetRequest->SerialNo = SerialNo;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region DualShock 4 section
|
||||
|
||||
typedef struct _DS4_OUTPUT_REPORT {
|
||||
//
|
||||
// Vibration intensity value of the small motor (0-255).
|
||||
//
|
||||
UCHAR SmallMotor;
|
||||
|
||||
//
|
||||
// Vibration intensity value of the large motor (0-255).
|
||||
//
|
||||
UCHAR LargeMotor;
|
||||
|
||||
//
|
||||
// Color values of the Lightbar.
|
||||
//
|
||||
DS4_LIGHTBAR_COLOR LightbarColor;
|
||||
|
||||
} DS4_OUTPUT_REPORT, *PDS4_OUTPUT_REPORT;
|
||||
|
||||
//
|
||||
// Data structure used in IOCTL_DS4_REQUEST_NOTIFICATION requests.
|
||||
//
|
||||
typedef struct _DS4_REQUEST_NOTIFICATION {
|
||||
//
|
||||
// sizeof(struct _XUSB_REQUEST_NOTIFICATION)
|
||||
//
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
ULONG SerialNo;
|
||||
|
||||
//
|
||||
// The HID output report
|
||||
//
|
||||
DS4_OUTPUT_REPORT Report;
|
||||
|
||||
} DS4_REQUEST_NOTIFICATION, *PDS4_REQUEST_NOTIFICATION;
|
||||
|
||||
//
|
||||
// Initializes a DS4_REQUEST_NOTIFICATION structure.
|
||||
//
|
||||
VOID FORCEINLINE DS4_REQUEST_NOTIFICATION_INIT(
|
||||
_Out_ PDS4_REQUEST_NOTIFICATION Request, _In_ ULONG SerialNo)
|
||||
{
|
||||
RtlZeroMemory(Request, sizeof(DS4_REQUEST_NOTIFICATION));
|
||||
|
||||
Request->Size = sizeof(DS4_REQUEST_NOTIFICATION);
|
||||
Request->SerialNo = SerialNo;
|
||||
}
|
||||
|
||||
//
|
||||
// DualShock 4 request data
|
||||
//
|
||||
typedef struct _DS4_SUBMIT_REPORT {
|
||||
//
|
||||
// sizeof(struct _DS4_SUBMIT_REPORT)
|
||||
//
|
||||
ULONG Size;
|
||||
|
||||
//
|
||||
// Serial number of target device.
|
||||
//
|
||||
ULONG SerialNo;
|
||||
|
||||
//
|
||||
// HID Input report
|
||||
//
|
||||
DS4_REPORT Report;
|
||||
|
||||
} DS4_SUBMIT_REPORT, *PDS4_SUBMIT_REPORT;
|
||||
|
||||
//
|
||||
// Initializes a DualShock 4 report.
|
||||
//
|
||||
VOID FORCEINLINE
|
||||
DS4_SUBMIT_REPORT_INIT(_Out_ PDS4_SUBMIT_REPORT Report, _In_ ULONG SerialNo)
|
||||
{
|
||||
RtlZeroMemory(Report, sizeof(DS4_SUBMIT_REPORT));
|
||||
|
||||
Report->Size = sizeof(DS4_SUBMIT_REPORT);
|
||||
Report->SerialNo = SerialNo;
|
||||
|
||||
DS4_REPORT_INIT(&Report->Report);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -36,7 +36,8 @@ enum property_type {
|
||||
PROPERTY_TYPE_S64 = 8,
|
||||
PROPERTY_TYPE_U64 = 9,
|
||||
PROPERTY_TYPE_BIN = 10,
|
||||
PROPERTY_TYPE_STR = 11
|
||||
PROPERTY_TYPE_STR = 11,
|
||||
PROPERTY_TYPE_BOOL = 52
|
||||
};
|
||||
|
||||
struct property;
|
||||
@@ -57,8 +58,6 @@ enum psmap_type {
|
||||
PSMAP_TYPE_S64 = 8,
|
||||
PSMAP_TYPE_U64 = 9,
|
||||
PSMAP_TYPE_STR = 10,
|
||||
/* Used on avs 803 instead of value 10 */
|
||||
PSMAP_TYPE_STR_LEGACY = 11,
|
||||
PSMAP_TYPE_ATTR = 45,
|
||||
PSMAP_TYPE_BOOL = 50,
|
||||
};
|
||||
@@ -230,4 +229,6 @@ int avs_fs_addfs(void *filesys_struct);
|
||||
int avs_fs_mount(
|
||||
const char *mountpoint, const char *fsroot, const char *fstype, void *data);
|
||||
|
||||
bool avs_is_active();
|
||||
|
||||
#endif
|
||||
|
||||
19
src/imports/ch341.h
Normal file
19
src/imports/ch341.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* This is the header for ch341dll.dll, a library for interfacing with the
|
||||
* CH341 USB to serial/parallel port chip. Magic Box uses this for their
|
||||
* proprietary IO, and it provides access to the panel sensors.
|
||||
*
|
||||
* The full .h for this file is floating around online with many more functions
|
||||
* and comments (in Chinese). Only the bare minimum definitions are provided
|
||||
* here for use in jbio-magicbox
|
||||
*/
|
||||
|
||||
#ifndef IMPORTS_CH341_H
|
||||
#define IMPORTS_CH341_H
|
||||
|
||||
HANDLE WINAPI CH341OpenDevice(ULONG iIndex);
|
||||
VOID WINAPI CH341CloseDevice(ULONG iIndex);
|
||||
BOOL WINAPI CH341EppReadData(ULONG iIndex, PVOID oBuffer, PULONG ioLength);
|
||||
BOOL WINAPI CH341EppSetAddr(ULONG iIndex, UCHAR iAddr);
|
||||
|
||||
#endif
|
||||
27
src/imports/import_32_indep_ViGEmClient.def
Normal file
27
src/imports/import_32_indep_ViGEmClient.def
Normal file
@@ -0,0 +1,27 @@
|
||||
LIBRARY ViGEmClient
|
||||
|
||||
EXPORTS
|
||||
vigem_alloc
|
||||
vigem_connect
|
||||
vigem_disconnect
|
||||
vigem_free
|
||||
vigem_target_add
|
||||
vigem_target_add_async
|
||||
vigem_target_ds4_alloc
|
||||
vigem_target_ds4_register_notification
|
||||
vigem_target_ds4_unregister_notification
|
||||
vigem_target_ds4_update
|
||||
vigem_target_free
|
||||
vigem_target_get_index
|
||||
vigem_target_get_pid
|
||||
vigem_target_get_type
|
||||
vigem_target_get_vid
|
||||
vigem_target_is_attached
|
||||
vigem_target_remove
|
||||
vigem_target_set_pid
|
||||
vigem_target_set_vid
|
||||
vigem_target_x360_alloc
|
||||
vigem_target_x360_get_user_index
|
||||
vigem_target_x360_register_notification
|
||||
vigem_target_x360_unregister_notification
|
||||
vigem_target_x360_update
|
||||
7
src/imports/import_32_indep_ch341.def
Normal file
7
src/imports/import_32_indep_ch341.def
Normal file
@@ -0,0 +1,7 @@
|
||||
LIBRARY ch341dll
|
||||
|
||||
EXPORTS
|
||||
CH341OpenDevice@4=CH341OpenDevice
|
||||
CH341CloseDevice@4=CH341CloseDevice
|
||||
CH341EppReadData@12=CH341EppReadData
|
||||
CH341EppSetAddr@8=CH341EppSetAddr
|
||||
@@ -23,6 +23,7 @@ EXPORTS
|
||||
std_setenv @213 NONAME
|
||||
avs_boot @298 NONAME
|
||||
avs_shutdown @299 NONAME
|
||||
avs_is_active @302 NONAME
|
||||
log_body_fatal @379 NONAME
|
||||
log_body_warning @380 NONAME
|
||||
log_body_info @381 NONAME
|
||||
|
||||
27
src/imports/import_64_indep_ViGEmClient.def
Normal file
27
src/imports/import_64_indep_ViGEmClient.def
Normal file
@@ -0,0 +1,27 @@
|
||||
LIBRARY ViGEmClient
|
||||
|
||||
EXPORTS
|
||||
vigem_alloc
|
||||
vigem_connect
|
||||
vigem_disconnect
|
||||
vigem_free
|
||||
vigem_target_add
|
||||
vigem_target_add_async
|
||||
vigem_target_ds4_alloc
|
||||
vigem_target_ds4_register_notification
|
||||
vigem_target_ds4_unregister_notification
|
||||
vigem_target_ds4_update
|
||||
vigem_target_free
|
||||
vigem_target_get_index
|
||||
vigem_target_get_pid
|
||||
vigem_target_get_type
|
||||
vigem_target_get_vid
|
||||
vigem_target_is_attached
|
||||
vigem_target_remove
|
||||
vigem_target_set_pid
|
||||
vigem_target_set_vid
|
||||
vigem_target_x360_alloc
|
||||
vigem_target_x360_get_user_index
|
||||
vigem_target_x360_register_notification
|
||||
vigem_target_x360_unregister_notification
|
||||
vigem_target_x360_update
|
||||
@@ -36,6 +36,7 @@ enum ac_io_node_type {
|
||||
AC_IO_NODE_TYPE_LED_SPIKE = 0x05010000,
|
||||
AC_IO_NODE_TYPE_KFCA = 0x09060000,
|
||||
AC_IO_NODE_TYPE_BI2A = 0x0d060000,
|
||||
AC_IO_NODE_TYPE_RVOL = 0x09060001,
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -65,6 +66,7 @@ struct ac_io_message {
|
||||
uint8_t raw[0xFF];
|
||||
uint8_t count;
|
||||
uint8_t status;
|
||||
uint8_t param;
|
||||
struct ac_io_version version;
|
||||
|
||||
struct ac_io_icca_misc icca_misc;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef AC_IO_KFCA_H
|
||||
#define AC_IO_KFCA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define AC_IO_CMD_KFCA_POLL 0x0113
|
||||
#define AC_IO_CMD_KFCA_WATCHDOG 0x0120
|
||||
#define AC_IO_CMD_KFCA_AMP_CONTROL 0x0128
|
||||
|
||||
@@ -166,6 +166,7 @@ static int aciodrv_device_receive(uint8_t *buffer, int size)
|
||||
|
||||
#ifdef AC_IO_MSG_LOG
|
||||
aciodrv_device_log_buffer("Recv (1)", recv_buf, recv_size);
|
||||
log_warning("Expected %d got %d", recv_buf[4], recv_size - 6);
|
||||
#endif
|
||||
|
||||
/* recv_size - 1: omit checksum for checksum calc */
|
||||
@@ -321,7 +322,11 @@ bool aciodrv_send_and_recv(struct ac_io_message *msg, int resp_size)
|
||||
int send_size = offsetof(struct ac_io_message, cmd.raw) + msg->cmd.nbytes;
|
||||
|
||||
#ifdef AC_IO_MSG_LOG
|
||||
log_info("Beginning send on %d: %04x (%d b)", msg->addr, msg->cmd.code, send_size);
|
||||
log_info(
|
||||
"Beginning send on %d: %04x (%d b)",
|
||||
msg->addr,
|
||||
msg->cmd.code,
|
||||
send_size);
|
||||
#endif
|
||||
if (aciodrv_device_send((uint8_t *) msg, send_size) <= 0) {
|
||||
return false;
|
||||
|
||||
@@ -37,7 +37,12 @@ static bool aciodrv_kfca_watchdog_start(uint8_t node_id)
|
||||
*/
|
||||
}
|
||||
|
||||
static bool aciodrv_kfca_amp(uint8_t node_id)
|
||||
bool aciodrv_kfca_amp(
|
||||
uint8_t node_id,
|
||||
uint8_t primary,
|
||||
uint8_t headphone,
|
||||
uint8_t unused,
|
||||
uint8_t subwoofer)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
@@ -45,12 +50,10 @@ static bool aciodrv_kfca_amp(uint8_t node_id)
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_KFCA_AMP_CONTROL);
|
||||
msg.cmd.nbytes = 4;
|
||||
|
||||
// yes this sets the amp to 100% volume
|
||||
// TODO: expose this to sdvxio instead at some point
|
||||
msg.cmd.raw[0] = 0;
|
||||
msg.cmd.raw[1] = 0;
|
||||
msg.cmd.raw[2] = 0;
|
||||
msg.cmd.raw[3] = 0;
|
||||
msg.cmd.raw[0] = primary;
|
||||
msg.cmd.raw[1] = headphone;
|
||||
msg.cmd.raw[2] = unused;
|
||||
msg.cmd.raw[3] = subwoofer;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
@@ -69,7 +72,7 @@ bool aciodrv_kfca_init(uint8_t node_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!aciodrv_kfca_amp(node_id)) {
|
||||
if (!aciodrv_kfca_amp(node_id, 0, 0, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,4 +30,22 @@ bool aciodrv_kfca_poll(
|
||||
const struct ac_io_kfca_poll_out *pout,
|
||||
struct ac_io_kfca_poll_in *pin);
|
||||
|
||||
/**
|
||||
* Set the KFCA digital amp level
|
||||
*
|
||||
* @param node_id Id of the node to query (0 based).
|
||||
* @param primary primary volume (96-0)
|
||||
* @param headphone headphone volume (96-0)
|
||||
* @param unused unknown volume (96-0) (unused)
|
||||
* @param subwoofer subwoofer volume (96-0)
|
||||
* @return True on success, false on error.
|
||||
* @note Note 96 (or 100?) is lowest volume level, 0 is highest
|
||||
*/
|
||||
bool aciodrv_kfca_amp(
|
||||
uint8_t node_id,
|
||||
uint8_t primary,
|
||||
uint8_t headphone,
|
||||
uint8_t unused,
|
||||
uint8_t subwoofer);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,8 +30,16 @@ void ac_io_emu_init(struct ac_io_emu *emu, const wchar_t *filename)
|
||||
log_assert(emu != NULL);
|
||||
log_assert(filename != NULL);
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
memset(emu, 0, sizeof(*emu));
|
||||
emu->fd = iohook_open_dummy_fd();
|
||||
|
||||
hr = iohook_open_nul_fd(&emu->fd);
|
||||
|
||||
if (hr != S_OK) {
|
||||
log_fatal("Opening nul fd failed: %08lx", hr);
|
||||
}
|
||||
|
||||
emu->wfilename = wstr_dup(filename);
|
||||
wstr_narrow(filename, &emu->filename);
|
||||
ac_io_in_init(&emu->in);
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
exes += aciotest
|
||||
|
||||
libs_aciotest := \
|
||||
bio2drv \
|
||||
aciodrv \
|
||||
util \
|
||||
|
||||
src_aciotest := \
|
||||
icca.c \
|
||||
kfca.c \
|
||||
bi2a-sdvx.c \
|
||||
main.c \
|
||||
|
||||
58
src/main/aciotest/bi2a-sdvx.c
Normal file
58
src/main/aciotest/bi2a-sdvx.c
Normal file
@@ -0,0 +1,58 @@
|
||||
#include "aciotest/bi2a-sdvx.h"
|
||||
|
||||
#include "acio/acio.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bio2drv/bi2a-sdvx.h"
|
||||
|
||||
bool aciotest_bi2a_sdvx_handler_init(uint8_t node_id, void **ctx)
|
||||
{
|
||||
*ctx = malloc(sizeof(uint32_t));
|
||||
*((uint32_t *) *ctx) = 0;
|
||||
|
||||
return bio2drv_bi2a_sdvx_init(node_id);
|
||||
}
|
||||
|
||||
bool aciotest_bi2a_sdvx_handler_update(uint8_t node_id, void *ctx)
|
||||
{
|
||||
struct bi2a_sdvx_state_in pin;
|
||||
struct bi2a_sdvx_state_out pout;
|
||||
|
||||
memset(&pout, 0, sizeof(pout));
|
||||
|
||||
if (!bio2drv_bi2a_sdvx_poll(node_id, &pout, &pin)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
pin.raw[0] = ac_io_u16(pin.raw[0]);
|
||||
pin.raw[1] = ac_io_u16(pin.raw[1]);
|
||||
|
||||
printf(
|
||||
">>> BI2A (SDVX) %d:\n"
|
||||
"BTN A B C D: %d %d %d %d\n"
|
||||
"FX-L R: %d %d\n"
|
||||
"VOL L: %d\n"
|
||||
"VOL R: %d\n"
|
||||
"START COIN TEST SERV REC HP: %d %d %d %d %d %d\n",
|
||||
node_id,
|
||||
pin.buttons_1.b_a,
|
||||
pin.buttons_1.b_b,
|
||||
pin.buttons_1.b_c,
|
||||
pin.buttons_1.b_d,
|
||||
pin.buttons_1.b_fxl,
|
||||
pin.buttons_2.b_fxr,
|
||||
pin.analogs[0].a_val,
|
||||
pin.analogs[1].a_val,
|
||||
pin.buttons_1.b_start,
|
||||
pin.analogs[0].a_coin,
|
||||
pin.analogs[0].a_test,
|
||||
pin.analogs[0].a_service,
|
||||
pin.buttons_1.b_recorder,
|
||||
pin.buttons_1.b_headphone);
|
||||
|
||||
return true;
|
||||
}
|
||||
10
src/main/aciotest/bi2a-sdvx.h
Normal file
10
src/main/aciotest/bi2a-sdvx.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef ACIOTEST_BI2A_SDVX_H
|
||||
#define ACIOTEST_BI2A_SDVX_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
bool aciotest_bi2a_sdvx_handler_init(uint8_t node_id, void **ctx);
|
||||
bool aciotest_bi2a_sdvx_handler_update(uint8_t node_id, void *ctx);
|
||||
|
||||
#endif
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "aciodrv/device.h"
|
||||
|
||||
#include "aciotest/bi2a-sdvx.h"
|
||||
#include "aciotest/handler.h"
|
||||
#include "aciotest/icca.h"
|
||||
#include "aciotest/kfca.h"
|
||||
@@ -13,6 +14,7 @@
|
||||
#include "util/log.h"
|
||||
|
||||
static uint8_t aciotest_cnt = 0;
|
||||
static uint8_t bi2a_mode = 0;
|
||||
|
||||
/**
|
||||
* Enumerate supported ACIO nodes based on their product id.
|
||||
@@ -35,6 +37,17 @@ static bool aciotest_assign_handler(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!memcmp(product, "BI2A", 4)) {
|
||||
if (bi2a_mode == 0) {
|
||||
handler->init = aciotest_bi2a_sdvx_handler_init;
|
||||
handler->update = aciotest_bi2a_sdvx_handler_update;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
printf("Unknown BI2A device specified");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -125,7 +138,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* avoid cpu banging */
|
||||
Sleep(20);
|
||||
Sleep(30);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
#include "util/log.h"
|
||||
|
||||
#define ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY "asio.force_asio"
|
||||
#define ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY "asio.force_wasapi"
|
||||
#define ASIOHOOK_CONFIG_IO_ASIO_DEVICE_NAME_KEY "asio.device_name"
|
||||
|
||||
#define ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE false
|
||||
#define ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE false
|
||||
#define ASIOHOOK_CONFIG_IO_DEFAULT_ASIO_DEVICE_NAME_VALUE \
|
||||
"XONAR SOUND CARD(64)"
|
||||
|
||||
@@ -17,7 +19,13 @@ void asiohook_config_init(struct cconfig *config)
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE,
|
||||
"Force ASIO audio mode/device");
|
||||
"Force ASIO audio mode/device (if applicable)");
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE,
|
||||
"Force WASAPI audio mode (if applicable)");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
@@ -40,6 +48,17 @@ void asiohook_config_asio_get(
|
||||
ASIOHOOK_CONFIG_IO_FORCE_ASIO_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_ASIO_VALUE);
|
||||
}
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY,
|
||||
&config_asio->force_wasapi,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
ASIOHOOK_CONFIG_IO_FORCE_WASAPI_KEY,
|
||||
ASIOHOOK_CONFIG_IO_DEFAULT_FORCE_WASAPI_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
struct asiohook_config_asio {
|
||||
bool force_asio;
|
||||
bool force_wasapi;
|
||||
char replacement_name[128];
|
||||
};
|
||||
|
||||
|
||||
@@ -70,6 +70,19 @@ enum iidx_io_panel_light {
|
||||
IIDX_IO_PANEL_LIGHT_EFFECT = 3,
|
||||
};
|
||||
|
||||
/* Bit mapping for the top lamps from left to right when facing cabinet screen */
|
||||
|
||||
enum iidx_io_top_lamp {
|
||||
IIDX_IO_TOP_LAMP_LEFT_BLUE = 0,
|
||||
IIDX_IO_TOP_LAMP_LEFT_GREEN = 1,
|
||||
IIDX_IO_TOP_LAMP_LEFT_YELLOW = 2,
|
||||
IIDX_IO_TOP_LAMP_LEFT_RED = 3,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_BLUE = 4,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_GREEN = 5,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_YELLOW = 6,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_RED = 7,
|
||||
};
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
@@ -98,4 +98,12 @@ uint16_t sdvx_io_get_input_gpio(uint8_t gpio_bank);
|
||||
|
||||
uint16_t sdvx_io_get_spinner_pos(uint8_t spinner_no);
|
||||
|
||||
/* Sets the volume of the digital amps if possible.
|
||||
Range is between 0-96, where 0 is MAX and 96 is LOW. */
|
||||
|
||||
bool sdvx_io_set_amp_volume(
|
||||
uint8_t primary,
|
||||
uint8_t headphone,
|
||||
uint8_t subwoofer);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
#ifndef IIDXHOOK_BI2A_H
|
||||
#define IIDXHOOK_BI2A_H
|
||||
#ifndef BIO2_BI2A_IIDX
|
||||
#define BIO2_BI2A_IIDX
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "bio2/bio2.h"
|
||||
|
||||
#include "bio2emu/emu.h"
|
||||
enum bi2a_iidx_panel_button {
|
||||
BI2A_IIDX_PANEL_BUTTON_START_P1 = 0,
|
||||
BI2A_IIDX_PANEL_BUTTON_START_P2 = 1,
|
||||
BI2A_IIDX_PANEL_BUTTON_VEFX = 2,
|
||||
BI2A_IIDX_PANEL_BUTTON_EFFECT = 3,
|
||||
};
|
||||
|
||||
enum bio2_iidx_cmd {
|
||||
// Custom Stuff
|
||||
BIO2_BI2A_CMD_UNK_0100 = 0x0100,
|
||||
BIO2_BI2A_CMD_UNK_0120 = 0x0120,
|
||||
BIO2_BI2A_CMD_POLL = 0x0152,
|
||||
enum bi2a_iidx_spotlight_left {
|
||||
BI2A_IIDX_SPOTLIGHT_LEFT_BLUE = 0,
|
||||
BI2A_IIDX_SPOTLIGHT_LEFT_GREEN = 1,
|
||||
BI2A_IIDX_SPOTLIGHT_LEFT_YELLOW = 2,
|
||||
BI2A_IIDX_SPOTLIGHT_LEFT_RED = 3,
|
||||
};
|
||||
|
||||
enum bi2a_iidx_spotlight_right {
|
||||
BI2A_IIDX_SPOTLIGHT_RIGHT_RED = 0,
|
||||
BI2A_IIDX_SPOTLIGHT_RIGHT_YELLOW = 1,
|
||||
BI2A_IIDX_SPOTLIGHT_RIGHT_GREEN = 2,
|
||||
BI2A_IIDX_SPOTLIGHT_RIGHT_BLUE = 3,
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -41,7 +51,7 @@ struct bi2a_iidx_panel {
|
||||
uint8_t y_start1 : 1;
|
||||
};
|
||||
|
||||
struct bi2a_iidx_state_out {
|
||||
struct bi2a_iidx_state_in {
|
||||
struct bi2a_iidx_slider SLIDER1;
|
||||
struct bi2a_iidx_system SYSTEM;
|
||||
struct bi2a_iidx_slider SLIDER2;
|
||||
@@ -50,7 +60,7 @@ struct bi2a_iidx_state_out {
|
||||
uint8_t UNK2;
|
||||
struct bi2a_iidx_slider SLIDER4;
|
||||
struct bi2a_iidx_slider SLIDER5;
|
||||
uint8_t UNK3; // coin mech?
|
||||
uint8_t coins; // coin mech?
|
||||
struct bi2a_iidx_panel PANEL;
|
||||
uint8_t UNK4;
|
||||
uint8_t UNK5;
|
||||
@@ -95,27 +105,25 @@ struct bi2a_iidx_light {
|
||||
uint8_t l_state : 1;
|
||||
};
|
||||
|
||||
struct bi2a_iidx_state_in {
|
||||
struct bi2a_iidx_state_out {
|
||||
struct bi2a_iidx_light UNK1[3];
|
||||
struct bi2a_iidx_light PANEL[4];
|
||||
struct bi2a_iidx_light DECKSW[14];
|
||||
uint8_t UNK2[2];
|
||||
uint8_t SEG16[9];
|
||||
// right
|
||||
struct bi2a_iidx_light SPOTLIGHT1[4];
|
||||
struct bi2a_iidx_light NEONLAMP;
|
||||
// left
|
||||
struct bi2a_iidx_light SPOTLIGHT2[4];
|
||||
uint8_t UNK3[7];
|
||||
};
|
||||
_Static_assert(
|
||||
sizeof(struct bi2a_iidx_state_in) == 48,
|
||||
"bi2a_iidx_state_in is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct bi2a_iidx_state_out) == 46,
|
||||
sizeof(struct bi2a_iidx_state_out) == 48,
|
||||
"bi2a_iidx_state_out is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct bi2a_iidx_state_in) == 46,
|
||||
"bi2a_iidx_state_in is the wrong size");
|
||||
#pragma pack(pop)
|
||||
|
||||
void bio2_emu_bi2a_init(struct bio2emu_port *in, bool disable_poll_limiter);
|
||||
void bio2_emu_bi2a_dispatch_request(
|
||||
struct bio2emu_port *bio2port, const struct ac_io_message *req);
|
||||
|
||||
#endif
|
||||
75
src/main/bio2/bi2a-sdvx.h
Normal file
75
src/main/bio2/bi2a-sdvx.h
Normal file
@@ -0,0 +1,75 @@
|
||||
#ifndef BIO2_BI2A_SDVX
|
||||
#define BIO2_BI2A_SDVX
|
||||
|
||||
#include "bio2/bio2.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct bi2a_sdvx_analog {
|
||||
uint16_t unk1 : 1;
|
||||
uint16_t a_coin : 1;
|
||||
uint16_t a_service : 1;
|
||||
uint16_t a_test : 1;
|
||||
uint16_t unk2 : 2;
|
||||
uint16_t a_val : 10;
|
||||
};
|
||||
|
||||
struct bi2a_sdvx_buttons1 {
|
||||
uint8_t b_fxl : 1;
|
||||
uint8_t b_d : 1;
|
||||
uint8_t b_c : 1;
|
||||
uint8_t b_b : 1;
|
||||
uint8_t b_a : 1;
|
||||
uint8_t b_start : 1;
|
||||
uint8_t b_recorder : 1;
|
||||
uint8_t b_headphone : 1;
|
||||
};
|
||||
|
||||
struct bi2a_sdvx_buttons2 {
|
||||
uint8_t unk : 5;
|
||||
uint8_t b_ex2 : 1;
|
||||
uint8_t b_ex1 : 1;
|
||||
uint8_t b_fxr : 1;
|
||||
};
|
||||
|
||||
struct bi2a_sdvx_state_in {
|
||||
union {
|
||||
uint16_t raw[8];
|
||||
struct {
|
||||
struct bi2a_sdvx_analog analogs[4];
|
||||
uint8_t coins;
|
||||
struct bi2a_sdvx_buttons1 buttons_1;
|
||||
struct bi2a_sdvx_buttons2 buttons_2;
|
||||
uint8_t unk_2[5];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
struct bi2a_sdvx_state_out {
|
||||
uint8_t unk1[2];
|
||||
uint8_t c_block;
|
||||
uint8_t woof_r;
|
||||
uint8_t woof_g;
|
||||
uint8_t unk2;
|
||||
uint8_t woof_b;
|
||||
uint8_t controller[3];
|
||||
uint8_t unk3;
|
||||
uint8_t gpio[7]; // START, ABCD, FXL, FXR
|
||||
uint8_t unk4[3];
|
||||
uint8_t generator[3];
|
||||
uint8_t unk5[3];
|
||||
uint8_t gpio2[3]; // pop, titleL, titleR
|
||||
uint8_t unk6;
|
||||
uint8_t wingUpper[3];
|
||||
uint8_t wingLower[3];
|
||||
uint8_t unk7[3];
|
||||
};
|
||||
|
||||
_Static_assert(
|
||||
sizeof(struct bi2a_sdvx_state_in) == 16,
|
||||
"bi2a_sdvx_state_in is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct bi2a_sdvx_state_out) == 40,
|
||||
"bi2a_sdvx_state_out is the wrong size");
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
16
src/main/bio2/bio2.h
Normal file
16
src/main/bio2/bio2.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef BIO2_BIO2
|
||||
#define BIO2_BIO2
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
enum bio2_bi2a_cmd {
|
||||
// Same as AC_IO_CMD_CLEAR but called differently
|
||||
// with a parameter required to initialize the IO correctly
|
||||
BIO2_BI2A_CMD_INIT = 0x0100,
|
||||
BIO2_BI2A_CMD_WATCHDOG = 0x0120,
|
||||
BIO2_BI2A_CMD_POLL = 0x0152, // For IIDX
|
||||
};
|
||||
|
||||
#endif
|
||||
10
src/main/bio2drv/Module.mk
Normal file
10
src/main/bio2drv/Module.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
libs += bio2drv
|
||||
|
||||
libs_bio2drv := \
|
||||
aciodrv
|
||||
|
||||
src_bio2drv := \
|
||||
detect.c \
|
||||
config-bio2.c \
|
||||
bi2a-iidx.c \
|
||||
bi2a-sdvx.c
|
||||
106
src/main/bio2drv/bi2a-iidx.c
Normal file
106
src/main/bio2drv/bi2a-iidx.c
Normal file
@@ -0,0 +1,106 @@
|
||||
#define LOG_MODULE "bio2drv-bi2a_iidx"
|
||||
|
||||
#include "bio2drv/bi2a-iidx.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "aciodrv/device.h"
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
// Must be provided on init command. Actual meaning unknown right now.
|
||||
// Not providing this will not initialize the IO correctly resulting
|
||||
// in all inputs and outputs (over sub IO) other than 14 keys to not work.
|
||||
static const uint8_t _BIO2DR_BI2A_IIDX_INIT_DATA = 0x2D;
|
||||
|
||||
static bool bio2drv_bi2a_iidx_init_io(uint8_t node_id)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(BIO2_BI2A_CMD_INIT);
|
||||
msg.cmd.nbytes = 1;
|
||||
msg.cmd.param = _BIO2DR_BI2A_IIDX_INIT_DATA;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
log_warning("Init node failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_warning("Init of node %d, status: %d", node_id, msg.cmd.status);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool bio2drv_bi2a_iidx_watchdog_start(uint8_t node_id)
|
||||
{
|
||||
// exit early and don't actually call watchdog
|
||||
// the watchdog call actually returns different sized packets depending on
|
||||
// the state this results in an issue during packet processing (see: #68)
|
||||
return true;
|
||||
|
||||
/*
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_KFCA_WATCHDOG);
|
||||
msg.cmd.nbytes = 2;
|
||||
msg.cmd.nbytes = 2;
|
||||
|
||||
// uint16_t: 6000
|
||||
msg.cmd.raw[0] = 23;
|
||||
msg.cmd.raw[1] = 112;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 2
|
||||
)) {
|
||||
log_warning("Starting watchdog failed"); return false;
|
||||
}
|
||||
|
||||
log_warning("Started watchdog of node %d, status: %d",
|
||||
node_id, msg.cmd.status);
|
||||
|
||||
return true;
|
||||
*/
|
||||
}
|
||||
|
||||
bool bio2drv_bi2a_iidx_init(uint8_t node_id)
|
||||
{
|
||||
if (!bio2drv_bi2a_iidx_init_io(node_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!bio2drv_bi2a_iidx_watchdog_start(node_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool bio2drv_bi2a_iidx_poll(
|
||||
uint8_t node_id,
|
||||
const struct bi2a_iidx_state_out *pout,
|
||||
struct bi2a_iidx_state_in *pin)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(BIO2_BI2A_CMD_POLL);
|
||||
msg.cmd.nbytes = sizeof(*pout);
|
||||
/* buffer size of data we expect */
|
||||
*(struct bi2a_iidx_state_out *) msg.cmd.raw = *pout;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + sizeof(*pin))) {
|
||||
log_warning("Polling of node %d failed", node_id + 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pin != NULL) {
|
||||
memcpy(pin, &msg.cmd.raw, sizeof(*pin));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
33
src/main/bio2drv/bi2a-iidx.h
Normal file
33
src/main/bio2drv/bi2a-iidx.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef BIO2DRV_BI2A_IIDX_H
|
||||
#define BIO2DRV_BI2A_IIDX_H
|
||||
|
||||
#include "bio2/bi2a-iidx.h"
|
||||
|
||||
/**
|
||||
* Initialize a BI2A node.
|
||||
*
|
||||
* @param node_id Id of the node to initialize (0 based).
|
||||
* @return True if successful, false on error.
|
||||
* @note This module is supposed to be used in combination with the common
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool bio2drv_bi2a_iidx_init(uint8_t node_id);
|
||||
|
||||
/**
|
||||
* Poll the BI2A board
|
||||
*
|
||||
* @param node_id Id of the node to query (0 based).
|
||||
* @param state Pointer to a state struct to return the current state to
|
||||
* (optional, NULL for none).
|
||||
* @return True on success, false on error.
|
||||
* @note This module is supposed to be used in combination with the common
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool bio2drv_bi2a_iidx_poll(
|
||||
uint8_t node_id,
|
||||
const struct bi2a_iidx_state_out *pout,
|
||||
struct bi2a_iidx_state_in *pin);
|
||||
|
||||
#endif
|
||||
140
src/main/bio2drv/bi2a-sdvx.c
Normal file
140
src/main/bio2drv/bi2a-sdvx.c
Normal file
@@ -0,0 +1,140 @@
|
||||
#define LOG_MODULE "bio2drv-bi2a_sdvx"
|
||||
|
||||
#include "bio2drv/bi2a-sdvx.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "aciodrv/device.h"
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
static const uint8_t _BIO2DR_BI2A_SDVX_INIT_DATA = 0x3B;
|
||||
|
||||
// this is probably InitIO
|
||||
static bool bio2drv_bi2a_sdvx_init_io(uint8_t node_id)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(BIO2_BI2A_CMD_INIT);
|
||||
msg.cmd.nbytes = 1;
|
||||
msg.cmd.param = _BIO2DR_BI2A_SDVX_INIT_DATA;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
log_warning("Init node failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_warning("Init of node %d, status: %d", node_id, msg.cmd.status);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool bio2drv_bi2a_sdvx_watchdog_start(uint8_t node_id)
|
||||
{
|
||||
// exit early and don't actually call watchdog
|
||||
// the watchdog call actually returns different sized packets depending on
|
||||
// the state this results in an issue during packet processing (see: #68)
|
||||
return true;
|
||||
|
||||
/*
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_KFCA_WATCHDOG);
|
||||
msg.cmd.nbytes = 2;
|
||||
msg.cmd.nbytes = 2;
|
||||
|
||||
// uint16_t: 6000
|
||||
msg.cmd.raw[0] = 23;
|
||||
msg.cmd.raw[1] = 112;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 2
|
||||
)) {
|
||||
log_warning("Starting watchdog failed"); return false;
|
||||
}
|
||||
|
||||
log_warning("Started watchdog of node %d, status: %d",
|
||||
node_id, msg.cmd.status);
|
||||
|
||||
return true;
|
||||
*/
|
||||
}
|
||||
|
||||
bool bio2drv_bi2a_sdvx_amp(
|
||||
uint8_t node_id,
|
||||
uint8_t unused_1,
|
||||
uint8_t unused_2,
|
||||
uint8_t left,
|
||||
uint8_t right)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_KFCA_AMP_CONTROL);
|
||||
msg.cmd.nbytes = 4;
|
||||
|
||||
// the BIO2 DOES NOT MATCH THE KFCA for what these mean
|
||||
// 0 and 1 are ignored, 2 and 3 seem to map to left/right for ALL 3 AMPS
|
||||
// in the future, maybe use windows APIs and write the volume levels there
|
||||
msg.cmd.raw[0] = unused_1;
|
||||
msg.cmd.raw[1] = unused_2;
|
||||
msg.cmd.raw[2] = left;
|
||||
msg.cmd.raw[3] = right;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
log_warning("Setting AMP failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
log_warning("Started AMP node %d", node_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool bio2drv_bi2a_sdvx_init(uint8_t node_id)
|
||||
{
|
||||
if (!bio2drv_bi2a_sdvx_init_io(node_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!bio2drv_bi2a_sdvx_watchdog_start(node_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!bio2drv_bi2a_sdvx_amp(node_id, 0, 0, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool bio2drv_bi2a_sdvx_poll(
|
||||
uint8_t node_id,
|
||||
const struct bi2a_sdvx_state_out *pout,
|
||||
struct bi2a_sdvx_state_in *pin)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
msg.addr = node_id + 1;
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_KFCA_POLL);
|
||||
msg.cmd.nbytes = sizeof(*pout);
|
||||
/* buffer size of data we expect */
|
||||
*(struct bi2a_sdvx_state_out *) msg.cmd.raw = *pout;
|
||||
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + sizeof(*pin))) {
|
||||
log_warning("Polling of node %d failed", node_id + 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pin != NULL) {
|
||||
memcpy(pin, &msg.cmd.raw, sizeof(*pin));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
51
src/main/bio2drv/bi2a-sdvx.h
Normal file
51
src/main/bio2drv/bi2a-sdvx.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef BIO2DRV_BI2A_H
|
||||
#define BIO2DRV_BI2A_H
|
||||
|
||||
#include "bio2/bi2a-sdvx.h"
|
||||
|
||||
/**
|
||||
* Initialize a BI2A node.
|
||||
*
|
||||
* @param node_id Id of the node to initialize (0 based).
|
||||
* @return True if successful, false on error.
|
||||
* @note This module is supposed to be used in combination with the common
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool bio2drv_bi2a_sdvx_init(uint8_t node_id);
|
||||
|
||||
/**
|
||||
* Poll the board
|
||||
*
|
||||
* @param node_id Id of the node to query (0 based).
|
||||
* @param state Pointer to a state struct to return the current state to
|
||||
* (optional, NULL for none).
|
||||
* @return True on success, false on error.
|
||||
* @note This module is supposed to be used in combination with the common
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool bio2drv_bi2a_sdvx_poll(
|
||||
uint8_t node_id,
|
||||
const struct bi2a_sdvx_state_out *pout,
|
||||
struct bi2a_sdvx_state_in *pin);
|
||||
|
||||
/**
|
||||
* Set the BIO2 BI2A SDVX digital amp level
|
||||
*
|
||||
* @param node_id Id of the node to query (0 based).
|
||||
* @param primary primary volume (96-0)
|
||||
* @param headphone headphone volume (96-0)
|
||||
* @param unused unknown volume (96-0) (unused)
|
||||
* @param subwoofer subwoofer volume (96-0)
|
||||
* @return True on success, false on error.
|
||||
* @note Note 96 is lowest volume level, 0 is highest
|
||||
*/
|
||||
bool bio2drv_bi2a_sdvx_amp(
|
||||
uint8_t node_id,
|
||||
uint8_t unused_1,
|
||||
uint8_t unused_2,
|
||||
uint8_t left,
|
||||
uint8_t right);
|
||||
|
||||
#endif
|
||||
75
src/main/bio2drv/config-bio2.c
Normal file
75
src/main/bio2drv/config-bio2.c
Normal file
@@ -0,0 +1,75 @@
|
||||
#include "cconfig/cconfig-util.h"
|
||||
|
||||
#include "bio2drv/config-bio2.h"
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
#define BIO2DRV_CONFIG_BIO2_AUTO_KEY "bio2.autodetect"
|
||||
#define BIO2DRV_CONFIG_BIO2_PORT_KEY "bio2.port"
|
||||
#define BIO2DRV_CONFIG_BIO2_BAUD_KEY "bio2.baud"
|
||||
|
||||
#define BIO2DRV_CONFIG_BIO2_DEFAULT_AUTO_VALUE true
|
||||
#define BIO2DRV_CONFIG_BIO2_DEFAULT_PORT_VALUE "COM4"
|
||||
#define BIO2DRV_CONFIG_BIO2_DEFAULT_BAUD_VALUE 115200
|
||||
|
||||
void bio2drv_config_bio2_init(struct cconfig *config)
|
||||
{
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
BIO2DRV_CONFIG_BIO2_AUTO_KEY,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_AUTO_VALUE,
|
||||
"Autodetect BIO2 port (default: on)");
|
||||
|
||||
cconfig_util_set_str(
|
||||
config,
|
||||
BIO2DRV_CONFIG_BIO2_PORT_KEY,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_PORT_VALUE,
|
||||
"BIO2 serial port. Optional, if autodetect property is turned on");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
BIO2DRV_CONFIG_BIO2_BAUD_KEY,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_BAUD_VALUE,
|
||||
"BIO2 bus baudrate (real devices expect 115200)");
|
||||
}
|
||||
|
||||
void bio2drv_config_bio2_get(
|
||||
struct bio2drv_config_bio2 *config_bio2, struct cconfig *config)
|
||||
{
|
||||
if (!cconfig_util_get_bool(
|
||||
config,
|
||||
BIO2DRV_CONFIG_BIO2_AUTO_KEY,
|
||||
&config_bio2->autodetect,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_AUTO_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
BIO2DRV_CONFIG_BIO2_AUTO_KEY,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_AUTO_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_str(
|
||||
config,
|
||||
BIO2DRV_CONFIG_BIO2_PORT_KEY,
|
||||
config_bio2->port,
|
||||
sizeof(config_bio2->port) - 1,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_PORT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%s'",
|
||||
BIO2DRV_CONFIG_BIO2_PORT_KEY,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_PORT_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
BIO2DRV_CONFIG_BIO2_BAUD_KEY,
|
||||
&config_bio2->baud,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_BAUD_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
BIO2DRV_CONFIG_BIO2_BAUD_KEY,
|
||||
BIO2DRV_CONFIG_BIO2_DEFAULT_BAUD_VALUE);
|
||||
}
|
||||
}
|
||||
19
src/main/bio2drv/config-bio2.h
Normal file
19
src/main/bio2drv/config-bio2.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef BIO2DRV_CONFIG_BIO2_H
|
||||
#define BIO2DRV_CONFIG_BIO2_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "cconfig/cconfig.h"
|
||||
|
||||
struct bio2drv_config_bio2 {
|
||||
bool autodetect;
|
||||
char port[64];
|
||||
int32_t baud;
|
||||
};
|
||||
|
||||
void bio2drv_config_bio2_init(struct cconfig *config);
|
||||
|
||||
void bio2drv_config_bio2_get(
|
||||
struct bio2drv_config_bio2 *config_bio2, struct cconfig *config);
|
||||
|
||||
#endif
|
||||
163
src/main/bio2drv/detect.c
Normal file
163
src/main/bio2drv/detect.c
Normal file
@@ -0,0 +1,163 @@
|
||||
#define LOG_MODULE "bio2drv-detect"
|
||||
|
||||
#include <initguid.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include <cfgmgr32.h>
|
||||
#include <setupapi.h>
|
||||
|
||||
#include "bio2drv/detect.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
DEFINE_GUID(
|
||||
GUID_COM_BUS_ENUMERATOR,
|
||||
0x4D36E978,
|
||||
0xE325,
|
||||
0x11CE,
|
||||
0xBF,
|
||||
0xC1,
|
||||
0x08,
|
||||
0x00,
|
||||
0x2B,
|
||||
0xE1,
|
||||
0x03,
|
||||
0x18);
|
||||
|
||||
static char work_buffer[0x400];
|
||||
|
||||
static bool check_property(
|
||||
HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA PDeviceInfoData, DWORD property)
|
||||
{
|
||||
if (SetupDiGetDeviceRegistryPropertyA(
|
||||
DeviceInfoSet,
|
||||
PDeviceInfoData,
|
||||
property,
|
||||
NULL,
|
||||
(BYTE *) work_buffer,
|
||||
sizeof(work_buffer),
|
||||
NULL)) {
|
||||
if (strstr(work_buffer, "BIO2(VIDEO)")) {
|
||||
log_info("Found matching device: %s", work_buffer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
log_info("Device with property: %s does not match", work_buffer);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool check_id(
|
||||
HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA PDeviceInfoData)
|
||||
{
|
||||
if (CM_Get_Device_IDA(PDeviceInfoData->DevInst, work_buffer, sizeof(work_buffer), 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strstr(work_buffer, "VID_1CCF&PID_804C")) {
|
||||
log_info("Found matching device: %s", work_buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strstr(work_buffer, "VID_1CCF&PID_8040")) {
|
||||
log_info("Found matching device: %s", work_buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
log_info("Device with ID: %s does not match", work_buffer);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool get_device_by_filter(
|
||||
bool id_filter, DWORD property, size_t devnum, char *path, size_t length)
|
||||
{
|
||||
HDEVINFO DeviceInfoSet = SetupDiGetClassDevsA(
|
||||
&GUID_COM_BUS_ENUMERATOR, NULL, NULL, DIGCF_PRESENT);
|
||||
|
||||
if (DeviceInfoSet == INVALID_HANDLE_VALUE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SP_DEVINFO_DATA DeviceInfoData;
|
||||
ZeroMemory(&DeviceInfoData, sizeof(SP_DEVINFO_DATA));
|
||||
DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
|
||||
DWORD idx = 0;
|
||||
size_t num_found = 0;
|
||||
|
||||
while (SetupDiEnumDeviceInfo(DeviceInfoSet, idx, &DeviceInfoData)) {
|
||||
HKEY DeviceRegKey = SetupDiOpenDevRegKey(
|
||||
DeviceInfoSet,
|
||||
&DeviceInfoData,
|
||||
DICS_FLAG_GLOBAL,
|
||||
0,
|
||||
DIREG_DEV,
|
||||
KEY_QUERY_VALUE);
|
||||
|
||||
if (DeviceRegKey) {
|
||||
bool found = false;
|
||||
log_info("Found a serial device at index: %ld", idx);
|
||||
|
||||
if (!id_filter) {
|
||||
if (check_property(DeviceInfoSet, &DeviceInfoData, property)) {
|
||||
found = true;
|
||||
}
|
||||
} else {
|
||||
if (check_id(DeviceInfoSet, &DeviceInfoData)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (num_found == devnum) {
|
||||
DWORD path_length = length;
|
||||
RegQueryValueExA(
|
||||
DeviceRegKey,
|
||||
"PortName",
|
||||
0,
|
||||
NULL,
|
||||
(BYTE *) path,
|
||||
&path_length);
|
||||
log_info("Using port: %s", path);
|
||||
|
||||
return true;
|
||||
}
|
||||
num_found++;
|
||||
}
|
||||
}
|
||||
++idx;
|
||||
}
|
||||
SetupDiDestroyDeviceInfoList(DeviceInfoSet);
|
||||
|
||||
log_warning("No matching device found");
|
||||
return false;
|
||||
}
|
||||
|
||||
void bio2drv_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal)
|
||||
{
|
||||
log_to_external(misc, info, warning, fatal);
|
||||
}
|
||||
|
||||
bool bio2drv_detect(
|
||||
enum bio2drv_detect_mode mode, size_t index, char *path, size_t length)
|
||||
{
|
||||
if (mode == DETECT_DEVICEDESC) {
|
||||
return get_device_by_filter(
|
||||
false, SPDRP_DEVICEDESC, index, path, length);
|
||||
} else if (mode == DETECT_FRIENDLYNAME) {
|
||||
return get_device_by_filter(
|
||||
false, SPDRP_FRIENDLYNAME, index, path, length);
|
||||
} else if (mode == DETECT_DEVICEID) {
|
||||
return get_device_by_filter(true, -1, index, path, length);
|
||||
}
|
||||
|
||||
log_warning("Unknown autodetect mode: %d", mode);
|
||||
return false;
|
||||
}
|
||||
23
src/main/bio2drv/detect.h
Normal file
23
src/main/bio2drv/detect.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef BIO2DRV_DETECT_H
|
||||
#define BIO2DRV_DETECT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
enum bio2drv_detect_mode {
|
||||
DETECT_DEVICEDESC = 0x1, // look for serial devices containing BIO2(VIDEO)
|
||||
DETECT_FRIENDLYNAME = 0x2, // look for serial devices containing BIO2(VIDEO)
|
||||
DETECT_DEVICEID = 0x3, // look for serial devices by vid/pid
|
||||
};
|
||||
|
||||
void bio2drv_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
bool bio2drv_detect(
|
||||
enum bio2drv_detect_mode mode, size_t devnum, char *path, size_t length);
|
||||
|
||||
#endif
|
||||
7
src/main/bio2emu-iidx/Module.mk
Normal file
7
src/main/bio2emu-iidx/Module.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
libs += bio2emu-iidx
|
||||
|
||||
libs_bio2emu-iidx := \
|
||||
bio2emu \
|
||||
|
||||
src_bio2emu-iidx := \
|
||||
bi2a.c \
|
||||
@@ -1,15 +1,16 @@
|
||||
#define LOG_MODULE "bio2emu-bi2a"
|
||||
#define LOG_MODULE "bio2emu-iidx"
|
||||
|
||||
#include "iidxhook8/bi2a.h"
|
||||
#include "bio2emu/emu.h"
|
||||
#include "bio2emu-iidx/bi2a.h"
|
||||
|
||||
#include <windows.h> /* for _BitScanForward */
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "acioemu/emu.h"
|
||||
#include "util/math.h"
|
||||
|
||||
#include "bemanitools/iidxio.h"
|
||||
|
||||
@@ -25,6 +26,13 @@ static void bio2_emu_bi2a_send_status(
|
||||
|
||||
static int default_sliders[5];
|
||||
static bool poll_delay;
|
||||
static bool coin_latch;
|
||||
static uint8_t coin_count;
|
||||
|
||||
static bool tt_multiplier_set;
|
||||
static float tt_multiplier = 1.f;
|
||||
static uint8_t tt_accum[2];
|
||||
static int16_t tt_last[2];
|
||||
|
||||
int get_default_slider_valid(size_t idx)
|
||||
{
|
||||
@@ -35,6 +43,12 @@ int get_default_slider_valid(size_t idx)
|
||||
}
|
||||
}
|
||||
|
||||
void bio2_emu_bi2a_set_tt_multiplier(float multiplier)
|
||||
{
|
||||
tt_multiplier_set = true;
|
||||
tt_multiplier = multiplier;
|
||||
}
|
||||
|
||||
void bio2_emu_bi2a_init(
|
||||
struct bio2emu_port *bio2_emu, bool disable_poll_limiter)
|
||||
{
|
||||
@@ -71,9 +85,13 @@ void bio2_emu_bi2a_dispatch_request(
|
||||
cmd_code = ac_io_u16(req->cmd.code);
|
||||
|
||||
switch (cmd_code) {
|
||||
case BIO2_BI2A_CMD_UNK_0100:
|
||||
case BIO2_BI2A_CMD_UNK_0120:
|
||||
log_misc("BIO2_BI2A_CMD_UNK_%04X(%d)", cmd_code, req->addr);
|
||||
case BIO2_BI2A_CMD_INIT:
|
||||
log_misc("BIO2_BI2A_CMD_INIT(%d)", req->addr);
|
||||
bio2_emu_bi2a_send_status(&bio2port->acio, req, 0x00);
|
||||
break;
|
||||
|
||||
case BIO2_BI2A_CMD_WATCHDOG:
|
||||
log_misc("BIO2_BI2A_CMD_WATCHDOGX(%d)", req->addr);
|
||||
bio2_emu_bi2a_send_status(&bio2port->acio, req, 0x00);
|
||||
break;
|
||||
|
||||
@@ -157,12 +175,21 @@ static void bio2_emu_bi2a_send_status(
|
||||
ac_io_emu_response_push(emu, &resp, 0);
|
||||
}
|
||||
|
||||
static int16_t tt_mult_delta(size_t tt_no) {
|
||||
int16_t current_tt = iidx_io_ep2_get_turntable(tt_no);
|
||||
int16_t delta = get_wrapped_delta_s16(current_tt, tt_last[tt_no], 256);
|
||||
|
||||
tt_last[tt_no] = current_tt;
|
||||
|
||||
return round(delta * tt_multiplier);
|
||||
}
|
||||
|
||||
static void
|
||||
bio2_emu_bi2a_send_state(struct ac_io_emu *emu, const struct ac_io_message *req)
|
||||
{
|
||||
struct ac_io_message resp;
|
||||
struct bi2a_iidx_state_out *body;
|
||||
struct bi2a_iidx_state_in *req_bi2a;
|
||||
struct bi2a_iidx_state_in *body;
|
||||
struct bi2a_iidx_state_out *req_bi2a;
|
||||
|
||||
uint8_t input_sys = 0;
|
||||
uint8_t input_panel = 0;
|
||||
@@ -177,8 +204,8 @@ bio2_emu_bi2a_send_state(struct ac_io_emu *emu, const struct ac_io_message *req)
|
||||
resp.addr = req->addr | AC_IO_RESPONSE_FLAG;
|
||||
resp.cmd.code = req->cmd.code;
|
||||
resp.cmd.seq_no = req->cmd.seq_no;
|
||||
resp.cmd.nbytes = sizeof(struct bi2a_iidx_state_out);
|
||||
req_bi2a = (struct bi2a_iidx_state_in *) req->cmd.raw;
|
||||
resp.cmd.nbytes = sizeof(struct bi2a_iidx_state_in);
|
||||
req_bi2a = (struct bi2a_iidx_state_out *) req->cmd.raw;
|
||||
|
||||
packed_lights.panel_lights = 0;
|
||||
for (size_t i = 0; i < 4; ++i) {
|
||||
@@ -219,8 +246,8 @@ bio2_emu_bi2a_send_state(struct ac_io_emu *emu, const struct ac_io_message *req)
|
||||
return bio2_emu_bi2a_send_status(emu, req, 0);
|
||||
}
|
||||
|
||||
body = (struct bi2a_iidx_state_out *) &resp.cmd.raw;
|
||||
memset(body, 0, sizeof(struct bi2a_iidx_state_out));
|
||||
body = (struct bi2a_iidx_state_in *) &resp.cmd.raw;
|
||||
memset(body, 0, sizeof(struct bi2a_iidx_state_in));
|
||||
|
||||
// IIDX25 polls really really fast, this limits it to 1000Hz
|
||||
if (poll_delay) {
|
||||
@@ -232,8 +259,16 @@ bio2_emu_bi2a_send_state(struct ac_io_emu *emu, const struct ac_io_message *req)
|
||||
return bio2_emu_bi2a_send_status(emu, req, 0);
|
||||
}
|
||||
|
||||
body->TURNTABLE1 = iidx_io_ep2_get_turntable(0);
|
||||
body->TURNTABLE2 = iidx_io_ep2_get_turntable(1);
|
||||
if (tt_multiplier_set) {
|
||||
tt_accum[0] += tt_mult_delta(0);
|
||||
tt_accum[1] += tt_mult_delta(1);
|
||||
|
||||
body->TURNTABLE1 = tt_accum[0];
|
||||
body->TURNTABLE2 = tt_accum[1];
|
||||
} else {
|
||||
body->TURNTABLE1 = iidx_io_ep2_get_turntable(0);
|
||||
body->TURNTABLE2 = iidx_io_ep2_get_turntable(1);
|
||||
}
|
||||
|
||||
body->SLIDER1.s_val = get_default_slider_valid(0) ?
|
||||
default_sliders[0] :
|
||||
@@ -278,5 +313,16 @@ bio2_emu_bi2a_send_state(struct ac_io_emu *emu, const struct ac_io_message *req)
|
||||
body->SYSTEM.v_service = (input_sys >> IIDX_IO_SYS_SERVICE) & 1;
|
||||
body->SYSTEM.v_coin = (input_sys >> IIDX_IO_SYS_COIN) & 1;
|
||||
|
||||
if (body->SYSTEM.v_coin) {
|
||||
if (!coin_latch) {
|
||||
coin_latch = true;
|
||||
coin_count += 1;
|
||||
}
|
||||
} else {
|
||||
coin_latch = false;
|
||||
}
|
||||
|
||||
body->coins = coin_count;
|
||||
|
||||
ac_io_emu_response_push(emu, &resp, 0);
|
||||
}
|
||||
13
src/main/bio2emu-iidx/bi2a.h
Normal file
13
src/main/bio2emu-iidx/bi2a.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef BIO2EMU_IIDX_BI2A_H
|
||||
#define BIO2EMU_IIDX_BI2A_H
|
||||
|
||||
#include "bio2/bi2a-iidx.h"
|
||||
|
||||
#include "bio2emu/emu.h"
|
||||
|
||||
void bio2_emu_bi2a_init(struct bio2emu_port *in, bool disable_poll_limiter);
|
||||
void bio2_emu_bi2a_set_tt_multiplier(float multiplier);
|
||||
void bio2_emu_bi2a_dispatch_request(
|
||||
struct bio2emu_port *bio2port, const struct ac_io_message *req);
|
||||
|
||||
#endif
|
||||
@@ -69,7 +69,7 @@ bio2emu_port_dispatch_irp(struct irp *irp)
|
||||
}
|
||||
|
||||
if (!selected_emu) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
struct ac_io_emu *emu = &selected_emu->acio;
|
||||
|
||||
@@ -350,8 +350,8 @@ static CONFIGRET my_CM_Get_Device_IDA(
|
||||
log_info("%s: Injecting custom parent ID for BIO2", __FUNCTION__);
|
||||
strcpy(Buffer, devpath);
|
||||
|
||||
Buffer[devpathsize - 1] =
|
||||
'\0' + (dnDevInst & CUSTOM_DEVICE_INSTANCE_IDXMASK);
|
||||
Buffer[devpathsize - 2] =
|
||||
'0' + (dnDevInst & CUSTOM_DEVICE_INSTANCE_IDXMASK);
|
||||
log_info("%s: %s", __FUNCTION__, Buffer);
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ ac_io_bus_dispatch_irp(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (!ac_io_emu_match_irp(&ac_io_emu, irp)) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
#include "util/defs.h"
|
||||
#include "util/log.h"
|
||||
|
||||
static const irp_handler_t bsthook_handlers[] = {
|
||||
ac_io_bus_dispatch_irp,
|
||||
};
|
||||
|
||||
static bool my_dll_entry_init(char *sidcode, struct property_node *config);
|
||||
static bool my_dll_entry_main(void);
|
||||
|
||||
@@ -116,7 +112,7 @@ BOOL WINAPI DllMain(HMODULE self, DWORD reason, void *ctx)
|
||||
args_free(argc, argv);
|
||||
|
||||
app_hook_init(my_dll_entry_init, my_dll_entry_main);
|
||||
iohook_init(bsthook_handlers, lengthof(bsthook_handlers));
|
||||
iohook_push_handler(ac_io_bus_dispatch_irp);
|
||||
rs232_hook_init();
|
||||
|
||||
gfx_init();
|
||||
|
||||
@@ -41,7 +41,7 @@ static HRESULT STDCALL my_CreateDevice(
|
||||
D3DPRESENT_PARAMETERS *pp,
|
||||
IDirect3DDevice9 **pdev)
|
||||
{
|
||||
IDirect3D9 *real = COM_PROXY_UNWRAP(self);
|
||||
IDirect3D9 *real = com_proxy_downcast(self)->real;
|
||||
HRESULT hr;
|
||||
|
||||
log_misc("IDirect3D9::CreateDevice hook hit");
|
||||
@@ -61,11 +61,17 @@ static IDirect3D9 *STDCALL my_Direct3DCreate9(UINT sdk_ver)
|
||||
IDirect3D9 *api;
|
||||
IDirect3D9Vtbl *api_vtbl;
|
||||
struct com_proxy *api_proxy;
|
||||
HRESULT res;
|
||||
|
||||
log_info("Direct3DCreate9 hook hit");
|
||||
|
||||
api = real_Direct3DCreate9(sdk_ver);
|
||||
api_proxy = com_proxy_wrap(api, sizeof(*api->lpVtbl));
|
||||
res = com_proxy_wrap(&api_proxy, api, sizeof(*api->lpVtbl));
|
||||
|
||||
if (res != S_OK) {
|
||||
log_fatal("Wrapping com proxy failed: 0x%ld", res);
|
||||
}
|
||||
|
||||
api_vtbl = api_proxy->vptr;
|
||||
|
||||
api_vtbl->CreateDevice = my_CreateDevice;
|
||||
|
||||
@@ -341,7 +341,14 @@ static HRESULT my_MFEnumDeviceSources(
|
||||
|
||||
for (UINT32 i = 0; i < nsrcs; ++i) {
|
||||
api = (*pppSourceActivate)[i];
|
||||
api_proxy = com_proxy_wrap(api, sizeof(*api->lpVtbl));
|
||||
|
||||
ret = com_proxy_wrap(&api_proxy, api, sizeof(*api->lpVtbl));
|
||||
|
||||
if (ret != S_OK) {
|
||||
log_warning("Wrapping com proxy failed: %08lx", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
api_vtbl = api_proxy->vptr;
|
||||
|
||||
real_GetAllocatedString = api_vtbl->GetAllocatedString;
|
||||
|
||||
@@ -160,7 +160,6 @@ static const struct light_def ddr_lights[] = {
|
||||
{0x2A, IDS_DDR_HD_P2_SPEAKER_W_G},
|
||||
{0x2B, IDS_DDR_HD_P2_SPEAKER_W_B},
|
||||
|
||||
|
||||
// EXTIO
|
||||
{0x1E, IDS_DDR_P1_UP},
|
||||
{0x1D, IDS_DDR_P1_DOWN},
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY "gfx.forced_refresh_rate"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY "gfx.device_adapter"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCE_ORIENTATION_KEY "gfx.force_orientation"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY "gfx.force_screen_res.width"
|
||||
#define D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY "gfx.force_screen_res.height"
|
||||
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE false
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOWED_VALUE false
|
||||
@@ -25,6 +27,8 @@
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE -1
|
||||
#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE -1
|
||||
|
||||
void d3d9exhook_config_gfx_init(struct cconfig *config)
|
||||
{
|
||||
@@ -78,6 +82,20 @@ void d3d9exhook_config_gfx_init(struct cconfig *config)
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE,
|
||||
"Orientation to force monitor into, -1 to use default, "
|
||||
"0, 1, 2, 3 to do 0, 90, 180, 270 degrees");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE,
|
||||
"Force a screen resolution (width), -1 to disable. Use this if the game does not auto "
|
||||
"detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.");
|
||||
|
||||
cconfig_util_set_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE,
|
||||
"Force a screen resolution (height), -1 to disable. Use this if the game does not auto "
|
||||
"detect your monitor's resolution properly, e.g. 1368x768 instead of 1280x720.");
|
||||
}
|
||||
|
||||
void d3d9exhook_config_gfx_get(
|
||||
@@ -178,4 +196,28 @@ void d3d9exhook_config_gfx_get(
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_ORIENTATION_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_ORIENTATION_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY,
|
||||
&config_gfx->force_screen_res.width,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_WIDTH_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_WIDTH_VALUE);
|
||||
}
|
||||
|
||||
if (!cconfig_util_get_int(
|
||||
config,
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY,
|
||||
&config_gfx->force_screen_res.height,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE)) {
|
||||
log_warning(
|
||||
"Invalid value for key '%s' specified, fallback "
|
||||
"to default '%d'",
|
||||
D3D9EXHOOK_CONFIG_GFX_FORCE_SCREEN_RES_HEIGHT_KEY,
|
||||
D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCE_SCREEN_RES_HEIGHT_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,11 @@ struct d3d9exhook_config_gfx {
|
||||
int32_t forced_refresh_rate;
|
||||
int32_t device_adapter;
|
||||
int32_t force_orientation;
|
||||
|
||||
struct force_screen_res {
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
} force_screen_res;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,6 +91,8 @@ static int32_t d3d9ex_window_height = -1;
|
||||
static bool d3d9ex_window_framed;
|
||||
static int32_t d3d9ex_device_adapter = -1;
|
||||
static int32_t d3d9ex_force_orientation = -1;
|
||||
static int32_t d3d9ex_force_screen_res_width = -1;
|
||||
static int32_t d3d9ex_force_screen_res_height = -1;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -242,14 +244,78 @@ static HRESULT STDCALL my_CreateDeviceEx(
|
||||
D3DDISPLAYMODEEX *fdm,
|
||||
IDirect3DDevice9Ex **pdev)
|
||||
{
|
||||
IDirect3D9Ex *real = COM_PROXY_UNWRAP(self);
|
||||
log_assert(self);
|
||||
log_assert(pp);
|
||||
log_assert(pdev);
|
||||
|
||||
IDirect3D9Ex *real = com_proxy_downcast(self)->real;
|
||||
HRESULT hr;
|
||||
|
||||
log_misc(
|
||||
"CreateDeviceEx parameters: adapter %d, type %d, hwnd %p, flags %lX, "
|
||||
"pdev %p",
|
||||
adapter,
|
||||
type,
|
||||
hwnd,
|
||||
flags,
|
||||
pdev);
|
||||
|
||||
if (fdm) {
|
||||
log_misc(
|
||||
"CreateDeviceEx display mode: size %d, width %d, height %d, refresh rate %d, format %d, "
|
||||
"scan line ordering %d",
|
||||
fdm->Size,
|
||||
fdm->Width,
|
||||
fdm->Height,
|
||||
fdm->RefreshRate,
|
||||
fdm->Format,
|
||||
fdm->ScanLineOrdering);
|
||||
}
|
||||
|
||||
log_misc(
|
||||
"D3D9EX presenter parameters: BackBufferWidth %d, BackBufferHeight "
|
||||
"%d, BackBufferFormat %d, "
|
||||
"BackBufferCount %d, MultiSampleType %d, MultiSampleQuality %ld, SwapEffect %d, "
|
||||
"hDeviceWindow %p, Windowed %d, "
|
||||
"EnableAutoDepthStencil "
|
||||
"%d, AutoDepthStencilFormat %d, Flags %lX, "
|
||||
"FullScreen_RefreshRateInHz %d, PresentationInterval %d",
|
||||
pp->BackBufferWidth,
|
||||
pp->BackBufferHeight,
|
||||
pp->BackBufferFormat,
|
||||
pp->BackBufferCount,
|
||||
pp->MultiSampleType,
|
||||
pp->MultiSampleQuality,
|
||||
pp->SwapEffect,
|
||||
pp->hDeviceWindow,
|
||||
pp->Windowed,
|
||||
pp->EnableAutoDepthStencil,
|
||||
pp->AutoDepthStencilFormat,
|
||||
pp->Flags,
|
||||
pp->FullScreen_RefreshRateInHz,
|
||||
pp->PresentationInterval);
|
||||
|
||||
if (d3d9ex_device_adapter >= 0) {
|
||||
log_info("Forcing adapter %d -> %d", adapter, d3d9ex_device_adapter);
|
||||
adapter = d3d9ex_device_adapter;
|
||||
}
|
||||
|
||||
if (d3d9ex_force_screen_res_width > 0 && d3d9ex_force_screen_res_height > 0) {
|
||||
log_info("Overriding screen resolution/back buffer of %dx%d -> %dx%d",
|
||||
pp->BackBufferWidth,
|
||||
pp->BackBufferHeight,
|
||||
d3d9ex_force_screen_res_width,
|
||||
d3d9ex_force_screen_res_height);
|
||||
|
||||
pp->BackBufferWidth = d3d9ex_force_screen_res_width;
|
||||
pp->BackBufferHeight = d3d9ex_force_screen_res_height;
|
||||
|
||||
if (fdm) {
|
||||
fdm->Width = pp->BackBufferWidth;
|
||||
fdm->Height = pp->BackBufferHeight;
|
||||
}
|
||||
}
|
||||
|
||||
if (d3d9ex_windowed) {
|
||||
fdm = NULL;
|
||||
pp->Windowed = TRUE;
|
||||
@@ -337,7 +403,14 @@ static HRESULT STDCALL my_Direct3DCreate9Ex(UINT sdk_ver, IDirect3D9Ex **api)
|
||||
|
||||
hr = real_Direct3DCreate9Ex(sdk_ver, api);
|
||||
api_ = *api;
|
||||
api_proxy = com_proxy_wrap(api_, sizeof(*api_->lpVtbl));
|
||||
|
||||
hr = com_proxy_wrap(&api_proxy, api_, sizeof(*api_->lpVtbl));
|
||||
|
||||
if (hr != S_OK) {
|
||||
log_warning("Wrapping com proxy failed: %08lx", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
api_vtbl = api_proxy->vptr;
|
||||
|
||||
api_vtbl->CreateDeviceEx = my_CreateDeviceEx;
|
||||
@@ -382,6 +455,14 @@ void d3d9ex_configure(struct d3d9exhook_config_gfx *gfx_config)
|
||||
d3d9ex_force_refresh_rate = gfx_config->forced_refresh_rate;
|
||||
d3d9ex_device_adapter = gfx_config->device_adapter;
|
||||
d3d9ex_force_orientation = gfx_config->force_orientation;
|
||||
|
||||
d3d9ex_force_screen_res_width = gfx_config->force_screen_res.width;
|
||||
d3d9ex_force_screen_res_height = gfx_config->force_screen_res.height;
|
||||
|
||||
if (d3d9ex_force_screen_res_width * d3d9ex_force_screen_res_height > 0) {
|
||||
log_warning("Force screen res: Only one, either width or height, is > 0."
|
||||
" Force screen res not activate");
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -107,7 +107,7 @@ com4_dispatch_irp(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (!ac_io_emu_match_irp(&com4_ac_io_emu, irp)) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
@@ -72,10 +72,18 @@ static HRESULT STDCALL my_DirectInput8Create(
|
||||
|
||||
res = real_DirectInput8Create(
|
||||
hinst, dwVersion, riidltf, (LPVOID *) &api, punkOuter);
|
||||
|
||||
if (res != DI_OK) {
|
||||
return res;
|
||||
}
|
||||
api_proxy = com_proxy_wrap(api, sizeof(*api->lpVtbl));
|
||||
|
||||
res = com_proxy_wrap(&api_proxy, api, sizeof(*api->lpVtbl));
|
||||
|
||||
if (res != S_OK) {
|
||||
log_warning("Wrapping com proxy failed: %08lx", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
api_vtbl = api_proxy->vptr;
|
||||
|
||||
api_vtbl->EnumDevices = my_EnumDevices;
|
||||
|
||||
@@ -32,24 +32,6 @@ static bool my_dll_entry_main(void);
|
||||
bool standard_def;
|
||||
bool _15khz;
|
||||
|
||||
static const irp_handler_t ddrhook_com4_handlers[] = {
|
||||
p3io_emu_dispatch_irp,
|
||||
extio_dispatch_irp,
|
||||
spike_dispatch_irp,
|
||||
usbmem_dispatch_irp,
|
||||
com4_dispatch_irp,
|
||||
};
|
||||
|
||||
static const irp_handler_t ddrhook_handlers[] = {
|
||||
/* Same as above, but without COM4 emulation.
|
||||
See ddrhook/p3io.c for details. */
|
||||
|
||||
p3io_emu_dispatch_irp,
|
||||
extio_dispatch_irp,
|
||||
spike_dispatch_irp,
|
||||
usbmem_dispatch_irp,
|
||||
};
|
||||
|
||||
static bool my_dll_entry_init(char *sidcode, struct property_node *param)
|
||||
{
|
||||
int argc;
|
||||
@@ -90,10 +72,14 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
|
||||
|
||||
args_free(argc, argv);
|
||||
|
||||
iohook_push_handler(p3io_emu_dispatch_irp);
|
||||
iohook_push_handler(extio_dispatch_irp);
|
||||
iohook_push_handler(spike_dispatch_irp);
|
||||
iohook_push_handler(usbmem_dispatch_irp);
|
||||
|
||||
if (com4) {
|
||||
iohook_init(ddrhook_com4_handlers, lengthof(ddrhook_com4_handlers));
|
||||
} else {
|
||||
iohook_init(ddrhook_handlers, lengthof(ddrhook_handlers));
|
||||
/* See ddrhook/p3io.c for details. */
|
||||
iohook_push_handler(com4_dispatch_irp);
|
||||
}
|
||||
|
||||
rs232_hook_init();
|
||||
|
||||
@@ -33,7 +33,13 @@ void extio_init(void)
|
||||
{
|
||||
log_assert(extio_fd == NULL);
|
||||
|
||||
extio_fd = iohook_open_dummy_fd();
|
||||
HRESULT hr;
|
||||
|
||||
hr = iohook_open_nul_fd(&extio_fd);
|
||||
|
||||
if (hr != S_OK) {
|
||||
log_fatal("Opening nul fd failed: %08lx", hr);
|
||||
}
|
||||
}
|
||||
|
||||
void extio_fini(void)
|
||||
@@ -51,7 +57,7 @@ extio_dispatch_irp(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (irp->op != IRP_OP_OPEN && irp->fd != extio_fd) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
switch (irp->op) {
|
||||
@@ -75,7 +81,7 @@ static HRESULT extio_open(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (!wstr_eq(irp->open_filename, L"COM1")) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
log_info("EXTIO RS232 port opened");
|
||||
|
||||
@@ -43,7 +43,7 @@ static HRESULT STDCALL my_CreateDevice(
|
||||
{
|
||||
IDirect3D9 *real;
|
||||
|
||||
real = COM_PROXY_UNWRAP(self);
|
||||
real = com_proxy_downcast(self)->real;
|
||||
|
||||
if (gfx_windowed) {
|
||||
pp->Windowed = TRUE;
|
||||
@@ -58,11 +58,18 @@ static IDirect3D9 *STDCALL my_Direct3DCreate9(UINT sdk_ver)
|
||||
IDirect3D9 *api;
|
||||
IDirect3D9Vtbl *api_vtbl;
|
||||
struct com_proxy *api_proxy;
|
||||
HRESULT hr;
|
||||
|
||||
log_info("Direct3DCreate9 hook hit");
|
||||
|
||||
api = real_Direct3DCreate9(sdk_ver);
|
||||
api_proxy = com_proxy_wrap(api, sizeof(*api->lpVtbl));
|
||||
|
||||
hr = com_proxy_wrap(&api_proxy, api, sizeof(*api->lpVtbl));
|
||||
|
||||
if (hr != S_OK) {
|
||||
log_fatal("Wrapping com proxy failed: %08lx", hr);
|
||||
}
|
||||
|
||||
api_vtbl = api_proxy->vptr;
|
||||
|
||||
api_vtbl->CreateDevice = my_CreateDevice;
|
||||
|
||||
@@ -47,7 +47,7 @@ spike_dispatch_irp(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (!ac_io_emu_match_irp(&spike_ac_io_emu, irp)) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
@@ -34,7 +34,13 @@ void usbmem_init(void)
|
||||
{
|
||||
log_assert(usbmem_fd == NULL);
|
||||
|
||||
usbmem_fd = iohook_open_dummy_fd();
|
||||
HRESULT hr;
|
||||
|
||||
hr = iohook_open_nul_fd(&usbmem_fd);
|
||||
|
||||
if (hr != S_OK) {
|
||||
log_fatal("Opening nul fd failed: %08lx", hr);
|
||||
}
|
||||
}
|
||||
|
||||
void usbmem_fini(void)
|
||||
@@ -52,7 +58,7 @@ usbmem_dispatch_irp(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (irp->op != IRP_OP_OPEN && irp->fd != usbmem_fd) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
switch (irp->op) {
|
||||
@@ -76,7 +82,7 @@ static HRESULT usbmem_open(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (!wstr_eq(irp->open_filename, L"COM3")) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
irp->fd = usbmem_fd;
|
||||
|
||||
@@ -95,7 +95,13 @@ static HRESULT STDCALL my_DirectInput8Create(
|
||||
return res;
|
||||
}
|
||||
|
||||
api_proxy = com_proxy_wrap(api, sizeof(*api->lpVtbl));
|
||||
res = com_proxy_wrap(&api_proxy, api, sizeof(*api->lpVtbl));
|
||||
|
||||
if (res != S_OK) {
|
||||
log_warning("Wrapping com proxy failed: %08lx", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
api_vtbl = api_proxy->vptr;
|
||||
|
||||
api_vtbl->EnumDevices = my_EnumDevices;
|
||||
|
||||
@@ -53,7 +53,14 @@ void ezusb_emu_device_hook_init(struct ezusb_emu_msg_hook *msg_hook)
|
||||
{
|
||||
log_assert(ezusb_emu_fd == NULL);
|
||||
|
||||
ezusb_emu_fd = iohook_open_dummy_fd();
|
||||
HRESULT hr;
|
||||
|
||||
hr = iohook_open_nul_fd(&ezusb_emu_fd);
|
||||
|
||||
if (hr != S_OK) {
|
||||
log_fatal("Opening nul fd failed: %08lx", hr);
|
||||
}
|
||||
|
||||
ezusb_emu_dev_fx_msg_hook = msg_hook;
|
||||
}
|
||||
|
||||
@@ -70,7 +77,7 @@ HRESULT
|
||||
ezusb_emu_device_dispatch_irp(struct irp *irp)
|
||||
{
|
||||
if (irp->op != IRP_OP_OPEN && irp->fd != ezusb_emu_fd) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
/* read/write are not supported, and the game-side EZUSB code constantly
|
||||
@@ -98,7 +105,7 @@ static HRESULT ezusb_open(struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
if (!wstr_eq(irp->open_filename, L"\\\\.\\Ezusb-0")) {
|
||||
return irp_invoke_next(irp);
|
||||
return iohook_invoke_next(irp);
|
||||
}
|
||||
|
||||
irp->fd = ezusb_emu_fd;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user