SmileBASIC

Tech Specs

Basic Specifications and Restrictions

Editing function
Code EditorBuilt-in line editor. Auto-numbered in EDIT mode
Range of line numbers0 to 999999
Line number handlingLine numbers are only for visibility purposes in the editor, not used in programs. Instead of using a line number “@label” is used for branching with GOTO or other branching statements
Word WrappingSupported. Switchable in the option menu
# of characters per lineNo limitation but depends on free memory
Multiple Programs4 isolated slots are available which can be stored and executed separately
Smile buttonExecute a program without overwriting an editing slot
By default “SMILE TOOL” is assigned to the Smile Button, but it can be changed in the options menu
Input Devices
KeyboardSmileBASIC original software keyboard (English, European, Katakana, Symbols)
Buttons+Control Pad, A, B, X, Y, L, R
Circle PadSupported. Direction, angle, force and magnitude of movement
Circle Pad ProSupported
Touch ScreenSupported. Whether the screen is being touched, position of touch (X and Y)
AccelerometerSupported. 3-axis accelerometer measures acceleration
Gyro-sensorSupported. 3-axis gyro-sensor measures angle and angular velocity
Display
Screens
Console screen
for displaying text elements
Graphic screen
for rendering graphical elements
Sprite screen
for drawing sprites with optional animation (up to 512 sprites)
BG screen
for drawing a grid of fixed-sized characters (up to 4 layers)
Display Priority A Z coordinate can be set for each display elements.
In 3D viewing, Z coordinate controls depth
Output Screen Both Upper and Lower screens can be used separately or linked both as a one big screen.
Graphics Pages 6 memory pages (GRP0 to GRP5) to store graphics for each screen
Resolution 400 x 240 pixels in the upper screen
320 x 240 pixels in the lower screen
Both screens span 320 × 480 pixels when used in XSCREEN 4 mode
3D depth Z-coordinates range from -256 (the nearest) to 1024 (the farthest)
Console Screen 50 columns x 30 rows in the upper screen
40 columns x 30 rows in the lower screen
Both screens span 60 columns × 30 rows when used in XSCREEN 4 mode
16 colors including a transparent color
Text color and background color can each be set from the 16 colors
Sounds
Maximum Polyphony 24 voices shared between BGM and SFX
Sound Effect Presets 134 presets. Up to 8 voices at a time. Frequency, Volume and Pan are configurable
Sound sources for BGM 128 preset tones of various musical instruments
2 drum sets
PSG (Programmable Sound Generator) and Noise
Wavetables for BGM 32 wavetables (WAVSET)
BGM Presets 42 preset songs, 128 user songs (BGMSET)
Up to 8 songs can be played at a time
Speech synthesis Supported but Japanese phrases only
Built-in Effector Reverberation (EFCSET)
3 presets available
Parameters are editable
Fundamental Elements
Character Code UNICODE
Character Sets Numbers, Hiragana, Katakana, English, Russian, Greek and Symbols
Data Type (#) Double-precision Real Data Type (variables ending with #)
Data Type ($) String Type (variables ending with $)
Data Type (%) Integer Type (variables ending with %)
32-bit signed
Hexadecimal Notation &H
Binary Notation &B
Variables Names can include letters, numbers, and underscores but cannot begin with a number
No maximum name length. Names are not case-sensitive
Reserved Words The following words are reserved and cannot be used as variables or statements.
IF THEN ELSE ENDIF GOTO GOSUB RETURN ON FOR NEXT WHILE WEND REPEAT UNTIL BREAK CONTINUE DEF END VAR DIM AND OR XOR NOT DATA READ RESTORE PRINT INPUT LINPUT CALL TRUE FALSE SWAP OUT COMMON USE EXEC
Implicit Type
Conversion
Values are converted implicitly between numeric types. No conversion happens between characters and numbers
Label String Text variable beginning with @
Array Up to four-dimensional arrays supported
Up to 2^31 (2,147,483,648) elements supported, depending on available memory.
Parentheses [] must be used to enclose elements, () cannot be used.
Multiple Statements Supported. Use “:” (Colon) as a delimiter
Sub-Routines and
Nesting
No limits
Project All files are organized in a project-based hierarchy
Files are stored and managed by grouping them in a single level of project folders.
File Types
TXT
for strings of text (including a program file)
DAT
DAT for binary data arrays (Numbers)
Operator Symbols
Arithmetic operators
+Addition (A+B)
-Subtraction (A-B)
*Multiplication (A*B)
/Division (A/B)Division by 0 causes error
MODRemainder (A MOD B)Division by 0 causes error
DIVInteger Division (A DIV B)
The fractional part of a quotient is rounded downDivision by 0 causes error

String variables can be added or multiplied

(e.g.) Adding String variables
A$="ABC" : B$="XYZ" : PRINT A$+B$
Result: ABCXYZ
(e.g.) Multiplying String variables
A$="ABC" * 4: PRINT A$
Result: ABCABCABCABC
Relational operators
>Value on left is greater than value on right (A>B)
<Value on left is less than value on right (A<B)
>=Value on left is equal or greater than value on right (A>=B)
“=>” is invalid and does not work
<=Value on left is equal or less than value on right (A<=B)
“=<” is invalid and does not work
==The values are equal (A==B)
“=” assigns a value to a variable
!=The values are not equal (A!=B)
“<>” is invalid and does not work
Bitwise operators
ANDLogical AND (A AND B)
ORLogical OR (A OR B)
XORExclusive OR (A XOR B)
NOTNegation (NOT A)
<<Left Arithmetic Shift (A << 1 shifts the value of A left by 1 bit)
>>Right Arithmetic Shift (A >> 3 shifts the value of A right by 3 bits)
Logical Operators
&&Logical AND (IF A<3 && B==2 THEN ~)
||Logical OR (IF A>3 || B>3 THEN ~)
!Logical Negation (NOT)
  • !TRUE is equal to FALSE
  • !FALSE is equal to TRUE
Order of Operations
1 (Highest)Sections inside ( )
2- (Unary), NOT (One’s Complement), ! (Logical Negation)
3*, /, DIV, MOD
4+, - (Binary)
5<< and >> (Shift)
6==, !=, <, <=, >, >=
7AND, OR, XOR (Bitwise Operation)
8 (Lowest)&&, || (Logical Operators. Shortcut Operators can be used.)