This function gets the start position (vertical position and horizontal position) of the screen display in dot units.

Syntax

int GetOffset(void);

Parameters

None

Return value

The upper 8 bits represent the horizontal position, and the lower 8 bits represent the horizontal position.
0xXXXXYYYY − Screen display start position
(XXXX:Horizontal position、YYYY:Specify the vertical position in dot units.)

Remarks

Gets the start position (vertical position and horizontal position) of the screen display in dot units.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"

void main( void )
{
    int offset;
    for(;;)
    {
        SetFont( TINY_FONT, 0);
        offset = GetOffset();
        printf("\foffset=%08x", offset);

        GotoXY( 0, 0);
        SetOffset( 0x00060006 );
        SetFont( SMALL_FONT, 0);
        offset = GetOffset();
        printf("\foffset=%08x", offset);

        GotoXY( 0, 0);
        SetOffset( 0x0006000E );
        SetFont( MEDIUM_FONT, 0);
        offset = GetOffset();
        printf("\foffset=%08x", offset);

        GotoXY( 0, 0);
        SetOffset( 0x000E001A );
        SetFont( LARGE_FONT, 0);
        offset = GetOffset();
        printf("\foffset=%08x", offset);

        ResetKey();
        while( !kbhit())
            Idle();
    }
}

Last updated: 2020/10/02