more pedantic cleanup of extraneous tabs, and add a description to LightsDriver_SystemMessage.
This commit is contained in:
@@ -14,7 +14,7 @@ public:
|
||||
|
||||
LightsDriver() {};
|
||||
virtual ~LightsDriver() {};
|
||||
|
||||
|
||||
virtual void Set( const LightsState *ls ) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public:
|
||||
LightsDriver_Export();
|
||||
virtual void Set( const LightsState *ls );
|
||||
|
||||
/* Get the current lights state. This can be called from a thread. */
|
||||
// Get the current lights state. This can be called from a thread.
|
||||
static LightsState GetState();
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
//
|
||||
// LightsDriver_LinuxParallel - Parallel Port Based Lights Driver for Linux
|
||||
//
|
||||
// This requires root permissions to work! (run as root or suid)
|
||||
// This code was written using SystemMessage Driver as template.
|
||||
//
|
||||
/* LightsDriver_LinuxParallel - Parallel Port Based Lights Driver for Linux
|
||||
* This requires root permissions to work! (run as root or suid)
|
||||
* This code was written using SystemMessage Driver as template. */
|
||||
|
||||
#include "global.h"
|
||||
#include <sys/io.h>
|
||||
@@ -12,6 +9,7 @@
|
||||
#include "InputMapper.h"
|
||||
#include "Game.h"
|
||||
|
||||
// xxx: don't hardcode the port address. -aj
|
||||
static const int PORT_ADDRESS = 0x378;
|
||||
static const bool SCREEN_DEBUG = false;
|
||||
|
||||
@@ -19,7 +17,7 @@ REGISTER_SOUND_DRIVER_CLASS(LinuxParallel);
|
||||
|
||||
LightsDriver_LinuxParallel::LightsDriver_LinuxParallel()
|
||||
{
|
||||
// Give port's permissions and reset all bits to zero
|
||||
// Give ports permissions and reset all bits to zero
|
||||
ioperm( PORT_ADDRESS, 1, 1 );
|
||||
outb( 0, PORT_ADDRESS );
|
||||
}
|
||||
@@ -36,7 +34,7 @@ void LightsDriver_LinuxParallel::Set( const LightsState *ls )
|
||||
// Set LightState to port
|
||||
RString s;
|
||||
|
||||
// Prepare Screen Output too for debugging
|
||||
// Prepare screen output too for debugging
|
||||
s += "LinuxParallel Lights Driver Debug\n";
|
||||
s += "Lights Mode: " + LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n";
|
||||
|
||||
@@ -75,7 +73,6 @@ void LightsDriver_LinuxParallel::Set( const LightsState *ls )
|
||||
|
||||
/*
|
||||
* (c) 2004 Hugo Hromic M. <hhromic@udec.cl>
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
||||
@@ -20,7 +20,7 @@ void LightsDriver_SystemMessage::Set( const LightsState *ls )
|
||||
return;
|
||||
|
||||
RString s;
|
||||
|
||||
|
||||
s += LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n";
|
||||
|
||||
s += "Cabinet: ";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* LightsDriver_SystemMessage: Outputs light state as a system message. */
|
||||
#ifndef LightsDriver_SystemMessage_H
|
||||
#define LightsDriver_SystemMessage_H
|
||||
|
||||
@@ -8,7 +9,7 @@ class LightsDriver_SystemMessage : public LightsDriver
|
||||
public:
|
||||
LightsDriver_SystemMessage();
|
||||
virtual ~LightsDriver_SystemMessage();
|
||||
|
||||
|
||||
virtual void Set( const LightsState *ls );
|
||||
};
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ typedef short int (WINAPI ISDRIVERINSTALLED)();
|
||||
ISDRIVERINSTALLED* IsDriverInstalled = NULL;
|
||||
|
||||
const int LIGHTS_PER_PARALLEL_PORT = 8;
|
||||
// xxx: don't hardcode the port addresses. -aj
|
||||
const int MAX_PARALLEL_PORTS = 3;
|
||||
short LPT_ADDRESS[MAX_PARALLEL_PORTS] =
|
||||
{
|
||||
@@ -48,7 +49,7 @@ LightsDriver_Win32Parallel::LightsDriver_Win32Parallel()
|
||||
MessageBox(NULL, "Could not LoadLibrary( parallel_lights_io.dll ).", "ERROR", MB_OK );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Get the function pointers
|
||||
PortOut = (PORTOUT*) GetProcAddress(hDLL, "PortOut");
|
||||
IsDriverInstalled = (ISDRIVERINSTALLED*) GetProcAddress(hDLL, "IsDriverInstalled");
|
||||
@@ -83,7 +84,7 @@ void LightsDriver_Win32Parallel::Set( const LightsState *ls )
|
||||
data[lpt] &= ~mask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FOREACH_ENUM( GameController, gc )
|
||||
{
|
||||
FOREACH_ENUM( GameButton, gb )
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
* LightsDriver_Win32Parallel - Control lights with Kit 74:
|
||||
* http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=kit+74+relay
|
||||
*/
|
||||
/* LightsDriver_Win32Parallel - Control lights with Kit 74:
|
||||
* http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=kit+74+relay */
|
||||
|
||||
#ifndef LightsDriver_Win32Parallel_H
|
||||
#define LightsDriver_Win32Parallel_H
|
||||
@@ -13,7 +11,7 @@ class LightsDriver_Win32Parallel : public LightsDriver
|
||||
public:
|
||||
LightsDriver_Win32Parallel();
|
||||
virtual ~LightsDriver_Win32Parallel();
|
||||
|
||||
|
||||
virtual void Set( const LightsState *ls );
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user