summaryrefslogtreecommitdiff
path: root/src/docs/tasd-spec-0001.xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/docs/tasd-spec-0001.xml')
-rw-r--r--src/docs/tasd-spec-0001.xml1978
1 files changed, 1978 insertions, 0 deletions
diff --git a/src/docs/tasd-spec-0001.xml b/src/docs/tasd-spec-0001.xml
new file mode 100644
index 0000000..49d2642
--- /dev/null
+++ b/src/docs/tasd-spec-0001.xml
@@ -0,0 +1,1978 @@
+<?xml version='1.0' encoding='utf-8'?>
+<rfc
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ category="info"
+ docName="draft-tasd-v0001-00"
+ ipr="none"
+ obsoletes=""
+ updates=""
+ submissionType="independent"
+ xml:lang="en"
+ tocInclude="true"
+ tocDepth="4"
+ symRefs="true"
+ sortRefs="true"
+ version="3">
+ <front>
+ <title abbrev="TASD File Format Specification">TASD File Format Specification Version 1</title>
+ <seriesInfo name="Internet-Draft" stream="independent" value="draft-tasd-v0001-00" status="informational"/>
+ <author fullname="Vi Grey" initials="V." surname="Grey">
+ <address>
+ <email>vi@vigrey.com</email>
+ <uri>https://vigrey.com</uri>
+ </address>
+ </author>
+ <author fullname="Bigbass" surname="Bigbass">
+ <address>
+ <uri>https://github.com/bigbass1997</uri>
+ </address>
+ </author>
+ <author fullname="rasteri" surname="rasteri">
+ <address>
+ <uri>https://github.com/rasteri</uri>
+ </address>
+ </author>
+ <date year="2025"/>
+ <area>General</area>
+ <workgroup>Independent TAS Console Replay Research Group</workgroup>
+ <abstract>
+ <t>The <strong>TASD</strong> file format is used for storing "Tool Assisted Speedrun" or "Tool Assisted Superplay" (TAS) input and configuration data for use with devices (known as "TAS replay devices") that replay inputs on physical video game hardware. The format is defined to be expandable for future needs. The format is also defined to be parsable by programs that do not understand portions of the format, whether that is due to incomplete support of the format specification or due to new features being added to later versions of the specification.</t>
+ <t>This document defines the file format specification for <strong>TASD</strong> files.</t>
+ </abstract>
+ </front>
+ <middle>
+ <section anchor="introduction" numbered="true" toc="default">
+ <name>Introduction</name>
+ <t>The Tool Assisted Speedrun Dump (<strong>TASD</strong>) interchange format is a file format for storing data that enables "Tool Assisted Speedruns" or "Tool Assisted Superplays" to be played on physical video game hardware using TAS replay devices. Created to be hardware and software agnostic, the <strong>TASD</strong> interchange format uses a key-based, binary, packet format to break up pieces of information into easily-parsable and forward-compatible chunks. The format is extensible by simply defining additional keys or value types as necessary. When parsing the file, software can skip any packets whose key is unknown or unsupported.</t>
+ <t>Packets of a given type can be used multiple times or completely omitted as needed. This reusability eliminates the need of a predefined delimiter to separate pieces of data.</t>
+ <t>While files generated by emulator dump scripts should provide as much information as possible, they may be unable to provide everything. Since packets are optional, the file can be expanded later with any additional data as desired. No intermediary file format is necessary.</t>
+ <section numbered="true" toc="default">
+ <name>Overview and Preliminaries</name>
+ <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
+ <section numbered="true" toc="default">
+ <name>Notation and Vocabulary</name>
+ <t>Data Types:</t>
+ <ul spacing="compact" empty="true">
+ <li>(S) = String</li>
+ <li>(A) = Binary Data</li>
+ <li>(I) = Signed Integer</li>
+ <li>(N) = Unsigned Integer</li>
+ <li>(B) = Boolean</li>
+ <li>([]N) = List of Unsigned Integers</li>
+ </ul>
+ <t>Unless specified otherwise, all multi-octet integers are big-endian.</t>
+ <t>We use the terms <strong>byte</strong> and <strong>octet</strong> interchangeably in this document.</t>
+ <t>We use the terms <strong>Tool Assisted Speedrun</strong>, <strong>Tool Assisted Superplay</strong> and <strong>TAS</strong> interchangeably in this document.</t>
+ <t>In subsections of (<xref target="descriptions"/>), the term "in direct form" is used. That term is defined to mean a packet in a <strong>TASD</strong> file directly (first order packet) rather than a packet inside a TRANSITION or MOVIE_TRANSITION packet (second order packet).</t>
+ <t>String values <bcp14>MUST</bcp14> use UTF-8 encoding. As such, string values <bcp14>MAY</bcp14> contain any number of NUL characters and do not make use of "null termination". If an example of a string value is given, the example will be between quotation marks. The quotation marks are not included in the string. Not all content between quotations will be string value examples, so be aware of that when continuing through this document.</t>
+ <t>Both unsigned and signed integers can have different bit widths. For instance, an 8-bit integer can be used in one part of the specification and a 64-bit integer can be used in another part of the specification.</t>
+ <t>Variable-length integer encoding (also known as VarInt or VLQ) is not used in this format. Instead, arbitrarily sized integers, like those used in <xref target="packets"/>, are prefixed with a single octet that specifies the number of octets used to contain the integer value. In most cases, this is less space-efficient than VarInt encoding, but it is simpler to understand and to parse.</t>
+ <t>Boolean values <bcp14>MUST</bcp14> be a single octet with the value of <tt>0</tt> for <strong>FALSE</strong> or <tt>1</tt> for <strong>TRUE</strong>.</t>
+ <dl>
+ <dt><tt>[N octets]</tt></dt> <dd>A sequence of octets with a length of N</dd>
+ <dt><tt>[00 7F FF]</tt></dt> <dd>A sequence of octets <tt>00</tt>, <tt>7F</tt>, and <tt>FF</tt> in that order.</dd>
+ <dt><strong>0-indexed</strong></dt> <dd>When counting sequentially, start counting at 0.</dd>
+ <dt><strong>1-indexed</strong></dt> <dd>When counting sequentially, start counting at 1.</dd>
+ </dl>
+ <t>In packet diagrams, a single octet is represented with a box like this:</t>
+ <artwork><![CDATA[
+ +-----+
+ | Var | <-- Vertical bars MAY be missing
+ +-----+]]>
+ </artwork>
+ <ul spacing="compact" empty="true">
+ <li><strong>Var</strong> is a variable name.</li>
+ </ul>
+ <t>In packet diagrams, an arbitrary number of octets are represented with a box like this:</t>
+ <artwork><![CDATA[
+ +=====+
+ | Var |
+ +=====+]]>
+ </artwork>
+ <ul spacing="compact" empty="true">
+ <li><strong>Var</strong> is a variable name.</li>
+ </ul>
+ <t>In packet diagrams, boxes can be connected like these examples:</t>
+ <artwork><![CDATA[
+ +-----------+-----------+
+ | Var 1 (B) | Var 2 (I) |
+ +-----------+-----------+]]>
+ </artwork>
+ <ul spacing="compact" empty="true">
+ <li>In this example, <strong>Var 1</strong> is a 1 octet long boolean value and <strong>Var 2</strong> is a 1 octet long signed integer.</li>
+ </ul>
+ <artwork><![CDATA[
+ +-----+-----+===========+
+ | Var 1 (N) | Var 2 (S) |
+ +-----+-----+===========+]]>
+ </artwork>
+ <ul spacing="compact" empty="true">
+ <li>In this example, <strong>Var 1</strong> is a 2 octet long unsigned integer and <strong>Var 2</strong> is an arbitrary octet length string.</li>
+ </ul>
+ <t>In packet diagrams, boxes <bcp14>MAY</bcp14> have relative offset values above them like in the following example:</t>
+ <artwork><![CDATA[
+ 0 1 2...
+ +-----+-----+===========+
+ | Var 1 (N) | Var 2 (S) |
+ +-----+-----+===========+]]>
+ </artwork>
+ <ul spacing="compact" empty="true">
+ <li>In this example, <strong>Var 1</strong> is a 2 octet long unsigned integer and <strong>Var 2</strong> is an arbitrary octet length string.</li>
+ </ul>
+ <t>Packet diagrams <bcp14>MAY</bcp14> be split into multiple lined sections like in the following example:</t>
+ <artwork><![CDATA[
+ 0 1 2 3
+ +-----------+-----------+-----------+-----------+
+ | Var 1 (N) | Var 2 (I) | Var 3 (B) | Var 4 (I) | ...
+ +-----------+-----------+-----------+-----------+
+ 4 5
+ +-----------+===========+
+ | Var 5 (N) | Var 6 (S) |
+ +-----------+===========+]]>
+ </artwork>
+ <ul spacing="compact" empty="true">
+ <li>In this example, the packet diagram contains enough variable boxes to require being split into 2 sections, in order to maintain consistent horizontal spacing in this document. The packet diagram is separated by an ellipsis (<tt>...</tt>) on the same text row as the variable names to signify that the packet diagram is continuing.</li>
+ </ul>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Motivations</name>
+ <t>This file format's primary goal is to provide a comprehensive and replay device agnostic TAS input dump format that is usable for any console. Additional goals include:</t>
+ <ul>
+ <li>No intermediary formats</li>
+ <li>Forward compatibility</li>
+ <li>High extensibility</li>
+ <li>Ability to easily generate using lua scripting in emulators</li>
+ </ul>
+ <t>Consideration is also given to how usable the format would be for the software that interacts with replay devices (examples: methods of ingestion/parsing, ease of ingestion/parsing in various languages).</t>
+ <section numbered="true" toc="default">
+ <name>Problems With Existing Formats</name>
+ <t>Existing formats are either incomplete for some verification needs or don't exist at all for some consoles. For example, a format commonly used for NES console verifications (r08) only encodes 2 standard controllers worth of sequential data. The format doesn't indicate whether those inputs are per latch or per frame. It also doesn't contain <strong>RESET</strong> timing information, additional settings, or metadata. Non-standard controllers, such as the NES Zapper, aren't supported either.</t>
+ <t>Until now, controller input formats were written in a way that was "good enough" for each use case, but rarely in a "standard" way. Often, any additional data had to be supplied separately as command-line arguments. While that process may work for a specific device, it's less than ideal when it comes time to redistribute the replay data so that others (especially those using different replay devices) can also successfully replay the same TAS.</t>
+ </section>
+ </section>
+ </section>
+
+ <section numbered="true" toc="default">
+ <name>Structure</name>
+ <t><strong>TASD</strong> files <bcp14>MUST</bcp14> begin with a header. The header <bcp14>MUST</bcp14> be followed by <strong>0 or more</strong> packets.</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6 7...
+ +-+-+-+-+-+-+-+=============+
+ | Header (A) | Packets (A) |
+ +-+-+-+-+-+-+-+=============+
+
+ Header (Binary Data) [7 octets]
+ Packets (Binary Data) [? octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Header</strong></dt>
+ <dd>7 octet header as defined in <xref target="header"/>.</dd>
+ <dt><strong>Packets</strong></dt>
+ <dd>List of 0 or more packets. Refer to <xref target="packets"/> for packet definitions.</dd>
+ </dl>
+ </section>
+
+ <section numbered="true" toc="default" anchor="header">
+ <name>Header</name>
+ <t>The <strong>TASD</strong> file header <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6
+ +----+----+----+----+------+------+--------------+
+ | Magic Number (A) | Version (N) | G_KEYLEN (N) |
+ +----+----+----+----+------+------+--------------+
+
+ Magic Number (Binary Data) [4 octets]
+ Version (Unsigned Integer) [2 octets]
+ G_KEYLEN (Unsigned Integer) [1 octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Magic Number</strong></dt>
+ <dd>4 octet value that <bcp14>MUST</bcp14> be <tt>[54 41 53 44]</tt> (ASCII value <tt>TASD</tt>).</dd>
+ <dt><strong>Version</strong></dt>
+ <dd>Version of the <strong>TASD</strong> file format. Version currently <bcp14>MUST</bcp14> be a value of 1, but <bcp14>SHOULD</bcp14> be incremented in future versions.</dd>
+ <dt><strong>G_KEYLEN</strong></dt>
+ <dd>Global length of <strong>Key</strong> values of packets. G_KEYLEN currently <bcp14>MUST</bcp14> be a value of 2.</dd>
+ </dl>
+ </section>
+
+ <section numbered="true" toc="default" anchor="packets">
+ <name>Packets</name>
+ <t>Each packet <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ +=========+----------+==========+=============+
+ | Key (A) | PEXP (N) | PLEN (N) | Payload (A) |
+ +=========+----------+==========+=============+
+
+ Key (Binary Data) [G_KEYLEN octets]
+ PEXP (Unsigned Integer) [1 octet]
+ PLEN (Unsigned Integer) [PEXP octets]
+ Payload (Binary Data) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Key</strong></dt>
+ <dd>Packet type (Packet key).</dd>
+ <dt><strong>PEXP</strong></dt>
+ <dd>Length of <strong>PLEN</strong>. <strong>PEXP</strong> <bcp14>MUST</bcp14> be a value greater than 0.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of <strong>Payload</strong>.</dd>
+ <dt><strong>Payload</strong></dt>
+ <dd>Payload/Content of the packet.</dd>
+ <dt><strong>G_KEYLEN</strong></dt>
+ <dd>Length of <strong>Key</strong> in each packet and is specified in the <strong>TASD</strong> file header.</dd>
+ </dl>
+ <t>All packets are <bcp14>OPTIONAL</bcp14>.</t>
+ <section numbered="true" toc="default">
+ <name>Assigned Packet Keys Without Descriptions</name>
+ <section numbered="true" toc="default">
+ <name>General Keys</name>
+ <dl spacing="compact">
+ <dt><tt>[00 01]</tt></dt> <dd>CONSOLE_TYPE</dd>
+ <dt><tt>[00 02]</tt></dt> <dd>CONSOLE_REGION</dd>
+ <dt><tt>[00 03]</tt></dt> <dd>GAME_TITLE</dd>
+ <dt><tt>[00 04]</tt></dt> <dd>ROM_NAME</dd>
+ <dt><tt>[00 05]</tt></dt> <dd>ATTRIBUTION</dd>
+ <dt><tt>[00 06]</tt></dt> <dd>CATEGORY</dd>
+ <dt><tt>[00 07]</tt></dt> <dd>EMULATOR_NAME</dd>
+ <dt><tt>[00 08]</tt></dt> <dd>EMULATOR_VERSION</dd>
+ <dt><tt>[00 09]</tt></dt> <dd>EMULATOR_CORE</dd>
+ <dt><tt>[00 0A]</tt></dt> <dd>TAS_LAST_MODIFIED</dd>
+ <dt><tt>[00 0B]</tt></dt> <dd>DUMP_CREATED</dd>
+ <dt><tt>[00 0C]</tt></dt> <dd>DUMP_LAST_MODIFIED</dd>
+ <dt><tt>[00 0D]</tt></dt> <dd>TOTAL_FRAMES</dd>
+ <dt><tt>[00 0E]</tt></dt> <dd>RERECORDS</dd>
+ <dt><tt>[00 0F]</tt></dt> <dd>SOURCE_LINK</dd>
+ <dt><tt>[00 10]</tt></dt> <dd>BLANK_FRAMES</dd>
+ <dt><tt>[00 11]</tt></dt> <dd>VERIFIED</dd>
+ <dt><tt>[00 12]</tt></dt> <dd>MEMORY_INIT</dd>
+ <dt><tt>[00 13]</tt></dt> <dd>GAME_IDENTIFIER</dd>
+ <dt><tt>[00 14]</tt></dt> <dd>MOVIE_LICENSE</dd>
+ <dt><tt>[00 15]</tt></dt> <dd>MOVIE_FILE</dd>
+ <dt><tt>[00 F0]</tt></dt> <dd>PORT_CONTROLLER</dd>
+ <dt><tt>[00 F1]</tt></dt> <dd>PORT_OVERREAD</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>NES Specific Keys</name>
+ <dl spacing="compact">
+ <dt><tt>[01 01]</tt></dt> <dd>NES_LATCH_FILTER</dd>
+ <dt><tt>[01 02]</tt></dt> <dd>NES_CLOCK_FILTER</dd>
+ <dt><tt>[01 04]</tt></dt> <dd>NES_GAME_GENIE_CODE</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>SNES Specific Keys</name>
+ <dl spacing="compact">
+ <dt><tt>[02 01]</tt></dt> <dd>SNES_LATCH_FILTER</dd>
+ <dt><tt>[02 02]</tt></dt> <dd>SNES_CLOCK_FILTER</dd>
+ <dt><tt>[02 04]</tt></dt> <dd>SNES_GAME_GENIE_CODE</dd>
+ <dt><tt>[02 05]</tt></dt> <dd>SNES_LATCH_TRAIN</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Genesis Specific Keys</name>
+ <dl spacing="compact">
+ <dt><tt>[08 04]</tt></dt> <dd>GENESIS_GAME_GENIE_CODE</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Input Frame/Timing Keys</name>
+ <dl spacing="compact">
+ <dt><tt>[FE 01]</tt></dt> <dd>INPUT_CHUNK</dd>
+ <dt><tt>[FE 02]</tt></dt> <dd>INPUT_MOMENT</dd>
+ <dt><tt>[FE 03]</tt></dt> <dd>TRANSITION</dd>
+ <dt><tt>[FE 04]</tt></dt> <dd>LAG_FRAME_CHUNK</dd>
+ <dt><tt>[FE 05]</tt></dt> <dd>MOVIE_TRANSITION</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Extraneous Keys</name>
+ <dl spacing="compact">
+ <dt><tt>[FF 01]</tt></dt> <dd>COMMENT</dd>
+ <dt><tt>[FF FE]</tt></dt> <dd>EXPERIMENTAL</dd>
+ <dt><tt>[FF FF]</tt></dt> <dd>UNSPECIFIED</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default" anchor="descriptions">
+ <name>Assigned Packet Keys With Descriptions</name>
+ <section numbered="true" toc="default">
+ <name>General Key Descriptions</name>
+ <dl newline="true">
+ <dt><tt>[00 01]</tt> - CONSOLE_TYPE</dt>
+ <dd>Specifies console used on emulator when dumping the TAS controller inputs. This packet type is <bcp14>OPTIONAL</bcp14> but <bcp14>SHOULD</bcp14> be included in a <strong>TASD</strong> file and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="console_type"/>).</dd>
+ <dt><tt>[00 02]</tt> - CONSOLE_REGION</dt>
+ <dd>Specifies video region of console used for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="console_region"/>).</dd>
+ <dt><tt>[00 03]</tt> - GAME_TITLE</dt>
+ <dd>Specifies the name of the game the TAS is written for. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="game_title"/>).</dd>
+ <dt><tt>[00 04]</tt> - ROM_NAME</dt>
+ <dd>Specifies the name of the specific ROM file used for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="rom_name"/>).</dd>
+ <dt><tt>[00 05]</tt> - ATTRIBUTION</dt>
+ <dd>Specifies the name of someone involved in the TAS or the creation or management of the <strong>TASD</strong> file in order to provide proper attribution for work done. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="author"/>).</dd>
+ <dt><tt>[00 06]</tt> - CATEGORY</dt>
+ <dd>Specifies the run category of the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="category"/>).</dd>
+ <dt><tt>[00 07]</tt> - EMULATOR_NAME</dt>
+ <dd>Specifies the emulator used while dumping TAS controller inputs. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="emulator_name"/>).</dd>
+ <dt><tt>[00 08]</tt> - EMULATOR_VERSION</dt>
+ <dd>Specifies the version of the emulator used while dump the TAS controller inputs. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="emulator_version"/>).</dd>
+ <dt><tt>[00 09]</tt> - EMULATOR_CORE</dt>
+ <dd>Specifies the core of the emulator used while dumping the TAS controller inputs. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="emulator_core"/>).</dd>
+ <dt><tt>[00 0A]</tt> - TAS_LAST_MODIFIED</dt>
+ <dd>Specifies when the TAS was last modified. Frequently used to specify the date and time when the TAS was published. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="tas_last_modified"/>).</dd>
+ <dt><tt>[00 0B]</tt> - DUMP_CREATED</dt>
+ <dd>Specifies when the <strong>TASD</strong> file was first created. This packet is <bcp14>OPTIONAL</bcp14> but <bcp14>SHOULD</bcp14> be included in a <strong>TASD</strong> file and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="dump_created"/>).</dd>
+ <dt><tt>[00 0C]</tt> - DUMP_LAST_MODIFIED</dt>
+ <dd>Specifies when the <strong>TASD</strong> file was last modified. This packet is <bcp14>OPTIONAL</bcp14> but <bcp14>SHOULD</bcp14> be included in a <strong>TASD</strong> file and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="dump_last_modified"/>).</dd>
+ <dt><tt>[00 0D]</tt> - TOTAL_FRAMES</dt>
+ <dd>Specifies the total number of frames in the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="total_frames"/>).</dd>
+ <dt><tt>[00 0E]</tt> - RERECORDS</dt>
+ <dd>Specifies the total number of rerecords of the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="rerecords"/>).</dd>
+ <dt><tt>[00 0F]</tt> - SOURCE_LINK</dt>
+ <dd>Specifies the source link for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="source_link"/>).</dd>
+ <dt><tt>[00 10]</tt> - BLANK_FRAMES</dt>
+ <dd>Specifies the number of blank controller inputs or frames to prepend to the inputs of the TAS when played on hardware. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="blank_frames"/>).</dd>
+ <dt><tt>[00 11]</tt> - VERIFIED</dt>
+ <dd>Specifies whether the TAS is verified to run on hardware, also known as "console verified", using the <strong>TASD</strong> file. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="verified"/>).</dd>
+ <dt><tt>[00 12]</tt> - MEMORY_INIT</dt>
+ <dd>Specifies initial memory values used for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="memory_init"/>).</dd>
+ <dt><tt>[00 13]</tt> - GAME_IDENTIFIER</dt>
+ <dd>Specifies an identifier for the game the TAS is written for. This can be checksums, hashes, or other identifying data. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="game_identifier"/>).</dd>
+ <dt><tt>[00 14]</tt> - MOVIE_LICENSE</dt>
+ <dd>Specifies a copyright license for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="movie_license"/>).</dd>
+ <dt><tt>[00 15]</tt> - MOVIE_FILE</dt>
+ <dd>Specifies the TAS movie data. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="movie_file"/>).</dd>
+ <dt><tt>[00 F0]</tt> - PORT_CONTROLLER</dt>
+ <dd>Specifies the controller type in specific console controller ports for the TAS when played on hardware. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="port_controller"/>).</dd>
+ <dt><tt>[00 F1]</tt> - PORT_OVERREAD</dt>
+ <dd>Specifies whether a high or low signal <bcp14>SHOULD</bcp14> be sent through a specified controller port of the console if the console requests more input data from the replay device through that controller port than expected. This packet type is <bcp14>OPTIONAL</bcp14>. Discussed in (<xref target="port_overread"/>).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>NES Specific Key Descriptions</name>
+ <dl newline="true">
+ <dt><tt>[01 01]</tt> - NES_LATCH_FILTER</dt>
+ <dd>Specifies a latch filter time in microseconds for how long how long to wait after a latch signal until new latch signals <bcp14>SHOULD</bcp14> be accepted by the replay device. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="nes_latch_filter"/>).</dd>
+ <dt><tt>[01 02]</tt> - NES_CLOCK_FILTER</dt>
+ <dd>Specifies a clock filter time in tenths of a microsecond (0.1 microseconds or 100 nanoseconds) for how long to wait after a clock pulse until new clock pulses <bcp14>SHOULD</bcp14> be accepted by the replay device. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="nes_clock_filter"/>).</dd>
+ <dt><tt>[01 04]</tt> - NES_GAME_GENIE_CODE</dt>
+ <dd>Specifies a Game Genie code for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="nes_game_genie_code"/>).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>SNES Specific Key Descriptions</name>
+ <dl newline="true">
+ <dt><tt>[02 01]</tt> - SNES_LATCH_FILTER</dt>
+ <dd>Specifies a latch filter time in microseconds for how long how long to wait after a latch signal until new latch signals <bcp14>SHOULD</bcp14> be accepted by the replay device. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="snes_latch_filter"/>).</dd>
+ <dt><tt>[02 02]</tt> - SNES_CLOCK_FILTER</dt>
+ <dd>Specifies a clock filter time in tenths of a microsecond (0.1 microseconds or 100 nanoseconds) for how long to wait after a clock pulse until new clock pulses <bcp14>SHOULD</bcp14> be accepted by the replay device. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type in direct form. Discussed in (<xref target="snes_clock_filter"/>).</dd>
+ <dt><tt>[02 04]</tt> - SNES_GAME_GENIE_CODE</dt>
+ <dd>Specifies a Game Genie code for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="snes_game_genie_code"/>).</dd>
+ <dt><tt>[02 05]</tt> - SNES_LATCH_TRAIN</dt>
+ <dd>Specifies Latch Trains for TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="snes_latch_train"/>).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Genesis Specific Key Descriptions</name>
+ <dl newline="true">
+ <dt><tt>[08 04]</tt> - GENESIS_GAME_GENIE_CODE</dt>
+ <dd>Specifies a Game Genie code for the TAS. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="genesis_game_genie_code"/>).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Input Frame/Timing Key Descriptions</name>
+ <dl newline="true">
+ <dt><tt>[FE 01]</tt> - INPUT_CHUNK</dt>
+ <dd>Specifies a chunk of input data for the TAS when played on hardware. All data from INPUT_CHUNK packets for each controller port are concatenated together in order of appearance in the <strong>TASD</strong> file. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="input_chunk"/>).</dd>
+ <dt><tt>[FE 02]</tt> - INPUT_MOMENT</dt>
+ <dd>Specifies a single instance of input data that is sent from the replay device to the console with specific timing. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="input_moment"/>).</dd>
+ <dt><tt>[FE 03]</tt> - TRANSITION</dt>
+ <dd>Specifies when a transition or change occurs during a TAS replay (example: console reset or changing of controller types). This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="transition"/>).</dd>
+ <dt><tt>[FE 04]</tt> - LAG_FRAME_CHUNK</dt>
+ <dd>Specifies a chunk of lag frames in a TAS based on the original TAS movie. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="lag_frame_chunk"/>).</dd>
+ <dt><tt>[FE 05]</tt> - MOVIE_TRANSITION</dt>
+ <dd>Specifies when a transition or change occurs in the original TAS movie (example: console reset or changing of controller types). This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="movie_transition"/>).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Extraneous Key Descriptions</name>
+ <dl newline="true">
+ <dt><tt>[FF 01]</tt> - COMMENT</dt>
+ <dd>Comment data. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="comment"/>).</dd>
+ <dt><tt>[FF FE]</tt> - EXPERIMENTAL</dt>
+ <dd>TASD file is using draft/experimental packets. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>SHOULD NOT</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="experimental"/>).</dd>
+ <dt><tt>[FF FF]</tt> - UNSPECIFIED</dt>
+ <dd>Unspecified packet data. Can contain any arbitrary data. This packet type is <bcp14>OPTIONAL</bcp14> and a <strong>TASD</strong> file <bcp14>MAY</bcp14> contain more than 1 of this packet type. Discussed in (<xref target="unspecified"/>).</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Packet Payload Formats</name>
+ <section numbered="true" toc="default">
+ <name>General Key Payload Formats</name>
+ <section numbered="true" toc="default" anchor="console_type">
+ <name>CONSOLE_TYPE Packet</name>
+ <t>CONSOLE_TYPE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1...
+ +-------------+==========+
+ | Console (A) | Name (S) |
+ +-------------+==========+
+
+ Console (Binary Data): [1 octet]
+ [01] - NES <Nintendo Entertainment System>
+ [02] - SNES <Super Nintendo>
+ [03] - N64 <Nintendo 64>
+ [04] - GC <GameCube>
+ [05] - GB <Game Boy>
+ [06] - GBC <Game Boy Color>
+ [07] - GBA <Game Boy Advance>
+ [08] - Genesis <Sega Genesis/Sega Mega Drive>
+ [09] - A2600 <Atari 2600>
+ [FF] - Custom
+ Name (String) [PLEN - 1 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Console</strong></dt>
+ <dd>Game console the TAS movie is for. There are pre-specified console types, but a <strong>TASD</strong> file <bcp14>MAY</bcp14> use <tt>[FF]</tt> to specify a console that is not in the pre-specified console types.</dd>
+ <dt><strong>Name</strong></dt>
+ <dd>Name of the console the TAS movie is for. <bcp14>SHOULD</bcp14> be empty if <strong>Console</strong> is not set to <tt>[FF]</tt>.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="console_region">
+ <name>CONSOLE_REGION Packet</name>
+ <t>CONSOLE_REGION packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +------------------+
+ | Video Signal (A) |
+ +------------------+
+
+ Video Signal (Binary Data): [1 octet]
+ [01] - NTSC
+ [02] - PAL
+ [FF] - Other/Unknown]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Video Signal</strong></dt>
+ <dd>Specifies the video signal of the game console being emulated while dumping the TAS movie's controller inputs.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="game_title">
+ <name>GAME_TITLE Packet</name>
+ <t>GAME_TITLE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +===========+
+ | Title (S) |
+ +===========+
+
+ Title (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Title</strong></dt>
+ <dd>Game title the TAS movie is for (example: "Super Mario Bros. 3").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="rom_name">
+ <name>ROM_NAME Packet</name>
+ <t>ROM_NAME packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Name (S) |
+ +==========+
+
+ Name (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Name</strong></dt>
+ <dd>File name of the ROM used for the TAS movie (example: "Super Mario Bros. 3 (J) [!].nes").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="author">
+ <name>ATTRIBUTION Packet</name>
+ <t>ATTRIBUTION packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1...
+ +----------+==========+
+ | Type (A) | Name (S) |
+ +----------+==========+
+
+ Type (Binary Data) [1 octet]
+ [01] - Author
+ [02] - Verifier
+ [03] - TASD File Creator
+ [04] - TASD File Editor
+ [FF] - Other
+ Name (String) [PLEN - 1 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Type</strong></dt>
+ <dd>Function of the person who is being attributed. <strong>Author</strong> is meant for a TAS movie author. <strong>Verifier</strong> is meant for a person who console verified the TAS movie(s) contained in the <strong>TASD</strong> file. <strong>TASD File Creator</strong> is meant for the person who initially created the <strong>TASD</strong> file, such as when dumping inputs from a TAS movie. <strong>TASD File Editor</strong> is meant for a person who edited the <strong>TASD</strong> file.</dd>
+ <dt><strong>Name</strong></dt>
+ <dd>Name of the individual getting the attribution (example: "OnehundredthCoin").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="category">
+ <name>CATEGORY Packet</name>
+ <t>CATEGORY packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==============+
+ | Category (S) |
+ +==============+
+
+ Category (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Category</strong></dt>
+ <dd>Name of the TAS movie run category (example: "any&#37;", "100&#37;", "No Warps").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="emulator_name">
+ <name>EMULATOR_NAME Packet</name>
+ <t>EMULATOR_NAME packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Name (S) |
+ +==========+
+
+ Name (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Name</strong></dt>
+ <dd>Name of the emulator used to play the TAS movie while dumping controller inputs (example: "FCEUX", "Bizhawk"). The emulator's version or core name <bcp14>SHOULD NOT</bcp14> be included.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="emulator_version">
+ <name>EMULATOR_VERSION Packet</name>
+ <t>EMULATOR_VERSION packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +=============+
+ | Version (S) |
+ +=============+
+
+ Version (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Version</strong></dt>
+ <dd>Version of the emulator used to play the TAS movie while dumping controller inputs (example: "2.7.0").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="emulator_core">
+ <name>EMULATOR_CORE Packet</name>
+ <t>EMULATOR_CORE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Core (S) |
+ +==========+
+
+ Core (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Core</strong></dt>
+ <dd>Core of the emulator used to play the TAS movie while dumping controller inputs (example: "NESHawk", "Gambatte").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="tas_last_modified">
+ <name>TAS_LAST_MODIFIED Packet</name>
+ <t>TAS_LAST_MODIFIED packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6 7
+ +--+--+--+--+--+--+--+--+
+ | Unix Timestamp (I) |
+ +--+--+--+--+--+--+--+--+
+
+ Unix Timestamp (Signed Integer) [8 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Unix Timestamp</strong></dt>
+ <dd>64-bit Unix timestamp (seconds since Unix Epoch) of when the TAS movie was last modified.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="dump_created">
+ <name>DUMP_CREATED Packet</name>
+ <t>DUMP_CREATED packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6 7
+ +--+--+--+--+--+--+--+--+
+ | Unix Timestamp (I) |
+ +--+--+--+--+--+--+--+--+
+
+ Unix Timestamp (Signed Integer) [8 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Unix Timestamp</strong></dt>
+ <dd>64-bit Unix timestamp (seconds since Unix Epoch) of when the <strong>TASD</strong> file was created.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="dump_last_modified">
+ <name>DUMP_LAST_MODIFIED Packet</name>
+ <t>DUMP_LAST_MODIFIED packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6 7
+ +--+--+--+--+--+--+--+--+
+ | Unix Timestamp (I) |
+ +--+--+--+--+--+--+--+--+
+
+ Unix Timestamp (Signed Integer) [8 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Unix Timestamp</strong></dt>
+ <dd>64-bit Unix timestamp (seconds since Unix Epoch) of when the <strong>TASD</strong> file was last modified.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="total_frames">
+ <name>TOTAL_FRAMES Packet</name>
+ <t>TOTAL_FRAMES packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3
+ +---+---+---+---+
+ | Frames (N) |
+ +---+---+---+---+
+
+ Frames (Unsigned Integer) [4 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Frames</strong></dt>
+ <dd>Total number of frames of the TAS movie.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="rerecords">
+ <name>RERECORDS Packet</name>
+ <t>RERECORDS packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3
+ +---+---+---+---+
+ | Rerecords (N) |
+ +---+---+---+---+
+
+ Rerecords (Unsigned Integer) [4 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Rerecords</strong></dt>
+ <dd>Total number of rerecords of the TAS movie.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="source_link">
+ <name>SOURCE_LINK Packet</name>
+ <t>SOURCE_LINK packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Link (S) |
+ +==========+
+
+ Link (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Link</strong></dt>
+ <dd>URL that points to the TAS movie file (example: "https://tasvideos.org/4567M").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="blank_frames">
+ <name>BLANK_FRAMES Packet</name>
+ <t>BLANK_FRAMES packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1
+ +------+------+
+ | Frames (I) |
+ +------+------+
+
+ Frames (Signed Integer) [2 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Frames</strong></dt>
+ <dd>Number of blank frames (of input where no buttons are being pressed) needed at the beginning of a TAS replay. If <strong>Frames</strong> is a negative value, the value of <strong>Frames</strong> indicates the number of frames that should be skipped from the TAS input data. A negative value is not applicable if there is no way to determine how much input data should be skipped (e.g. NES with INPUT_CHUNKs where each input represents a single latch).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="verified">
+ <name>VERIFIED Packet</name>
+ <t>VERIFIED packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +--------------+
+ | Verified (B) |
+ +--------------+
+
+ Verified (Boolean) [1 octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Verified</strong></dt>
+ <dd>Boolean value that is <strong>TRUE</strong> if the <strong>TASD</strong> file has been successfully console verified and <strong>FALSE</strong> if it has not been verified.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="memory_init">
+ <name>MEMORY_INIT Packet</name>
+ <t>MEMORY_INIT packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3
+ +---------------+------+------+--------------+
+ | Data Type (A) | Device (A) | Required (B) | ...
+ +---------------+------+------+--------------+
+ 4 5... 5+NLEN...
+ +----------+==========+==========+
+ | NLEN (N) | Name (S) | Data (A) |
+ +----------+==========+==========+
+
+ Data Type (Binary Data): [1 octet]
+ [01] - No Initialization Required
+ [02] - All [00]
+ [03] - All [FF]
+ [04] - [00 00 00 00 FF FF FF FF] Repeating
+ [05] - Random
+ [FF] - Custom
+ Device (Binary Data): [2 octets]
+ [01 01] - NES CPU RAM
+ [01 02] - NES Cartridge Save Data
+ [02 01] - SNES CPU RAM
+ [02 02] - SNES Cartridge Save Data
+ [05 01] - GB CPU RAM
+ [05 02] - GB Cartridge Save Data
+ [06 01] - GBC CPU RAM
+ [06 02] - GBC Cartridge Save Data
+ [07 01] - GBA CPU RAM
+ [07 02] - GBA Cartridge Save Data
+ [08 01] - Genesis CPU RAM
+ [08 02] - Genesis Cartridge Save Data
+ [09 01] - A2600 CPU RAM
+ [09 02] - A2600 Cartridge Save Data
+ [FF FF] - Custom/Other Device
+ Required (Boolean) [1 octet]
+ NLEN (Unsigned Integer) [1 octet]
+ Name (String) [NLEN octets]
+ Data (Binary Data) [PLEN - NLEN -
+ 5 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Data Type</strong></dt>
+ <dd>Content type of initial memory. If <strong>Type</strong> is not <tt>[FF]</tt>, <strong>Data</strong> <bcp14>SHOULD</bcp14> be empty (0 octet length binary data).</dd>
+ <dt><strong>Device</strong></dt>
+ <dd>Device/Location that is to have memory initialized.</dd>
+ <dt><strong>Required</strong></dt>
+ <dd>Boolean value that is <strong>TRUE</strong> if this memory initialization data is known to be required and <strong>FALSE</strong> if the memory initialization data is not known to be required.</dd>
+ <dt><strong>NLEN</strong></dt>
+ <dd>Length of <strong>Name</strong></dd>
+ <dt><strong>Name</strong></dt>
+ <dd>Label for the memory initialization data (example: "CPU RAM", "SAVE RAM"). If <strong>Device</strong> is <tt>[FF FF]</tt>, <strong>Name</strong> <bcp14>SHOULD NOT</bcp14> be empty (0 octet length string).</dd>
+ <dt><strong>Data</strong></dt>
+ <dd>Raw memory initialization data. If <strong>Data Type</strong> is not <tt>[FF]</tt>, <strong>Data</strong> <bcp14>SHOULD</bcp14> be empty (0 octet length binary data).</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="game_identifier">
+ <name>GAME_IDENTIFIER Packet</name>
+ <t>GAME_IDENTIFIER packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3...
+ +----------+--------------+----------+==========+
+ | Type (A) | Encoding (A) | NLEN (N) | Name (S) | ...
+ +----------+--------------+----------+==========+
+ 3+NLEN...
+ +================+
+ | Identifier (A) |
+ +================+
+
+ Type (Binary Data): [1 octet]
+ [01] - MD5 Hash
+ [02] - SHA1 Hash
+ [03] - SHA224 Hash
+ [04] - SHA256 Hash
+ [05] - SHA384 Hash
+ [06] - SHA512 Hash
+ [07] - SHA512/224 Hash
+ [08] - SHA512/256 Hash
+ [09] - SHA3-224 Hash
+ [0A] - SHA3-256 Hash
+ [0B] - SHA3-384 Hash
+ [0C] - SHA3-512 Hash
+ [0D] - SHAKE-128 Hash
+ [0E] - SHAKE-256 Hash
+ [FF] - Other
+ Encoding (Binary Data): [1 octet]
+ [01] - Raw Binary
+ [02] - Base 16 (Case Insensitive)
+ [03] - Base 32 (Case Insensitive)
+ [04] - Base 64
+ NLEN (Unsigned Integer) [1 octet]
+ Name (String) [NLEN octets]
+ Identifier (Binary Data) [PLEN - NLEN -
+ 3 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Type</strong></dt>
+ <dd>Hash, checksum, or identifier algorithm used to create the <strong>Identifier</strong>.</dd>
+ <dt><strong>Encoding</strong></dt>
+ <dd>Describes the data encoding of <strong>Identifier</strong>. Raw binary indicates no encoding is used. Base16/32/64 all use the standard RFC 4648 encodings, without extensions. Base 16 and Base 32 are case-insensitive.</dd>
+ <dt><strong>NLEN</strong></dt>
+ <dd>Length of <strong>Name</strong></dd>
+ <dt><strong>Name</strong></dt>
+ <dd>Name of the hash, checksum, or identifier algorithm used to create the <strong>Identifier</strong>. If <strong>Type</strong> is not <tt>[FF]</tt>, <strong>Name</strong> <bcp14>SHOULD</bcp14> be empty (0 octet length binary data).</dd>
+ <dt><strong>Identifier</strong></dt>
+ <dd>Game hash, checksum, or identifier data.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="movie_license">
+ <name>MOVIE_LICENSE Packet</name>
+ <t>MOVIE_LICENSE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +=============+
+ | License (S) |
+ +=============+
+
+ License (String) [PLEN octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>License</strong></dt>
+ <dd>License information for the TAS movie (example: "Creative Commons Attribution 2.0").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="movie_file">
+ <name>MOVIE_FILE Packet</name>
+ <t>MOVIE_FILE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1... 1+NLEN...
+ +----------+==========+=============+
+ | NLEN (N) | Name (S) | Data (A) |
+ +----------+==========+=============+
+
+ NLEN (Unsigned Integer) [1 octet]
+ Name (String) [NLEN octets]
+ Data (Binary Data) [PLEN - NLEN -
+ 1 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>NLEN</strong></dt>
+ <dd>Length of <strong>Name</strong>.</dd>
+ <dt><strong>Name</strong></dt>
+ <dd>Name of the TAS movie. Using the TAS movie's file name is <bcp14>RECOMMENDED</bcp14> (example: "mranderson-thematrix.bk2").</dd>
+ <dt><strong>Data</strong></dt>
+ <dd>TAS movie file data/content.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="port_controller">
+ <name>PORT_CONTROLLER Packet</name>
+ <t>PORT_CONTROLLER packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2
+ +----------+-----+-----+
+ | Port (N) | Type (A) |
+ +----------+-----+-----+
+
+ Port (Unsigned Integer) [1 octet]
+ Type (Binary Data): [2 octets]
+ [01 01] - NES Standard Controller
+ [01 02] - NES Four Score
+ [01 03] - (RESERVED) NES Zapper
+ [01 04] - (RESERVED) NES Power Pad
+ [01 05] - (RESERVED) Famicom Family BASIC Keyboard
+ [02 01] - SNES Standard Controller
+ [02 02] - SNES Super Multitap
+ [02 03] - SNES Mouse
+ [02 04] - (RESERVED) SNES Superscope
+ [03 01] - N64 Standard Controller
+ [03 02] - N64 Standard Controller with Rumble Pak
+ [03 03] - N64 Standard Controller with Controller Pak
+ [03 04] - N64 Standard Controller with Transfer Pak
+ [03 05] - N64 Mouse
+ [03 06] - (RESERVED) N64 Voice Recognition Unit (VRU)
+ [03 07] - (RESERVED) N64 RandNet Keyboard
+ [03 08] - N64 Densha de Go
+ [04 01] - GC Standard Controller
+ [04 02] - (RESERVED) GC Keyboard
+ [05 01] - GB Gamepad
+ [06 01] - GBC Gamepad
+ [07 01] - GBA Gamepad
+ [08 01] - Genesis (Mega Drive) 3-Button
+ [08 02] - Genesis (Mega Drive) 6-Button
+ [09 01] - A2600 Joystick
+ [09 02] - (RESERVED) A2600 Paddle
+ [09 03] - A2600 Keyboard Controller
+ [FF FF] - Other/Unspecified]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Port</strong></dt>
+ <dd>Controller port number (<strong>Port</strong> number <bcp14>MUST</bcp14> be <strong>1-indexed</strong>).</dd>
+ <dt><strong>Type</strong></dt>
+ <dd>Specifies the controller type connected to the <strong>Port</strong>. <strong>(RESERVED)</strong> specifies that the controller type is not described in this document, but the byte values are reserved for a later version of the <strong>TASD</strong> file format protocol. Input formats for specific controller types are described in (<xref target="controller_inputs"/>).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="port_overread">
+ <name>PORT_OVERREAD Packet</name>
+ <t>PORT_OVERREAD packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1
+ +----------+----------+
+ | Port (N) | High (B) |
+ +----------+----------+
+
+ Port (N) [1 octet]
+ High (Boolean) [1 octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Port</strong></dt>
+ <dd>Controller port number (<strong>Port</strong> number <bcp14>MUST</bcp14> be <strong>1-indexed</strong>).</dd>
+ <dt><strong>High</strong></dt>
+ <dd>Boolean value that is <strong>TRUE</strong> if overread bits are set to high and <strong>FALSE</strong> if overread bits are set to low.</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>NES Specific Key Payload Formats</name>
+ <section numbered="true" toc="default" anchor="nes_latch_filter">
+ <name>NES_LATCH_FILTER Packet</name>
+ <t>NES_LATCH_FILTER packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1
+ +-----+-----+
+ | Time (N) |
+ +-----+-----+
+
+ Time (Unsigned Integer) [2 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Time</strong></dt>
+ <dd>Latch filter length of time in microseconds.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="nes_clock_filter">
+ <name>NES_CLOCK_FILTER Packet</name>
+ <t>NES_CLOCK_FILTER packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +----------+
+ | Time (N) |
+ +----------+
+
+ Time (Unsigned Integer) [1 octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Time</strong></dt>
+ <dd>Clock filter length of time in tenths of a microsecond (units of 0.1 microseconds or 100 nanoseconds).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="nes_game_genie_code">
+ <name>NES_GAME_GENIE_CODE Packet</name>
+ <t>NES_GAME_GENIE_CODE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Code (S) |
+ +==========+
+
+ Code (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Code</strong></dt>
+ <dd>Game Genie code (example: "AATOZA").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>SNES Specific Key Payload Formats</name>
+ <section numbered="true" toc="default" anchor="snes_latch_filter">
+ <name>SNES_LATCH_FILTER Packet</name>
+ <t>SNES_LATCH_FILTER packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1
+ +-----+-----+
+ | Time (N) |
+ +-----+-----+
+
+ Time (Unsigned Integer) [2 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Time</strong></dt>
+ <dd>Latch filter length of time in microseconds.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="snes_clock_filter">
+ <name>SNES_CLOCK_FILTER Packet</name>
+ <t>SNES_CLOCK_FILTER packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +----------+
+ | Time (N) |
+ +----------+
+
+ Time (Unsigned Integer) [1 octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Time</strong></dt>
+ <dd>Clock filter length of time in tenths of a microsecond (units of 0.1 microseconds or 100 nanoseconds).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="snes_game_genie_code">
+ <name>SNES_GAME_GENIE_CODE Packet</name>
+ <t>SNES_GAME_GENIE_CODE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Code (S) |
+ +==========+
+
+ Code (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Code</strong></dt>
+ <dd>Game Genie code (example: "DDB4-6F07").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="snes_latch_train">
+ <name>SNES_LATCH_TRAIN Packet</name>
+ <t>SNES_LATCH_TRAIN packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +====================+
+ | Latch Trains ([]N) |
+ +====================+
+
+ Latch Trains (List of Unsigned Integers) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Latch Trains</strong></dt>
+ <dd>List of 64-bit unsigned integers in which each integer is the length of one Latch Train. <bcp14>MUST</bcp14> be a multiple of 8 octets in size</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ <t>A single SNES_LATCH_TRAIN packet <bcp14>MAY</bcp14> contain up to every Latch Train of a SNES TAS movie console replay and <bcp14>MAY</bcp14> contain fewer than every Latch Train of a SNES TAS movie console replay. There <bcp14>MAY</bcp14> be more than 1 SNES_LATCH_TRAIN packet.</t>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Genesis Specific Key Payload Formats</name>
+ <section numbered="true" toc="default" anchor="genesis_game_genie_code">
+ <name>GENESIS_GAME_GENIE_CODE Packet</name>
+ <t>GENESIS_GAME_GENIE_CODE packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +==========+
+ | Code (S) |
+ +==========+
+
+ Code (String) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Code</strong></dt>
+ <dd>Game Genie code (example: "ATBT-AA32").</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Input Frame/Timing Key Payload Formats</name>
+ <section numbered="true" toc="default" anchor="input_chunk">
+ <name>INPUT_CHUNK Packet</name>
+ <t>INPUT_CHUNK packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1...
+ +----------+============+
+ | Port (N) | Inputs (A) |
+ +----------+============+
+
+ Port (Unsigned Integer) [1 octet]
+ Inputs (Binary Data) [PLEN - 1 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Port</strong></dt>
+ <dd>Controller port number (<strong>Port</strong> number <bcp14>MUST</bcp14> be <strong>1-indexed</strong>).</dd>
+ <dt><strong>Inputs</strong></dt>
+ <dd>Controller input data for controller on <strong>Port</strong>. Input formats for each controller type is described in <xref target="controller_inputs"/>.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ <t>All INPUT_CHUNK packets with corresponding Port values in the <strong>TASD</strong> file <bcp14>MUST</bcp14> be in chronological order, where earlier inputs in the TAS movie console replay are earlier in the <strong>TASD</strong> file and later inputs in the TAS movie console replay are later in the <strong>TASD</strong> file. If there are more than one INPUT_CHUNK packets for a specific Port, the input data <bcp14>MUST</bcp14> be interpreted as if all their contents were concatenated into a single INPUT_CHUNK packet. As such, a single INPUT_CHUNK packet <bcp14>MAY</bcp14> contain up to every input of a TAS movie console replay and <bcp14>MAY</bcp14> contain fewer than every input of a TAS movie console replay.</t>
+ <t>The input data contained in <strong>Inputs</strong> is divided up based on the PORT_CONTROLLER type corresponding to the <strong>Port</strong> number. Refer to <xref target="controller_inputs"/> for each available type and the number of bytes used for each instance of controller input. The PORT_CONTROLLER type <bcp14>MAY</bcp14> be changed using TRANSITION packets, which <bcp14>MAY</bcp14> change the interpretation of the input data until either the end of the replay or until the next PORT_CONTROLLER transition.</t>
+ <t>Each instance of controller input <strong>SHOULD</strong> remain held until the input has been used according to the current replay configuration. By default, this means each instance of controller input corresponds to a single input "latch" or polling sequence by the console. However, some packet types <strong>MAY</strong> alter how inputs are used during replay. For example, the NES has the NES_LATCH_FILTER packet available. When NES_LATCH_FILTER is active, each instance of controller input <strong>MUST</strong> remain held until the end of the filter period.</t>
+ </section>
+ <section numbered="true" toc="default" anchor="input_moment">
+ <name>INPUT_MOMENT Packet</name>
+ <t>INPUT_MOMENT packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2
+ +----------+----------+----------------+
+ | Port (N) | Hold (B) | Index Type (A) | ...
+ +----------+----------+----------------+
+ 3 4 5 6 7 8 9 10 11...
+ +--+--+--+--+--+--+--+--+============+
+ | Index (N) | Inputs (B) |
+ +--+--+--+--+--+--+--+--+============+
+
+ Port (Unsigned Integer) [1 octet]
+ Hold (Boolean) [1 octet]
+ Index Type (Binary Data): [1 octet]
+ [01] - Frame
+ [02] - Cycle Count
+ [03] - Milliseconds
+ [04] - Microseconds
+ [05] - Nanoseconds
+ Index (Unsigned Integer) [8 octets]
+ Inputs (Binary Data) [PLEN - 11 octets]
+]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Port</strong></dt>
+ <dd>Controller port number (<strong>Port</strong> number <bcp14>MUST</bcp14> be <strong>1-indexed</strong>).</dd>
+ <dt><strong>Hold</strong></dt>
+ <dd>If <strong>TRUE</strong>, the <strong>Input</strong> data <bcp14>MUST</bcp14> continue to be held after the controller state has been read. Otherwise if <strong>FALSE</strong>, the <strong>Input</strong> data is held only until the data has been used once.</dd>
+ <dt><strong>Index Type</strong></dt>
+ <dd>Specifies timing methodology of a specific moment when <strong>Input</strong> data <bcp14>MUST</bcp14> be applied.</dd>
+ <dt><strong>Index</strong></dt>
+ <dd>Time value in units based on <strong>Index Type</strong>.</dd>
+ <dt><strong>Input</strong></dt>
+ <dd>A single instance of controller input data for the controller on the specified <strong>Port</strong>. Input formats for each controller type is described in <xref target="controller_inputs"/>.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ <t>Each INPUT_MOMENT packet contains a single instance of controller input data for a specific moment during a TAS replay. The input data's format depends on the PORT_CONTROLLER type corresponding to the <strong>Port</strong> number. Refer to <xref target="controller_inputs"/> for each available type. The PORT_CONTROLLER type <bcp14>MAY</bcp14> be changed using TRANSITION packets, which <bcp14>MAY</bcp14> change the interpretation of the input data.</t>
+ <t>If <strong>Hold</strong> is <strong>TRUE</strong>, the controller <bcp14>MUST</bcp14> continually hold the input state until the next INPUT_MOMENT for the same <strong>Port</strong> number. If <strong>Hold</strong> is <strong>FALSE</strong>, the controller <bcp14>MUST</bcp14> hold only until the console reads the input state, or until the next INPUT_MOMENT for the same <strong>Port</strong> number.</t>
+ <t>If an INPUT_MOMENT overlaps with input data from one or more INPUT_CHUNKs, the INPUT_MOMENT's <strong>Input</strong> data <bcp14>MUST</bcp14> be used instead of the data contained in the INPUT_CHUNKs. INPUT_CHUNK data <bcp14>MUST</bcp14> still be incremented as it normally would. <strong>Hold</strong> <bcp14>MUST</bcp14> still behave as specified.</t>
+ </section>
+ <section numbered="true" toc="default" anchor="transition">
+ <name>TRANSITION Packet</name>
+ <t>TRANSITION packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6 7 8 9
+ +----------+----------------+--+--+--+--+--+--+--+--+
+ | Port (N) | Index Type (A) | Index (N) | ...
+ +----------+----------------+--+--+--+--+--+--+--+--+
+ 10 11...
+ +----------+============+
+ | Type (A) | Packet (A) |
+ +----------+============+
+
+ Port (Unsigned Integer) [1 octet]
+ Index Type (Binary Data): [1 octet]
+ [01] - Frame
+ [02] - Cycle Count
+ [03] - Milliseconds
+ [04] - Microseconds
+ [05] - Nanoseconds
+ [06] - INPUT_CHUNK Byte Index
+ Index (Unsigned Integer) [8 octets]
+ Type (Binary Data): [1 octet]
+ [01] - Soft Reset
+ [02] - Power Reset
+ [03] - Restart TASD File
+ [FF] - Packet Derived
+ Inner Packet (Binary Data) [PLEN - 11 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Port</strong></dt>
+ <dd>Controller port number (<strong>Port</strong> number <bcp14>MUST</bcp14> be <strong>1-indexed</strong>).</dd>
+ <dt><strong>Input Type</strong></dt>
+ <dd>Determines specific timing type for start of transition.</dd>
+ <dt><strong>Index</strong></dt>
+ <dd>Time or offset value to start transition. If <strong>Index Type</strong> is <tt>[06]</tt>, <strong>Index</strong> <bcp14>MUST</bcp14> be interpreted as the <strong>byte offset</strong> (<strong>0-indexed</strong>) into the concatenated input data from all <strong>INPUT_CHUNK</strong> packets for the controller port specified by <strong>Port</strong>. If <strong>Index Type</strong> is <tt>[06]</tt>, the byte offset <bcp14>MUST</bcp14> also point to the first byte of an instance of controller input data (according to the PORT_CONTROLLER format at that moment in the TAS replay.)</dd>
+ <dt><strong>Type</strong></dt>
+ <dd>Type of transition. If <strong>Type</strong> is <tt>[FF]</tt>, the transition action will be interpreting a <strong>TASD</strong> packet.</dd>
+ <dt><strong>Inner Packet</strong></dt>
+ <dd>If <strong>Type</strong> is <tt>[FF]</tt>, <strong>Inner Packet</strong> <bcp14>SHOULD</bcp14> be a <strong>TASD</strong> packet. <strong>Inner Packet</strong> <bcp14>MUST NOT</bcp14> be a <strong>INPUT_CHUNK</strong>, <strong>INPUT_MOMENT</strong>, <strong>TRANSITION</strong>, <strong>LAG_FRAME_CHUNK</strong>, or <strong>MOVIE_TRANSITION</strong> packet.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload (Not <strong>Inner Packet</strong> length).</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="lag_frame_chunk">
+ <name>LAG_FRAME_CHUNK Packet</name>
+ <t>LAG_FRAME_CHUNK packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5 6 7
+ +----+----+----+----+--+--+--+--+
+ | Movie Frame (N) | Count (N) |
+ +----+----+----+----+--+--+--+--+
+
+ Movie Frame (Unsigned Integer) [4 octets]
+ Count (Unsigned Integer) [4 octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Movie Frame</strong></dt>
+ <dd>Frame number of the TAS movie where Lag Frames start (<strong>Movie Frame</strong> MUST be <strong>0-indexed</strong>).</dd>
+ <dt><strong>Count</strong></dt>
+ <dd>Number of Lag Frames in a row starting from <strong>Movie Frame</strong>.</dd>
+ </dl>
+ <t>Emulators typically consider a "lag frame" to be any frame in which the emulator believes the game does not poll/read controller inputs.</t>
+ </section>
+ <section numbered="true" toc="default" anchor="movie_transition">
+ <name>MOVIE_TRANSITION</name>
+ <t>MOVIE_TRANSITION packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0 1 2 3 4 5...
+ +----+----+----+----+----------+==================+
+ | Movie Frame (N) | Type (A) | Inner Packet (A) |
+ +----+----+----+----+----------+==================+
+
+ Movie Frame (Unsigned Integer) [4 octets]
+ Type (Binary Data): [1 octet]
+ [01] - Soft Reset
+ [02] - Power Reset
+ [03] - Restart TASD File
+ [FF] - Packet Derived
+ Inner Packet (Binary Data) [PLEN - 5 octets]]]>
+ </artwork>
+
+ <dl newline="true">
+ <dt><strong>Movie Frame</strong></dt>
+ <dd>Frame number of the TAS movie (<strong>Movie Frame</strong> MUST be <strong>0-indexed</strong>).</dd>
+ <dt><strong>Type</strong></dt>
+ <dd>Type of transition. If <strong>Type</strong> is <tt>[FF]</tt>, the transition action will be interpreting a <strong>TASD</strong> packet.</dd>
+ <dt><strong>Inner Packet</strong></dt>
+ <dd>If <strong>Type</strong> is <tt>[FF]</tt>, <strong>Inner Packet</strong> <bcp14>SHOULD</bcp14> be a <strong>TASD</strong> packet. <strong>Inner Packet</strong> <bcp14>MUST NOT</bcp14> be a <strong>INPUT_CHUNK</strong>, <strong>INPUT_MOMENT</strong>, <strong>TRANSITION</strong>, <strong>LAG_FRAME_CHUNK</strong>, or <strong>MOVIE_TRANSITION</strong> packet.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload (Not <strong>Inner Packet</strong> length).</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Extraneous Key Payload Formats</name>
+ <section numbered="true" toc="default" anchor="comment">
+ <name>COMMENT Packet</name>
+ <t>COMMENT packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +=============+
+ | Comment (S) |
+ +=============+
+
+ Comment (String) [PLEN octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Comment</strong></dt>
+ <dd>Comment text.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="experimental">
+ <name>EXPERIMENTAL Packet</name>
+ <t>EXPERIMENTAL packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0
+ +------------------+
+ | Experimental (B) |
+ +------------------+
+
+ Experimental (Boolean) [1 octet]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Experimental</strong></dt>
+ <dd>Boolean data that is <strong>TRUE</strong> if the TASD file is using draft/experimental features (Currently SHOULD be <strong>TRUE</strong>) and <strong>FALSE</strong> if the TASD file is using only stable features.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default" anchor="unspecified">
+ <name>UNSPECIFIED Packet</name>
+ <t>UNSPECIFIED packets <bcp14>MUST</bcp14> be in the following format:</t>
+ <artwork><![CDATA[
+ 0...
+ +======================+
+ | Unspecified Data (A) |
+ +======================+
+
+ Unspecified Data (Binary Data) [PLEN octets]]]>
+ </artwork>
+ <dl newline="true">
+ <dt><strong>Unspecified Data</strong></dt>
+ <dd>Arbitrary data. Can be used for any data. Because this is unspecified data, there is no guarantee any software used to control a TAS replay device will support data in this packet type.</dd>
+ <dt><strong>PLEN</strong></dt>
+ <dd>Length of the packet payload.</dd>
+ </dl>
+ </section>
+ </section>
+ </section>
+ </section>
+ <section numbered="true" toc="default" anchor="controller_inputs">
+ <name>Controller Input Formats</name>
+ <t>A forward slash (<strong>/</strong>) is used to signify <strong>active low</strong>. As an example, if a bit is labeled as <strong>/A</strong>, the bit <bcp14>MUST</bcp14> be 0 if the A button is pressed and <bcp14>MUST</bcp14> be 1 if the A button is not pressed.</t>
+ <t>Multi-octet controller inputs are in little-endian order</t>
+ <t>Bit order for octets in controller inputs are high-order (MSB) (Most significant bit to least significant bit), so bit 7 <bcp14>MUST</bcp14> be the left-most bit of the octet and bit 0 <bcp14>MUST</bcp14> be the right-most bit of the octet.</t>
+ <section numbered="true" toc="default">
+ <name>NES/Famicom Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>NES Standard Controller</name>
+ <t>Single Input Length: 1 Octet</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/A</dd>
+ <dt>Bit 6:</dt><dd>/B</dd>
+ <dt>Bit 5:</dt><dd>/Select</dd>
+ <dt>Bit 4:</dt><dd>/Start</dd>
+ <dt>Bit 3:</dt><dd>/Up</dd>
+ <dt>Bit 2:</dt><dd>/Down</dd>
+ <dt>Bit 1:</dt><dd>/Left</dd>
+ <dt>Bit 0:</dt><dd>/Right</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>NES Four Score</name>
+ <t>Single Input Length: 3 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>Controller N-1 /A</dd>
+ <dt>Bit 6:</dt><dd>Controller N-1 /B</dd>
+ <dt>Bit 5:</dt><dd>Controller N-1 /Select</dd>
+ <dt>Bit 4:</dt><dd>Controller N-1 /Start</dd>
+ <dt>Bit 3:</dt><dd>Controller N-1 /Up</dd>
+ <dt>Bit 2:</dt><dd>Controller N-1 /Down</dd>
+ <dt>Bit 1:</dt><dd>Controller N-1 /Left</dd>
+ <dt>Bit 0:</dt><dd>Controller N-1 /Right</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>Controller N-2 /A</dd>
+ <dt>Bit 6:</dt><dd>Controller N-2 /B</dd>
+ <dt>Bit 5:</dt><dd>Controller N-2 /Select</dd>
+ <dt>Bit 4:</dt><dd>Controller N-2 /Start</dd>
+ <dt>Bit 3:</dt><dd>Controller N-2 /Up</dd>
+ <dt>Bit 2:</dt><dd>Controller N-2 /Down</dd>
+ <dt>Bit 1:</dt><dd>Controller N-2 /Left</dd>
+ <dt>Bit 0:</dt><dd>Controller N-2 /Right</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>1</dd>
+ <dt>Bit 6:</dt><dd>1</dd>
+ <dt>Bit 5:</dt><dd>0 if Controller Port is 2, otherwise 1</dd>
+ <dt>Bit 4:</dt><dd>0 if Controller Port is 1, otherwise 1</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ <t><strong>Controller N</strong> is the controller port number. The NES Four Score allows players 1 and 3 to input buttons on controller port 1 and players 2 and 4 to input buttons on controller port 2. <strong>Controller N-1</strong> on controller port 1 is <strong>Player 1</strong>, <strong>Controller N-2</strong> on controller port 1 is <strong>Player 3</strong>, <strong>Controller N-1</strong> on controller port 2 is <strong>Player 2</strong>, and <strong>Controller N-2</strong> on controller port 2 is <strong>Player 4</strong>.</t>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>SNES Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>SNES Standard Controller</name>
+ <t>Single Input Length: 2 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/B</dd>
+ <dt>Bit 6:</dt><dd>/Y</dd>
+ <dt>Bit 5:</dt><dd>/Select</dd>
+ <dt>Bit 4:</dt><dd>/Start</dd>
+ <dt>Bit 3:</dt><dd>/Up</dd>
+ <dt>Bit 2:</dt><dd>/Down</dd>
+ <dt>Bit 1:</dt><dd>/Left</dd>
+ <dt>Bit 0:</dt><dd>/Right</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/A</dd>
+ <dt>Bit 6:</dt><dd>/X</dd>
+ <dt>Bit 5:</dt><dd>/L</dd>
+ <dt>Bit 4:</dt><dd>/R</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>SNES Super Multitap</name>
+ <t>Single Input Length: 5 Octets</t>
+ <t><strong>Octet 0</strong> : </t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>1</dd>
+ <dt>Bit 6:</dt><dd>1</dd>
+ <dt>Bit 5:</dt><dd>1</dd>
+ <dt>Bit 4:</dt><dd>1</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>I/O Pin State - <strong>1</strong> if Multitap ports <strong>1 and 2</strong> are being polled, <strong>0</strong> if ports <strong>3 and 4</strong> are.</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>Controller N-1 or N-3 /B</dd>
+ <dt>Bit 6:</dt><dd>Controller N-1 or N-3 /Y</dd>
+ <dt>Bit 5:</dt><dd>Controller N-1 or N-3 /Select</dd>
+ <dt>Bit 4:</dt><dd>Controller N-1 or N-3 /Start</dd>
+ <dt>Bit 3:</dt><dd>Controller N-1 or N-3 /Up</dd>
+ <dt>Bit 2:</dt><dd>Controller N-1 or N-3 /Down</dd>
+ <dt>Bit 1:</dt><dd>Controller N-1 or N-3 /Left</dd>
+ <dt>Bit 0:</dt><dd>Controller N-1 or N-3 /Right</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>Controller N-1 or N-3 /A</dd>
+ <dt>Bit 6:</dt><dd>Controller N-1 or N-3 /X</dd>
+ <dt>Bit 5:</dt><dd>Controller N-1 or N-3 /L</dd>
+ <dt>Bit 4:</dt><dd>Controller N-1 or N-3 /R</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>Controller N-2 or N-4 /B</dd>
+ <dt>Bit 6:</dt><dd>Controller N-2 or N-4 /Y</dd>
+ <dt>Bit 5:</dt><dd>Controller N-2 or N-4 /Select</dd>
+ <dt>Bit 4:</dt><dd>Controller N-2 or N-4 /Start</dd>
+ <dt>Bit 3:</dt><dd>Controller N-2 or N-4 /Up</dd>
+ <dt>Bit 2:</dt><dd>Controller N-2 or N-4 /Down</dd>
+ <dt>Bit 1:</dt><dd>Controller N-2 or N-4 /Left</dd>
+ <dt>Bit 0:</dt><dd>Controller N-2 or N-4 /Right</dd>
+ </dl>
+ <t><strong>Octet 4</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>Controller N-2 or N-4 /A</dd>
+ <dt>Bit 6:</dt><dd>Controller N-2 or N-4 /X</dd>
+ <dt>Bit 5:</dt><dd>Controller N-2 or N-4 /L</dd>
+ <dt>Bit 4:</dt><dd>Controller N-2 or N-4 /R</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ <t><strong>Controller N</strong> is the controller port number on the console that the Multitap is connected to. <strong>Controller N-1...N-4</strong> are the controller ports <strong>1...4</strong> on the Multitap. Two Multitap ports are polled simultaneously by the game - either <strong>1 and 2</strong>, or <strong>3 and 4</strong>. The I/O Pin state in octet 0 <bcp14>MUST</bcp14> be <strong>1</strong> for multitap ports <strong>1 and 2</strong>, or <strong>0</strong> for ports <strong>3 and 4</strong>.</t>
+ </section>
+ <section numbered="true" toc="default">
+ <name>SNES Mouse</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>1</dd>
+ <dt>Bit 6:</dt><dd>1</dd>
+ <dt>Bit 5:</dt><dd>1</dd>
+ <dt>Bit 4:</dt><dd>1</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Right button</dd>
+ <dt>Bit 6:</dt><dd>/Left button</dd>
+ <dt>Bit 5:</dt><dd>Current sensitivity (0: high sensitivity; 1: low or medium sensitivity)</dd>
+ <dt>Bit 4:</dt><dd>Current sensitivity (0: medium sensitivity; 1: low or high sensitivity)</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>0</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-1:</dt><dd>/Vertical displacement since last read</dd>
+ <dt>Bit 0:</dt><dd>Direction (0: up; 1: down)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-1:</dt><dd>/Horizontal displacement since last read</dd>
+ <dt>Bit 0:</dt><dd>Direction (0: up; 1: down)</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>N64 Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>N64 Standard Controller</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>A</dd>
+ <dt>Bit 6:</dt><dd>B</dd>
+ <dt>Bit 5:</dt><dd>Z</dd>
+ <dt>Bit 4:</dt><dd>Start</dd>
+ <dt>Bit 3:</dt><dd>D-Pad Up</dd>
+ <dt>Bit 2:</dt><dd>D-Pad Down</dd>
+ <dt>Bit 1:</dt><dd>D-Pad Left</dd>
+ <dt>Bit 0:</dt><dd>D-Pad Right</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>RST (special controller reset bit)</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>Left Trigger</dd>
+ <dt>Bit 4:</dt><dd>Right Trigger</dd>
+ <dt>Bit 3:</dt><dd>C-Up</dd>
+ <dt>Bit 2:</dt><dd>C-Down</dd>
+ <dt>Bit 1:</dt><dd>C-Left</dd>
+ <dt>Bit 0:</dt><dd>C-Right</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick X-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick Y-Axis (signed 8-bit number)</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>N64 Standard Controller with Rumble</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>A</dd>
+ <dt>Bit 6:</dt><dd>B</dd>
+ <dt>Bit 5:</dt><dd>Z</dd>
+ <dt>Bit 4:</dt><dd>Start</dd>
+ <dt>Bit 3:</dt><dd>D-Pad Up</dd>
+ <dt>Bit 2:</dt><dd>D-Pad Down</dd>
+ <dt>Bit 1:</dt><dd>D-Pad Left</dd>
+ <dt>Bit 0:</dt><dd>D-Pad Right</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>RST (special controller reset bit)</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>Left Trigger</dd>
+ <dt>Bit 4:</dt><dd>Right Trigger</dd>
+ <dt>Bit 3:</dt><dd>C-Up</dd>
+ <dt>Bit 2:</dt><dd>C-Down</dd>
+ <dt>Bit 1:</dt><dd>C-Left</dd>
+ <dt>Bit 0:</dt><dd>C-Right</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick X-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick Y-Axis (signed 8-bit number)</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>N64 Standard Controller with Controller Pak</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>A</dd>
+ <dt>Bit 6:</dt><dd>B</dd>
+ <dt>Bit 5:</dt><dd>Z</dd>
+ <dt>Bit 4:</dt><dd>Start</dd>
+ <dt>Bit 3:</dt><dd>D-Pad Up</dd>
+ <dt>Bit 2:</dt><dd>D-Pad Down</dd>
+ <dt>Bit 1:</dt><dd>D-Pad Left</dd>
+ <dt>Bit 0:</dt><dd>D-Pad Right</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>RST (special controller reset bit)</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>Left Trigger</dd>
+ <dt>Bit 4:</dt><dd>Right Trigger</dd>
+ <dt>Bit 3:</dt><dd>C-Up</dd>
+ <dt>Bit 2:</dt><dd>C-Down</dd>
+ <dt>Bit 1:</dt><dd>C-Left</dd>
+ <dt>Bit 0:</dt><dd>C-Right</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick X-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick Y-Axis (signed 8-bit number)</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>N64 Standard Controller with Transfer Pak</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>A</dd>
+ <dt>Bit 6:</dt><dd>B</dd>
+ <dt>Bit 5:</dt><dd>Z</dd>
+ <dt>Bit 4:</dt><dd>Start</dd>
+ <dt>Bit 3:</dt><dd>D-Pad Up</dd>
+ <dt>Bit 2:</dt><dd>D-Pad Down</dd>
+ <dt>Bit 1:</dt><dd>D-Pad Left</dd>
+ <dt>Bit 0:</dt><dd>D-Pad Right</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>RST (special controller reset bit)</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>Left Trigger</dd>
+ <dt>Bit 4:</dt><dd>Right Trigger</dd>
+ <dt>Bit 3:</dt><dd>C-Up</dd>
+ <dt>Bit 2:</dt><dd>C-Down</dd>
+ <dt>Bit 1:</dt><dd>C-Left</dd>
+ <dt>Bit 0:</dt><dd>C-Right</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick X-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick Y-Axis (signed 8-bit number)</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>N64 Mouse</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>A</dd>
+ <dt>Bit 6:</dt><dd>B</dd>
+ <dt>Bit 5:</dt><dd>0</dd>
+ <dt>Bit 4:</dt><dd>0</dd>
+ <dt>Bit 3:</dt><dd>0</dd>
+ <dt>Bit 2:</dt><dd>0</dd>
+ <dt>Bit 1:</dt><dd>0</dd>
+ <dt>Bit 0:</dt><dd>0</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>0</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>0</dd>
+ <dt>Bit 4:</dt><dd>0</dd>
+ <dt>Bit 3:</dt><dd>0</dd>
+ <dt>Bit 2:</dt><dd>0</dd>
+ <dt>Bit 1:</dt><dd>0</dd>
+ <dt>Bit 0:</dt><dd>0</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Relative X-Axis position (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Relative Y-Axis position (signed 8-bit number)</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>N64 Densha de Go</name>
+ <t>Single Input Length: 4 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>A</dd>
+ <dt>Bit 6:</dt><dd>B</dd>
+ <dt>Bit 5:</dt><dd>Accelerator</dd>
+ <dt>Bit 4:</dt><dd>Start</dd>
+ <dt>Bit 3:</dt><dd>Accelerator</dd>
+ <dt>Bit 2:</dt><dd>0</dd>
+ <dt>Bit 1:</dt><dd>0</dd>
+ <dt>Bit 0:</dt><dd>Accelerator</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>0</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>C</dd>
+ <dt>Bit 4:</dt><dd>Select</dd>
+ <dt>Bits 3-0:</dt><dd>Brake</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>0</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>0</dd>
+ <dt>Bit 4:</dt><dd>0</dd>
+ <dt>Bit 3:</dt><dd>0</dd>
+ <dt>Bit 2:</dt><dd>0</dd>
+ <dt>Bit 1:</dt><dd>0</dd>
+ <dt>Bit 0:</dt><dd>0</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>0</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>0</dd>
+ <dt>Bit 4:</dt><dd>0</dd>
+ <dt>Bit 3:</dt><dd>0</dd>
+ <dt>Bit 2:</dt><dd>0</dd>
+ <dt>Bit 1:</dt><dd>0</dd>
+ <dt>Bit 0:</dt><dd>0</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>GameCube Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>GameCube Standard Controller</name>
+ <t>Single Input Length: 8 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>0</dd>
+ <dt>Bit 6:</dt><dd>0</dd>
+ <dt>Bit 5:</dt><dd>0</dd>
+ <dt>Bit 4:</dt><dd>Start</dd>
+ <dt>Bit 3:</dt><dd>Y</dd>
+ <dt>Bit 2:</dt><dd>X</dd>
+ <dt>Bit 1:</dt><dd>B</dd>
+ <dt>Bit 0:</dt><dd>A</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>1</dd>
+ <dt>Bit 6:</dt><dd>L</dd>
+ <dt>Bit 5:</dt><dd>R</dd>
+ <dt>Bit 4:</dt><dd>Z</dd>
+ <dt>Bit 3:</dt><dd>D-Pad Up</dd>
+ <dt>Bit 2:</dt><dd>D-Pad Down</dd>
+ <dt>Bit 1:</dt><dd>D-Pad Right</dd>
+ <dt>Bit 0:</dt><dd>D-Pad Left</dd>
+ </dl>
+ <t><strong>Octet 2</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick X-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 3</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>Analog Stick Y-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 4</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>C-Stick X-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 5</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>C-Stick Y-Axis (signed 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 6</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>L Analog Value (unsigned 8-bit number)</dd>
+ </dl>
+ <t><strong>Octet 7</strong></t>
+ <dl spacing="compact">
+ <dt>Bits 7-0:</dt><dd>R Analog Value (unsigned 8-bit number)</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Game Boy Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>GB Standard Controller</name>
+ <t>Single Input Length: 1 Octet</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Down</dd>
+ <dt>Bit 6:</dt><dd>/Up</dd>
+ <dt>Bit 5:</dt><dd>/Left</dd>
+ <dt>Bit 4:</dt><dd>/Right</dd>
+ <dt>Bit 3:</dt><dd>/Start</dd>
+ <dt>Bit 2:</dt><dd>/Select</dd>
+ <dt>Bit 1:</dt><dd>/B</dd>
+ <dt>Bit 0:</dt><dd>/A</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Game Boy Color Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>GBC Standard Controller</name>
+ <t>Single Input Length: 1 Octet</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Down</dd>
+ <dt>Bit 6:</dt><dd>/Up</dd>
+ <dt>Bit 5:</dt><dd>/Left</dd>
+ <dt>Bit 4:</dt><dd>/Right</dd>
+ <dt>Bit 3:</dt><dd>/Start</dd>
+ <dt>Bit 2:</dt><dd>/Select</dd>
+ <dt>Bit 1:</dt><dd>/B</dd>
+ <dt>Bit 0:</dt><dd>/A</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Game Boy Advance Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>GBA Standard Controller</name>
+ <t>Single Input Length: 2 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>1</dd>
+ <dt>Bit 6:</dt><dd>1</dd>
+ <dt>Bit 5:</dt><dd>1</dd>
+ <dt>Bit 4:</dt><dd>1</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>/L</dd>
+ <dt>Bit 0:</dt><dd>/R</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Down</dd>
+ <dt>Bit 6:</dt><dd>/Up</dd>
+ <dt>Bit 5:</dt><dd>/Left</dd>
+ <dt>Bit 4:</dt><dd>/Right</dd>
+ <dt>Bit 3:</dt><dd>/Start</dd>
+ <dt>Bit 2:</dt><dd>/Select</dd>
+ <dt>Bit 1:</dt><dd>/B</dd>
+ <dt>Bit 0:</dt><dd>/A</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Genesis Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>Genesis (Mega Drive) 3-Button</name>
+ <t>Single Input Length: 1 Octet</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/C</dd>
+ <dt>Bit 6:</dt><dd>/B</dd>
+ <dt>Bit 5:</dt><dd>/Right</dd>
+ <dt>Bit 4:</dt><dd>/Left</dd>
+ <dt>Bit 3:</dt><dd>/Down</dd>
+ <dt>Bit 2:</dt><dd>/Up</dd>
+ <dt>Bit 1:</dt><dd>/Start</dd>
+ <dt>Bit 0:</dt><dd>/A</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Genesis (Mega Drive) 6-Button</name>
+ <t>Single Input Length: 2 Octets</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/C</dd>
+ <dt>Bit 6:</dt><dd>/B</dd>
+ <dt>Bit 5:</dt><dd>/Right</dd>
+ <dt>Bit 4:</dt><dd>/Left</dd>
+ <dt>Bit 3:</dt><dd>/Down</dd>
+ <dt>Bit 2:</dt><dd>/Up</dd>
+ <dt>Bit 1:</dt><dd>/Start</dd>
+ <dt>Bit 0:</dt><dd>/A</dd>
+ </dl>
+ <t><strong>Octet 1</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Mode</dd>
+ <dt>Bit 6:</dt><dd>/X</dd>
+ <dt>Bit 5:</dt><dd>/Y</dd>
+ <dt>Bit 4:</dt><dd>/Z</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>1</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ </section>
+ </section>
+ <section numbered="true" toc="default">
+ <name>Atari 2600 Controller Types</name>
+ <section numbered="true" toc="default">
+ <name>A2600 Joystick</name>
+ <t>Single Input Length: 1 Octet</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Up</dd>
+ <dt>Bit 6:</dt><dd>/Down</dd>
+ <dt>Bit 5:</dt><dd>/Left</dd>
+ <dt>Bit 4:</dt><dd>/Right</dd>
+ <dt>Bit 3:</dt><dd>1</dd>
+ <dt>Bit 2:</dt><dd>/Button</dd>
+ <dt>Bit 1:</dt><dd>1</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ </section>
+ <section numbered="true" toc="default">
+ <name>A2600 Keyboard Controller</name>
+ <t>Single Input Length: 1 Octet</t>
+ <t><strong>Octet 0</strong></t>
+ <dl spacing="compact">
+ <dt>Bit 7:</dt><dd>/Row1 (key 1, 2, or 3 pressed)</dd>
+ <dt>Bit 6:</dt><dd>/Row2 (key 4, 5, or 6 pressed)</dd>
+ <dt>Bit 5:</dt><dd>/Row3 (key 7, 8, or 9 pressed)</dd>
+ <dt>Bit 4:</dt><dd>/Row4 (key *, 0, or # pressed)</dd>
+ <dt>Bit 3:</dt><dd>/Column1 (key 1, 4, 7, or * pressed)</dd>
+ <dt>Bit 2:</dt><dd>/Column3 (key 3, 6, 9, or # pressed)</dd>
+ <dt>Bit 1:</dt><dd>/Column2 (key 2, 5, 8, or 0 pressed)</dd>
+ <dt>Bit 0:</dt><dd>1</dd>
+ </dl>
+ </section>
+ </section>
+ </section>
+ </middle>
+
+ <back>
+ <references>
+ <name>References</name>
+ <references>
+ <name>Normative References</name>
+ <xi:include href="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
+ <xi:include href="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
+ </references>
+ </references>
+ <section numbered="false" toc="default">
+ <name>Copyright Notice</name>
+ <t>Copyright (c) 2021-2025, Vi Grey, Bigbass, and rasteri</t>
+ <t>All rights reserved.</t>
+ <t>Redistribution and use of this documentation in source (XML format) and/or "compiled" forms (TXT, PDF, HTML, etc), with or without modification, are permitted provided that the following conditions are met:</t>
+ <ol>
+ <li>Redistributions of source code (XML format) of this documentation must retain the above copyright notice, this list of conditions, and the following disclaimer in the documentation.</li>
+ <li>Redistributions in compiled form (Converted to TXT, PDF, HTML, and other formats) of this documentation must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation.</li>
+ </ol>
+ <t>THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</t>
+ </section>
+ <!-- Change Log
+draft 17 - 2025-04-16 Bigbass Improved the wording in the Abstract and Introduction paragraphs. Reordered and expanded on the overview/preliminaries section. Revised wording in a packet diagram example and the Motivations section. Miscellaneous formatting changes. Removed exclusion requirements between INPUT_CHUNK and INPUT_MOMENT packets, as they can be used together now. Clarified what must happen if an INPUT_MOMENT conflicts with INPUT_CHUNK inputs. For INPUT_MOMENT and TRANSITION packets, the Index Type "Microseconds * 10" has been changed to "Microseconds", and a new type "Nanoseconds" has been added. (2^64 nanoseconds is ~584.6 years). Reordered Port field in TRANSITION to match similar ordering in INPUT_MOMENT and other packets.
+
+draft 16 - 2025-02-01 Bigbass Revised "Introduction" paragraphs. Clarified NUL characters in strings. Clarified header version should increase in future versions. Clarified INPUT_MOMENT packets contain only a single instance of input data. Clarified how multiple INPUT_CHUNK packets must be interpreted. Clarified INPUT_CHUNK indexes in TRANSITION packets refer to an individual byte (changed index type name.) Added a "Hold" option to INPUT_MOMENT packets to clarify how long the INPUT_MOMENT should be active for (useful for GB/C/A replays which expect the value to be held until the input changes.) Changed Genesis controller input formats.
+
+draft 15 - 2023-10-15 Bigbass Reordered SNES controller types
+
+draft 14 - 2023-10-13 Bigbass Removed Other encoding option from GAME_IDENTIFIER and clarified which encoding alphabets are used. Added clarifications and improved descriptions of various packets and the Introduction section.
+
+draft 13 - 2023-10-08 VG Change Base to Encoding in GAME_IDENTIFIER packet
+
+draft 12 - 2023-10-08 VG Modify GAME_IDENTIFIER packet, removing CRC-32 and CRC-16 from Type and adding NLEN and Name. Mention seconds since Unix Epoch for Unix timestamps.
+
+draft 11 - 2023-09-24 VG Made OVERREAD packets generic and added Port to it, now is PORT_OVERREAD. Fixed packet drawing error in EXPERIMENTAL. Added SNES_LATCH_FILTER. Added Port to TRANSITION packet. Specify meaning of INPUT_CHUNK offset for Index value of TRANSITION packet.
+
+draft 10 - 2023-09-18 VG Specify that PEXP MUST be greater than 0
+
+draft 09 - 2023-09-17 Bigbass Added "Structure" section to better define the overall structure of a TASD file
+
+draft 08 - 2023-09-14 Bigbass Fixed key numbering for packets SNES_OVERREAD, SNES_GAME_GENIE_CODE, and SNES_LATCH_TRAIN in section 3.2.3
+
+draft 07 - 2023-09-14 Bigbass Changed wording on SNES_LATCH_TRAIN to better explain what each interger represents
+
+draft 06 - 2023-07-15 Bigbass Fixed spelling mistakes
+
+draft 05 - 2023-07-06 VG surround MUST with <bcp14> tag instead of <strong> tag
+
+draft 04 - 2023-07-06 Bigbass Reordered Genesis 3-button and 6-button controller formats to better align with real hardware
+
+draft 03 - 2023-07-06 rasteri Add SNES Super Multitap input format
+
+draft 02 - 2023-07-03 VG Add SNES_LATCH_TRAIN packet description and add []N data type
+
+draft 01 - 2022-09-26 VG Add FALSE state description for EXPERIMENTAL packet and mention draft/experimental packets rather than just experimental packets
+
+draft 00 - 2022-09-24 VG Initial draft
+
+ -->
+ </back>
+</rfc>