Difference between revisions of "Cursor SetPosition"
From WikiPrizm
Jump to navigationJump to search (Created page with "{{syscall | name = locate_OS | index = 0x01F1 | signature = int Cursor_SetPosition(int x, int y) | header = fxcg/display.h | synopsis = Sets the cursor position for Print_OS...") |
m (Fix copy and paste error.) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{syscall | {{syscall | ||
− | | name = | + | | name = Cursor_SetPosition |
| index = 0x01F1 | | index = 0x01F1 | ||
| signature = int Cursor_SetPosition(int x, int y) | | signature = int Cursor_SetPosition(int x, int y) | ||
− | | header = fxcg/display.h | + | | header = fxcg/display.h {{NoLibfxcg}} |
| synopsis = Sets the cursor position for [[Print_OS]]. | | synopsis = Sets the cursor position for [[Print_OS]]. | ||
| parameters = * '''x''' Must be in range of [0,20] | | parameters = * '''x''' Must be in range of [0,20] |
Latest revision as of 13:20, 15 February 2015
Contents
Synopsis
Header: fxcg/display.h (Not yet in libfxcg)
Syscall index: 0x01F1
Function signature: int Cursor_SetPosition(int x, int y)
Sets the cursor position for Print_OS.
Parameters
- x Must be in range of [0,20]
- y Must be in range of [0,7]
Returns
0 on failure, 1 on success.
Comments
This function like locate_OS does bounds checking. It is better to use this function as opposed to locate_OS to avoid a duplication of bounds checking.
Cursor_SetPosition: cmp/pz r4 bf Cursor_SetPosition_OutOfBounds mov #21, r2 cmp/ge r2, r4 bt Cursor_SetPosition_OutOfBounds cmp/pz r5 bf Cursor_SetPosition_OutOfBounds mov #8, r2 cmp/ge r2, r5 bf loc_8004E744 Cursor_SetPosition_OutOfBounds: rts mov #0, r0 ! --------------------------------------------------------------------------- loc_8004E744: mov.l #CursorXpos, r1 mov #1, r0 mov.l #CursorYpos, r6 mov.l r4, @r1 rts mov.l r5, @r6 ! End of function Cursor_SetPosition