The Description opcode is how you "call" the RIC-based Font drawing routine in an RIC file with the enhanced NBC/NXC firmware. It is a no-op opcode except for within the LEGO MINDSTORMS NXT software for previewing a simple RIC file in the Display block's configuration panel. I believe that the preview uses the Width and Height fields of the Description opcode but not the Options field.
In the enhanced NBC/NXC firmware if the Options field of the Description opcode is equal to DESC_FONTOUT (0x8001) then it calls the cCmdDrawFont function to draw the text using the sprite with ID == 1. The Description opcode's Width and Height fields are used as the font's standard character width and height.
Andreas Dreier is working on a cross platform version of nxtRICeditV2 so I am not sure I see the point to reinventing the wheel for a third time. Nobody understands the format better than Andreas.
I don't understand what you mean by parameters being limited to numbers from 0 to 255. I don't think that is the case (if you mean parameter values that can be passed into RIC files via the GraphicOutEx API function). The type of the image variables array is signed long. You can have 256 entries in the variables array simply because of the way that values in the various opcodes are masked/encoded as parameterized rather than hard-coded values.
Code: Select all
#define IMG_SYMB_USEARGS(_v) (_v & (SWORD)0xF000)
#define IMG_SYMB_MAP(_v) ((_v & 0x0F00) >> 8)
#define IMG_SYMB_ARG(_v) (_v & 0x00FF)
So each value (such as the x coordinate of the first point of a line opcode) is decoded to see if it is parameterized or not using these macros. This allows for a hard-coded value of up to 4095. If the value is encoded as a parameterized value then you have the 0xF00 bits used to determine what the VarMap index is (if any) and then you have the 0xFF bits to specify the index into the variables array. The standard firmware uses 0x000F instead of 0x00FF so it can only accept 16 values in the variables array.
The nxtRICedit documentation link you refer to is talking about the Description opcode which it calls the Information element. The reference to "only used by NXT-G" is talking about the entire Information element (aka Description opcode) and not the Options field within that opcode. Technically, if you set the Options field of the Information element to 0x8001 then it is no longer an Information element but a DrawFont element (or opcode) instead (with the enhanced NBC/NXC firmware, anyway).
I don't really understand your questions about VarMaps. You can't parameterize the output of a VarMap (i.e., link or chain multiple VarMaps together). You could have a really big sprite that has data way out at x = 65530 and need to draw that part of the sprite image on the screen so the output or Range of a VarMap is an unsigned word (0..65535). Large VarMap output values would not be so useful when drawing lines, points, rectangles, circles, ellipses, or polygons.
John Hansen