mirror of
https://github.com/irmen/prog8.git
synced 2025-10-29 17:16:17 +00:00
mouse_pos() now returns the coordinates as unsigned words
This commit is contained in:
@@ -587,7 +587,7 @@ asmsub mouse_config2(byte shape @A) clobbers (A, X, Y) {
|
|||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
asmsub mouse_pos() clobbers(X) -> ubyte @A, word @R0, word @R1 {
|
asmsub mouse_pos() clobbers(X) -> ubyte @A, uword @R0, uword @R1 {
|
||||||
; -- short wrapper around mouse_get() kernal routine:
|
; -- short wrapper around mouse_get() kernal routine:
|
||||||
; -- gets the position of the mouse cursor in cx16.r0 and cx16.r1 (x/y coordinate), returns mouse button status in A.
|
; -- gets the position of the mouse cursor in cx16.r0 and cx16.r1 (x/y coordinate), returns mouse button status in A.
|
||||||
; Note: mouse pointer needs to be enabled for this to do anything.
|
; Note: mouse pointer needs to be enabled for this to do anything.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ The language aims to provide many conveniences over raw assembly code (even when
|
|||||||
while still being low level enough to create high performance programs.
|
while still being low level enough to create high performance programs.
|
||||||
You can compile programs for various machines with this CPU:
|
You can compile programs for various machines with this CPU:
|
||||||
|
|
||||||
* Commander X16
|
* Commander X16 (with 6502 cpu, 65816 cpu specifics are currently not supported)
|
||||||
* Commodore 64
|
* Commodore 64
|
||||||
* Commodore 128 (limited support)
|
* Commodore 128 (limited support)
|
||||||
* Commodore PET (limited support)
|
* Commodore PET (limited support)
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ On the other targets, it only contains the definition of the 16 memory mapped vi
|
|||||||
|
|
||||||
``cpu_is_65816()``
|
``cpu_is_65816()``
|
||||||
Returns true if the CPU in the computer is a 65816, false otherwise (6502 cpu).
|
Returns true if the CPU in the computer is a 65816, false otherwise (6502 cpu).
|
||||||
|
Note that Prog8 itself has no support yet for this CPU other than detecting its presence.
|
||||||
|
|
||||||
``reset_system ()``
|
``reset_system ()``
|
||||||
Soft-reset the system back to initial power-on BASIC prompt. (same as the routine in sys)
|
Soft-reset the system back to initial power-on BASIC prompt. (same as the routine in sys)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ main {
|
|||||||
|
|
||||||
; spotlight
|
; spotlight
|
||||||
repeat {
|
repeat {
|
||||||
void, cx16.r0s, cx16.r1s = cx16.mouse_pos()
|
void, cx16.r0, cx16.r1 = cx16.mouse_pos()
|
||||||
new_direction = math.direction(128, HEIGHT/2, clampx(cx16.r0), cx16.r1L)
|
new_direction = math.direction(128, HEIGHT/2, clampx(cx16.r0), cx16.r1L)
|
||||||
if new_direction != previous_direction {
|
if new_direction != previous_direction {
|
||||||
sys.waitvsync()
|
sys.waitvsync()
|
||||||
|
|||||||
Reference in New Issue
Block a user