SNES Super Scope support (port 2 only) More...
Macros | |
| #define | SSC_CURSOR 0x4000 |
| #define | SSC_FIRE 0x8000 |
| #define | SSC_NOISE 0x0100 |
| #define | SSC_OFFSCREEN 0x0200 |
| #define | SSC_PAUSE 0x1000 |
| #define | SSC_TURBO 0x2000 |
Functions | |
| u16 | scopeButtonsDown (void) |
| Get currently held buttons. | |
| u16 | scopeButtonsHeld (void) |
| Get buttons held past the hold delay threshold. | |
| u16 | scopeButtonsPressed (void) |
| Get newly pressed buttons this frame. | |
| void | scopeCalibrate (void) |
| Calibrate aim from a center-screen shot. | |
| u16 | scopeGetRawX (void) |
| Get raw (uncalibrated) H position from PPU. | |
| u16 | scopeGetRawY (void) |
| Get raw (uncalibrated) V position from PPU. | |
| u16 | scopeGetX (void) |
| Get calibration-adjusted H position. | |
| u16 | scopeGetY (void) |
| Get calibration-adjusted V position. | |
| u8 | scopeInit (void) |
| Detect Super Scope on port 2. | |
| u8 | scopeIsConnected (void) |
| Check if Super Scope is connected. | |
| void | scopeSetHoldDelay (u16 frames) |
| Set hold delay (frames before hold triggers). | |
| void | scopeSetRepeatDelay (u16 frames) |
| Set repeat delay (frames between repeat fires after hold). | |
| u16 | scopeSinceShot (void) |
| Get frames since last detected shot. | |
SNES Super Scope support (port 2 only)
The Super Scope is a light gun that uses the PPU H/V counter latch to determine aim position. It provides 4 buttons and 2 status flags.
| #define SSC_CURSOR 0x4000 |
Cursor button
| #define SSC_FIRE 0x8000 |
Fire button (trigger)
| #define SSC_NOISE 0x0100 |
Noise flag (no signal)
| #define SSC_OFFSCREEN 0x0200 |
Off-screen flag
| #define SSC_PAUSE 0x1000 |
Pause button
| #define SSC_TURBO 0x2000 |
Turbo switch
Get currently held buttons.
Get buttons held past the hold delay threshold.
After holding a button for holddelay frames, it triggers as "held". Then it re-triggers every repdelay frames.
Get newly pressed buttons this frame.
Calibrate aim from a center-screen shot.
Call this after the user fires at the center of the screen (128, 112). Computes calibration offsets: centerh = 128 - rawX, centerv = 112 - rawY. The NMI handler applies these offsets to all subsequent readings.
Get raw (uncalibrated) H position from PPU.
Get raw (uncalibrated) V position from PPU.
Get calibration-adjusted H position.
Get calibration-adjusted V position.
Detect Super Scope on port 2.
Checks the auto-joypad device signature on port 2. If a Super Scope is found, enables reading in the NMI handler and sets default hold/repeat delays (60/20 frames).
Set hold delay (frames before hold triggers).
| frames | Number of frames (default: 60 = 1 second at 60Hz) |
Set repeat delay (frames between repeat fires after hold).
| frames | Number of frames (default: 20) |