mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-09-15 03:45:09 -05:00
Compare commits
187 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
e0cfc8c948 | ||
|
|
69ef963451 | ||
|
|
93cfb591b7 | ||
|
|
3396c09fbf | ||
|
|
bd8dc18b30 | ||
|
|
86517bd001 | ||
|
|
172c83a854 | ||
|
|
c7137659bc | ||
|
|
8e9abf9906 | ||
|
|
62bb717582 | ||
|
|
4816fb809d | ||
|
|
2a2c77f255 | ||
|
|
55513bac41 | ||
|
|
9c37ef71ba | ||
|
|
a0a1dea397 | ||
|
|
3c26a3f315 | ||
|
|
b408cd9687 | ||
|
|
be4df516fd | ||
|
|
d1080905e5 | ||
|
|
f87a51bbe4 | ||
|
|
2a4d3e2865 | ||
|
|
6697ff7df1 | ||
|
|
682fe8aa1b | ||
|
|
7d533f60cb | ||
|
|
e5331fbc7c | ||
|
|
77527e346b | ||
|
|
1d0a96fa20 | ||
|
|
63e19aaaf6 | ||
|
|
4c59f16d46 | ||
|
|
7157fdedb7 | ||
|
|
13d29cb62e | ||
|
|
bf48715466 | ||
|
|
24b490e36b | ||
|
|
ff2a4b9a2c | ||
|
|
10bddd4905 | ||
|
|
ad5fbc1f5b | ||
|
|
25413bcba8 | ||
|
|
937290f93d | ||
|
|
d04598a570 | ||
|
|
bd382e5509 | ||
|
|
0d3fa54316 | ||
|
|
e8943edff6 | ||
|
|
61f3eb44d2 | ||
|
|
5aa1e27a31 | ||
|
|
596b962cfe | ||
|
|
5969573dc9 | ||
|
|
5da6997805 | ||
|
|
dc98103419 | ||
|
|
2d07bd6f5a | ||
|
|
a21e37c894 | ||
|
|
fbb7731681 | ||
|
|
3659494c18 | ||
|
|
6d638ff1ae | ||
|
|
214a31b24d | ||
|
|
66d1131664 | ||
|
|
3450686cf5 | ||
|
|
3b8f6ac1d9 | ||
|
|
8ae06f6f4b | ||
|
|
b1fd175318 | ||
|
|
b1329d10bf | ||
|
|
bf3d543893 | ||
|
|
f1f26dece3 | ||
|
|
fe0996ec3b | ||
|
|
d551930ea0 | ||
|
|
daad6a09c5 | ||
|
|
27fdabe17a | ||
|
|
d29d9415b2 | ||
|
|
3212981cc9 | ||
|
|
7ea12a8517 | ||
|
|
82ac30e49f | ||
|
|
d177f23476 | ||
|
|
13050b05e5 | ||
|
|
673881bc47 | ||
|
|
74ddd96d32 | ||
|
|
48622f6a58 | ||
|
|
0ca353b250 | ||
|
|
ddd7853810 | ||
|
|
51a697659b | ||
|
|
412ece18fc | ||
|
|
1d247d44d5 | ||
|
|
2011bfafd6 | ||
|
|
b434d7975d | ||
|
|
2d8017dbda | ||
|
|
6da3732968 | ||
|
|
f3ead543ab | ||
|
|
ad3995eeae | ||
|
|
78a7fd418a | ||
|
|
518f65b8c0 | ||
|
|
041d6935ff | ||
|
|
69ee95c79a | ||
|
|
b6e588116d | ||
|
|
c3bc8782f4 | ||
|
|
c600e1a423 | ||
|
|
6741a1f2fd | ||
|
|
ce61a246a6 | ||
|
|
e96a280bde | ||
|
|
5aa9ad1e02 | ||
|
|
d60a1e0c0f | ||
|
|
03a9beae41 | ||
|
|
71f0a66408 | ||
|
|
0f04d5ef19 | ||
|
|
0c1bbe08c0 | ||
|
|
1c415eb207 | ||
|
|
b6216c696e | ||
|
|
a492cee93e | ||
|
|
e495bfb8f1 | ||
|
|
073392407a | ||
|
|
0a499b38a7 | ||
|
|
79495ea687 | ||
|
|
29526e02ec | ||
|
|
b83033587f | ||
|
|
ff6bad2495 | ||
|
|
d64f8b2d8d | ||
|
|
8c998f6461 | ||
|
|
a10132f62d | ||
|
|
d9cc873eec | ||
|
|
f4c0810ee3 | ||
|
|
b1871a475d | ||
|
|
a626e9e635 | ||
|
|
5183547ba9 | ||
|
|
53d61dcbbd | ||
|
|
f201bff9ca | ||
|
|
e0d7596f20 | ||
|
|
3e60300273 | ||
|
|
77906205b5 | ||
|
|
c5d39d82d5 | ||
|
|
d169ee84b3 | ||
|
|
60050d0d09 | ||
|
|
3436838b85 | ||
|
|
bda056f0e4 | ||
|
|
2788b27a6f | ||
|
|
89e3bbd2a3 | ||
|
|
1a567aa8ba | ||
|
|
a6386ac472 | ||
|
|
6582eff48b | ||
|
|
df0390e6f1 | ||
|
|
9874882774 | ||
|
|
2aaaf2a864 | ||
|
|
8d03db1b3d | ||
|
|
b5f3eddba1 |
@@ -9,23 +9,23 @@ AllowShortCaseLabelsOnASingleLine: 'false'
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: 'false'
|
||||
AllowShortLoopsOnASingleLine: 'false'
|
||||
AlwaysBreakAfterDefinitionReturnType: All
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: 'false'
|
||||
AlwaysBreakBeforeMultilineStrings: 'true'
|
||||
BinPackArguments: 'false'
|
||||
BinPackParameters: 'false'
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Linux
|
||||
BreakBeforeTernaryOperators: 'false'
|
||||
BreakStringLiterals: 'true'
|
||||
ColumnLimit: '120'
|
||||
ContinuationIndentWidth: '8'
|
||||
ColumnLimit: '80'
|
||||
ContinuationIndentWidth: '4'
|
||||
IncludeBlocks: Preserve
|
||||
IndentCaseLabels: 'false'
|
||||
IndentCaseLabels: 'true'
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: '4'
|
||||
IndentWrappedFunctionNames: 'false'
|
||||
KeepEmptyLinesAtTheStartOfBlocks: 'false'
|
||||
KeepEmptyLinesAtTheStartOfBlocks: 'true'
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: '1'
|
||||
PointerAlignment: Right
|
||||
|
||||
67
.gitlab-ci.yml
Normal file
67
.gitlab-ci.yml
Normal file
@@ -0,0 +1,67 @@
|
||||
image: docker:stable
|
||||
|
||||
variables:
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
|
||||
services:
|
||||
- docker:19.03.8-dind
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
|
||||
stages:
|
||||
- build
|
||||
- create-release-package
|
||||
- releasetag
|
||||
|
||||
build:
|
||||
stage: build
|
||||
before_script:
|
||||
- apk update && apk add make > /dev/null
|
||||
script:
|
||||
- make build-docker
|
||||
artifacts:
|
||||
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
||||
paths:
|
||||
- build
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
|
||||
create-release-package:
|
||||
stage: create-release-package
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
dependencies:
|
||||
- build
|
||||
before_script:
|
||||
- apk update && apk add zip > /dev/null
|
||||
script:
|
||||
- mv build/docker/bemanitools.zip ./bemanitools.zip
|
||||
- rm -r build
|
||||
- find . -mindepth 1 ! -regex '^./bemanitools.zip' -delete
|
||||
- unzip bemanitools.zip
|
||||
- rm bemanitools.zip
|
||||
artifacts:
|
||||
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
||||
paths:
|
||||
- ./*
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
|
||||
releasetag:
|
||||
stage: releasetag
|
||||
dependencies: []
|
||||
before_script:
|
||||
- apk update && apk add curl > /dev/null
|
||||
script:
|
||||
- |
|
||||
curl --silent --show-error \
|
||||
--data "{\"tag_name\": \"${CI_COMMIT_TAG}\", \"name\": \"${CI_PROJECT_NAME}-${CI_COMMIT_TAG}\", \"description\": \"${CI_COMMIT_TAG_MESSAGE:-No release notes.}\"}" \
|
||||
--header "Content-Type: application/json" \
|
||||
--header "Private-Token: ${CI_PRIVATE_TOKEN}" \
|
||||
--request POST \
|
||||
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases"
|
||||
only:
|
||||
- tags
|
||||
53
.gitlab/issue_templates/Bug.md
Normal file
53
.gitlab/issue_templates/Bug.md
Normal file
@@ -0,0 +1,53 @@
|
||||
## Summary
|
||||
<!--- Provide a general summary of the issue in the Title above -->
|
||||
|
||||
## Expected behavior
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
## Current behavior
|
||||
<!--- 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 -->
|
||||
|
||||
## Steps to reproduce
|
||||
<!--- Provide a detailed step by step description how to reproduce this issue -->
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
|
||||
## Possible solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
|
||||
## Context (Environment)
|
||||
### Bemanitools version(s) affected
|
||||
* <!--- Add one or multiple versions as a bullet list -->
|
||||
|
||||
### Game(s) and version(s) affected
|
||||
* <!--- Add one or multiple game versions as a bullet list -->
|
||||
|
||||
### Log output
|
||||
See attachment.
|
||||
<!--- Provide log output as attachment. Make sure to censor sensitive data like PCBIDs or device names if necessary -->
|
||||
|
||||
### Configuration files
|
||||
See attachment.
|
||||
<!--- Provide any configuration files that you used, e.g. iidxhook-XX.conf. Make sure to censor sensitive data like
|
||||
PCBIDs -->
|
||||
|
||||
### 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. -->
|
||||
|
||||
### APIs used
|
||||
* <!--- List all APIs you used as a bullet list, e.g. iidxio-keyboard, eamio-keyboard -->
|
||||
|
||||
### OS version
|
||||
<!--- Provide the version of Windows you used with whatever update/build identifier -->
|
||||
|
||||
### Hardware specs
|
||||
* CPU: <!--- Insert, e.g. Core i7 2600k 3.20ghz -->
|
||||
* RAM: <!--- Insert, e.g. 16 GB -->
|
||||
* GPU: <!--- Insert, e.g. Nvidia GeForce GTX 970, 4GB -->
|
||||
* Controllers/IO: <!--- Insert, e.g. DJ Dao RE over USB -->
|
||||
14
.gitlab/issue_templates/Feature.md
Normal file
14
.gitlab/issue_templates/Feature.md
Normal file
@@ -0,0 +1,14 @@
|
||||
## Summary
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
|
||||
## Detailed description
|
||||
<!--- Describe your feature in detail -->
|
||||
|
||||
## Benefits
|
||||
<!--- Describe the value/benefits of the feature in detail -->
|
||||
|
||||
## Drawbacks
|
||||
<!--- Describe any drawbacks that might be introduced with this feature -->
|
||||
|
||||
## Current blockers
|
||||
<!--- Describe any blockers that need to be resolved before implementing this feature -->
|
||||
27
.gitlab/merge_request_templates/Bugfix.md
Normal file
27
.gitlab/merge_request_templates/Bugfix.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## Summary
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
|
||||
## Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Related Issue
|
||||
<!--- This project only accepts pull requests related to open issues -->
|
||||
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
|
||||
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
|
||||
<!--- Please link to the issue here: -->
|
||||
|
||||
## How Has This Been Tested?
|
||||
<!--- Please describe in detail how you tested your changes. -->
|
||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||
<!--- see how your change affects other areas of the code, etc. -->
|
||||
|
||||
## Checklist
|
||||
<!-- Make sure you covered all items, which apply, of the checklist below. -->
|
||||
<!-- Strikethrough items that do not apply and provide a brief description why. -->
|
||||
* [ ] Implemented (unit) test(s) which prove that the introduced changes are working as expected.
|
||||
* Tested with the following games:
|
||||
* [ ] ... <!-- insert game name 1-->
|
||||
* [ ] ... <!-- insert game name 2--->
|
||||
* [ ] Followed the developer (style) guidelines.
|
||||
* [ ] Updated existing doc of or add new doc to README file(s).
|
||||
* [ ] Updated development documentation.
|
||||
27
.gitlab/merge_request_templates/Feature.md
Normal file
27
.gitlab/merge_request_templates/Feature.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## Summary
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
|
||||
## Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Related Issue
|
||||
<!--- This project only accepts pull requests related to open issues -->
|
||||
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
|
||||
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
|
||||
<!--- Please link to the issue here: -->
|
||||
|
||||
## How Has This Been Tested?
|
||||
<!--- Please describe in detail how you tested your changes. -->
|
||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||
<!--- see how your change affects other areas of the code, etc. -->
|
||||
|
||||
## Checklist
|
||||
<!-- Make sure you covered all items, which apply, of the checklist below. -->
|
||||
<!-- Strikethrough items that do not apply and provide a brief description why. -->
|
||||
* [ ] Implemented (unit) test(s) which prove that the introduced changes are working as expected.
|
||||
* Tested with the following games:
|
||||
* [ ] ... <!-- insert game name 1-->
|
||||
* [ ] ... <!-- insert game name 2--->
|
||||
* [ ] Followed the developer (style) guidelines.
|
||||
* [ ] Updated existing doc of or add new doc to README file(s).
|
||||
* [ ] Updated development documentation.
|
||||
49
CHANGELOG.md
49
CHANGELOG.md
@@ -1,4 +1,53 @@
|
||||
# Release history
|
||||
## 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
|
||||
|
||||
## 5.31
|
||||
* DDR: Fix p3io and extio lights not working / being swapped when using geninput
|
||||
* DDR: Add HDXS light support
|
||||
* DDR: Add 64 bit support
|
||||
* DDR: Add option to use COM4 as the p3io rs232 port instead of emulating (for use with acrealio etc.)
|
||||
* Jubeat: Add network adapter hook
|
||||
* Misc: Fix aciodrv sometimes hanging on boot (eamio-icca and sdvxio-kfca)
|
||||
|
||||
## 5.30
|
||||
* SDVX: sdvxhook2 headphone force and cursor confining config options
|
||||
* DDR: Add light support for SMX gen 4 pads
|
||||
|
||||
## 5.29
|
||||
* SDVX: Add option for monitor rotation
|
||||
* SDVX: Add option to allow overriding network adapter IP
|
||||
* IIDX: Add force display adapter and refresh rate configuration
|
||||
* SDVX: Allow specifying display adapter to open for d3d9ex hook
|
||||
* IIDX/SDVX camerahooks bugfix: Camera sometimes not detected on some older machines
|
||||
|
||||
## 5.28
|
||||
* Improve documentation in various places
|
||||
* Automatic code formatting in build pipeline
|
||||
* Bugfix: Recursive config.bat script
|
||||
* Enable automatic building on pushes to master
|
||||
* Bugfix: Stop SDVX hanging on thankyou for playing
|
||||
* sdvx2: Support for Vivid Wave using sdvxhook2
|
||||
* sdvxio-kfca: Driver for real sdvx cabinet IO hardware
|
||||
|
||||
## 5.27
|
||||
* Various documentation updates regarding development and how to contribute
|
||||
* KFCA emulation accuracy fixes
|
||||
* Fix passthrough of serial calls when using real hardware (e.g. card reader passthrough IIDX25+/SDVX5+)
|
||||
* Add sdvxio-kfca driver to talk to real SDVX hardware
|
||||
* Refactor d3d9 hook module to improve maintainability. Also fixes upscaling not working on IIDX20+.
|
||||
* Remove d3d8 hook module to improve maintainability. Make old d3d8 based games, e.g. iidxhook1/2, use d3d9 instead.
|
||||
Requires usage of d3d8to9 wrapper library to use gfx patching features.
|
||||
* Add dev doc about IIDX rendering loops
|
||||
* Add an initial draft of an architecture document (will be worked on in iterations)
|
||||
* Refactor BIO2 emulation to make it re-usable by other games
|
||||
|
||||
## 5.26
|
||||
* iidxio-ezusb: Reduce sleep time to Sleep(1) to avoid framerate issues on some versions of iidx.
|
||||
* Bugfix: iidx d3d9 games, mainly the newer ones iidx 20-25, freezing. Happened on boot, during song selection or during the song.
|
||||
|
||||
30
CONTRIBUTING.md
Normal file
30
CONTRIBUTING.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# 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.
|
||||
|
||||
# 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.
|
||||
|
||||
When creating new issues, use our template for reporting bugs. It tells you what kind of information we need.
|
||||
|
||||
# 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.
|
||||
|
||||
Please read our [development guidelines](doc/development.md) as they contain valuable information that your contribution
|
||||
meets our standards.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
# 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).
|
||||
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM fedora:31
|
||||
|
||||
LABEL description="Build environment for bemanitools"
|
||||
|
||||
RUN yum -y install \
|
||||
git \
|
||||
make \
|
||||
zip \
|
||||
clang \
|
||||
mingw64-gcc.x86_64 \
|
||||
mingw32-gcc.x86_64 \
|
||||
wine.x86_64
|
||||
|
||||
RUN mkdir /bemanitools
|
||||
WORKDIR /bemanitools
|
||||
|
||||
# Order optimized for docker layer caching
|
||||
COPY run-tests-wine.sh run-tests-wine.sh
|
||||
COPY CHANGELOG.md CHANGELOG.md
|
||||
COPY CONTRIBUTING.md CONTRIBUTING.md
|
||||
COPY LICENSE LICENSE
|
||||
COPY GNUmakefile GNUmakefile
|
||||
COPY Module.mk Module.mk
|
||||
COPY README.md README.md
|
||||
COPY doc doc
|
||||
COPY dist dist
|
||||
COPY src src
|
||||
# .git folder required or building fails when version is generated
|
||||
COPY .git .git
|
||||
|
||||
# Building
|
||||
RUN make
|
||||
86
GNUmakefile
86
GNUmakefile
@@ -11,34 +11,83 @@ BUILDDIR ?= build
|
||||
# Internal variables
|
||||
#
|
||||
|
||||
depdir := $(BUILDDIR)/dep
|
||||
objdir := $(BUILDDIR)/obj
|
||||
bindir := $(BUILDDIR)/bin
|
||||
builddir_docker := $(BUILDDIR)/docker
|
||||
|
||||
toolchain_32 := i686-w64-mingw32-
|
||||
toolchain_64 := x86_64-w64-mingw32-
|
||||
docker_container_name := "bemanitools-build"
|
||||
docker_image_name := "bemanitools:build"
|
||||
|
||||
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
|
||||
ldflags := -Wl,--gc-sections -static-libgcc
|
||||
depdir := $(BUILDDIR)/dep
|
||||
objdir := $(BUILDDIR)/obj
|
||||
bindir := $(BUILDDIR)/bin
|
||||
|
||||
toolchain_32 := i686-w64-mingw32-
|
||||
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 -DPSAPI_VERSION=1
|
||||
cflags_release := -Werror
|
||||
ldflags := -Wl,--gc-sections -static-libgcc
|
||||
|
||||
#
|
||||
# The first target that GNU Make encounters becomes the default target.
|
||||
# Define our ultimate target (`all') here, and also some helpers
|
||||
#
|
||||
|
||||
all:
|
||||
all: build
|
||||
|
||||
.PHONY: \
|
||||
build-docker \
|
||||
clean \
|
||||
code-format \
|
||||
print-building \
|
||||
print-release \
|
||||
run-tests \
|
||||
version
|
||||
|
||||
release: \
|
||||
print-release \
|
||||
clean \
|
||||
code-format \
|
||||
all \
|
||||
run-tests
|
||||
|
||||
build: \
|
||||
print-building \
|
||||
version
|
||||
|
||||
print-building:
|
||||
$(V)echo "Build gitrev "$(gitrev)"..."
|
||||
|
||||
print-release:
|
||||
$(V)echo "Starting release build..."
|
||||
|
||||
clean:
|
||||
$(V)echo "Cleaning up..."
|
||||
$(V)rm -rf $(BUILDDIR)
|
||||
|
||||
code-format:
|
||||
$(V)echo "Applying clang-format..."
|
||||
$(V)find src/ -name '*.c' -o -name '*.h' | xargs clang-format -i -style=file
|
||||
|
||||
run-tests:
|
||||
$(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
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
$(V)rm -rf $(BUILDDIR)
|
||||
build-docker:
|
||||
$(V)docker rm -f $(docker_container_name) 2> /dev/null || true
|
||||
$(V)docker build -t $(docker_image_name) -f Dockerfile .
|
||||
$(V)docker create --name $(docker_container_name) $(docker_image_name)
|
||||
$(V)rm -rf $(builddir_docker)
|
||||
$(V)mkdir -p $(builddir_docker)
|
||||
$(V)docker cp $(docker_container_name):/bemanitools/build $(builddir_docker)
|
||||
$(V)mv $(builddir_docker)/build/* $(builddir_docker)
|
||||
$(V)rm -r $(builddir_docker)/build
|
||||
|
||||
#
|
||||
# Pull in module definitions
|
||||
@@ -54,11 +103,12 @@ libs :=
|
||||
avsdlls :=
|
||||
avsexes :=
|
||||
|
||||
testdlls :=
|
||||
testexes :=
|
||||
|
||||
include Module.mk
|
||||
|
||||
modules := $(dlls) $(exes) $(libs) $(avsdlls) $(avsexes) $(testexes)
|
||||
modules := $(dlls) $(exes) $(libs) $(avsdlls) $(avsexes) $(testdlls) $(testexes)
|
||||
|
||||
#
|
||||
# $1: Bitness
|
||||
@@ -70,6 +120,7 @@ define t_moddefs
|
||||
|
||||
cppflags_$3 += $(cppflags) -DBUILD_MODULE=$3
|
||||
cflags_$3 += $(cflags)
|
||||
release: cflags_$3 += $(cflags_release)
|
||||
ldflags_$3 += $(ldflags)
|
||||
srcdir_$3 ?= src/main/$3
|
||||
|
||||
@@ -94,6 +145,7 @@ $$(eval $$(foreach lib,$(libs),$$(call t_archive,$1,indep,$$(lib))))
|
||||
|
||||
$$(eval $$(foreach avsver,$$(avsvers_$1),$$(call t_avsver,$1,$$(avsver))))
|
||||
|
||||
$$(eval $$(foreach dll,$(testdlls),$$(call t_linkdll,$1,indep,$$(dll))))
|
||||
$$(eval $$(foreach exe,$(testexes),$$(call t_linkexe,$1,indep,$$(exe))))
|
||||
|
||||
endef
|
||||
|
||||
170
Module.mk
170
Module.mk
@@ -42,7 +42,7 @@
|
||||
# 15: Patch 8: DanceDanceRevolution (2013)
|
||||
# beatmania IIDX 20 tricoro
|
||||
# pop'n music 21 Sunny Park
|
||||
# SOUND VOLTEX (all known versions)
|
||||
# SOUND VOLTEX (1-4)
|
||||
# jubeat prop
|
||||
#
|
||||
# 16: Patch 1: beatmania IIDX 21 SPADA
|
||||
@@ -53,6 +53,9 @@
|
||||
# "Patch" 7: Steel Chronicle VicTroopers (not a Bemani, w/e)
|
||||
#
|
||||
# 17: Patch 0: beatmania IIDX 25 CANNON BALLERS
|
||||
# beatmania IIDX 26 Rootage
|
||||
#
|
||||
# Patch 3: SOUND VOLTEX VIVID WAVE
|
||||
#
|
||||
|
||||
cflags += \
|
||||
@@ -74,14 +77,21 @@ imps += avs avs-ea3
|
||||
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/Module.mk
|
||||
include src/main/bio2emu-iidx/Module.mk
|
||||
include src/main/bsthook/Module.mk
|
||||
include src/main/bstio/Module.mk
|
||||
include src/main/camhook/Module.mk
|
||||
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/dinput/Module.mk
|
||||
include src/main/eamio/Module.mk
|
||||
include src/main/eamio-icca/Module.mk
|
||||
include src/main/eamiotest/Module.mk
|
||||
@@ -113,12 +123,14 @@ 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/iidxhook9/Module.mk
|
||||
include src/main/iidxio/Module.mk
|
||||
include src/main/iidxio-ezusb/Module.mk
|
||||
include src/main/iidxio-ezusb2/Module.mk
|
||||
include src/main/iidxiotest/Module.mk
|
||||
include src/main/inject/Module.mk
|
||||
include src/main/jbio/Module.mk
|
||||
include src/main/jbiotest/Module.mk
|
||||
include src/main/jbhook/Module.mk
|
||||
include src/main/jbhook1/Module.mk
|
||||
include src/main/launcher/Module.mk
|
||||
@@ -129,17 +141,25 @@ 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/sdvxio-kfca/Module.mk
|
||||
include src/main/sdvxio-bio2/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-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/security/Module.mk
|
||||
include src/test/test/Module.mk
|
||||
include src/test/util/Module.mk
|
||||
include src/test/iidxhook8/Module.mk
|
||||
|
||||
#
|
||||
# Distribution build rules
|
||||
@@ -158,6 +178,7 @@ $(zipdir)/tools.zip: \
|
||||
build/bin/indep-32/iidxiotest.exe \
|
||||
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 \
|
||||
@@ -170,27 +191,23 @@ $(zipdir)/tools.zip: \
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(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-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 $@ $^
|
||||
|
||||
$(zipdir)/src.zip: .git/HEAD $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)git archive -o $@ HEAD
|
||||
|
||||
$(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 \
|
||||
@@ -214,11 +231,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 \
|
||||
@@ -233,11 +247,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 \
|
||||
@@ -259,11 +270,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 \
|
||||
@@ -278,11 +286,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 \
|
||||
@@ -297,11 +302,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 \
|
||||
@@ -316,11 +318,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 \
|
||||
@@ -336,25 +335,56 @@ $(zipdir)/iidx-21-to-24.zip: \
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/iidx-25.zip: \
|
||||
$(zipdir)/iidx-25-to-26.zip: \
|
||||
build/bin/avs2_1700-64/iidxhook8.dll \
|
||||
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 \
|
||||
dist/iidx/gamestart-26.bat \
|
||||
dist/iidx/iidxhook-25.conf \
|
||||
dist/iidx/iidxhook-26.conf \
|
||||
dist/iidx/vefx.txt \
|
||||
| $(zipdir)/
|
||||
$(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-ezusb.dll \
|
||||
build/bin/indep-32/iidxio-ezusb2.dll \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/iidx-hwio-x64.zip: \
|
||||
build/bin/indep-64/eamio-icca.dll \
|
||||
build/bin/indep-64/iidxio-ezusb.dll \
|
||||
build/bin/indep-64/iidxio-ezusb2.dll \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/jb-01.zip: \
|
||||
build/bin/avs2_803-32/jbhook1.dll \
|
||||
build/bin/indep-32/inject.exe \
|
||||
@@ -395,7 +425,7 @@ $(zipdir)/jb-08.zip: \
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/sdvx.zip: \
|
||||
$(zipdir)/sdvx-01-to-04.zip: \
|
||||
build/bin/avs2_1508-32/launcher.exe \
|
||||
build/bin/avs2_1508-32/sdvxhook.dll \
|
||||
build/bin/indep-32/config.exe \
|
||||
@@ -408,6 +438,50 @@ $(zipdir)/sdvx.zip: \
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/sdvx-05.zip: \
|
||||
build/bin/avs2_1700-64/launcher.exe \
|
||||
build/bin/avs2_1700-64/sdvxhook2.dll \
|
||||
build/bin/indep-64/config.exe \
|
||||
build/bin/indep-64/eamio.dll \
|
||||
build/bin/indep-64/geninput.dll \
|
||||
build/bin/indep-64/sdvxio.dll \
|
||||
dist/sdvx5/config.bat \
|
||||
dist/sdvx5/gamestart.bat \
|
||||
dist/sdvx5/sdvxhook2.conf \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/sdvx-05-cn.zip: \
|
||||
build/bin/avs2_1700-64/launcher.exe \
|
||||
build/bin/avs2_1700-64/sdvxhook2-cn.dll \
|
||||
build/bin/indep-64/config.exe \
|
||||
build/bin/indep-64/eamio.dll \
|
||||
build/bin/indep-64/geninput.dll \
|
||||
build/bin/indep-64/sdvxio.dll \
|
||||
dist/sdvx5/config.bat \
|
||||
dist/sdvx5/gamestart-cn.bat \
|
||||
dist/sdvx5/sdvxhook2-cn.conf \
|
||||
| $(zipdir)/
|
||||
$(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 \
|
||||
@@ -428,6 +502,22 @@ $(zipdir)/ddr-12-to-16.zip: \
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/ddr-16-x64.zip: \
|
||||
build/bin/avs2_1603-64/launcher.exe \
|
||||
build/bin/avs2_1603-64/ddrhook.dll \
|
||||
build/bin/avs2_1603-64/unicorntail.dll \
|
||||
build/bin/indep-64/config.exe \
|
||||
build/bin/indep-64/ddrio.dll \
|
||||
build/bin/indep-64/ddrio-mm.dll \
|
||||
build/bin/indep-64/ddrio-smx.dll \
|
||||
build/bin/indep-64/eamio.dll \
|
||||
build/bin/indep-64/geninput.dll \
|
||||
dist/ddr/config.bat \
|
||||
dist/ddr/gamestart-16.bat \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
$(V)zip -j $@ $^
|
||||
|
||||
$(zipdir)/bst.zip: \
|
||||
build/bin/avs2_1603-64/bsthook.dll \
|
||||
build/bin/avs2_1603-64/launcher.exe \
|
||||
@@ -444,6 +534,7 @@ $(zipdir)/bst.zip: \
|
||||
|
||||
$(zipdir)/doc.zip: \
|
||||
doc/iidxhook \
|
||||
doc/sdvxhook \
|
||||
doc/jbhook \
|
||||
doc/tools \
|
||||
| $(zipdir)/
|
||||
@@ -456,10 +547,13 @@ $(BUILDDIR)/tests.zip: \
|
||||
build/bin/indep-32/cconfig-test.exe \
|
||||
build/bin/indep-32/cconfig-util-test.exe \
|
||||
build/bin/indep-32/cconfig-cmd-test.exe \
|
||||
build/bin/indep-32/d3d9hook.dll \
|
||||
build/bin/indep-32/d3d9hook-test.exe \
|
||||
build/bin/indep-32/iidxhook-util-config-eamuse-test.exe \
|
||||
build/bin/indep-32/iidxhook-util-config-gfx-test.exe \
|
||||
build/bin/indep-32/iidxhook-util-config-misc-test.exe \
|
||||
build/bin/indep-32/iidxhook-util-config-sec-test.exe \
|
||||
build/bin/indep-32/inject.exe \
|
||||
build/bin/indep-32/security-id-test.exe \
|
||||
build/bin/indep-32/security-mcode-test.exe \
|
||||
build/bin/indep-32/security-rp-test.exe \
|
||||
@@ -467,6 +561,7 @@ $(BUILDDIR)/tests.zip: \
|
||||
build/bin/indep-32/security-rp3-test.exe \
|
||||
build/bin/indep-32/security-util-test.exe \
|
||||
build/bin/indep-32/util-net-test.exe \
|
||||
build/bin/indep-64/iidxhook8-config-cam-test.exe \
|
||||
dist/test/run-tests.sh \
|
||||
| $(zipdir)/
|
||||
$(V)echo ... $@
|
||||
@@ -475,6 +570,7 @@ $(BUILDDIR)/tests.zip: \
|
||||
$(BUILDDIR)/bemanitools.zip: \
|
||||
$(zipdir)/bst.zip \
|
||||
$(zipdir)/ddr-12-to-16.zip \
|
||||
$(zipdir)/ddr-16-x64.zip \
|
||||
$(zipdir)/doc.zip \
|
||||
$(zipdir)/iidx-09-to-12.zip \
|
||||
$(zipdir)/iidx-13.zip \
|
||||
@@ -483,12 +579,18 @@ $(BUILDDIR)/bemanitools.zip: \
|
||||
$(zipdir)/iidx-19.zip \
|
||||
$(zipdir)/iidx-20.zip \
|
||||
$(zipdir)/iidx-21-to-24.zip \
|
||||
$(zipdir)/iidx-25.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)/src.zip \
|
||||
$(zipdir)/sdvx.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 \
|
||||
|
||||
123
README.md
123
README.md
@@ -1,5 +1,8 @@
|
||||
# Bemanitools 5
|
||||
Version: 5.26</br>
|
||||
[](https://dev.s-ul.eu/djhackers/bemanitools/commits/master)
|
||||
|
||||
Version: 5.33
|
||||
|
||||
[Release history](CHANGELOG.md)
|
||||
|
||||
A collection of tools to run [various Bemani arcade games](#list-of-supported-games).
|
||||
@@ -11,43 +14,46 @@ authentic gameplay experience, and easier support for a broader range of release
|
||||
|
||||
# List of supported games
|
||||
* BeatStream
|
||||
* BeatStream (bst.zip)
|
||||
* BeatStream アニムトライヴ (bst.zip)
|
||||
* BeatStream (bst.zip) using bsthook
|
||||
* BeatStream アニムトライヴ (bst.zip) using bsthook
|
||||
* Dance Dance Revolution
|
||||
* Dance Dance Revolution X2 (ddr-12-to-16.zip)
|
||||
* Dance Dance Revolution X3 vs. 2ndMIX (ddr-12-to-16.zip)
|
||||
* Dance Dance Revolution 2013 (ddr-12-to-16.zip)
|
||||
* Dance Dance Revolution 2014 (ddr-12-to-16.zip)
|
||||
* Dance Dance Revolution A (ddr-12-to-16.zip)
|
||||
* Dance Dance Revolution X2 (ddr-12-to-16.zip) using ddrhook
|
||||
* Dance Dance Revolution X3 vs. 2ndMIX (ddr-12-to-16.zip) using ddrhook
|
||||
* Dance Dance Revolution 2013 (ddr-12-to-16.zip) using ddrhook
|
||||
* Dance Dance Revolution 2014 (ddr-12-to-16.zip) using ddrhook
|
||||
* Dance Dance Revolution A (ddr-12-to-16.zip) using ddrhook
|
||||
* Beatmania IIDX
|
||||
* Beatmania IIDX 9th Style (iidx-09-to-12.zip)
|
||||
* Beatmania IIDX 10th Style (iidx-09-to-12.zip)
|
||||
* Beatmania IIDX 11 IIDX RED (iidx-09-to-12.zip)
|
||||
* Beatmania IIDX 12 HAPPY SKY (iidx-09-to-12.zip)
|
||||
* Beatmania IIDX 13 DistorteD (iidx-13.zip)
|
||||
* Beatmania IIDX 14 GOLD (iidx-14-to-17.zip)
|
||||
* Beatmania IIDX 15 DJ TROOPERS (iidx-14-to-17.zip)
|
||||
* Beatmania IIDX 16 EMPRESS (iidx-14-to-17.zip)
|
||||
* Beatmania IIDX 17 SIRIUS (iidx-14-to-17.zip)
|
||||
* Beatmania IIDX 18 Resort Anthem (iidx-18.zip)
|
||||
* Beatmania IIDX 19 Lincle (iidx-19.zip)
|
||||
* Beatmania IIDX 20 Tricoro (iidx-20.zip)
|
||||
* Beatmania IIDX 21 SPADA (iidx-21-to-24.zip)
|
||||
* Beatmania IIDX 22 PENDUAL (iidx-21-to-24.zip)
|
||||
* Beatmania IIDX 23 copula (iidx-21-to-24.zip)
|
||||
* Beatmania IIDX 24 SINOBUZ (iidx-21-to-24.zip)
|
||||
* Beatmania IIDX 25 CANNON BALLERS (iidx-25.zip)
|
||||
* Beatmania IIDX 9th Style (iidx-09-to-12.zip) using [iidxhook1](doc/iidxhook/iidxhook1.md)
|
||||
* Beatmania IIDX 10th Style (iidx-09-to-12.zip) using [iidxhook1](doc/iidxhook/iidxhook1.md)
|
||||
* Beatmania IIDX 11 IIDX RED (iidx-09-to-12.zip) using [iidxhook1](doc/iidxhook/iidxhook1.md)
|
||||
* Beatmania IIDX 12 HAPPY SKY (iidx-09-to-12.zip) using [iidxhook1](doc/iidxhook/iidxhook1.md)
|
||||
* Beatmania IIDX 13 DistorteD (iidx-13.zip) using [iidxhook2](doc/iidxhook/iidxhook2.md)
|
||||
* Beatmania IIDX 14 GOLD (iidx-14-to-17.zip) using [iidxhook3](doc/iidxhook/iidxhook3.md)
|
||||
* Beatmania IIDX 15 DJ TROOPERS (iidx-14-to-17.zip) using [iidxhook3](doc/iidxhook/iidxhook3.md)
|
||||
* Beatmania IIDX 16 EMPRESS (iidx-14-to-17.zip) using [iidxhook3](doc/iidxhook/iidxhook3.md)
|
||||
* Beatmania IIDX 17 SIRIUS (iidx-14-to-17.zip) using [iidxhook3](doc/iidxhook/iidxhook3.md)
|
||||
* Beatmania IIDX 18 Resort Anthem (iidx-18.zip) using [iidxhook4](doc/iidxhook/iidxhook4.md)
|
||||
* Beatmania IIDX 19 Lincle (iidx-19.zip) using [iidxhook5](doc/iidxhook/iidxhook5.md)
|
||||
* Beatmania IIDX 20 Tricoro (iidx-20.zip) using [iidxhook6](doc/iidxhook/iidxhook6.md)
|
||||
* Beatmania IIDX 21 SPADA (iidx-21-to-24.zip) using [iidxhook7](doc/iidxhook/iidxhook7.md)
|
||||
* Beatmania IIDX 22 PENDUAL (iidx-21-to-24.zip) using [iidxhook7](doc/iidxhook/iidxhook7.md)
|
||||
* Beatmania IIDX 23 copula (iidx-21-to-24.zip) using [iidxhook7](doc/iidxhook/iidxhook7.md)
|
||||
* 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)
|
||||
* jubeat saucer (fulfill) (jb-05-to-07.zip)
|
||||
* jubeat prop (jb-05-to-07.zip)
|
||||
* jubeat Qubell (jb-05-to-07.zip)
|
||||
* jubeat clan (jb-08.zip)
|
||||
* jubeat (experimental/buggy) (jb-01.zip) using [jbhook1](doc/jbhook1/jbhook1.md)
|
||||
* jubeat saucer (fulfill) (jb-05-to-07.zip) using jbhook
|
||||
* jubeat prop (jb-05-to-07.zip) using jbhook
|
||||
* jubeat Qubell (jb-05-to-07.zip) using jbhook
|
||||
* jubeat clan (jb-08.zip) using jbhook
|
||||
* SOUND VOLTEX
|
||||
* SOUND VOLTEX BOOTH (sdvx.zip)
|
||||
* SOUND VOLTEX II -infinite infection- (sdvx.zip)
|
||||
* SOUND VOLTEX III GRAVITY WARS (sdvx.zip)
|
||||
* SOUND VOLTEX IV HEAVENLY HAVEN (sdvx.zip)
|
||||
* SOUND VOLTEX BOOTH (sdvx-01-to-04.zip) using sdvxhook
|
||||
* SOUND VOLTEX II -infinite infection- (sdvx-01-to-04.zip) using sdvxhook
|
||||
* SOUND VOLTEX III GRAVITY WARS (sdvx-01-to-04.zip) using sdvxhook
|
||||
* SOUND VOLTEX IV HEAVENLY HAVEN (sdvx-01-to-04.zip) using sdvxhook
|
||||
* SOUND VOLTEX Vivid Wave (sdvx-05.zip) using sdvxhook2
|
||||
|
||||
# Supported platforms
|
||||
Our main platforms are currently Windows XP and Windows 7 which are also the target platforms on the original hardware
|
||||
@@ -63,39 +69,30 @@ 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
|
||||
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.
|
||||
|
||||
Depending on the game, you also need the following dependencies installed:
|
||||
* DirectX 9 runtime
|
||||
* 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).
|
||||
|
||||
## 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
|
||||
Please refer to the [API documentation](doc/api.md).
|
||||
|
||||
## Source Code
|
||||
The source code is included with this distribution package (src.zip). Please refer to the
|
||||
[development document](doc/development.md) for further details.
|
||||
|
||||
## Bugs and TODOs
|
||||
We have our own issue tracker for this. If you want to contribute or have any bugs to report, please reach out to us on
|
||||
the various channels we are available on. Please help us by providing a detailed description of your concern including:
|
||||
* The version of bemanitools you are using
|
||||
* The games affected including version
|
||||
* Log output of bemanitools and the game
|
||||
* The APIs you have been using with bemanitools, e.g. iidxio-keyboard, eamio-keyboard.
|
||||
* The OS version you are running this on
|
||||
* Specs of your hardware including CPU, RAM, GPU
|
||||
* A detailed description of your issue. Describe the symptoms and the steps to trigger and reproduce them. Videos and
|
||||
screenshots might be helpful depending on the issue.
|
||||
|
||||
## Contributions
|
||||
Patches are welcome! Let us know if you have any contributions, e.g. bugfixes, and send us a patch file. Please read
|
||||
our [development guidelines](doc/development.md) as they contain valuable information that your contribution meets our
|
||||
standards.
|
||||
|
||||
Once submitted, 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.
|
||||
|
||||
## 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). However, our time and workforce is limited. If you are
|
||||
interested in contributing, please check the [contribution section](#contributions).
|
||||
|
||||
# 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.
|
||||
|
||||
2
dist/bst/config.bat
vendored
2
dist/bst/config.bat
vendored
@@ -1 +1 @@
|
||||
@start config bst
|
||||
@start config.exe bst
|
||||
|
||||
2
dist/ddr/config.bat
vendored
2
dist/ddr/config.bat
vendored
@@ -1 +1 @@
|
||||
@start config ddr
|
||||
@start config.exe ddr
|
||||
|
||||
2
dist/iidx/config.bat
vendored
2
dist/iidx/config.bat
vendored
@@ -1 +1 @@
|
||||
@start config iidx
|
||||
@start config.exe iidx
|
||||
|
||||
16
dist/iidx/gamestart-26.bat
vendored
Normal file
16
dist/iidx/gamestart-26.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 -K iidxhook8.dll bm2dx.dll --config iidxhook-26.conf %*
|
||||
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 %*
|
||||
17
dist/iidx/iidxhook-09.conf
vendored
17
dist/iidx/iidxhook-09.conf
vendored
@@ -25,11 +25,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,12 +40,15 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
# Use d3d9 hooks instead of d3d8 to enable d3d9 hook features not available on d3d8 (e.g. upscaling). Requires d3d8to9 wrapper library to be used with this game.
|
||||
misc.use_d3d9_hooks=false
|
||||
|
||||
# Stub calls to rteffect.dll (10th to DistorteD)
|
||||
misc.rteffect_stub=false
|
||||
|
||||
|
||||
17
dist/iidx/iidxhook-10.conf
vendored
17
dist/iidx/iidxhook-10.conf
vendored
@@ -25,11 +25,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,12 +40,15 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
# Use d3d9 hooks instead of d3d8 to enable d3d9 hook features not available on d3d8 (e.g. upscaling). Requires d3d8to9 wrapper library to be used with this game.
|
||||
misc.use_d3d9_hooks=false
|
||||
|
||||
# Stub calls to rteffect.dll (10th to DistorteD)
|
||||
misc.rteffect_stub=false
|
||||
|
||||
|
||||
17
dist/iidx/iidxhook-11.conf
vendored
17
dist/iidx/iidxhook-11.conf
vendored
@@ -25,11 +25,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,12 +40,15 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
# Use d3d9 hooks instead of d3d8 to enable d3d9 hook features not available on d3d8 (e.g. upscaling). Requires d3d8to9 wrapper library to be used with this game.
|
||||
misc.use_d3d9_hooks=false
|
||||
|
||||
# Stub calls to rteffect.dll (10th to DistorteD)
|
||||
misc.rteffect_stub=false
|
||||
|
||||
|
||||
17
dist/iidx/iidxhook-12.conf
vendored
17
dist/iidx/iidxhook-12.conf
vendored
@@ -25,11 +25,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,12 +40,15 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Fix broken 3D background on Happy Sky's music select (if appearing completely white)
|
||||
misc.happy_sky_ms_bg_fix=false
|
||||
|
||||
# Use d3d9 hooks instead of d3d8 to enable d3d9 hook features not available on d3d8 (e.g. upscaling). Requires d3d8to9 wrapper library to be used with this game.
|
||||
misc.use_d3d9_hooks=false
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
|
||||
17
dist/iidx/iidxhook-13.conf
vendored
17
dist/iidx/iidxhook-13.conf
vendored
@@ -25,11 +25,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,12 +40,15 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Fix broken 3D background on DistorteD's music select (if appearing completely black)
|
||||
misc.distorted_ms_bg_fix=false
|
||||
|
||||
# Use d3d9 hooks instead of d3d8 to enable d3d9 hook features not available on d3d8 (e.g. upscaling). Requires d3d8to9 wrapper library to be used with this game.
|
||||
misc.use_d3d9_hooks=false
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
|
||||
14
dist/iidx/iidxhook-14.conf
vendored
14
dist/iidx/iidxhook-14.conf
vendored
@@ -22,11 +22,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -37,6 +37,12 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
|
||||
14
dist/iidx/iidxhook-15.conf
vendored
14
dist/iidx/iidxhook-15.conf
vendored
@@ -22,11 +22,11 @@ gfx.monitor_check=-1.000000
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -37,6 +37,12 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
|
||||
14
dist/iidx/iidxhook-16.conf
vendored
14
dist/iidx/iidxhook-16.conf
vendored
@@ -25,11 +25,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,6 +40,12 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
|
||||
14
dist/iidx/iidxhook-17.conf
vendored
14
dist/iidx/iidxhook-17.conf
vendored
@@ -25,11 +25,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -40,6 +40,12 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disable operator clock setting system clock time
|
||||
misc.disable_clock_set=false
|
||||
|
||||
|
||||
14
dist/iidx/iidxhook-18.conf
vendored
14
dist/iidx/iidxhook-18.conf
vendored
@@ -16,11 +16,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -30,3 +30,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-19.conf
vendored
14
dist/iidx/iidxhook-19.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -27,3 +27,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-20.conf
vendored
14
dist/iidx/iidxhook-20.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -27,3 +27,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-21.conf
vendored
14
dist/iidx/iidxhook-21.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -27,3 +27,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-22.conf
vendored
14
dist/iidx/iidxhook-22.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -27,3 +27,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-23.conf
vendored
14
dist/iidx/iidxhook-23.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -27,3 +27,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-24.conf
vendored
14
dist/iidx/iidxhook-24.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -27,3 +27,9 @@ gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
14
dist/iidx/iidxhook-25.conf
vendored
14
dist/iidx/iidxhook-25.conf
vendored
@@ -13,11 +13,11 @@ gfx.pci_id=1002:7146
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=-1
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=-1
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
@@ -28,6 +28,12 @@ gfx.scale_back_buffer_height=0
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disables the camera emulation
|
||||
cam.disable_emu=false
|
||||
|
||||
|
||||
53
dist/iidx/iidxhook-26.conf
vendored
Normal file
53
dist/iidx/iidxhook-26.conf
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# Fix stretched BG videos on newer GPUs. Might appear on Red and newer
|
||||
gfx.bgvideo_uv_fix=false
|
||||
|
||||
# Run the game in a framed window (requires windowed option)
|
||||
gfx.framed=false
|
||||
|
||||
# Software limit the frame rate of the rendering loop in hz, e.g. 60 or 59.95 (0.0 = no software limit)
|
||||
gfx.frame_rate_limit=0.0
|
||||
|
||||
# Patch the GPU device ID detection (leave empty to disable), format XXXX:YYYY, two 4 digit hex numbers (vid:pid). Examples: 1002:7146 (RV515, Radeon X1300), 1002:95C5 (RV620 LE, Radeon HD3450)
|
||||
gfx.pci_id=1002:7146
|
||||
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, 0 for default size
|
||||
gfx.window_width=0
|
||||
|
||||
# Windowed height, 0 for default size
|
||||
gfx.window_height=0
|
||||
|
||||
# Up-/downscale the back buffer's width. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding height parameter.
|
||||
gfx.scale_back_buffer_width=0
|
||||
|
||||
# Up-/downscale the back buffer's height. This does not change the game's rendering resolution but scales the final frame. Use this to target the native resolution of your monitor/TV, e.g. to avoid over-/underscan, bad image quality or latency caused by the monitors internal upscaler. 0 to disable this feature. Must be set in combination with the corresponding width parameter.
|
||||
gfx.scale_back_buffer_height=0
|
||||
|
||||
# Filter type to use for up-/downscaling the back buffer. Only used if scaling feature was enabled by setting the scaling width and height parameters. Available types: none, linear, point (refer to D3DTEXTUREFILTERTYPE for explanation).
|
||||
gfx.scale_back_buffer_filter=none
|
||||
|
||||
# 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
|
||||
|
||||
# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter
|
||||
gfx.device_adapter=-1
|
||||
|
||||
# Disables the camera emulation
|
||||
cam.disable_emu=false
|
||||
|
||||
# Override camera device ID 1 detection (copy from device manager, do not escape)
|
||||
cam.device_id1=
|
||||
|
||||
# Override camera device ID 2 detection (copy from device manager, do not escape)
|
||||
cam.device_id2=
|
||||
|
||||
# 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
|
||||
63
dist/iidx/iidxhook-27.conf
vendored
Normal file
63
dist/iidx/iidxhook-27.conf
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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)
|
||||
|
||||
2
dist/jb/config.bat
vendored
2
dist/jb/config.bat
vendored
@@ -1 +1 @@
|
||||
@start config jb
|
||||
@start config.exe jb
|
||||
|
||||
2
dist/old/config-dm.bat
vendored
2
dist/old/config-dm.bat
vendored
@@ -1 +1 @@
|
||||
@start config dm
|
||||
@start config.exe dm
|
||||
|
||||
2
dist/old/config-gf.bat
vendored
2
dist/old/config-gf.bat
vendored
@@ -1 +1 @@
|
||||
@start config gf
|
||||
@start config.exe gf
|
||||
|
||||
2
dist/old/config-pnm.bat
vendored
2
dist/old/config-pnm.bat
vendored
@@ -1 +1 @@
|
||||
@start config pnm
|
||||
@start config.exe pnm
|
||||
|
||||
2
dist/old/config-sdvx.bat
vendored
2
dist/old/config-sdvx.bat
vendored
@@ -1 +1 @@
|
||||
@start config sdvx
|
||||
@start config.exe sdvx
|
||||
|
||||
2
dist/sdvx/config.bat
vendored
2
dist/sdvx/config.bat
vendored
@@ -1 +1 @@
|
||||
@start config sdvx
|
||||
@start config.exe sdvx
|
||||
|
||||
1
dist/sdvx5/config.bat
vendored
Normal file
1
dist/sdvx5/config.bat
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@start config.exe sdvx
|
||||
17
dist/sdvx5/gamestart-cn.bat
vendored
Normal file
17
dist/sdvx5/gamestart-cn.bat
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@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\c.dest echo $null >> dev\raw\c.dest
|
||||
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 268435456 -K sdvxhook2-cn.dll soundvoltex.dll --config sdvxhook2-cn.conf %*
|
||||
16
dist/sdvx5/gamestart.bat
vendored
Normal file
16
dist/sdvx5/gamestart.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 268435456 -K sdvxhook2.dll soundvoltex.dll --config sdvxhook2.conf %*
|
||||
24
dist/sdvx5/sdvxhook2-cn.conf
vendored
Normal file
24
dist/sdvx5/sdvxhook2-cn.conf
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Disable IO emulation and enable usage of real KFCA hardware
|
||||
io.disable_io_emu=false
|
||||
|
||||
# Path to unis version file under the prop.s folder
|
||||
cn.unis_path=prop/unis.xml
|
||||
|
||||
# Run the game in a framed window (requires windowed option)
|
||||
gfx.framed=true
|
||||
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=720
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=1280
|
||||
|
||||
# Disables the camera emulation
|
||||
cam.disable_emu=false
|
||||
|
||||
# Override camera device ID detection (copy from device manager, do not escape)
|
||||
cam.device_id1=
|
||||
|
||||
48
dist/sdvx5/sdvxhook2.conf
vendored
Normal file
48
dist/sdvx5/sdvxhook2.conf
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# Disable card reader emulation and enable usage of real card reader hardware on COM2
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# Run the game windowed
|
||||
gfx.windowed=false
|
||||
|
||||
# Confine mouse coursor to window
|
||||
gfx.confined=false
|
||||
|
||||
# Windowed width, -1 for default size
|
||||
gfx.window_width=1080
|
||||
|
||||
# Windowed height, -1 for default size
|
||||
gfx.window_height=1920
|
||||
|
||||
# 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
|
||||
|
||||
# Disables the camera emulation
|
||||
cam.disable_emu=false
|
||||
|
||||
# Override camera device ID detection (copy from device manager, do not escape)
|
||||
cam.device_id1=
|
||||
|
||||
# IP of adapter to force override with
|
||||
adapter.override_ip=
|
||||
|
||||
2
dist/test/run-tests.sh
vendored
2
dist/test/run-tests.sh
vendored
@@ -25,4 +25,6 @@ wine ./security-rp2-test.exe
|
||||
wine ./security-rp3-test.exe
|
||||
wine ./util-net-test.exe
|
||||
|
||||
wine ./inject.exe d3d9hook.dll d3d9hook-test.exe
|
||||
|
||||
echo "All tests successful."
|
||||
182
doc/architecture.md
Normal file
182
doc/architecture.md
Normal file
@@ -0,0 +1,182 @@
|
||||
# Bemanitools architecture
|
||||
This document gives you an overview of the architecture of Bemanitools (5). Why do we need this? This helps document the
|
||||
various design decisions and how everything comes together, in the end. At some point when things are evolving and other
|
||||
developers want to pick up the project, this might give them answers to why some things were done well or not so well.
|
||||
This allows them to iterate on the current design (document) to analyze if a change they want to apply might work out
|
||||
or not.
|
||||
|
||||
Anway, enough preface...I guess you got the idea. This document will be split into several sections which address
|
||||
different aspects of the architecture.
|
||||
|
||||
## The big picture
|
||||
TODO create a graphic that presents the key modules and ideas.
|
||||
|
||||
## Detouring library functions, IAT hooking
|
||||
One of Bemanitools's goals is to avoid patching of executables, libraries or any game data and instead rely on
|
||||
intercepting calls to libraries to patch bugs or introduce new features. To support a game on a non native platform
|
||||
transparently, e.g. your home desktop, this allows us to intercept I/O communication to emulate hardware or
|
||||
files/filesystem features the game expects to be available.
|
||||
|
||||
We create a so called "hook library/hook.dll" which gets injected to the target process (the game) before the game
|
||||
runs any of its application code. This is well known by the terms of dll injection and will not be further discussed
|
||||
here (google it). The injected dll will replace the function addresses in the IATs to detour any calls to our own
|
||||
handler functions before, eventually, calling the real function. This way, we can intercept the call and do cool things.
|
||||
|
||||
These features are covered by the modules in the following subfolders in src/main:
|
||||
* hook: Essentially, this is capnhook: https://github.com/decafcode/capnhook. General tools for hooking Win32 API calls.
|
||||
* hooklib: Some additional helper modules to take care of specific issues in Bemanitools, e.g. rs232 related stuff for
|
||||
ACIO.
|
||||
|
||||
Check the modules for details.
|
||||
|
||||
## Hooking and IRP
|
||||
IRP stands for "I/O request packet" and is a kernel mode structure used in Windows drivers for communication with the
|
||||
OS. The data structure describes an I/O request with parameters for that request avoiding function calls with large
|
||||
number of arguments to a driver.
|
||||
|
||||
We make use of that "IRP pattern" by creating a flexible and maintainable abstraction layer for the following hooking
|
||||
modules:
|
||||
* iohook: Hook I/O (e.g. file) related calls
|
||||
* d3d9: Hook d3d9 graphics API calls
|
||||
|
||||
An IRP handler is implemented to handle selected IRP calls based on the specified operation type. IRP handlers can be
|
||||
chained which allows splitting up different features/interceptors to different functions and modules allowing you to
|
||||
create a clear structure. At the end of the forwarding chain, you the real API function that maps to the abstracted
|
||||
operation is called. However, a handler can decide at any time to not forward calls which allows you to implement
|
||||
emulation of access to selected files or I/O devices.
|
||||
|
||||
Modules that make use of this:
|
||||
* iidxhook-util/d3d9
|
||||
* ezusb-emu/device
|
||||
* ezusb2-emu/device
|
||||
* acioemu/emu
|
||||
|
||||
## Bemanitools's hook libraries, let's glue everything together
|
||||
Bemanitools dlls to be injected into target game processes are refered to as "hook dlls" and come in different flavours
|
||||
targetting different games and often different versions of the same game (series), for example:
|
||||
* ddrhook: Hook dll for Dance Dance Revolution games
|
||||
* iidxhook1-8: Hook dlls for Beatmania IIDX, we are currently at 8 different implementations due to the various
|
||||
iterations the game went through, related to software and hardware.
|
||||
* sdvxhook: Hook dll for SoundVoltex series
|
||||
|
||||
The following sub-sections will give you some brief insights on each hook implementation and what modules were used.
|
||||
|
||||
### bsthook
|
||||
TODO
|
||||
|
||||
### ddrhook
|
||||
TODO
|
||||
|
||||
### iidxhook
|
||||
IIDX went through so many hard- and software iterations, it's actually amazing that the development team(s) refactored
|
||||
and improved parts of the game and hardware with each iteration. However, when facing emulation and supporting
|
||||
compatibility to legacy OS platforms, it can't get any worse. On the bright side, IIDX helped shaping Bemanitools a lot
|
||||
and created a solid foundation other games can build on.
|
||||
|
||||
Because of that, we have 8 iidxhook implementations supporting sometimes different software features/fixes and
|
||||
hardware. The following sub-sub-sections list the most relevant aspects and modules to point out common and different
|
||||
higher level features.
|
||||
|
||||
Essentially, the main module file of each iidxhook implementation just glues the APIs of the modules it requires
|
||||
together. An additional configuration layer allows users to tweak some of the features.
|
||||
|
||||
TODO go into some more detail about some differences in the hook modules, e.g. 18 to 19 look identical
|
||||
-> but different AVS versions
|
||||
|
||||
#### iidxhook1 (9-12)
|
||||
* Ezusb C02 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full security emulation with SRAM and round plugs
|
||||
* Full serial emulation for magstripe card readers
|
||||
* Full game essential I/O emulation
|
||||
* d3d8 patching and extended features (superseded by d3d9 hook module + d3d8to9 wrapper)
|
||||
* clock patching
|
||||
* Font patching for Japanese chars
|
||||
* Network related patches to enable eamuse to custom servers
|
||||
* Filesystem patches to detour E and F backup drives for settings
|
||||
|
||||
#### iidxhook2 (13)
|
||||
* Ezusb C02 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full security emulation with SRAM and round plugs
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, slotted readers
|
||||
* d3d8 patching and extended features (superseded by d3d9 hook module + d3d8to9 wrapper)
|
||||
* clock patching
|
||||
* Font patching for Japanese chars
|
||||
* Network related patches to enable eamuse to custom servers
|
||||
* Filesystem patches to detour E and F backup drives for settings
|
||||
|
||||
#### iidxhook3 (14-17)
|
||||
* Ezusb IO2 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full security emulation with SRAM and round plugs
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, slotted readers
|
||||
* d3d9 patching and extended features
|
||||
* Font patching for Japanese chars
|
||||
* Network related patches to enable eamuse to custom servers
|
||||
* Filesystem patches to detour E and F backup drives for settings
|
||||
|
||||
#### iidxhook4 (18)
|
||||
* Ezusb IO2 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, slotted readers
|
||||
* d3d9 patching and extended features
|
||||
* Font patching for Japanese chars
|
||||
* Filesystem patches to detour E and F backup drives for settings
|
||||
|
||||
#### iidxhook5 (19)
|
||||
* Ezusb IO2 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, wave pass readers
|
||||
* d3d9 patching and extended features
|
||||
* Font patching for Japanese chars
|
||||
* Filesystem patches to detour E and F backup drives for settings
|
||||
|
||||
#### iidxhook6 (20)
|
||||
* Ezusb IO2 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, wave pass readers
|
||||
* d3d9 patching and extended features
|
||||
* Font patching for Japanese chars
|
||||
|
||||
#### iidxhook7 (21-24)
|
||||
* Ezusb IO2 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, wave pass readers
|
||||
* d3d9 patching and extended features
|
||||
* Font patching for Japanese chars
|
||||
|
||||
#### iidxhook8 (25-26)
|
||||
* ACIO BIO2 I/O emulation
|
||||
* Setupapi emulation
|
||||
* Full game essential I/O emulation
|
||||
* ACIO ICCA card reader emulation, wave pass readers
|
||||
* d3d9 patching and extended features
|
||||
* Font patching for Japanese chars
|
||||
|
||||
### jbhook
|
||||
TODO
|
||||
|
||||
### sdvxhook
|
||||
TODO
|
||||
|
||||
## The ezusb (emulation) stack
|
||||
TODO
|
||||
|
||||
## The ACIO (emulation) stack
|
||||
TODO
|
||||
|
||||
## BT5 API
|
||||
TODO
|
||||
|
||||
## AVS and launcher
|
||||
TODO
|
||||
|
||||
## Inject
|
||||
TODO
|
||||
14
doc/ddrhook/ddrio-smx.md
Normal file
14
doc/ddrhook/ddrio-smx.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Using SMX pads with BemaniTools (DDR Ace and higher)
|
||||
If you are looking to use StepManiaX pads with DDR, these are supported **natively** for Gen 1 through Gen 5.(And theoretically beyond!) Steps and info below
|
||||
|
||||
## Step-by-Step
|
||||
1. Ensure that you have the latest `SMX.dll` copied to your contents folder. The easiest way to get this is to download and install the latest SMX Config program on [StepManiaX.com](https://data.stepmaniax.com/docs/SMXConfigInstaller-2020-04-03-01.exe). `SMX.dll`'s default install location is `C:\Program Files (x86)\SMXConfig`
|
||||
2. After bemanitools has been copied to your contents folder, rename the regular `ddrio.dll` to something like `ddrio-orig.dll`.
|
||||
3. Rename `ddrio-smx.dll` to `ddrio.dll`.
|
||||
4. Use the config tool to set up the usual stuff.(cards, network, etc.) Be sure to map menu, test, service, and start buttons to your keyboard or other controllers. You **cannot** map SMX panels as joystick inputs.
|
||||
5. Start the game. If everything works properly, the game will boot and your panels will light up when stepped on during gameplay and song selection.
|
||||
|
||||
## Important Things
|
||||
* Pad panel inputs (UDLR on P1 and P2) are mapped automatically. If you've purchased a single pad from StepManiaX, this jumper is installed and will set your pad to P2 by default. If you want to change to P1, you'll need to open up your pads and remove this jumper in the [MCU box](https://data.stepmaniax.com/docs/Stage%20-%20Gen%205%20Manual%20Rev1.pdf).
|
||||
* Panel colors set in the SMX config tool are not used. Colors are set internally by Bemanitools.
|
||||
* If you get a warning about setlights2 when starting the game, your `SMX.dll` is likely out of date. Make sure you've downloaded the latest version of the StepManiaX config tool from stepmaniax.com and have copied the `SMX.dll` to your contents folder.
|
||||
88
doc/dev/iidx-gfx-rendering-loops.md
Normal file
88
doc/dev/iidx-gfx-rendering-loops.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# Notes outlining some aspects of the DirectX calls which were required to know to implement a up-/downscaling feature
|
||||
As the title says, this outlines some aspects I needed to figure out in order to implement a up-/downscaling feature
|
||||
within the d3d9 hook module that works on all currently available IIDX versions (9 to 26).
|
||||
|
||||
To analyze the rendering loops, I have used a tool called apitrace which traces the calls of many graphic APIs:
|
||||
https://github.com/apitrace/apitrace
|
||||
|
||||
Defintely recommended to quickly figure out what is going on regarding rendering. It also allows you to let you render
|
||||
parts of a scene after the application exited because it records all API calls and data passed to them.
|
||||
|
||||
Anyway, considering the various iterations in (GPU) hardware the game had to undergo combined with weird quirks and
|
||||
"fixes" Bemanitools is undoing, I wouldn't have guessed that their rendering engine was nearly the same until IIDX 20.
|
||||
That's when they introduced SD/HD mode.
|
||||
|
||||
In this case, that's great news because I had to craft a solution that allows up-/downscaling the final frame to
|
||||
different resolutions (see the iidxhook-util/d3d9 module for more details about the feature).
|
||||
|
||||
But first, we need a breakdown of the render loop's most relevant parts for this:
|
||||
|
||||
## IIDX pre 20
|
||||
Using apitrace, we can see the following outline of a frame (not counting the first one that does a lot of setup in
|
||||
the beginning):
|
||||
```
|
||||
BeginScene
|
||||
Clear
|
||||
...
|
||||
// Here are the main draw calls for the scene rendering to the back buffer
|
||||
EndScene
|
||||
Present
|
||||
```
|
||||
|
||||
No render target switching, simply render everything to the back buffer...plain and simple.
|
||||
|
||||
Note: The viewport size is determined by the size returned by GetClientRect, wtf.
|
||||
Welp, no official Konmai seal of approval without that. ¯\_(ツ)_/¯
|
||||
|
||||
## IIDX 20+
|
||||
Using apitrace, we can see the following outline of a frame (not counting the first one that does a lot of setup in
|
||||
the beginning):
|
||||
```
|
||||
BeginScene
|
||||
// tex1 is a render target texture with size 1280x720 (also in SD mode)
|
||||
// The game will render to this intermediate target and not directly to the fram ebuffer
|
||||
SetRenderTarget(0, tex1)
|
||||
...
|
||||
Clear
|
||||
BeginScene -> ErrInvalidCall return code
|
||||
Clear
|
||||
...
|
||||
// Here are the main draw calls for the scene rendering to tex1
|
||||
...
|
||||
// Sets the render target to the original frame buffer. The size of the framebuffer is set to the output mode
|
||||
// resolution, e.g. 1280x720 for HD mode and 640x480 for SD mode
|
||||
SetRenderTarget(0, frame_buffer)
|
||||
...
|
||||
Clear
|
||||
EndScene
|
||||
...
|
||||
// Render, texture and sampler state updates as well as a draw call that draws tex1 to a quad which fills the
|
||||
// screen space.
|
||||
...
|
||||
EndScene -> ErrInvalidCall return code
|
||||
Present
|
||||
```
|
||||
|
||||
This is quite a different flow to implement HD and SD mode but the solution to solve that particular problem is straight
|
||||
forward and easy to understand. This means that the game will always render in HD mode and only downscale the final
|
||||
frame to SD resolution for 640x480 output.
|
||||
|
||||
Also, why the fuck do they call BeginScene and EndScene twice? Looks like they wanted to do this in two separate scenes
|
||||
for some reason. Checking the return values would have revealed to them that something's not right...lucky them that
|
||||
this code works nevertheless.
|
||||
Another Konmai seal of approval, a job well done. ¯\_(ツ)_/¯
|
||||
|
||||
## iidxhook's up-/downscaling solution
|
||||
The initial solution simply hooked into BeginScene and EndScene and let the game render to an intermediate render
|
||||
target texture. The texture was scaled according to the actual target frame buffer size before getting presented. This
|
||||
solution worked fine for pre IIDX 20 games but created a black screen on IIDX 20+.
|
||||
|
||||
In order to avoid two different scaling flows, the final solution that works for both does the following:
|
||||
* Create a render target texture with native resolution and let the game render to it
|
||||
* Set the render target to that intermediate render target texture on BeginScene
|
||||
* Before Present
|
||||
* Scale the intermediate render target texture to the back buffer
|
||||
* Set the back buffer as the render target
|
||||
* Present frame
|
||||
|
||||
Just an outline which follows the actual implementation that you can find in the iidxhook-util/d3d9.
|
||||
@@ -36,6 +36,13 @@ development environment which we run on a Linux distribution of our choice:
|
||||
* C++ Intellisense
|
||||
* Clang-Format
|
||||
|
||||
### Further tools for testing and debugging
|
||||
* Debugger: Can be part of your reverse engineering IDE of your choice or stand-along like
|
||||
[OllyDbg](http://www.ollydbg.de/).
|
||||
* [apitrace](https://apitrace.github.io/): Trace render calls to graphics APIs like D3D and OpenGL.
|
||||
This tool allows you to record and re-play render calls of an application with frame-by-frame
|
||||
debugging. Very useful to analyze the render pipeline or debug graphicial glitches.
|
||||
|
||||
## Building
|
||||
Simply run make in the root folder:
|
||||
```
|
||||
@@ -44,10 +51,75 @@ make
|
||||
|
||||
All output is located in the *build* folder including the final *bemanitools.zip* package.
|
||||
|
||||
### Release building
|
||||
A release build is a clean build including code formatting and testing. This can be executed by running the following
|
||||
command:
|
||||
```
|
||||
make release
|
||||
```
|
||||
|
||||
## Building with docker
|
||||
You can also build bemanitools using docker which avoids having to setup a full development
|
||||
environment if you are just interested in building binaries for the latest changes. Naturally, this
|
||||
requires you to have the docker daemon installed. Then, run the following command from the root
|
||||
folder of the project:
|
||||
|
||||
```bash
|
||||
make build-docker
|
||||
```
|
||||
|
||||
Once completed successfully, the build output is located in the `build/docker` sub-folder.
|
||||
|
||||
## Creating releases
|
||||
For developers to create official releases with major and minor versioning:
|
||||
1. Ensure that all everything you want to have for this release is merged into master.
|
||||
1. Create a [changelog](CHANGELOG.md) based on aggregating and summerizing commit messages of
|
||||
whatever got added starting from the tag of the current version to the current head of master.
|
||||
Commit that changelog and push to master.
|
||||
1. Create a tag with the next version number, e.g. for 5.28:
|
||||
```bash
|
||||
git tag v5.28
|
||||
```
|
||||
1. Push the tag upstream:
|
||||
```bash
|
||||
git push origin v5.28
|
||||
```
|
||||
1. Wait for the CI pipeline to finish building the release and check if everything's ok.
|
||||
1. On GitLab, go to "Tags" in the repository, click on the commit ID below the tag in the list you
|
||||
just created.
|
||||
1. Click on the "Pipelines" tab and click on the download button on the right and on "Download
|
||||
release artifacts".
|
||||
1. Rename the downloaded zip to "bemanitools-v5.28.zip" and the replace v5.28 with the version
|
||||
you want to release.
|
||||
1. Upload the release.
|
||||
1. For publishing the release, create a post with the following contents:
|
||||
```
|
||||
v5.28
|
||||
<insert link to uploaded zip here>
|
||||
|
||||
<additional comments or things to point out for this release>
|
||||
|
||||
Changelog copy-paste:
|
||||
<insert copy-pasted changelog you created previously here>
|
||||
```
|
||||
|
||||
## Code formatting
|
||||
To apply our code style using clang-format, simply run the following command:
|
||||
```
|
||||
make code-format
|
||||
```
|
||||
|
||||
Please also refer to the [section about](###Additional-code-style-guidelines) which cannot be covered using
|
||||
clang-format.
|
||||
|
||||
## Testing
|
||||
This still needs to be improved/implemented properly to run the unit-tests easily. Currently, you have to be on either
|
||||
a Linux/MacOSX system to run *run-test-wine.sh* from the root folder. This executes all currently available unit-tests
|
||||
and reports to the terminal any errors. This requires wine to be installed.
|
||||
a Linux/MacOSX system and run
|
||||
```
|
||||
make run-tests
|
||||
```
|
||||
This executes all currently available unit-tests and reports to the terminal any errors. This requires wine to be
|
||||
installed.
|
||||
|
||||
## Project structure
|
||||
Now that your setup is ready to go, here is brief big picture of what you find in this project.
|
||||
@@ -140,6 +212,26 @@ if (var == 2) {
|
||||
printf("%d\n", var);
|
||||
```
|
||||
|
||||
#### Empty line at the start of blocks
|
||||
There are situations when you want to have an empty line at the start of the block to enhance readability, for example:
|
||||
```
|
||||
if (a &&
|
||||
b &&
|
||||
c) {
|
||||
d = 5;
|
||||
}
|
||||
```
|
||||
|
||||
Here the assignment aligns with the conditions of the if-black making it hard to read. Better:
|
||||
```
|
||||
if (a &&
|
||||
b &&
|
||||
c) {
|
||||
|
||||
d = 5;
|
||||
}
|
||||
```
|
||||
|
||||
#### Includes
|
||||
* Always keep all includes at the top of a header and source file. Exception: Documentation before include guards on
|
||||
header file.
|
||||
@@ -291,6 +383,20 @@ Upper-case with underscore as spacing, proper namespacing to namespace and modul
|
||||
#define EZUSB_DEVICE_VID 0xFFFF
|
||||
```
|
||||
|
||||
#### Multiple variable declarations
|
||||
Only one declaration per line which also avoids various errors, for example:
|
||||
```
|
||||
// Nope
|
||||
char a, b, b;
|
||||
```
|
||||
|
||||
```
|
||||
// Ok
|
||||
char a;
|
||||
char b;
|
||||
char c;
|
||||
```
|
||||
|
||||
### Testing
|
||||
We advice you to write unit tests for all modules that allow proper unit testing. This applies to modules that are not
|
||||
part of the actual hooking process and do not rely on external devices to be available. Add these tests to the
|
||||
|
||||
@@ -4,6 +4,11 @@ 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.
|
||||
|
||||
The hook libraries must be bootstrapped either using [inject](../inject.md) or
|
||||
[launcher](../launcher.md) depending on the version you want to run. Further
|
||||
instructions are given in dedicated readme files for each iidxhook version
|
||||
(see below).
|
||||
|
||||
# Versions
|
||||
|
||||
iidxhook comes in a few different flavors. The game and its engine changed over
|
||||
@@ -17,7 +22,8 @@ games:
|
||||
* [iidxhook5](iidxhook5.md): Lincle
|
||||
* [iidxhook6](iidxhook6.md): Tricoro
|
||||
* [iidxhook7](iidxhook7.md): SPADA, PENDUAL, copula, SINOBUZ
|
||||
* [iidxhook8](../iidxhook8/iidxhook8.md): CANNON BALLERS
|
||||
* [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
|
||||
|
||||
@@ -6,6 +6,8 @@ The following games are compatible with this version of iidxhook:
|
||||
* RED
|
||||
* HAPPY SKY
|
||||
|
||||
The games must be bootstrapped using [inject](../inject.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
Ensure your folder with your unpacked data looks like this:
|
||||
@@ -52,6 +54,14 @@ 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.
|
||||
|
||||
# Use d3d8to9 wrapper
|
||||
|
||||
In order to use the gfx feature patches, e.g. window mode, monitor check,
|
||||
frame rate locking, framebuffer up/-downscaling etc. you **must** use the
|
||||
d3d8to9 wrapper library (get it from the bemanitools-supplement package).
|
||||
Bemanitools removed the old d3d8 hooking module to provide native d3d8 hooks
|
||||
due to compatibility and maintainability reasons.
|
||||
|
||||
# Eamuse network setup
|
||||
|
||||
If you want to run the games online, you have to set a valid PCBID in the
|
||||
@@ -116,6 +126,10 @@ happens, run the game again.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
|
||||
## 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.
|
||||
|
||||
## 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
|
||||
@@ -211,6 +225,3 @@ If one or multiple of these issues apply, use the built in scaling options by se
|
||||
to scale to. Usually, you want to set this to the monitor's native resolution, e.g.
|
||||
1920x1080 for full HD. You can play around with a few different filters using
|
||||
*gfx.scale_back_buffer_filter* which impacts image quality/blurriness on upscaling.
|
||||
If you want to use this with old d3d8 games (IIDX 9-13), you have to use the d3d8to9
|
||||
library from bemanitools-supplement because the d3d8 hook module cannot support this
|
||||
upscaling feature. Make sure to set *misc.use_d3d9_hooks=true*.
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* DistorteD
|
||||
|
||||
The games must be bootstrapped using [inject](../inject.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
Ensure your folder with your unpacked data looks like this:
|
||||
@@ -48,6 +50,14 @@ 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.
|
||||
|
||||
# Use d3d8to9 wrapper
|
||||
|
||||
In order to use the gfx feature patches, e.g. window mode, monitor check,
|
||||
frame rate locking, framebuffer up/-downscaling etc. you **must** use the
|
||||
d3d8to9 wrapper library (get it from the bemanitools-supplement package).
|
||||
Bemanitools removed the old d3d8 hooking module to provide native d3d8 hooks
|
||||
due to compatibility and maintainability reasons.
|
||||
|
||||
# Eamuse network setup
|
||||
|
||||
If you want to run the games online, you have to set a valid PCBID in the
|
||||
@@ -92,6 +102,10 @@ happens, run the game again.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
|
||||
## 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.
|
||||
|
||||
## 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
|
||||
@@ -176,6 +190,3 @@ If one or multiple of these issues apply, use the built in scaling options by se
|
||||
to scale to. Usually, you want to set this to the monitor's native resolution, e.g.
|
||||
1920x1080 for full HD. You can play around with a few different filters using
|
||||
*gfx.scale_back_buffer_filter* which impacts image quality/blurriness on upscaling.
|
||||
If you want to use this with old d3d8 games (IIDX 9-13), you have to use the d3d8to9
|
||||
library from bemanitools-supplement because the d3d8 hook module cannot support this
|
||||
upscaling feature. Make sure to set *misc.use_d3d9_hooks=true*.
|
||||
|
||||
@@ -6,6 +6,8 @@ The following games are compatible with this version of iidxhook:
|
||||
* EMPRESS
|
||||
* SIRIUS
|
||||
|
||||
The games must be bootstrapped using [inject](../inject.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
Ensure your folder with your unpacked data looks like this:
|
||||
@@ -93,6 +95,22 @@ IIDX occasionally fails to boot with a "USBIO (FM-DL TIMEOUT)" error. If this
|
||||
happens, run the game again.
|
||||
|
||||
# Troubleshooting and FAQ
|
||||
## The game does not start at all
|
||||
If you try to run iidx16 or iidx17 and you see one of the following outputs when
|
||||
running the gamestart-XX.bat script:
|
||||
```
|
||||
Failed to launch hook EXE: 00000002
|
||||
```
|
||||
or
|
||||
```
|
||||
Injecting: iidxhook3.dll
|
||||
Debug active process
|
||||
Resuming remote process...
|
||||
```
|
||||
|
||||
Make sure to check if you are using non htpac'd executables on iidx16 and iidx17
|
||||
and also non htpac'd libraries/dll files on iidx17. These won't work with BT
|
||||
and injecting the hook libraries.
|
||||
|
||||
## The game does not run "well" (frame drops, drifting offsync etc)
|
||||
This can be related to various issues:
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* Resort Anthem
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
We assume that you are using a clean/vanilla data dump. Ensure your ("concents")
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* Lincle
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
We assume that you are using a clean/vanilla data dump. Ensure your ("concents")
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* Tricoro
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
We assume that you are using a clean/vanilla data dump. Ensure your ("concents")
|
||||
|
||||
@@ -6,6 +6,8 @@ The following games are compatible with this version of iidxhook:
|
||||
* copula
|
||||
* SINOBUZ
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
We assume that you are using a clean/vanilla data dump. Ensure your ("concents")
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
The following games are compatible with this version of iidxhook:
|
||||
* CANNON BALLERS
|
||||
* Rootage
|
||||
|
||||
The games must be bootstrapped using [launcher](../launcher.md).
|
||||
|
||||
# Data setup and running the game
|
||||
|
||||
|
||||
179
doc/iidxhook/iidxhook9.md
Normal file
179
doc/iidxhook/iidxhook9.md
Normal file
@@ -0,0 +1,179 @@
|
||||
# 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
|
||||
|
||||
### BIO2 hardware
|
||||
|
||||
Set the *io.disable_bio2_emu* configuration value to *1* to disable BIO2
|
||||
emulation to run the game using real BIO2 hardware.
|
||||
|
||||
### 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.
|
||||
|
||||
## Slotted/Wave pass card readers
|
||||
|
||||
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*.
|
||||
|
||||
### 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 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.
|
||||
@@ -1,4 +1,4 @@
|
||||
This library drives a "legacy" ezusb IO board, also known as C02 IO, and
|
||||
This library drives a "legacy" ezusb IO board, also known as C02/D01 IO, and
|
||||
implements the iidxio API of BT5. Thus, it allows you to use this IO board with
|
||||
*any* version of IIDX that is supported by BT5.
|
||||
|
||||
@@ -24,5 +24,7 @@ the status LEDs on the side of the board should show a blinking pattern.
|
||||
dump to the FPGA.
|
||||
* There is a script called ezusb-boot.bat which combines the two steps above
|
||||
and can be integrated into the startup process of a dedicated setup.
|
||||
* If you are using a D01 IO board, use the `fpga-d01.bin` file instead of the
|
||||
`fpga.bin` file.
|
||||
* If you ignore these steps, you will either run into errors or parts of the
|
||||
IO board won't work (e.g. lights).
|
||||
18
doc/inject.md
Normal file
18
doc/inject.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Inject
|
||||
|
||||
Inject is a tool that creates a process for a specified application executable
|
||||
file and injects a specified list of library/dll files into the process before
|
||||
it is kicked off.
|
||||
|
||||
Typically, the tool is run when you use one of the bat script files to start
|
||||
any of the games that require its usage, e.g. older IIDX games.
|
||||
|
||||
It comes with further option switches for development, e.g. Halting until
|
||||
a debugger is attached, outputting debug output to a logfile etc.
|
||||
Just run the application without any parameters to get a usage message:
|
||||
```
|
||||
inject.exe
|
||||
```
|
||||
|
||||
How inject.exe is used can be taken from the bat script files of various
|
||||
(typically older) games.
|
||||
15
doc/launcher.md
Normal file
15
doc/launcher.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Launcher
|
||||
|
||||
Launcher is a tool which is required to run the more recent titles. It sets up
|
||||
the AVS environment for the target game to boot before it runs the it.
|
||||
|
||||
Typically, the tool is run when you use one of the bat script files to start
|
||||
any of the games that require its usage, e.g. newer IIDX games.
|
||||
|
||||
It comes with option switches to configure the AVS environment and for
|
||||
development, e.g. Halting until a debugger is attached, outputting debug
|
||||
output to a logfile etc.
|
||||
Just run the application without any parameters to get a usage message:
|
||||
```
|
||||
launcher.exe
|
||||
```
|
||||
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)
|
||||
16
doc/sdvxhook/sdvxio-kfca.md
Normal file
16
doc/sdvxhook/sdvxio-kfca.md
Normal file
@@ -0,0 +1,16 @@
|
||||
This library talks to a KFCA node through ACIO and implements the sdvxio API of BT5.
|
||||
Thus, it allows you to use a KFCA device board with *any* version of SDVX that is supported by BT5.
|
||||
|
||||
# Setup
|
||||
* Rename sdvxio-kfca.dll to sdvxio.dll.
|
||||
* Ensure that your gamestart.bat actually injects the appropriate sdvxhook dll
|
||||
for example:
|
||||
```
|
||||
launcher -K sdvxhook2.dll soundvoltex.dll ...*
|
||||
```
|
||||
or that the application otherwise uses sdvxio.dll
|
||||
|
||||
* sdvxio-kfca expects a KFCA device on COM3 by default
|
||||
* You can change the port and baudrate by editing the sdvxio-kfca.conf that should be created by default
|
||||
* If there is also an ICCA device on the same ACIO bus, it cannot be used with eamio-icca at this time
|
||||
* Please connect any additional acio devices to their own port (ex: SDVX5 expects an ICCA by itself on COM2)
|
||||
24
doc/sdvxhook/vigem-sdvxio.md
Normal file
24
doc/sdvxhook/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)
|
||||
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.
|
||||
@@ -14,12 +14,12 @@ it to the list of libraries to inject:
|
||||
|
||||
Example when using *inject.exe*:
|
||||
```
|
||||
inject iidxhook3.dll mempatch-hook.dll bm2dx.exe --options iidxhook-16.conf --mempatch myPatch.mph %*
|
||||
inject iidxhook3.dll mempatch-hook.dll bm2dx.exe --config iidxhook-16.conf --mempatch myPatch.mph %*
|
||||
```
|
||||
|
||||
When using *launcher.exe*:
|
||||
```
|
||||
launcher -K iidxhook4.dll -K mempatch-hook.dll bm2dx.dll --options iidxhook.conf --mempatch myPatch.mph %*
|
||||
launcher -K iidxhook4.dll -K mempatch-hook.dll bm2dx.dll --config iidxhook.conf --mempatch myPatch.mph %*
|
||||
```
|
||||
|
||||
To load a patch script, add the *--mempatch <path to patch script>* argument (as
|
||||
|
||||
@@ -25,27 +25,33 @@ enum SensorTestMode;
|
||||
enum SMXUpdateCallbackReason;
|
||||
struct SMXSensorTestModeData;
|
||||
|
||||
// All functions are nonblocking. Getters will return the most recent state. Setters will
|
||||
// return immediately and do their work in the background. No functions return errors, and
|
||||
// setting data on a pad which isn't connected will have no effect.
|
||||
// All functions are nonblocking. Getters will return the most recent state.
|
||||
// Setters will return immediately and do their work in the background. No
|
||||
// functions return errors, and setting data on a pad which isn't connected will
|
||||
// have no effect.
|
||||
|
||||
// Initialize, and start searching for devices.
|
||||
//
|
||||
// UpdateCallback will be called when something happens: connection or disconnection, inputs
|
||||
// changed, configuration updated, test data updated, etc. It doesn't specify what's changed,
|
||||
// and the user should check all state that it's interested in.
|
||||
// UpdateCallback will be called when something happens: connection or
|
||||
// disconnection, inputs changed, configuration updated, test data updated, etc.
|
||||
// It doesn't specify what's changed, and the user should check all state that
|
||||
// it's interested in.
|
||||
//
|
||||
// This is called asynchronously from a helper thread, so the receiver must be thread-safe.
|
||||
typedef void SMXUpdateCallback(int pad, enum SMXUpdateCallbackReason reason, void *pUser);
|
||||
SMX_EXTERN_C SMX_API void SMX_Start(SMXUpdateCallback UpdateCallback, void *pUser);
|
||||
// This is called asynchronously from a helper thread, so the receiver must be
|
||||
// thread-safe.
|
||||
typedef void
|
||||
SMXUpdateCallback(int pad, enum SMXUpdateCallbackReason reason, void *pUser);
|
||||
SMX_EXTERN_C SMX_API void
|
||||
SMX_Start(SMXUpdateCallback UpdateCallback, void *pUser);
|
||||
|
||||
// Shut down and disconnect from all devices. This will wait for any user callbacks to complete,
|
||||
// and no user callbacks will be called after this returns. This must not be called from within
|
||||
// the update callback.
|
||||
// Shut down and disconnect from all devices. This will wait for any user
|
||||
// callbacks to complete, and no user callbacks will be called after this
|
||||
// returns. This must not be called from within the update callback.
|
||||
SMX_EXTERN_C SMX_API void SMX_Stop();
|
||||
|
||||
// Set a function to receive diagnostic logs. By default, logs are written to stdout.
|
||||
// This can be called before SMX_Start, so it affects any logs sent during initialization.
|
||||
// Set a function to receive diagnostic logs. By default, logs are written to
|
||||
// stdout. This can be called before SMX_Start, so it affects any logs sent
|
||||
// during initialization.
|
||||
typedef void SMXLogCallback(const char *log);
|
||||
SMX_EXTERN_C SMX_API void SMX_SetLogCallback(SMXLogCallback callback);
|
||||
|
||||
@@ -55,13 +61,24 @@ SMX_EXTERN_C SMX_API void SMX_GetInfo(int pad, struct SMXInfo *info);
|
||||
// Get a mask of the currently pressed panels.
|
||||
SMX_EXTERN_C SMX_API uint16_t SMX_GetInputState(int pad);
|
||||
|
||||
// Update the lights. Both pads are always updated together. lightsData is a list of 8-bit RGB
|
||||
// colors, one for each LED. Each panel has lights in the following order:
|
||||
// (deprecated) Equivalent to SMX_SetLights2(lightsData, 864).
|
||||
SMX_API void SMX_SetLights(const char lightData[864]);
|
||||
|
||||
// Update the lights. Both pads are always updated together. lightData is a list of 8-bit RGB
|
||||
// colors, one for each LED.
|
||||
//
|
||||
// 0123
|
||||
// 4567
|
||||
// 89AB
|
||||
// CDEF
|
||||
// lightDataSize is the number of bytes in lightsData. This should be 1350 (2 pads * 9 panels *
|
||||
// 25 lights * 3 RGB colors). For backwards-compatibility, this can also be 864.
|
||||
//
|
||||
// Each panel has lights in the following order:
|
||||
//
|
||||
// 00 01 02 03
|
||||
// 16 17 18
|
||||
// 04 05 06 07
|
||||
// 19 20 21
|
||||
// 08 09 10 11
|
||||
// 22 23 24
|
||||
// 12 13 14 15
|
||||
//
|
||||
// Panels are in the following order:
|
||||
//
|
||||
@@ -69,61 +86,70 @@ SMX_EXTERN_C SMX_API uint16_t SMX_GetInputState(int pad);
|
||||
// 345 CDE
|
||||
// 678 F01
|
||||
//
|
||||
// With 18 panels, 16 LEDs per panel and 3 bytes per LED, each light update has 864 bytes of data.
|
||||
// With 18 panels, 25 LEDs per panel and 3 bytes per LED, each light update has 1350 bytes of data.
|
||||
//
|
||||
// Lights will update at up to 30 FPS. If lights data is sent more quickly, a best effort will be
|
||||
// made to send the most recent lights data available, but the panels won't update more quickly.
|
||||
//
|
||||
// The panels will return to automatic lighting if no lights are received for a while, so applications
|
||||
// controlling lights should send light updates continually, even if the lights aren't changing.
|
||||
SMX_EXTERN_C SMX_API void SMX_SetLights(const char lightsData[864]);
|
||||
|
||||
// By default, the panels light automatically when stepped on. If a lights command is sent by
|
||||
// the application, this stops happening to allow the application to fully control lighting.
|
||||
// If no lights update is received for a few seconds, automatic lighting is reenabled by the
|
||||
// panels.
|
||||
//
|
||||
// SMX_ReenableAutoLights can be called to immediately reenable auto-lighting, without waiting
|
||||
// for the timeout period to elapse. Games don't need to call this, since the panels will return
|
||||
// to auto-lighting mode automatically after a brief period of no updates.
|
||||
// For backwards compatibility, if lightDataSize is 864, the old 4x4-only order is used,
|
||||
// which simply omits lights 16-24.
|
||||
SMX_API void SMX_SetLights2(const char *lightData, int lightDataSize);
|
||||
|
||||
// By default, the panels light automatically when stepped on. If a lights
|
||||
// command is sent by the application, this stops happening to allow the
|
||||
// application to fully control lighting. If no lights update is received for a
|
||||
// few seconds, automatic lighting is reenabled by the panels.
|
||||
//
|
||||
// SMX_ReenableAutoLights can be called to immediately reenable auto-lighting,
|
||||
// without waiting for the timeout period to elapse. Games don't need to call
|
||||
// this, since the panels will return to auto-lighting mode automatically after
|
||||
// a brief period of no updates.
|
||||
SMX_EXTERN_C SMX_API void SMX_ReenableAutoLights();
|
||||
|
||||
// Get the current controller's configuration.
|
||||
//
|
||||
// Return true if a configuration is available. If false is returned, no panel is connected
|
||||
// and no data will be set.
|
||||
// Return true if a configuration is available. If false is returned, no panel
|
||||
// is connected and no data will be set.
|
||||
SMX_EXTERN_C SMX_API bool SMX_GetConfig(int pad, struct SMXConfig *config);
|
||||
|
||||
// Update the current controller's configuration. This doesn't block, and the new configuration will
|
||||
// be sent in the background. SMX_GetConfig will return the new configuration as soon as this call
|
||||
// returns, without waiting for it to actually be sent to the controller.
|
||||
SMX_EXTERN_C SMX_API void SMX_SetConfig(int pad, const struct SMXConfig *config);
|
||||
// Update the current controller's configuration. This doesn't block, and the
|
||||
// new configuration will be sent in the background. SMX_GetConfig will return
|
||||
// the new configuration as soon as this call returns, without waiting for it to
|
||||
// actually be sent to the controller.
|
||||
SMX_EXTERN_C SMX_API void
|
||||
SMX_SetConfig(int pad, const struct SMXConfig *config);
|
||||
|
||||
// Reset a pad to its original configuration.
|
||||
SMX_EXTERN_C SMX_API void SMX_FactoryReset(int pad);
|
||||
|
||||
// Request an immediate panel recalibration. This is normally not necessary, but can be helpful
|
||||
// for diagnostics.
|
||||
// Request an immediate panel recalibration. This is normally not necessary,
|
||||
// but can be helpful for diagnostics.
|
||||
SMX_EXTERN_C SMX_API void SMX_ForceRecalibration(int pad);
|
||||
|
||||
// Set a panel test mode and request test data. This is used by the configuration tool.
|
||||
// Set a panel test mode and request test data. This is used by the
|
||||
// configuration tool.
|
||||
SMX_EXTERN_C SMX_API void SMX_SetTestMode(int pad, enum SensorTestMode mode);
|
||||
SMX_EXTERN_C SMX_API bool SMX_GetTestData(int pad, struct SMXSensorTestModeData *data);
|
||||
SMX_EXTERN_C SMX_API bool
|
||||
SMX_GetTestData(int pad, struct SMXSensorTestModeData *data);
|
||||
|
||||
// Return the build version of the DLL, which is based on the git tag at build time. This
|
||||
// is only intended for diagnostic logging, and it's also the version we show in SMXConfig.
|
||||
// Return the build version of the DLL, which is based on the git tag at build
|
||||
// time. This is only intended for diagnostic logging, and it's also the
|
||||
// version we show in SMXConfig.
|
||||
SMX_EXTERN_C SMX_API const char *SMX_Version();
|
||||
|
||||
// General info about a connected controller. This can be retrieved with SMX_GetInfo.
|
||||
struct SMXInfo
|
||||
{
|
||||
// True if we're fully connected to this controller. If this is false, the other
|
||||
// fields won't be set.
|
||||
// General info about a connected controller. This can be retrieved with
|
||||
// SMX_GetInfo.
|
||||
struct SMXInfo {
|
||||
// True if we're fully connected to this controller. If this is false, the
|
||||
// other fields won't be set.
|
||||
bool m_bConnected;
|
||||
|
||||
// This device's serial number. This can be used to distinguish devices from each
|
||||
// other if more than one is connected. This is a null-terminated string instead
|
||||
// of a C++ string for C# marshalling.
|
||||
// This device's serial number. This can be used to distinguish devices
|
||||
// from each other if more than one is connected. This is a null-terminated
|
||||
// string instead of a C++ string for C# marshalling.
|
||||
char m_Serial[33];
|
||||
|
||||
// This device's firmware version.
|
||||
@@ -131,22 +157,24 @@ struct SMXInfo
|
||||
};
|
||||
|
||||
enum SMXUpdateCallbackReason {
|
||||
// This is called when a generic state change happens: connection or disconnection, inputs changed,
|
||||
// test data updated, etc. It doesn't specify what's changed. We simply check the whole state.
|
||||
// This is called when a generic state change happens: connection or
|
||||
// disconnection, inputs changed,
|
||||
// test data updated, etc. It doesn't specify what's changed. We simply
|
||||
// check the whole state.
|
||||
SMXUpdateCallback_Updated,
|
||||
|
||||
// This is called when SMX_FactoryReset completes, indicating that SMX_GetConfig will now return
|
||||
// This is called when SMX_FactoryReset completes, indicating that
|
||||
// SMX_GetConfig will now return
|
||||
// the reset configuration.
|
||||
SMXUpdateCallback_FactoryResetCommandComplete
|
||||
};
|
||||
|
||||
// The configuration for a connected controller. This can be retrieved with SMX_GetConfig
|
||||
// and modified with SMX_SetConfig.
|
||||
// The configuration for a connected controller. This can be retrieved with
|
||||
// SMX_GetConfig and modified with SMX_SetConfig.
|
||||
//
|
||||
// The order and packing of this struct corresponds to the configuration packet sent to
|
||||
// the master controller, so it must not be changed.
|
||||
struct SMXConfig
|
||||
{
|
||||
// The order and packing of this struct corresponds to the configuration packet
|
||||
// sent to the master controller, so it must not be changed.
|
||||
struct SMXConfig {
|
||||
#if 0
|
||||
// These fields are unused and must be left at their existing values.
|
||||
uint8_t unused1 = 0xFF, unused2 = 0xFF;
|
||||
@@ -228,9 +256,10 @@ struct SMXConfig
|
||||
uint8_t panelThreshold8Low, panelThreshold8High;
|
||||
#endif
|
||||
};
|
||||
//static_assert(sizeof(SMXConfig) == 84, "Expected 84 bytes");
|
||||
// static_assert(sizeof(SMXConfig) == 84, "Expected 84 bytes");
|
||||
|
||||
// The values (except for Off) correspond with the protocol and must not be changed.
|
||||
// The values (except for Off) correspond with the protocol and must not be
|
||||
// changed.
|
||||
enum SensorTestMode {
|
||||
SensorTestMode_Off = 0,
|
||||
// Return the raw, uncalibrated value of each sensor.
|
||||
@@ -246,10 +275,11 @@ enum SensorTestMode {
|
||||
SensorTestMode_Tare = '3',
|
||||
};
|
||||
|
||||
// Data for the current SensorTestMode. The interpretation of sensorLevel depends on the mode.
|
||||
struct SMXSensorTestModeData
|
||||
{
|
||||
// If false, sensorLevel[n][*] is zero because we didn't receive a response from that panel.
|
||||
// Data for the current SensorTestMode. The interpretation of sensorLevel
|
||||
// depends on the mode.
|
||||
struct SMXSensorTestModeData {
|
||||
// If false, sensorLevel[n][*] is zero because we didn't receive a response
|
||||
// from that panel.
|
||||
bool bHaveDataFromPanel[9];
|
||||
|
||||
int16_t sensorLevel[9][4];
|
||||
|
||||
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
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef IMPORTS_AVS_EA3_H
|
||||
#define IMPORTS_AVS_EA3_H
|
||||
|
||||
#include "imports/avs.h"
|
||||
|
||||
void ea3_boot(struct property_node *conf);
|
||||
void ea3_shutdown(void);
|
||||
|
||||
|
||||
@@ -74,45 +74,44 @@ struct property_psmap {
|
||||
intptr_t xdefault;
|
||||
};
|
||||
|
||||
#define PSMAP_BEGIN(name) \
|
||||
struct property_psmap name[] = {
|
||||
|
||||
#define PSMAP_BEGIN(name) struct property_psmap name[] = {
|
||||
#define PSMAP_REQUIRED(type, xstruct, field, path) \
|
||||
{ \
|
||||
type, \
|
||||
0, \
|
||||
offsetof(xstruct, field), \
|
||||
sizeof( ((xstruct *) 0)->field ), \
|
||||
path, \
|
||||
0, \
|
||||
}, \
|
||||
{ \
|
||||
type, \
|
||||
0, \
|
||||
offsetof(xstruct, field), \
|
||||
sizeof(((xstruct *) 0)->field), \
|
||||
path, \
|
||||
0, \
|
||||
},
|
||||
|
||||
#define PSMAP_OPTIONAL(type, xstruct, field, path, xdefault) \
|
||||
{ \
|
||||
type, \
|
||||
PSMAP_FLAG_HAVE_DEFAULT, \
|
||||
offsetof(xstruct, field), \
|
||||
sizeof( ((xstruct *) 0)->field ), \
|
||||
path, \
|
||||
(intptr_t) xdefault, \
|
||||
}, \
|
||||
{ \
|
||||
type, \
|
||||
PSMAP_FLAG_HAVE_DEFAULT, \
|
||||
offsetof(xstruct, field), \
|
||||
sizeof(((xstruct *) 0)->field), \
|
||||
path, \
|
||||
(intptr_t) xdefault, \
|
||||
},
|
||||
|
||||
#define PSMAP_END \
|
||||
{ 0xFF, 0, 0, 0, NULL, 0 } \
|
||||
};
|
||||
#define PSMAP_END \
|
||||
{ \
|
||||
0xFF, 0, 0, 0, NULL, 0 \
|
||||
} \
|
||||
} \
|
||||
;
|
||||
|
||||
#if AVS_VERSION >= 1500
|
||||
# define AVS_LOG_WRITER(name, chars, nchars, ctx) \
|
||||
void name(const char * chars , uint32_t nchars , void * ctx )
|
||||
#define AVS_LOG_WRITER(name, chars, nchars, ctx) \
|
||||
void name(const char *chars, uint32_t nchars, void *ctx)
|
||||
|
||||
typedef void (*avs_log_writer_t)(const char *chars, uint32_t nchars,
|
||||
void *ctx);
|
||||
typedef void (*avs_log_writer_t)(const char *chars, uint32_t nchars, void *ctx);
|
||||
#else
|
||||
# define AVS_LOG_WRITER(name, chars, nchars, ctx) \
|
||||
void name(void * ctx , const char * chars , uint32_t nchars )
|
||||
#define AVS_LOG_WRITER(name, chars, nchars, ctx) \
|
||||
void name(void *ctx, const char *chars, uint32_t nchars)
|
||||
|
||||
typedef void (*avs_log_writer_t)(void *ctx, const char *chars,
|
||||
uint32_t nchars);
|
||||
typedef void (*avs_log_writer_t)(void *ctx, const char *chars, uint32_t nchars);
|
||||
#endif
|
||||
|
||||
typedef int (*avs_reader_t)(uint32_t context, void *bytes, size_t nbytes);
|
||||
@@ -120,22 +119,38 @@ typedef int (*avs_reader_t)(uint32_t context, void *bytes, size_t nbytes);
|
||||
#if AVS_VERSION >= 1600
|
||||
/* "avs" and "std" heaps have been unified */
|
||||
typedef void (*avs_boot_t)(
|
||||
struct property_node *config, void *com_heap, size_t sz_com_heap,
|
||||
void *reserved, avs_log_writer_t log_writer, void *log_context);
|
||||
struct property_node *config,
|
||||
void *com_heap,
|
||||
size_t sz_com_heap,
|
||||
void *reserved,
|
||||
avs_log_writer_t log_writer,
|
||||
void *log_context);
|
||||
|
||||
void avs_boot(
|
||||
struct property_node *config, void *com_heap, size_t sz_com_heap,
|
||||
void *reserved, avs_log_writer_t log_writer, void *log_context);
|
||||
struct property_node *config,
|
||||
void *com_heap,
|
||||
size_t sz_com_heap,
|
||||
void *reserved,
|
||||
avs_log_writer_t log_writer,
|
||||
void *log_context);
|
||||
#else
|
||||
typedef void (*avs_boot_t)(
|
||||
struct property_node *config, void *std_heap, size_t sz_std_heap,
|
||||
void *avs_heap, size_t sz_avs_heap, avs_log_writer_t log_writer,
|
||||
void* log_context);
|
||||
struct property_node *config,
|
||||
void *std_heap,
|
||||
size_t sz_std_heap,
|
||||
void *avs_heap,
|
||||
size_t sz_avs_heap,
|
||||
avs_log_writer_t log_writer,
|
||||
void *log_context);
|
||||
|
||||
void avs_boot(
|
||||
struct property_node *config, void *std_heap, size_t sz_std_heap,
|
||||
void *avs_heap, size_t sz_avs_heap, avs_log_writer_t log_writer,
|
||||
void *log_context);
|
||||
struct property_node *config,
|
||||
void *std_heap,
|
||||
size_t sz_std_heap,
|
||||
void *avs_heap,
|
||||
size_t sz_avs_heap,
|
||||
avs_log_writer_t log_writer,
|
||||
void *log_context);
|
||||
#endif
|
||||
|
||||
void avs_shutdown(void);
|
||||
@@ -149,54 +164,72 @@ void log_change_level(int level);
|
||||
|
||||
int avs_net_ctrl(int ioctl, void *bytes, uint32_t nbytes);
|
||||
|
||||
int avs_thread_create(int (*proc)(void *), void *ctx, uint32_t sz_stack,
|
||||
unsigned int priority);
|
||||
int avs_thread_create(
|
||||
int (*proc)(void *), void *ctx, uint32_t sz_stack, unsigned int priority);
|
||||
void avs_thread_destroy(int thread_id);
|
||||
void avs_thread_exit(int result);
|
||||
void avs_thread_join(int thread_id, int *result);
|
||||
|
||||
uint32_t property_read_query_memsize(
|
||||
avs_reader_t reader, uint32_t context, int unk0, int unk1);
|
||||
struct property *property_create(
|
||||
int flags, void *buffer, uint32_t buffer_size);
|
||||
avs_reader_t reader, uint32_t context, int unk0, int unk1);
|
||||
struct property *property_create(int flags, void *buffer, uint32_t buffer_size);
|
||||
struct property_node *property_search(
|
||||
struct property *prop, struct property_node *root, const char *path);
|
||||
struct property *prop, struct property_node *root, const char *path);
|
||||
int property_insert_read(
|
||||
struct property *prop, struct property_node *root, avs_reader_t reader,
|
||||
uint32_t context);
|
||||
struct property *prop,
|
||||
struct property_node *root,
|
||||
avs_reader_t reader,
|
||||
uint32_t context);
|
||||
int property_mem_write(struct property *prop, void *bytes, int nbytes);
|
||||
void *property_desc_to_buffer(struct property *prop);
|
||||
void property_file_write(struct property *prop, const char *path);
|
||||
int property_set_flag(struct property *prop, int flags, int mask);
|
||||
void property_destroy(struct property *prop);
|
||||
|
||||
int property_psmap_import(struct property *prop, struct property_node *root,
|
||||
void *dest, const struct property_psmap *psmap);
|
||||
int property_psmap_export(struct property *prop, struct property_node *root,
|
||||
const void *src, const struct property_psmap *psmap);
|
||||
int property_psmap_import(
|
||||
struct property *prop,
|
||||
struct property_node *root,
|
||||
void *dest,
|
||||
const struct property_psmap *psmap);
|
||||
int property_psmap_export(
|
||||
struct property *prop,
|
||||
struct property_node *root,
|
||||
const void *src,
|
||||
const struct property_psmap *psmap);
|
||||
|
||||
struct property_node *property_node_clone(
|
||||
struct property *new_parent, int unk0,
|
||||
struct property_node *src, bool deep);
|
||||
struct property *new_parent,
|
||||
int unk0,
|
||||
struct property_node *src,
|
||||
bool deep);
|
||||
struct property_node *property_node_create(
|
||||
struct property *prop, struct property_node *parent, int type,
|
||||
const char *key, ...);
|
||||
void property_node_name(
|
||||
struct property_node *node, char *chars, int nchars);
|
||||
struct property *prop,
|
||||
struct property_node *parent,
|
||||
int type,
|
||||
const char *key,
|
||||
...);
|
||||
void property_node_name(struct property_node *node, char *chars, int nchars);
|
||||
const char *property_node_refdata(struct property_node *node);
|
||||
int property_node_refer(struct property *prop,
|
||||
struct property_node *node, const char *name,
|
||||
enum property_type type, void *bytes, uint32_t nbytes);
|
||||
int property_node_refer(
|
||||
struct property *prop,
|
||||
struct property_node *node,
|
||||
const char *name,
|
||||
enum property_type type,
|
||||
void *bytes,
|
||||
uint32_t nbytes);
|
||||
void property_node_remove(struct property_node *node);
|
||||
enum property_type property_node_type(
|
||||
struct property_node *node);
|
||||
enum property_type property_node_type(struct property_node *node);
|
||||
struct property_node *property_node_traversal(
|
||||
struct property_node *node, enum property_node_traversal direction);
|
||||
void property_node_datasize(struct property_node* node);
|
||||
struct property_node *node, enum property_node_traversal direction);
|
||||
void property_node_datasize(struct property_node *node);
|
||||
|
||||
bool std_getenv(const char *key, char *val, uint32_t nbytes);
|
||||
void std_setenv(const char *key, const char *val);
|
||||
|
||||
void *avs_fs_mount (char* mountpoint, char* fsroot, void* fstype, int flags);
|
||||
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
|
||||
|
||||
@@ -5,6 +5,7 @@ EXPORTS
|
||||
avs_thread_destroy @7 NONAME
|
||||
avs_thread_exit @11 NONAME
|
||||
avs_thread_join @12 NONAME
|
||||
avs_fs_addfs @73 NONAME
|
||||
avs_fs_mount @76 NONAME
|
||||
avs_net_ctrl @119 NONAME
|
||||
property_create @145 NONAME
|
||||
|
||||
@@ -7,6 +7,7 @@ EXPORTS
|
||||
SMX_GetInfo
|
||||
SMX_GetInputState
|
||||
SMX_SetLights
|
||||
SMX_SetLights2
|
||||
SMX_ReenableAutoLights
|
||||
SMX_GetConfig
|
||||
SMX_SetConfig
|
||||
|
||||
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
|
||||
@@ -5,6 +5,7 @@ EXPORTS
|
||||
avs_thread_destroy @7 NONAME
|
||||
avs_thread_exit @11 NONAME
|
||||
avs_thread_join @12 NONAME
|
||||
avs_fs_addfs @73 NONAME
|
||||
avs_fs_mount @76 NONAME
|
||||
avs_net_ctrl @119 NONAME
|
||||
property_create @145 NONAME
|
||||
@@ -22,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
|
||||
|
||||
18
src/imports/import_64_indep_SMX.def
Normal file
18
src/imports/import_64_indep_SMX.def
Normal file
@@ -0,0 +1,18 @@
|
||||
LIBRARY SMX
|
||||
|
||||
EXPORTS
|
||||
SMX_Start
|
||||
SMX_Stop
|
||||
SMX_SetLogCallback
|
||||
SMX_GetInfo
|
||||
SMX_GetInputState
|
||||
SMX_SetLights
|
||||
SMX_SetLights2
|
||||
SMX_ReenableAutoLights
|
||||
SMX_GetConfig
|
||||
SMX_SetConfig
|
||||
SMX_FactoryReset
|
||||
SMX_ForceRecalibration
|
||||
SMX_SetTestMode
|
||||
SMX_GetTestData
|
||||
SMX_Version
|
||||
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
|
||||
@@ -5,36 +5,38 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "acio/hdxs.h"
|
||||
#include "acio/icca.h"
|
||||
#include "acio/kfca.h"
|
||||
|
||||
#define AC_IO_SOF 0xAA
|
||||
#define AC_IO_ESCAPE 0xFF
|
||||
#define AC_IO_RESPONSE_FLAG 0x80
|
||||
#define AC_IO_BROADCAST 0x70
|
||||
#define AC_IO_SOF 0xAA
|
||||
#define AC_IO_ESCAPE 0xFF
|
||||
#define AC_IO_RESPONSE_FLAG 0x80
|
||||
#define AC_IO_BROADCAST 0x70
|
||||
|
||||
#define ac_io_u16(x) _byteswap_ushort(x)
|
||||
#define ac_io_u32(x) _byteswap_ulong(x)
|
||||
#define ac_io_u16(x) _byteswap_ushort(x)
|
||||
#define ac_io_u32(x) _byteswap_ulong(x)
|
||||
|
||||
enum ac_io_cmd {
|
||||
AC_IO_CMD_ASSIGN_ADDRS = 0x0001,
|
||||
AC_IO_CMD_GET_VERSION = 0x0002,
|
||||
AC_IO_CMD_START_UP = 0x0003,
|
||||
AC_IO_CMD_KEEPALIVE = 0x0080,
|
||||
AC_IO_CMD_ASSIGN_ADDRS = 0x0001,
|
||||
AC_IO_CMD_GET_VERSION = 0x0002,
|
||||
AC_IO_CMD_START_UP = 0x0003,
|
||||
AC_IO_CMD_KEEPALIVE = 0x0080,
|
||||
/* Yet unknown command encountered first on jubeat (1) */
|
||||
AC_IO_CMD_UNKN_00FF = 0x00FF,
|
||||
AC_IO_CMD_CLEAR = 0x0100,
|
||||
AC_IO_CMD_UNKN_00FF = 0x00FF,
|
||||
AC_IO_CMD_CLEAR = 0x0100,
|
||||
};
|
||||
|
||||
enum ac_io_node_type {
|
||||
AC_IO_NODE_TYPE_H44B = 0x04010000,
|
||||
AC_IO_NODE_TYPE_ICCA = 0x03000000,
|
||||
AC_IO_NODE_TYPE_H44B = 0x04010000,
|
||||
AC_IO_NODE_TYPE_ICCA = 0x03000000,
|
||||
/* same as ICCA */
|
||||
AC_IO_NODE_TYPE_ICCB = 0x03000000,
|
||||
AC_IO_NODE_TYPE_LED_STRIP = 0x04020000,
|
||||
AC_IO_NODE_TYPE_LED_SPIKE = 0x05010000,
|
||||
AC_IO_NODE_TYPE_KFCA = 0x09060000,
|
||||
AC_IO_NODE_TYPE_BI2A = 0x0d060000,
|
||||
AC_IO_NODE_TYPE_ICCB = 0x03000000,
|
||||
AC_IO_NODE_TYPE_LED_STRIP = 0x04020000,
|
||||
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)
|
||||
@@ -52,7 +54,7 @@ struct ac_io_version {
|
||||
};
|
||||
|
||||
struct ac_io_message {
|
||||
uint8_t addr; /* High bit: clear = req, set = resp */
|
||||
uint8_t addr; /* High bit: clear = req, set = resp */
|
||||
|
||||
union {
|
||||
struct {
|
||||
@@ -71,12 +73,14 @@ struct ac_io_message {
|
||||
|
||||
struct ac_io_kfca_poll_in kfca_poll_in;
|
||||
struct ac_io_kfca_poll_out kfca_poll_out;
|
||||
|
||||
struct ac_io_hdxs_output hdxs_output;
|
||||
};
|
||||
} cmd;
|
||||
|
||||
struct {
|
||||
uint8_t nbytes;
|
||||
uint8_t raw[0xFF]; /* 0xFFucked if I know */
|
||||
uint8_t raw[0xFF]; /* 0xFFucked if I know */
|
||||
} bcast;
|
||||
};
|
||||
};
|
||||
|
||||
48
src/main/acio/hdxs.h
Normal file
48
src/main/acio/hdxs.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef ACIO_HDXS_H
|
||||
#define ACIO_HDXS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum ac_io_hdxs_cmd {
|
||||
AC_IO_HDXS_CMD_SET_OUTPUTS = 0x0112,
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct ac_io_hdxs_light {
|
||||
uint8_t analog : 7; // rgb component
|
||||
uint8_t bit : 1; // buttons
|
||||
};
|
||||
|
||||
struct ac_io_hdxs_output {
|
||||
uint8_t empty;
|
||||
struct ac_io_hdxs_light lights[12];
|
||||
};
|
||||
|
||||
enum ac_io_hdxs_front_panel_lights {
|
||||
AC_IO_HDXS_OUT_P1_START = 0,
|
||||
AC_IO_HDXS_OUT_P1_UP_DOWN = 1,
|
||||
AC_IO_HDXS_OUT_P1_LEFT_RIGHT = 2,
|
||||
AC_IO_HDXS_OUT_P2_START = 3,
|
||||
AC_IO_HDXS_OUT_P2_UP_DOWN = 4,
|
||||
AC_IO_HDXS_OUT_P2_LEFT_RIGHT = 5,
|
||||
};
|
||||
|
||||
enum ac_io_hdxs_grb_layout {
|
||||
AC_IO_HDXS_GREEN = 0,
|
||||
AC_IO_HDXS_RED = 1,
|
||||
AC_IO_HDXS_BLUE = 2,
|
||||
};
|
||||
|
||||
enum ac_io_hdxs_speaker_lights {
|
||||
AC_IO_HDXS_OUT_P1_SPEAKER_F = 0,
|
||||
AC_IO_HDXS_OUT_P2_SPEAKER_F = 1,
|
||||
AC_IO_HDXS_OUT_P1_SPEAKER_W = 2,
|
||||
AC_IO_HDXS_OUT_P2_SPEAKER_W = 3,
|
||||
};
|
||||
|
||||
_Static_assert(
|
||||
sizeof(struct ac_io_hdxs_output) == 13,
|
||||
"ac_io_hdxs_output is the wrong size");
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
@@ -5,13 +5,15 @@
|
||||
|
||||
enum ac_io_icca_cmd {
|
||||
/* Yet unknown command encountered first on jubeat (1) */
|
||||
AC_IO_ICCA_CMD_UNKN_0120 = 0x0120,
|
||||
AC_IO_ICCA_CMD_UNKN_0120 = 0x0120,
|
||||
AC_IO_ICCA_CMD_QUEUE_LOOP_START = 0x0130,
|
||||
AC_IO_ICCA_CMD_ENGAGE = 0x0131,
|
||||
AC_IO_ICCA_CMD_POLL = 0x0134,
|
||||
AC_IO_ICCA_CMD_SET_SLOT_STATE = 0x0135,
|
||||
AC_IO_ICCA_CMD_BEGIN_KEYPAD = 0x013A,
|
||||
AC_IO_ICCA_CMD_POLL_FELICA = 0x0161,
|
||||
AC_IO_ICCA_CMD_ENGAGE = 0x0131,
|
||||
AC_IO_ICCA_CMD_POLL = 0x0134,
|
||||
AC_IO_ICCA_CMD_SET_SLOT_STATE = 0x0135,
|
||||
AC_IO_ICCA_CMD_BEGIN_KEYPAD = 0x013A,
|
||||
AC_IO_ICCA_CMD_POLL_FELICA = 0x0161,
|
||||
AC_IO_ICCA_CMD_KEY_EXCHANGE = 0x0160,
|
||||
AC_IO_ICCA_CMD_POLL_ENCRYPTED = 0x0164,
|
||||
};
|
||||
|
||||
enum ac_io_icca_slot_state {
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
enum ac_io_iccb_cmd {
|
||||
/* found on jubeat prop, sent after acio init req, maybe fw update? */
|
||||
AC_IO_ICCB_CMD_UNK_0100 = 0x0100,
|
||||
AC_IO_ICCB_CMD_UNK_0100 = 0x0100,
|
||||
/* found on jubeat prop, sent right after queue loop start */
|
||||
AC_IO_ICCB_CMD_UNK_0116 = 0x0116,
|
||||
AC_IO_ICCB_CMD_UNK_0116 = 0x0116,
|
||||
/* found on jubeat prop, sent after 0100 req */
|
||||
AC_IO_ICCB_CMD_UNK_0120 = 0x0120,
|
||||
AC_IO_ICCB_CMD_UNK_0120 = 0x0120,
|
||||
AC_IO_ICCB_CMD_QUEUE_LOOP_START = 0x0130,
|
||||
AC_IO_ICCB_CMD_POLL = 0x0134,
|
||||
AC_IO_ICCB_CMD_UNK_135 = 0x0135,
|
||||
AC_IO_ICCB_CMD_SLEEP = 0x013A,
|
||||
AC_IO_ICCB_CMD_READ_CARD = 0x0161
|
||||
AC_IO_ICCB_CMD_POLL = 0x0134,
|
||||
AC_IO_ICCB_CMD_UNK_135 = 0x0135,
|
||||
AC_IO_ICCB_CMD_SLEEP = 0x013A,
|
||||
AC_IO_ICCB_CMD_READ_CARD = 0x0161
|
||||
};
|
||||
|
||||
enum ac_io_iccb_sensor_state {
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
#ifndef AC_IO_KFCA_H
|
||||
#define AC_IO_KFCA_H
|
||||
|
||||
#define AC_IO_CMD_KFCA_POLL 0x0113
|
||||
#define AC_IO_CMD_KFCA_UNK_0120 0x0120
|
||||
#define AC_IO_CMD_KFCA_UNK_0128 0x0128
|
||||
#include <stdint.h>
|
||||
|
||||
#define AC_IO_KFCA_IN_GPIO_SYS_COIN 0x04
|
||||
#define AC_IO_CMD_KFCA_POLL 0x0113
|
||||
#define AC_IO_CMD_KFCA_WATCHDOG 0x0120
|
||||
#define AC_IO_CMD_KFCA_AMP_CONTROL 0x0128
|
||||
|
||||
#define AC_IO_KFCA_IN_GPIO_SYS_COIN 0x04
|
||||
/* ... AC_IO_KFCA_IN_GPIO_SYS_COIN2 0x08 (maybe?) */
|
||||
#define AC_IO_KFCA_IN_GPIO_SYS_TEST 0x10
|
||||
#define AC_IO_KFCA_IN_GPIO_SYS_SERVICE 0x20
|
||||
#define AC_IO_KFCA_IN_GPIO_SYS_TEST 0x10
|
||||
#define AC_IO_KFCA_IN_GPIO_SYS_SERVICE 0x20
|
||||
|
||||
#define AC_IO_KFCA_IN_GPIO_0_C 0x0001
|
||||
#define AC_IO_KFCA_IN_GPIO_0_B 0x0002
|
||||
#define AC_IO_KFCA_IN_GPIO_0_A 0x0004
|
||||
#define AC_IO_KFCA_IN_GPIO_0_START 0x0008
|
||||
#define AC_IO_KFCA_IN_GPIO_0_HEADPHONE 0x0020
|
||||
#define AC_IO_KFCA_IN_GPIO_0_C 0x0001
|
||||
#define AC_IO_KFCA_IN_GPIO_0_B 0x0002
|
||||
#define AC_IO_KFCA_IN_GPIO_0_A 0x0004
|
||||
#define AC_IO_KFCA_IN_GPIO_0_START 0x0008
|
||||
#define AC_IO_KFCA_IN_GPIO_0_RECORDER 0x0010
|
||||
#define AC_IO_KFCA_IN_GPIO_0_HEADPHONE 0x0020
|
||||
|
||||
#define AC_IO_KFCA_IN_GPIO_1_FX_R 0x0008
|
||||
#define AC_IO_KFCA_IN_GPIO_1_FX_L 0x0010
|
||||
#define AC_IO_KFCA_IN_GPIO_1_D 0x0020
|
||||
#define AC_IO_KFCA_IN_GPIO_1_FX_R 0x0008
|
||||
#define AC_IO_KFCA_IN_GPIO_1_FX_L 0x0010
|
||||
#define AC_IO_KFCA_IN_GPIO_1_D 0x0020
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
@@ -39,6 +42,7 @@ struct ac_io_kfca_poll_in {
|
||||
struct ac_io_kfca_poll_out {
|
||||
uint32_t gpio;
|
||||
uint8_t pwm[18];
|
||||
uint8_t unk[2];
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -5,5 +5,6 @@ libs_aciodrv := \
|
||||
src_aciodrv := \
|
||||
device.c \
|
||||
icca.c \
|
||||
kfca.c \
|
||||
port.c \
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ static char aviodrv_device_node_products[16][4];
|
||||
static bool aciodrv_device_init(void)
|
||||
{
|
||||
uint8_t init_seq[1] = {AC_IO_SOF};
|
||||
uint8_t read_buff[1] = {0x00};
|
||||
|
||||
/* init/reset the device by sending 0xAA until 0xAA is returned */
|
||||
int read = 0;
|
||||
@@ -27,33 +28,36 @@ static bool aciodrv_device_init(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
read = aciodrv_port_read(init_seq, sizeof(init_seq));
|
||||
} while (read == 0);
|
||||
read = aciodrv_port_read(read_buff, sizeof(read_buff));
|
||||
} while ((read <= 0) || (read_buff[0] != init_seq[0]));
|
||||
|
||||
if (read > 0) {
|
||||
log_warning("Obtained SOF, clearing out buffer now");
|
||||
/* empty buffer by reading all data */
|
||||
while (read > 0) {
|
||||
read = aciodrv_port_read(init_seq, sizeof(init_seq));
|
||||
}
|
||||
log_warning("Cleared buffer, init done");
|
||||
|
||||
return read == 0;
|
||||
} else {
|
||||
log_warning("Read failure when trying to clear device state");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef AC_IO_MSG_LOG
|
||||
static void aciodrv_device_log_buffer(const char* msg, const uint8_t* buffer,
|
||||
int length)
|
||||
static void
|
||||
aciodrv_device_log_buffer(const char *msg, const uint8_t *buffer, int length)
|
||||
{
|
||||
char str[4096];
|
||||
|
||||
hex_encode_uc((const void*) buffer, length, str, sizeof(str));
|
||||
hex_encode_uc((const void *) buffer, length, str, sizeof(str));
|
||||
log_misc("%s, length %d: %s", msg, length, str);
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool aciodrv_device_send(const uint8_t* buffer, int length)
|
||||
static bool aciodrv_device_send(const uint8_t *buffer, int length)
|
||||
{
|
||||
uint8_t send_buf[512];
|
||||
int send_buf_pos = 0;
|
||||
@@ -102,7 +106,7 @@ static bool aciodrv_device_send(const uint8_t* buffer, int length)
|
||||
return true;
|
||||
}
|
||||
|
||||
static int aciodrv_device_receive(uint8_t* buffer, int size)
|
||||
static int aciodrv_device_receive(uint8_t *buffer, int size)
|
||||
{
|
||||
uint8_t recv_buf[512];
|
||||
int recv_size = 0;
|
||||
@@ -142,8 +146,7 @@ static int aciodrv_device_receive(uint8_t* buffer, int size)
|
||||
|
||||
/* check for escape byte. these don't count towards the
|
||||
size we expect! */
|
||||
if (recv_buf[recv_size] == AC_IO_ESCAPE)
|
||||
{
|
||||
if (recv_buf[recv_size] == AC_IO_ESCAPE) {
|
||||
/* next byte is our real data
|
||||
overwrite escape byte */
|
||||
do {
|
||||
@@ -162,7 +165,8 @@ 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);
|
||||
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 */
|
||||
@@ -174,12 +178,14 @@ static int aciodrv_device_receive(uint8_t* buffer, int size)
|
||||
result_size = recv_size - 1;
|
||||
|
||||
#ifdef AC_IO_MSG_LOG
|
||||
aciodrv_device_log_buffer("Recv (2)", buffer, result_size);
|
||||
aciodrv_device_log_buffer("Recv (2)", buffer, result_size);
|
||||
#endif
|
||||
|
||||
if (checksum != recv_buf[recv_size - 1]) {
|
||||
log_warning("Invalid message checksum: %02X != %02X",
|
||||
checksum, recv_buf[recv_size - 1]);
|
||||
log_warning(
|
||||
"Invalid message checksum: %02X != %02X",
|
||||
checksum,
|
||||
recv_buf[recv_size - 1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -198,7 +204,8 @@ static uint8_t aciodrv_device_enum_nodes(void)
|
||||
msg.cmd.nbytes = 1;
|
||||
msg.cmd.count = 0;
|
||||
|
||||
if (!aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
log_warning("Enumerating nodes failed");
|
||||
return 0;
|
||||
}
|
||||
@@ -216,13 +223,16 @@ static bool aciodrv_device_get_version(uint8_t node_id, char product[4])
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_GET_VERSION);
|
||||
msg.cmd.nbytes = 0;
|
||||
|
||||
if ( !aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) +
|
||||
sizeof(struct ac_io_version))) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg,
|
||||
offsetof(struct ac_io_message, cmd.raw) +
|
||||
sizeof(struct ac_io_version))) {
|
||||
log_warning("Get version of node %d failed", node_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
log_info("Node %d: type %d, flag %d, version %d.%d.%d, product %c%c%c%c, "
|
||||
log_info(
|
||||
"Node %d: type %d, flag %d, version %d.%d.%d, product %c%c%c%c, "
|
||||
"build date: %s %s",
|
||||
node_id,
|
||||
msg.cmd.version.type,
|
||||
@@ -250,7 +260,8 @@ static bool aciodrv_device_start_node(uint8_t node_id)
|
||||
msg.cmd.code = ac_io_u16(AC_IO_CMD_START_UP);
|
||||
msg.cmd.nbytes = 0;
|
||||
|
||||
if (!aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
log_warning("Starting node %d failed", node_id);
|
||||
return false;
|
||||
}
|
||||
@@ -259,7 +270,7 @@ static bool aciodrv_device_start_node(uint8_t node_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_device_open(const char* port, int baud)
|
||||
bool aciodrv_device_open(const char *port, int baud)
|
||||
{
|
||||
if (!aciodrv_port_open(port, baud)) {
|
||||
return false;
|
||||
@@ -275,7 +286,8 @@ bool aciodrv_device_open(const char* port, int baud)
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < aciodrv_device_node_count; i++) {
|
||||
if (!aciodrv_device_get_version(i + 1, aviodrv_device_node_products[i])) {
|
||||
if (!aciodrv_device_get_version(
|
||||
i + 1, aviodrv_device_node_products[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -304,25 +316,36 @@ bool aciodrv_device_get_node_product_ident(uint8_t node_id, char product[4])
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_send_and_recv(struct ac_io_message* msg, int resp_size)
|
||||
bool aciodrv_send_and_recv(struct ac_io_message *msg, int resp_size)
|
||||
{
|
||||
msg->cmd.seq_no = aciodrv_device_msg_counter++;
|
||||
int send_size = offsetof(struct ac_io_message, cmd.raw) + msg->cmd.nbytes;
|
||||
|
||||
if (aciodrv_device_send((uint8_t*) msg,
|
||||
offsetof(struct ac_io_message, cmd.raw) + msg->cmd.nbytes) <= 0) {
|
||||
#ifdef AC_IO_MSG_LOG
|
||||
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;
|
||||
}
|
||||
|
||||
uint16_t req_code = msg->cmd.code;
|
||||
|
||||
if (aciodrv_device_receive((uint8_t*) msg,
|
||||
resp_size) <= 0) {
|
||||
#ifdef AC_IO_MSG_LOG
|
||||
log_info("Beginning recv: (%d b)", resp_size);
|
||||
#endif
|
||||
if (aciodrv_device_receive((uint8_t *) msg, resp_size) <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (req_code != msg->cmd.code) {
|
||||
log_warning("Received invalid response %04X for request %04X",
|
||||
msg->cmd.code, req_code);
|
||||
log_warning(
|
||||
"Received invalid response %04X for request %04X",
|
||||
msg->cmd.code,
|
||||
req_code);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* @return True if opening the port and resetting the device was successful,
|
||||
* false on error.
|
||||
*/
|
||||
bool aciodrv_device_open(const char* port, int baud);
|
||||
bool aciodrv_device_open(const char *port, int baud);
|
||||
|
||||
/**
|
||||
* Get the node count on the opened device.
|
||||
@@ -27,8 +27,8 @@ uint8_t aciodrv_device_get_node_count(void);
|
||||
*
|
||||
* @param node_id Id of the node. Needs to be in range of the total node count.
|
||||
* @param product Buffer to return the product id to.
|
||||
* @return True on success, false on error. If True the variable product contains
|
||||
* the identifier of the queried node.
|
||||
* @return True on success, false on error. If True the variable product
|
||||
* contains the identifier of the queried node.
|
||||
*/
|
||||
bool aciodrv_device_get_node_product_ident(uint8_t node_id, char product[4]);
|
||||
|
||||
@@ -42,7 +42,7 @@ bool aciodrv_device_get_node_product_ident(uint8_t node_id, char product[4]);
|
||||
* @param resp_size Size of the expecting response.
|
||||
* @return True on success, false on error.
|
||||
*/
|
||||
bool aciodrv_send_and_recv(struct ac_io_message* msg, int resp_size);
|
||||
bool aciodrv_send_and_recv(struct ac_io_message *msg, int resp_size);
|
||||
|
||||
/**
|
||||
* Close the previously opened ACIO device.
|
||||
|
||||
@@ -15,13 +15,14 @@ static bool aciodrv_icca_queue_loop_start(uint8_t node_id)
|
||||
msg.cmd.nbytes = 1;
|
||||
msg.cmd.status = 0;
|
||||
|
||||
if (!aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
|
||||
log_warning("Starting queue loop failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
log_info("Started queue loop of node %d, status: %d",
|
||||
node_id, msg.cmd.status);
|
||||
log_info(
|
||||
"Started queue loop of node %d, status: %d", node_id, msg.cmd.status);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -35,8 +36,8 @@ bool aciodrv_icca_init(uint8_t node_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_icca_set_state(uint8_t node_id, int slot_state,
|
||||
struct ac_io_icca_state* state)
|
||||
bool aciodrv_icca_set_state(
|
||||
uint8_t node_id, int slot_state, struct ac_io_icca_state *state)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
@@ -47,8 +48,8 @@ bool aciodrv_icca_set_state(uint8_t node_id, int slot_state,
|
||||
msg.cmd.raw[0] = sizeof(struct ac_io_icca_state);
|
||||
msg.cmd.raw[1] = slot_state;
|
||||
|
||||
if ( !aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) +
|
||||
msg.cmd.raw[0])) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + msg.cmd.raw[0])) {
|
||||
log_warning("Setting state of node %d failed", node_id + 1);
|
||||
return false;
|
||||
}
|
||||
@@ -60,7 +61,7 @@ bool aciodrv_icca_set_state(uint8_t node_id, int slot_state,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state* state)
|
||||
bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state *state)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
@@ -70,8 +71,8 @@ bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state* state)
|
||||
/* buffer size of data we expect */
|
||||
msg.cmd.count = sizeof(struct ac_io_icca_state);
|
||||
|
||||
if ( !aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) +
|
||||
msg.cmd.count)) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + msg.cmd.count)) {
|
||||
log_warning("Getting state of node %d failed", node_id + 1);
|
||||
return false;
|
||||
}
|
||||
@@ -83,7 +84,7 @@ bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state* state)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_icca_read_card(uint8_t node_id, struct ac_io_icca_state* state)
|
||||
bool aciodrv_icca_read_card(uint8_t node_id, struct ac_io_icca_state *state)
|
||||
{
|
||||
struct ac_io_message msg;
|
||||
|
||||
@@ -93,8 +94,8 @@ bool aciodrv_icca_read_card(uint8_t node_id, struct ac_io_icca_state* state)
|
||||
/* buffer size of data we expect */
|
||||
msg.cmd.count = sizeof(struct ac_io_icca_state);
|
||||
|
||||
if ( !aciodrv_send_and_recv(&msg, offsetof(struct ac_io_message, cmd.raw) +
|
||||
msg.cmd.count)) {
|
||||
if (!aciodrv_send_and_recv(
|
||||
&msg, offsetof(struct ac_io_message, cmd.raw) + msg.cmd.count)) {
|
||||
log_warning("Reading card of node %d failed", node_id + 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ bool aciodrv_icca_init(uint8_t node_id);
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool aciodrv_icca_set_state(uint8_t node_id, int slot_state, struct ac_io_icca_state* state);
|
||||
bool aciodrv_icca_set_state(
|
||||
uint8_t node_id, int slot_state, struct ac_io_icca_state *state);
|
||||
|
||||
/**
|
||||
* Get the current state of an ICCA node.
|
||||
@@ -39,7 +40,7 @@ bool aciodrv_icca_set_state(uint8_t node_id, int slot_state, struct ac_io_icca_s
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state* state);
|
||||
bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state *state);
|
||||
|
||||
/**
|
||||
* Trigger a card read action on the ICCA reader. Make sure to call this
|
||||
@@ -55,6 +56,6 @@ bool aciodrv_icca_get_state(uint8_t node_id, struct ac_io_icca_state* state);
|
||||
* device driver foundation.
|
||||
* @see driver.h
|
||||
*/
|
||||
bool aciodrv_icca_read_card(uint8_t node_id, struct ac_io_icca_state* state);
|
||||
bool aciodrv_icca_read_card(uint8_t node_id, struct ac_io_icca_state *state);
|
||||
|
||||
#endif
|
||||
106
src/main/aciodrv/kfca.c
Normal file
106
src/main/aciodrv/kfca.c
Normal file
@@ -0,0 +1,106 @@
|
||||
#define LOG_MODULE "aciodrv-kfca"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "aciodrv/device.h"
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
static bool aciodrv_kfca_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 aciodrv_kfca_amp(
|
||||
uint8_t node_id,
|
||||
uint8_t primary,
|
||||
uint8_t headphone,
|
||||
uint8_t unused,
|
||||
uint8_t subwoofer)
|
||||
{
|
||||
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;
|
||||
|
||||
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)) {
|
||||
log_warning("Setting AMP failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
log_warning("Started AMP node %d", node_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_kfca_init(uint8_t node_id)
|
||||
{
|
||||
if (!aciodrv_kfca_watchdog_start(node_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!aciodrv_kfca_amp(node_id, 0, 0, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool aciodrv_kfca_poll(
|
||||
uint8_t node_id,
|
||||
const struct ac_io_kfca_poll_out *pout,
|
||||
struct ac_io_kfca_poll_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 */
|
||||
msg.cmd.kfca_poll_out = *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.kfca_poll_in, sizeof(*pin));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
51
src/main/aciodrv/kfca.h
Normal file
51
src/main/aciodrv/kfca.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef ACIODRV_KFCA_H
|
||||
#define ACIODRV_KFCA_H
|
||||
|
||||
#include "acio/kfca.h"
|
||||
|
||||
/**
|
||||
* Initialize an KFCA 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 aciodrv_kfca_init(uint8_t node_id);
|
||||
|
||||
/**
|
||||
* Poll the KFCA io 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 aciodrv_kfca_poll(
|
||||
uint8_t node_id,
|
||||
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
|
||||
@@ -9,15 +9,21 @@
|
||||
|
||||
static HANDLE aciodrv_port_fd;
|
||||
|
||||
bool aciodrv_port_open(const char* port, int baud)
|
||||
bool aciodrv_port_open(const char *port, int baud)
|
||||
{
|
||||
COMMTIMEOUTS ct;
|
||||
DCB dcb;
|
||||
|
||||
log_info("Opening ACIO on %s at %d baud", port, baud);
|
||||
|
||||
aciodrv_port_fd = CreateFile(port, GENERIC_READ | GENERIC_WRITE, 0, NULL,
|
||||
OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH | FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
aciodrv_port_fd = CreateFile(
|
||||
port,
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_FLAG_WRITE_THROUGH | FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
|
||||
if (aciodrv_port_fd == INVALID_HANDLE_VALUE) {
|
||||
log_warning("Failed to open %s", port);
|
||||
@@ -37,9 +43,9 @@ bool aciodrv_port_open(const char* port, int baud)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!PurgeComm(aciodrv_port_fd,
|
||||
PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR)) {
|
||||
|
||||
if (!PurgeComm(
|
||||
aciodrv_port_fd,
|
||||
PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR)) {
|
||||
log_warning("PurgeComm failed");
|
||||
|
||||
goto fail;
|
||||
@@ -143,7 +149,7 @@ int aciodrv_port_write(const void *bytes, int nbytes)
|
||||
log_warning("WriteFile failed: err = %lu", GetLastError());
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return nwrit;
|
||||
}
|
||||
@@ -154,4 +160,3 @@ void aciodrv_port_close(void)
|
||||
CloseHandle(aciodrv_port_fd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef ACIODRV_PORT_H
|
||||
#define ACIODRV_PORT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Open a serial port for communication with a ACIO device.
|
||||
@@ -12,7 +12,7 @@
|
||||
* @return True if opening the com port was successful, false on error.
|
||||
* @note This will open and setup the com port, only.
|
||||
*/
|
||||
bool aciodrv_port_open(const char* port, int baud);
|
||||
bool aciodrv_port_open(const char *port, int baud);
|
||||
|
||||
/**
|
||||
* Read data from the opened com port.
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#include "util/log.h"
|
||||
|
||||
void ac_io_emu_cmd_assign_addrs(
|
||||
struct ac_io_emu *emu,
|
||||
const struct ac_io_message *req,
|
||||
uint8_t node_count)
|
||||
struct ac_io_emu *emu, const struct ac_io_message *req, uint8_t node_count)
|
||||
{
|
||||
struct ac_io_message resp;
|
||||
uint16_t cmd;
|
||||
@@ -21,9 +19,7 @@ void ac_io_emu_cmd_assign_addrs(
|
||||
cmd = ac_io_u16(req->cmd.code);
|
||||
|
||||
if (cmd != AC_IO_CMD_ASSIGN_ADDRS) {
|
||||
log_warning(
|
||||
"Address 0 expects address assignment cmd, got %04x",
|
||||
cmd);
|
||||
log_warning("Address 0 expects address assignment cmd, got %04x", cmd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
void ac_io_emu_cmd_assign_addrs(
|
||||
struct ac_io_emu *emu,
|
||||
const struct ac_io_message *req,
|
||||
uint8_t node_count);
|
||||
struct ac_io_emu *emu, const struct ac_io_message *req, uint8_t node_count);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#include <windows.h> /* Usermode API */
|
||||
#include <windows.h> /* Usermode API */
|
||||
|
||||
#include <ntdef.h> /* Kernel-mode API for ioctls */
|
||||
// clang-format off
|
||||
// Don't format because the order is important here
|
||||
#include <ntdef.h>
|
||||
#include <devioctl.h>
|
||||
#include <ntddser.h>
|
||||
// clang-format on
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -27,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);
|
||||
@@ -61,18 +72,26 @@ bool ac_io_emu_match_irp(const struct ac_io_emu *emu, const struct irp *irp)
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT ac_io_emu_dispatch_irp(struct ac_io_emu *emu, struct irp *irp)
|
||||
HRESULT
|
||||
ac_io_emu_dispatch_irp(struct ac_io_emu *emu, struct irp *irp)
|
||||
{
|
||||
log_assert(irp != NULL);
|
||||
|
||||
switch (irp->op) {
|
||||
case IRP_OP_OPEN: return ac_io_emu_open(emu, irp);
|
||||
case IRP_OP_CLOSE: return ac_io_emu_close(emu, irp);
|
||||
case IRP_OP_READ: return ac_io_emu_read(emu, irp);
|
||||
case IRP_OP_WRITE: return ac_io_emu_write(emu, irp);
|
||||
case IRP_OP_IOCTL: return ac_io_emu_ioctl(emu, irp);
|
||||
case IRP_OP_FSYNC: return S_FALSE;
|
||||
default: return E_NOTIMPL;
|
||||
case IRP_OP_OPEN:
|
||||
return ac_io_emu_open(emu, irp);
|
||||
case IRP_OP_CLOSE:
|
||||
return ac_io_emu_close(emu, irp);
|
||||
case IRP_OP_READ:
|
||||
return ac_io_emu_read(emu, irp);
|
||||
case IRP_OP_WRITE:
|
||||
return ac_io_emu_write(emu, irp);
|
||||
case IRP_OP_IOCTL:
|
||||
return ac_io_emu_ioctl(emu, irp);
|
||||
case IRP_OP_FSYNC:
|
||||
return S_FALSE;
|
||||
default:
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,29 +148,30 @@ static HRESULT ac_io_emu_ioctl(struct ac_io_emu *emu, struct irp *irp)
|
||||
log_assert(irp != NULL);
|
||||
|
||||
switch (irp->ioctl) {
|
||||
case IOCTL_SERIAL_GET_COMMSTATUS:
|
||||
if (irp->read.bytes == NULL) {
|
||||
log_warning("IOCTL_SERIAL_GET_COMMSTATUS: Output buffer is NULL");
|
||||
case IOCTL_SERIAL_GET_COMMSTATUS:
|
||||
if (irp->read.bytes == NULL) {
|
||||
log_warning(
|
||||
"IOCTL_SERIAL_GET_COMMSTATUS: Output buffer is NULL");
|
||||
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (irp->read.nbytes < sizeof(*status)) {
|
||||
log_warning("IOCTL_SERIAL_GET_COMMSTATUS: Buffer is too small");
|
||||
if (irp->read.nbytes < sizeof(*status)) {
|
||||
log_warning("IOCTL_SERIAL_GET_COMMSTATUS: Buffer is too small");
|
||||
|
||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
||||
}
|
||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
||||
}
|
||||
|
||||
status = (SERIAL_STATUS *) irp->read.bytes;
|
||||
status->Errors = 0;
|
||||
status->AmountInInQueue = ac_io_in_is_msg_pending(&emu->in);
|
||||
status = (SERIAL_STATUS *) irp->read.bytes;
|
||||
status->Errors = 0;
|
||||
status->AmountInInQueue = ac_io_in_is_msg_pending(&emu->in);
|
||||
|
||||
irp->read.pos = sizeof(*status);
|
||||
irp->read.pos = sizeof(*status);
|
||||
|
||||
return S_FALSE;
|
||||
return S_FALSE;
|
||||
|
||||
default:
|
||||
return S_FALSE;
|
||||
default:
|
||||
return S_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,9 +190,7 @@ void ac_io_emu_request_pop(struct ac_io_emu *emu)
|
||||
}
|
||||
|
||||
void ac_io_emu_response_push(
|
||||
struct ac_io_emu *emu,
|
||||
const struct ac_io_message *resp,
|
||||
uint64_t delay_us)
|
||||
struct ac_io_emu *emu, const struct ac_io_message *resp, uint64_t delay_us)
|
||||
{
|
||||
log_assert(emu != NULL);
|
||||
log_assert(resp != NULL);
|
||||
@@ -181,14 +199,10 @@ void ac_io_emu_response_push(
|
||||
}
|
||||
|
||||
void ac_io_emu_response_push_thunk(
|
||||
struct ac_io_emu *emu,
|
||||
ac_io_in_thunk_t thunk,
|
||||
void *ctx,
|
||||
uint64_t delay_us)
|
||||
struct ac_io_emu *emu, ac_io_in_thunk_t thunk, void *ctx, uint64_t delay_us)
|
||||
{
|
||||
log_assert(emu != NULL);
|
||||
log_assert(thunk != NULL);
|
||||
|
||||
ac_io_in_supply_thunk(&emu->in, thunk, ctx, delay_us);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user