From CloudModding TWW Wiki

This page documents the control codes used in The Wind Waker. Control codes modify the text drawn to the screen in some way, such as inserting button icon images or causing the text to halt for a specific period of time.

There are three control code structures differentiated by the size - five bytes, six bytes, and seven bytes.

Five-byte Codes

These control codes are five bytes long and have the following format:

/*0x00*/ const byte Identifier = 0x1A; //This signals a control code
/*0x01*/ byte CodeLength;
/*0x02*/ bool IsSoundCode;
/*0x03*/ short CodeType;

While the vast majority of the five-byte-long control codes follow this format, the code that causes a sound to play when it is reached is slightly different. This code identifies itself with the bool at offset 0x02 within the code. When this bool is true, CodeType actually refers to the ID of the sound to play rather than the code's type.

Below is a list of the valid code types and their meanings.

Code Meaning
0x00 Player Name
0x01 Change Draw Type to Instant
0x02 Change Draw Type to Per-Character
0x03 Unused
0x04 Unused
0x05 Unused
0x06 Unused
0x07 Unused
0x08 Two Dialog Options
0x09 Three Dialog Options
0x0A A Button Icon
0x0B B Button Icon
0x0C C-Stick Icon
0x0D L-Trigger Icon
0x0E R-Trigger Icon
0x0F X Button Icon
0x10 Y Button Icon
0x11 Z Button Icon
0x12 D-Pad Icon
0x13 Static Control Stick Icon
0x14 Left Arrow Icon
0x15 Right Arrow Icon
0x16 Up Arrow Icon
0x17 Down Arrow Icon
0x18 Control Stick Moving Up Icon
0x19 Control Stick Moving Down Icon
0x1A Control Stick Moving Left Icon
0x1B Control Stick Moving Right Icon
0x1C Control Stick Moving Up/Down Icon
0x1D Control Stick Moving Left/Right Icon
0x1E Dialog Option 1
0x1F Dialog Option 2
0x20 Remaining Cannonballs in Cannonball Minigame
0x21 Broken Vase Payment
0x22 Auction Character Name
0x23 Auction Item Name
0x24 Auction Bid Amount
0x25 Auction Starting Bid Amount
0x26 Player Auction Bid Selector
0x27 Starbust A Button Icon
0x28 Blow Count in Orca Training Minigame
0x29 Pirate Ship Password
0x2A Target Starburst Icon
0x2B Letter Count in Post Office Sorting Minigame
0x2C Rupee Reward in Post Office Sorting Minigame
0x2D Post Box Letter Count
0x2E Remaining Koroks in Dying Tree Sidequest
0x2F Remaining Time before Forest Water Spoils
0x30 Game Time in Flight Platform Minigame
0x31 Record Time in Flight Platform Minigame
0x32 Beedle Point Count
0x33 Ms. Marrie's Joy Pendent Count
0x34 Ms. Marrie's Joy Pendent Total
0x35 Time for Windfall Island Pig Minigame
0x36 Rupee Reward for Sailing Minigame
0x37 Current Bomb Capacity
0x38 Current Arrow Capacity
0x39 Heart Icon
0x3A Music Note Icon
0x3B Target Letter Count for Post Office Sorting Minigame
0x3C Hit Count for Fishman Minigame
0x3D Rupee Reward for Fishman Minigame
0x3E Boko Baba Seed Count
0x3F Skull Necklace Count
0x40 Chu Jelly Count
0x41 Joy Pendent Count
0x42 Golden Feather Count
0x43 Knight's Crest Count
0x44 Price Offer from Beedle
0x45 Boko Baba Seed Sell selector
0x46 Skull Necklace Sell Selector
0x47 Chu Jelly Sell Selector
0x48 Joy Pendent Sell Selector
0x49 Golden Feather Sell Selector
0x4A Knight's Crest Sell Selector

Six-byte Codes

There is only one code that is six bytes long, and it changes the color of the text being drawn. It is formatted as follows:

/*0x00*/ const byte Identifier = 0x1A; //This signals a control code
/*0x01*/ byte CodeLength;
/*0x02*/ byte Unknown1; //Always 0xFF?
/*0x03*/ byte Unknown2; //Always 0x00?
/*0x04*/ short ColorIndex;

ColorIndex refers to the index of the color as they are defined in the game's BMC file, which in The Wind Waker is found within the same archive as the BMG file.

Seven-byte Codes

Seven-byte-long control codes are used for two main purposes: changing the size of the text being drawn and causing the text to stop drawing for a given period of time. They are formatted as follows:

/*0x00*/ const byte Identifier = 0x1A; //Indicates control code start
/*0x01*/ byte CodeLength;
/*0x02*/ byte Unknown1; //Normally this is 0x00, but for the code that changes text size it's 0xFF
/*0x03*/ short CodeType;
/*0x05*/ short CodeData;

The possible values for CodeType and the meaning of CodeData are described below.

Code Meaning CodeData
0x00 Unused Unused
0x01 Set Text Size Text Scale Percentage
0x02 Unused Unused
0x03 Wait and Dismiss (With Player Prompt) Wait Time
0x04 Wait and Dismiss (Without Player Prompt) Wait Time
0x05 Dismiss Time before Dismissal
0x06 Dummy? Unknown
0x07 Wait Wait Time

CodeType 0x06 is found only once in The Wind Waker's text, but it has no noticable effect. It is possible that the code type was removed, but not all references to it were deleted.