mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 587ae86341 | |||
| 926f2ef2a0 | |||
| d262e02f8c | |||
| f6b63473a0 | |||
| 1ad45edd6e | |||
| e79de3b117 | |||
| f783a5a1cd | |||
| 7848d5c237 | |||
| cec735a81b | |||
| 753702e32e | |||
| 7bd7503951 | |||
| d0c38956bf | |||
| 77bca2baee | |||
| 46e8c8a5a5 | |||
| 4d58e5d080 | |||
| 168084d672 | |||
| 740ed90d95 | |||
| 61c17f15b4 | |||
| 99035f312f | |||
| aafc916bb6 | |||
| c5eb1e999b | |||
| 7c15452c1e | |||
| 4bc849ccdb | |||
| 58481a035b | |||
| 66b3de8e5c | |||
| 257afe0cd3 | |||
| aafea3b1c1 | |||
| 346a159157 | |||
| 54028d8cbb | |||
| 621b702ed4 | |||
| 26ea8a1b92 | |||
| 6e7bf99af8 | |||
| df9d9d8673 | |||
| b3cee1dfcc | |||
| f40c382903 | |||
| e4cfb808bf | |||
| 61d14a16e8 | |||
| 521e87ea41 | |||
| 2b735ffd55 | |||
| 4f72b0a98b | |||
| 474f5f5203 |
+8
-4
@@ -30,12 +30,11 @@ Do not change the names of options, buttons binds, analogs, etc - since they are
|
|||||||
* All currently supported games / versions must continue to work.
|
* All currently supported games / versions must continue to work.
|
||||||
* Backwards compatibility must be preserved, unless there is a really good reason to break it. This includes (but not limited to): global/local config files, command line parameters, game patches, device interop (e.g., card readers), and SpiceAPI / Companion interop.
|
* Backwards compatibility must be preserved, unless there is a really good reason to break it. This includes (but not limited to): global/local config files, command line parameters, game patches, device interop (e.g., card readers), and SpiceAPI / Companion interop.
|
||||||
* Reasonable level of compatibility with the last release of original spicetools is expected. The stated goal of spice2x is to be a drop-in replacement for spicetools.
|
* Reasonable level of compatibility with the last release of original spicetools is expected. The stated goal of spice2x is to be a drop-in replacement for spicetools.
|
||||||
* Simply put, if someone has an existing install of spicetools/spice2x, copying over new version of spice2x should not result in different behavior or loss of functionality.
|
* Simply put, if someone has an existing install of spicetools/spice2x, copying over new version of spice2x should not result in vastly different behavior or major loss of functionality.
|
||||||
* Make sure you compile with the included Docker script and ensure you do not introduce **any** new compiler warnings or build breaks. The Docker script is the standard build environment, your custom Linux build environment or MSVC can be used during development, but you must validate the final build using Docker.
|
* Make sure you compile with the included Docker script and ensure you do not introduce **any** new compiler warnings or build breaks. The Docker script is the standard build environment, your custom Linux build environment or MSVC can be used during development, but you must validate the final build using Docker.
|
||||||
* Do not submit snippets of code as a "patch". Exceptions can be made for trivial changes (correct a typo, fix a single line of code...), but otherwise, a successfully compiled & fully tested patch file is required when submitting for review.
|
|
||||||
* Do not make code changes in unrelated areas; i.e., do not run code linters and auto-formatters for parts of the code that you didn't modify.
|
* Do not make code changes in unrelated areas; i.e., do not run code linters and auto-formatters for parts of the code that you didn't modify.
|
||||||
* Try to submit smaller chunks of code, instead one gigantic patch. For example, don't submit a patch for "Improve feature XYZ"; instead, submit "Change how A works to prepare for feature XYZ" "Refactor B for feature XYZ" "Add feature B to enable feature XYZ".
|
* Try to submit smaller chunks of code, instead one gigantic patch. For example, don't submit a patch for "Improve feature XYZ"; instead, submit "Change how A works to prepare for feature XYZ" "Refactor B for feature XYZ" "Add feature B to enable feature XYZ".
|
||||||
* Write to the log for anything useful - it helps immensely with debugging post-mortem. At the same time though, avoid spamming the log for something trivial.
|
* Write to the log for anything useful - it helps immensely with troubleshooting and debugging. At the same time though, avoid spamming the log for something trivial.
|
||||||
|
|
||||||
### UI text
|
### UI text
|
||||||
spice2x has a global audience; majority of the user base do not speak English as their first language.
|
spice2x has a global audience; majority of the user base do not speak English as their first language.
|
||||||
@@ -44,7 +43,7 @@ Use simple English, avoid colloquialism, and use concise language, even if it's
|
|||||||
|
|
||||||
### Using OS APIs
|
### Using OS APIs
|
||||||
|
|
||||||
Avoid making permanent changes to user's OS configuration. For example, spice should not make a call to set power profile to Maximum Performance, or switch default audio device. Making the reverse call to restore settings on game shutdown is **not** good enough; there is no guarantee that spice will gracefully shutdown, since games (or spice) can crash. This is to avoid inadvertently putting user's PC into a bad state, which can be seen as malware-like behavior.
|
Avoid making permanent changes to user's OS configuration. For example, spice must not make a call to set power profile to Maximum Performance, or switch default audio device. Making the reverse call to restore settings on game shutdown is **not** good enough; there is no guarantee that spice will gracefully shutdown, since games (or spice) can crash. This is to avoid inadvertently putting user's PC into a bad state, which can be seen as malware-like behavior.
|
||||||
|
|
||||||
Watch out for legacy OS compatibility. Currently, the minimum support floor is Windows 7. If you use any Windows API, make sure it's supported in Windows 7. If you need to use API that is not present in Windows 7, you must not directly link against it, otherwise spice will fail to launch on older OSes. Take a look at Windows 8 touch code (win8.cpp) for examples on how to discover OS APIs via pointers.
|
Watch out for legacy OS compatibility. Currently, the minimum support floor is Windows 7. If you use any Windows API, make sure it's supported in Windows 7. If you need to use API that is not present in Windows 7, you must not directly link against it, otherwise spice will fail to launch on older OSes. Take a look at Windows 8 touch code (win8.cpp) for examples on how to discover OS APIs via pointers.
|
||||||
|
|
||||||
@@ -87,4 +86,9 @@ if (conditional)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Please give [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) a read. A few things to point out in spice codebase:
|
||||||
|
* We don't use GSL.
|
||||||
|
* Don't throw exceptions.
|
||||||
|
* Stick to smart pointers. For interfacing with C Win32 API and raw buffers, use `unique_plain_ptr`.
|
||||||
|
* Writing in C is also completely acceptable.
|
||||||
* Other than that, there are no strict rules for code formatting, but please attempt to emulate the style around the code you are modifying.
|
* Other than that, there are no strict rules for code formatting, but please attempt to emulate the style around the code you are modifying.
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ please do not ask for these, as it will never happen here.
|
|||||||
|
|
||||||
Rules for filing a new issue or adding comments to existing issues in the tracker:
|
Rules for filing a new issue or adding comments to existing issues in the tracker:
|
||||||
|
|
||||||
|
* Low effort submissions will be simply deleted, and repeated attempts will get you banned.
|
||||||
* Check the [known issues](https://github.com/spice2x/spice2x.github.io/wiki/Known-issues) page first before reporting a new issue. If you have some new information or workarounds for a known issue, you can file a documentation bug as well.
|
* Check the [known issues](https://github.com/spice2x/spice2x.github.io/wiki/Known-issues) page first before reporting a new issue. If you have some new information or workarounds for a known issue, you can file a documentation bug as well.
|
||||||
* Use the search function and see if there is an existing issue.
|
* Use the search function and see if there is an existing issue.
|
||||||
* This is not the place to obtain a guide or receive basic troubleshooting.
|
* This is not the place to obtain a guide or receive basic troubleshooting.
|
||||||
|
|||||||
@@ -124,8 +124,8 @@ else()
|
|||||||
# https://github.com/msys2/MINGW-packages/pull/6880
|
# https://github.com/msys2/MINGW-packages/pull/6880
|
||||||
# some games crash if some DLLS load above 4GB VA, so manually set base address to standard 32-bit VA,
|
# some games crash if some DLLS load above 4GB VA, so manually set base address to standard 32-bit VA,
|
||||||
# and might as well double make sure ASLR is disabled here
|
# and might as well double make sure ASLR is disabled here
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000,--enable-stdcall-fixup")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000,--enable-stdcall-fixup")
|
||||||
|
|
||||||
# set visibility to hidden
|
# set visibility to hidden
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fvisibility=hidden")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fvisibility=hidden")
|
||||||
@@ -160,8 +160,8 @@ else()
|
|||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-fno-ident -ffunction-sections -fdata-sections")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-fno-ident -ffunction-sections -fdata-sections")
|
||||||
|
|
||||||
# linker fix to load below 4GB
|
# linker fix to load below 4GB
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000,--enable-stdcall-fixup")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections,--disable-dynamicbase,--image-base=0x400000,--enable-stdcall-fixup")
|
||||||
|
|
||||||
# set visibility to hidden
|
# set visibility to hidden
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fvisibility=hidden")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fvisibility=hidden")
|
||||||
@@ -184,8 +184,8 @@ else()
|
|||||||
set(CMAKE_CXX_FLAGS_DEBUG "-gdwarf")
|
set(CMAKE_CXX_FLAGS_DEBUG "-gdwarf")
|
||||||
|
|
||||||
# linker fix to load below 4GB
|
# linker fix to load below 4GB
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-dynamicbase,--image-base=0x400000")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-dynamicbase,--image-base=0x400000,--enable-stdcall-fixup")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--disable-dynamicbase,--image-base=0x400000")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--disable-dynamicbase,--image-base=0x400000,--enable-stdcall-fixup")
|
||||||
|
|
||||||
# enable debug symbols on level 3 and keep frame pointers
|
# enable debug symbols on level 3 and keep frame pointers
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -fno-omit-frame-pointer")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -fno-omit-frame-pointer")
|
||||||
@@ -738,6 +738,16 @@ if(NOT MSVC)
|
|||||||
set_target_properties(spicetools_stubs_nvEncodeAPI64 PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
|
set_target_properties(spicetools_stubs_nvEncodeAPI64 PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# cpusbxpkm.dll (32 bit)
|
||||||
|
set(SOURCE_FILES stubs/cpusbxpkm.cpp)
|
||||||
|
add_library(spicetools_stubs_cpusbxpkm SHARED ${SOURCE_FILES} stubs/cpusbxpkm.def)
|
||||||
|
set_target_properties(spicetools_stubs_cpusbxpkm PROPERTIES PREFIX "")
|
||||||
|
set_target_properties(spicetools_stubs_cpusbxpkm PROPERTIES OUTPUT_NAME "cpusbxpkm")
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
set_target_properties(spicetools_stubs_cpusbxpkm PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
|
||||||
|
endif()
|
||||||
|
|
||||||
# output directories
|
# output directories
|
||||||
####################
|
####################
|
||||||
|
|
||||||
@@ -747,7 +757,7 @@ set_target_properties(spicetools_cfg
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/spicetools")
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/spicetools")
|
||||||
|
|
||||||
# output 32bit
|
# output 32bit
|
||||||
set_target_properties(spicetools_spice spicetools_spice_laa spicetools_stubs_kbt spicetools_stubs_kld
|
set_target_properties(spicetools_spice spicetools_spice_laa spicetools_stubs_kbt spicetools_stubs_kld spicetools_stubs_cpusbxpkm
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/archive32"
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/archive32"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/spicetools/32"
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/spicetools/32"
|
||||||
|
|||||||
@@ -247,6 +247,25 @@ which also means that your hex edits are applicable directly.
|
|||||||
- sets the contents of the 16 segment display and disables writes from game
|
- sets the contents of the 16 segment display and disables writes from game
|
||||||
- ticker_reset()
|
- ticker_reset()
|
||||||
- re-enables writes from game
|
- re-enables writes from game
|
||||||
|
- tapeled_get(name: str, ...)
|
||||||
|
- returns a list containing a dict of the current tape LED states. The dict keys are:
|
||||||
|
- `Stage Left`
|
||||||
|
- `Stage Right`
|
||||||
|
- `Cabinet Left`
|
||||||
|
- `Cabinet Right`
|
||||||
|
- `Control Panel Under`
|
||||||
|
- `Ceiling Left`
|
||||||
|
- `Title Left`
|
||||||
|
- `Title Right`
|
||||||
|
- `Ceiling Right`
|
||||||
|
- `Touch Panel Left`
|
||||||
|
- `Touch Panel Right`
|
||||||
|
- `Side Panel Left Inner`
|
||||||
|
- `Side Panel Left Outer`
|
||||||
|
- `Side Panel Left`
|
||||||
|
- `Side Panel Right Outer`
|
||||||
|
- `Side Panel Right Inner`
|
||||||
|
- `Side Panel Right`
|
||||||
|
|
||||||
#### LCD
|
#### LCD
|
||||||
- info()
|
- info()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
namespace acio {
|
namespace acio {
|
||||||
HINSTANCE DLL_INSTANCE = nullptr;
|
HINSTANCE DLL_INSTANCE = nullptr;
|
||||||
std::vector<acio::ACIOModule *> MODULES;
|
std::vector<acio::ACIOModule *> MODULES;
|
||||||
|
std::atomic<bool> IO_INIT_IN_PROGRESS = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -58,6 +59,7 @@ static inline acio::HookMode get_hookmode() {
|
|||||||
|
|
||||||
void acio::attach() {
|
void acio::attach() {
|
||||||
log_info("acio", "SpiceTools ACIO");
|
log_info("acio", "SpiceTools ACIO");
|
||||||
|
IO_INIT_IN_PROGRESS = true;
|
||||||
|
|
||||||
// load settings and instance
|
// load settings and instance
|
||||||
acio::DLL_INSTANCE = LoadLibraryA("libacio.dll");
|
acio::DLL_INSTANCE = LoadLibraryA("libacio.dll");
|
||||||
@@ -111,6 +113,8 @@ void acio::attach() {
|
|||||||
for (auto &module : MODULES) {
|
for (auto &module : MODULES) {
|
||||||
module->attach();
|
module->attach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IO_INIT_IN_PROGRESS = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void acio::attach_icca() {
|
void acio::attach_icca() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -11,6 +12,7 @@ namespace acio {
|
|||||||
// globals
|
// globals
|
||||||
extern HINSTANCE DLL_INSTANCE;
|
extern HINSTANCE DLL_INSTANCE;
|
||||||
extern std::vector<acio::ACIOModule *> MODULES;
|
extern std::vector<acio::ACIOModule *> MODULES;
|
||||||
|
extern std::atomic<bool> IO_INIT_IN_PROGRESS;
|
||||||
|
|
||||||
void attach();
|
void attach();
|
||||||
void attach_icca();
|
void attach_icca();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace acio2emu {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IOBHandle::IOBHandle(std::wstring device) : device_(device) {
|
IOBHandle::IOBHandle(LPCWSTR device) : device_(device) {
|
||||||
nodes_[0] = std::make_unique<MasterNode>(this);
|
nodes_[0] = std::make_unique<MasterNode>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace acio2emu {
|
|||||||
void forward_packet_(const Packet &packet);
|
void forward_packet_(const Packet &packet);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IOBHandle(std::wstring device);
|
IOBHandle(LPCWSTR device);
|
||||||
|
|
||||||
bool register_node(std::unique_ptr<Node> node);
|
bool register_node(std::unique_ptr<Node> node);
|
||||||
int number_of_nodes() const;
|
int number_of_nodes() const;
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ using namespace rapidjson;
|
|||||||
|
|
||||||
namespace api::modules {
|
namespace api::modules {
|
||||||
|
|
||||||
|
std::optional<uint32_t> CAPTURE_QUALITY;
|
||||||
|
std::optional<uint32_t> CAPTURE_DIVIDE;
|
||||||
|
|
||||||
static thread_local std::vector<uint8_t> CAPTURE_BUFFER;
|
static thread_local std::vector<uint8_t> CAPTURE_BUFFER;
|
||||||
|
|
||||||
Capture::Capture() : Module("capture") {
|
Capture::Capture() : Module("capture") {
|
||||||
@@ -44,12 +47,21 @@ namespace api::modules {
|
|||||||
int screen = 0;
|
int screen = 0;
|
||||||
int quality = 70;
|
int quality = 70;
|
||||||
int divide = 1;
|
int divide = 1;
|
||||||
if (req.params.Size() > 0 && req.params[0].IsUint())
|
if (req.params.Size() > 0 && req.params[0].IsUint()) {
|
||||||
screen = req.params[0].GetUint();
|
screen = req.params[0].GetUint();
|
||||||
if (req.params.Size() > 1 && req.params[1].IsUint())
|
}
|
||||||
|
|
||||||
|
if (CAPTURE_QUALITY.has_value()) {
|
||||||
|
quality = CAPTURE_QUALITY.value();
|
||||||
|
} else if (req.params.Size() > 1 && req.params[1].IsUint()) {
|
||||||
quality = req.params[1].GetUint();
|
quality = req.params[1].GetUint();
|
||||||
if (req.params.Size() > 2 && req.params[2].IsUint())
|
}
|
||||||
|
|
||||||
|
if (CAPTURE_DIVIDE.has_value()) {
|
||||||
|
divide = CAPTURE_DIVIDE.value();
|
||||||
|
} else if (req.params.Size() > 2 && req.params[2].IsUint()) {
|
||||||
divide = req.params[2].GetUint();
|
divide = req.params[2].GetUint();
|
||||||
|
}
|
||||||
|
|
||||||
// receive JPEG data
|
// receive JPEG data
|
||||||
uint64_t timestamp = 0;
|
uint64_t timestamp = 0;
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
#include "api/module.h"
|
#include "api/module.h"
|
||||||
#include "api/request.h"
|
#include "api/request.h"
|
||||||
|
|
||||||
namespace api::modules {
|
namespace api::modules {
|
||||||
|
|
||||||
|
extern std::optional<uint32_t> CAPTURE_QUALITY;
|
||||||
|
extern std::optional<uint32_t> CAPTURE_DIVIDE;
|
||||||
|
|
||||||
class Capture : public Module {
|
class Capture : public Module {
|
||||||
public:
|
public:
|
||||||
Capture();
|
Capture();
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
#include "iidx.h"
|
#include "iidx.h"
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
|
||||||
#include "games/iidx/iidx.h"
|
|
||||||
#include "external/rapidjson/document.h"
|
|
||||||
|
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
using namespace rapidjson;
|
using namespace rapidjson;
|
||||||
|
|
||||||
|
|
||||||
namespace api::modules {
|
namespace api::modules {
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
@@ -17,6 +13,11 @@ namespace api::modules {
|
|||||||
functions["ticker_get"] = std::bind(&IIDX::ticker_get, this, _1, _2);
|
functions["ticker_get"] = std::bind(&IIDX::ticker_get, this, _1, _2);
|
||||||
functions["ticker_set"] = std::bind(&IIDX::ticker_set, this, _1, _2);
|
functions["ticker_set"] = std::bind(&IIDX::ticker_set, this, _1, _2);
|
||||||
functions["ticker_reset"] = std::bind(&IIDX::ticker_reset, this, _1, _2);
|
functions["ticker_reset"] = std::bind(&IIDX::ticker_reset, this, _1, _2);
|
||||||
|
functions["tapeled_get"] = std::bind(&IIDX::tapeled_get, this, _1, _2);
|
||||||
|
|
||||||
|
for (auto &light : games::iidx::TAPELED_MAPPING) {
|
||||||
|
this->lights_by_names.emplace(light.lightName, light);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,4 +70,51 @@ namespace api::modules {
|
|||||||
// disable read only
|
// disable read only
|
||||||
games::iidx::IIDXIO_LED_TICKER_READONLY = false;
|
games::iidx::IIDXIO_LED_TICKER_READONLY = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tapeled_get()
|
||||||
|
* tapeled_get(name: str, ...)
|
||||||
|
*/
|
||||||
|
void IIDX::tapeled_get(Request &req, Response &res) {
|
||||||
|
Value response_object(kObjectType);
|
||||||
|
|
||||||
|
// all tape leds
|
||||||
|
if (req.params.Size() == 0) {
|
||||||
|
// Iterate through each device and dump its lights data into the response
|
||||||
|
for (const auto &mapping : games::iidx::TAPELED_MAPPING) {
|
||||||
|
copy_tapeled_data(res, response_object, mapping);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// specified light names
|
||||||
|
for (Value ¶m : req.params.GetArray()) {
|
||||||
|
// check params
|
||||||
|
if (!param.IsString()) {
|
||||||
|
error_type(res, "name", "string");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto name = param.GetString();
|
||||||
|
if (const auto &it = lights_by_names.find(name); it != lights_by_names.end()) {
|
||||||
|
const auto mapping = it->second.get();
|
||||||
|
copy_tapeled_data(res, response_object, mapping);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res.add_data(response_object);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IIDX::copy_tapeled_data(Response &res, Value &response_object, const tapeledutils::tape_led &mapping) {
|
||||||
|
// Create an array for the light state
|
||||||
|
Value light_state(kArrayType);
|
||||||
|
light_state.Reserve(mapping.data.capacity() * 3, res.doc()->GetAllocator());
|
||||||
|
for (const auto [r, g, b] : mapping.data) {
|
||||||
|
light_state.PushBack(r, res.doc()->GetAllocator());
|
||||||
|
light_state.PushBack(g, res.doc()->GetAllocator());
|
||||||
|
light_state.PushBack(b, res.doc()->GetAllocator());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can't use StringRef here, turns some strings partially into null bytes for some reason
|
||||||
|
Value light_name(mapping.lightName.c_str(), res.doc()->GetAllocator());
|
||||||
|
response_object.AddMember(light_name, light_state, res.doc()->GetAllocator());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "api/module.h"
|
#include "api/module.h"
|
||||||
#include "api/request.h"
|
#include "api/request.h"
|
||||||
|
#include "games/iidx/iidx.h"
|
||||||
|
|
||||||
namespace api::modules {
|
namespace api::modules {
|
||||||
|
|
||||||
@@ -10,10 +11,16 @@ namespace api::modules {
|
|||||||
IIDX();
|
IIDX();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// state
|
||||||
|
robin_hood::unordered_map<std::string, std::reference_wrapper<tapeledutils::tape_led>> lights_by_names;
|
||||||
|
|
||||||
// function definitions
|
// function definitions
|
||||||
void ticker_get(Request &req, Response &res);
|
void ticker_get(Request &req, Response &res);
|
||||||
void ticker_set(Request &req, Response &res);
|
void ticker_set(Request &req, Response &res);
|
||||||
void ticker_reset(Request &req, Response &res);
|
void ticker_reset(Request &req, Response &res);
|
||||||
|
void tapeled_get(Request &req, Response &res);
|
||||||
|
|
||||||
|
// helper
|
||||||
|
void copy_tapeled_data(Response &res, rapidjson::Value &response_object, const tapeledutils::tape_led &mapping);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,3 +16,13 @@ def iidx_ticker_set(con: Connection, text: str):
|
|||||||
def iidx_ticker_reset(con: Connection):
|
def iidx_ticker_reset(con: Connection):
|
||||||
req = Request("iidx", "ticker_reset")
|
req = Request("iidx", "ticker_reset")
|
||||||
con.request(req)
|
con.request(req)
|
||||||
|
|
||||||
|
|
||||||
|
def iidx_tapeled_get(con: Connection, *light_names):
|
||||||
|
req = Request("iidx", "tapeled_get")
|
||||||
|
|
||||||
|
for light_name in light_names:
|
||||||
|
req.add_param(light_name)
|
||||||
|
|
||||||
|
res = con.request(req)
|
||||||
|
return res.get_data()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
namespace avs {
|
namespace avs {
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ DIST_ENABLE=1
|
|||||||
DIST_FOLDER="./dist"
|
DIST_FOLDER="./dist"
|
||||||
DIST_NAME="spice2x-$(date +%y)-$(date +%m)-$(date +%d).zip"
|
DIST_NAME="spice2x-$(date +%y)-$(date +%m)-$(date +%d).zip"
|
||||||
DIST_COMMENT=${DIST_NAME}$'\n'"$GIT_BRANCH - $GIT_HEAD"$'\nThank you for playing.'
|
DIST_COMMENT=${DIST_NAME}$'\n'"$GIT_BRANCH - $GIT_HEAD"$'\nThank you for playing.'
|
||||||
TARGETS_32="spicetools_stubs_kbt spicetools_stubs_kld spicetools_cfg spicetools_spice spicetools_spice_laa"
|
TARGETS_32="spicetools_stubs_kbt spicetools_stubs_kld spicetools_cfg spicetools_spice spicetools_spice_laa spicetools_stubs_cpusbxpkm"
|
||||||
TARGETS_64="spicetools_stubs_kbt64 spicetools_stubs_kld64 spicetools_stubs_nvEncodeAPI64 spicetools_stubs_nvcuvid spicetools_stubs_nvcuda spicetools_spice64"
|
TARGETS_64="spicetools_stubs_kbt64 spicetools_stubs_kld64 spicetools_stubs_nvEncodeAPI64 spicetools_stubs_nvcuvid spicetools_stubs_nvcuda spicetools_spice64"
|
||||||
|
|
||||||
# determine build type
|
# determine build type
|
||||||
@@ -181,7 +181,7 @@ fi
|
|||||||
echo "Copy files to output directory..."
|
echo "Copy files to output directory..."
|
||||||
rm -rf ${OUTDIR}
|
rm -rf ${OUTDIR}
|
||||||
mkdir -p ${OUTDIR}
|
mkdir -p ${OUTDIR}
|
||||||
#mkdir -p ${OUTDIR}/stubs/32
|
mkdir -p ${OUTDIR}/stubs/32
|
||||||
mkdir -p ${OUTDIR}/stubs/64
|
mkdir -p ${OUTDIR}/stubs/64
|
||||||
mkdir -p ${OUTDIR}/extras/largeaddressaware
|
mkdir -p ${OUTDIR}/extras/largeaddressaware
|
||||||
if false # ((DEBUG > 0))
|
if false # ((DEBUG > 0))
|
||||||
@@ -200,6 +200,7 @@ then
|
|||||||
#cp ${BUILDDIR_64}/spicetools/64/nvEncodeAPI64.dll ${OUTDIR}/stubs/64 2>/dev/null
|
#cp ${BUILDDIR_64}/spicetools/64/nvEncodeAPI64.dll ${OUTDIR}/stubs/64 2>/dev/null
|
||||||
#cp ${BUILDDIR_64}/spicetools/64/nvcuda.dll ${OUTDIR}/stubs/64 2>/dev/null
|
#cp ${BUILDDIR_64}/spicetools/64/nvcuda.dll ${OUTDIR}/stubs/64 2>/dev/null
|
||||||
#cp ${BUILDDIR_64}/spicetools/64/nvcuvid.dll ${OUTDIR}/stubs/64 2>/dev/null
|
#cp ${BUILDDIR_64}/spicetools/64/nvcuvid.dll ${OUTDIR}/stubs/64 2>/dev/null
|
||||||
|
#cp ${BUILDDIR_32}/spicetools/32/cpusbxpkm.dll ${OUTDIR}/stubs/32 2>/dev/null
|
||||||
else
|
else
|
||||||
# release files
|
# release files
|
||||||
cp ${BUILDDIR_32}/spicetools/spicecfg.exe ${OUTDIR} 2>/dev/null
|
cp ${BUILDDIR_32}/spicetools/spicecfg.exe ${OUTDIR} 2>/dev/null
|
||||||
@@ -213,6 +214,7 @@ else
|
|||||||
cp ${BUILDDIR_64}/spicetools/64/nvEncodeAPI64.dll ${OUTDIR}/stubs/64 2>/dev/null
|
cp ${BUILDDIR_64}/spicetools/64/nvEncodeAPI64.dll ${OUTDIR}/stubs/64 2>/dev/null
|
||||||
cp ${BUILDDIR_64}/spicetools/64/nvcuda.dll ${OUTDIR}/stubs/64 2>/dev/null
|
cp ${BUILDDIR_64}/spicetools/64/nvcuda.dll ${OUTDIR}/stubs/64 2>/dev/null
|
||||||
cp ${BUILDDIR_64}/spicetools/64/nvcuvid.dll ${OUTDIR}/stubs/64 2>/dev/null
|
cp ${BUILDDIR_64}/spicetools/64/nvcuvid.dll ${OUTDIR}/stubs/64 2>/dev/null
|
||||||
|
cp ${BUILDDIR_32}/spicetools/32/cpusbxpkm.dll ${OUTDIR}/stubs/32 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pack source files to output directory
|
# pack source files to output directory
|
||||||
|
|||||||
+34
-4
@@ -1,5 +1,8 @@
|
|||||||
#include "api.h"
|
#include "api.h"
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
#include "launcher/superexit.h"
|
||||||
#include "rawinput/rawinput.h"
|
#include "rawinput/rawinput.h"
|
||||||
#include "rawinput/piuio.h"
|
#include "rawinput/piuio.h"
|
||||||
#include "util/time.h"
|
#include "util/time.h"
|
||||||
@@ -64,18 +67,29 @@ GameAPI::Buttons::State GameAPI::Buttons::getState(rawinput::RawInputManager *ma
|
|||||||
auto current_button = &_button;
|
auto current_button = &_button;
|
||||||
auto alternatives = check_alts ? ¤t_button->getAlternatives() : nullptr;
|
auto alternatives = check_alts ? ¤t_button->getAlternatives() : nullptr;
|
||||||
unsigned int button_count = 0;
|
unsigned int button_count = 0;
|
||||||
|
std::optional<bool> window_has_focus;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
// naive behavior
|
// naive behavior
|
||||||
if (current_button->isNaive()) {
|
if (current_button->isNaive()) {
|
||||||
|
GameAPI::Buttons::State state;
|
||||||
|
auto vkey = current_button->getVKey();
|
||||||
|
|
||||||
|
// check for focus
|
||||||
|
if (vkey != INVALID_VKEY && rawinput::NAIVE_REQUIRE_FOCUS) {
|
||||||
|
if (!window_has_focus.has_value()) {
|
||||||
|
window_has_focus = superexit::has_focus();
|
||||||
|
}
|
||||||
|
if (!window_has_focus.value()) {
|
||||||
|
vkey = INVALID_VKEY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// read
|
// read
|
||||||
auto vkey = current_button->getVKey();
|
if (vkey == INVALID_VKEY) {
|
||||||
GameAPI::Buttons::State state;
|
|
||||||
if (vkey == 0xFF) {
|
|
||||||
state = BUTTON_NOT_PRESSED;
|
state = BUTTON_NOT_PRESSED;
|
||||||
} else {
|
} else {
|
||||||
state = (GetAsyncKeyState(current_button->getVKey()) & 0x8000) ? BUTTON_PRESSED : BUTTON_NOT_PRESSED;
|
state = (GetAsyncKeyState(vkey) & 0x8000) ? BUTTON_PRESSED : BUTTON_NOT_PRESSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// invert
|
// invert
|
||||||
@@ -106,6 +120,16 @@ GameAPI::Buttons::State GameAPI::Buttons::getState(rawinput::RawInputManager *ma
|
|||||||
auto &devid = current_button->getDeviceIdentifier();
|
auto &devid = current_button->getDeviceIdentifier();
|
||||||
auto device = manager->devices_get(devid, false); // TODO: fix to update only
|
auto device = manager->devices_get(devid, false); // TODO: fix to update only
|
||||||
|
|
||||||
|
// check for focus
|
||||||
|
if (device && rawinput::RAWINPUT_REQUIRE_FOCUS) {
|
||||||
|
if (!window_has_focus.has_value()) {
|
||||||
|
window_has_focus = superexit::has_focus();
|
||||||
|
}
|
||||||
|
if (!window_has_focus.value()) {
|
||||||
|
device = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get state if device was marked as updated
|
// get state if device was marked as updated
|
||||||
GameAPI::Buttons::State state = current_button->getLastState();
|
GameAPI::Buttons::State state = current_button->getLastState();
|
||||||
double *last_up = nullptr;
|
double *last_up = nullptr;
|
||||||
@@ -571,6 +595,12 @@ float GameAPI::Analogs::getState(rawinput::Device *device, Analog &analog) {
|
|||||||
switch (device->type) {
|
switch (device->type) {
|
||||||
case rawinput::MOUSE: {
|
case rawinput::MOUSE: {
|
||||||
|
|
||||||
|
// check for focus
|
||||||
|
if (rawinput::NAIVE_REQUIRE_FOCUS && !superexit::has_focus()) {
|
||||||
|
value = analog.getLastState();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// get mouse position
|
// get mouse position
|
||||||
auto mouse = device->mouseInfo;
|
auto mouse = device->mouseInfo;
|
||||||
long pos;
|
long pos;
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ std::string Button::getDisplayString(rawinput::RawInputManager* manager) {
|
|||||||
std::string vKeyString = fmt::format("{:#x}", vKey);
|
std::string vKeyString = fmt::format("{:#x}", vKey);
|
||||||
|
|
||||||
// device must be existing
|
// device must be existing
|
||||||
if (this->device_identifier.empty() && vKey == 0xFF) {
|
if (this->device_identifier.empty() && vKey == INVALID_VKEY) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,12 +33,14 @@ enum ButtonAnalogType {
|
|||||||
|
|
||||||
extern const char *ButtonAnalogTypeStr[];
|
extern const char *ButtonAnalogTypeStr[];
|
||||||
|
|
||||||
|
constexpr unsigned short INVALID_VKEY = UINT16_C(0xFF);
|
||||||
|
|
||||||
class Button {
|
class Button {
|
||||||
private:
|
private:
|
||||||
std::vector<Button> alternatives;
|
std::vector<Button> alternatives;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string device_identifier = "";
|
std::string device_identifier = "";
|
||||||
unsigned short vKey = 0xFF;
|
unsigned short vKey = INVALID_VKEY;
|
||||||
ButtonAnalogType analog_type = BAT_NONE;
|
ButtonAnalogType analog_type = BAT_NONE;
|
||||||
double debounce_up = 0.0;
|
double debounce_up = 0.0;
|
||||||
double debounce_down = 0.0;
|
double debounce_down = 0.0;
|
||||||
@@ -68,12 +70,12 @@ public:
|
|||||||
if (this->override_enabled) {
|
if (this->override_enabled) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (this->vKey != 0xFF) {
|
if (this->vKey != INVALID_VKEY) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &alternative : this->alternatives) {
|
for (auto &alternative : this->alternatives) {
|
||||||
if (alternative.vKey != 0xFF) {
|
if (alternative.vKey != INVALID_VKEY) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +84,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void clearBindings() {
|
inline void clearBindings() {
|
||||||
vKey = 0xFF;
|
vKey = INVALID_VKEY;
|
||||||
alternatives.clear();
|
alternatives.clear();
|
||||||
device_identifier = "";
|
device_identifier = "";
|
||||||
analog_type = BAT_NONE;
|
analog_type = BAT_NONE;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public:
|
|||||||
std::string value;
|
std::string value;
|
||||||
std::vector<Option> alternatives;
|
std::vector<Option> alternatives;
|
||||||
bool disabled = false;
|
bool disabled = false;
|
||||||
|
bool conflicting = false;
|
||||||
|
|
||||||
explicit Option(OptionDefinition definition, std::string value = "") :
|
explicit Option(OptionDefinition definition, std::string value = "") :
|
||||||
definition(std::move(definition)), value(std::move(value)) {
|
definition(std::move(definition)), value(std::move(value)) {
|
||||||
|
|||||||
@@ -1,3 +1,32 @@
|
|||||||
|
08/17/2025 [spice2x]
|
||||||
|
DDR: fix codec registration failure when path contains spaces
|
||||||
|
|
||||||
|
08/11/2025 [spice2x]
|
||||||
|
SDVX: fix camera hook, remove -sdvxdisablecams
|
||||||
|
DDR: automatically register codecs in com folder on boot
|
||||||
|
|
||||||
|
06/03/2025 [spice2x]
|
||||||
|
Add libshare-pj.dll to Gitadora patch import
|
||||||
|
Detect ACIO init failures
|
||||||
|
|
||||||
|
05/31/2025 [spice2x]
|
||||||
|
IIDX: fix windowed subscreen not accepting mouse clicks when
|
||||||
|
overlay is active
|
||||||
|
IIDX: tape LED over API
|
||||||
|
Option to make command line args take precedence
|
||||||
|
UI tweaks
|
||||||
|
|
||||||
|
05/09/2025 [spice2x]
|
||||||
|
Check for window focus when processing input (-inputfocus)
|
||||||
|
More options for IIDX/SDVX windowed subscreen
|
||||||
|
SpiceCompanion screen mirroring quality options
|
||||||
|
Various LovePlus improvements and fixes:
|
||||||
|
Allow camera access
|
||||||
|
Full screen mode
|
||||||
|
Add printer options
|
||||||
|
Add stub for printer DLL (cpusbxpkm.dll)
|
||||||
|
Logging improvements for better troubleshooting
|
||||||
|
|
||||||
04/25/2025 [spice2x]
|
04/25/2025 [spice2x]
|
||||||
LargeAddressAware variant of spice.exe for Metal Gear
|
LargeAddressAware variant of spice.exe for Metal Gear
|
||||||
Save new JSON config files to %appdata%/spice2x
|
Save new JSON config files to %appdata%/spice2x
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace games::ddr {
|
|||||||
|
|
||||||
// settings
|
// settings
|
||||||
bool SDMODE = false;
|
bool SDMODE = false;
|
||||||
|
bool NO_CODEC_REGISTRATION = false;
|
||||||
|
|
||||||
uint8_t DDR_TAPELEDS[TAPELED_DEVICE_COUNT][50][3] {};
|
uint8_t DDR_TAPELEDS[TAPELED_DEVICE_COUNT][50][3] {};
|
||||||
|
|
||||||
@@ -52,6 +53,51 @@ namespace games::ddr {
|
|||||||
DDRGame::DDRGame() : Game("Dance Dance Revolution") {
|
DDRGame::DDRGame() : Game("Dance Dance Revolution") {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DDRGame::register_codecs() {
|
||||||
|
// find where spice.exe / spice64.exe is located
|
||||||
|
const auto &spice_bin_path = libutils::module_file_name(nullptr).parent_path();
|
||||||
|
|
||||||
|
// find the com directory
|
||||||
|
std::filesystem::path dir = "";
|
||||||
|
if (MODULE_PATH == spice_bin_path) {
|
||||||
|
// try: \com
|
||||||
|
dir = spice_bin_path / "com";
|
||||||
|
} else {
|
||||||
|
// try: modules\..\com
|
||||||
|
dir = MODULE_PATH / ".." / "com";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileutils::dir_exists(dir)) {
|
||||||
|
log_info("ddr", "looking for codecs in this directory: {}", dir.string());
|
||||||
|
} else {
|
||||||
|
log_info("ddr", "codecs directory not found: {}", dir.string());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &file : std::filesystem::directory_iterator(dir)) {
|
||||||
|
const auto &filename = file.path().filename();
|
||||||
|
const auto extension = strtolower(filename.extension().string());
|
||||||
|
|
||||||
|
if (extension != ".dll") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
log_info("ddr", "found DLL: {}", filename.string());
|
||||||
|
if (filename == "k-clvsd.dll" || filename.string().find("xactengine") == 0) {
|
||||||
|
const std::wstring wcmd = L"regsvr32.exe /s \"" + file.path().wstring() + L"\"";
|
||||||
|
const std::string cmd = "regsvr32.exe /s \"" + file.path().string() + "\"";
|
||||||
|
|
||||||
|
int result = 0;
|
||||||
|
std::thread t([wcmd, &result]() {
|
||||||
|
result = _wsystem(wcmd.c_str());
|
||||||
|
});
|
||||||
|
t.join();
|
||||||
|
log_info("ddr", "`{}` returned {}", cmd, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DDRGame::pre_attach() {
|
void DDRGame::pre_attach() {
|
||||||
if (!cfg::CONFIGURATOR_STANDALONE && avs::game::is_model("TDX")) {
|
if (!cfg::CONFIGURATOR_STANDALONE && avs::game::is_model("TDX")) {
|
||||||
log_fatal(
|
log_fatal(
|
||||||
@@ -87,6 +133,10 @@ namespace games::ddr {
|
|||||||
"!!! !!!\n\n\n"
|
"!!! !!!\n\n\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cfg::CONFIGURATOR_STANDALONE && !NO_CODEC_REGISTRATION) {
|
||||||
|
this->register_codecs();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DDRGame::attach() {
|
void DDRGame::attach() {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ namespace games::ddr {
|
|||||||
|
|
||||||
// settings
|
// settings
|
||||||
extern bool SDMODE;
|
extern bool SDMODE;
|
||||||
|
extern bool NO_CODEC_REGISTRATION;
|
||||||
|
|
||||||
// Buffers to store RGB data for tape LEDs on gold cabinets
|
// Buffers to store RGB data for tape LEDs on gold cabinets
|
||||||
const size_t TAPELED_DEVICE_COUNT = 11;
|
const size_t TAPELED_DEVICE_COUNT = 11;
|
||||||
@@ -18,5 +19,8 @@ namespace games::ddr {
|
|||||||
virtual void pre_attach() override;
|
virtual void pre_attach() override;
|
||||||
virtual void attach() override;
|
virtual void attach() override;
|
||||||
virtual void detach() override;
|
virtual void detach() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void register_codecs();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -409,50 +409,27 @@ namespace games::iidx {
|
|||||||
* 16 - side panel right - 183 bytes - 61 colors
|
* 16 - side panel right - 183 bytes - 61 colors
|
||||||
*
|
*
|
||||||
* data is stored in RGB order, 3 bytes per color
|
* data is stored in RGB order, 3 bytes per color
|
||||||
*
|
|
||||||
* TODO: expose this data via API
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// data mapping
|
|
||||||
static struct TapeLedMapping {
|
|
||||||
size_t data_size;
|
|
||||||
int index_r, index_g, index_b;
|
|
||||||
|
|
||||||
TapeLedMapping(size_t data_size, int index_r, int index_g, int index_b)
|
|
||||||
: data_size(data_size), index_r(index_r), index_g(index_g), index_b(index_b) {}
|
|
||||||
|
|
||||||
} mapping[] = {
|
|
||||||
{ 19, Lights::StageLeftAvgR, Lights::StageLeftAvgG, Lights::StageLeftAvgB },
|
|
||||||
{ 19, Lights::StageRightAvgR, Lights::StageRightAvgG, Lights::StageRightAvgB },
|
|
||||||
{ 45, Lights::CabinetLeftAvgR, Lights::CabinetLeftAvgG, Lights::CabinetLeftAvgB },
|
|
||||||
{ 45, Lights::CabinetRightAvgR, Lights::CabinetRightAvgG, Lights::CabinetRightAvgB },
|
|
||||||
{ 21, Lights::ControlPanelUnderAvgR, Lights::ControlPanelUnderAvgG, Lights::ControlPanelUnderAvgB },
|
|
||||||
{ 54, Lights::CeilingLeftAvgR, Lights::CeilingLeftAvgG, Lights::CeilingLeftAvgB },
|
|
||||||
{ 11, Lights::TitleLeftAvgR, Lights::TitleLeftAvgG, Lights::TitleLeftAvgB },
|
|
||||||
{ 11, Lights::TitleRightAvgR, Lights::TitleRightAvgG, Lights::TitleRightAvgB },
|
|
||||||
{ 54, Lights::CeilingRightAvgR, Lights::CeilingRightAvgG, Lights::CeilingRightAvgB },
|
|
||||||
{ 17, Lights::TouchPanelLeftAvgR, Lights::TouchPanelLeftAvgG, Lights::TouchPanelLeftAvgB },
|
|
||||||
{ 17, Lights::TouchPanelRightAvgR, Lights::TouchPanelRightAvgG, Lights::TouchPanelRightAvgB },
|
|
||||||
{ 68, Lights::SidePanelLeftInnerAvgR, Lights::SidePanelLeftInnerAvgG, Lights::SidePanelLeftInnerAvgB },
|
|
||||||
{ 68, Lights::SidePanelLeftOuterAvgR, Lights::SidePanelLeftOuterAvgG, Lights::SidePanelLeftOuterAvgB },
|
|
||||||
{ 61, Lights::SidePanelLeftAvgR, Lights::SidePanelLeftAvgG, Lights::SidePanelLeftAvgB },
|
|
||||||
{ 68, Lights::SidePanelRightOuterAvgR, Lights::SidePanelRightOuterAvgG, Lights::SidePanelRightOuterAvgB },
|
|
||||||
{ 68, Lights::SidePanelRightInnerAvgR, Lights::SidePanelRightInnerAvgG, Lights::SidePanelRightInnerAvgB },
|
|
||||||
{ 61, Lights::SidePanelRightAvgR, Lights::SidePanelRightAvgG, Lights::SidePanelRightAvgB },
|
|
||||||
};
|
|
||||||
|
|
||||||
// check index bounds
|
// check index bounds
|
||||||
if (tapeledutils::is_enabled() && index < std::size(mapping)) {
|
if (tapeledutils::is_enabled() && index < std::size(TAPELED_MAPPING)) {
|
||||||
auto &map = mapping[index];
|
auto &map = TAPELED_MAPPING[index];
|
||||||
|
const auto data_size = map.data.capacity();
|
||||||
|
|
||||||
// pick a color to use
|
// pick a color to use
|
||||||
const auto rgb = tapeledutils::pick_color_from_led_tape(data, map.data_size);
|
const auto rgb = tapeledutils::pick_color_from_led_tape(data, data_size);
|
||||||
|
|
||||||
// program the lights into API
|
// program the lights into API
|
||||||
auto &lights = get_lights();
|
auto &lights = get_lights();
|
||||||
GameAPI::Lights::writeLight(RI_MGR, lights[map.index_r], rgb.r);
|
GameAPI::Lights::writeLight(RI_MGR, lights[map.index_r], rgb.r);
|
||||||
GameAPI::Lights::writeLight(RI_MGR, lights[map.index_g], rgb.g);
|
GameAPI::Lights::writeLight(RI_MGR, lights[map.index_g], rgb.g);
|
||||||
GameAPI::Lights::writeLight(RI_MGR, lights[map.index_b], rgb.b);
|
GameAPI::Lights::writeLight(RI_MGR, lights[map.index_b], rgb.b);
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < data_size; ++i) {
|
||||||
|
map.data[i].r = data[i * 3];
|
||||||
|
map.data[i].g = data[i * 3 + 1];
|
||||||
|
map.data[i].b = data[i * 3 + 2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (This != custom_node) {
|
if (This != custom_node) {
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
#include "util/sigscan.h"
|
#include "util/sigscan.h"
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
|
|
||||||
|
#include "external/robin_hood.h"
|
||||||
|
|
||||||
#include "bi2a.h"
|
#include "bi2a.h"
|
||||||
#include "bi2x_hook.h"
|
#include "bi2x_hook.h"
|
||||||
#include "ezusb.h"
|
#include "ezusb.h"
|
||||||
@@ -74,6 +76,26 @@ namespace games::iidx {
|
|||||||
bool IIDXIO_LED_TICKER_READONLY = false;
|
bool IIDXIO_LED_TICKER_READONLY = false;
|
||||||
std::mutex IIDX_LED_TICKER_LOCK;
|
std::mutex IIDX_LED_TICKER_LOCK;
|
||||||
|
|
||||||
|
tapeledutils::tape_led TAPELED_MAPPING[IIDX_TAPELED_TOTAL] = {
|
||||||
|
{ 19, Lights::StageLeftAvgR, Lights::StageLeftAvgG, Lights::StageLeftAvgB, "Stage Left" },
|
||||||
|
{ 19, Lights::StageRightAvgR, Lights::StageRightAvgG, Lights::StageRightAvgB, "Stage Right" },
|
||||||
|
{ 45, Lights::CabinetLeftAvgR, Lights::CabinetLeftAvgG, Lights::CabinetLeftAvgB, "Cabinet Left" },
|
||||||
|
{ 45, Lights::CabinetRightAvgR, Lights::CabinetRightAvgG, Lights::CabinetRightAvgB, "Cabinet Right" },
|
||||||
|
{ 21, Lights::ControlPanelUnderAvgR, Lights::ControlPanelUnderAvgG, Lights::ControlPanelUnderAvgB, "Control Panel Under" },
|
||||||
|
{ 54, Lights::CeilingLeftAvgR, Lights::CeilingLeftAvgG, Lights::CeilingLeftAvgB, "Ceiling Left" },
|
||||||
|
{ 11, Lights::TitleLeftAvgR, Lights::TitleLeftAvgG, Lights::TitleLeftAvgB, "Title Left" },
|
||||||
|
{ 11, Lights::TitleRightAvgR, Lights::TitleRightAvgG, Lights::TitleRightAvgB, "Title Right" },
|
||||||
|
{ 54, Lights::CeilingRightAvgR, Lights::CeilingRightAvgG, Lights::CeilingRightAvgB, "Ceiling Right" },
|
||||||
|
{ 17, Lights::TouchPanelLeftAvgR, Lights::TouchPanelLeftAvgG, Lights::TouchPanelLeftAvgB, "Touch Panel Left" },
|
||||||
|
{ 17, Lights::TouchPanelRightAvgR, Lights::TouchPanelRightAvgG, Lights::TouchPanelRightAvgB, "Touch Panel Right" },
|
||||||
|
{ 68, Lights::SidePanelLeftInnerAvgR, Lights::SidePanelLeftInnerAvgG, Lights::SidePanelLeftInnerAvgB, "Side Panel Left Inner" },
|
||||||
|
{ 68, Lights::SidePanelLeftOuterAvgR, Lights::SidePanelLeftOuterAvgG, Lights::SidePanelLeftOuterAvgB, "Side Panel Left Outer" },
|
||||||
|
{ 61, Lights::SidePanelLeftAvgR, Lights::SidePanelLeftAvgG, Lights::SidePanelLeftAvgB, "Side Panel Left" },
|
||||||
|
{ 68, Lights::SidePanelRightOuterAvgR, Lights::SidePanelRightOuterAvgG, Lights::SidePanelRightOuterAvgB, "Side Panel Right Outer" },
|
||||||
|
{ 68, Lights::SidePanelRightInnerAvgR, Lights::SidePanelRightInnerAvgG, Lights::SidePanelRightInnerAvgB, "Side Panel Right Inner" },
|
||||||
|
{ 61, Lights::SidePanelRightAvgR, Lights::SidePanelRightAvgG, Lights::SidePanelRightAvgB, "Side Panel Right" },
|
||||||
|
};
|
||||||
|
|
||||||
static LONG WINAPI RegOpenKeyA_hook(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult) {
|
static LONG WINAPI RegOpenKeyA_hook(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult) {
|
||||||
if (lpSubKey != nullptr && phkResult != nullptr) {
|
if (lpSubKey != nullptr && phkResult != nullptr) {
|
||||||
if (hKey == HKEY_LOCAL_MACHINE &&
|
if (hKey == HKEY_LOCAL_MACHINE &&
|
||||||
|
|||||||
@@ -2,9 +2,13 @@
|
|||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "games/game.h"
|
#include "games/game.h"
|
||||||
|
|
||||||
|
#include "external/robin_hood.h"
|
||||||
|
#include "util/tapeled.h"
|
||||||
|
|
||||||
namespace games::iidx {
|
namespace games::iidx {
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
@@ -30,6 +34,10 @@ namespace games::iidx {
|
|||||||
extern bool IIDXIO_LED_TICKER_READONLY;
|
extern bool IIDXIO_LED_TICKER_READONLY;
|
||||||
extern std::mutex IIDX_LED_TICKER_LOCK;
|
extern std::mutex IIDX_LED_TICKER_LOCK;
|
||||||
|
|
||||||
|
constexpr int IIDX_TAPELED_TOTAL = 17;
|
||||||
|
// data mapping
|
||||||
|
extern tapeledutils::tape_led TAPELED_MAPPING[IIDX_TAPELED_TOTAL];
|
||||||
|
|
||||||
class IIDXGame : public games::Game {
|
class IIDXGame : public games::Game {
|
||||||
public:
|
public:
|
||||||
IIDXGame();
|
IIDXGame();
|
||||||
|
|||||||
@@ -266,8 +266,8 @@ namespace games::iidx::poke {
|
|||||||
y *= rawinput::TOUCHSCREEN_RANGE_Y;
|
y *= rawinput::TOUCHSCREEN_RANGE_Y;
|
||||||
} else if (GRAPHICS_IIDX_WSUB) {
|
} else if (GRAPHICS_IIDX_WSUB) {
|
||||||
// Scale to windowed subscreen
|
// Scale to windowed subscreen
|
||||||
x *= GRAPHICS_IIDX_WSUB_WIDTH;
|
x *= GRAPHICS_WSUB_WIDTH;
|
||||||
y *= GRAPHICS_IIDX_WSUB_HEIGHT;
|
y *= GRAPHICS_WSUB_HEIGHT;
|
||||||
} else if (GENERIC_SUB_WINDOW_FULLSIZE || !overlay::OVERLAY->get_active()) {
|
} else if (GENERIC_SUB_WINDOW_FULLSIZE || !overlay::OVERLAY->get_active()) {
|
||||||
// Overlay is not present, scale to main screen
|
// Overlay is not present, scale to main screen
|
||||||
if (GRAPHICS_WINDOWED) {
|
if (GRAPHICS_WINDOWED) {
|
||||||
|
|||||||
@@ -13,10 +13,14 @@
|
|||||||
|
|
||||||
namespace games::loveplus {
|
namespace games::loveplus {
|
||||||
|
|
||||||
|
bool CAMERA_ENABLE = false;
|
||||||
|
|
||||||
// touch stuff
|
// touch stuff
|
||||||
static bool TOUCH_ENABLE = false;
|
static bool TOUCH_ENABLE = false;
|
||||||
static bool TOUCH_ATTACHED = false;
|
static bool TOUCH_ATTACHED = false;
|
||||||
|
|
||||||
|
static std::string lp_args = "-noWatchDog -noIOError -noIrda -notarget";
|
||||||
|
|
||||||
void touch_update() {
|
void touch_update() {
|
||||||
|
|
||||||
// check if touch enabled
|
// check if touch enabled
|
||||||
@@ -28,16 +32,15 @@ namespace games::loveplus {
|
|||||||
if (!TOUCH_ATTACHED) {
|
if (!TOUCH_ATTACHED) {
|
||||||
|
|
||||||
// Find the game window.
|
// Find the game window.
|
||||||
// We check the foreground window first, then fall back to searching for the window title
|
HWND wnd = FindProcessWindowBeginsWith("LovePlusAC");
|
||||||
// All game versions seem to have their model first in the window title
|
|
||||||
HWND wnd = GetForegroundWindow();
|
|
||||||
if (!string_begins_with(GetActiveWindowTitle(), "LovePlus")) {
|
|
||||||
wnd = FindWindowBeginsWith(avs::game::MODEL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// attach touch hook
|
// attach touch hook
|
||||||
if (wnd) {
|
if (wnd) {
|
||||||
log_info("loveplus", "using window handle for touch: {}", fmt::ptr(wnd));
|
log_info(
|
||||||
|
"loveplus",
|
||||||
|
"using window handle for touch: {} ({})",
|
||||||
|
fmt::ptr(wnd),
|
||||||
|
get_window_title(wnd));
|
||||||
touch_create_wnd(wnd);
|
touch_create_wnd(wnd);
|
||||||
} else {
|
} else {
|
||||||
log_info("loveplus", "falling back to the DirectX window handle for touch");
|
log_info("loveplus", "falling back to the DirectX window handle for touch");
|
||||||
@@ -117,12 +120,26 @@ namespace games::loveplus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static LPSTR __stdcall GetCommandLineA_hook() {
|
static LPSTR __stdcall GetCommandLineA_hook() {
|
||||||
static std::string lp_args = "-win -noCamera -noWatchDog -noIOError -noIrda -notarget";
|
|
||||||
|
|
||||||
return lp_args.data();
|
return lp_args.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool lp_spam_remover(void *user, const std::string &data, logger::Style style, std::string &out) {
|
||||||
|
if (data.empty() || data[0] != '[') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (data.find("> [INFO] err_code: 0, err_title: , err_str:") != std::string::npos) {
|
||||||
|
out = "";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
LovePlusGame::LovePlusGame() : Game("LovePlus") {
|
LovePlusGame::LovePlusGame() : Game("LovePlus") {
|
||||||
|
logger::hook_add(lp_spam_remover, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
LovePlusGame::~LovePlusGame() {
|
||||||
|
logger::hook_remove(lp_spam_remover, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LovePlusGame::attach() {
|
void LovePlusGame::attach() {
|
||||||
@@ -157,9 +174,17 @@ namespace games::loveplus {
|
|||||||
HMODULE seteq = libutils::try_library("ad_hd_seteq_dll.dll");
|
HMODULE seteq = libutils::try_library("ad_hd_seteq_dll.dll");
|
||||||
detour::inline_hook((void *) SetEqualizer, libutils::try_proc(seteq, "SetEqualizer"));
|
detour::inline_hook((void *) SetEqualizer, libutils::try_proc(seteq, "SetEqualizer"));
|
||||||
|
|
||||||
|
// set up command line args
|
||||||
|
if (!CAMERA_ENABLE) {
|
||||||
|
lp_args += " -noCamera";
|
||||||
|
}
|
||||||
|
if (GRAPHICS_WINDOWED) {
|
||||||
|
lp_args += " -win";
|
||||||
|
}
|
||||||
// get command line hook
|
// get command line hook
|
||||||
HMODULE lpac = libutils::try_library("lpac.dll");
|
HMODULE lpac = libutils::try_library("lpac.dll");
|
||||||
detour::iat("GetCommandLineA", GetCommandLineA_hook, lpac);
|
detour::iat("GetCommandLineA", GetCommandLineA_hook, lpac);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LovePlusGame::detach() {
|
void LovePlusGame::detach() {
|
||||||
|
|||||||
@@ -4,12 +4,15 @@
|
|||||||
|
|
||||||
namespace games::loveplus {
|
namespace games::loveplus {
|
||||||
|
|
||||||
|
extern bool CAMERA_ENABLE;
|
||||||
|
|
||||||
// touch stuff
|
// touch stuff
|
||||||
void touch_update();
|
void touch_update();
|
||||||
|
|
||||||
class LovePlusGame : public games::Game {
|
class LovePlusGame : public games::Game {
|
||||||
public:
|
public:
|
||||||
LovePlusGame();
|
LovePlusGame();
|
||||||
|
virtual ~LovePlusGame() override;
|
||||||
virtual void attach() override;
|
virtual void attach() override;
|
||||||
virtual void detach() override;
|
virtual void detach() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,134 +14,24 @@
|
|||||||
#include <mfidl.h>
|
#include <mfidl.h>
|
||||||
|
|
||||||
#include "avs/game.h"
|
#include "avs/game.h"
|
||||||
#include "hooks/cfgmgr32hook.h"
|
|
||||||
#include "util/detour.h"
|
#include "util/detour.h"
|
||||||
#include "util/memutils.h"
|
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
|
|
||||||
static VTBL_TYPE(IMFActivate, GetAllocatedString) GetAllocatedString_orig = nullptr;
|
|
||||||
|
|
||||||
static decltype(MFEnumDeviceSources) *MFEnumDeviceSources_orig = nullptr;
|
|
||||||
|
|
||||||
namespace games::sdvx {
|
namespace games::sdvx {
|
||||||
|
|
||||||
static std::wstring CAMERA0_ID;
|
|
||||||
|
|
||||||
static HRESULT WINAPI GetAllocatedString_hook(IMFActivate* This, REFGUID guidKey, LPWSTR *ppwszValue,
|
|
||||||
UINT32 *pcchLength) {
|
|
||||||
// call the original
|
|
||||||
HRESULT result = GetAllocatedString_orig(This, guidKey, ppwszValue, pcchLength);
|
|
||||||
|
|
||||||
// try first camera
|
|
||||||
wchar_t *pwc = nullptr;
|
|
||||||
if (CAMERA0_ID.length() == 23)
|
|
||||||
pwc = wcsstr(*ppwszValue, CAMERA0_ID.c_str());
|
|
||||||
|
|
||||||
// check if camera could be identified
|
|
||||||
if (pwc) {
|
|
||||||
|
|
||||||
// fake the USB IDs
|
|
||||||
pwc[4] = L'2';
|
|
||||||
pwc[5] = L'8';
|
|
||||||
pwc[6] = L'8';
|
|
||||||
pwc[7] = L'c';
|
|
||||||
pwc[13] = L'0';
|
|
||||||
pwc[14] = L'0';
|
|
||||||
pwc[15] = L'0';
|
|
||||||
pwc[16] = L'2';
|
|
||||||
pwc[21] = L'0';
|
|
||||||
pwc[22] = L'0';
|
|
||||||
}
|
|
||||||
|
|
||||||
// return original result
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void hook_camera(IMFActivate* camera, size_t no, std::wstring camera_id, std::string camera_instance) {
|
|
||||||
|
|
||||||
// don't hook if camera 0 is already hooked
|
|
||||||
if (CAMERA0_ID.length() > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// save the camera ID
|
|
||||||
CAMERA0_ID = camera_id;
|
|
||||||
|
|
||||||
// cfgmgr hook
|
|
||||||
CFGMGR32_HOOK_SETTING camera_setting;
|
|
||||||
camera_setting.device_instance = 0xDEADBEEF;
|
|
||||||
camera_setting.parent_instance = ~camera_setting.device_instance;
|
|
||||||
camera_setting.device_id = "USB\\VEN_1022&DEV_7908";
|
|
||||||
camera_setting.device_node_id = "USB\\VID_288C&PID_0002&MI_00\\?&????????&?&????";
|
|
||||||
if (camera_instance.length() == 17) {
|
|
||||||
for (int i = 0; i < 17; i++) {
|
|
||||||
camera_setting.device_node_id[28 + i] = camera_instance[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cfgmgr32hook_add(camera_setting);
|
|
||||||
|
|
||||||
// save original method for later use
|
|
||||||
if (GetAllocatedString_orig == nullptr) {
|
|
||||||
GetAllocatedString_orig = camera->lpVtbl->GetAllocatedString;
|
|
||||||
}
|
|
||||||
|
|
||||||
// hook allocated string method for camera identification
|
|
||||||
memutils::VProtectGuard camera_guard(camera->lpVtbl);
|
|
||||||
camera->lpVtbl->GetAllocatedString = GetAllocatedString_hook;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI MFEnumDeviceSources_hook(IMFAttributes *pAttributes, IMFActivate ***pppSourceActivate,
|
static HRESULT WINAPI MFEnumDeviceSources_hook(IMFAttributes *pAttributes, IMFActivate ***pppSourceActivate,
|
||||||
UINT32 *pcSourceActivate) {
|
UINT32 *pcSourceActivate) {
|
||||||
|
|
||||||
// call original function
|
*pppSourceActivate = nullptr;
|
||||||
HRESULT result_orig = MFEnumDeviceSources_orig(pAttributes, pppSourceActivate, pcSourceActivate);
|
*pcSourceActivate = 0;
|
||||||
|
log_misc("sdvx", "MFEnumDeviceSources_hook called, returning 0 cameras");
|
||||||
// check for capture devices
|
return S_OK;
|
||||||
if (FAILED(result_orig) || !*pcSourceActivate) {
|
|
||||||
return result_orig;
|
|
||||||
}
|
|
||||||
|
|
||||||
// iterate cameras
|
|
||||||
size_t cam_hook_num = 0;
|
|
||||||
for (size_t cam_num = 0; cam_num < *pcSourceActivate && cam_hook_num < 1; cam_num++) {
|
|
||||||
|
|
||||||
// flip
|
|
||||||
size_t cam_num_flipped = cam_num;
|
|
||||||
|
|
||||||
// get camera link
|
|
||||||
IMFActivate *camera = (*pppSourceActivate)[cam_num_flipped];
|
|
||||||
LPWSTR camera_link_lpwstr;
|
|
||||||
UINT32 camera_link_length;
|
|
||||||
if (SUCCEEDED(camera->lpVtbl->GetAllocatedString(
|
|
||||||
camera,
|
|
||||||
MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK,
|
|
||||||
&camera_link_lpwstr,
|
|
||||||
&camera_link_length))) {
|
|
||||||
|
|
||||||
// cut name to make ID
|
|
||||||
std::wstring camera_link_ws = std::wstring(camera_link_lpwstr);
|
|
||||||
std::wstring camera_id = camera_link_ws.substr(8, 23);
|
|
||||||
|
|
||||||
// get camera instance
|
|
||||||
std::string camera_link = ws2s(camera_link_ws);
|
|
||||||
std::string camera_instance = camera_link.substr(32, 17);
|
|
||||||
|
|
||||||
// hook the camera
|
|
||||||
hook_camera(camera, cam_hook_num, camera_id, camera_instance);
|
|
||||||
|
|
||||||
// increase camera hook number
|
|
||||||
cam_hook_num++;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// return result
|
|
||||||
return result_orig;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void camera_init() {
|
void camera_init() {
|
||||||
|
|
||||||
// camera media framework hook
|
// camera media framework hook
|
||||||
MFEnumDeviceSources_orig = detour::iat_try(
|
log_info("sdvx", "installing camera hooks...");
|
||||||
"MFEnumDeviceSources", MFEnumDeviceSources_hook, avs::game::DLL_INSTANCE);
|
detour::iat_try("MFEnumDeviceSources", MFEnumDeviceSources_hook, avs::game::DLL_INSTANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ namespace games::sdvx {
|
|||||||
const char *ORIGINAL_ASIO_DEVICE_NAME = "XONAR SOUND CARD(64)";
|
const char *ORIGINAL_ASIO_DEVICE_NAME = "XONAR SOUND CARD(64)";
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
bool DISABLECAMS = false;
|
|
||||||
bool NATIVETOUCH = false;
|
bool NATIVETOUCH = false;
|
||||||
uint8_t DIGITAL_KNOB_SENS = 16;
|
uint8_t DIGITAL_KNOB_SENS = 16;
|
||||||
SdvxOverlayPosition OVERLAY_POS = SDVX_OVERLAY_BOTTOM;
|
SdvxOverlayPosition OVERLAY_POS = SDVX_OVERLAY_BOTTOM;
|
||||||
@@ -369,17 +368,17 @@ namespace games::sdvx {
|
|||||||
winuser_hook_init(avs::game::DLL_INSTANCE);
|
winuser_hook_init(avs::game::DLL_INSTANCE);
|
||||||
|
|
||||||
// hook camera
|
// hook camera
|
||||||
if (!DISABLECAMS) {
|
camera_init();
|
||||||
camera_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
// RGB CAMERA error ignore
|
// RGB CAMERA error ignore for SDVX5
|
||||||
if (!replace_pattern(
|
// SDVX5: boot sequence triggers camera error if camera is not detected
|
||||||
|
// SDVX6: boots fine, but game title screen in attract loop will have camera error (cosmetic only)
|
||||||
|
if (replace_pattern(
|
||||||
avs::game::DLL_INSTANCE,
|
avs::game::DLL_INSTANCE,
|
||||||
"418D480484C074218D51FD",
|
"418D480484C074218D51FD",
|
||||||
"????????????9090??????",
|
"????????????9090??????",
|
||||||
0, 0)) {
|
0, 0)) {
|
||||||
log_info("sdvx", "did not find matching signature for camera error patch");
|
log_info("sdvx", "applied camera error patch (sdvx5)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove log spam
|
// remove log spam
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ namespace games::sdvx {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
extern bool DISABLECAMS;
|
|
||||||
extern bool NATIVETOUCH;
|
extern bool NATIVETOUCH;
|
||||||
extern uint8_t DIGITAL_KNOB_SENS;
|
extern uint8_t DIGITAL_KNOB_SENS;
|
||||||
extern std::optional<std::string> ASIO_DRIVER;
|
extern std::optional<std::string> ASIO_DRIVER;
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ namespace games::shared {
|
|||||||
|
|
||||||
// error
|
// error
|
||||||
if (!clear) {
|
if (!clear) {
|
||||||
log_fatal("sdvx", "could not find path");
|
log_fatal("printer", "could not find path");
|
||||||
}
|
}
|
||||||
|
|
||||||
return "DUMMY";
|
return "DUMMY";
|
||||||
@@ -326,7 +326,7 @@ namespace games::shared {
|
|||||||
memcpy(image_data, pBandImage->baseAddr, (size_t) (image_width * image_height * 3));
|
memcpy(image_data, pBandImage->baseAddr, (size_t) (image_width * image_height * 3));
|
||||||
|
|
||||||
// convert BGR to RGB
|
// convert BGR to RGB
|
||||||
log_info("printer", "converting BGR to RGB...");
|
log_misc("printer", "converting BGR to RGB...");
|
||||||
for (int pixel = 0; pixel < image_width * image_height; pixel++) {
|
for (int pixel = 0; pixel < image_width * image_height; pixel++) {
|
||||||
int index = pixel * 3;
|
int index = pixel * 3;
|
||||||
uint8_t tmp = image_data[index];
|
uint8_t tmp = image_data[index];
|
||||||
@@ -334,25 +334,45 @@ namespace games::shared {
|
|||||||
image_data[index + 2] = tmp;
|
image_data[index + 2] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// flip horizontally
|
if (avs::game::is_model({"KLP", "KFC"})) {
|
||||||
for (int x = 0; x < image_width / 2; x++) {
|
// rotate image clockwise
|
||||||
for (int y = 0; y < image_height; y++) {
|
log_misc("printer", "rotate clockwise...");
|
||||||
int index1 = (y * image_width + x) * 3;
|
auto rotated = new uint8_t[image_width * image_height * 3];
|
||||||
int index2 = (y * image_width + image_width - x - 1) * 3;
|
for (int x = 0; x < image_width; x++) {
|
||||||
uint8_t r = image_data[index1 + 0];
|
for (int y = 0; y < image_height; y++) {
|
||||||
uint8_t g = image_data[index1 + 1];
|
int index1 = (y * image_width + x) * 3;
|
||||||
uint8_t b = image_data[index1 + 2];
|
int index2 = (x * image_height + y) * 3;
|
||||||
image_data[index1 + 0] = image_data[index2 + 0];
|
rotated[index2 + 0] = image_data[index1 + 0];
|
||||||
image_data[index1 + 1] = image_data[index2 + 1];
|
rotated[index2 + 1] = image_data[index1 + 1];
|
||||||
image_data[index1 + 2] = image_data[index2 + 2];
|
rotated[index2 + 2] = image_data[index1 + 2];
|
||||||
image_data[index2 + 0] = r;
|
}
|
||||||
image_data[index2 + 1] = g;
|
}
|
||||||
image_data[index2 + 2] = b;
|
delete[] image_data;
|
||||||
|
image_data = rotated;
|
||||||
|
std::swap(image_width, image_height);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// flip horizontally
|
||||||
|
log_misc("printer", "flip horizontally...");
|
||||||
|
for (int x = 0; x < image_width / 2; x++) {
|
||||||
|
for (int y = 0; y < image_height; y++) {
|
||||||
|
int index1 = (y * image_width + x) * 3;
|
||||||
|
int index2 = (y * image_width + image_width - x - 1) * 3;
|
||||||
|
uint8_t r = image_data[index1 + 0];
|
||||||
|
uint8_t g = image_data[index1 + 1];
|
||||||
|
uint8_t b = image_data[index1 + 2];
|
||||||
|
image_data[index1 + 0] = image_data[index2 + 0];
|
||||||
|
image_data[index1 + 1] = image_data[index2 + 1];
|
||||||
|
image_data[index1 + 2] = image_data[index2 + 2];
|
||||||
|
image_data[index2 + 0] = r;
|
||||||
|
image_data[index2 + 1] = g;
|
||||||
|
image_data[index2 + 2] = b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterate folders
|
// iterate folders
|
||||||
log_info("printer", "writing files...");
|
log_misc("printer", "writing files...");
|
||||||
for (const auto &path : PRINTER_PATH) {
|
for (const auto &path : PRINTER_PATH) {
|
||||||
for (const auto &format : PRINTER_FORMAT) {
|
for (const auto &format : PRINTER_FORMAT) {
|
||||||
|
|
||||||
|
|||||||
@@ -374,6 +374,27 @@ static HWND WINAPI CreateWindowExA_hook(DWORD dwExStyle, LPCSTR lpClassName, LPC
|
|||||||
if ((is_tdj_sub_window && GRAPHICS_IIDX_WSUB) || is_sdvx_sub_window) {
|
if ((is_tdj_sub_window && GRAPHICS_IIDX_WSUB) || is_sdvx_sub_window) {
|
||||||
dwStyle &= ~(WS_MAXIMIZEBOX);
|
dwStyle &= ~(WS_MAXIMIZEBOX);
|
||||||
}
|
}
|
||||||
|
if ((is_tdj_sub_window || is_sdvx_sub_window) && GRAPHICS_WSUB_BORDERLESS) {
|
||||||
|
dwStyle &= ~(WS_OVERLAPPEDWINDOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_sdvx_sub_window) {
|
||||||
|
graphics_load_windowed_subscreen_parameters();
|
||||||
|
if (GRAPHICS_WSUB_SIZE.has_value()) {
|
||||||
|
nWidth = GRAPHICS_WSUB_WIDTH;
|
||||||
|
nHeight = GRAPHICS_WSUB_HEIGHT;
|
||||||
|
} else {
|
||||||
|
GRAPHICS_WSUB_WIDTH = nWidth;
|
||||||
|
GRAPHICS_WSUB_HEIGHT = nHeight;
|
||||||
|
}
|
||||||
|
if (GRAPHICS_WSUB_POS.has_value()) {
|
||||||
|
x = GRAPHICS_WSUB_X;
|
||||||
|
y = GRAPHICS_WSUB_Y;
|
||||||
|
} else {
|
||||||
|
GRAPHICS_WSUB_X = x;
|
||||||
|
GRAPHICS_WSUB_Y = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// call original
|
// call original
|
||||||
HWND result = CreateWindowExA_orig(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight,
|
HWND result = CreateWindowExA_orig(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight,
|
||||||
@@ -529,11 +550,11 @@ static BOOL WINAPI MoveWindow_hook(HWND hWnd, int X, int Y, int nWidth, int nHei
|
|||||||
|
|
||||||
dwStyle = GetWindowLongA(hWnd, GWL_STYLE);
|
dwStyle = GetWindowLongA(hWnd, GWL_STYLE);
|
||||||
|
|
||||||
SetRect(&rect, 0, 0, GRAPHICS_IIDX_WSUB_WIDTH, GRAPHICS_IIDX_WSUB_HEIGHT);
|
SetRect(&rect, 0, 0, GRAPHICS_WSUB_WIDTH, GRAPHICS_WSUB_HEIGHT);
|
||||||
AdjustWindowRect(&rect, dwStyle, 0);
|
AdjustWindowRect(&rect, dwStyle, 0);
|
||||||
|
|
||||||
X = GRAPHICS_IIDX_WSUB_X;
|
X = GRAPHICS_WSUB_X;
|
||||||
Y = GRAPHICS_IIDX_WSUB_Y;
|
Y = GRAPHICS_WSUB_Y;
|
||||||
|
|
||||||
nWidth = rect.right - rect.left;
|
nWidth = rect.right - rect.left;
|
||||||
nHeight = rect.bottom - rect.top;
|
nHeight = rect.bottom - rect.top;
|
||||||
@@ -865,6 +886,9 @@ void graphics_hook_subscreen_window(HWND hWnd) {
|
|||||||
WSUB_WNDPROC_ORIG = reinterpret_cast<WNDPROC>(GetWindowLongPtrA(hWnd, GWLP_WNDPROC));
|
WSUB_WNDPROC_ORIG = reinterpret_cast<WNDPROC>(GetWindowLongPtrA(hWnd, GWLP_WNDPROC));
|
||||||
SetWindowLongPtrA(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(WsubWindowProc));
|
SetWindowLongPtrA(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(WsubWindowProc));
|
||||||
}
|
}
|
||||||
|
if (GRAPHICS_WSUB_ALWAYS_ON_TOP) {
|
||||||
|
graphics_update_z_order(hWnd, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void graphics_screens_register(int screen) {
|
void graphics_screens_register(int screen) {
|
||||||
|
|||||||
@@ -50,12 +50,14 @@ extern bool GRAPHICS_WINDOW_ALWAYS_ON_TOP;
|
|||||||
extern bool GRAPHICS_WINDOW_BACKBUFFER_SCALE;
|
extern bool GRAPHICS_WINDOW_BACKBUFFER_SCALE;
|
||||||
|
|
||||||
extern bool GRAPHICS_IIDX_WSUB;
|
extern bool GRAPHICS_IIDX_WSUB;
|
||||||
extern std::optional<std::string> GRAPHICS_IIDX_WSUB_SIZE;
|
extern std::optional<std::string> GRAPHICS_WSUB_SIZE;
|
||||||
extern std::optional<std::string> GRAPHICS_IIDX_WSUB_POS;
|
extern std::optional<std::string> GRAPHICS_WSUB_POS;
|
||||||
extern int GRAPHICS_IIDX_WSUB_WIDTH;
|
extern int GRAPHICS_WSUB_WIDTH;
|
||||||
extern int GRAPHICS_IIDX_WSUB_HEIGHT;
|
extern int GRAPHICS_WSUB_HEIGHT;
|
||||||
extern int GRAPHICS_IIDX_WSUB_X;
|
extern int GRAPHICS_WSUB_X;
|
||||||
extern int GRAPHICS_IIDX_WSUB_Y;
|
extern int GRAPHICS_WSUB_Y;
|
||||||
|
extern bool GRAPHICS_WSUB_BORDERLESS;
|
||||||
|
extern bool GRAPHICS_WSUB_ALWAYS_ON_TOP;
|
||||||
extern HWND TDJ_SUBSCREEN_WINDOW;
|
extern HWND TDJ_SUBSCREEN_WINDOW;
|
||||||
extern HWND SDVX_SUBSCREEN_WINDOW;
|
extern HWND SDVX_SUBSCREEN_WINDOW;
|
||||||
|
|
||||||
@@ -94,7 +96,7 @@ std::string graphics_screenshot_genpath();
|
|||||||
void graphics_windowed_wndproc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
void graphics_windowed_wndproc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
void graphics_capture_initial_window(HWND hWnd);
|
void graphics_capture_initial_window(HWND hWnd);
|
||||||
void graphics_update_window_style(HWND hWnd);
|
void graphics_update_window_style(HWND hWnd);
|
||||||
void graphics_update_z_order(HWND hWnd);
|
void graphics_update_z_order(HWND hWnd, bool always_on_top);
|
||||||
void graphics_move_resize_window(HWND hWnd);
|
void graphics_move_resize_window(HWND hWnd);
|
||||||
bool graphics_window_change_crashes_game();
|
bool graphics_window_change_crashes_game();
|
||||||
void graphics_load_windowed_subscreen_parameters();
|
void graphics_load_windowed_subscreen_parameters();
|
||||||
|
|||||||
@@ -26,12 +26,14 @@ bool GRAPHICS_WINDOW_BACKBUFFER_SCALE = false;
|
|||||||
|
|
||||||
// IIDX Windowed Subscreen - starts out as false, enabled by IIDX module on pre-attach as needed
|
// IIDX Windowed Subscreen - starts out as false, enabled by IIDX module on pre-attach as needed
|
||||||
bool GRAPHICS_IIDX_WSUB = false;
|
bool GRAPHICS_IIDX_WSUB = false;
|
||||||
std::optional<std::string> GRAPHICS_IIDX_WSUB_SIZE;
|
std::optional<std::string> GRAPHICS_WSUB_SIZE;
|
||||||
std::optional<std::string> GRAPHICS_IIDX_WSUB_POS;
|
std::optional<std::string> GRAPHICS_WSUB_POS;
|
||||||
int GRAPHICS_IIDX_WSUB_WIDTH = 1280;
|
int GRAPHICS_WSUB_WIDTH = 1280;
|
||||||
int GRAPHICS_IIDX_WSUB_HEIGHT = 720;
|
int GRAPHICS_WSUB_HEIGHT = 720;
|
||||||
int GRAPHICS_IIDX_WSUB_X = 0;
|
int GRAPHICS_WSUB_X = 0;
|
||||||
int GRAPHICS_IIDX_WSUB_Y = 0;
|
int GRAPHICS_WSUB_Y = 0;
|
||||||
|
bool GRAPHICS_WSUB_BORDERLESS = false;
|
||||||
|
bool GRAPHICS_WSUB_ALWAYS_ON_TOP = false;
|
||||||
|
|
||||||
// these flags are carefully constructed to ensure maximum compatibility
|
// these flags are carefully constructed to ensure maximum compatibility
|
||||||
// (e.g., DDR likes to hang when SetWindowPos is called with certain params)
|
// (e.g., DDR likes to hang when SetWindowPos is called with certain params)
|
||||||
@@ -108,7 +110,7 @@ void graphics_capture_initial_window(HWND hWnd) {
|
|||||||
}
|
}
|
||||||
if (cfg::SCREENRESIZE->window_always_on_top) {
|
if (cfg::SCREENRESIZE->window_always_on_top) {
|
||||||
log_info("graphics-windowed", "change window z-order - always on top");
|
log_info("graphics-windowed", "change window z-order - always on top");
|
||||||
graphics_update_z_order(hWnd);
|
graphics_update_z_order(hWnd, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure spicetouch coordinates are initialized
|
// ensure spicetouch coordinates are initialized
|
||||||
@@ -169,29 +171,29 @@ void graphics_load_windowed_subscreen_parameters() {
|
|||||||
|
|
||||||
log_debug("graphics-windowed", "graphics_load_windowed_subscreen_parameters called");
|
log_debug("graphics-windowed", "graphics_load_windowed_subscreen_parameters called");
|
||||||
|
|
||||||
if (GRAPHICS_IIDX_WSUB_SIZE.has_value()) {
|
if (GRAPHICS_WSUB_SIZE.has_value()) {
|
||||||
log_debug(
|
log_debug(
|
||||||
"graphics-windowed",
|
"graphics-windowed",
|
||||||
"graphics_load_windowed_parameters - load GRAPHICS_IIDX_WSUB_SIZE");
|
"graphics_load_windowed_parameters - load GRAPHICS_WSUB_SIZE");
|
||||||
|
|
||||||
std::pair<uint32_t, uint32_t> result;
|
std::pair<uint32_t, uint32_t> result;
|
||||||
if (parse_width_height(GRAPHICS_IIDX_WSUB_SIZE.value(), result)) {
|
if (parse_width_height(GRAPHICS_WSUB_SIZE.value(), result)) {
|
||||||
GRAPHICS_IIDX_WSUB_WIDTH = result.first;
|
GRAPHICS_WSUB_WIDTH = result.first;
|
||||||
GRAPHICS_IIDX_WSUB_HEIGHT = result.second;
|
GRAPHICS_WSUB_HEIGHT = result.second;
|
||||||
} else {
|
} else {
|
||||||
log_warning("graphics-windowed", "failed to parse -wsubsize");
|
log_warning("graphics-windowed", "failed to parse -wsubsize");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GRAPHICS_IIDX_WSUB_POS.has_value()) {
|
if (GRAPHICS_WSUB_POS.has_value()) {
|
||||||
log_debug(
|
log_debug(
|
||||||
"graphics-windowed",
|
"graphics-windowed",
|
||||||
"graphics_load_windowed_parameters - load GRAPHICS_IIDX_WSUB_POS");
|
"graphics_load_windowed_parameters - load GRAPHICS_WSUB_POS");
|
||||||
|
|
||||||
std::pair<uint32_t, uint32_t> result;
|
std::pair<uint32_t, uint32_t> result;
|
||||||
if (parse_width_height(GRAPHICS_IIDX_WSUB_POS.value(), result)) {
|
if (parse_width_height(GRAPHICS_WSUB_POS.value(), result)) {
|
||||||
GRAPHICS_IIDX_WSUB_X = result.first;
|
GRAPHICS_WSUB_X = result.first;
|
||||||
GRAPHICS_IIDX_WSUB_Y = result.second;
|
GRAPHICS_WSUB_Y = result.second;
|
||||||
} else {
|
} else {
|
||||||
log_warning("graphics-windowed", "failed to parse -wsubpos");
|
log_warning("graphics-windowed", "failed to parse -wsubpos");
|
||||||
}
|
}
|
||||||
@@ -398,7 +400,7 @@ void graphics_update_window_style(HWND hWnd) {
|
|||||||
log_debug("graphics-windowed", "graphics_update_window_style returned");
|
log_debug("graphics-windowed", "graphics_update_window_style returned");
|
||||||
}
|
}
|
||||||
|
|
||||||
void graphics_update_z_order(HWND hWnd) {
|
void graphics_update_z_order(HWND hWnd, bool always_on_top) {
|
||||||
if (!GRAPHICS_WINDOWED) {
|
if (!GRAPHICS_WINDOWED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -406,7 +408,7 @@ void graphics_update_z_order(HWND hWnd) {
|
|||||||
log_debug("graphics-windowed", "graphics_update_z_order called");
|
log_debug("graphics-windowed", "graphics_update_z_order called");
|
||||||
|
|
||||||
HWND insert_after = nullptr;
|
HWND insert_after = nullptr;
|
||||||
if (cfg::SCREENRESIZE->window_always_on_top) {
|
if (always_on_top) {
|
||||||
insert_after = HWND_TOPMOST;
|
insert_after = HWND_TOPMOST;
|
||||||
} else {
|
} else {
|
||||||
insert_after = HWND_NOTOPMOST;
|
insert_after = HWND_NOTOPMOST;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ void networkhook_init() {
|
|||||||
strncpy(s_prefix, inet_ntoa(prefix), 16);
|
strncpy(s_prefix, inet_ntoa(prefix), 16);
|
||||||
|
|
||||||
// log preferences
|
// log preferences
|
||||||
log_info("network", "Network preferences: {}", s_network, s_subnet, s_prefix);
|
// log_info("network", "Network preferences: {}, {}, {}", s_network, s_subnet, s_prefix);
|
||||||
|
|
||||||
// GetAdaptersInfo hook
|
// GetAdaptersInfo hook
|
||||||
auto orig_addr = detour::iat_try(
|
auto orig_addr = detour::iat_try(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#include <cfg/configurator.h>
|
#include <cfg/configurator.h>
|
||||||
|
|
||||||
|
#include "api/modules/capture.h"
|
||||||
#include "acio/acio.h"
|
#include "acio/acio.h"
|
||||||
#include "acio/icca/icca.h"
|
#include "acio/icca/icca.h"
|
||||||
#include "api/controller.h"
|
#include "api/controller.h"
|
||||||
@@ -149,6 +150,9 @@ static bool check_dll(const std::string &model) {
|
|||||||
|
|
||||||
void update_msvcrt_args(int argc, char *argv[]);
|
void update_msvcrt_args(int argc, char *argv[]);
|
||||||
|
|
||||||
|
void dump_button_bindings(std::vector<Button> *buttons);
|
||||||
|
void dump_analog_bindings();
|
||||||
|
|
||||||
int main_implementation(int argc, char *argv[]) {
|
int main_implementation(int argc, char *argv[]) {
|
||||||
|
|
||||||
// remember argv, argv
|
// remember argv, argv
|
||||||
@@ -243,6 +247,11 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
// parse arguments
|
// parse arguments
|
||||||
LAUNCHER_OPTIONS = launcher::parse_options(argc, argv);
|
LAUNCHER_OPTIONS = launcher::parse_options(argc, argv);
|
||||||
|
|
||||||
|
// command line override (must be done before merging options with cfg)
|
||||||
|
if (LAUNCHER_OPTIONS->at(launcher::Options::OptionConflictResolution).value_bool()) {
|
||||||
|
launcher::USE_CMD_OVERRIDE = true;
|
||||||
|
}
|
||||||
|
|
||||||
// determine config file path - must be done before anything else
|
// determine config file path - must be done before anything else
|
||||||
const auto &cfg_path = LAUNCHER_OPTIONS->at(launcher::Options::ConfigurationPath);
|
const auto &cfg_path = LAUNCHER_OPTIONS->at(launcher::Options::ConfigurationPath);
|
||||||
if (cfg_path.is_active()) {
|
if (cfg_path.is_active()) {
|
||||||
@@ -284,6 +293,7 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
cfg::CONFIGURATOR_TYPE = cfg::ConfigType::Config;
|
cfg::CONFIGURATOR_TYPE = cfg::ConfigType::Config;
|
||||||
cfg_run = true;
|
cfg_run = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::EAmusementEmulation].value_bool() &&
|
if (options[launcher::Options::EAmusementEmulation].value_bool() &&
|
||||||
options[launcher::Options::ServiceURL].is_active() &&
|
options[launcher::Options::ServiceURL].is_active() &&
|
||||||
!cfg::CONFIGURATOR_STANDALONE) {
|
!cfg::CONFIGURATOR_STANDALONE) {
|
||||||
@@ -423,9 +433,6 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::LoadSoundVoltexModule].value_bool()) {
|
if (options[launcher::Options::LoadSoundVoltexModule].value_bool()) {
|
||||||
attach_sdvx = true;
|
attach_sdvx = true;
|
||||||
}
|
}
|
||||||
if (options[launcher::Options::SDVXDisableCameras].value_bool()) {
|
|
||||||
games::sdvx::DISABLECAMS = true;
|
|
||||||
}
|
|
||||||
if (options[launcher::Options::SDVXNativeTouch].value_bool()) {
|
if (options[launcher::Options::SDVXNativeTouch].value_bool()) {
|
||||||
games::sdvx::NATIVETOUCH = true;
|
games::sdvx::NATIVETOUCH = true;
|
||||||
}
|
}
|
||||||
@@ -622,6 +629,9 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::DDR43Mode].value_bool()) {
|
if (options[launcher::Options::DDR43Mode].value_bool()) {
|
||||||
games::ddr::SDMODE = true;
|
games::ddr::SDMODE = true;
|
||||||
}
|
}
|
||||||
|
if (options[launcher::Options::DDRSkipCodecRegisteration].value_bool()) {
|
||||||
|
games::ddr::NO_CODEC_REGISTRATION = true;
|
||||||
|
}
|
||||||
if (options[launcher::Options::LoadSteelChronicleModule].value_bool()) {
|
if (options[launcher::Options::LoadSteelChronicleModule].value_bool()) {
|
||||||
attach_sc = true;
|
attach_sc = true;
|
||||||
}
|
}
|
||||||
@@ -661,21 +671,42 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::SDVXPrinterEmulation].value_bool()) {
|
if (options[launcher::Options::SDVXPrinterEmulation].value_bool()) {
|
||||||
attach_cpusbxpkm_printer = true;
|
attach_cpusbxpkm_printer = true;
|
||||||
}
|
}
|
||||||
if (options[launcher::Options::SDVXPrinterOutputOverwrite].value_bool()) {
|
|
||||||
|
// printer overwrite
|
||||||
|
if (options[launcher::Options::SDVXPrinterOutputOverwrite].value_bool() ||
|
||||||
|
options[launcher::Options::LovePlusPrinterOutputOverwrite].value_bool()) {
|
||||||
games::shared::PRINTER_OVERWRITE_FILE = true;
|
games::shared::PRINTER_OVERWRITE_FILE = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// printer output path
|
||||||
for (auto &path : options[launcher::Options::SDVXPrinterOutputPath].values_text()) {
|
for (auto &path : options[launcher::Options::SDVXPrinterOutputPath].values_text()) {
|
||||||
games::shared::PRINTER_PATH.push_back(path);
|
games::shared::PRINTER_PATH.push_back(path);
|
||||||
}
|
}
|
||||||
|
for (auto &path : options[launcher::Options::LovePlusPrinterOutputPath].values_text()) {
|
||||||
|
games::shared::PRINTER_PATH.push_back(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// printer file format
|
||||||
for (auto &path : options[launcher::Options::SDVXPrinterOutputFormat].values_text()) {
|
for (auto &path : options[launcher::Options::SDVXPrinterOutputFormat].values_text()) {
|
||||||
games::shared::PRINTER_FORMAT.push_back(path);
|
games::shared::PRINTER_FORMAT.push_back(path);
|
||||||
}
|
}
|
||||||
|
for (auto &path : options[launcher::Options::LovePlusPrinterOutputFormat].values_text()) {
|
||||||
|
games::shared::PRINTER_FORMAT.push_back(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// printer JPG quality
|
||||||
if (options[launcher::Options::SDVXPrinterJPGQuality].is_active()) {
|
if (options[launcher::Options::SDVXPrinterJPGQuality].is_active()) {
|
||||||
games::shared::PRINTER_JPG_QUALITY = options[launcher::Options::SDVXPrinterJPGQuality].value_uint32();
|
games::shared::PRINTER_JPG_QUALITY = options[launcher::Options::SDVXPrinterJPGQuality].value_uint32();
|
||||||
|
} else if (options[launcher::Options::LovePlusPrinterJPGQuality].is_active()) {
|
||||||
|
games::shared::PRINTER_JPG_QUALITY = options[launcher::Options::LovePlusPrinterJPGQuality].value_uint32();
|
||||||
}
|
}
|
||||||
if (options[launcher::Options::SDVXPrinterOutputClear].value_bool()) {
|
|
||||||
|
// printer output clear
|
||||||
|
if (options[launcher::Options::SDVXPrinterOutputClear].value_bool() ||
|
||||||
|
options[launcher::Options::LovePlusPrinterOutputClear].value_bool()) {
|
||||||
games::shared::PRINTER_CLEAR = true;
|
games::shared::PRINTER_CLEAR = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::HTTP11].is_active()) {
|
if (options[launcher::Options::HTTP11].is_active()) {
|
||||||
avs::ea3::HTTP11 = options[launcher::Options::HTTP11].value_uint32();
|
avs::ea3::HTTP11 = options[launcher::Options::HTTP11].value_uint32();
|
||||||
}
|
}
|
||||||
@@ -813,6 +844,7 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::AdapterSubnet].is_active()) {
|
if (options[launcher::Options::AdapterSubnet].is_active()) {
|
||||||
NETWORK_SUBNET = options[launcher::Options::AdapterSubnet].value_text();
|
NETWORK_SUBNET = options[launcher::Options::AdapterSubnet].value_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::APITCPPort].is_active()) {
|
if (options[launcher::Options::APITCPPort].is_active()) {
|
||||||
api_enable = true;
|
api_enable = true;
|
||||||
api_port = options[launcher::Options::APITCPPort].value_uint32();
|
api_port = options[launcher::Options::APITCPPort].value_uint32();
|
||||||
@@ -835,6 +867,13 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::APIDebugMode].value_bool()) {
|
if (options[launcher::Options::APIDebugMode].value_bool()) {
|
||||||
api_debug = true;
|
api_debug = true;
|
||||||
}
|
}
|
||||||
|
if (options[launcher::Options::APIScreenMirrorQuality].is_active()) {
|
||||||
|
api::modules::CAPTURE_QUALITY = options[launcher::Options::APIScreenMirrorQuality].value_uint32();
|
||||||
|
}
|
||||||
|
if (options[launcher::Options::APIScreenMirrorDivide].is_active()) {
|
||||||
|
api::modules::CAPTURE_DIVIDE = options[launcher::Options::APIScreenMirrorDivide].value_uint32();
|
||||||
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::DisableDebugHooks].value_bool()) {
|
if (options[launcher::Options::DisableDebugHooks].value_bool()) {
|
||||||
debughook::DEBUGHOOK_LOGGING = false;
|
debughook::DEBUGHOOK_LOGGING = false;
|
||||||
}
|
}
|
||||||
@@ -976,12 +1015,24 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
GRAPHICS_WINDOW_ALWAYS_ON_TOP = options[launcher::Options::spice2x_WindowAlwaysOnTop].value_bool();
|
GRAPHICS_WINDOW_ALWAYS_ON_TOP = options[launcher::Options::spice2x_WindowAlwaysOnTop].value_bool();
|
||||||
GRAPHICS_WINDOW_BACKBUFFER_SCALE = options[launcher::Options::WindowForceScaling].value_bool();
|
GRAPHICS_WINDOW_BACKBUFFER_SCALE = options[launcher::Options::WindowForceScaling].value_bool();
|
||||||
|
|
||||||
// IIDX Windowed Subscreen
|
// IIDX/SDVX Windowed Subscreen
|
||||||
if (options[launcher::Options::spice2x_IIDXWindowedSubscreenSize].is_active()) {
|
if (options[launcher::Options::spice2x_IIDXWindowedSubscreenSize].is_active()) {
|
||||||
GRAPHICS_IIDX_WSUB_SIZE = options[launcher::Options::spice2x_IIDXWindowedSubscreenSize].value_text();
|
GRAPHICS_WSUB_SIZE = options[launcher::Options::spice2x_IIDXWindowedSubscreenSize].value_text();
|
||||||
|
} else if (options[launcher::Options::SDVXWindowedSubscreenSize].is_active()) {
|
||||||
|
GRAPHICS_WSUB_SIZE = options[launcher::Options::SDVXWindowedSubscreenSize].value_text();
|
||||||
}
|
}
|
||||||
if (options[launcher::Options::spice2x_IIDXWindowedSubscreenPosition].is_active()) {
|
if (options[launcher::Options::spice2x_IIDXWindowedSubscreenPosition].is_active()) {
|
||||||
GRAPHICS_IIDX_WSUB_POS = options[launcher::Options::spice2x_IIDXWindowedSubscreenPosition].value_text();
|
GRAPHICS_WSUB_POS = options[launcher::Options::spice2x_IIDXWindowedSubscreenPosition].value_text();
|
||||||
|
} else if (options[launcher::Options::SDVXWindowedSubscreenPosition].is_active()) {
|
||||||
|
GRAPHICS_WSUB_POS = options[launcher::Options::SDVXWindowedSubscreenPosition].value_text();
|
||||||
|
}
|
||||||
|
if (options[launcher::Options::IIDXWindowedSubscreenBorderless].value_bool() ||
|
||||||
|
options[launcher::Options::SDVXWindowedSubscreenBorderless].value_bool()) {
|
||||||
|
GRAPHICS_WSUB_BORDERLESS = true;
|
||||||
|
}
|
||||||
|
if (options[launcher::Options::IIDXWindowedSubscreenAlwaysOnTop].value_bool() ||
|
||||||
|
options[launcher::Options::SDVXWindowedSubscreenAlwaysOnTop].value_bool()) {
|
||||||
|
GRAPHICS_WSUB_ALWAYS_ON_TOP = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::spice2x_JubeatLegacyTouch].value_bool()) {
|
if (options[launcher::Options::spice2x_JubeatLegacyTouch].value_bool()) {
|
||||||
@@ -1056,6 +1107,17 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::spice2x_EnableSMXDedicab].value_bool()) {
|
if (options[launcher::Options::spice2x_EnableSMXDedicab].value_bool()) {
|
||||||
rawinput::ENABLE_SMX_DEDICAB = true;
|
rawinput::ENABLE_SMX_DEDICAB = true;
|
||||||
}
|
}
|
||||||
|
if (options[launcher::Options::InputRequiresFocus].is_active()) {
|
||||||
|
const auto &text = options[launcher::Options::InputRequiresFocus].value_text();
|
||||||
|
if (text == "always") {
|
||||||
|
rawinput::NAIVE_REQUIRE_FOCUS = true;
|
||||||
|
rawinput::RAWINPUT_REQUIRE_FOCUS = true;
|
||||||
|
} else if (text == "never") {
|
||||||
|
rawinput::NAIVE_REQUIRE_FOCUS = false;
|
||||||
|
rawinput::RAWINPUT_REQUIRE_FOCUS = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::MidiAlgoVer].is_active()) {
|
if (options[launcher::Options::MidiAlgoVer].is_active()) {
|
||||||
if (options[launcher::Options::MidiAlgoVer].value_text() == "legacy") {
|
if (options[launcher::Options::MidiAlgoVer].value_text() == "legacy") {
|
||||||
midi_algo = rawinput::MidiNoteAlgorithm::LEGACY;
|
midi_algo = rawinput::MidiNoteAlgorithm::LEGACY;
|
||||||
@@ -1077,6 +1139,10 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
rawinput::MIDI_NOTE_SUSTAIN = options[launcher::Options::MidiNoteSustain].value_uint32();
|
rawinput::MIDI_NOTE_SUSTAIN = options[launcher::Options::MidiNoteSustain].value_uint32();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options[launcher::Options::LovePlusCamEnable].value_bool()) {
|
||||||
|
games::loveplus::CAMERA_ENABLE = true;
|
||||||
|
}
|
||||||
|
|
||||||
// API debugging
|
// API debugging
|
||||||
if (api_debug && !cfg::CONFIGURATOR_STANDALONE) {
|
if (api_debug && !cfg::CONFIGURATOR_STANDALONE) {
|
||||||
API_CONTROLLER = std::make_unique<api::Controller>(api_port, api_pass, api_pretty);
|
API_CONTROLLER = std::make_unique<api::Controller>(api_port, api_pass, api_pretty);
|
||||||
@@ -1163,6 +1229,38 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
log_info("launcher", "arguments:\n{}", arguments.str());
|
log_info("launcher", "arguments:\n{}", arguments.str());
|
||||||
|
|
||||||
|
// print out conflicts
|
||||||
|
size_t conflicts = 0;
|
||||||
|
for (const auto &option : options) {
|
||||||
|
if (option.conflicting && option.get_definition().type != OptionType::Bool) {
|
||||||
|
conflicts += 1;
|
||||||
|
if (launcher::USE_CMD_OVERRIDE) {
|
||||||
|
log_warning(
|
||||||
|
"launcher",
|
||||||
|
"multiple values for -{}, command line args take precedence: {}",
|
||||||
|
option.get_definition().name,
|
||||||
|
option.value);
|
||||||
|
} else {
|
||||||
|
log_warning(
|
||||||
|
"launcher",
|
||||||
|
"multiple values for -{}, spicecfg values take precedence: {}",
|
||||||
|
option.get_definition().name,
|
||||||
|
option.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (conflicts) {
|
||||||
|
if (launcher::USE_CMD_OVERRIDE) {
|
||||||
|
log_info(
|
||||||
|
"launcher",
|
||||||
|
"user specified -cmdoverride, therefore command line args took precedence over spicecfg");
|
||||||
|
} else {
|
||||||
|
log_warning(
|
||||||
|
"launcher",
|
||||||
|
"spicecfg values take precedence over command line args; to change this behavior, use -cmdoverride");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (options[launcher::Options::FullscreenResolution].is_active()) {
|
if (options[launcher::Options::FullscreenResolution].is_active()) {
|
||||||
std::pair<uint32_t, uint32_t> result;
|
std::pair<uint32_t, uint32_t> result;
|
||||||
if (parse_width_height(options[launcher::Options::FullscreenResolution].value_text(), result)) {
|
if (parse_width_height(options[launcher::Options::FullscreenResolution].value_text(), result)) {
|
||||||
@@ -1172,16 +1270,18 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// // SDVXFullscreenLandscape disabled due to it messing with in-game camera angle
|
// SDVXFullscreenLandscape disabled due to it messing with in-game camera angle
|
||||||
// // FullscreenOrientationFlip continues to live on, however.
|
// FullscreenOrientationFlip continues to live on, however.
|
||||||
//
|
if (options[launcher::Options::SDVXFullscreenLandscape].value_bool()) {
|
||||||
// if (options[launcher::Options::SDVXFullscreenLandscape].value_bool() && !GRAPHICS_WINDOWED) {
|
log_fatal("launcher", "-sdvxlandscape removed due to a camera bug in SDVX!");
|
||||||
|
}
|
||||||
|
// if (options[launcher::Options::SDVXFullscreenLandscape].value_bool() && !GRAPHICS_WINDOWED) {
|
||||||
// #if SPICE64
|
// #if SPICE64
|
||||||
// GRAPHICS_FS_ORIENTATION_SWAP = true;
|
// GRAPHICS_FS_ORIENTATION_SWAP = true;
|
||||||
// #else
|
// #else
|
||||||
// log_warning("launcher", "-sdvxlandscape is not supported in 32-bit SDVX, ignoring...");
|
// log_warning("launcher", "-sdvxlandscape is not supported in 32-bit SDVX, ignoring...");
|
||||||
// #endif
|
// #endif
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (options[launcher::Options::FullscreenOrientationFlip].value_bool() && !GRAPHICS_WINDOWED) {
|
if (options[launcher::Options::FullscreenOrientationFlip].value_bool() && !GRAPHICS_WINDOWED) {
|
||||||
GRAPHICS_FS_ORIENTATION_SWAP = true;
|
GRAPHICS_FS_ORIENTATION_SWAP = true;
|
||||||
@@ -1806,6 +1906,20 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
exit(spicecfg_run(sextet_devices));
|
exit(spicecfg_run(sextet_devices));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// log some DLLs found in path (purely for troubleshooting purposes to detect
|
||||||
|
// dxvk, ForceD3D9On12, ifs_layeredfs, etc)
|
||||||
|
libutils::warn_if_dll_exists("d3d8.dll");
|
||||||
|
libutils::warn_if_dll_exists("d3d9.dll");
|
||||||
|
libutils::warn_if_dll_exists("d3d10core.dll");
|
||||||
|
libutils::warn_if_dll_exists("d3d11.dll");
|
||||||
|
libutils::warn_if_dll_exists("d3d12.dll");
|
||||||
|
libutils::warn_if_dll_exists("dxgi.dll");
|
||||||
|
libutils::warn_if_dll_exists("opengl32.dll");
|
||||||
|
libutils::warn_if_dll_exists("nvcuda.dll");
|
||||||
|
libutils::warn_if_dll_exists("nvcuvid.dll");
|
||||||
|
libutils::warn_if_dll_exists("nvEncodeAPI64.dll");
|
||||||
|
libutils::warn_if_dll_exists("msvcr100.dll");
|
||||||
|
|
||||||
// complain loudly & early about dll load ordering issue
|
// complain loudly & early about dll load ordering issue
|
||||||
libutils::check_duplicate_dlls();
|
libutils::check_duplicate_dlls();
|
||||||
|
|
||||||
@@ -1826,6 +1940,21 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
// print devices
|
// print devices
|
||||||
RI_MGR->devices_print();
|
RI_MGR->devices_print();
|
||||||
|
|
||||||
|
auto buttons = games::get_buttons(eamuse_get_game());
|
||||||
|
log_misc("rawinput", "Button mappings:");
|
||||||
|
dump_button_bindings(buttons);
|
||||||
|
|
||||||
|
log_misc("rawinput", "Keypad button mappings:");
|
||||||
|
auto keypads = games::get_buttons_keypads(eamuse_get_game());
|
||||||
|
dump_button_bindings(keypads);
|
||||||
|
|
||||||
|
log_misc("rawinput", "Overlay button mappings:");
|
||||||
|
auto overlay_buttons = games::get_buttons_overlay(eamuse_get_game());
|
||||||
|
dump_button_bindings(overlay_buttons);
|
||||||
|
|
||||||
|
log_misc("rawinput", "Analog mappings:");
|
||||||
|
dump_analog_bindings();
|
||||||
|
|
||||||
// for certain games, show cursor if no touch is available (must be called after RI_MGR is available)
|
// for certain games, show cursor if no touch is available (must be called after RI_MGR is available)
|
||||||
if (show_cursor_if_no_touch && !is_touch_available("launcher::main_implementation")) {
|
if (show_cursor_if_no_touch && !is_touch_available("launcher::main_implementation")) {
|
||||||
GRAPHICS_SHOW_CURSOR = true;
|
GRAPHICS_SHOW_CURSOR = true;
|
||||||
@@ -1967,15 +2096,6 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
networkhook_init();
|
networkhook_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
// layeredfs
|
|
||||||
if (fileutils::dir_exists("data_mods") &&
|
|
||||||
!fileutils::file_exists("ifs_hook.dll") &&
|
|
||||||
!fileutils::file_exists(MODULE_PATH / "ifs_hook.dll")) {
|
|
||||||
log_warning("launcher", "data_mods directory was found, but ifs_hook.dll is not present; your mods will not load");
|
|
||||||
log_warning("launcher", "to fix this, download ifs_layeredfs and add it as a DLL hook (-k)");
|
|
||||||
log_warning("launcher", "https://github.com/mon/ifs_layeredfs");
|
|
||||||
}
|
|
||||||
|
|
||||||
update_msvcrt_args(argc, argv);
|
update_msvcrt_args(argc, argv);
|
||||||
|
|
||||||
// load hooks
|
// load hooks
|
||||||
@@ -1989,6 +2109,14 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// layeredfs
|
||||||
|
if (fileutils::dir_exists("data_mods") &&
|
||||||
|
GetModuleHandleA("ifs_hook.dll") == nullptr) {
|
||||||
|
log_warning("launcher", "data_mods directory was found, but ifs_hook.dll is not present; your mods will not load");
|
||||||
|
log_warning("launcher", "to fix this, download ifs_layeredfs and add it as a DLL hook (-k)");
|
||||||
|
log_warning("launcher", "https://github.com/mon/ifs_layeredfs");
|
||||||
|
}
|
||||||
|
|
||||||
// apply patches
|
// apply patches
|
||||||
{
|
{
|
||||||
overlay::windows::PatchManager patch_manager(nullptr, true);
|
overlay::windows::PatchManager patch_manager(nullptr, true);
|
||||||
@@ -2211,6 +2339,65 @@ void update_msvcrt_args(int argc, char *argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dump_button_bindings(std::vector<Button> *buttons) {
|
||||||
|
if (!buttons) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto button = buttons->begin(); button != buttons->end(); ++button) {
|
||||||
|
if (!button->isSet()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (button->isNaive()) {
|
||||||
|
log_misc(
|
||||||
|
"rawinput", " [{}] dev=Naive, vkey={}",
|
||||||
|
button->getName(),
|
||||||
|
button->getVKey()
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
log_misc(
|
||||||
|
"rawinput", " [{}] dev={}, vkey={}, analogtype={}",
|
||||||
|
button->getName(),
|
||||||
|
button->getDeviceIdentifier(),
|
||||||
|
button->getVKey(),
|
||||||
|
button->getAnalogType()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& alt : button->getAlternatives()) {
|
||||||
|
if (alt.getVKey() == INVALID_VKEY) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
log_misc(
|
||||||
|
"rawinput", " [{}] (alt) dev={}, vkey={}, analogtype={}",
|
||||||
|
button->getName(),
|
||||||
|
alt.isNaive() ? "Naive" : alt.getDeviceIdentifier(),
|
||||||
|
alt.getVKey(),
|
||||||
|
alt.getAnalogType()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dump_analog_bindings() {
|
||||||
|
auto analogs = games::get_analogs(eamuse_get_game());
|
||||||
|
if (!analogs) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (auto& analog : *analogs) {
|
||||||
|
if (!analog.isSet()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
log_misc(
|
||||||
|
"rawinput", " [{}] dev={}, index={}",
|
||||||
|
analog.getName(),
|
||||||
|
analog.getDeviceIdentifier(),
|
||||||
|
analog.getIndex()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef SPICETOOLS_SPICECFG_STANDALONE
|
#ifndef SPICETOOLS_SPICECFG_STANDALONE
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
return main_implementation(argc, argv);
|
return main_implementation(argc, argv);
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ static const std::vector<std::string> CATEGORY_ORDER_NONE = {
|
|||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool launcher::USE_CMD_OVERRIDE = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Option Definitions
|
* Option Definitions
|
||||||
* Be aware that the order must be the same as in the enum launcher::Options!
|
* Be aware that the order must be the same as in the enum launcher::Options!
|
||||||
@@ -81,6 +83,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Network",
|
.category = "Network",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// ServiceURL
|
||||||
.title = "EA Service URL",
|
.title = "EA Service URL",
|
||||||
.name = "url",
|
.name = "url",
|
||||||
.desc = "Sets a custom service URL override",
|
.desc = "Sets a custom service URL override",
|
||||||
@@ -142,6 +145,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Graphics (Windowed)",
|
.category = "Graphics (Windowed)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// InjectHook
|
||||||
.title = "Inject DLL Hooks",
|
.title = "Inject DLL Hooks",
|
||||||
.name = "k",
|
.name = "k",
|
||||||
.desc = "Multiple files are allowed; use multiple -k flags, or in SpiceCfg, separate by "
|
.desc = "Multiple files are allowed; use multiple -k flags, or in SpiceCfg, separate by "
|
||||||
@@ -152,6 +156,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Common",
|
.category = "Common",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// EarlyInjectHook
|
||||||
.title = "Inject Early DLL Hooks",
|
.title = "Inject Early DLL Hooks",
|
||||||
.name = "z",
|
.name = "z",
|
||||||
.desc = "Equivalent to 'Inject DLL Hooks' option, but ensures hooks are injected before "
|
.desc = "Equivalent to 'Inject DLL Hooks' option, but ensures hooks are injected before "
|
||||||
@@ -306,6 +311,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
"Force the use of an adapter with the specified network. Must also provide -subnet",
|
"Force the use of an adapter with the specified network. Must also provide -subnet",
|
||||||
.type = OptionType::Text,
|
.type = OptionType::Text,
|
||||||
.category = "Network Adapters",
|
.category = "Network Adapters",
|
||||||
|
.sensitive = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "Preferred NetAdapter Subnet",
|
.title = "Preferred NetAdapter Subnet",
|
||||||
@@ -667,6 +673,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Game Options (Advanced)",
|
.category = "Game Options (Advanced)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// SDVXPrinterOutputPath
|
||||||
.title = "SDVX Printer Output Path",
|
.title = "SDVX Printer Output Path",
|
||||||
.name = "printerpath",
|
.name = "printerpath",
|
||||||
.desc = "Path to folder where images will be stored",
|
.desc = "Path to folder where images will be stored",
|
||||||
@@ -691,9 +698,10 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Game Options (Advanced)",
|
.category = "Game Options (Advanced)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// SDVXPrinterOutputFormat
|
||||||
.title = "SDVX Printer Output Format",
|
.title = "SDVX Printer Output Format",
|
||||||
.name = "printerformat",
|
.name = "printerformat",
|
||||||
.desc = "Path to folder where images will be stored",
|
.desc = "File format for printer output",
|
||||||
.type = OptionType::Text,
|
.type = OptionType::Text,
|
||||||
.setting_name = "(png/bmp/tga/jpg)",
|
.setting_name = "(png/bmp/tga/jpg)",
|
||||||
.game_name = "Sound Voltex",
|
.game_name = "Sound Voltex",
|
||||||
@@ -709,10 +717,13 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Game Options (Advanced)",
|
.category = "Game Options (Advanced)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "SDVX Disable Cameras",
|
.title = "SDVX Disable Cameras (DEPRECATED - no longer needed)",
|
||||||
.name = "sdvxdisablecams",
|
.name = "sdvxdisablecams",
|
||||||
.desc = "Disables cameras",
|
.desc = "This option does nothing.\n\n"
|
||||||
|
"This option was used in the past to fix cameras in SDVX5 but this is no longer "
|
||||||
|
"needed as camera check will always be skipped with a built-in patch.",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
|
.hidden = true,
|
||||||
.game_name = "Sound Voltex",
|
.game_name = "Sound Voltex",
|
||||||
.category = "Game Options",
|
.category = "Game Options",
|
||||||
},
|
},
|
||||||
@@ -798,6 +809,15 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.game_name = "Dance Dance Revolution",
|
.game_name = "Dance Dance Revolution",
|
||||||
.category = "Game Options",
|
.category = "Game Options",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// DDRSkipCodecRegisteration
|
||||||
|
.title = "DDR Skip Codec Registration",
|
||||||
|
.name = "ddrnocodec",
|
||||||
|
.desc = "Prevent automatic registration of codecs in the com folder",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "Dance Dance Revolution",
|
||||||
|
.category = "Game Options (Advanced)",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.title = "Force Load Pop'n Music Module",
|
.title = "Force Load Pop'n Music Module",
|
||||||
.name = "pnm",
|
.name = "pnm",
|
||||||
@@ -1193,6 +1213,28 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
.category = "API (Dev)",
|
.category = "API (Dev)",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// APIScreenMirrorQuality
|
||||||
|
.title = "API Screen Mirror Quality Override",
|
||||||
|
.name = "apiscreenq",
|
||||||
|
.desc = "JPEG compression level of mirrored images, overriding any client request. "
|
||||||
|
"Value must be between 0 (poor quality) and 100 (best quality), inclusive. Default: 70",
|
||||||
|
.type = OptionType::Integer,
|
||||||
|
.setting_name = "(0-100)",
|
||||||
|
.category = "SpiceCompanion and API",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// APIScreenMirrorDivide
|
||||||
|
.title = "API Screen Mirror Divide Override",
|
||||||
|
.name = "apiscreendiv",
|
||||||
|
.desc = "Divide value of mirrored images, overriding any client request. "
|
||||||
|
"Divide of 1 means send every pixel, 2 means every other pixel, 3 means every third pixel, and so on; "
|
||||||
|
"increasing the value drastically reduces transfer size at the cost of image quality. "
|
||||||
|
"Value must be 1 or greater. Default: 1",
|
||||||
|
.type = OptionType::Integer,
|
||||||
|
.setting_name = "1",
|
||||||
|
.category = "SpiceCompanion and API",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.title = "Enable All IO Modules",
|
.title = "Enable All IO Modules",
|
||||||
.name = "io",
|
.name = "io",
|
||||||
@@ -1288,6 +1330,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Touch Parameters",
|
.category = "Touch Parameters",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// ICCAReaderPort
|
||||||
.title = "ICCA Reader Port",
|
.title = "ICCA Reader Port",
|
||||||
.name = "reader",
|
.name = "reader",
|
||||||
.desc = "Connects to and uses a ICCA on a given COM port",
|
.desc = "Connects to and uses a ICCA on a given COM port",
|
||||||
@@ -1364,6 +1407,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// SextetStreamPort
|
||||||
.title = "SextetStream Port",
|
.title = "SextetStream Port",
|
||||||
.name = "sextet",
|
.name = "sextet",
|
||||||
.desc = "Use a SextetStream device on a given COM port",
|
.desc = "Use a SextetStream device on a given COM port",
|
||||||
@@ -1559,9 +1603,9 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.elements = {{"0", "90 (CW)"}, {"1", "270 (CCW)"}},
|
.elements = {{"0", "90 (CW)"}, {"1", "270 (CCW)"}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "Log Level",
|
.title = "AVS Log Level",
|
||||||
.name = "loglevel",
|
.name = "loglevel",
|
||||||
.desc = "Set the level of detail that gets written to the log",
|
.desc = "Set the level of detail for AVS log messages written to the log. Does not affect logging from spice",
|
||||||
.type = OptionType::Enum,
|
.type = OptionType::Enum,
|
||||||
.category = "Performance",
|
.category = "Performance",
|
||||||
.elements = {{"fatal", ""}, {"warning", ""}, {"info", ""}, {"misc", ""}, {"all", ""}, {"disable", ""}},
|
.elements = {{"fatal", ""}, {"warning", ""}, {"info", ""}, {"misc", ""}, {"all", ""}, {"disable", ""}},
|
||||||
@@ -1842,6 +1886,24 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.game_name = "Beatmania IIDX",
|
.game_name = "Beatmania IIDX",
|
||||||
.category = "Graphics (Windowed)",
|
.category = "Graphics (Windowed)",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// IIDXWindowedSubscreenBorderless
|
||||||
|
.title = "IIDX Windowed Subscreen Borderless",
|
||||||
|
.name = "iidxwsubborderless",
|
||||||
|
.desc = "Remove window decoration from windowed subscreen",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "Beatmania IIDX",
|
||||||
|
.category = "Graphics (Windowed)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// IIDXWindowedSubscreenAlwaysOnTop
|
||||||
|
.title = "IIDX Windowed Subscreen Always On Top",
|
||||||
|
.name = "iidxwsubtop",
|
||||||
|
.desc = "Keep windowed subscreen on top",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "Beatmania IIDX",
|
||||||
|
.category = "Graphics (Windowed)",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// spice2x_JubeatLegacyTouch
|
// spice2x_JubeatLegacyTouch
|
||||||
.title = "JB Legacy Touch Targets",
|
.title = "JB Legacy Touch Targets",
|
||||||
@@ -2129,6 +2191,23 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.setting_name = "20",
|
.setting_name = "20",
|
||||||
.category = "I/O Options",
|
.category = "I/O Options",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// InputRequiresFocus
|
||||||
|
.title = "Input Requires Focus",
|
||||||
|
.name = "inputfocus",
|
||||||
|
.desc =
|
||||||
|
"Determine input behavior when game window is not in focus.\n\n"
|
||||||
|
"never: allow input regardless of focus\n"
|
||||||
|
"naive (default): only naive bindings check for window focus, rawinput binds are always allowed\n"
|
||||||
|
"always: only process input when window is in focus",
|
||||||
|
.type = OptionType::Enum,
|
||||||
|
.category = "I/O Options",
|
||||||
|
.elements = {
|
||||||
|
{"never", ""},
|
||||||
|
{"naive", ""},
|
||||||
|
{"always", ""},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// NostalgiaPoke
|
// NostalgiaPoke
|
||||||
.title = "Nost Screen Poke",
|
.title = "Nost Screen Poke",
|
||||||
@@ -2153,7 +2232,108 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
{"2", "double buffer"},
|
{"2", "double buffer"},
|
||||||
{"3", "triple buffer"},
|
{"3", "triple buffer"},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
// SDVXWindowedSubscreenSize
|
||||||
|
.title = "SDVX Windowed Subscreen Size",
|
||||||
|
.name = "sdvxwsubsize",
|
||||||
|
.desc = "Size of the subscreen window. Defaults to (1920,1080)",
|
||||||
|
.type = OptionType::Text,
|
||||||
|
.setting_name = "1920,1080",
|
||||||
|
.game_name = "Sound Voltex",
|
||||||
|
.category = "Graphics (Windowed)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// SDVXWindowedSubscreenPosition
|
||||||
|
.title = "SDVX Windowed Subscreen Position",
|
||||||
|
.name = "sdvxwsubpos",
|
||||||
|
.desc = "Initial position of the subscreen window. Defaults to (0,0)",
|
||||||
|
.type = OptionType::Text,
|
||||||
|
.setting_name = "0,0",
|
||||||
|
.game_name = "Sound Voltex",
|
||||||
|
.category = "Graphics (Windowed)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// SDVXWindowedSubscreenBorderless
|
||||||
|
.title = "SDVX Windowed Subscreen Borderless",
|
||||||
|
.name = "sdvxwsubborderless",
|
||||||
|
.desc = "Remove window decoration from windowed subscreen",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "Sound Voltex",
|
||||||
|
.category = "Graphics (Windowed)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// SDVXWindowedSubscreenAlwaysOnTop
|
||||||
|
.title = "SDVX Windowed Subscreen Always On Top",
|
||||||
|
.name = "sdvxwsubtop",
|
||||||
|
.desc = "Keep windowed subscreen on top",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "Sound Voltex",
|
||||||
|
.category = "Graphics (Windowed)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// LovePlusCamEnable
|
||||||
|
.title = "LovePlus Camera Enable",
|
||||||
|
.name = "lovepluscam",
|
||||||
|
.desc = "Allow game to access camera; camera must be compatible with game",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "LovePlus",
|
||||||
|
.category = "Game Options",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// LovePlusPrinterOutputPath
|
||||||
|
.title = "LovePlus Printer Output Path",
|
||||||
|
.name = "lpprinterpath",
|
||||||
|
.desc = "Path to folder where images will be stored",
|
||||||
|
.type = OptionType::Text,
|
||||||
|
.game_name = "LovePlus",
|
||||||
|
.category = "Game Options (Advanced)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.title = "LovePlus Printer Output Clear",
|
||||||
|
.name = "lpprinterclear",
|
||||||
|
.desc = "Clean up saved images in the output directory on startup",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "LovePlus",
|
||||||
|
.category = "Game Options (Advanced)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.title = "LovePlus Printer Output Overwrite",
|
||||||
|
.name = "lpprinteroverwrite",
|
||||||
|
.desc = "Always overwrite the same file in output directory",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "LovePlus",
|
||||||
|
.category = "Game Options (Advanced)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// LovePlusPrinterOutputFormat
|
||||||
|
.title = "LovePlus Printer Output Format",
|
||||||
|
.name = "lpprinterformat",
|
||||||
|
.desc = "File format for printer output",
|
||||||
|
.type = OptionType::Text,
|
||||||
|
.setting_name = "(png/bmp/tga/jpg)",
|
||||||
|
.game_name = "LovePlus",
|
||||||
|
.category = "Game Options (Advanced)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.title = "LovePlus Printer JPG Quality",
|
||||||
|
.name = "lpprinterjpgquality",
|
||||||
|
.desc = "Quality setting in percent if JPG format is used",
|
||||||
|
.type = OptionType::Integer,
|
||||||
|
.setting_name = "(0-100)",
|
||||||
|
.game_name = "LovePlus",
|
||||||
|
.category = "Game Options (Advanced)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// OptionConflictResolution
|
||||||
|
.title = "Command Line Args Override",
|
||||||
|
.name = "cmdoverride",
|
||||||
|
.desc = "By default, option values in spicecfg take precedence over command-line args, for legacy compat.\n"
|
||||||
|
"When this is specified in command line, command-line args take precedence instead",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.category = "Development",
|
||||||
|
.disabled = true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::vector<std::string> &launcher::get_categories(Options::OptionsCategory category) {
|
const std::vector<std::string> &launcher::get_categories(Options::OptionsCategory category) {
|
||||||
@@ -2335,12 +2515,25 @@ std::vector<Option> launcher::merge_options(
|
|||||||
auto &new_option = merged.emplace_back(option.get_definition(), "");
|
auto &new_option = merged.emplace_back(option.get_definition(), "");
|
||||||
new_option.disabled = true;
|
new_option.disabled = true;
|
||||||
|
|
||||||
for (auto &value : option.values()) {
|
if (USE_CMD_OVERRIDE) {
|
||||||
new_option.value_add(value);
|
// command-line arguments take precedence (opt-in)
|
||||||
}
|
for (auto &value : override.values()) {
|
||||||
for (auto &value : override.values()) {
|
new_option.value_add(value);
|
||||||
new_option.value_add(value);
|
}
|
||||||
|
for (auto &value : option.values()) {
|
||||||
|
new_option.value_add(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// spicecfg options take precedence (default)
|
||||||
|
// this sucks, but it's the default for legacy spicetools compat
|
||||||
|
for (auto &value : option.values()) {
|
||||||
|
new_option.value_add(value);
|
||||||
|
}
|
||||||
|
for (auto &value : override.values()) {
|
||||||
|
new_option.value_add(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
new_option.conflicting = true;
|
||||||
} else {
|
} else {
|
||||||
auto &new_option = merged.emplace_back(override.get_definition(), "");
|
auto &new_option = merged.emplace_back(override.get_definition(), "");
|
||||||
new_option.disabled = true;
|
new_option.disabled = true;
|
||||||
@@ -2356,7 +2549,6 @@ std::vector<Option> launcher::merge_options(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return merged;
|
return merged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ namespace launcher {
|
|||||||
spice2x_SDVXSubRedraw,
|
spice2x_SDVXSubRedraw,
|
||||||
LoadDDRModule,
|
LoadDDRModule,
|
||||||
DDR43Mode,
|
DDR43Mode,
|
||||||
|
DDRSkipCodecRegisteration,
|
||||||
LoadPopnMusicModule,
|
LoadPopnMusicModule,
|
||||||
PopnMusicForceHDMode,
|
PopnMusicForceHDMode,
|
||||||
PopnMusicForceSDMode,
|
PopnMusicForceSDMode,
|
||||||
@@ -136,6 +137,8 @@ namespace launcher {
|
|||||||
APISerialBaud,
|
APISerialBaud,
|
||||||
APIPretty,
|
APIPretty,
|
||||||
APIDebugMode,
|
APIDebugMode,
|
||||||
|
APIScreenMirrorQuality,
|
||||||
|
APIScreenMirrorDivide,
|
||||||
EnableAllIOModules,
|
EnableAllIOModules,
|
||||||
EnableACIOModule,
|
EnableACIOModule,
|
||||||
EnableICCAModule,
|
EnableICCAModule,
|
||||||
@@ -207,6 +210,8 @@ namespace launcher {
|
|||||||
WindowForceScaling,
|
WindowForceScaling,
|
||||||
spice2x_IIDXWindowedSubscreenSize,
|
spice2x_IIDXWindowedSubscreenSize,
|
||||||
spice2x_IIDXWindowedSubscreenPosition,
|
spice2x_IIDXWindowedSubscreenPosition,
|
||||||
|
IIDXWindowedSubscreenBorderless,
|
||||||
|
IIDXWindowedSubscreenAlwaysOnTop,
|
||||||
spice2x_JubeatLegacyTouch,
|
spice2x_JubeatLegacyTouch,
|
||||||
spice2x_RBTouchScale,
|
spice2x_RBTouchScale,
|
||||||
spice2x_AsioForceUnload,
|
spice2x_AsioForceUnload,
|
||||||
@@ -229,8 +234,20 @@ namespace launcher {
|
|||||||
IIDXRecQuality,
|
IIDXRecQuality,
|
||||||
MidiAlgoVer,
|
MidiAlgoVer,
|
||||||
MidiNoteSustain,
|
MidiNoteSustain,
|
||||||
|
InputRequiresFocus,
|
||||||
NostalgiaPoke,
|
NostalgiaPoke,
|
||||||
ForceBackBufferCount,
|
ForceBackBufferCount,
|
||||||
|
SDVXWindowedSubscreenSize,
|
||||||
|
SDVXWindowedSubscreenPosition,
|
||||||
|
SDVXWindowedSubscreenBorderless,
|
||||||
|
SDVXWindowedSubscreenAlwaysOnTop,
|
||||||
|
LovePlusCamEnable,
|
||||||
|
LovePlusPrinterOutputPath,
|
||||||
|
LovePlusPrinterOutputClear,
|
||||||
|
LovePlusPrinterOutputOverwrite,
|
||||||
|
LovePlusPrinterOutputFormat,
|
||||||
|
LovePlusPrinterJPGQuality,
|
||||||
|
OptionConflictResolution,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class OptionsCategory {
|
enum class OptionsCategory {
|
||||||
@@ -242,6 +259,8 @@ namespace launcher {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern bool USE_CMD_OVERRIDE;
|
||||||
|
|
||||||
const std::vector<std::string> &get_categories(Options::OptionsCategory category);
|
const std::vector<std::string> &get_categories(Options::OptionsCategory category);
|
||||||
const std::vector<OptionDefinition> &get_option_definitions();
|
const std::vector<OptionDefinition> &get_option_definitions();
|
||||||
std::unique_ptr<std::vector<Option>> parse_options(int argc, char *argv[]);
|
std::unique_ptr<std::vector<Option>> parse_options(int argc, char *argv[]);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
|
|
||||||
|
#include "acio/acio.h"
|
||||||
#include "external/stackwalker/stackwalker.h"
|
#include "external/stackwalker/stackwalker.h"
|
||||||
#include "hooks/libraryhook.h"
|
#include "hooks/libraryhook.h"
|
||||||
#include "launcher/shutdown.h"
|
#include "launcher/shutdown.h"
|
||||||
@@ -97,6 +98,19 @@ static LONG WINAPI TopLevelExceptionFilter(struct _EXCEPTION_POINTERS *Exception
|
|||||||
// print signal
|
// print signal
|
||||||
log_warning("signal", "exception raised: {}", exception_code(ExceptionRecord));
|
log_warning("signal", "exception raised: {}", exception_code(ExceptionRecord));
|
||||||
|
|
||||||
|
// check ACIO init failures
|
||||||
|
if (acio::IO_INIT_IN_PROGRESS) {
|
||||||
|
log_warning(
|
||||||
|
"signal",
|
||||||
|
"exception raised during ACIO init, this usually happens when a third party application interferes with hooks");
|
||||||
|
log_warning(
|
||||||
|
"signal",
|
||||||
|
" please check for the following, disable them, and try launching the game again:");
|
||||||
|
log_warning(
|
||||||
|
"signal",
|
||||||
|
" RivaTuner Statistics Server (RTSS), MSI Afterburner, kernel mode anti-cheat");
|
||||||
|
}
|
||||||
|
|
||||||
// walk the exception chain
|
// walk the exception chain
|
||||||
struct _EXCEPTION_RECORD *record_cause = ExceptionRecord->ExceptionRecord;
|
struct _EXCEPTION_RECORD *record_cause = ExceptionRecord->ExceptionRecord;
|
||||||
while (record_cause != nullptr) {
|
while (record_cause != nullptr) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "touch/touch.h"
|
#include "touch/touch.h"
|
||||||
#include "util/logging.h"
|
#include "util/logging.h"
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
|
#include "hooks/graphics/graphics.h"
|
||||||
|
|
||||||
#if !defined(IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS) || \
|
#if !defined(IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS) || \
|
||||||
!defined(IMGUI_DISABLE_DEFAULT_ALLOCATORS) || \
|
!defined(IMGUI_DISABLE_DEFAULT_ALLOCATORS) || \
|
||||||
@@ -175,10 +176,22 @@ static void ImGui_ImplSpice_UpdateMousePos() {
|
|||||||
static_cast<int>(pos.y / io.DisplaySize.y * window_size.y));
|
static_cast<int>(pos.y / io.DisplaySize.y * window_size.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto active_window = ::GetForegroundWindow();
|
||||||
|
|
||||||
|
// if the main focus is a windowed subscreen, put the imgui cursor in a place that won't
|
||||||
|
// trigger any overlay, don't process anything else
|
||||||
|
const auto is_windowed_subscreen =
|
||||||
|
(GRAPHICS_IIDX_WSUB && active_window == TDJ_SUBSCREEN_WINDOW) ||
|
||||||
|
(active_window == SDVX_SUBSCREEN_WINDOW);
|
||||||
|
if (is_windowed_subscreen) {
|
||||||
|
io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// set mouse position
|
// set mouse position
|
||||||
io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
||||||
POINT pos;
|
POINT pos;
|
||||||
if (HWND active_window = ::GetForegroundWindow()) {
|
if (active_window) {
|
||||||
if (active_window == g_hWnd
|
if (active_window == g_hWnd
|
||||||
|| ::IsChild(active_window, g_hWnd)
|
|| ::IsChild(active_window, g_hWnd)
|
||||||
|| ::IsChild(g_hWnd, active_window)
|
|| ::IsChild(g_hWnd, active_window)
|
||||||
@@ -208,7 +221,7 @@ static void ImGui_ImplSpice_UpdateMousePos() {
|
|||||||
static size_t delay_touch = 0;
|
static size_t delay_touch = 0;
|
||||||
static size_t delay_touch_target = 2;
|
static size_t delay_touch_target = 2;
|
||||||
static DWORD last_touch_id = ~0u;
|
static DWORD last_touch_id = ~0u;
|
||||||
if (!touch_points.empty()) {
|
if (!touch_points.empty() && !is_windowed_subscreen) {
|
||||||
|
|
||||||
// use the first touch point
|
// use the first touch point
|
||||||
auto &tp = touch_points[0];
|
auto &tp = touch_points[0];
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#include "avs/ea3.h"
|
#include "avs/ea3.h"
|
||||||
#include "avs/game.h"
|
#include "avs/game.h"
|
||||||
#include "launcher/launcher.h"
|
#include "launcher/launcher.h"
|
||||||
#include "launcher/shutdown.h"
|
|
||||||
#include "launcher/options.h"
|
#include "launcher/options.h"
|
||||||
#include "misc/eamuse.h"
|
#include "misc/eamuse.h"
|
||||||
#include "overlay/imgui/extensions.h"
|
#include "overlay/imgui/extensions.h"
|
||||||
@@ -2914,7 +2913,7 @@ namespace overlay::windows {
|
|||||||
ImGui::TextUnformatted("");
|
ImGui::TextUnformatted("");
|
||||||
|
|
||||||
if (ImGui::Button(PROJECT_URL)) {
|
if (ImGui::Button(PROJECT_URL)) {
|
||||||
launch_shell(PROJECT_URL, nullptr);
|
launch_shell(PROJECT_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::TextUnformatted("");
|
ImGui::TextUnformatted("");
|
||||||
@@ -2979,31 +2978,28 @@ namespace overlay::windows {
|
|||||||
void Config::build_menu(int *game_selected) {
|
void Config::build_menu(int *game_selected) {
|
||||||
bool about_popup = false;
|
bool about_popup = false;
|
||||||
bool licenses_popup = false;
|
bool licenses_popup = false;
|
||||||
bool shutdown_popup = false;
|
|
||||||
if (ImGui::BeginMenuBar()) {
|
if (ImGui::BeginMenuBar()) {
|
||||||
|
|
||||||
// [spice2x]
|
// [spice2x]
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 0.f, 0.f, 1.f));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 0.f, 0.f, 1.f));
|
||||||
ImGui::PushStyleColor(ImGuiCol_TextDisabled, ImVec4(1.f, 0.f, 0.f, 1.f));
|
if (ImGui::BeginMenu("[spice2x]")) {
|
||||||
ImGui::BeginDisabled(!cfg::CONFIGURATOR_STANDALONE);
|
ImGui::PopStyleColor();
|
||||||
if (ImGui::MenuItem("[spice2x]")) {
|
if (ImGui::MenuItem("spice2x.github.io")) {
|
||||||
launch_shell(PROJECT_URL, nullptr);
|
launch_shell(PROJECT_URL);
|
||||||
|
}
|
||||||
|
if (ImGui::MenuItem("Licenses")) {
|
||||||
|
licenses_popup = true;
|
||||||
|
}
|
||||||
|
if (ImGui::MenuItem("About")) {
|
||||||
|
about_popup = true;
|
||||||
|
}
|
||||||
|
ImGui::EndMenu();
|
||||||
|
} else {
|
||||||
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
|
||||||
ImGui::PopStyleColor();
|
|
||||||
ImGui::PopStyleColor();
|
|
||||||
|
|
||||||
ImGui::Separator();
|
|
||||||
|
|
||||||
// game selector
|
|
||||||
ImGui::PushItemWidth(MIN(580, MAX(80, ImGui::GetWindowSize().x - 520)));
|
|
||||||
ImGui::Combo("##game_selector", game_selected, games_names.data(), (int)games_list.size());
|
|
||||||
ImGui::PopItemWidth();
|
|
||||||
|
|
||||||
ImGui::Separator();
|
|
||||||
|
|
||||||
// shortcuts
|
// shortcuts
|
||||||
if (ImGui::BeginMenu("Shortcuts", cfg::CONFIGURATOR_STANDALONE)) {
|
if (ImGui::BeginMenu("Shortcuts")) {
|
||||||
if (ImGui::MenuItem("USB Game Controllers")) {
|
if (ImGui::MenuItem("USB Game Controllers")) {
|
||||||
launch_shell("control.exe", "joy.cpl");
|
launch_shell("control.exe", "joy.cpl");
|
||||||
}
|
}
|
||||||
@@ -3016,32 +3012,21 @@ namespace overlay::windows {
|
|||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
// popup menus
|
// help
|
||||||
if (ImGui::MenuItem("Licenses")) {
|
if (ImGui::BeginMenu("Help")) {
|
||||||
licenses_popup = true;
|
if (ImGui::MenuItem("FAQ")) {
|
||||||
}
|
launch_shell("https://github.com/spice2x/spice2x.github.io/wiki/Known-issues");
|
||||||
if (ImGui::MenuItem("About")) {
|
|
||||||
about_popup = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// power - only active in games
|
|
||||||
if (ImGui::BeginMenu("Power", !cfg::CONFIGURATOR_STANDALONE)) {
|
|
||||||
if (ImGui::MenuItem("Restart Game")) {
|
|
||||||
launcher::restart();
|
|
||||||
}
|
}
|
||||||
if (ImGui::MenuItem("Exit Game")) {
|
if (ImGui::MenuItem("Wiki")) {
|
||||||
launcher::shutdown();
|
launch_shell("https://github.com/spice2x/spice2x.github.io/wiki");
|
||||||
}
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::Separator();
|
|
||||||
ImGui::Spacing();
|
|
||||||
if (ImGui::MenuItem("Shutdown PC")) {
|
|
||||||
shutdown_popup = true;
|
|
||||||
}
|
}
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Separator();
|
// game selector
|
||||||
|
ImGui::PushItemWidth(MIN(700, MAX(100, ImGui::GetWindowSize().x - 400)));
|
||||||
|
ImGui::Combo("##game_selector", game_selected, games_names.data(), (int)games_list.size());
|
||||||
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
ImGui::BeginDisabled();
|
ImGui::BeginDisabled();
|
||||||
if (!avs::game::is_model("000")) {
|
if (!avs::game::is_model("000")) {
|
||||||
@@ -3059,45 +3044,9 @@ namespace overlay::windows {
|
|||||||
if (licenses_popup) {
|
if (licenses_popup) {
|
||||||
ImGui::OpenPopup("Licenses##topbarpopup");
|
ImGui::OpenPopup("Licenses##topbarpopup");
|
||||||
}
|
}
|
||||||
if (shutdown_popup) {
|
|
||||||
ImGui::OpenPopup("System##topbarpopup");
|
|
||||||
}
|
|
||||||
|
|
||||||
// draw popups
|
// draw popups
|
||||||
{
|
{
|
||||||
// unused_open is needed for close button to appear on the popup
|
|
||||||
bool unused_open = true;
|
|
||||||
|
|
||||||
if (ImGui::BeginPopupModal(
|
|
||||||
"System##topbarpopup",
|
|
||||||
&unused_open,
|
|
||||||
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize)) {
|
|
||||||
|
|
||||||
static bool force_shutdown = false;
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::Checkbox("Force", &force_shutdown);
|
|
||||||
ImGui::Spacing();
|
|
||||||
|
|
||||||
const ImVec2 button_size(100.f, 0.f);
|
|
||||||
|
|
||||||
ImGui::Spacing();
|
|
||||||
if (ImGui::Button("Shutdown PC", button_size)) {
|
|
||||||
this->shutdown_system(force_shutdown, false);
|
|
||||||
}
|
|
||||||
ImGui::Spacing();
|
|
||||||
if (ImGui::Button("Reboot PC", button_size)) {
|
|
||||||
this->shutdown_system(force_shutdown, true);
|
|
||||||
}
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::Separator();
|
|
||||||
ImGui::Spacing();
|
|
||||||
if (ImGui::Button("Cancel", button_size)) {
|
|
||||||
ImGui::CloseCurrentPopup();
|
|
||||||
}
|
|
||||||
ImGui::Spacing();
|
|
||||||
ImGui::EndPopup();
|
|
||||||
}
|
|
||||||
|
|
||||||
const ImVec2 popup_size(
|
const ImVec2 popup_size(
|
||||||
std::min(ImGui::GetIO().DisplaySize.x * 0.9f, 800.f),
|
std::min(ImGui::GetIO().DisplaySize.x * 0.9f, 800.f),
|
||||||
std::min(ImGui::GetIO().DisplaySize.y * 0.9f, 800.f));
|
std::min(ImGui::GetIO().DisplaySize.y * 0.9f, 800.f));
|
||||||
@@ -3122,23 +3071,4 @@ namespace overlay::windows {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::shutdown_system(bool force, bool reboot_instead) {
|
|
||||||
if (!acquire_shutdown_privs()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UINT flags = 0;
|
|
||||||
if (force) {
|
|
||||||
flags |= EWX_FORCE;
|
|
||||||
}
|
|
||||||
if (reboot_instead) {
|
|
||||||
flags |= EWX_REBOOT;
|
|
||||||
} else {
|
|
||||||
flags |= EWX_SHUTDOWN | EWX_HYBRID_SHUTDOWN;
|
|
||||||
}
|
|
||||||
if (!ExitWindowsEx(flags, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_MAINTENANCE)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
launcher::shutdown(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace overlay::windows {
|
|||||||
void build_about();
|
void build_about();
|
||||||
void build_licenses();
|
void build_licenses();
|
||||||
void build_launcher();
|
void build_launcher();
|
||||||
void launch_shell(LPCSTR app, LPCSTR file);
|
void launch_shell(LPCSTR app, LPCSTR file=nullptr);
|
||||||
|
|
||||||
static void build_page_selector(int *page);
|
static void build_page_selector(int *page);
|
||||||
void build_menu(int *game_selected);
|
void build_menu(int *game_selected);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace overlay::windows {
|
|||||||
{"arkmmd.dll", {"gamemmd.dll"}},
|
{"arkmmd.dll", {"gamemmd.dll"}},
|
||||||
{"arkklp.dll", {"lpac.dll"}},
|
{"arkklp.dll", {"lpac.dll"}},
|
||||||
{"arknck.dll", {"weac.dll"}},
|
{"arknck.dll", {"weac.dll"}},
|
||||||
{"gdxg.dll", {"game.dll"}}
|
{"gdxg.dll", {"game.dll", "libshare-pj.dll"}}
|
||||||
};
|
};
|
||||||
|
|
||||||
static size_t url_recent_idx = -1;
|
static size_t url_recent_idx = -1;
|
||||||
@@ -1645,6 +1645,8 @@ namespace overlay::windows {
|
|||||||
std::string first_id = get_game_identifier(MODULE_PATH / firstDll);
|
std::string first_id = get_game_identifier(MODULE_PATH / firstDll);
|
||||||
std::filesystem::path firstPath = fmt::format("patches/{}.json", first_id);
|
std::filesystem::path firstPath = fmt::format("patches/{}.json", first_id);
|
||||||
|
|
||||||
|
log_misc("patchmanager", "patch identifier of {}: {}", firstDll, first_id);
|
||||||
|
|
||||||
auto extraDlls = getExtraDlls(firstDll);
|
auto extraDlls = getExtraDlls(firstDll);
|
||||||
std::erase_if(extraDlls, [](const std::string& dll) {
|
std::erase_if(extraDlls, [](const std::string& dll) {
|
||||||
auto identifier = get_game_identifier(MODULE_PATH / dll);
|
auto identifier = get_game_identifier(MODULE_PATH / dll);
|
||||||
|
|||||||
@@ -173,8 +173,8 @@ namespace overlay::windows {
|
|||||||
"Change window decoration. Resizable Window may not cause your mouse cursor to change, "
|
"Change window decoration. Resizable Window may not cause your mouse cursor to change, "
|
||||||
"but you can still drag to resize. Disabled for some games due to incompatibility.");
|
"but you can still drag to resize. Disabled for some games due to incompatibility.");
|
||||||
|
|
||||||
if (ImGui::Checkbox("Always on Top", &cfg::SCREENRESIZE->window_always_on_top) ) {
|
if (ImGui::Checkbox("Always On Top", &cfg::SCREENRESIZE->window_always_on_top) ) {
|
||||||
graphics_update_z_order(window);
|
graphics_update_z_order(window, cfg::SCREENRESIZE->window_always_on_top);
|
||||||
}
|
}
|
||||||
ImGui::BeginDisabled();
|
ImGui::BeginDisabled();
|
||||||
ImGui::Checkbox("Forced Render Scaling", &GRAPHICS_WINDOW_BACKBUFFER_SCALE);
|
ImGui::Checkbox("Forced Render Scaling", &GRAPHICS_WINDOW_BACKBUFFER_SCALE);
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ namespace rawinput {
|
|||||||
int TOUCHSCREEN_RANGE_X = 0;
|
int TOUCHSCREEN_RANGE_X = 0;
|
||||||
int TOUCHSCREEN_RANGE_Y = 0;
|
int TOUCHSCREEN_RANGE_Y = 0;
|
||||||
bool DUMP_HID_DEVICES_TO_LOG = false;
|
bool DUMP_HID_DEVICES_TO_LOG = false;
|
||||||
|
bool NAIVE_REQUIRE_FOCUS = true;
|
||||||
|
bool RAWINPUT_REQUIRE_FOCUS = false;
|
||||||
|
|
||||||
// set this to something slightly longer than 16.67ms (60Hz) so that I/O can pick it up
|
// set this to something slightly longer than 16.67ms (60Hz) so that I/O can pick it up
|
||||||
// this may need to be adjusted for each game in the future if there is a game that polls less
|
// this may need to be adjusted for each game in the future if there is a game that polls less
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ namespace rawinput {
|
|||||||
|
|
||||||
extern uint32_t MIDI_NOTE_SUSTAIN;
|
extern uint32_t MIDI_NOTE_SUSTAIN;
|
||||||
|
|
||||||
|
extern bool NAIVE_REQUIRE_FOCUS;
|
||||||
|
extern bool RAWINPUT_REQUIRE_FOCUS;
|
||||||
|
|
||||||
struct DeviceCallback {
|
struct DeviceCallback {
|
||||||
void *data;
|
void *data;
|
||||||
std::function<void(void*, Device*)> f;
|
std::function<void(void*, Device*)> f;
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
#define EXPORT __declspec(dllexport)
|
||||||
|
|
||||||
|
enum {
|
||||||
|
Error_NoError = 0,
|
||||||
|
Error_DeviceNotFound = 100,
|
||||||
|
Error_Busy,
|
||||||
|
Error_Printing_Busy,
|
||||||
|
Error_Printing_Ready,
|
||||||
|
Error_PortBusy,
|
||||||
|
Error_GetCPDIDinfo,
|
||||||
|
Error_PrinterBusy,
|
||||||
|
Error_FuncParamError = 201,
|
||||||
|
Error_MemAllocError,
|
||||||
|
Error_Timeout,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9CheckPaperRemain(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9CheckPrinter(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9CheckPrintEnd(uint32_t p1, void *p2, void *p3) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9GetFWInfo(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9GetMediaType(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9GetTempInfo(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9GetTotalPrintCount(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9PreHeat(void *p1) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9PrintJobCancel(void *p1) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9PrintOut(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPU9SetPrintParameter2(void *p1, void *p2) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPUASendImage(void *p1, void *p2, void *p3, void *p4) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPUASendImagePrint(
|
||||||
|
void *p1, void *p2, void *p3, bool p4, void *p5, int32_t p6, void *p7) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPUASendImagePrint2(
|
||||||
|
void *p1, void *p2, void *p3, bool p4, bool p5, void *p6, int32_t p7, void *p8) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPUASetPrintParameter(void *p1, void *p2, bool p3, void *p4, void *p5) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int32_t EXPORT __stdcall CPUXSearchPrinters(void *p1, void *p2, int32_t p3, void *p4) {
|
||||||
|
return Error_FuncParamError;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void EXPORT __stdcall CPUXInit() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
EXPORTS
|
||||||
|
CPU9CheckPaperRemain
|
||||||
|
CPU9CheckPrinter
|
||||||
|
CPU9CheckPrintEnd
|
||||||
|
CPU9GetFWInfo
|
||||||
|
CPU9GetMediaType
|
||||||
|
CPU9GetTempInfo
|
||||||
|
CPU9GetTotalPrintCount
|
||||||
|
CPU9PreHeat
|
||||||
|
CPU9PrintJobCancel
|
||||||
|
CPU9PrintOut
|
||||||
|
CPU9SetPrintParameter2
|
||||||
|
CPUASendImage
|
||||||
|
CPUASendImagePrint
|
||||||
|
CPUASendImagePrint2
|
||||||
|
CPUASetPrintParameter
|
||||||
|
CPUXInit
|
||||||
|
CPUXSearchPrinters
|
||||||
@@ -240,8 +240,11 @@ static LRESULT CALLBACK SpiceTouchWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
|
|||||||
rawinput::touch::display_update();
|
rawinput::touch::display_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto is_windowed_sub =
|
||||||
|
(GRAPHICS_IIDX_WSUB && hWnd == TDJ_SUBSCREEN_WINDOW) || (hWnd == SDVX_SUBSCREEN_WINDOW);
|
||||||
|
|
||||||
if (msg == WM_CLOSE) {
|
if (msg == WM_CLOSE) {
|
||||||
if ((GRAPHICS_IIDX_WSUB && hWnd == TDJ_SUBSCREEN_WINDOW) || (hWnd == SDVX_SUBSCREEN_WINDOW)) {
|
if (is_windowed_sub) {
|
||||||
log_misc("touch", "ignore WM_CLOSE for subscreen window");
|
log_misc("touch", "ignore WM_CLOSE for subscreen window");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -461,11 +464,14 @@ static LRESULT CALLBACK SpiceTouchWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
|
|||||||
};
|
};
|
||||||
|
|
||||||
// check if imgui is handling this mouse event
|
// check if imgui is handling this mouse event
|
||||||
if (overlay::OVERLAY != nullptr && overlay::OVERLAY->get_active() && ImGui::GetIO().WantCaptureMouse) {
|
if (is_windowed_sub) {
|
||||||
|
// do nothing, don't let imgui hijack clicks on the sub window
|
||||||
|
result.action = ACTION_PASS;
|
||||||
|
|
||||||
|
} else if (overlay::OVERLAY != nullptr && overlay::OVERLAY->get_active() && ImGui::GetIO().WantCaptureMouse) {
|
||||||
result.action = ACTION_RETURN_DEFAULT;
|
result.action = ACTION_RETURN_DEFAULT;
|
||||||
|
|
||||||
} else if (TOUCH_HANDLER != nullptr) {
|
} else if (TOUCH_HANDLER != nullptr) {
|
||||||
|
|
||||||
// call touch handler
|
// call touch handler
|
||||||
TOUCH_HANDLER->handle_message(result, hWnd, msg, wParam, lParam);
|
TOUCH_HANDLER->handle_message(result, hWnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,3 +356,15 @@ void libutils::check_duplicate_dlls() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void libutils::warn_if_dll_exists(const std::string &file_name) {
|
||||||
|
if (fileutils::file_exists(MODULE_PATH / file_name)) {
|
||||||
|
log_info("libutils", "found user-supplied {} in modules directory", file_name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto &spice_bin_path = libutils::module_file_name(nullptr).parent_path();
|
||||||
|
if (fileutils::file_exists(spice_bin_path / file_name)) {
|
||||||
|
log_info("libutils", "found user-supplied {} next to spice executable path", file_name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@ namespace libutils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void check_duplicate_dlls();
|
void check_duplicate_dlls();
|
||||||
|
void warn_if_dll_exists(const std::string &file_name);
|
||||||
|
|
||||||
// get module handle helpers
|
// get module handle helpers
|
||||||
HMODULE get_module(const char *module_name);
|
HMODULE get_module(const char *module_name);
|
||||||
|
|||||||
@@ -215,23 +215,42 @@ namespace sysutils {
|
|||||||
}
|
}
|
||||||
std::string prefix("device");
|
std::string prefix("device");
|
||||||
if (is_monitor) {
|
if (is_monitor) {
|
||||||
prefix = " adapter";
|
prefix = " adapter";
|
||||||
|
}
|
||||||
|
log_misc("gpuinfo", "{} {} device name : {}", prefix.c_str(), index, adapter->DeviceName);
|
||||||
|
log_misc("gpuinfo", "{} {} device string : {}", prefix.c_str(), index, adapter->DeviceString);
|
||||||
|
log_dbug("gpuinfo", "{} {} flags : 0x{:x}", prefix.c_str(), index, adapter->StateFlags);
|
||||||
|
|
||||||
|
if (!is_monitor) {
|
||||||
|
DEVMODEA devmode = {};
|
||||||
|
devmode.dmSize = sizeof(devmode);
|
||||||
|
if (EnumDisplaySettingsA(adapter->DeviceName, ENUM_CURRENT_SETTINGS, &devmode)) {
|
||||||
|
log_misc(
|
||||||
|
"gpuinfo",
|
||||||
|
"{} {} resolution : {}px * {}px @ {}Hz",
|
||||||
|
prefix.c_str(),
|
||||||
|
index,
|
||||||
|
devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||||
|
devmode.dmDisplayFrequency);
|
||||||
|
} else {
|
||||||
|
log_misc("gpuinfo", "EnumDisplaySettingsA failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log_misc("gpuinfo", "{} {} name : {}", prefix.c_str(), index, adapter->DeviceName);
|
|
||||||
log_misc("gpuinfo", "{} {} string : {}", prefix.c_str(), index, adapter->DeviceString);
|
|
||||||
log_dbug("gpuinfo", "{} {} flags : 0x{:x}", prefix.c_str(), index, adapter->StateFlags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_gpus() {
|
void print_gpus() {
|
||||||
DWORD device_index = 0;
|
DWORD device_index = 0;
|
||||||
DISPLAY_DEVICEA device;
|
DISPLAY_DEVICEA device = {};
|
||||||
device.cb = sizeof(device);
|
device.cb = sizeof(device);
|
||||||
log_misc("smbios", "dumping GPU/monitor information...");
|
log_misc(
|
||||||
|
"gpuinfo",
|
||||||
|
"dumping GPU/monitor information... "
|
||||||
|
"(note: these are current values **before** launching the game)");
|
||||||
while (EnumDisplayDevicesA(nullptr, device_index, &device, 0)) {
|
while (EnumDisplayDevicesA(nullptr, device_index, &device, 0)) {
|
||||||
print_adapter(device_index, &device, false);
|
print_adapter(device_index, &device, false);
|
||||||
|
|
||||||
DWORD monitor_index = 0;
|
DWORD monitor_index = 0;
|
||||||
DISPLAY_DEVICEA monitor;
|
DISPLAY_DEVICEA monitor = {};
|
||||||
monitor.cb = sizeof(monitor);
|
monitor.cb = sizeof(monitor);
|
||||||
while (EnumDisplayDevicesA((PCHAR)device.DeviceName, monitor_index, &monitor, 0)) {
|
while (EnumDisplayDevicesA((PCHAR)device.DeviceName, monitor_index, &monitor, 0)) {
|
||||||
print_adapter(monitor_index, &monitor, true);
|
print_adapter(monitor_index, &monitor, true);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace tapeledutils {
|
namespace tapeledutils {
|
||||||
|
|
||||||
@@ -20,6 +22,15 @@ namespace tapeledutils {
|
|||||||
float b;
|
float b;
|
||||||
} rgb_float3_t;
|
} rgb_float3_t;
|
||||||
|
|
||||||
|
struct tape_led {
|
||||||
|
std::vector<rgb_float3_t> data;
|
||||||
|
int index_r, index_g, index_b; // Averaged RGB light output indexes
|
||||||
|
std::string lightName;
|
||||||
|
|
||||||
|
tape_led(size_t data_size, int index_r, int index_g, int index_b, std::string lightName)
|
||||||
|
: data(std::vector<rgb_float3_t>(data_size)), index_r(index_r), index_g(index_g), index_b(index_b), lightName(std::move(lightName)) {}
|
||||||
|
};
|
||||||
|
|
||||||
bool is_enabled();
|
bool is_enabled();
|
||||||
rgb_float3_t pick_color_from_led_tape(uint8_t *data, size_t data_size);
|
rgb_float3_t pick_color_from_led_tape(uint8_t *data, size_t data_size);
|
||||||
size_t get_led_index_using_avg_algo(size_t data_size);
|
size_t get_led_index_using_avg_algo(size_t data_size);
|
||||||
|
|||||||
@@ -227,6 +227,7 @@ static inline std::vector<HWND> find_windows_beginning_with(const std::string &t
|
|||||||
return windows;
|
return windows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// exists for compat only; prefer to use FindProcessWindowBeginsWith instead
|
||||||
static inline HWND FindWindowBeginsWith(std::string title) {
|
static inline HWND FindWindowBeginsWith(std::string title) {
|
||||||
|
|
||||||
// get all windows
|
// get all windows
|
||||||
@@ -248,6 +249,28 @@ static inline HWND FindWindowBeginsWith(std::string title) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline HWND FindProcessWindowBeginsWith(const std::string &title) {
|
||||||
|
// try foreground window first
|
||||||
|
HWND fg_win = GetForegroundWindow();
|
||||||
|
if (string_begins_with(get_window_title(fg_win), title)) {
|
||||||
|
DWORD fg_pid;
|
||||||
|
GetWindowThreadProcessId(fg_win, &fg_pid);
|
||||||
|
if (fg_pid == GetCurrentProcessId()) {
|
||||||
|
return fg_win;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// try different windows
|
||||||
|
for (const auto window : find_windows_beginning_with(title)) {
|
||||||
|
DWORD fg_pid;
|
||||||
|
GetWindowThreadProcessId(window, &fg_pid);
|
||||||
|
if (fg_pid == GetCurrentProcessId()) {
|
||||||
|
return window;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
static inline std::string get_last_error_string() {
|
static inline std::string get_last_error_string() {
|
||||||
|
|
||||||
// get error
|
// get error
|
||||||
|
|||||||
Reference in New Issue
Block a user