DROS 0.5: User Manual © Whoredoeuvre 2006
DROS 0.5: User Manual © Whoredoeuvre 2006
5
User manual
© Whoredoeuvre 2006
© Whoredoeuvre 2006
Table of Contents
Introduction............................................................................................................3
Part 1 The DROS command shell.........................................................................4
Application navigation.......................................................................................4
Commands........................................................................................................5
Batch Files.........................................................................................................5
FTP...................................................................................................................6
Part 2 BASIC Interpreter........................................................................................7
Introduction........................................................................................................7
Commands........................................................................................................7
Example program 1.........................................................................................12
Example program 2.........................................................................................12
Example program 3.........................................................................................13
Example program 4.........................................................................................13
© Whoredoeuvre 2006
Introduction
DROS is a DOS like shell written in MIDP with a BASIC interpreter for the writing
of simple programs. This brief user guide is split into two parts a user guide for
the DROS environment and a guide to the BASIC interpreters API.
Because the application requires access to the file system the application
requires JSR 75 file system support on the phone. Phones that have this
present (at the time of writing the document) are Sony Ericsson phones
starting with the K750i. Nokia Series 60 (Symbian) phones starting with the
6630. Nokia Series 40 phones starting with the 6230i. Siemens phones
starting with the 75 Series. It should be noted that some network operators
such as Cingular and T-Mobile in America disable the JSR-75 file support
so the application will not work.
© Whoredoeuvre 2006
Part 1 The DROS command shell
Application navigation
There are two forms of command entry in the shell text can be entered directly
into the command window and it can also be entered through an input screen.
Commands can be executed by either pressing the fire button or by using the
Enter menu item. Previously executed commands can be accessed by pressing
the up button. By pressing the * button a scrolling mode is entered where by
using the up and down direction keys the session so far can be viewed. Pressing
* again returns to the normal command input mode. The command window can
be placed in full screen mode using the 'Full Screen On' menu item. If the phone
has a QUERTY keyboard this input mode can be selected using the menu item.
© Whoredoeuvre 2006
Commands
Batch Files
Batch files can be written using most of the commands above. Create or edit a
batch file using the edit <filename>.bat command.
If a batch file named autoexec.bat is added to the root of the initial drive normally
(E:) this is run upon startup.
© Whoredoeuvre 2006
Applications
• There is a media player can be used for playing mp3's and videos.
• The editor can be used to edit text files. These may be DROS BASIC files
or DROS batch files. If the files are BASIC files there is the possibility to
run the program from the editor, thus providing a very basic IDE.
© Whoredoeuvre 2006
FTP
When opening a site using enter will automatically send a anonymous user and
anonymous email address as a password. Transfers can be canceled at anytime
using the menu item cancel.
© Whoredoeuvre 2006
Part 2 BASIC Interpreter
Introduction
Basic Files can be run either from the command line or through the on board
editor. Basic source files can be created/edited using edit <filename>.bas, as
stated before the programs can be run from within the editor.
Commands
IF
FOR
FOR X = 1 TO 100
...
NEXT
GOTO
10
PRINT "DAVE IS SKILL"
GOTO 10
GOSUB
VADDELEMENT
VADDELEMENT 1, 23 or
VADDELEMENT 1, "DAVE IS SKILL" or
VADDELEMENT 1, S$ or
VADDELEMENT 1, S
Adds a element to vector with the index 1 in the vector buffer. If no vector exists then a new one
is created at this index.
© Whoredoeuvre 2006
VDELELEMENT
VDELELEMENT 1,0
Deletes the element at position 0 from the vector at index 1 in the vector buffer.
VGETELEMENT
VGETELEMENT 1, 0 ,S or
VGETELEMENT 1, 0 ,S$
Gets the element at position 0 from the vector at index 1 in the vector buffer and sets the variable
S to this value.
VSIZE
VSIZE 1,S
Gets the size of the vector at index 1 in the vector buffer and sets the variable S to be the size.
VCLEAR
VCLEAR 1
; = tab
X$ = String variable
*TEXTMODE only
INPUT
INPUT X or
INPUT X$ or
INPUT "What is your age?",X or
INPUT "What is your name?",X$
CLS
CLS
© Whoredoeuvre 2006
GRAPHICSMODE
X: x coord
Y: y coord
SETCOLOUR
SETCOLOUR R,G,B
DRAWCIRCLE
DRAWCIRCLE X,Y,W,H
W: width
H: height
FILLCIRCLE
FILLCIRCLE X,Y,W,H
W: width
H: height
DRAWLINE
DRAWLINE X,Y,A,B
DRAWBOX
DRAWBOX X,Y,W,H
W: width
H: height
DRAWPIXEL
DRAWPIXEL X,Y
FILLCIRCLE
See DRAWCIRCLE
FILLBOX
See DRAWBOX
© Whoredoeuvre 2006
DRAWSTRING
LOADSPRITE
LOADSPRITE 0,"C:/test.jpg"
DRAWSPRITE
DRAWSPRITE 50,60,0
Draws the sprite at x coordinate 50 and y coordinate 60 from sprite buffer index 0
TEXTMODE
GETKEY
GETKEY I
TIME
TIME X
File Commands
FOPEN
FOPEN "c:/test.txt"
FINPUT
FINPUT X$,Y
FPRINT
Writes into the currently open file. Subsequent calls before FCLOSE append to the end of the file.
© Whoredoeuvre 2006
FCLOSE
String functions
CONCAT
CONCAT X$,Y$ or
CONCAT Y$,"OWEN IS SKILL"
SUBSTR
SUBSTR S,E,X$,Y$ or
SUBSTR S,E,X$,"OWEN IS SKILL"
Sets the first string to be the substring of the second starting at S and ending at E
INDEXOF
INDEXOF X$,"a",Y or
INDEXOF "OWEN IS SKILL",X$,Y
Finds the index of the second string within the first and sets the variable Y with this index.
Sets the variable Y to -1 if the string cannot be found.
LENGTH
LENGTH X$,Y or
LENGTH "OWEN IS SKILL",Y
WAIT
WAIT 1000
EXIT
© Whoredoeuvre 2006
Example program 1
GRAPHICSMODE
X = 10
Y = 10
A=1
B=2
C=0
10
X=X+A
Y=Y+B
I=I+1
IF I % 300 = 0 THEN C = 1
IF B > 0 THEN B = B-C
IF B < 0 THEN B = B+C
C=0
SETCOLOUR 255-Y,X,Y
CLS
DRAWSTRING X,Y,"OWEN IS SKILL"
SETCOLOUR 255,255,255
DRAWBOX X+27,194,43,12
WAIT 35
GOTO 10
EXIT
Example program 2
VADDELEMENT 1, 23
VGETELEMENT 1, 0 ,S
PRINT S,
VDELELEMENT 1,0
VADDELEMENT 1, 26
VGETELEMENT 1, 0 ,S
PRINT S,
EXIT
© Whoredoeuvre 2006
Example program 3
FOPEN "C:/test.txt"
INPUT "Please enter your name",Z$
INPUT "Please enter your age", I
FPRINT Z$, I
FCLOSE
FOPEN "C:/test.txt"
FINPUT D$, X
FCLOSE
PRINT "Name is:",D$," Age is:", X
EXIT
Example program 4
GRAPHICSMODE
LOADSPRITE 0,"C:/test.jpg"
DRAWSPRITE 50,50,0
EXIT
© Whoredoeuvre 2006