diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index be18175e21..d46f274f7d 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -19,7 +19,6 @@ #include "GameInput.h" // for GameController #include "InputMapper.h" -#include "windows.h" LightsManager* LIGHTSMAN = NULL; // global and accessable from anywhere in our program @@ -198,4 +197,4 @@ void LightsManager::Update( float fDeltaTime ) void LightsManager::SetLightMode( LightMode lm ) { m_LightMode = lm; -} \ No newline at end of file +} diff --git a/stepmania/src/arch/Lights/LightsDriver_LinuxSerial.cpp b/stepmania/src/arch/Lights/LightsDriver_LinuxSerial.cpp index 3e2b9c681e..d580af4ac3 100644 --- a/stepmania/src/arch/Lights/LightsDriver_LinuxSerial.cpp +++ b/stepmania/src/arch/Lights/LightsDriver_LinuxSerial.cpp @@ -19,43 +19,10 @@ #include #include #include -#include "adrport.h" +#include "RageLog.h" static int fd = 0; -LightsDriver_LinuxSerial::LightsDriver_LinuxSerial() -{ - sprintf(sPortName, "/dev/ttyS1", sPortNumber); - - fd = open(sPortName, O_RDWR | O_NOCTTY | O_NDELAY); - if (fd < 0) - RageException::Throw( "open error %d %s\n", errno, strerror(errno) ); - - struct termios my_termios; - tcgetattr(fd, &my_termios); - tcflush(fd, TCIFLUSH); - - my_termios.c_cflag = B2400 | CS8 |CREAD | CLOCAL | HUPCL; - - cfsetospeed(&my_termios, B2400); - tcsetattr(fd, TCSANOW, &my_termios); - - LOG->Info("Lights info:"); - LOG->Info(" new cflag=%08x\n", my_termios.c_cflag); - LOG->Info(" new oflag=%08x\n", my_termios.c_oflag); - LOG->Info(" new iflag=%08x\n", my_termios.c_iflag); - LOG->Info(" new lflag=%08x\n", my_termios.c_lflag); - LOG->Info(" new line=%02x\n", my_termios.c_line); - - WriteString( "Yo", strlen("Yo" ); -} - -LightsDriver_LinuxSerial::~LightsDriver_LinuxSerial() -{ - if (fd > 0) - close(fd); -} - void WriteString( char* sz, int len ) { int iOut; @@ -74,24 +41,53 @@ void WriteString( char* sz, int len ) ASSERT( iOut > 0 ); } -char g_data[2] = { 0, 0 }; +LightsDriver_LinuxSerial::LightsDriver_LinuxSerial() +{ + fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NDELAY); + if (fd < 0) + RageException::Throw( "open error %d %s\n", errno, strerror(errno) ); + struct termios my_termios; + tcgetattr(fd, &my_termios); + tcflush(fd, TCIFLUSH); + + my_termios.c_cflag = B2400 | CS8 |CREAD | CLOCAL | HUPCL; + + cfsetospeed(&my_termios, B2400); + tcsetattr(fd, TCSANOW, &my_termios); + + LOG->Info("Lights info:"); + LOG->Info(" new cflag=%08x\n", my_termios.c_cflag); + LOG->Info(" new oflag=%08x\n", my_termios.c_oflag); + LOG->Info(" new iflag=%08x\n", my_termios.c_iflag); + LOG->Info(" new lflag=%08x\n", my_termios.c_lflag); + LOG->Info(" new line=%02x\n", my_termios.c_line); + + WriteString( "Yo", strlen("Yo") ); +} + +LightsDriver_LinuxSerial::~LightsDriver_LinuxSerial() +{ + if (fd > 0) + close(fd); +} + + +char g_data[2] = { 0, 0 }; void LightsDriver_LinuxSerial::SetLight( Light light, bool bOn ) { int byte_index = light / 8; int bit_index = light % 8; char &data = g_data[byte_index]; - BYTE mask = 0x01 << bit_index; + char mask = 0x01 << bit_index; if( bOn ) data |= mask; else data &= ~mask; - - WriteString( data, sizeof(data) ); } void LightsDriver_LinuxSerial::Flush() { - WriteString( data, sizeof(data) ); + WriteString( g_data, sizeof(g_data) ); } diff --git a/stepmania/src/libresample/src/config.h b/stepmania/src/libresample/src/config.h index 93a25b310f..af7cff6691 100644 --- a/stepmania/src/libresample/src/config.h +++ b/stepmania/src/libresample/src/config.h @@ -1,4 +1,4 @@ -/* src/config.h. Generated automatically by configure. */ +/* src/config.h. Generated by configure. */ /* Run configure to generate config.h automatically on any system supported by GNU autoconf. For all other systems, use this file as a template to create config.h