@@ -61,6 +61,7 @@ elseif(LINUX)
|
||||
# Builder beware: later versions of ffmpeg may break!
|
||||
option(WITH_SYSTEM_FFMPEG "Build with the system's FFMPEG, disabled build with bundled's FFMPEG" OFF)
|
||||
option(WITH_CRYSTALHD_DISABLED "Build FFMPEG without Crystal HD support." OFF)
|
||||
option(WITH_MINIMAID "Build with Minimaid Lights Support." ON)
|
||||
option(WITH_TTY "Build with Linux TTY Input Support." OFF)
|
||||
option(WITH_PROFILING "Build with Profiling Support." OFF)
|
||||
option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON)
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
if(LINUX)
|
||||
if(WITH_MINIMAID)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
list(APPEND SMDATA_LINK_LIB
|
||||
"${SM_EXTERN_DIR}/libmmmagic/linux-64bit/libmmmagic.a"
|
||||
"udev"
|
||||
)
|
||||
else()
|
||||
list(APPEND SMDATA_LINK_LIB
|
||||
"${SM_EXTERN_DIR}/libmmmagic/linux-32bit/libmmmagic.a"
|
||||
"udev"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+75
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
IMPORTANT NOTE FOR *NIX USERS:
|
||||
You must add permissions to access the minimaid as a user! Either do this through udev or manually or something.The below should work but fuck if it works for me :/
|
||||
|
||||
|
||||
sudo -i
|
||||
echo SUBSYSTEM==\"usb\", ATTR{idVendor}==\"beef\", ATTR{idProduct}==\"5730\", MODE=\"0666\" > /etc/udev/rules.d/50-minimaid
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef MMMAGIC_H
|
||||
#define MMMAGIC_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*Minimaid bit identifiers*/
|
||||
//CANINET_LIGHTS
|
||||
#define DDR_DOUBLE_BASS_LIGHTS 0 //unknown but guessed
|
||||
#define DDR_DOUBLE_PLAYER1_PANEL 2
|
||||
#define DDR_DOUBLE_PLAYER2_PANEL 3
|
||||
#define DDR_DOUBLE_MARQUEE_LOWER_RIGHT 4
|
||||
#define DDR_DOUBLE_MARQUEE_UPPER_RIGHT 5
|
||||
#define DDR_DOUBLE_MARQUEE_LOWER_LEFT 6
|
||||
#define DDR_DOUBLE_MARQUEE_UPPER_LEFT 7
|
||||
|
||||
//PADX_LIGHTS
|
||||
#define DDR_DOUBLE_PAD_UP 0
|
||||
#define DDR_DOUBLE_PAD_DOWN 1
|
||||
#define DDR_DOUBLE_PAD_LEFT 2
|
||||
#define DDR_DOUBLE_PAD_RIGHT 3
|
||||
#define DDR_DOUBLE_PAD_RESET 4
|
||||
|
||||
#define BIT(i) (1<<(i))
|
||||
#define BIT_IS_SET(v,i) ((v&BIT(i))!=0)
|
||||
static bool __bitValid(int bit);
|
||||
|
||||
|
||||
//minimaid prototypes
|
||||
void mm_setDDRPad1Light(int, int);
|
||||
void mm_setDDRPad2Light(int, int);
|
||||
void mm_setDDRCabinetLight(int, int);
|
||||
void mm_setDDRBassLight(int, int);
|
||||
|
||||
|
||||
bool mm_connect_minimaid();
|
||||
bool mm_setKB(bool val);
|
||||
|
||||
void mm_setDDRAllOn();
|
||||
void mm_setDDRAllOff();
|
||||
|
||||
void mm_setBlueLED(unsigned char value);
|
||||
void mm_setMMOutputReports(unsigned char a, unsigned char b, unsigned char c, unsigned char d);
|
||||
bool mm_sendDDRMiniMaidUpdate();
|
||||
static void mm_init();
|
||||
static unsigned char mm_turnON(unsigned char set, int bit);
|
||||
static unsigned char mm_turnOFF(unsigned char set, int bit);
|
||||
|
||||
|
||||
|
||||
//void mm_input_callback(void *ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -319,6 +319,14 @@ if(NOT APPLE)
|
||||
"arch/Lights/LightsDriver_LinuxParallel.h"
|
||||
)
|
||||
endif()
|
||||
if (WITH_MINIMAID)
|
||||
list(APPEND SMDATA_ARCH_LIGHTS_SRC
|
||||
"arch/Lights/LightsDriver_LinuxMinimaid.cpp"
|
||||
)
|
||||
list(APPEND SMDATA_ARCH_LIGHTS_HPP
|
||||
"arch/Lights/LightsDriver_LinuxMinimaid.h"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif(WIN32)
|
||||
endif(NOT APPLE)
|
||||
|
||||
@@ -331,6 +331,7 @@ list(APPEND SMDATA_LINK_LIB
|
||||
"glew"
|
||||
"jpeg"
|
||||
)
|
||||
include(../extern/CMakeProject-mmmagic.cmake)
|
||||
|
||||
if (HAS_MP3)
|
||||
list(FIND SMDATA_LINK_LIB "jsoncpp" JSON_INDEX)
|
||||
|
||||
@@ -18,9 +18,9 @@ public:
|
||||
virtual void Set( const LightsState *ls ) = 0;
|
||||
};
|
||||
|
||||
#define REGISTER_SOUND_DRIVER_CLASS2( name, x ) \
|
||||
#define REGISTER_LIGHTS_DRIVER_CLASS2( name, x ) \
|
||||
static RegisterRageDriver register_##x( &LightsDriver::m_pDriverList, #name, CreateClass<LightsDriver_##x, RageDriver> )
|
||||
#define REGISTER_SOUND_DRIVER_CLASS( name ) REGISTER_SOUND_DRIVER_CLASS2( name, name )
|
||||
#define REGISTER_LIGHTS_DRIVER_CLASS( name ) REGISTER_LIGHTS_DRIVER_CLASS2( name, name )
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "LightsDriver_Export.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS(Export);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS(Export);
|
||||
|
||||
RageMutex LightsDriver_Export::m_Lock( "LightsDriver_Export");
|
||||
LightsState LightsDriver_Export::m_State;
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
// LightsDriver_LinuxMinimaid - driver for lights on the Minimaid with libmmmagic
|
||||
/* To use, StepMania must be run with root permissions, or udev rule for the
|
||||
* device must be made something like this (but it's not quite right):
|
||||
* echo SUBSYSTEM==\"usb\", ATTR{idVendor}==\"beef\", ATTR{idProduct}==\"5730\", MODE=\"0666\" > /etc/udev/rules.d/50-minimaid
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include "LightsDriver_LinuxMinimaid.h"
|
||||
#include "../../../extern/libmmmagic/mmmagic.h"
|
||||
|
||||
REGISTER_LIGHTS_DRIVER_CLASS( LinuxMinimaid );
|
||||
|
||||
LightsDriver_LinuxMinimaid::LightsDriver_LinuxMinimaid()
|
||||
{
|
||||
// libmmmagic is actually statically linked in, so there's no wrapper
|
||||
// initializing to do. -Kyz
|
||||
_mmmagic_loaded= true;
|
||||
mm_connect_minimaid();
|
||||
mm_setKB(true);
|
||||
}
|
||||
|
||||
LightsDriver_LinuxMinimaid::~LightsDriver_LinuxMinimaid()
|
||||
{
|
||||
// libmmmagic is actually statically linked in, so there's no wrapper
|
||||
// destruction to do. -Kyz
|
||||
}
|
||||
|
||||
void LightsDriver_LinuxMinimaid::Set(LightsState const* ls)
|
||||
{
|
||||
if(_mmmagic_loaded)
|
||||
{
|
||||
mm_setDDRAllOff();
|
||||
|
||||
// Set the cabinet light values
|
||||
if(ls->m_bCabinetLights[LIGHT_MARQUEE_UP_LEFT])
|
||||
{
|
||||
mm_setDDRCabinetLight(DDR_DOUBLE_MARQUEE_UPPER_LEFT, 1);
|
||||
}
|
||||
if(ls->m_bCabinetLights[LIGHT_MARQUEE_UP_RIGHT])
|
||||
{
|
||||
mm_setDDRCabinetLight(DDR_DOUBLE_MARQUEE_UPPER_RIGHT, 1);
|
||||
}
|
||||
if(ls->m_bCabinetLights[LIGHT_MARQUEE_LR_LEFT])
|
||||
{
|
||||
mm_setDDRCabinetLight(DDR_DOUBLE_MARQUEE_LOWER_LEFT, 1);
|
||||
}
|
||||
if(ls->m_bCabinetLights[LIGHT_MARQUEE_LR_RIGHT])
|
||||
{
|
||||
mm_setDDRCabinetLight(DDR_DOUBLE_MARQUEE_LOWER_RIGHT, 1);
|
||||
}
|
||||
if(ls->m_bCabinetLights[LIGHT_BASS_LEFT] || ls->m_bCabinetLights[LIGHT_BASS_RIGHT])
|
||||
{
|
||||
mm_setDDRBassLight(DDR_DOUBLE_BASS_LIGHTS, 1);
|
||||
}
|
||||
|
||||
if(ls->m_bGameButtonLights[GameController_1][DANCE_BUTTON_LEFT])
|
||||
{
|
||||
mm_setDDRPad1Light(DDR_DOUBLE_PAD_LEFT, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_1][DANCE_BUTTON_RIGHT])
|
||||
{
|
||||
mm_setDDRPad1Light(DDR_DOUBLE_PAD_RIGHT, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_1][DANCE_BUTTON_UP])
|
||||
{
|
||||
mm_setDDRPad1Light(DDR_DOUBLE_PAD_UP, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_1][DANCE_BUTTON_DOWN])
|
||||
{
|
||||
mm_setDDRPad1Light(DDR_DOUBLE_PAD_DOWN, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_1][GAME_BUTTON_START])
|
||||
{
|
||||
mm_setDDRCabinetLight(DDR_DOUBLE_PLAYER1_PANEL, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_2][DANCE_BUTTON_LEFT])
|
||||
{
|
||||
mm_setDDRPad2Light(DDR_DOUBLE_PAD_LEFT, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_2][DANCE_BUTTON_RIGHT])
|
||||
{
|
||||
mm_setDDRPad2Light(DDR_DOUBLE_PAD_RIGHT, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_2][DANCE_BUTTON_UP])
|
||||
{
|
||||
mm_setDDRPad2Light(DDR_DOUBLE_PAD_UP, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_2][DANCE_BUTTON_DOWN])
|
||||
{
|
||||
mm_setDDRPad2Light(DDR_DOUBLE_PAD_DOWN, 1);
|
||||
}
|
||||
if(ls->m_bGameButtonLights[GameController_2][GAME_BUTTON_START])
|
||||
{
|
||||
mm_setDDRCabinetLight(DDR_DOUBLE_PLAYER2_PANEL, 1);
|
||||
}
|
||||
|
||||
// Output the information
|
||||
mm_sendDDRMiniMaidUpdate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/* LightsDriver_LinuxMinimaid - Minimaid based lights with libmmmagic */
|
||||
|
||||
#ifndef LightsDriver_LinuxMinimaid_H
|
||||
#define LightsDriver_LinuxMinimaid_H
|
||||
|
||||
#include "LightsDriver.h"
|
||||
|
||||
#define DDR_DOUBLE_BASS_LIGHTS 0 //unknown but guessed
|
||||
#define DDR_DOUBLE_PLAYER1_PANEL 2
|
||||
#define DDR_DOUBLE_PLAYER2_PANEL 3
|
||||
#define DDR_DOUBLE_MARQUEE_LOWER_RIGHT 4
|
||||
#define DDR_DOUBLE_MARQUEE_UPPER_RIGHT 5
|
||||
#define DDR_DOUBLE_MARQUEE_LOWER_LEFT 6
|
||||
#define DDR_DOUBLE_MARQUEE_UPPER_LEFT 7
|
||||
|
||||
//PADX_LIGHTS
|
||||
#define DDR_DOUBLE_PAD_UP 0
|
||||
#define DDR_DOUBLE_PAD_DOWN 1
|
||||
#define DDR_DOUBLE_PAD_LEFT 2
|
||||
#define DDR_DOUBLE_PAD_RIGHT 3
|
||||
#define DDR_DOUBLE_PAD_RESET 4
|
||||
|
||||
#define BIT(i) (1<<(i))
|
||||
#define BIT_IS_SET(v,i) ((v&BIT(i))!=0)
|
||||
|
||||
static bool _mmmagic_loaded=false;
|
||||
|
||||
class LightsDriver_LinuxMinimaid : public LightsDriver
|
||||
{
|
||||
public:
|
||||
LightsDriver_LinuxMinimaid();
|
||||
|
||||
virtual ~LightsDriver_LinuxMinimaid();
|
||||
virtual void Set( const LightsState *ls );
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -13,7 +13,7 @@
|
||||
static const int PORT_ADDRESS = 0x378;
|
||||
static const bool SCREEN_DEBUG = false;
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS(LinuxParallel);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS(LinuxParallel);
|
||||
|
||||
LightsDriver_LinuxParallel::LightsDriver_LinuxParallel()
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "LightsDriver_LinuxWeedTech.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS(LinuxWeedTech);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS(LinuxWeedTech);
|
||||
|
||||
// Begin serial driver
|
||||
static int fd = -1;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "Game.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS2(PIUIO, Linux_PIUIO);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS2(PIUIO, Linux_PIUIO);
|
||||
|
||||
LightsDriver_Linux_PIUIO::LightsDriver_Linux_PIUIO()
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "Game.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS2(PIUIO_Leds, Linux_PIUIO_Leds);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS2(PIUIO_Leds, Linux_PIUIO_Leds);
|
||||
|
||||
namespace {
|
||||
const char *cabinet_leds[NUM_CabinetLight] = {
|
||||
|
||||
@@ -227,7 +227,7 @@ void LightsDriver_SextetStream::Set(const LightsState *ls)
|
||||
|
||||
// LightsDriver_SextetStreamToFile implementation
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS(SextetStreamToFile);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS(SextetStreamToFile);
|
||||
|
||||
#if defined(_WINDOWS)
|
||||
#define DEFAULT_OUTPUT_FILENAME "\\\\.\\pipe\\StepMania-Lights-SextetStream"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "InputMapper.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS(SystemMessage);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS(SystemMessage);
|
||||
|
||||
LightsDriver_SystemMessage::LightsDriver_SystemMessage()
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "LightsDriver_Win32Minimaid.h"
|
||||
#include "windows.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS( Win32Minimaid );
|
||||
REGISTER_LIGHTS_DRIVER_CLASS( Win32Minimaid );
|
||||
|
||||
HINSTANCE hMMMAGICDLL = NULL;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "windows.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS(Win32Parallel);
|
||||
REGISTER_LIGHTS_DRIVER_CLASS(Win32Parallel);
|
||||
|
||||
HINSTANCE hDLL = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user