Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

EarthBound/Controller input memory

From Data Crystal
< EarthBound
Revision as of 02:21, 7 June 2023 by Esorth (talk | contribs) (Document all the memory locations.)
Jump to navigation Jump to search

This is a sub-page of EarthBound.

Memory Locations

$7E0065: Latest controller1 data

Most recently read input from controller1, masked by #$fff0, the bits expected to be valid for a standard SNES controller. Contains the OR of both controller1 and controller2 data if $7E436C is #$0000.

$7E0067: Latest controller2 data

Most recently read input from controller2, masked by #$fff0, the bits expected to be valid for a standard SNES controller.

$7E0069: Controller1 data with repeat pulses

Contains #$0000 except when controller1 input changes or has stayed stable. Whenever controller1 input changes, for one frame only, contains just the newly set controller data bits ($7E006D) that were not set on the previous frame. When controller1 input has not changed for 15 frames, contains all controller1 data ($7E0065) only every four frames.

Contains the OR of both controller1 and controller2 values if $7E436C is #$0000.

$7E006B: Controller2 data with repeat pulses

Contains #$0000 except when controller2 input changes or has stayed stable. Whenever controller2 input changes, for one frame only, contains just the newly set controller data bits ($7E006F) that were not set on the previous frame. When controller2 input has not changed for 15 frames, contains all controller2 data ($7E0067) only every four frames.

$7E006D: New controller1 data

Contains newly set controller1 data bits that were not set on the previous frame. Contains the OR of both controller1 and controller2 values if $7E436C is #$0000.

$7E006F: New controller2 data

Contains newly set controller2 data bits that were not set on the previous frame.

$7E0071: Num frames until next controller1 pulse

Number of remaining frames of no change to controller1 data before the data will next be pulsed to $7E0069.

$7E0073: Num frames until next controller2 pulse

Number of remaining frames of no change to controller2 data before the data will next be pulsed to $7E006B.

$7E0075: Controller data

Same as $7E0065. Most likely only intended as a temporary storage location during controller input processing.

$7E0077: Raw controller1 data

Most recently read raw input from controller1.

$7E0079: Raw controller2 data

Most recently read raw input from controller2.

$7E007B: Controller playback/record status

Status bit flags for controller playback and record. Format: RPxxxxxx

If R is 1, controller input is currently being recorded.

If P is 1, controller input is being overridden using the data in a record table.

$7E007D-$7E0080: Long pointer to record table entry for playback

24-bit long pointer to the current entry in a record table being used for overriding controller input.

$7E0081: Num frames remaining for current playback value

Number of frames remaining to override controller input with the value in $7E0083 before moving on to the next entry in the record table. On loading a new record table entry, set to the first byte of the entry ([$7E0081] & #$00FF).

$7E0083: Current playback value

Current value being used to override controller input. On loading a new record table entry, set to bytes 2 and 3 of the entry ([$7E0081], #$0001).

$7E0085-$7E0088: Long pointer to record table entry for record

24-bit long pointer to the current entry in a record table being used for recording controller input.

$7E0089: Num frames current controller data has been recording

Number of frames the value in $7E008B has been recording from controller input.

$7E008B: Current controller data being recorded

Current value being recorded from controller input.

Record Table Format

So very stubbly.
This page is rather stubbly and could use some expansion.
Are you a bad enough dude to rescue this article?