Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fu-sen
Last active February 12, 2021 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fu-sen/7274466 to your computer and use it in GitHub Desktop.
Save fu-sen/7274466 to your computer and use it in GitHub Desktop.
' move cursor with a mouse | MSX-BASIC
' Copyright (c) 1991 Keiichi Shiga (BALLOON | FU-SEN)
' The MIT License (MIT) - https://mit.balloon.net.eu.org/#1991
10 SCREEN0:KEYOFF:WIDTH40:FILES
20 X=POS(0):IFX<>0THENPRINT
30 J=CSRLIN-1:X=0:Y=0
40 LOCATEX*13,Y,1
50 IFSTRIG(0)+STRIG(1)=-1THEN110
60 S=STICK(0)+STICK(1):IFSMOD2=0THEN50
70 X=X+(S=3)*(X<2)-(S=7)*(X>0)
80 Y=Y+(S=5)*(Y<J)-(S=1)*(Y>0)
90 S=STICK(0)+STICK(1)
100 IFSMOD2=1THEN90ELSE40
110 LOCATE,,0:FORI=0TO11
120 N$=N$+CHR$(VPEEK(X*13+Y*40+I)):NEXT
130 CLS:PRINT"RUN ";N$:RUNN$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment