Initial re-upload of spice2x-24-08-24
This commit is contained in:
38
games/hpm/hpm.cpp
Normal file
38
games/hpm/hpm.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "avs/game.h"
|
||||
#include "hpm.h"
|
||||
|
||||
#include "util/detour.h"
|
||||
#include "util/libutils.h"
|
||||
#include "util/logging.h"
|
||||
|
||||
#include <mmsystem.h>
|
||||
|
||||
namespace games::hpm {
|
||||
|
||||
BOOL WINAPI SetCurrentDirectoryW_hook(LPCTSTR lpPathName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static decltype(mixerSetControlDetails)* mixerSetControlDetails_real = nullptr;
|
||||
|
||||
static MMRESULT WINAPI mixerSetControlDetails_hook(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails) {
|
||||
|
||||
mixerSetControlDetails_real(hmxobj, pmxcd, fdwDetails);
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
HPMGame::HPMGame() : Game("HELLO! Pop'n Music") {
|
||||
}
|
||||
|
||||
void HPMGame::attach() {
|
||||
Game::attach();
|
||||
|
||||
HMODULE kernel32_module = libutils::try_module("kernel32.dll");
|
||||
|
||||
// patches
|
||||
detour::inline_hook((void *) SetCurrentDirectoryW_hook, libutils::try_proc(
|
||||
kernel32_module, "SetCurrentDirectoryW"));
|
||||
|
||||
mixerSetControlDetails_real = detour::iat_try("mixerSetControlDetails", mixerSetControlDetails_hook, avs::game::DLL_INSTANCE);
|
||||
}
|
||||
}
|
||||
13
games/hpm/hpm.h
Normal file
13
games/hpm/hpm.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "games/game.h"
|
||||
|
||||
namespace games::hpm {
|
||||
|
||||
class HPMGame : public games::Game {
|
||||
public:
|
||||
HPMGame();
|
||||
|
||||
virtual void attach() override;
|
||||
};
|
||||
}
|
||||
54
games/hpm/io.cpp
Normal file
54
games/hpm/io.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#include "io.h"
|
||||
|
||||
std::vector<Button> &games::hpm::get_buttons() {
|
||||
static std::vector<Button> buttons;
|
||||
|
||||
if (buttons.empty()) {
|
||||
buttons = GameAPI::Buttons::getButtons("HELLO! Pop'n Music");
|
||||
|
||||
GameAPI::Buttons::sortButtons(
|
||||
&buttons,
|
||||
"Service",
|
||||
"Test",
|
||||
"Coin Mech",
|
||||
"P1 Start",
|
||||
"P1 1",
|
||||
"P1 2",
|
||||
"P1 3",
|
||||
"P1 4",
|
||||
"P2 Start",
|
||||
"P2 1",
|
||||
"P2 2",
|
||||
"P2 3",
|
||||
"P2 4"
|
||||
);
|
||||
}
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
std::vector<Light> &games::hpm::get_lights() {
|
||||
static std::vector<Light> lights;
|
||||
|
||||
if (lights.empty()) {
|
||||
lights = GameAPI::Lights::getLights("HELLO! Pop'n Music");
|
||||
|
||||
GameAPI::Lights::sortLights(
|
||||
&lights,
|
||||
"Speaker Red",
|
||||
"Speaker Orange",
|
||||
"Speaker Blue",
|
||||
"P1 Start",
|
||||
"P1 Red & P2 Green",
|
||||
"P1 Blue",
|
||||
"P1 Yellow",
|
||||
"P1 Green",
|
||||
"P2 Start",
|
||||
"P2 Red",
|
||||
"P2 Blue",
|
||||
"P2 Yellow"
|
||||
);
|
||||
}
|
||||
|
||||
return lights;
|
||||
}
|
||||
48
games/hpm/io.h
Normal file
48
games/hpm/io.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "cfg/api.h"
|
||||
|
||||
namespace games::hpm {
|
||||
|
||||
// all buttons in correct order
|
||||
namespace Buttons {
|
||||
enum {
|
||||
Service,
|
||||
Test,
|
||||
CoinMech,
|
||||
P1_Start,
|
||||
P1_1,
|
||||
P1_2,
|
||||
P1_3,
|
||||
P1_4,
|
||||
P2_Start,
|
||||
P2_1,
|
||||
P2_2,
|
||||
P2_3,
|
||||
P2_4,
|
||||
};
|
||||
}
|
||||
|
||||
// all lights in correct order
|
||||
namespace Lights {
|
||||
enum {
|
||||
SPEAKER_RED,
|
||||
SPEAKER_ORANGE,
|
||||
SPEAKER_BLUE,
|
||||
P1_START,
|
||||
P1_RED_P2_GREEN,
|
||||
P1_BLUE,
|
||||
P1_YELLOW,
|
||||
P1_GREEN,
|
||||
P2_START,
|
||||
P2_RED,
|
||||
P2_BLUE,
|
||||
P2_YELLOW,
|
||||
};
|
||||
}
|
||||
|
||||
// getters
|
||||
std::vector<Button> &get_buttons();
|
||||
std::vector<Light> &get_lights();
|
||||
}
|
||||
Reference in New Issue
Block a user