com.monkeycoder.monkeynes.hardware
Class NesJoypad

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.hardware.NesJoypad
All Implemented Interfaces:
NesController

public class NesJoypad
extends Object
implements NesController

This is the Original NES Joypad, a small square Joypad with 4-directional D-Pad, B and A buttons, and Start and Select buttons.

Originally part of the MonkeyNES project.

Author:
David Stephens

Field Summary
static int BUTTON_A
           
static int BUTTON_B
           
static int BUTTON_COUNT
           
static int BUTTON_DPAD_DOWN
           
static int BUTTON_DPAD_LEFT
           
static int BUTTON_DPAD_RIGHT
           
static int BUTTON_DPAD_UP
           
static int BUTTON_SELECT
           
static int BUTTON_START
           
 
Fields inherited from interface com.monkeycoder.monkeynes.hardware.NesController
TYPE_JOYPAD, TYPE_NONE
 
Constructor Summary
NesJoypad()
          Creates a new NesJoypad.
 
Method Summary
 void clearStrobe()
          Clears the strobe on this controller.
 int getNextButtonValue()
          Gets the value of the next button.
 int getType()
          Returns the type of this controller.
 String getTypeName()
          Returns the name of this type of controller.
 void resetStrobe()
          Resets the strobe on this controller.
 void setButtonValue(int inButton, int inValue)
          Sets the value of a specific button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTON_A

public static final int BUTTON_A
See Also:
Constant Field Values

BUTTON_B

public static final int BUTTON_B
See Also:
Constant Field Values

BUTTON_SELECT

public static final int BUTTON_SELECT
See Also:
Constant Field Values

BUTTON_START

public static final int BUTTON_START
See Also:
Constant Field Values

BUTTON_DPAD_UP

public static final int BUTTON_DPAD_UP
See Also:
Constant Field Values

BUTTON_DPAD_DOWN

public static final int BUTTON_DPAD_DOWN
See Also:
Constant Field Values

BUTTON_DPAD_LEFT

public static final int BUTTON_DPAD_LEFT
See Also:
Constant Field Values

BUTTON_DPAD_RIGHT

public static final int BUTTON_DPAD_RIGHT
See Also:
Constant Field Values

BUTTON_COUNT

public static final int BUTTON_COUNT
See Also:
Constant Field Values
Constructor Detail

NesJoypad

public NesJoypad()
Creates a new NesJoypad.

Method Detail

getType

public int getType()
Description copied from interface: NesController
Returns the type of this controller.

Specified by:
getType in interface NesController
Returns:
The type number of this controller.

getTypeName

public String getTypeName()
Description copied from interface: NesController
Returns the name of this type of controller.

Specified by:
getTypeName in interface NesController
Returns:
The name of this type of controller.

setButtonValue

public void setButtonValue(int inButton,
                           int inValue)
Description copied from interface: NesController
Sets the value of a specific button.

Specified by:
setButtonValue in interface NesController
Parameters:
inButton - The button whose value is being set.
inValue - The value being set.

resetStrobe

public void resetStrobe()
Description copied from interface: NesController
Resets the strobe on this controller.

Specified by:
resetStrobe in interface NesController

clearStrobe

public void clearStrobe()
Description copied from interface: NesController
Clears the strobe on this controller.

Specified by:
clearStrobe in interface NesController

getNextButtonValue

public int getNextButtonValue()
Description copied from interface: NesController
Gets the value of the next button.

Specified by:
getNextButtonValue in interface NesController
Returns:
The value of the next button.