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: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Create page and add all memory locations)
 
(Document all the memory locations.)
Line 4: Line 4:


===<tt>$7E0065</tt>: Latest controller1 data <span class="anchor" id="$7E0065"></span> ===
===<tt>$7E0065</tt>: Latest controller1 data <span class="anchor" id="$7E0065"></span> ===
Most recently read input from controller1, masked by <tt>#$fff0</tt>, the bits expected to be valid for a standard SNES controller. Contains the OR of both controller1 and controller2 data if <tt>$7E436C</tt> is <tt>#$0000</tt>.


===<tt>$7E0067</tt>: Latest controller2 data <span class="anchor" id="$7E0067"></span> ===
===<tt>$7E0067</tt>: Latest controller2 data <span class="anchor" id="$7E0067"></span> ===
Most recently read input from controller2, masked by <tt>#$fff0</tt>, the bits expected to be valid for a standard SNES controller.


===<tt>$7E0069</tt>: Controller1 data with repeat pulses <span class="anchor" id="$7E0069"></span> ===
===<tt>$7E0069</tt>: Controller1 data with repeat pulses <span class="anchor" id="$7E0069"></span> ===
Contains <tt>#$0000</tt> 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|<tt>$7E006D</tt>]]) that were not set on the previous frame. When controller1 input has not changed for 15 frames, contains all controller1 data ([[#$7E0065|<tt>$7E0065</tt>]]) only every four frames.
Contains the OR of both controller1 and controller2 values if <tt>$7E436C</tt> is <tt>#$0000</tt>.


===<tt>$7E006B</tt>: Controller2 data with repeat pulses <span class="anchor" id="$7E006B"></span> ===
===<tt>$7E006B</tt>: Controller2 data with repeat pulses <span class="anchor" id="$7E006B"></span> ===
Contains <tt>#$0000</tt> 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|<tt>$7E006F</tt>]]) that were not set on the previous frame. When controller2 input has not changed for 15 frames, contains all controller2 data ([[#$7E0067|<tt>$7E0067</tt>]]) only every four frames.


===<tt>$7E006D</tt>: New controller1 data <span class="anchor" id="$7E006D"></span> ===
===<tt>$7E006D</tt>: New controller1 data <span class="anchor" id="$7E006D"></span> ===
Contains newly set controller1 data bits that were not set on the previous frame. Contains the OR of both controller1 and controller2 values if <tt>$7E436C</tt> is <tt>#$0000</tt>.


===<tt>$7E006F</tt>: New controller2 data <span class="anchor" id="$7E006F"></span> ===
===<tt>$7E006F</tt>: New controller2 data <span class="anchor" id="$7E006F"></span> ===
Contains newly set controller2 data bits that were not set on the previous frame.


===<tt>$7E0071</tt>: Num frames until next controller1 pulse <span class="anchor" id="$7E0071"></span> ===
===<tt>$7E0071</tt>: Num frames until next controller1 pulse <span class="anchor" id="$7E0071"></span> ===
Number of remaining frames of no change to controller1 data before the data will next be pulsed to [[#$7E0069|<tt>$7E0069</tt>]].


===<tt>$7E0073</tt>: Num frames until next controller2 pulse <span class="anchor" id="$7E0073"></span> ===
===<tt>$7E0073</tt>: Num frames until next controller2 pulse <span class="anchor" id="$7E0073"></span> ===
Number of remaining frames of no change to controller2 data before the data will next be pulsed to [[#$7E006B|<tt>$7E006B</tt>]].


===<tt>$7E0075</tt>: Controller data <span class="anchor" id="$7E0075"></span> ===
===<tt>$7E0075</tt>: Controller data <span class="anchor" id="$7E0075"></span> ===
Same as [[#$7E0065|<tt>$7E0065</tt>]]. Most likely only intended as a temporary storage location during controller input processing.


===<tt>$7E0077</tt>: Raw controller1 data <span class="anchor" id="$7E0077"></span> ===
===<tt>$7E0077</tt>: Raw controller1 data <span class="anchor" id="$7E0077"></span> ===
Most recently read raw input from controller1.


===<tt>$7E0079</tt>: Raw controller2 data <span class="anchor" id="$7E0079"></span> ===
===<tt>$7E0079</tt>: Raw controller2 data <span class="anchor" id="$7E0079"></span> ===
Most recently read raw input from controller2.


===<tt>$7E007B</tt>: Controller playback/record status <span class="anchor" id="$7E007B"></span> ===
===<tt>$7E007B</tt>: Controller playback/record status <span class="anchor" id="$7E007B"></span> ===
Status bit flags for controller playback and record. Format:
<code>RPxxxxxx</code>
If <tt>R</tt> is <code>1</code>, controller input is currently being recorded.
If <tt>P</tt> is <code>1</code>, controller input is being overridden using the data in a record table.


===<tt>$7E007D-$7E0080</tt>: Long pointer to record table entry for playback <span class="anchor" id="$7E007D"></span> ===
===<tt>$7E007D-$7E0080</tt>: Long pointer to record table entry for playback <span class="anchor" id="$7E007D"></span> ===
24-bit long pointer to the current entry in a record table being used for overriding controller input.


===<tt>$7E0081</tt>: Num frames remaining for current playback value <span class="anchor" id="$7E0081"></span> ===
===<tt>$7E0081</tt>: Num frames remaining for current playback value <span class="anchor" id="$7E0081"></span> ===
Number of frames remaining to override controller input with the value in [[#$7E0083|<tt>$7E0083</tt>]] 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 (<code>[$7E0081] & #$00FF</code>).


===<tt>$7E0083</tt>: Current playback value <span class="anchor" id="$7E0083"></span> ===
===<tt>$7E0083</tt>: Current playback value <span class="anchor" id="$7E0083"></span> ===
Current value being used to override controller input. On loading a new record table entry, set to bytes 2 and 3 of the entry (<code>[$7E0081], #$0001</code>).


===<tt>$7E0085-$7E0088</tt>: Long pointer to record table entry for record <span class="anchor" id="$7E0085"></span> ===
===<tt>$7E0085-$7E0088</tt>: Long pointer to record table entry for record <span class="anchor" id="$7E0085"></span> ===
24-bit long pointer to the current entry in a record table being used for recording controller input.


===<tt>$7E0089</tt>: Num frames current controller data has been recording <span class="anchor" id="$7E0089"></span> ===
===<tt>$7E0089</tt>: Num frames current controller data has been recording <span class="anchor" id="$7E0089"></span> ===
Number of frames the value in [[#$7E008B|<tt>$7E008B</tt>]] has been recording from controller input.


===<tt>$7E008B</tt>: Current controller data being recorded <span class="anchor" id="$7E008B"></span> ===
===<tt>$7E008B</tt>: Current controller data being recorded <span class="anchor" id="$7E008B"></span> ===
Current value being recorded from controller input.


==Record Table Format <span class="anchor" id="Record table format"></span> ==
==Record Table Format <span class="anchor" id="Record table format"></span> ==

Revision as of 02:21, 7 June 2023

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?