The CURSORPS.I include file resides on the Kyan Pascal 2.x Utilities Disk 1. It contains two functions for determining the X and Y locations of the cursor.
- FUNCTION Cursor_X: Integer;
- FUNCTION Cursor_Y: Integer;
Source Code
FUNCTION Cursor_X: Integer;
BEGIN
CURSOR_X:=0;
#A
LDY #5 ;offset
LDA $55 ;peek LSB
STA (_SP),Y ;...and save it
INY ;add 1 for MSB
LDA $56 ;peek MSB
STA (_SP),Y ;...and save it
#
END;(* CursorX procedure *)
FUNCTION Cursor_Y: Integer;
BEGIN
CURSOR_Y:=0;
#A
LDY #5 ;offset to LSB
LDA $54 ;peek LSB of value
STA (_SP),Y ;...and store it
#
END;(* Cursor Y function*)
No comments:
Post a Comment