SuperH-based fx calculators
fx-CG20, auxiliary functions

Legacy auxiliary syscalls

syscall 0x02C7: void HourGlass( void );
Directly draws the busy-indicator(hourglass) in the upper right corner.

syscall 0x07A2: short CharacterSelectDialog( void );
To ensure, that the FKey-assignments of this call work, syscall 0x0111 has to be called beforehand. The dialog returns the MB_code of the selected character.

syscall 0x0820: int DeflateToFile( int filehandle, int*lengthofpackeddata, void*sourcebuffer, int sourcebufferlength, int v6, int v8, int vB, int v5, int mixflag );
not yet ready to use
filehandle
is the handle of an open file, which will receive the packed data, starting at the current fileposition.
lengthofpackeddata receives the length of packed data (zero on input)
sourcebuffer the data to be deflated
sourcebufferlength the length of data to be deflated
v6, v8, vB, v5: parameters controlling the deflate process
mixflag
: if this flag is 1, the packed data are processed by some bit-mixing.

syscall 0x0821: int InflateFromFile( int filehandle, in fileoffset, int inflatebuffer, int*inflatebufferlength, int mixflag );
not yet ready to use

syscall
0x0901: int OpenDeflate( void*deflate_record, int v6, int v8, int vB, int v5, int v0, unsigned char*deflate_version, int v38 );
not yet ready to use

deflate_record
points to a struct like

typedef struct tag_Deflate{
    void*source;
    int requested_sourcelength;
    int processed_sourcelength;
    void*chunkbuffer;
    int max_chunklength;
    int processed_chunklength;
    int field7;
    int field8;
    void*pMalloc_P2xP3;
    void*pFree_P2;
    int field11;
    int field12;
    int field13;
    int field14;
} TDeflate;

whereas
source is a pointer to the sourcebuffer (f. i. 0xA8000000)
sourcelength is the length of the sourcebuffer
chunkbuffer is a workbuffer provided by the caller
chunklength is the max. allowed chunksize
pMalloc_P2xP3 is a pointer to a malloc_P2xP3-function; if this is zero, the pointer will be set to a default-value automatically
pFree_P2xP3 is a pointer to a free_P2-function; if this is zero, the pointer will be set to a default-value automatically
field11 is set to zero by the caller

the other fields seem to be some return values
.

The function's return value is 0 on success.

syscall 0x0909: void PerformDeflate( void*deflate_record, int v4  );
not yet ready to use

 

The function's return value is 0 or 1 on success
The function's return value is 1 if the deflate is completed.
 

syscall 0x090A: void CloseDeflate( void*deflate_record  );
not yet ready to use

 

syscall 0x0C66: int SaveFileDialog( unsigned short*FileNameBuffer, int mode );
FileNameBufferLength at least 0x214 (t. i. 0x10A unsigned short items).
mode == 4 (meaning not known, yet.).

syscall 0x0D91: int OverwriteConfirmation( char*name, int mode );
Displays an OverwriteConfirmation-Dialog. name is displayed as first line. If mode is zero, the AC/on-key does not serve as exit-key. Returns 0x7539 if F1 is hit. Any other result means "No".

syscall 0x117A: int OpenInflate( void*inflate_record, unsigned char*inflate_version, int v38 );
not yet ready to use

inflate_record
points to a struct like

typedef struct tag_Inflate{
    int field1;
    int field2;
    int field3;
    void*inflatebuffer;
    int inflatebufferlength;
    int field6;
    int field7;
    int field8;
    void*pMalloc_P2xP3;
    void*pFree_P2;
    int field11;
    int field12;
    int field13;
    int field14;
} TInflate;

whereas
field1 is set to zero by the caller
field2 is set to zero by the caller
inflatebuffer is a pointer to the inflatebuffer (f. i. VRAM_SHADOW_1)
inflatebufferlength is the length of the inflatebuffer
pMalloc_P2xP3 is a pointer to a malloc_P2xP3-function; if this is zero, the pointer will be set to a default-value automatically
pFree_P2xP3 is a pointer to a free_P2-function; if this is zero, the pointer will be set to a default-value automatically

the other fields seem to be some return values
.

The function's return value is 0 on success.

syscall 0x117B: void PerformInflate( void*inflate_record, int v0  );
not yet ready to use

 

The function's return value is 0 or 1 on success
The function's return value is 1 if the deflate is completed.
 

syscall 0x117C: void CloseInflate( void*inflate_record  );
not yet ready to use

 

syscall 0x120A: void EditMBStringCtrl2( unsigned char*MB_string, int xposmax, int*P3, int*xpos, int*key, int x, int y, int enable_pos_to_clear, int pos_to_clear );
Edits MB_string based on the control character key and displays the resulting string at position x, y.
y is the vertical position in pixel.
pos_to_clear defines the end of the area to clear.
enable_pos_to_clear: if this value is zero, pos_to_clear is not applied.
The meaning of
P3 is unknown yet. Set it to zero.

syscall 0x120E: void EditMBStringCtrl( unsigned char*MB_string, int xposmax, void*P3, int*xpos, int*key, int x, int y );
Edits MB_string based on the control character key and displays the resulting string at text-position x, y.
The AC/on-key clears the input-buffer.

syscall 0x1218: void DisplayMBString2( int P1, unsigned char*MB_string, int P3, int xpos, int x, int y, int pos_to_clear, int P8, int P9 );
Displays MB_string at position x, y and sets the cursor to position xpos.
y is the vertical position in pixel.
pos_to_clear defines the end of the area to clear.
The meaning of P1 is unknown, yet. Set it to zero.
The meaning of
P3 is unknown, yet. Set it to zero.
The meaning of
P8 is unknown, yet. Set it to zero.
The meaning of
P9 is unknown, yet. Set it to zero.

syscall 0x121D: void DisplayMBString( unsigned char*MB_string, int P2, int xpos, int x, int y );
Displays MB_string at position x, y and sets the cursor to position xpos. The meaning of P2 is unknown, yet. It should be set to 0.

syscall 0x1224: int EditMBStringChar( unsigned char*MB_string, int xposmax, int xpos, int char_to_insert );
Inserts the character char_to_insert into MB_string at xpos. xposmax controls the maximal length of MB_string. Returns the new xpos.

syscall 0x17E9: int OpenFileDialog( unsigned short keycode, unsigned short*FileNameBuffer, int FileNameBufferLength );
With keycode == 0x756B an OPEN-Dialog will be performed;
FileNameBufferLength at least 0x214 (t. i. 0x10A unsigned short items).

syscall 0x1802: int ConfirmFileOverwriteDialog( unsigned short*filename );

syscall 0x1814: unsigned char ColorIndexDialog0( unsigned char initial_index );
Similar to 0x1815, but without disable_mask.

syscall 0x1815: unsigned char ColorIndexDialog1( unsigned char initial_index, unsigned short disable_mask );
Similar to 0x1816, but without Auto and Clear.

syscall 0x1816: unsigned char ColorIndexDialog2( unsigned char initial_index, unsigned short disable_mask );
Displays a dialog box to select a color index. initial_index is the initial index.
disable_mask:
0x8000: disables
9:Auto
0x4000: disables A:Clear
0x0001 to 0x0080: disables the corresponding color item
Returns the selected color index 0..7 on 1..8.
Returns 0xFD on 9:Auto.
Returns 0xFE on A:Clear.
Returns the value of the selected item on EXE.
Returns 0xFF on EXIT, QUIT, AC/on.

syscall 0x1839: void PowerOff( int DisplayPowerOffLogo );
Powers the calculator off.

(01.05.2012 17:51:37)