HCSCI Panel – FMS customization

Custom HCSCI datarefs for FMS display were created as a unified way of displaying data on HCSCI Panel FMS modules for any custom aircraft.
By default, it supports data from the default X-Plane FMS datarefs and custom datarefs from Zibo B737.
Our FMS datarefs are writable, so if you are familiar with X-Plane programming, you can create a script for your custom aircraft that will write data to HCSCI Plugin FMS datarefs, so this data will be displayed on HCSCI Panel FMS.

So, you will need to get the text and style data for FMS lines from the custom aircraft’s datarefs, and write it into our FMS line datarefs in the correct format, described here.

First, you need to set the override “hcscis/panel/fms_override” or “hcscis/panel/fms2_override” (integer dataref) to “1”, so that the FMS line datarefs will stop reading default data and accept the custom text.

Then, you can write your text data to the “hcscis/panel/fms_line#” or “hcscis/panel/fms2_line#” datarefs (# from 0 to 15).

The HCSCI Plugin FMS Line datarefs are byte array type datarefs that combine both text and style data – each FMS screen character is presented as 2 bytes – the first byte is the character itself, and the second one is the character’s style code.

The first byte represents common characters the same way as they are encoded in the ASCII table, with the exception of some special characters. X-Plane’s default FMS datarefs use several bytes to encode such special characters, but in HCSCI Plugin, they are encoded as a single character. Here are the hexadecimal codes used for special characters:

0x8F – Degrees
0x8D – Box
0x8E – White hexagon
0x88 – Left-facing triangle
0x89 – Right-facing triangle
0x80 – Arrow left
0x81 – Arrow up
0x82 – Arrow right
0x83 – Arrow down
0x7F – Delta

The second byte, containing letter style data, is formatted exactly the same way as in X-Plane’s default FMS line style datarefs, with every bit acting as a flag for different styles.
Full info about it is available here: https://developer.x-plane.com/article/datarefs-for-the-cdu-screen/

Here is the summary of this format (quote from X-Plane developer article):

The highest bit is set for a text displayed in large font. So use mask (1<<7) for the bit that tells you large vs small font.
The second highest bit is set for a text displayed in reverse video (colored background, black text). So use mask (1<<6) for the bit that tells you to invert the colors.
The third highest bit is set for a text displayed flashing (text being turned an and off periodically). So use mask (1<<5) for the bit that tells you to flash.
The fourth highest bit is set for a text with an underscore. So use mask (1<<4) for the bit that tells you to display an underscore under the character.
The remaining four bits encode the color of the text (or the background for reverse video): BLACK(0),CYAN(1),RED(2),YELLOW(3),GREEN(4),MAGENTA(5),AMBER(6),WHITE(7).

For example, the line for displaying the letters “FMS” in large white letters will be this (6 bytes):

| F | 0x87 | M | 0x87 | S | 0x87 |