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/ASM/Controller Input Routines: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Start creating page)
 
(Add another subroutine and start renaming things from joypad to controller because I changed my mind)
Line 1: Line 1:
{{subpage|game=EarthBound}}
{{subpage|game=EarthBound}}


==<tt>$C083B8-$C083C0</tt>: Clear joypad playback/record==
==<tt>$C083B8-$C083C0</tt>: Clear controller playback/record==
Clears all input playback and record status bit flags stored in [[EarthBound:Joypad input memory#$7E007B|<tt>$7E007B</tt>]].
Clears all controller playback and record status bit flags stored in [[EarthBound:Controller input memory#$7E007B|<tt>$7E007B</tt>]].


==<tt>$C083C1-$C083E2</tt>: Start joypad record==
==<tt>$C083C1-$C083E2</tt>: Start controller record==
Begins recording joypad data to a table at the input pointer. See [[EarthBound:Joypad input memory#Record table format|record table format]]. Initializes relevant [[EarthBound:Joypad input memory|memory]] including setting the record active bit flag in [[EarthBound:Joypad input memory#$7E007B|<tt>$7E007B</tt>]].
Begins recording controller data to a table at the input pointer. See [[EarthBound:Controller input memory#Record table format|record table format]]. Initializes relevant [[EarthBound:Controller input memory|memory]] including setting the record active bit flag in [[EarthBound:Controller input memory#$7E007B|<tt>$7E007B</tt>]].


''Note: In an unmodified EarthBound ROM, this appears to only ever be called from a routine within the debug block.''
''Note: In an unmodified EarthBound ROM, this appears to only ever be called from a subroutine within the debug block.''


===Inputs===
===Inputs===
* <tt>$0e..$11</tt>: Long pointer to start of record table
* <tt>$0e..$11</tt>: Long pointer to start of record table


==<tt>$C083E3-$C0841A</tt>: Start joypad playback==
==<tt>$C083E3-$C0841A</tt>: Start controller playback==
If playback is not already active, begins overriding joypad data per the table at the input pointer. See [[EarthBound:Joypad input memory#Record table format|record table format]]. Initializes relevant [[EarthBound:Joypad input memory|memory]] including setting the playback active bit flag in [[EarthBound:Joypad input memory#$7E007B|<tt>$7E007B</tt>]].
If playback is not already active, begins overriding controller data per the table at the input pointer. See [[EarthBound:Controller input memory#Record table format|record table format]]. Initializes relevant [[EarthBound:Controller input memory|memory]] including setting the playback active bit flag in [[EarthBound:Controller input memory#$7E007B|<tt>$7E007B</tt>]].


===Inputs===
===Inputs===
* <tt>$0e..$11</tt>: Long pointer to start of record table
* <tt>$0e..$11</tt>: Long pointer to start of record table
==<tt>$C0841B-$C08455</tt>: Read raw controller data (or playback)==
Write controller data to [[EarthBound:Controller input memory#$7E0077|<tt>$7E0077</tt>]] and [[EarthBound:Controller input memory#$7E0079|<tt>$7E0079</tt>]]. If playback is active (as indicated by the playback active bit flag in [[EarthBound:Controller input memory#$7E007B|<tt>$7E007B</tt>]]), sets the data per the controller playback [[EarthBound:Controller input memory|memory]] and updates the memory accordingly. Otherwise, reads the actual controller data using [https://snes.nesdev.org/wiki/Controller_reading SNES controller automatic read].
''Note: Subroutine expects to always be called with Data Bank set to #$00 and Data Page set to #$0000.''


[[Category:EarthBound:ASM|Joypad Input Routines]]
[[Category:EarthBound:ASM|Joypad Input Routines]]
{{Internal Data|game=EarthBound}}
{{Internal Data|game=EarthBound}}
{{stub}}
{{stub}}

Revision as of 01:58, 6 June 2023

This is a sub-page of EarthBound/ASM.

$C083B8-$C083C0: Clear controller playback/record

Clears all controller playback and record status bit flags stored in $7E007B.

$C083C1-$C083E2: Start controller record

Begins recording controller data to a table at the input pointer. See record table format. Initializes relevant memory including setting the record active bit flag in $7E007B.

Note: In an unmodified EarthBound ROM, this appears to only ever be called from a subroutine within the debug block.

Inputs

  • $0e..$11: Long pointer to start of record table

$C083E3-$C0841A: Start controller playback

If playback is not already active, begins overriding controller data per the table at the input pointer. See record table format. Initializes relevant memory including setting the playback active bit flag in $7E007B.

Inputs

  • $0e..$11: Long pointer to start of record table

$C0841B-$C08455: Read raw controller data (or playback)

Write controller data to $7E0077 and $7E0079. If playback is active (as indicated by the playback active bit flag in $7E007B), sets the data per the controller playback memory and updates the memory accordingly. Otherwise, reads the actual controller data using SNES controller automatic read.

Note: Subroutine expects to always be called with Data Bank set to #$00 and Data Page set to #$0000.

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