mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 14:50:41 -07:00
6bc1357d6a
## Link to GitHub Issue or related Pull Request, if one exists n/a ## Description of change Some crappy DDR soft mats (either USB-based or console pads with crappy adapters that lack a dedicated "DDR pad mode") use X and Y analog axis for arrows, which means they cannot cleanly report Up+Down or Left+Right input. According to some ancient Stepmania code, a lot of these report a middle value (value between center and right, for example, for left+right). Borrow this hack from Stepmania and implement it in spice as analog input for DDR. Also, for rawinput/xinput automatic bind scenario, update the logic so that face buttons are always detected before analog axis / dpads for consistency. This would help with binding any DDR pads that simultaneously input face buttons / dpad / analog axis, so that we can prefer face buttons when detected. ## Testing I don't have any soft mats that have this, but it was tested with an xbox controller.
30 lines
712 B
C++
30 lines
712 B
C++
#pragma once
|
|
|
|
#include "games/game.h"
|
|
#include <cstdint>
|
|
|
|
namespace games::ddr {
|
|
|
|
// settings
|
|
extern bool SDMODE;
|
|
extern bool NO_CODEC_REGISTRATION;
|
|
|
|
// Buffers to store RGB data for tape LEDs on gold cabinets
|
|
const size_t TAPELED_DEVICE_COUNT = 11;
|
|
extern uint8_t DDR_TAPELEDS[TAPELED_DEVICE_COUNT][50][3];
|
|
|
|
class DDRGame : public games::Game {
|
|
public:
|
|
DDRGame();
|
|
virtual void pre_attach() override;
|
|
virtual void attach() override;
|
|
virtual void detach() override;
|
|
|
|
private:
|
|
void register_codecs();
|
|
};
|
|
|
|
void get_analog_x_axis(int player, bool &left, bool &right);
|
|
void get_analog_y_axis(int player, bool &up, bool &down);
|
|
}
|