mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
sdvx: clean up valk cab check (#498)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "acio/icca/icca.h"
|
#include "acio/icca/icca.h"
|
||||||
#include "avs/game.h"
|
#include "avs/game.h"
|
||||||
|
#include "games/sdvx/sdvx.h"
|
||||||
#include "misc/eamuse.h"
|
#include "misc/eamuse.h"
|
||||||
#include "util/logging.h"
|
#include "util/logging.h"
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
@@ -101,13 +102,10 @@ bool ICCADevice::parse_msg(MessageData *msg_in,
|
|||||||
|
|
||||||
// send version data
|
// send version data
|
||||||
auto msg = this->create_msg(msg_in, MSG_VERSION_SIZE);
|
auto msg = this->create_msg(msg_in, MSG_VERSION_SIZE);
|
||||||
if (
|
if (avs::game::is_model({"LDJ", "TBS", "UJK", "XIF"}) ||
|
||||||
avs::game::is_model({"LDJ", "TBS", "UJK", "XIF"}) ||
|
games::sdvx::is_valkyrie_model()) {
|
||||||
// SDVX Valkyrie cabinet mode
|
|
||||||
(avs::game::is_model("KFC") && (avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H'))
|
|
||||||
) {
|
|
||||||
this->set_version(msg, 0x3, 0, 1, 7, 0, "ICCA");
|
this->set_version(msg, 0x3, 0, 1, 7, 0, "ICCA");
|
||||||
} else if (avs::game::is_model({"VFG"})) {
|
} else if (avs::game::is_model("VFG")) {
|
||||||
this->set_version(msg, 0x3, 0, 1, 7, 0, "ICCB");
|
this->set_version(msg, 0x3, 0, 1, 7, 0, "ICCB");
|
||||||
} else {
|
} else {
|
||||||
this->set_version(msg, 0x3, 0, 1, 6, 0, "ICCA");
|
this->set_version(msg, 0x3, 0, 1, 6, 0, "ICCA");
|
||||||
@@ -520,11 +518,7 @@ void ICCADevice::update_status(int unit) {
|
|||||||
buffer[1] = felica ? 0x01 : 0x00;
|
buffer[1] = felica ? 0x01 : 0x00;
|
||||||
buffer[10] = felica ? 0x01 : 0x00;
|
buffer[10] = felica ? 0x01 : 0x00;
|
||||||
|
|
||||||
} else if (
|
} else if (avs::game::is_model({"LDJ", "TBS", "XIF"}) || games::sdvx::is_valkyrie_model()) {
|
||||||
avs::game::is_model({"LDJ", "TBS", "XIF"}) ||
|
|
||||||
// SDVX Valkyrie cabinet mode
|
|
||||||
(avs::game::is_model("KFC") && (avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H'))) {
|
|
||||||
|
|
||||||
// set status to 0 otherwise reader power on fails
|
// set status to 0 otherwise reader power on fails
|
||||||
buffer[0] = 0x00;
|
buffer[0] = 0x00;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <external/robin_hood.h>
|
#include <external/robin_hood.h>
|
||||||
|
|
||||||
#include "avs/game.h"
|
|
||||||
#include "games/shared/lcdhandle.h"
|
#include "games/shared/lcdhandle.h"
|
||||||
#include "games/io.h"
|
#include "games/io.h"
|
||||||
#include "hooks/audio/audio.h"
|
#include "hooks/audio/audio.h"
|
||||||
@@ -331,9 +330,8 @@ namespace games::sdvx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SPICE64 // SDVX5+ specific code
|
#ifdef SPICE64 // SDVX5+ specific code
|
||||||
this->VALKYRIE_MODEL = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
|
|
||||||
// check -monitor + UFC mode
|
// check -monitor + UFC mode
|
||||||
if (!GRAPHICS_WINDOWED && D3D9_ADAPTER.has_value() && this->VALKYRIE_MODEL) {
|
if (!GRAPHICS_WINDOWED && D3D9_ADAPTER.has_value() && is_valkyrie_model()) {
|
||||||
SHOW_VM_MONITOR_WARNING = true;
|
SHOW_VM_MONITOR_WARNING = true;
|
||||||
log_warning(
|
log_warning(
|
||||||
"sdvx",
|
"sdvx",
|
||||||
@@ -370,7 +368,7 @@ namespace games::sdvx {
|
|||||||
#ifdef SPICE64 // SDVX5+ specific code
|
#ifdef SPICE64 // SDVX5+ specific code
|
||||||
|
|
||||||
// LCD handle
|
// LCD handle
|
||||||
if (!this->VALKYRIE_MODEL) {
|
if (!is_valkyrie_model()) {
|
||||||
devicehook_init();
|
devicehook_init();
|
||||||
devicehook_add(new games::shared::LCDHandle());
|
devicehook_add(new games::shared::LCDHandle());
|
||||||
}
|
}
|
||||||
@@ -409,7 +407,7 @@ namespace games::sdvx {
|
|||||||
nvapi_hook::initialize(avs::game::DLL_INSTANCE);
|
nvapi_hook::initialize(avs::game::DLL_INSTANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->VALKYRIE_MODEL) {
|
if (is_valkyrie_model()) {
|
||||||
// hook touch window
|
// hook touch window
|
||||||
// in windowed mode, game can accept mouse input on the second screen
|
// in windowed mode, game can accept mouse input on the second screen
|
||||||
if (!NATIVETOUCH && !GRAPHICS_WINDOWED) {
|
if (!NATIVETOUCH && !GRAPHICS_WINDOWED) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "avs/game.h"
|
||||||
#include "games/game.h"
|
#include "games/game.h"
|
||||||
|
|
||||||
namespace games::sdvx {
|
namespace games::sdvx {
|
||||||
@@ -25,6 +26,13 @@ namespace games::sdvx {
|
|||||||
// states
|
// states
|
||||||
extern bool SHOW_VM_MONITOR_WARNING;
|
extern bool SHOW_VM_MONITOR_WARNING;
|
||||||
|
|
||||||
|
static inline bool is_valkyrie_model() {
|
||||||
|
return (
|
||||||
|
avs::game::is_model("KFC") &&
|
||||||
|
(avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
class SDVXGame : public games::Game {
|
class SDVXGame : public games::Game {
|
||||||
public:
|
public:
|
||||||
SDVXGame();
|
SDVXGame();
|
||||||
@@ -33,11 +41,6 @@ namespace games::sdvx {
|
|||||||
virtual void post_attach() override;
|
virtual void post_attach() override;
|
||||||
virtual void detach() override;
|
virtual void detach() override;
|
||||||
private:
|
private:
|
||||||
// don't be tempted to make this into a public or a global variable
|
|
||||||
// various modules need to check if VM mode is active and they should
|
|
||||||
// not depend on the fact that SDVX module is active (since it can be
|
|
||||||
// inactive on cabs or partial I/O setup)
|
|
||||||
bool VALKYRIE_MODEL = false;
|
|
||||||
void detect_sound_output_device();
|
void detect_sound_output_device();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1362,9 +1362,7 @@ void graphics_d3d9_on_present(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for IIDX TDJ / SDVX UFC, handle subscreen
|
// for IIDX TDJ / SDVX UFC, handle subscreen
|
||||||
const bool is_vm =
|
const bool is_vm = games::sdvx::is_valkyrie_model();
|
||||||
avs::game::is_model("KFC") &&
|
|
||||||
(avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H');
|
|
||||||
const bool is_tdj = avs::game::is_model("LDJ") && games::iidx::TDJ_MODE;
|
const bool is_tdj = avs::game::is_model("LDJ") && games::iidx::TDJ_MODE;
|
||||||
if (is_vm || is_tdj) {
|
if (is_vm || is_tdj) {
|
||||||
graphics_d3d9_ldj_on_present(wrapped_device);
|
graphics_d3d9_ldj_on_present(wrapped_device);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "avs/game.h"
|
#include "avs/game.h"
|
||||||
#include "games/iidx/iidx.h"
|
#include "games/iidx/iidx.h"
|
||||||
#include "games/gitadora/gitadora.h"
|
#include "games/gitadora/gitadora.h"
|
||||||
|
#include "games/sdvx/sdvx.h"
|
||||||
#include "util/detour.h"
|
#include "util/detour.h"
|
||||||
#include "util/logging.h"
|
#include "util/logging.h"
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
@@ -220,8 +221,7 @@ void hooks::lang::early_init() {
|
|||||||
detour::trampoline_try("kernel32.dll", "GetOEMCP", GetOEMCP_hook, &GetOEMCP_orig);
|
detour::trampoline_try("kernel32.dll", "GetOEMCP", GetOEMCP_hook, &GetOEMCP_orig);
|
||||||
|
|
||||||
#ifdef SPICE64 // SDVX5+ specific code
|
#ifdef SPICE64 // SDVX5+ specific code
|
||||||
bool isValkyrieCabinetMode = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
|
if (games::sdvx::is_valkyrie_model()) {
|
||||||
if (avs::game::is_model("KFC") && isValkyrieCabinetMode) {
|
|
||||||
log_info("hooks::lang", "hooking GetSystemDefaultLCID");
|
log_info("hooks::lang", "hooking GetSystemDefaultLCID");
|
||||||
detour::trampoline_try(
|
detour::trampoline_try(
|
||||||
"kernel32.dll",
|
"kernel32.dll",
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ namespace overlay::windows {
|
|||||||
SDVXSubScreen::SDVXSubScreen(SpiceOverlay *overlay) : GenericSubScreen(overlay) {
|
SDVXSubScreen::SDVXSubScreen(SpiceOverlay *overlay) : GenericSubScreen(overlay) {
|
||||||
this->title = "SDVX Subscreen";
|
this->title = "SDVX Subscreen";
|
||||||
|
|
||||||
bool isValkyrieCabinetMode = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
|
if (!games::sdvx::is_valkyrie_model()) {
|
||||||
if (!isValkyrieCabinetMode) {
|
|
||||||
this->disabled_message = "Valkyrie Model mode is not enabled!";
|
this->disabled_message = "Valkyrie Model mode is not enabled!";
|
||||||
} else if (games::sdvx::SHOW_VM_MONITOR_WARNING) {
|
} else if (games::sdvx::SHOW_VM_MONITOR_WARNING) {
|
||||||
this->disabled_message = "VM mode subscreen overlay is not compatible with -monitor option";
|
this->disabled_message = "VM mode subscreen overlay is not compatible with -monitor option";
|
||||||
|
|||||||
Reference in New Issue
Block a user