SuperH-based fx calculators
fx-CG20, display

fx-CG syscalls, overview

legacy display syscalls

syscall 0x0002 : int HourGlassTimer( void );
Returns the current HourGlassBitmapNumber. The function uses the RTC and some system variables to switch the HourGlassBitmapNumber every second.

syscall 0x0003 : void DrawHourGlass( int HourGlassBitmapNumber );
Displays one of the four the HourGlassBitmaps (direct draw).

syscall 0x0194 : int Bdisp_SetDDRegisterB( int mode );
Sets the LCD controller to C:3-mode (mode==0) or to C:16-mode (mode==1).

syscall 0x0195 : int Bdisp_IsZeroDDRegisterB( void );
If this call returns 0, the LCD controller is in C:3-mode, else it is in C:16-mode.

syscall 0x0199 : void Bdisp_SetBacklightLevel( char level );
Sets the backlight level. level can be between 1 and 5 (meaning an actual value of 0x032, 0x078, 0x0D2, 0x16E, 0x1A0 in a range of 0..0x1FF).

syscall 0x019A : void Bdisp_WriteDDRegister5A1( unsigned char finelevel );
LCD's light fine adjustment. The main backlight level is controlled by bit 4 of SH-7724 port N 0xA4050138.

syscall 0x01a2 : void Bdisp_DDRegisterSelect( int registerno );
seems to be responsible to write some LCD controller (0xB4000000) register number. It clears bit 4 of 0xA405013C.b, writes P1 (r4) to 0xB4000000 and finally sets bit 4 of 0xA405013C.b again (it looks as if this bit controls the LCD-driver's RS-bit; refer to the R61509-manual). After every write to 0xA405013C or 0xB4000000, the SH-4A processor instruction SYNCO is performed.

syscall 0x01a3 : void Bdisp_DefineDMARange( int, int, int, int );
is involved in preparing the DMA-process in Bdisp_PutDisp_DD(), as well. Details will follow!

syscall 0x01a6 : unsigned short Bdisp_WriteDDRegister3_bit7( int value );
sets or clears bit 7 of the LCD controller register 3 , depending on bit 0 of value. (R61509: register "Entry Mode" bit "ORG")
Returns the written short.
The bit is cleared, before the color of a point has to be read (syscall 0x026F).
The bit is set, before the color of a point has to be written (syscall 0x026B).

syscall 0x01a7 : unsigned short Bdisp_ReadDDRegister3_bit7( void );
Returns 0 or 1, depending on bit 7 of LCD controller register 3.

syscall 0x01a8 : void Bdisp_PutPixel_x3( int x, int y, int color );
Set a b/w 3x3 pixel in legacy mode.

syscall 0x01C0 : void Bdisp_ShapeToDD( TShape*shape, int color );
Writes directly to the display.
The TShape-members on_bits and off_bits are not used any more. Maybe they are obsolete.
color is the color which ist used to draw the shape.
one is always 1.
The fxCG shape-functions cannot use the statusline-area.

syscall 0x01C1 : void Bdisp_ShapeToVRAM( TShape*shape, int color );
Writes to the VRAM. See 0x1C0 for more details.

syscall 0x01C2 : void Bdisp_ShapeToVRAMDD( TShape*shape, int color );
Writes to the VRAM and directly to the display. See 0x1C0 for more details.

syscall 0x01C3 : void Bdisp_ShapeToDD16C( TShape*shape, int color16 );
Writes directly to the display.
The TShape-members on_bits and off_bits are used any more. Maybe they are obsolete.
color16 is the color-index (see 0x0265) which ist used to draw the shape.
one is always 1.
The fxCG shape-functions cannot use the status-area.

syscall 0x01C4 : void Bdisp_ShapeToVRAM16C( TShape*shape, int color16 );
Writes to the VRAM. See 0x1C3 for more details.

syscall 0x01C5 : void Bdisp_ShapeToVRAMDD16C( TShape*shape, int color16 );
Writes to the VRAM and directly to the display. See 0x1C3 for more details.

syscall 0x01C7 : void Bdisp_ShapeBase( unsigned char work[28], TShape*shape, unsigned short color, int linewidth, int P5, int P6 );
Draws a shape. Set P5 and P6 to 0.
linewidth: width of the line in pixel.
If bit 0 of work[ 0 ] is set, the shape is written to VRAM.
If bit 1 of work[ 0 ] is set, the shape is written directly to the display.

syscall 0x01D0 : void Bdisp_Line3X_Draw( int x0, int y0, int x1, int y1 );
Draws a 3X-dot line. 0x24 is automatically added to the y-coordinates.

syscall 0x01D1 : void Bdisp_Line3X_Clear( int x0, int y0, int x1, int y1 );
Clears a 3X-dot line. 0x24 is automatically added to the y-coordinates.

syscall 0x01D2 : void Bdisp_LineC16( int x0, int y0, int x1, int y1, int mode, char c16 );
Draws a line. 0x24 is automatically added to the y-coordinates.
mode == 1: draw
mode == 2: clear

syscall 0x01D8 : void Bdisp_Line( int x0, int y0, int x1, int y1, char c3 );
Draws a line. 0x24 is automatically added to the y-coordinates.

syscall 0x01E5 : unsigned int GetVRAMBackgroundAddress( void ); syscall 0x01E6 : unsigned int GetVRAMAddress( void );
The VRAM starts at 0x88000000/0xA8000000. It is to recommend to use 0xA8000000, because it is non-cacheable. 384x216 pixel (2 byte per pixel).
A single pixel physically consists of three cells (5:6:5).
The left cell controls the red part (bits 15..11 of the color word).
The middle cell controls the green part (bits 10..5 of the color word).
The right cell controls the blue part (bits 4..0 of the color word).

syscall 0x01F5: unsigned int Cursor_GetSettings(unsigned int settingsarray[]);
This function returns (unsigned int)Flash mode.
unsigned int column;
unsigned int row;
unsigned int flashstyle;
unsigned int flashmode;
unsigned int cursor_setting_5;

syscall 0x01F8 : void PrintCXY(int x, int y, unsigned char*cptr, int mode_flags, int P5, int P6 );
only for reference:
Calls 0x0239( x, y, cptr, mode_flags, P6, 1, -1, 0, P5 ).

P5 : 0
P6 : -1

Due to parameter 8 == 0 the function obviously does nothing.

syscall 0x01F9 : void Print_OS( unsigned char*msg, int invers, int zero2 );

syscall 0x0208 : void PrintChar( unsigned char*msg, int mode, int P3, int C3_color1, int C3_color2, int P6 );
Prints the char pointed to by msg. Uses color1 as text-color and color2 as background-color. If bit 0 of mode is set, the character is printed reverse.

syscall 0x0209 : void PrintChar( unsigned char*msg, int mode, int C3_color1, int P4 );
Calls 0x0208( msg, mode, -1, C3_color1, 7, P4 )

syscall 0x021B : void PrintMiniMini( int*x, int*y, unsigned char*MB_string, int mode1, char  color, int mode2 );
Writes MB_string  at *x and *y in the "MiniMini" font. color is a C:3 color in the range 0..7. If mode2 is not zero, the function does not write. Under normal círcumstances the status area cannot be written to, t. i. 0x24 is added to the y-coordinate automatically. This behaviour can be unlocked with mode1 bit 6.
mode1 bit 0: the string is written using color as back color. The font color is white.
mode1 bit 1: no obvious effect.
mode1 bit 2: the string is written using black as back color. The font color is the inverted color.
mode1 bit 3: no obvious effect.
mode1 bit 4: the string font is written boldfaced.
mode1 bit 5: no obvious effect.
mode1 bit 6: the status area is unlocked.
mode1 bit 7: blank out the background, which would be used by the string.

syscall 0x0238 : void PrintCXY(int x, int y, void*glyphno, int mode_flags, int P5, int color, int back_color, int P8, int P9 );
Draws a glyph.

x x-position in pixel
y y-position in pixel (modified by mode_flags, see below)
glyphno: pointer to glyphno to draw
mode_flags:
0x40: allows to draw into the status-area; if this bit is not set, the y-position is automatically incremented by 24.
0x02: inverts color.
0x01: inverts color and back_color
color color used to draw the glyph
back_color: color used to draw the background

The remaining arguments are not unravelled, yet. Though, P5  should be set to -1, P8  should be set to 1, P9  should be set to 0.

syscall 0x0239 : void PrintCXY(int x, int y, unsigned char*cptr, int mode_flags, int P5, int color, int back_color, int P8, int P9 );
Draws a single character.

x : x-position in pixel
y : y-position in pixel (modified by mode_flags, see below)
cptr : pointer to the character to draw
mode_flags :
0x40: allows to draw into the status-area; if this bit is not set, the y-position is automatically incremented by 24.
0x02: inverts color.
0x01: inverts color and back_color
color : color used to draw the glyph
back_color : color used to draw the background

The remaining arguments are not unravelled, yet. Though, P5  should be set to -1, P8  should be set to 1, P9  should be set to 0.

syscall 0x023B : void PrintMiniGlyph(int x, int y, void*glyph, int mode_flags, int glyph_width, int P6, int P7, int P8, int P9, int color, int back_color, int P12 );
Draws a mini-glyph.

x x-position in pixel
y y-position in pixel (modified by mode_flags, see below)
glyph: pointer to mini-glyph to draw
mode_flags: see 0x023C
glyph_width: count of bits to be used of the mini-glyph-array shorts (from left)
color: see 0x023C
back_color: see 0x023C

The remaining arguments are not unravelled, yet. Though, P6, P7, P8, P9 and P12 should be set to 0.

syscall 0x023C : void PrintMini( int*x, int*y, unsigned char*MB_string, int mode_flags, unsigned int xlimit, int P6, int P7, int color, int back_color, int writeflag, int P11 );
Draws a MB-string using mini-glyphs.

x: pointer to x-position in pixel (x is changed to the next print-position)
y: pointer to y-position in pixel (modified by mode_flags, see below)
MB_string: string to draw, supports multi-bytes
mode_flags:
0x40: allows to draw into the status-area; if this bit is not set, the y-position is automatically incremented by 24.
0x04: inverts color and back_color (if mode_flag 0x02 is set).
0x02: do not use back_color.
color: color used to draw the mini-glyph
back_color: color used to draw the string's background (depends on mode_flags, see above)
xlimit: upper x-limit. Ignored, if set to 0xFFFFFFFF.
writeflag: if 1, MB_string is written; if 0 only x is incremented.

The remaining arguments are not unravelled, yet. Though, P6, P7 and P11 should be set to 0.

syscall 0x023F : void PrintMiniMini2( int*x, int*y, unsigned char*MB_string, int mode_flags, unsigned int xlimit, int P6, int P7, int color, int back_color, int writeflag, int P11 );
Draws a MB-string using "MiniMini"-glyphs.
Seems to be similar to syscall 0x023C.
mode_flags has the same functions as mode1 in syscall 0x021B.
xlimit does not seem to be supported properly.

syscall 0x025F : void Bdisp_PutDisp_DD( void );
Transfers the complete VRAM to the display-RAM using DMA.

Direct display access

The SH-7724 DMAC-address for this operation is 0xFE008020 (channel 0). The address of DMAOR is 0xFE008060. The base address of the displaydriver is 0xB4000000, which does not mean, that this address can be used to write directly to the display! The processor instruction SYNCO seems to sync the MPU/DD-interaction. Bdisp_PutDisp_DD() clears bit 21 of MSTPCR0 (0xA4050130) before starting to program the DMAC (this bit controls the DMAC0 clock).

syscall 0x0260 : void Bdisp_PutDisp_DD_stripe( int y1, int y2 );
Transfers the VRAM from row y1 to row y2 to the display-RAM using DMA, giving a speed advantage if only a limited range has to be transferred.

syscall 0x0262 : void Bdisp_SetPoint_VRAM_WB( int x, int y, unsigned short color );
increments y by 24 before setting the point, skipping the 24 pixel status-area on top of the screen.

syscall 0x0263 : void Bdisp_SetPoint_VRAM( int x, int y, unsigned short color );
 

syscall 0x0264 : void Bdisp_SetPoint_VRAM_WB_C3( int x, int y, unsigned short color_idx );
like syscall 0x0265; with an automatically applied 24 pixel y-offset

syscall 0x0265 : void Bdisp_SetPoint_VRAM_C3( int x, int y, unsigned short color_idx );
Though 16 colors would be possible, only eight colors are supported. Instead of a RAM-colortable, they use a ROM-colortable, which is very annoying.
color_idx: 0 => color 0x0000 (black)
color_idx: 1 => color 0x001F (blue)
color_idx: 2 => color 0x07E0 (green)
color_idx: 3 => color 0x07FF (green+blue, cyan)
color_idx: 4 => color 0xF800 (red)
color_idx: 5 => color 0xF81F (red+blue, magenta)
color_idx: 6 => color 0xFFE0 (red+green, yellow)
color_idx: 7 => color 0xFFFF (white)
color_idx: 8 => color 0x0008 ()
color_idx: 9 => color 0x0009 ()
color_idx: A => color 0x000A ()
color_idx: B => color 0x000B ()
color_idx: C => color 0x000C ()
color_idx: D => color 0x000D ()
color_idx: E => color 0x000E ()
color_idx: F => color 0xFFDF ()

syscall 0x0266 : unsigned short Bdisp_GetPoint_VRAM_WB( int x, int y );
increments y by 24 before fetching the point, skipping the 24 pixel status-area on top of the screen.

syscall 0x0267 : unsigned short Bdisp_GetPoint_VRAM( int x, int y );

syscall 0x026B : void Bdisp_SetPoint_DD( int x, int y, unsigned short color );
Writes a point directly to the display.
Writing the whole screen with 0x026B is 70 times slower than writing and transferring the complete VRAM to display-RAM using DMA.

syscall 0x026F : unsigned short Bdisp_GetPoint_DD( int x, int y );

syscall 0x0272 : void Bdisp_AllClr_VRAM( void );

syscall 0x0275 : void Bdisp_Fill_VRAM( int color, int mode );
mode 1: fills VRAM below the status-area with color.
mode 2: fills VRAM between the status-area and the FKey-area with color.
mode 3: fills VRAM with color.
mode 4: == mode 3

syscall 0x0276 : void Bdisp_Fill_DD( int color, int mode );
mode 1: fills DD below the status-area with color.
mode 2: fills DD between the status-area and the FKey-area with color.
mode 3: fills DD with color.

syscall 0x0278 : void Bdisp_Fill_DD_1( int color );
Calls 0x0276, Bdisp_Fill_DD( color, 1 ).

syscall 0x027A : void Bdisp_Fill_VRAM_2( int color );
Calls 0x0275, Bdisp_Fill_VRAM( color, 2 ).

syscall 0x0283 : void C16WorkbenchToC3Workbench( void*p );
Transfers the Workbench-VRAM as C3-image to p*. p points to a 0x9000-byte buffer.

syscall 0x028F : void Bdisp_WriteGraphVRAM_WB( TDispGraph*gd );
See 0x0290. This function adds 24 to all y-coordinates before drawing to skip the 24 pixel status-area on top of the screen.

syscall 0x0290 : void Bdisp_WriteGraphVRAM( TDispGraph*gd );
Puts a bitmap to VRAM.

typedef struct{
    int x;
    int y;
    int xofs;
    int yofs;
    int width;
    int height;
    char colormode;
    char zero4;
    char P20_1;
    char P20_2;
    int bitmap;
    char color_idx1;
    char color_idx2;
    char color_idx3;
    char P20_3;
    char writemodify;
    char writekind;
    char zero6;
    char one1;
    int transparency;
} TDispGraph;

x, y : position in pixel, where to put the bitmap;
xofs, yofs : offset inside of the bitmap, where to start drawing;
width, height: width and height of the bitmap to draw;
colormode: : 1=4 bit per pixel, color16; 2=full color, 16 bit per pixel; 3=monochrome, color16, one bit per pixel.
bitmap: pointer to the bitmap.
color_idx1: 16color-index of the color, which is used to draw a set bit (colormode 3).
color_idx2: 16color-index of the color, which is used to draw a cleared bit (colormode 3).
color_idx3: 16color-index of the color, which is transparent.
writemodify: 1=normal; 2=reverse; 3=halftone
writemode: 1=overwrite; 2=OR-write; 3=AND-write; 4:XOR-write;
transparency: 0..100 %.

The color16-table supports 8 colors only (see syscall 0x0265).

syscall 0x0291 : void Bdisp_WriteGraphDD_WB( TDispGraph*gd );
See 0x0290. This function adds 24 to all y-coordinates before drawing to skip the 24 pixel status-area on top of the screen.
Though, negative TDispGraph.y are allowed.

syscall 0x02A3 : unsigned short FrameColor( int mode, unsigned short color  );
mode
0: sets the word at 0xFD801460 to 0xFFFF.
mode 1: sets the word at 0xFD801460 to color.
Returns the value of word at 0xFD801460.

syscall 0x02A4 : unsigned char FrameColorIndex( int mode, unsigned char c3  );
mode
0: sets the byte 0xFD8014A5 to -3 (0xFD).
mode 1: sets the byte 0xFD8014A5 to c3.
Returns the value of byte 0xFD8014A5.
0xFD8014A5 resides in the IL-memory. The FrameColorIndex set by syscall 0x02A4 is used by syscall 0x02A9.

syscall 0x02A8 : void DrawFrame( unsigned short color  );
Draws a colored frame.

syscall 0x02A9 : void DrawFrameC3( char c3  );
Draws a colored frame. The color, which is used, is based on the color-index c3, if the FrameColorIndex set by syscall 0x02A4 is not in the range 0..7. Otherwise FrameColorIndex set by syscall 0x02A4 is used.

syscall 0x02AA : void DirectDrawRectangle( int x1, int y1, int x2, int y2, unsigned short color );
Draws a rectangle at any position of the display using color.
x: 0..398
y: 0..224

syscall 0x02B2 : void Bdisp_AreaClr( TBdispFillArea*area, unsigned char target, unsigned short color );

struct TBdispFillArea {
    int x1;
    int y1;
    int x2;
    int y2;
    unsigned char mode;
};

if
area.mode is 0, the area will be filled white.
if area.mode is 1, the area will be filled with color.
if area.mode is 2, the area will be shaded with color.
if area.mode is 4, the area will be inverted.

If bit target.0 is set, the function performs a VRAM-operation.
If bit target.1 is set, the function performs a DD-operation.

The function is somehow peculiar, if VRAM inverting. It uses the color-value of the point 24 Y-units below.
If DD inverting, it uses the first color-value of the point 24 Y-units below, to fill the whole area.
Most probably, the inverting function is not used at all. This seems to be a bug.

syscall 0x02B7 : int EnableStatusArea( int P1 );
Influences the int system variable at 0x8804F52C (fxCG-20 OS 01.02.0200).

P1 == 0 or 2: enable status area (*(int*)0x8804F52C = 1)
P1 == 1: nop
P1 == 3:
disable status area (*(int*)0x8804F52C = 0)

returns the current value
 

syscall 0x02B8 : int DefineStatusAreaFlags( int P1, int P2, void*P3, void*P4 );

P1 == 0:
sets the char system variables at 0x8804F48C and 0x8804F48D to 7.
sets the status-icon-display-flags to 0. Ignores P2, P3 and P4.
P1 == 1: sets the char system variables at 0x8804F48C and 0x8804F48D to 7.
sets the status-icon-display-flags to 0x303. Ignores P2, P3 and P4.
P1 == 2:
if P3 is not zero, the char system variable at 0x8804F48C is returned in *P3.
if P4 is not zero, the char system variable at 0x8804F48D is returned in *P4.
Ignores P2.
P1 == 3:
if P3 is not zero, the char system variable at 0x8804F48C is set to *P3.
if P4 is not zero, the char system variable at 0x8804F48D is set to *P4.
The status-icon-display-flags are set to P2.
P1 == 4: the status-icon-display-flags are "OR"ed with P2 (flags are set).
P1 == 5: the status-icon-display-flags are "NOT AND"ed with P2 (flags are cleared)

returns the status-icon-display-flags

status-icon-display-flags:
0x0001: show battery icon
0x0002: show alpha/shift icon
0x0004: show SETUP-"Input/Output" icon
0x0008: show SETUP-"Frac Result" icon
0x0010: show SETUP-"Angle" icon
0x0020: show SETUP-"Complex Mode" icon
0x0040: show SETUP-"Display" icon.
0x0100: show header-text, based on the text defined with 0x02B9 (free text).
0x0200: show header-glyph, based on the glyph defined with 0x02BA.

syscall 0x02B9 : char*DefineStatusMessage( int mode, void*P2, void*P3 );
mode 0
: clears the status-message definition to default values. The message is set to an empty string.
The struct-members are set to (short 1, short 0, int 0, char 0, char 7, short 0).
mode 1: copy the struct-members to *P3.
mode 2: if P2 == 0, the status-message is set to an empty string, else *P2 is copied to the status-message.
*P3 is copied to the struct-members.

The function returns the pointer to the actual status-message.

syscall 0x02BA : char*DefineStatusGlyph( int mode, int P2, void*P3 );
if P2 is below zero, the function does not change anything and returns zero.
Else if:
mode == 0: clears all status-glyph definition array (5 items). Ignores P2 and P3 and returns zero.
mode == 1: get a status-glyph definition array-item indexed by P2 to *P3. Returns the pointer to the glyph indexed by P2.
mode == 2: set a status-glyph definition array-item indexed by P2 based on *P3. Returns the pointer to the glyph indexed by P2.
mode > 2: Returns the pointer to the glyph indexed by P2.

syscall 0x02BB : void DrawHeaderLine( void );

syscall 0x08C7 : void Cursor_SetFlashOn( unsigned char cursor_type );
Maps cursor_type as follows:
0: 0
1: 0
2: 0
3: 0
4: 0
5: 8
6: 0x10
7: 0x11
8: 0
9: 0x12
10: 0x14
11: 0x18
12: 0x40
else: 0

If the result is not zero it is stored to FlashStyle (by syscall 0x01F2).

syscall 0x08C8 : void Cursor_SetFlashOff( void );

syscall 0x08D0 : void TextCursorToPoint( TPixelCursor*p );
Calculates the point-coordinates from the actual text-coordinates.
struct TPixelCursor {
    int x;
    int y;
    int ?1;
    int ?2
};
x = 18*CurrentTextColumn
y = 24*CurrentTextRow
?1 = 0x16
 

syscall 0x091E : unsigned short FrameOp( int P1, unsigned short P2 );
P1 == 0: *(unsigned short*)0xFD8014A8 = 0
P1 == 1: if ( *(unsigned short*)0xFD8014A8 && 0x8000 ){
  if ( *(unsigned short*)0xFD8014A8 && 0x0010 ){
    Set LCD-controller-register 0xB to 1;
  }else{
    Set LCD-controller-register 0xB to 0;
  } 
  if ( *(unsigned short*)0xFD8014A8 && 0x0001 ){
    calls sys02a9_DrawFrameC3( 0 );
  }else{
    calls sys02a9_DrawFrameC3( 7 );
  } 
}
P1 == 2: *(unsigned short*)0xFD8014A8 = 0x8000
P1 == 3: *(unsigned short*)0xFD8014A8 = 0x8000 || P2

returns *(unsigned short*)0xFD8014A8 in any case
 

syscall 0x0921 : int EnableColor( int P1 );
This function seems to enable the display's color mode. Ususally it is called immediately after program-start with parameter 1. The function does not use any specific bit of P1. It merely checks P1 to be zero or not-zero.

 syscall 0x0924 : void Bdisp_Rectangle( int x0, int y0, int x1, int y1, short color3 );
Draws a rectangle. 0x24 is automatically added to the y-coordinates.

syscall 0x092A : int GridWB( int P1, int P2 );
Draws a grid.
The vertical lines are drawn up to y = 0xC0 - ( 7 - P1 ) * 8.
With P2 == 0, one horizontal line is drawn, else two horizontal lines are drawn.
An offset of 0x18 is automatically applied to any y-coordinate.

syscall 0x0937 : void MsgBoxMoveWB_C3( void*buffer, int x0, int y0, int x1, int y1, int direction );
similar to syscall 0x0938; uses C3-colors; need 1/4 of buffer-space.

syscall 0x0938 : void MsgBoxMoveWB( void*buffer, int x0, int y0, int x1, int y1, int direction );
Copies a rectangular area to or from VRAM from or to buffer.
It automatically accounts for a 24 bit y-offset.
direction == 0: from buffer to VRAM
direction == 1: from VRAM to buffer

syscall 0x0C5A : void StandardScrollbar( TStandardScrollbar*scrollbar );
Displays the standard scroll-indicator bar.
uses
typedef unsigned short TStandardScrollbar[0x12];
set TStandardScrollbar[0x10]  to the maximum indicator range and TStandardScrollbar[0x09] to the current indicator position. The indicator height is fixed to 6 units of the maximum range. The other array-elements are not important.

A more flexible variant is syscall 0x1A0A.

syscall 0x12FC : int LocalizeMessage1( int msgno, char*result );
Copies the message into result. The buffer has to prepared accordingly (size of 88 bytes). The language will be selected according to the system setting.

syscall 0x12FD : int LocalizeMessage1( int msgno, char*result );
Copies the message into result. The buffer has to prepared accordingly (size of 88 bytes). This call copies two bytes of controlcode to the beginning of result., which seem to be used in syscall 0x18F9, f. i.. The language will be selected according to the system setting.

syscall 0x17F7 : void MsgBoxPush( int height );
Displays a box. height might be 1..6. Obviously this call allocates resources. Release these resources with MsgBoxPop! Otherwise the system will crash.

syscall 0x17F9 : void MsgBoxPop( void );
Releases the resources, which have been allocated by BoxPush.

syscall 0x1809 : void ProgressBar2( insigned char*heading, int current, int max );
Displays a progressbar with a special heading.
See 0x180E for further details, especially the meaning of current == 0!

syscall 0x180B : void ProgressBar0( int P1, int P2, int P3, int current, int max );
Displays the standard progressbar.
The meaning of P1, P2 and P3 is not clear, yet. Set these to zero.
With current == 0 and max > 0, the function calls MsgBoxPush( 5 ). Hence to close the ProgressBar-box use MsgBoxPop.
It is very important to call ProgressBar with current == 0 only for initialization! Otherwise there would be multiple calls of MsgBoxPush with only one finalizing MsgBoxPop.

syscall 0x180E : void ProgressBar1( int current, int max );
Displays the standard progressbar.
With current == 0 and max > 0, the function calls MsgBoxPush( 5 ). Hence to close the ProgressBar-box use MsgBoxPop.
It is very important to call ProgressBar with current == 0 only for initialization! Otherwise there would be multiple calls of MsgBoxPush with only one finalizing MsgBoxPop.

syscall 0x1863 : void locate_OS( int x, int y );

syscall 0x1865 : void PrintLine( int P1, int mode, unsigned char*msg, int P4, int P5, int imax, int C3_color1, int C3_color2 );
syscall 0x1883 calls 0x1865( 0, 1, msg, 0, -1, imax, 0, 7 )
if ( bit 0 is set ) the complete line is processed
else only msg is processed.
if ( bit 7 and bit 5 are set ) C3_color2 is used as text-color and C3_color1 is used as background-color
else C3_color1 is used as text-color and C3_color2 is used as background-color

syscall 0x187A : void PrintChar( int P1, unsigned char*msg, int P3, int P4, int C3_color1, int C3_color2 );
Prints the char pointed to by msg. Uses color1 as text-color and color2 as background-color.
The mening of P1, P3 and P4 are unknown. Set these to 0, 0, -1. P1 is not used within PrintChar. PrintChar skips MB_leadbytes.

syscall 0x1882 : void PrintCharReverse( int P1, unsigned char*msg, int P3, int P4, int C3_color1, int C3_color2 );
Works like 0x187A; prints reverse. Does not skip MB_leadbytes.

syscall 0x1883 : void PrintLine( unsigned char*msg, int imax );

syscall 0x18F6 : void PrintPixXY( int x, int y, short*msg, int mode, int color );
Calls 0x18FF: PrintPixXY( x, y, msg, mode, color, -1 ).

syscall 0x18F7 : void PrintPixXY( int x, int y, short*msg, int color );
Calls 0x18FF: PrintPixXY( x, y, msg, 0, color, -1 ).

syscall 0x18F9 : void PrintXY( int x, int y, short*msg, int mode, int color );

x and y in text-cursor coordinates;
the first two chars of *msg are ignored (the reason of which will be unravelled later, hopefully)
mode (bit-field) = 1: writes the string in reverse
mode (bit-field) = 0x20: does not overwrite the background
color=0: black; 1: blue; 2: green; 3: cyan; 4: red; 5: magenta; 6: yellow; 7: none

syscall 0x18FF : void PrintPixXY( int x, int y, short*msg, int mode, int color, int unknown );
x and y in pixel-cursor coordinates;

x = (x(text)-1)*18
y = (y(text)-1)*24

Due to some internal restriction, msg has to be a 2-aligned pointer, if unknown is equal to -1. syscalls 0x18F6, 0x18F7, 0x18F8, 0x18F9 call syscall 0x18FF with unknown set to -1.

syscall 0x1A0A : void Scrollbar( TScrollbar*scrollbar );
Displays a scroll-indicator bar. Cannot reach the status area.

typedef struct{
    unsigned int I1;    // unknown, affects the effective indicatorheight, set to zero
    unsigned int indicatormaximum;    // maximum logical indicator range
    unsigned int indicatorheight;  // height of the indicator in units of maximum
    unsigned int indicatorpos;    // indicator position in units of maximum
    unsigned int I5;    // meaning unknown, set to zero
    unsigned short barleft;    // left position of the bar in display coordinates
    unsigned short bartop;    // top position of the bar in display coordinates
    unsigned short barheight;  // height of the bar in display coordinates
    unsigned short barwidth;  // width of the bar in display coordinates
} TScrollbar;

syscall 0x1D77 : void DefineStatusMessage( char*P1, short P2, char color_idx, char P4 );
P1
: status-message to set
P2: (?)
color_idx: color index
P4: (?)

syscall 0x1D7B : void DefineStatusGlyph( int idx, TStatusGlyphDefinition*stgd );
idx
: index of the shortcolor glyph in the array (0..4).
stgd: pointer to a TStatusGlyphDefinition structure.

typedef struct{
    short    dx;    // usually 0x24
    short    dy;    // usuallay 0x16
    void*    shortcolor_bitmap;
    short    xalignment;
    short    xoffset;
} TStatusGlyphDefinition;

xalignment == 1: positions the glyph left of the rightmost enabled icon. xoffset is added.
xalignment == 2: positions the glyph right justified. xoffset is subtracted (384-dx-xoffset).
xalignment == 3: positions the glyph to xoffset.

syscall 0x1D81 : void DisplayStatusArea( void );
Use 0x02B7 to enable the status area.
Use 0x1D77 to define the text and the text-color.

syscall 0x1D86 : void Bdisp_HeaderFill( unsigned char color_idx1, unsigned char color_idx2 );
Fills the header-area (statusline) with a checkerpattern. The colors used are defined by color_idx1 and color_idx2. See table at syscall 0x0265.

syscall 0x1D87 : void Bdisp_HeaderFill2( unsigned int col_start, unsigned int col_count, unsigned char color_idx1, unsigned char color_idx2 );

syscall 0x1D89 : void BatteryIcon( unsigned int flag );
The battery icon is displayed if flag is true (!=0).

syscall 0x1E62 : void SaveVRAM_1( void );
saves the VRAM to 0x880A2AD5; the buffer seems to be used while process-switching with the MENU-key.

syscall 0x1E63 : void LoadVRAM_1( void );
loads the VRAM from 0x880A2AD5; the buffer seems to be used while process-switching with the MENU-key.

syscall 0x1EF7 : void WriteBackground( void*target, int width, int height, TBGRbitmap*source, int P5, int P6, int P7  );
Sets a background image.

target: pointer to the desitation of the background bitmap.
width: 384
height: 192
source: pointer to a TBGRBitmap-structure.
P5, P6 and P7: set these to zero. P6 could be used as y-offset.

typedef struct{
    unsigned short width;
    unsigned short height;
    unsigned short unknown1;
    unsigned short unknown2;
    unsigned short unknown3;
    unsigned short unknown4;
    unsigned short*bitmap;
} TBGRbitmap;

The TBGRbitmap-members:
width: 384.
height: 192.
unknown1: 0x10
unknown2: 0x00
unknown3: 0x01
unknown4: 0xF800
bitmap: pointer to an unsigned short bitmap.

syscall 0x1EF8 : SetBackGround( int ImageNo, int B );
Sets a predefined background image. Not of much use.

ImageNo = 0x00:
ImageNo = 0x01:
ImageNo = 0x02:  (eActivity)
ImageNo = 0x03:  (Program)
ImageNo = 0x04:  (Financial)
ImageNo = 0x05:  (calculator)
ImageNo = 0x06:
ImageNo = 0x07:  (System)
ImageNo = 0x08:  (System/Language)
ImageNo = 0x09:  (book, looking glass)
ImageNo = 0x0A: (Program/New Program)
ImageNo = 0x0B:  (CONV.G3A)
ImageNo = 0x0C:  (Spreadsheet open)
ImageNo = 0x0D:  (Floppy-disk)
ImageNo = 0x0E:  (Calculator/Photocamera)
ImageNo = 0x0F:  ()
ImageNo = 0x10:  ()
ImageNo = 0x11:  ()

The meaning of parameter B is unknown yet.

(26.08.2012 10:06:26)