SuperH-based fx calculators
fx legacy: cursor

The cursor settings are most commonly used by Print-calls to determine the next location of text output.

  Column (char) Row (char) Flash style (word) Flash mode (char)
1.02 - - - -
1.03 0x8800497C 0x8800497D 0x8800497E 0x88004980

Column/row indicator

This holds the row and column in range 0..7 (row) and 0..20 (column).

Cursor flash

The system can handle automatic flashing of a cursor at the set location, using one of the following cursors:


image

Flash style: values of 0, 1, 2, 4, 8, 0x10, 0x11, 0x12, 0x14, 0x18 and 0x40 correspond to an icon in the image above. Default: 0.
Flash mode: 0: no flashing cursor. 1: flashing cursor. (
needs research: 2: temporary flashing (cleared by RestoreDisp) )

The Flash style is automatically set by certain keypresses.
The first five styles are 'normal', SHIFT, ALPHA, lowercase ALPHA, and CLIP in normal INS mode. The next five are the same icons, just in overwrite mode (not INS).

System calls

0x138: int Cursor_SetPosition(char column, char row);
Stores the provided arguments at the locations for setting the column and row.
Valid ranges for input arguments are:
column: 0..20
row: 0..7
The function will return 0 on failure (bad arguments), or 1 on success (arguments saved).

0x139: int Cursor_SetFlashStyle(short int flashstyle);
If flashstyle is valid (see previous section for values), the Flash style is set to the provided value.
Returns 1 on success (argument saved), and 0 on failure (bad argument).
With OS 2.00 0x811 and 0x812 should be used.

0x13A: void Cursor_SetFlashMode(long flashmode);
If flashmode is 0, the Flash mode is set to 0 and cursor flashing is turned off. If flashmode is nonzero, Flash mode is set to 1, and cursor flashing is turned on.
With OS 2.00 0x811 and 0x812 should be used.

0x13B: uint Cursor_GetSettings(uint settingsarray[]);
Casts the set Column, Row, Flash style and Flash mode to unsigned integers, and copies them to a settingsarray in that order.
This function returns (unsigned int)Flash.

0x807: void locate(int column, int row); (SDK name)
Accepts arguments in the range column = 1..21 and row = 1..8. Return if input is invalid. If valid, call Cursor_SetPosition(); with arguments reduced by 1.

0x80E: int Cursor_GetFlashStyle();
returns the current flash style fitting for a call of 0x811.

0x80F: int Cursor_GetSettings( TCursorSettings*CursorSettings );

typedef struct{
    int flashstyle;    // -1 if not flashing, else flashmode
    int column; // starts at 1
    int row;    // starts at one
    int graphic_mode;
}
TCursorSettings;
 

0x811: void Cursor_SetFlashOn( char flash_style );
flash_style is mapped to 0x139-flashstyle: 0->0; 1->1; 3->2; 6->0x10; 7->0x11; 9->0x12; 4->4; 5->8; 0xA->0x14; 0xB->0x18; 0xC->0x40;
Sets flashmode on automatically. 0x811 automatically resets to cursor-textmode. That's the reason, why 0x811 must be used instead of 0x139/0x13A since OS 2.00.

0x812: void Cursor_SetFlashOff();
Calls Cursor_SetFlashMode(0); - setting Flash mode to 0 to disabling any flashing cursor.

(27.05.2012 15:44:03)