Skip to main content

Plotting and display

This category contains instructions for drawing shapes and printing text with format.

0x50 Pixel Dots on Background

Plot 16 black and white pixel dots in a row at given cooredinates on the background graphic buffer and display on the secondary display (OLED). The coordinates can be directly by literal values or indirectly by registers.

INST_MARK_GFX_BG_DOTSHEXsOP00sOP01OP-1
Plot 16 black and white pixel dots in a row at location (00,04) on the OLED 5000043603

The pixel area on the display is X[0,127],Y[0,63]X∈[0,127], Y∈[0,63], or X[0,(7F)16,Y[0,(3F)16]X∈[0,(7F)_{16}, Y∈[0,(3F)_{16}] in hexadecimal.

Pixels are binary, 0 for a black pxiel ■, and 1 for a white pixel.

In the example, OP-1 is 3603, in binary:

(3603)16=(0011  0110  0000  0011)2(3603)_{16}=(0011\;0110\;0000\;0011)_{2}

Starting at location (0,4), plot the following line:

Secondary Display

■■□□■□□■■■■■■■□□

info
OP/sOPValue/RangeRemarks
sOP0000~7FHorizontal coordinate X
sOP0100~3FVertical coordinate Y
OP-10000~FFFFBinary pixels in hexadecimal

0x51 Pixel Dots on Texture Buffers

Plot 16 binary pixel dots on a specified row of a chosen texture buffer.

tip

There are 16 texture buffers, indexed 00 ~ 0F.

INST_MARK_GFX_FG_DOTSHEXsOP00sOP01OP-1
Plot 16 pixel dots on texture buffer 0F, row 07510F073603
info
OP/sOPValue/RangeRemarks
sOP0000~0FTexture buffer index
sOP0100~0FRow
OP-10000~FFFFHexadecimal for pixel dots

0x55 Printing Formatted Values

Print formatted values of registers at specific coordinates on the secondary display.

INST_PUT_TEXT_WITH_FMTHEXsOP00sOP01sOP10sOP11
At (0,16) print the value of register 01, with format code 0x115511010010
At coordinates stored in R04, print the value of register 01, with format code 0x125512018004
info
  • sOP00 Format code for numbers and font size, e.g. 0x11 is for unsigned decimal integer numbers with midium sized fonts:

    • High Byte:

      ValueFormatValueFormat
      00Signed decimal integer04Hexadecimal
      01Unsigned decimal integer08Option 0 with Fixed Length
      02Binary09Option 1 with Fixed Length
      03Octal0BString buffer (experimental)
    • Low Byte:

      Value/RangeFont size
      0Small
      1Medium
      2Large
  • sOP01 Register index;

  • sOP10

    Value/RangeRemarks
    0x00~0x7FX coordinate of background,ranging from 0~127 in decimal
    0x80Get X and Y coordinates from register specified by sOP11
  • sOP11: Depends on sOP10

    sOP10
    0x00~0x7FY coordinate of background,ranging from 0~63 in decimal
    0x80Index of register for coordinates, high byte for X and low byte for Y coordinates
tip
  • Coordinates ranges: 0 ≤ X ≤ 127,0 ≤ Y ≤ 63;
  • In example 1, the value in register 01 will be displayed in format 0x11, i.e. unsigned decimal integer with medium font size, at (0, 16) on the secondary display;
  • In example 2, suppose the value in R04 is 0x0420, the value in register 01 will be displayed in format 0x12, i.e. unsigned decimal integer with large font size, at (0x04, 0x20) or (4, 32) indecimal, on the secondary display.

0x56 Draw a Circle

Draw a circle at specified coordinates, with desired radius.

INST_DRAW_CIRCLEHEXsOP00sOP01sOP10sOP11
At (16,16) draw a white edge circle with 5 pixels radius 5605001010
At coordinates stored in R04, draw a black edge circle with 18 pixels radius5612018004
info
  • sOP00 radius,00~FF

  • sOP01 colour of the edge

    Value/RangeRemarks
    0x00Black edge
    0x01White edge
  • sOP10

    Value/RangeRemarks
    0x00~0x7FX coordinate of background,ranging from 0~127 in decimal
    0x80Get X and Y coordinates from register specified by sOP11
  • sOP11: Depends on sOP10

    sOP10
    0x00~0x7FY coordinate of background,ranging from 0~63 in decimal
    0x80Index of register for coordinates, high byte for X and low byte for Y coordinates
特别说明
  • Coordinates ranges: 0 ≤ X ≤ 127,0 ≤ Y ≤ 63;
  • In example 2, suppose the value in R04 is 0x0420, a black edged circle with radius of 18 pixels will be shown at (0x04, 0x20) or (4, 32) indecimal, on the secondary display.

0x5C Display Two Chars

Display two ASCII characters at specified coordinates.

INST_DISP_CHARHEXsOP00sOP01sOP10sOP11
At (16,16), display "AB"5C41421010
At coordinates stored in R04, display two characters "CD"5C63648004
info
  • sOP00 ASCII character,starts from 0x20 (space)

  • sOP01 ASCII character,starts from 0x20 (space)

  • sOP10

    Value/RangeRemarks
    0x00~0x7FX coordinate of background,ranging from 0~127 in decimal
    0x80Get X and Y coordinates from register specified by sOP11
  • sOP11: Depends on sOP10

    sOP10
    0x00~0x7FY coordinate of background,ranging from 0~63 in decimal
    0x80Index of register for coordinates, high byte for X and low byte for Y coordinates
tip
  • In example 2, suppose the value in R04 is 0x0420, two characters "AB" will be shown at (0x04, 0x20) or (4, 32) indecimal, on the secondary display.

0x5D Show Characters in Multiple Registers

Display a series of ASCII characters at specified coordinates.

INST_DRAW_REGx_CHARHEXsOP00sOP01sOP10sOP11
At (16,16), display 5 ASCII characters stored in a series of registers starting from R015D05011010
At coordinates stored in R04, display 5 ASCII characters stored in a series of registers starting from R015D05018004
info
  • sOP00 Number of characters to display

  • sOP01 Starting register index

  • sOP10

    Value/RangeRemarks
    0x00~0x7FX coordinate of background,ranging from 0~127 in decimal
    0x80Get X and Y coordinates from register specified by sOP11
  • sOP11: Depends on sOP10

    sOP10
    0x00~0x7FY coordinate of background,ranging from 0~63 in decimal
    0x80Index of register for coordinates, high byte for X and low byte for Y coordinates
Explanation
  • In example 1,suppose R01 is 0x4865('H' and 'e'),R02 is 0x6C6C('l' and 'l'),R03 is0x6F21('o' and'!'). At (16,16) display a series of characters 'Hello'. As number of characters is set to 5, '!' as the sixth will not be shown.
  • In example 2,suppose the value in R04 is 0x0420, then the same word hello is displayed at (0x04, 0x20), or (4, 32) in decimal.