Zero2 QL program
what is the significance of the red border to the map? - none, it looks pretty
Useful cmnds easily added
RF - RightForward move left wheel only, turn 0.5deg. per step
RB - RightBackward move left wheel only, turn 0.5deg. per step
LF - LeftForward move right wheel only, turn 0.5deg. per step
LB - LeftBackward move right wheel only, turn 0.5deg. per step
Before use it is advisable to make a back-up copy of the cartridge.
Reset the QL
This will format the cartridge in mdv1_ and copy over all the files from the master cartridge.
Put the master cartridge in mdv2_
Put a blank cartridge in mdv1_
Enter LRUN mdv2_clone
Reset the QL
Put the cartridge in mdv1_
The boot program will load automatically and will then load and run the main program Robot. Robot will then look in files Zmem and Zmem_names to see if any routines were saved from the last session, and if so it will load them into its memory. It then prompts for a speed-factor and gives an option to set the pen position to 'up'. If this option is not taken the it presumes the pen is already in the 'up' position.
The speed-factor and pen position initialisation can be done at any time by entering zinit which also initialises the serial channel, or just the pen positior can be altered by entering peninit.
Entering help will display a series of 'Help' screens listing all the commands available to the user that the program understands. However since the user is operating directly in SuperBasic (see 'Program Operation' next section) any legal SuperBasic command will be executed, even 'list'.
At the end of a sesssion enter quit and this will update and close the files Zmem and Zmem-names. Failure to use quit will almost certainly leave Zmem and Zmem-names in a poor state as the QL file buffers are only flushed when the files are closed. Should it happen the program will probably error in the next session when any long-term memory routine is called (by mexec).
Entering LRUN mdv1_Initmem will restore Zmem and Zmem-names to their empty state.
Boot loading program for Robot Basic
Robot robot control program Basic
Zmem holds all long-term memory routines Data
Zmem-names holds routine names and lenghts Data
Initmem initialises Zmem and Zmem-names to empty Basic
Clone cartridge back-up program Basic
Most of the program consists of SuperBasic procedures which are invoked directly by the user at the keyboard and since the early QLs (pre JS) had no error trapping facilities available from SuperBasic the program uses two ways to protect itself.
For those procedures which are learnable robot commands and are also User invoked with a parameter eg. 'FD n' etc. failure to append any parameter will lead to a program error. This can be overcome by then entering oops which prompts for the missing data and executes a SuperBasic RETRY.
Other procedures are invoked by name only and they then request any data they need.
Running Zero2 from a PC with QPCII
If the Zero2 program-file is Zero2_bas then it can be LRUN from Superbasic with a DO file as follows
ie 'DO dodosZ2'
using the WIN file
eg dodosZ2='LRUN win1_zero2_zeroz.bas' then the program will load and run,
The data files Zmem and Zmem-names can be anywhere, edit the program following line 200 so directory$ holds the location; eg directory$='win1_zero2_'
using Windows folders
I find it much easier to edit using a Windows editor, eg 'Programmers File Editor' and keep the files under Windows.
if dodosZ2='LRUN DOS6_QL_Z2_Zero2_bas' then the program will load and run,
the program can be edited in QPCII and entering 'save' will save the program back as H:\QL\Z2\Zero2_bas
The data files Zmem and Zmem-names can be anywhere, edit the program following line 200 so directory$ holds the location; eg directory$='dos6_QL_Z2_' if they are in the same folder as Zero2_bas
The files Zero2_bas, Zmem and Zmem-names can be dragged into a browser to view or any editor which can handle the Unix style line ends.
LRUNing a file with PC-DOS style CRLF line ends results in 'syntax error'
Turtle graphics aspect ratio
At 1280 x 1024 screen size under XP on a 19" LCD monitor, if the QL screen measures 150 x 105 mm then squares are square.
Have to stretch the Windows window vertically to get 105.
Windows screen resolution QPCII QL screen size in mm under XP on a 19" LCD monitor
1280*1024 150*75 =>2:1
1280*960 150*80 =>1.875:1
1280*768 145*100 =>1.45:1
QL screen pixels are square, but all text in Windows and QPCII is poor!
800*600 241*128 =>1.13:1
Best results are at 1280*1024 and manually stretch the QPCII window to adjust the QL screen.
enter help to display screens