@NoOffset @Properties(inherit=ale.class) public class Controller extends Pointer
------------- \ 1 2 3 4 5 / \ 6 7 8 9 / ---------
Left Controller Right Controller
pin 1 D4 PIA SWCHA D0 PIA SWCHA pin 2 D5 PIA SWCHA D1 PIA SWCHA pin 3 D6 PIA SWCHA D2 PIA SWCHA pin 4 D7 PIA SWCHA D3 PIA SWCHA pin 5 D7 TIA INPT1 (Dumped) D7 TIA INPT3 (Dumped) pin 6 D7 TIA INPT4 (Latched) D7 TIA INPT5 (Latched) pin 7 +5 +5 pin 8 GND GND pin 9 D7 TIA INPT0 (Dumped) D7 TIA INPT2 (Dumped)
Each of the pins connected to the PIA can be configured as an input or output pin. The "dumped" TIA pins are used to charge a capacitor. A potentiometer is sometimes connected to these pins for analog input.
This is a base class for all controllers. It provides a view of the controller from the perspective of the controller's jack.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Modifier and Type | Field and Description |
|---|---|
static int |
AtariVox
enum Controller::Type
|
static int |
BoosterGrip
enum Controller::Type
|
static int |
Driving
enum Controller::Type
|
static int |
Five
enum Controller::AnalogPin
|
static int |
Four
enum Controller::DigitalPin
|
static int |
Joystick
enum Controller::Type
|
static int |
Keyboard
enum Controller::Type
|
static int |
Left
enum Controller::Jack
|
static int |
maximumResistance |
static int |
minimumResistance |
static int |
Nine
enum Controller::AnalogPin
|
static int |
One
enum Controller::DigitalPin
|
static int |
Paddles
enum Controller::Type
|
static int |
Right
enum Controller::Jack
|
static int |
Six
enum Controller::DigitalPin
|
static int |
Three
enum Controller::DigitalPin
|
static int |
TrakBall
enum Controller::Type
|
static int |
Two
enum Controller::DigitalPin
|
| Constructor and Description |
|---|
Controller(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
maximumResistance()
Constant which represents maximum resistance for analog pins
|
static int |
minimumResistance()
Constant which represents minimum resistance for analog pins
|
boolean |
read(int pin)
Read the value of the specified digital pin for this controller.
|
void |
setSystem(System system)
Inform this controller about the current System.
|
int |
type()
Returns the type of this controller.
|
void |
write(int pin,
boolean value)
Write the given value to the specified digital pin for this
controller.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getPointer, getPointer, getPointer, getPointer, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, offsetof, parseBytes, physicalBytes, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic static final int Left
public static final int Right
public static final int BoosterGrip
public static final int Driving
public static final int Keyboard
public static final int Paddles
public static final int Joystick
public static final int TrakBall
public static final int AtariVox
public static final int One
public static final int Two
public static final int Three
public static final int Four
public static final int Six
public static final int Five
public static final int Nine
public static final int maximumResistance
public static final int minimumResistance
public Controller(Pointer p)
Pointer.Pointer(Pointer).public void setSystem(System system)
@Cast(value="bool") public boolean read(@Cast(value="Controller::DigitalPin") int pin)
pin - The pin of the controller jack to readpublic void write(@Cast(value="Controller::DigitalPin") int pin, @Cast(value="bool") boolean value)
pin - The pin of the controller jack to write tovalue - The value to write to the pin@MemberGetter @Cast(value="const Int32") public static int maximumResistance()
@MemberGetter @Cast(value="const Int32") public static int minimumResistance()
Copyright © 2020. All rights reserved.