Interpreting Action Class 1

Go back to the Action Class index

Nibble 1 Class
The code for this action class can in theory be as long as you need, as each byte is one of two things. A byte can be either a 'string to print' or transition data (changing a tile's nibble/byte data) The first set of bytes are ALWAYS a string. The last byte in the set of string bytes is signified by a bit 7 set. All other string bytes before this have a bit 7 clear.

After the string bytes, there are two "transition" bytes or an 0xFF byte.

If the Action Class nibble immediately following the last string byte is "0xFF" then the tile is unchanged, and therefore is the last byte of the string.

The first byte is only interesting for the lower 4 bits, which are used to change the nibble data (Action Class) for this tile (and so has values in the range 0x0->0xf. The second byte is the new Action Selector byte for this tile., and so there is only 1 byte after the strings.

Deciphering the String Byte
Here is how that String byte is interpreted:



Now you'll note that the String Pointer value is only EVEN NUMBERED (because it is ANDED with 0xFE), this is because String pointers are two-bytes long, so pointer 0 is at offset 0x00, but pointer 1 is at 0x02.. and so on.

Encoding the String Byte
So in order to make this byte, you use the following pseudo-code: