chore: CRLF to LF
This commit is contained in:
+206
-206
@@ -1,206 +1,206 @@
|
||||
#include "gitadora.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "util/detour.h"
|
||||
#include "util/libutils.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/sigscan.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
|
||||
// settings
|
||||
bool TWOCHANNEL = false;
|
||||
std::optional<unsigned int> CAB_TYPE = std::nullopt;
|
||||
|
||||
/*
|
||||
* GitaDora checks if the IP address has changed, and if it has it throws 5-1506-0000 like jubeat.
|
||||
* We don't want this so we patch it out.
|
||||
*/
|
||||
static char __cdecl eam_network_detected_ip_change() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* GitaDora checks if the server it connects to is in the 192.168.0.0/16 or 169.254.0.0/16 subnet.
|
||||
* If it is, it downright refuses to use it and errors with no visible indication.
|
||||
* We don't want this so we patch it out.
|
||||
*/
|
||||
static char __cdecl eam_network_settings_conflict() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent GitaDora from changing the volume setting.
|
||||
*/
|
||||
static long __cdecl bmsd2_set_windows_volume(int volume) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Two Channel Audio Mode
|
||||
* We proxy bmsd2_boot_hook and modify the last parameter which is apparently the channel count.
|
||||
* Since this apparently isn't the only thing required we need a signature scan to modify a value as well.
|
||||
*/
|
||||
typedef int (__cdecl *bmsd2_boot_t)(long a1, int a2, long a3, char channel_count);
|
||||
static bmsd2_boot_t bmsd2_boot_orig = nullptr;
|
||||
static int __cdecl bmsd2_boot_hook(long a1, int a2, long a3, char channel_count) {
|
||||
return bmsd2_boot_orig(a1, a2, a3, 2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Command Line Arguments
|
||||
* We hook this to override specific values.
|
||||
* This currently disables the ability to specify your own in the app-config.xml (param/cmdline __type="str")
|
||||
*/
|
||||
static bool __cdecl sys_code_get_cmdline(const char *cmdline) {
|
||||
if (strcmp(cmdline, "-d") == 0) {
|
||||
return true;
|
||||
} else if (strcmp(cmdline, "-DM") == 0) {
|
||||
return true;
|
||||
} else if (strcmp(cmdline, "-WINDOW") == 0) {
|
||||
return GRAPHICS_WINDOWED;
|
||||
} else if (strcmp(cmdline, "-LOGOUT") == 0) {
|
||||
return false;
|
||||
} else if (strcmp(cmdline, "-AOU") == 0) {
|
||||
return false;
|
||||
} else if (strcmp(cmdline, "-QCMODE") == 0) {
|
||||
return false;
|
||||
} else if (strcmp(cmdline, "-FACTORY") == 0) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* System Setting Parameter Overrides
|
||||
*/
|
||||
static std::unordered_map<std::string, long> SYS_SETTINGS;
|
||||
static std::unordered_map<std::string, long> SYS_DEBUG_DIPS;
|
||||
|
||||
static long __cdecl sys_setting_get_param(const char *param) {
|
||||
|
||||
// overrides
|
||||
if (strcmp(param, "PRODUCTION_MODE") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "ENABLE_DISP_ID") == 0) {
|
||||
return 0;
|
||||
} else if (CAB_TYPE.has_value() && strcmp(param, "VER_MACHINE") == 0) {
|
||||
return CAB_TYPE.value() << 12;
|
||||
}
|
||||
|
||||
// map lookup
|
||||
auto it = SYS_SETTINGS.find(param);
|
||||
if (it != SYS_SETTINGS.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static long __cdecl sys_setting_set_param(const char *param, long value) {
|
||||
SYS_SETTINGS[std::string(param)] = value;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static long __cdecl sys_debug_dip_get_param(const char *param) {
|
||||
|
||||
// overrides
|
||||
if (strcmp(param, "sysinfo") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "jobbar1") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "jobbar2") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "serial") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "warnvpf") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "scrshot") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "eamxml") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "offset") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "autodbg") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "develop") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "effect_test") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "voice_type2") == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// map lookup
|
||||
auto it = SYS_DEBUG_DIPS.find(param);
|
||||
if (it != SYS_DEBUG_DIPS.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static long __cdecl sys_debug_dip_set_param(const char *param, long value) {
|
||||
SYS_DEBUG_DIPS[std::string(param)] = value;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
GitaDoraGame::GitaDoraGame() : Game("GitaDora") {
|
||||
}
|
||||
|
||||
void GitaDoraGame::attach() {
|
||||
Game::attach();
|
||||
|
||||
// modules
|
||||
HMODULE sharepj_module = libutils::try_module("libshare-pj.dll");
|
||||
HMODULE bmsd_engine_module = libutils::try_module("libbmsd-engine.dll");
|
||||
HMODULE bmsd_module = libutils::try_module("libbmsd.dll");
|
||||
HMODULE bmsd2_module = libutils::try_module("libbmsd2.dll");
|
||||
HMODULE gdme_module = libutils::try_module("libgdme.dll");
|
||||
HMODULE system_module = libutils::try_module("libsystem.dll");
|
||||
|
||||
// patches
|
||||
detour::inline_hook((void *) eam_network_detected_ip_change, libutils::try_proc(
|
||||
sharepj_module, "eam_network_detected_ip_change"));
|
||||
detour::inline_hook((void *) eam_network_settings_conflict, libutils::try_proc(
|
||||
sharepj_module, "eam_network_settings_conflict"));
|
||||
detour::inline_hook((void *) bmsd2_set_windows_volume, libutils::try_proc(
|
||||
bmsd2_module, "bmsd2_set_windows_volume"));
|
||||
detour::inline_hook((void *) bmsd2_set_windows_volume, libutils::try_proc(
|
||||
bmsd2_module, "bmsd2_set_windows_volume"));
|
||||
detour::inline_hook((void *) sys_code_get_cmdline, libutils::try_proc(
|
||||
system_module, "sys_code_get_cmdline"));
|
||||
detour::inline_hook((void *) sys_setting_get_param, libutils::try_proc(
|
||||
system_module, "sys_setting_get_param"));
|
||||
detour::inline_hook((void *) sys_setting_set_param, libutils::try_proc(
|
||||
system_module, "sys_setting_set_param"));
|
||||
detour::inline_hook((void *) sys_debug_dip_get_param, libutils::try_proc(
|
||||
system_module, "sys_debug_dip_get_param"));
|
||||
detour::inline_hook((void *) sys_debug_dip_set_param, libutils::try_proc(
|
||||
system_module, "sys_debug_dip_set_param"));
|
||||
|
||||
// window patch
|
||||
if (GRAPHICS_WINDOWED && !replace_pattern(
|
||||
gdme_module,
|
||||
"754185ED753D8B4118BF0000CB02",
|
||||
"9090????9090??????????????12", 0, 0))
|
||||
{
|
||||
log_warning("gitadora", "windowed mode failed");
|
||||
}
|
||||
|
||||
// two channel mod
|
||||
if (TWOCHANNEL) {
|
||||
bmsd2_boot_orig = detour::iat_try("bmsd2_boot", bmsd2_boot_hook, bmsd_module);
|
||||
|
||||
if (!(replace_pattern(bmsd_engine_module, "33000000488D", "03??????????", 0, 0) ||
|
||||
replace_pattern(bmsd_engine_module, "330000000F10", "03??????????", 0, 0)))
|
||||
{
|
||||
log_warning("gitadora", "two channel mode failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "gitadora.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "util/detour.h"
|
||||
#include "util/libutils.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/sigscan.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
|
||||
// settings
|
||||
bool TWOCHANNEL = false;
|
||||
std::optional<unsigned int> CAB_TYPE = std::nullopt;
|
||||
|
||||
/*
|
||||
* GitaDora checks if the IP address has changed, and if it has it throws 5-1506-0000 like jubeat.
|
||||
* We don't want this so we patch it out.
|
||||
*/
|
||||
static char __cdecl eam_network_detected_ip_change() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* GitaDora checks if the server it connects to is in the 192.168.0.0/16 or 169.254.0.0/16 subnet.
|
||||
* If it is, it downright refuses to use it and errors with no visible indication.
|
||||
* We don't want this so we patch it out.
|
||||
*/
|
||||
static char __cdecl eam_network_settings_conflict() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent GitaDora from changing the volume setting.
|
||||
*/
|
||||
static long __cdecl bmsd2_set_windows_volume(int volume) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Two Channel Audio Mode
|
||||
* We proxy bmsd2_boot_hook and modify the last parameter which is apparently the channel count.
|
||||
* Since this apparently isn't the only thing required we need a signature scan to modify a value as well.
|
||||
*/
|
||||
typedef int (__cdecl *bmsd2_boot_t)(long a1, int a2, long a3, char channel_count);
|
||||
static bmsd2_boot_t bmsd2_boot_orig = nullptr;
|
||||
static int __cdecl bmsd2_boot_hook(long a1, int a2, long a3, char channel_count) {
|
||||
return bmsd2_boot_orig(a1, a2, a3, 2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Command Line Arguments
|
||||
* We hook this to override specific values.
|
||||
* This currently disables the ability to specify your own in the app-config.xml (param/cmdline __type="str")
|
||||
*/
|
||||
static bool __cdecl sys_code_get_cmdline(const char *cmdline) {
|
||||
if (strcmp(cmdline, "-d") == 0) {
|
||||
return true;
|
||||
} else if (strcmp(cmdline, "-DM") == 0) {
|
||||
return true;
|
||||
} else if (strcmp(cmdline, "-WINDOW") == 0) {
|
||||
return GRAPHICS_WINDOWED;
|
||||
} else if (strcmp(cmdline, "-LOGOUT") == 0) {
|
||||
return false;
|
||||
} else if (strcmp(cmdline, "-AOU") == 0) {
|
||||
return false;
|
||||
} else if (strcmp(cmdline, "-QCMODE") == 0) {
|
||||
return false;
|
||||
} else if (strcmp(cmdline, "-FACTORY") == 0) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* System Setting Parameter Overrides
|
||||
*/
|
||||
static std::unordered_map<std::string, long> SYS_SETTINGS;
|
||||
static std::unordered_map<std::string, long> SYS_DEBUG_DIPS;
|
||||
|
||||
static long __cdecl sys_setting_get_param(const char *param) {
|
||||
|
||||
// overrides
|
||||
if (strcmp(param, "PRODUCTION_MODE") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "ENABLE_DISP_ID") == 0) {
|
||||
return 0;
|
||||
} else if (CAB_TYPE.has_value() && strcmp(param, "VER_MACHINE") == 0) {
|
||||
return CAB_TYPE.value() << 12;
|
||||
}
|
||||
|
||||
// map lookup
|
||||
auto it = SYS_SETTINGS.find(param);
|
||||
if (it != SYS_SETTINGS.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static long __cdecl sys_setting_set_param(const char *param, long value) {
|
||||
SYS_SETTINGS[std::string(param)] = value;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static long __cdecl sys_debug_dip_get_param(const char *param) {
|
||||
|
||||
// overrides
|
||||
if (strcmp(param, "sysinfo") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "jobbar1") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "jobbar2") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "serial") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "warnvpf") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "scrshot") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "eamxml") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "offset") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "autodbg") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "develop") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "effect_test") == 0) {
|
||||
return 0;
|
||||
} else if (strcmp(param, "voice_type2") == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// map lookup
|
||||
auto it = SYS_DEBUG_DIPS.find(param);
|
||||
if (it != SYS_DEBUG_DIPS.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static long __cdecl sys_debug_dip_set_param(const char *param, long value) {
|
||||
SYS_DEBUG_DIPS[std::string(param)] = value;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
GitaDoraGame::GitaDoraGame() : Game("GitaDora") {
|
||||
}
|
||||
|
||||
void GitaDoraGame::attach() {
|
||||
Game::attach();
|
||||
|
||||
// modules
|
||||
HMODULE sharepj_module = libutils::try_module("libshare-pj.dll");
|
||||
HMODULE bmsd_engine_module = libutils::try_module("libbmsd-engine.dll");
|
||||
HMODULE bmsd_module = libutils::try_module("libbmsd.dll");
|
||||
HMODULE bmsd2_module = libutils::try_module("libbmsd2.dll");
|
||||
HMODULE gdme_module = libutils::try_module("libgdme.dll");
|
||||
HMODULE system_module = libutils::try_module("libsystem.dll");
|
||||
|
||||
// patches
|
||||
detour::inline_hook((void *) eam_network_detected_ip_change, libutils::try_proc(
|
||||
sharepj_module, "eam_network_detected_ip_change"));
|
||||
detour::inline_hook((void *) eam_network_settings_conflict, libutils::try_proc(
|
||||
sharepj_module, "eam_network_settings_conflict"));
|
||||
detour::inline_hook((void *) bmsd2_set_windows_volume, libutils::try_proc(
|
||||
bmsd2_module, "bmsd2_set_windows_volume"));
|
||||
detour::inline_hook((void *) bmsd2_set_windows_volume, libutils::try_proc(
|
||||
bmsd2_module, "bmsd2_set_windows_volume"));
|
||||
detour::inline_hook((void *) sys_code_get_cmdline, libutils::try_proc(
|
||||
system_module, "sys_code_get_cmdline"));
|
||||
detour::inline_hook((void *) sys_setting_get_param, libutils::try_proc(
|
||||
system_module, "sys_setting_get_param"));
|
||||
detour::inline_hook((void *) sys_setting_set_param, libutils::try_proc(
|
||||
system_module, "sys_setting_set_param"));
|
||||
detour::inline_hook((void *) sys_debug_dip_get_param, libutils::try_proc(
|
||||
system_module, "sys_debug_dip_get_param"));
|
||||
detour::inline_hook((void *) sys_debug_dip_set_param, libutils::try_proc(
|
||||
system_module, "sys_debug_dip_set_param"));
|
||||
|
||||
// window patch
|
||||
if (GRAPHICS_WINDOWED && !replace_pattern(
|
||||
gdme_module,
|
||||
"754185ED753D8B4118BF0000CB02",
|
||||
"9090????9090??????????????12", 0, 0))
|
||||
{
|
||||
log_warning("gitadora", "windowed mode failed");
|
||||
}
|
||||
|
||||
// two channel mod
|
||||
if (TWOCHANNEL) {
|
||||
bmsd2_boot_orig = detour::iat_try("bmsd2_boot", bmsd2_boot_hook, bmsd_module);
|
||||
|
||||
if (!(replace_pattern(bmsd_engine_module, "33000000488D", "03??????????", 0, 0) ||
|
||||
replace_pattern(bmsd_engine_module, "330000000F10", "03??????????", 0, 0)))
|
||||
{
|
||||
log_warning("gitadora", "two channel mode failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-18
@@ -1,18 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "games/game.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
|
||||
// settings
|
||||
extern bool TWOCHANNEL;
|
||||
extern std::optional<unsigned int> CAB_TYPE;
|
||||
|
||||
class GitaDoraGame : public games::Game {
|
||||
public:
|
||||
GitaDoraGame();
|
||||
virtual void attach();
|
||||
};
|
||||
}
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "games/game.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
|
||||
// settings
|
||||
extern bool TWOCHANNEL;
|
||||
extern std::optional<unsigned int> CAB_TYPE;
|
||||
|
||||
class GitaDoraGame : public games::Game {
|
||||
public:
|
||||
GitaDoraGame();
|
||||
virtual void attach();
|
||||
};
|
||||
}
|
||||
|
||||
+118
-118
@@ -1,118 +1,118 @@
|
||||
#include "io.h"
|
||||
|
||||
std::vector<Button> &games::gitadora::get_buttons() {
|
||||
static std::vector<Button> buttons;
|
||||
|
||||
if (buttons.empty()) {
|
||||
buttons = GameAPI::Buttons::getButtons("GitaDora");
|
||||
|
||||
GameAPI::Buttons::sortButtons(&buttons,
|
||||
"Service",
|
||||
"Test",
|
||||
"Coin",
|
||||
"Guitar P1 Start",
|
||||
"Guitar P1 Up",
|
||||
"Guitar P1 Down",
|
||||
"Guitar P1 Left",
|
||||
"Guitar P1 Right",
|
||||
"Guitar P1 Help",
|
||||
"Guitar P1 Effect 1",
|
||||
"Guitar P1 Effect 2",
|
||||
"Guitar P1 Effect 3",
|
||||
"Guitar P1 Effect Pedal",
|
||||
"Guitar P1 Button Extra 1",
|
||||
"Guitar P1 Button Extra 2",
|
||||
"Guitar P1 Pick Up",
|
||||
"Guitar P1 Pick Down",
|
||||
"Guitar P1 R",
|
||||
"Guitar P1 G",
|
||||
"Guitar P1 B",
|
||||
"Guitar P1 Y",
|
||||
"Guitar P1 P",
|
||||
"Guitar P1 Knob Up",
|
||||
"Guitar P1 Knob Down",
|
||||
"Guitar P1 Wail Up",
|
||||
"Guitar P1 Wail Down",
|
||||
"Guitar P2 Start",
|
||||
"Guitar P2 Up",
|
||||
"Guitar P2 Down",
|
||||
"Guitar P2 Left",
|
||||
"Guitar P2 Right",
|
||||
"Guitar P2 Help",
|
||||
"Guitar P2 Effect 1",
|
||||
"Guitar P2 Effect 2",
|
||||
"Guitar P2 Effect 3",
|
||||
"Guitar P2 Effect Pedal",
|
||||
"Guitar P2 Button Extra 1",
|
||||
"Guitar P2 Button Extra 2",
|
||||
"Guitar P2 Pick Up",
|
||||
"Guitar P2 Pick Down",
|
||||
"Guitar P2 R",
|
||||
"Guitar P2 G",
|
||||
"Guitar P2 B",
|
||||
"Guitar P2 Y",
|
||||
"Guitar P2 P",
|
||||
"Guitar P2 Knob Up",
|
||||
"Guitar P2 Knob Down",
|
||||
"Guitar P2 Wail Up",
|
||||
"Guitar P2 Wail Down",
|
||||
"Drum Start",
|
||||
"Drum Up",
|
||||
"Drum Down",
|
||||
"Drum Left",
|
||||
"Drum Right",
|
||||
"Drum Help",
|
||||
"Drum Button Extra 1",
|
||||
"Drum Button Extra 2",
|
||||
"Drum Hi-Hat",
|
||||
"Drum Hi-Hat Closed",
|
||||
"Drum Hi-Hat Half-Open",
|
||||
"Drum Snare",
|
||||
"Drum Hi-Tom",
|
||||
"Drum Low-Tom",
|
||||
"Drum Right Cymbal",
|
||||
"Drum Bass Pedal",
|
||||
"Drum Left Cymbal",
|
||||
"Drum Left Pedal",
|
||||
"Drum Floor Tom"
|
||||
);
|
||||
}
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
std::vector<Analog> &games::gitadora::get_analogs() {
|
||||
static std::vector<Analog> analogs;
|
||||
|
||||
if (analogs.empty()) {
|
||||
analogs = GameAPI::Analogs::getAnalogs("GitaDora");
|
||||
|
||||
GameAPI::Analogs::sortAnalogs(&analogs,
|
||||
"Guitar P1 Wail X",
|
||||
"Guitar P1 Wail Y",
|
||||
"Guitar P1 Wail Z",
|
||||
"Guitar P1 Knob",
|
||||
"Guitar P2 Wail X",
|
||||
"Guitar P2 Wail Y",
|
||||
"Guitar P2 Wail Z",
|
||||
"Guitar P2 Knob"
|
||||
);
|
||||
}
|
||||
|
||||
return analogs;
|
||||
}
|
||||
|
||||
std::vector<Light> &games::gitadora::get_lights() {
|
||||
static std::vector<Light> lights;
|
||||
|
||||
if (lights.empty()) {
|
||||
lights = GameAPI::Lights::getLights("GitaDora");
|
||||
|
||||
GameAPI::Lights::sortLights(&lights,
|
||||
"Guitar P1 Motor",
|
||||
"Guitar P2 Motor"
|
||||
);
|
||||
}
|
||||
|
||||
return lights;
|
||||
}
|
||||
#include "io.h"
|
||||
|
||||
std::vector<Button> &games::gitadora::get_buttons() {
|
||||
static std::vector<Button> buttons;
|
||||
|
||||
if (buttons.empty()) {
|
||||
buttons = GameAPI::Buttons::getButtons("GitaDora");
|
||||
|
||||
GameAPI::Buttons::sortButtons(&buttons,
|
||||
"Service",
|
||||
"Test",
|
||||
"Coin",
|
||||
"Guitar P1 Start",
|
||||
"Guitar P1 Up",
|
||||
"Guitar P1 Down",
|
||||
"Guitar P1 Left",
|
||||
"Guitar P1 Right",
|
||||
"Guitar P1 Help",
|
||||
"Guitar P1 Effect 1",
|
||||
"Guitar P1 Effect 2",
|
||||
"Guitar P1 Effect 3",
|
||||
"Guitar P1 Effect Pedal",
|
||||
"Guitar P1 Button Extra 1",
|
||||
"Guitar P1 Button Extra 2",
|
||||
"Guitar P1 Pick Up",
|
||||
"Guitar P1 Pick Down",
|
||||
"Guitar P1 R",
|
||||
"Guitar P1 G",
|
||||
"Guitar P1 B",
|
||||
"Guitar P1 Y",
|
||||
"Guitar P1 P",
|
||||
"Guitar P1 Knob Up",
|
||||
"Guitar P1 Knob Down",
|
||||
"Guitar P1 Wail Up",
|
||||
"Guitar P1 Wail Down",
|
||||
"Guitar P2 Start",
|
||||
"Guitar P2 Up",
|
||||
"Guitar P2 Down",
|
||||
"Guitar P2 Left",
|
||||
"Guitar P2 Right",
|
||||
"Guitar P2 Help",
|
||||
"Guitar P2 Effect 1",
|
||||
"Guitar P2 Effect 2",
|
||||
"Guitar P2 Effect 3",
|
||||
"Guitar P2 Effect Pedal",
|
||||
"Guitar P2 Button Extra 1",
|
||||
"Guitar P2 Button Extra 2",
|
||||
"Guitar P2 Pick Up",
|
||||
"Guitar P2 Pick Down",
|
||||
"Guitar P2 R",
|
||||
"Guitar P2 G",
|
||||
"Guitar P2 B",
|
||||
"Guitar P2 Y",
|
||||
"Guitar P2 P",
|
||||
"Guitar P2 Knob Up",
|
||||
"Guitar P2 Knob Down",
|
||||
"Guitar P2 Wail Up",
|
||||
"Guitar P2 Wail Down",
|
||||
"Drum Start",
|
||||
"Drum Up",
|
||||
"Drum Down",
|
||||
"Drum Left",
|
||||
"Drum Right",
|
||||
"Drum Help",
|
||||
"Drum Button Extra 1",
|
||||
"Drum Button Extra 2",
|
||||
"Drum Hi-Hat",
|
||||
"Drum Hi-Hat Closed",
|
||||
"Drum Hi-Hat Half-Open",
|
||||
"Drum Snare",
|
||||
"Drum Hi-Tom",
|
||||
"Drum Low-Tom",
|
||||
"Drum Right Cymbal",
|
||||
"Drum Bass Pedal",
|
||||
"Drum Left Cymbal",
|
||||
"Drum Left Pedal",
|
||||
"Drum Floor Tom"
|
||||
);
|
||||
}
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
std::vector<Analog> &games::gitadora::get_analogs() {
|
||||
static std::vector<Analog> analogs;
|
||||
|
||||
if (analogs.empty()) {
|
||||
analogs = GameAPI::Analogs::getAnalogs("GitaDora");
|
||||
|
||||
GameAPI::Analogs::sortAnalogs(&analogs,
|
||||
"Guitar P1 Wail X",
|
||||
"Guitar P1 Wail Y",
|
||||
"Guitar P1 Wail Z",
|
||||
"Guitar P1 Knob",
|
||||
"Guitar P2 Wail X",
|
||||
"Guitar P2 Wail Y",
|
||||
"Guitar P2 Wail Z",
|
||||
"Guitar P2 Knob"
|
||||
);
|
||||
}
|
||||
|
||||
return analogs;
|
||||
}
|
||||
|
||||
std::vector<Light> &games::gitadora::get_lights() {
|
||||
static std::vector<Light> lights;
|
||||
|
||||
if (lights.empty()) {
|
||||
lights = GameAPI::Lights::getLights("GitaDora");
|
||||
|
||||
GameAPI::Lights::sortLights(&lights,
|
||||
"Guitar P1 Motor",
|
||||
"Guitar P2 Motor"
|
||||
);
|
||||
}
|
||||
|
||||
return lights;
|
||||
}
|
||||
|
||||
+108
-108
@@ -1,108 +1,108 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "cfg/api.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
|
||||
// all buttons in correct order
|
||||
namespace Buttons {
|
||||
enum {
|
||||
Service,
|
||||
Test,
|
||||
Coin,
|
||||
GuitarP1Start,
|
||||
GuitarP1Up,
|
||||
GuitarP1Down,
|
||||
GuitarP1Left,
|
||||
GuitarP1Right,
|
||||
GuitarP1Help,
|
||||
GuitarP1Effect1,
|
||||
GuitarP1Effect2,
|
||||
GuitarP1Effect3,
|
||||
GuitarP1EffectPedal,
|
||||
GuitarP1ButtonExtra1,
|
||||
GuitarP1ButtonExtra2,
|
||||
GuitarP1PickUp,
|
||||
GuitarP1PickDown,
|
||||
GuitarP1R,
|
||||
GuitarP1G,
|
||||
GuitarP1B,
|
||||
GuitarP1Y,
|
||||
GuitarP1P,
|
||||
GuitarP1KnobUp,
|
||||
GuitarP1KnobDown,
|
||||
GuitarP1WailUp,
|
||||
GuitarP1WailDown,
|
||||
GuitarP2Start,
|
||||
GuitarP2Up,
|
||||
GuitarP2Down,
|
||||
GuitarP2Left,
|
||||
GuitarP2Right,
|
||||
GuitarP2Help,
|
||||
GuitarP2Effect1,
|
||||
GuitarP2Effect2,
|
||||
GuitarP2Effect3,
|
||||
GuitarP2EffectPedal,
|
||||
GuitarP2ButtonExtra1,
|
||||
GuitarP2ButtonExtra2,
|
||||
GuitarP2PickUp,
|
||||
GuitarP2PickDown,
|
||||
GuitarP2R,
|
||||
GuitarP2G,
|
||||
GuitarP2B,
|
||||
GuitarP2Y,
|
||||
GuitarP2P,
|
||||
GuitarP2KnobUp,
|
||||
GuitarP2KnobDown,
|
||||
GuitarP2WailUp,
|
||||
GuitarP2WailDown,
|
||||
DrumStart,
|
||||
DrumUp,
|
||||
DrumDown,
|
||||
DrumLeft,
|
||||
DrumRight,
|
||||
DrumHelp,
|
||||
DrumButtonExtra1,
|
||||
DrumButtonExtra2,
|
||||
DrumHiHat,
|
||||
DrumHiHatClosed,
|
||||
DrumHiHatHalfOpen,
|
||||
DrumSnare,
|
||||
DrumHiTom,
|
||||
DrumLowTom,
|
||||
DrumRightCymbal,
|
||||
DrumBassPedal,
|
||||
DrumLeftCymbal,
|
||||
DrumLeftPedal,
|
||||
DrumFloorTom
|
||||
};
|
||||
}
|
||||
|
||||
// all analogs in correct order
|
||||
namespace Analogs {
|
||||
enum {
|
||||
GuitarP1WailX,
|
||||
GuitarP1WailY,
|
||||
GuitarP1WailZ,
|
||||
GuitarP1Knob,
|
||||
GuitarP2WailX,
|
||||
GuitarP2WailY,
|
||||
GuitarP2WailZ,
|
||||
GuitarP2Knob
|
||||
};
|
||||
}
|
||||
|
||||
// all lights in correct order
|
||||
namespace Lights {
|
||||
enum {
|
||||
GuitarP1Motor,
|
||||
GuitarP2Motor,
|
||||
};
|
||||
}
|
||||
|
||||
// getters
|
||||
std::vector<Button> &get_buttons();
|
||||
std::vector<Analog> &get_analogs();
|
||||
std::vector<Light> &get_lights();
|
||||
}
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "cfg/api.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
|
||||
// all buttons in correct order
|
||||
namespace Buttons {
|
||||
enum {
|
||||
Service,
|
||||
Test,
|
||||
Coin,
|
||||
GuitarP1Start,
|
||||
GuitarP1Up,
|
||||
GuitarP1Down,
|
||||
GuitarP1Left,
|
||||
GuitarP1Right,
|
||||
GuitarP1Help,
|
||||
GuitarP1Effect1,
|
||||
GuitarP1Effect2,
|
||||
GuitarP1Effect3,
|
||||
GuitarP1EffectPedal,
|
||||
GuitarP1ButtonExtra1,
|
||||
GuitarP1ButtonExtra2,
|
||||
GuitarP1PickUp,
|
||||
GuitarP1PickDown,
|
||||
GuitarP1R,
|
||||
GuitarP1G,
|
||||
GuitarP1B,
|
||||
GuitarP1Y,
|
||||
GuitarP1P,
|
||||
GuitarP1KnobUp,
|
||||
GuitarP1KnobDown,
|
||||
GuitarP1WailUp,
|
||||
GuitarP1WailDown,
|
||||
GuitarP2Start,
|
||||
GuitarP2Up,
|
||||
GuitarP2Down,
|
||||
GuitarP2Left,
|
||||
GuitarP2Right,
|
||||
GuitarP2Help,
|
||||
GuitarP2Effect1,
|
||||
GuitarP2Effect2,
|
||||
GuitarP2Effect3,
|
||||
GuitarP2EffectPedal,
|
||||
GuitarP2ButtonExtra1,
|
||||
GuitarP2ButtonExtra2,
|
||||
GuitarP2PickUp,
|
||||
GuitarP2PickDown,
|
||||
GuitarP2R,
|
||||
GuitarP2G,
|
||||
GuitarP2B,
|
||||
GuitarP2Y,
|
||||
GuitarP2P,
|
||||
GuitarP2KnobUp,
|
||||
GuitarP2KnobDown,
|
||||
GuitarP2WailUp,
|
||||
GuitarP2WailDown,
|
||||
DrumStart,
|
||||
DrumUp,
|
||||
DrumDown,
|
||||
DrumLeft,
|
||||
DrumRight,
|
||||
DrumHelp,
|
||||
DrumButtonExtra1,
|
||||
DrumButtonExtra2,
|
||||
DrumHiHat,
|
||||
DrumHiHatClosed,
|
||||
DrumHiHatHalfOpen,
|
||||
DrumSnare,
|
||||
DrumHiTom,
|
||||
DrumLowTom,
|
||||
DrumRightCymbal,
|
||||
DrumBassPedal,
|
||||
DrumLeftCymbal,
|
||||
DrumLeftPedal,
|
||||
DrumFloorTom
|
||||
};
|
||||
}
|
||||
|
||||
// all analogs in correct order
|
||||
namespace Analogs {
|
||||
enum {
|
||||
GuitarP1WailX,
|
||||
GuitarP1WailY,
|
||||
GuitarP1WailZ,
|
||||
GuitarP1Knob,
|
||||
GuitarP2WailX,
|
||||
GuitarP2WailY,
|
||||
GuitarP2WailZ,
|
||||
GuitarP2Knob
|
||||
};
|
||||
}
|
||||
|
||||
// all lights in correct order
|
||||
namespace Lights {
|
||||
enum {
|
||||
GuitarP1Motor,
|
||||
GuitarP2Motor,
|
||||
};
|
||||
}
|
||||
|
||||
// getters
|
||||
std::vector<Button> &get_buttons();
|
||||
std::vector<Analog> &get_analogs();
|
||||
std::vector<Light> &get_lights();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user