Update to spice2x-25-04-25 (pre-apply)
> broken commit
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "cfg/configurator.h"
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "util/cpuutils.h"
|
||||
#include "util/detour.h"
|
||||
#include "util/libutils.h"
|
||||
#include "util/logging.h"
|
||||
@@ -38,6 +40,8 @@ namespace games::gitadora {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef SPICE64
|
||||
|
||||
/*
|
||||
* Two Channel Audio Mode
|
||||
* We proxy bmsd2_boot_hook and modify the last parameter which is apparently the channel count.
|
||||
@@ -49,6 +53,8 @@ namespace games::gitadora {
|
||||
return bmsd2_boot_orig(a1, a2, a3, 2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Command Line Arguments
|
||||
* We hook this to override specific values.
|
||||
@@ -152,15 +158,41 @@ namespace games::gitadora {
|
||||
GitaDoraGame::GitaDoraGame() : Game("GitaDora") {
|
||||
}
|
||||
|
||||
void GitaDoraGame::pre_attach() {
|
||||
Game::pre_attach();
|
||||
|
||||
if (!cfg::CONFIGURATOR_STANDALONE) {
|
||||
if (CAB_TYPE.has_value()) {
|
||||
log_info("gitadora", "cab type: {}", CAB_TYPE.value());
|
||||
} else {
|
||||
log_warning("gitadora", "cab type: not set");
|
||||
}
|
||||
|
||||
log_info("gitadora", "applying processor affinity workaround to prevent hangs...");
|
||||
#ifdef SPICE64
|
||||
// workaround for hang on title screen, on systems with many SMT threads
|
||||
// exact cause is unknown; most likely a bad assumption in some video decoder
|
||||
// 0xFF (first 8 LPs) seems to work well for most people
|
||||
cpuutils::set_processor_affinity(0xFF, false);
|
||||
#else
|
||||
// XG versions ran on ancient dual-core AMD systems
|
||||
// having more cores cause random hangs on song select screen
|
||||
cpuutils::set_processor_affinity(0x3, false);
|
||||
|
||||
// check invalid cab type
|
||||
if (CAB_TYPE.has_value() && CAB_TYPE.value() == 3) {
|
||||
log_fatal("gitadora", "Cabinet type 3 (SD2) not supported on XG series");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -170,8 +202,6 @@ namespace games::gitadora {
|
||||
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(
|
||||
@@ -183,6 +213,10 @@ namespace games::gitadora {
|
||||
detour::inline_hook((void *) sys_debug_dip_set_param, libutils::try_proc(
|
||||
system_module, "sys_debug_dip_set_param"));
|
||||
|
||||
#ifdef SPICE64
|
||||
|
||||
HMODULE gdme_module = libutils::try_module("libgdme.dll");
|
||||
|
||||
// window patch
|
||||
if (GRAPHICS_WINDOWED && !replace_pattern(
|
||||
gdme_module,
|
||||
@@ -192,6 +226,9 @@ namespace games::gitadora {
|
||||
log_warning("gitadora", "windowed mode failed");
|
||||
}
|
||||
|
||||
HMODULE bmsd_engine_module = libutils::try_module("libbmsd-engine.dll");
|
||||
HMODULE bmsd_module = libutils::try_module("libbmsd.dll");
|
||||
|
||||
// two channel mod
|
||||
if (TWOCHANNEL) {
|
||||
bmsd2_boot_orig = detour::iat_try("bmsd2_boot", bmsd2_boot_hook, bmsd_module);
|
||||
@@ -202,5 +239,8 @@ namespace games::gitadora {
|
||||
log_warning("gitadora", "two channel mode failed");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "avs/game.h"
|
||||
#include "games/game.h"
|
||||
|
||||
namespace games::gitadora {
|
||||
@@ -13,6 +14,21 @@ namespace games::gitadora {
|
||||
class GitaDoraGame : public games::Game {
|
||||
public:
|
||||
GitaDoraGame();
|
||||
virtual void attach();
|
||||
virtual void pre_attach() override;
|
||||
virtual void attach() override;
|
||||
};
|
||||
|
||||
static inline bool is_drum() {
|
||||
return (
|
||||
avs::game::is_model({ "J32", "K32", "L32" }) ||
|
||||
(avs::game::is_model("M32") && avs::game::SPEC[0] == 'B')
|
||||
);
|
||||
}
|
||||
static inline bool is_guitar() {
|
||||
return (
|
||||
avs::game::is_model({ "J33", "K33", "L33" }) ||
|
||||
(avs::game::is_model("M32") && avs::game::SPEC[0] == 'A')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+101
-1
@@ -102,6 +102,27 @@ std::vector<Analog> &games::gitadora::get_analogs() {
|
||||
return analogs;
|
||||
}
|
||||
|
||||
std::string games::gitadora::get_buttons_help() {
|
||||
// keep to max 100 characters wide
|
||||
return
|
||||
"guitar:\n"
|
||||
" < R G B Y P --- Pick ] \n"
|
||||
"\n"
|
||||
"drums:\n"
|
||||
" LeftCymbal RightCymbal\n"
|
||||
" HiHat HiTom LowTom \n"
|
||||
" Snare FloorTom \n"
|
||||
" -------------------------------------------------------\n"
|
||||
" Left Bass\n"
|
||||
" Pedal Pedal\n"
|
||||
"\n"
|
||||
"Drums are NOT velocity-sensitive!\n"
|
||||
"\n"
|
||||
"For MIDI drums with Open/Closed HiHat configurations, bind variations below. "
|
||||
"v2_drum algorithm might work better for those drums."
|
||||
;
|
||||
}
|
||||
|
||||
std::vector<Light> &games::gitadora::get_lights() {
|
||||
static std::vector<Light> lights;
|
||||
|
||||
@@ -110,7 +131,86 @@ std::vector<Light> &games::gitadora::get_lights() {
|
||||
|
||||
GameAPI::Lights::sortLights(&lights,
|
||||
"Guitar P1 Motor",
|
||||
"Guitar P2 Motor"
|
||||
"Guitar P2 Motor",
|
||||
|
||||
"P1 Start",
|
||||
"P1 Menu Up Down (DX)",
|
||||
"P1 Menu Left Right (DX)",
|
||||
"P1 Help (DX)",
|
||||
|
||||
"P2 Start",
|
||||
"P2 Menu Up Down (DX)",
|
||||
"P2 Menu Left Right (DX)",
|
||||
"P2 Help (DX)",
|
||||
|
||||
"Drum Left Cymbal",
|
||||
"Drum Hi-Hat",
|
||||
"Drum Snare",
|
||||
"Drum High Tom",
|
||||
"Drum Low Tom",
|
||||
"Drum Floor Tom",
|
||||
"Drum Right Cymbal",
|
||||
|
||||
"Drum Woofer R",
|
||||
"Drum Woofer G",
|
||||
"Drum Woofer B",
|
||||
|
||||
"Drum Stage R (DX)",
|
||||
"Drum Stage G (DX)",
|
||||
"Drum Stage B (DX)",
|
||||
|
||||
"Spot Left (DX)",
|
||||
"Spot Right (DX)",
|
||||
"Spot Center Left (DX)",
|
||||
"Spot Center Right (DX)",
|
||||
|
||||
"Drum Spot Rear Left (DX)",
|
||||
"Drum Spot Rear Right (DX)",
|
||||
|
||||
"Guitar Lower Left R (DX)",
|
||||
"Guitar Lower Left G (DX)",
|
||||
"Guitar Lower Left B (DX)",
|
||||
"Guitar Lower Right R (DX)",
|
||||
"Guitar Lower Right G (DX)",
|
||||
"Guitar Lower Right B (DX)",
|
||||
|
||||
"Guitar Left Speaker Upper R (DX)",
|
||||
"Guitar Left Speaker Upper G (DX)",
|
||||
"Guitar Left Speaker Upper B (DX)",
|
||||
"Guitar Left Speaker Mid Up Left R (DX)",
|
||||
"Guitar Left Speaker Mid Up Left G (DX)",
|
||||
"Guitar Left Speaker Mid Up Left B (DX)",
|
||||
"Guitar Left Speaker Mid Up Right R (DX)",
|
||||
"Guitar Left Speaker Mid Up Right G (DX)",
|
||||
"Guitar Left Speaker Mid Up Right B (DX)",
|
||||
"Guitar Left Speaker Mid Low Left R (DX)",
|
||||
"Guitar Left Speaker Mid Low Left G (DX)",
|
||||
"Guitar Left Speaker Mid Low Left B (DX)",
|
||||
"Guitar Left Speaker Mid Low Right R (DX)",
|
||||
"Guitar Left Speaker Mid Low Right G (DX)",
|
||||
"Guitar Left Speaker Mid Low Right B (DX)",
|
||||
"Guitar Left Speaker Lower R (DX)",
|
||||
"Guitar Left Speaker Lower G (DX)",
|
||||
"Guitar Left Speaker Lower B (DX)",
|
||||
|
||||
"Guitar Right Speaker Upper R (DX)",
|
||||
"Guitar Right Speaker Upper G (DX)",
|
||||
"Guitar Right Speaker Upper B (DX)",
|
||||
"Guitar Right Speaker Mid Up Left R (DX)",
|
||||
"Guitar Right Speaker Mid Up Left G (DX)",
|
||||
"Guitar Right Speaker Mid Up Left B (DX)",
|
||||
"Guitar Right Speaker Mid Up Right R (DX)",
|
||||
"Guitar Right Speaker Mid Up Right G (DX)",
|
||||
"Guitar Right Speaker Mid Up Right B (DX)",
|
||||
"Guitar Right Speaker Mid Low Left R (DX)",
|
||||
"Guitar Right Speaker Mid Low Left G (DX)",
|
||||
"Guitar Right Speaker Mid Low Left B (DX)",
|
||||
"Guitar Right Speaker Mid Low Right R (DX)",
|
||||
"Guitar Right Speaker Mid Low Right G (DX)",
|
||||
"Guitar Right Speaker Mid Low Right B (DX)",
|
||||
"Guitar Right Speaker Lower R (DX)",
|
||||
"Guitar Right Speaker Lower G (DX)",
|
||||
"Guitar Right Speaker Lower B (DX)"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+96
-2
@@ -65,6 +65,7 @@ namespace games::gitadora {
|
||||
DrumHelp,
|
||||
DrumButtonExtra1,
|
||||
DrumButtonExtra2,
|
||||
// note: this is the order they appear in the test menu
|
||||
DrumHiHat,
|
||||
DrumHiHatClosed,
|
||||
DrumHiHatHalfOpen,
|
||||
@@ -95,14 +96,107 @@ namespace games::gitadora {
|
||||
|
||||
// all lights in correct order
|
||||
namespace Lights {
|
||||
enum {
|
||||
typedef enum {
|
||||
// vibration motors (DX only)
|
||||
GuitarP1Motor,
|
||||
GuitarP2Motor,
|
||||
};
|
||||
|
||||
// P1
|
||||
P1MenuStart,
|
||||
// DX only
|
||||
P1MenuUpDown,
|
||||
P1MenuLeftRight,
|
||||
P1MenuHelp,
|
||||
|
||||
// P2
|
||||
P2MenuStart,
|
||||
// DX only
|
||||
P2MenuUpDown,
|
||||
P2MenuLeftRight,
|
||||
P2MenuHelp,
|
||||
|
||||
// drums
|
||||
DrumLeftCymbal,
|
||||
DrumHiHat,
|
||||
DrumSnare,
|
||||
DrumHighTom,
|
||||
DrumLowTom,
|
||||
DrumFloorTom,
|
||||
DrumRightCymbal,
|
||||
|
||||
// drum woofer
|
||||
DrumWooferR,
|
||||
DrumWooferG,
|
||||
DrumWooferB,
|
||||
|
||||
// drum stage, DX only
|
||||
DrumStageR,
|
||||
DrumStageG,
|
||||
DrumStageB,
|
||||
|
||||
// main spotlights, DX only
|
||||
SpotFrontLeft,
|
||||
SpotFrontRight,
|
||||
SpotCenterLeft,
|
||||
SpotCenterRight,
|
||||
|
||||
// drum rear spotlights, DX only
|
||||
DrumSpotRearLeft,
|
||||
DrumSpotRearRight,
|
||||
|
||||
// guitar center lower RGB, DX only
|
||||
GuitarLowerLeftR,
|
||||
GuitarLowerLeftG,
|
||||
GuitarLowerLeftB,
|
||||
GuitarLowerRightR,
|
||||
GuitarLowerRightG,
|
||||
GuitarLowerRightB,
|
||||
|
||||
// guitar left speaker, DX only
|
||||
GuitarLeftSpeakerUpperR,
|
||||
GuitarLeftSpeakerUpperG,
|
||||
GuitarLeftSpeakerUpperB,
|
||||
GuitarLeftSpeakerMidUpLeftR,
|
||||
GuitarLeftSpeakerMidUpLeftG,
|
||||
GuitarLeftSpeakerMidUpLeftB,
|
||||
GuitarLeftSpeakerMidUpRightR,
|
||||
GuitarLeftSpeakerMidUpRightG,
|
||||
GuitarLeftSpeakerMidUpRightB,
|
||||
GuitarLeftSpeakerMidLowLeftR,
|
||||
GuitarLeftSpeakerMidLowLeftG,
|
||||
GuitarLeftSpeakerMidLowLeftB,
|
||||
GuitarLeftSpeakerMidLowRightR,
|
||||
GuitarLeftSpeakerMidLowRightG,
|
||||
GuitarLeftSpeakerMidLowRightB,
|
||||
GuitarLeftSpeakerLowerR,
|
||||
GuitarLeftSpeakerLowerG,
|
||||
GuitarLeftSpeakerLowerB,
|
||||
|
||||
// guitar right speaker, DX only
|
||||
GuitarRightSpeakerUpperR,
|
||||
GuitarRightSpeakerUpperG,
|
||||
GuitarRightSpeakerUpperB,
|
||||
GuitarRightSpeakerMidUpLeftR,
|
||||
GuitarRightSpeakerMidUpLeftG,
|
||||
GuitarRightSpeakerMidUpLeftB,
|
||||
GuitarRightSpeakerMidUpRightR,
|
||||
GuitarRightSpeakerMidUpRightG,
|
||||
GuitarRightSpeakerMidUpRightB,
|
||||
GuitarRightSpeakerMidLowLeftR,
|
||||
GuitarRightSpeakerMidLowLeftG,
|
||||
GuitarRightSpeakerMidLowLeftB,
|
||||
GuitarRightSpeakerMidLowRightR,
|
||||
GuitarRightSpeakerMidLowRightG,
|
||||
GuitarRightSpeakerMidLowRightB,
|
||||
GuitarRightSpeakerLowerR,
|
||||
GuitarRightSpeakerLowerG,
|
||||
GuitarRightSpeakerLowerB
|
||||
} gitadora_lights_t;
|
||||
}
|
||||
|
||||
// getters
|
||||
std::vector<Button> &get_buttons();
|
||||
std::string get_buttons_help();
|
||||
std::vector<Analog> &get_analogs();
|
||||
std::vector<Light> &get_lights();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user