NerdTAS File Format

First things first.  Button data needs to be stored somewhere for playback by a NerdTAS robot.  The way I’ve chosen to do that is to invent a simple line-by-line style format that is readable and editable by people with tools no more complex than a text editor.  Due in part to a fair amount of work in the past with 6502 assembly (the CPU in the NES), I chose to make this file format use (mostly) three character tags.

For the format details below, ## represents an integer value and XX represents text value.  All commands appear only one per line.

These are the parts of a .nerdtas file:

NerdTAS Header
This line is required to be the first line in a .nerdtas file and is used to indicate that the file is a NerdTAS file. This tag is case sensitive and must be capitalized as shown.
Syntax: NerdTAS
Options: n/a
Example: NerdTAS
Version Tag
This line is required to be the second line in a .nerdtas file and is used to indicate what version of the NerdTas format the file is in.
Syntax: ver ##
Options: 1 (only 1 version so far)
Example: ver 1
System Tag
This line is required to be the third line in a .nerdtas file and is used to indicate which system the button data is for.
Syntax: sys XX
Options: nes, snes
Example: sys snes
Comment Tag
This command is used to indicate that this is a line of content to be ignored. A comment is a full line only and must start with a # and a space. In other words, a comment is not valid on the same line after another tag.
Syntax: # XX
Options: any text
Example: # Hello World
Frame Duplicator Tag
This command is used to indicate how many frames each button should last. Some games only accept input when they receive the same input multiple consecutive times. This allows those games to work correctly without having to manually duplicate the button data yourself. Note: This value only applies to button data that does NOT have a run length specified. Run length button data is assumed to already be the correct number of frames.
Syntax: dup ##
Options: 1 to 255
Example: dup 2
Frame Delay Tag
This command is used to cause a delay of some number of frames. During this delay, no buttons are pressed. Typical frame rates are around 60 FPS, so multiply the number of seconds you would like to delay by 60.
Syntax: del ##
Options: 1 to 216,000 (roughly 1 hour)
Example: del 300
Button Data (Single Frame)
This command is made up of a number that represent all of the buttons pressed for a single frame. The values allowed for the buttons depend on the system specified. Single frame button data may take more than one frame if a Frame Duplicator value is specified. The values used for buttons are explained below.
Syntax: but ##
Options: NES: 0 to 255, SNES: 0 to 4095
Example: but 240
Button Data (Run Length)
This command is made up of a number that represent all of the buttons pressed for a single frame, and how many frames this button configuration should be held. The values allowed for the buttons depend on the system specified. Run Length button data is not affected by Frame Duplicator values, with the exception of when run length is specified as a single frame.  The values used for buttons are explained below.
Syntax: but ## ##
Options:
Button Value (parameter 1): NES: 0 to 255, SNES: 0 to 4095
Run Length (parameter 2): 1 to 255
Example: but 240 17