mouse_pos() now returns the coordinates as unsigned words

This commit is contained in:
Irmen de Jong 2024-05-20 21:33:57 +02:00
parent c719e274d5
commit ac1d4b4a7a
4 changed files with 4 additions and 3 deletions

View File

@ -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:
; -- 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.

View File

@ -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.
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 128 (limited support)
* Commodore PET (limited support)

View File

@ -615,6 +615,7 @@ On the other targets, it only contains the definition of the 16 memory mapped vi
``cpu_is_65816()``
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 ()``
Soft-reset the system back to initial power-on BASIC prompt. (same as the routine in sys)

View File

@ -37,7 +37,7 @@ main {
; spotlight
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)
if new_direction != previous_direction {
sys.waitvsync()