Initial commit for GitHub migration based on spice2x-25-03-03

This commit is contained in:
sp2xdev
2025-03-10 19:16:49 -07:00
parent 94af8d32c9
commit ed8c72852f
1008 changed files with 296815 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
#include "bs.h"
#include "avs/game.h"
#include "misc/wintouchemu.h"
#include "launcher/launcher.h"
#include "rawinput/rawinput.h"
#include "util/detour.h"
#include "util/logging.h"
namespace games::bs {
BSGame::BSGame() : Game("Beatstream") {
}
inline bool touchscreen_has_bug() {
// get devices
auto devices = RI_MGR->devices_get();
for (auto &device : devices) {
// filter by HID
if (device.type == rawinput::HID) {
auto &hid = device.hidInfo;
auto &attributes = hid->attributes;
// P2314T
// it apparently cannot do holds using Beatstream's wintouch code
if (attributes.VendorID == 0x2149 && attributes.ProductID == 0x2316)
return true;
// P2418HT
// it apparently cannot do holds using Beatstream's wintouch code
if (attributes.VendorID == 0x1FD2 && attributes.ProductID == 0x6103)
return true;
}
}
// looks all clean
return false;
}
void BSGame::attach() {
Game::attach();
// for bugged touch screens
if (touchscreen_has_bug()) {
log_info("bs", "detected bugged touchscreen, forcing wintouchemu");
wintouchemu::FORCE = true;
}
// for mouse support
wintouchemu::hook("BeatStream", avs::game::DLL_INSTANCE);
}
}