Initial re-upload of spice2x-24-08-24

This commit is contained in:
2024-08-28 11:10:34 -04:00
commit caa9e02285
1181 changed files with 380065 additions and 0 deletions

53
games/bs/bs.cpp Normal file
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);
}
}

12
games/bs/bs.h Normal file
View File

@@ -0,0 +1,12 @@
#pragma once
#include "games/game.h"
namespace games::bs {
class BSGame : public games::Game {
public:
BSGame();
virtual void attach() override;
};
}

41
games/bs/io.cpp Normal file
View File

@@ -0,0 +1,41 @@
#include "io.h"
std::vector<Button> &games::bs::get_buttons() {
static std::vector<Button> buttons;
if (buttons.empty()) {
buttons = GameAPI::Buttons::getButtons("Beatstream");
GameAPI::Buttons::sortButtons(
&buttons,
"Service",
"Test",
"Coin Mech"
);
}
return buttons;
}
std::vector<Light> &games::bs::get_lights() {
static std::vector<Light> lights;
if (lights.empty()) {
lights = GameAPI::Lights::getLights("Beatstream");
GameAPI::Lights::sortLights(
&lights,
"Bottom R",
"Bottom G",
"Bottom B",
"Left R",
"Left G",
"Left B",
"Right R",
"Right G",
"Right B"
);
}
return lights;
}

35
games/bs/io.h Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
#include <vector>
#include "cfg/api.h"
namespace games::bs {
// all buttons in correct order
namespace Buttons {
enum {
Service,
Test,
CoinMech,
};
}
// all lights in correct order
namespace Lights {
enum {
BottomR,
BottomG,
BottomB,
LeftR,
LeftG,
LeftB,
RightR,
RightG,
RightB,
};
}
// getters
std::vector<Button> &get_buttons();
std::vector<Light> &get_lights();
}