My Xts-uBASIC keyword set

A project log for Xts-uBASIC POCKET v3

yet another version of my handheld BASIC system in a GameGear case

Franck GALLIATFranck GALLIAT 06/19/2018 at 11:210 Comments

Hi, Here is my current BASIC Keywords set:

PRINT -----------------------> ADDED <?> shortcut
REM, ------------------------> ADDED <'> shortcut
INPUT, INKEY$ // INKEY$ : non blocking key listening ....
INT(),RND() // int(1.5) -> rounds to 1 // rnd -> returns between 0.00 & 1.00
STR$()      // STR$(1) => "1" (allows string concat)
LEN(),      // LEN("abc") => 3 

MEM --> function that return free ammount of RAM
DIR, ----------------------> ADDED optional extension filter ex: DIR ".BAS"
DIRARRAY ------------------> Stores FS list in "DIR$" ARRAY VARIABLE
DIRM ----------------------> show FS content for MCU#2

MUTE (toggle mute buzzer)
BEEP 100,2        : 1-48 produces some notes, direct freq. otherwise, beeps for 2*50msec
PLAY "ABC#"       : play some notes of OCTAVE_4
PLAYT5K & PLAYT53 : to play audio (beep) files

DRAWBPP           : display a 1bpp (B/W) picture to builtin screen
DRAWPCT           : display a 64K colors picture
DRAWSPRT          : draw a sprite (portion of a .PCT image file)
CIRCLE x,y,r      : draw a circle
LINE   x,y,x2,y2  : draw a line
PSET   x,y        : switch ON a pixel
PRESET x,y        : switch OFF a pixel
RECT x,y,w,h,c,m  : c : 0,1,2,3 (black,white,gray, darkGray) // m : 0,1 (draw,fill)
TRIANGLE x,y,x,y,x,y,c,m : as same as RECT but draws a triangle

BLITT x           : 0 stop blitt / 1 trigger blitt / 2 auto blitt (default mode)
SCREEN 0/1/2	  : switch resolution (128x64, 160x128, 320x240)
(TEXT 0/1 -> change text overlay mode)
BTN(x)            : function get button state
LED [1..3], {0,1} : switch on/off a LED

( CONSOLE <out>,<in>,<gfx> : set I/O + GFX main devices )
( ECHO {0;1}        : enable/disable console output )

DELAY x           : wait x msec
SECS              : function that returns nb of seconds elapsed since boot
MILLIS            : function that returns nb of milli-seconds elapsed since boot

UPPER$(str)       : function that return UPPERCASE of str
STRING$(nbTimes, chr) : function that returns repeating string of nbTimes * CHR$(chr)
CHR$( chr )       : function that return a char of given ASCII code
SPACE$(nbTimes)   : function that returns repeating string of nbTimes * CHR$(32)
ASC( str )        : returns ascii code of 1st char of str
INSTR( str, toFind ) : returns index of 'toFind' in 'str' (else 0)

ABS(x)            : return absolute value of number
COS(x)            : return cos( x in radians)
SIN(x)            : return sin( x in radians)
SQRT(x)           : return square-root of x
POW(x,y)          : return x pow y
MIN(x,y)		  : guess
MAX(x,y)		  : guess ...

EXEC "<extCmd>", "[<extArg>]" : to launch an extended command
DO "? 3.14"       : ~ as eval() in JS, interprets & launch a String expr.

DATAF "file", "SZ", "A$", "B" -> feeds A$ & B arrays w/ a PSEUDO CSV file content (ex: file.BAD) of a length of SZ

(DATAU "url?", "SZ", "A$", "B" -> will do as same but with an URL)

(COPY "/TOTO.PCT" -> copy an asset to MCU#2 )

BYE               : to reset the MCU
HALT              : to halt the MCU & optional connected RPI