Post Reply 
Really really fast BASIC handheld
01-12-2019, 10:00 PM (This post was last modified: 01-14-2019 07:25 PM by berndpr.)
Post: #21
RE: Really really fast BASIC handheld
Hallo!

1. You have to buy Smilebasic at the Nintendo Online Shop like a Game and download to the 2DS or 3DS. Actual version is 3.6.0.
The Nintendo New 2DS XL and 3Ds are released at 2017.
I think, this shows the progress of the handheld devices, but sadly our favorite hobby - calculators - are still years behind.
I have paid the same price as a TI-Nspire for the 2DS. But for gaming not for calculating.

Yes, I think too, SmileBasic was developed to program your own games.
The interpreter tells more than 8 MBytes are free!
But it must very fast, so many tasks like sprite, background screen and music is a own function in the multi cores of the ARM. And the calculation is fast, because it's using the buildin math coprocessor.

2. The input of programs are using a very complete virtual keyboard (full qwerty keyboard with many keys and using the shoulder keys as additional shift, auto offline help with command completing) on the touch screen (lower screen). If you are using a good stylus like I from an old PDA, for me the input is not slower as with HP-35S or TI-89.

Very important is the offline help of nearly all commands, because there many new one for grafic, sound etc. And the BASIC has his own dialect.

The output is by default the upper screen, but you can then define both screens together as one or as a second screen. And yes, there are commands for the buttons and touch screen.

The storage for programs is the SD card of the DS (128 GByte in my case).
It use is own directory system with sub directorys. The most programs are very small (only 100 Bytes -100 kByte). Only grafic and sound can use many storage. But SmileBasic has big liberries for music, sounds and grafics.

Here is script for 8 Queens unstructured (only 363 Bytes):
CLS
PRINT "8-Queen-Problem"
OPTION DEFINT
M=MAINCNT
K=1000
PRINT K;" times"
N=K
@L0
R=8
S=0
X=0
DIM A[9]
@L1
IF X==R GOTO @L5
INC X
A[X]=R
@L2
INC S
Y=X
@L3
DEC Y
IF Y==0 GOTO @L1
T=A[X]-A[Y]
IF T==0 GOTO @L4
IF X-Y!=ABS(T) GOTO @L3
@L4
DEC A[x]
IF A[X]!=0 GOTO @L3
DEC X
IF X!=0 GOTO @L4
@L5
DEC N
IF N>1 GOTO @L0
PRINT S
PRINT FORMAT$("%5.4F sec",(MAINCNT-M)/60)

What you see here, is exactly the same as in the BASIC editor!
I have used the original code with the labels @L0 until @L5, because SmileBasic doesn't know command line numbers. Compares are like C with == and !=.
MAINCNT are the vsyncs from start of BASIC (60 per secondes).
N is the counter for the outer loop (here 1000).
DEC ind INC are the decrement and increment commands.
OPTION DEFINT: all variable are integers (floating point numbers are only slightly slower!).
CLS is clear screen, not clear variables!

I have tried some simplification like IF X GOTO or IF !X GOTO and the DIM A[9] outside the outer loop, but this version here is the fastest!

I hope there no errror, because the DS is not using an interface to a PC. I have to type in the code. This is for me no problem. I like it to stop programming by closing the DS. This stops all things in the DS and if I open the DS, everything starts without any delay exactly before closing. It depends not if a program is runnig or the editor/IDE is been used.

I don't know it's using a byte code interpreter, but after RUN the program starts immediatly. But the SmileBasic makes some error checks before execute the commands (errors immediatly after RUN) and some error checks if commands are executed.

Some words to MicroPython in Numworks and Casio FX-CG50.
It is not the real Python, but a reprogrammed special version to be fast and small enough for micro controllers. And as fare as I see, SmileBasic is round 10 times faster as on numworks and FX-CG50.

Some different:
I have seen some benchmark test on the raspberry pi with compiled codes. This is more faster. I have seen a prototype of a kind of calculator with raspberry pi zero at youtube. But the full version 3B+ of the pi could be one of the fasted handheld. But I don't know, if anybody uses this for a homebrew calculator.
Does anybody of you know about this?

Bernd
P.S.: Sorry for the typos!
P.P.S.: Code edit because of errors. Sorry!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Really really fast BASIC handheld - berndpr - 01-12-2019 10:00 PM



User(s) browsing this thread: 1 Guest(s)