The NextOS Editor and Menus

Editor and menus changes between +3e/NextOS (Updated 30 Nov 2017)

Credits/Authors: Garry Lancaster and Phoebus Dokos.

 

This document describes the planned changes in the editor and menu system between the version of the +3e currently available from the +3e website (+3e v1.43) and the January launch version of NextOS (which will be released as NextOS v2.00).

 

Updates: 30 Nov 2017

Added description of new Browser features: remount, mkdir, rename, copy/paste and erase.

 

Updates: 25 Nov 2017

Added note that it is now possible to use the wildcard character ? in the Browser configuration file to match a single character in the filetype (with examples).

 

Updates: 14 Nov 2017

Added note that it is now possible to use the wildcard character * in the Browser configuration file to match remaining characters in the filetype (with examples).

 

 

Additional editing functions

(As described in a previous document).

The NextBASIC editor is enhanced from the original +3e v1.43 editor as follows:

 

  1. The current mode is now reflected in the cursor colour (flashes alternately with white):
  • normal text entry: blue (as previously)
  • CAPS lock on: cyan
  • GRAPHICS mode: magenta
  • EXTEND mode: green
  • error marker: red (as previously)

 

  1. Extended mode symbols shown in red below the keys (ie ~ | \ [ ] { }) can be entered either by entering EXTEND mode and then pressing SYMBOL-SHIFT plus the key, OR by just pressing SYMBOL-SHIFT plus the key in normal/CAPS modes.

 

The exception is the copyright symbol, which can either be entered in EXTEND mode by pressing SYMBOL-SHIFT plus P, or in normal/CAPS mode by pressing SYMBOL-SHIFT plus Q.

 

  1. The following additional editing keys are available (EXTEND,key means press and release the EXTEND key (to enter EXTEND mode) and then press the key):
  • EXTEND,EDIT – Switch between full/lower screen editor (same as choosing Screen from the edit menu)
  • EXTEND,CURSOR LEFT – Move to start of BASIC line
  • EXTEND,CURSOR RIGHT – Move to end of BASIC line
  • EXTEND,CURSOR UP – Move up 10 screen lines
  • EXTEND,CURSOR DOWN – Move down 10 screen lines
  • EXTEND,GRAPHICS – Move to start of program
  • EXTEND,CAPS LOCK – Move to end of program
  • TRUE VIDEO – Move left one word
  • INVERSE VIDEO – Move right one word
  • EXTEND,TRUE VIDEO – Delete word left
  • EXTEND,INVERSE VIDEO – Delete word right
  • EXTEND,DELETE – Delete character right
  • EXTEND,9 – Delete to start of BASIC line
  • EXTEND,0 – Delete to end of BASIC line

 

Additional Menu Features

 

All menus now display the amount of RAM available to the Spectrum in the bottom-right corner (this is expected to be 768K for standard 1MB Nexts and 1792K for fully-expanded 2MB Nexts).

 

The current clock speed is displayed in the menu title bar, and defaults to the standard 3.5MHz at boot. It can be altered whilst in the menus by pressing the left and right cursor keys to reduce/increase the speed respectively. (It is not yet known what the maximum available speed will be).

Main Menu

 

The main menu now contains the following items:

  • Browser
  • NextOS
  • NextBASIC
  • Calculator
  • CP/M
  • Boot A:
  • Tape Loader
  • 48 BASIC

 

Of these, NextBASIC, Calculator and 48 BASIC are the same as the old +3 BASIC, Calculator and 48 BASIC options.

 

The old Loader option is now split into two:

 

Boot A:

Attempts to boot any floppy disk in drive A: (if a third-party +3-compatible floppy disk interface and drive is attached).

This will also work if a partition or disk image has been mapped to drive A: (provided there is a boot sector or a “DISK” filename to load and boot). Note that most +3 disk software was copy-protected and/or hard-coded to use the floppy drive, so this won’t work for a lot of commercial releases.

 

Loader

This will start loading from cassette. If a .TAP file has been attached to the tape input (using the .tapein dot command), then this will be loaded.

 

Three new options have also been added. The Browser is described in a later section. The other two new options are:

 

NextOS

This is the same as the NextBASIC option except that any currently-resident BASIC program is not listed (and can’t be directly edited, although you can still RUN the program, enter new lines, or delete them by just entering the line number). The main purpose is for using disk-related commands such as CAT so that the output can be seen without being continually replaced by the program listing.

 

CP/M

This will re-map drives to files in the C:/NEXTOS directory named CPM-A.P3D etc (or, if not present, DRV-A.P3D etc) and then attempt to load the CP/M operating system from drive A:. Therefore, C:/NEXTOS/CPM-A.P3D must contain all the necessary CP/M system files for the ZX Spectrum Next. (It is intended that this drive image will be made available for download or distributed on the SD card).

 

The NextBASIC Editor

 

The NextBASIC editor option operates largely as previously, but can now operate in the usual 32-column mode (with colour-coded cursors as noted earlier) or in 64-column or 85-column modes.

 

The 64/85-column options use the Timex hi-res screen mode, and so are in monochrome. In these modes, instead of colour-coded cursors, there are new cursor shapes:

 

  • normal text entry: horizontal bar in lower half of character
  • CAPS lock on: horizontal bar in upper half of character
  • GRAPHICS mode: vertical bar
  • EXTEND mode: horizontal stripes
  • error marker: rectangular outline

 

The options menu within NextBASIC now has the following options (note that the previously-available Print option has been removed):

 

  • NextBASIC
  • NextOS
  • 32/64/85
  • Screen
  • Renumber
  • Exit

 

The NextBASIC and NextOS options return to the editor in the appropriate mode.

 

32/64/85 cycles between the number of text columns available in editing mode (with Timex hi-res mode being used for 64 or 85 columns).

 

Screen switches between having the editing area in the upper/lower screen (as previously).

 

Renumber renumbers the entire program starting at line 10 in steps of 10 (note that this cannot be altered by POKing system variables, as these no longer exist. Instead the new LINE..TO command must be used).

 

Exit exits the editor and returns to the main menu.

 

Note that the editor mode is independent of the mode used by BASIC. Therefore, even if you have switched to hi-res mode in the editor, when a BASIC command or program is executed, the mode is changed to whatever was last set by the LAYER command (or to standard Spectrum mode if no LAYER commands have been issued). When the command/program has finished, the mode will switch back to the appropriate mode for the editor.

Calculator and NextOS

 

The options menu in the Calculator mode now has the following options:

 

  • Calculator
  • 32/64/85
  • Exit

 

The options menu in the NextOS mode has the following options:

 

  • NextOS
  • NextBASIC
  • 32/64/85
  • Exit

 

All the options work in the same way as those found in the NextBASIC options menu.

 

Note that the NextBASIC, NextOS and Calculator modes all use the same setting for 32/64/85 columns, so changing the number of columns in one also affects the others.

 

Browser

 

This option allows an easy way to manage and run files from the SD card.

 

On entry to the Browser, the files and subdirectories in the current directory are listed.

 

The current file/directory highlight may be moved by using the up/down cursor keys. If there are more files than will fit on a single screen, then using left/right will move one page backwards/forwards respectively. Using down at the bottom of the screen or up at the top of the screen also moves to the next/previous page.

 

The currently-selected file/directory is highlighted in cyan if the file can be executed or in yellow if NextOS does not support executing that type of file.

 

Available keys are:

    • cursor keys: navigate up/down/back page/forward page
    • SPACE/BREAK: exit the browser back to the main menu
    • ENTER: load/execute the currently-selected file (or change to the currently-selected directory)

 

  • EDIT: move back up one directory level (this can also be done by pressing ENTER on the special .. directory)

 

    • D: change the current drive to the next available mapped drive

 

  • M: allows the SD card to be removed and/or replaced
  • K: make a new directory
  • R: rename the currently-highlighted file or directory
  • C: copy the currently-highlighted file. You can then navigate to a different drive and/or directory and press P to paste a copy of the file
  • E: erase the currently-highlighted file or (empty) directory

 

 

If the chosen action cannot be performed, the Browser will beep and abort the operation.

 

The browser can be used as a quick directory navigation tool (instead of using CD commands), since when you exit it with SPACE or BREAK, the new current directory is the one that was last displayed in the browser.

 

Browser configuration

 

The filetypes supported by the Browser are defined in the plain text configuration file C:/NEXTOS/BROWSER.CFG which is loaded every time that the browser is started.

 

This file contains one line per filetype. The first 1-3 characters are the extension to be supported (this must be in capitals). The next character is a colon (:). The remainder of the line is a BASIC command (or commands, separated with colons) which is used to execute the file. Within the list of commands, the vertical bar symbol (|) represents the selected file, and will be replaced directly with the (short) filename.

 

Note that this is a plain text file and commands are written in standard ASCII text, not using Spectrum token codes.

 

You can use the special wildcard character * to match all remaining characters in the filetype. eg Z*: matches .z, .z5, .zip etc. To match all remaining files, use *: on the last line of the configuration file, eg:

 

*:.hexdump |

 

You can also use the special wildcard character ? to match a single character in the filetype. eg Z?: matches .z3, .z4, .z5 etc but not .z or .zip.

 

An example of possible contents for this file is as follows (something similar will be provided on the SD card and/or for download):

 

BAS:load “|”

Z80:spectrum “|”

SNA:spectrum “|”

TAP:.tapein |:load “t:”:load “”

O:spectrum “|”

P:spectrum “|”

POK:spectrum “|”

TXT:copy “|” to screen$

DOC:copy “|” to screen$

SCR:load “|” screen$:pause 0

LY2:layer 2,1:load “|” layer:pause 0:layer 2,0

LY0:layer 1,0:load “|” layer:pause 0:layer 0

LYH:layer 1,2:load “|” layer:pause 0:layer 0

LYC:layer 1,3:load “|” layer:pause 0:layer 0

Z1:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

Z2:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

Z3:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

Z4:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

Z5:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

Z7:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

Z8:clear 26623:let f$=”|”:cd ”c:/zxzvm”:merge “zxzvmrun.bas”:goto 8000

TZX:.tzxtotap |,c:/nextos/tmptap.tap:.tapein “c:/nextos/tmptap.tap”:load “t:”:load “”

Editor-related BASIC commands

 

The editor colour scheme can be chosen using these standard commands from +3e BASIC:

 

SPECTRUM INK n

SPECTRUM PAPER n

SPECTRUM FLASH n

SPECTRUM BRIGHT n

SPECTRUM ATTR n

 

The colour scheme applies to the standard 32-column editing mode as well as the hi-resolution 64/85 column modes. However, since Timex hi-res only allows 8 different colour schemes, the scheme used is the one with the same PAPER colour as standard mode.

 

The default number of columns in the editor can be chosen using the new command:

 

SPECTRUM CHR$ n

where n is 32, 64 or 85.

 

As noted in a previous document, there is no “permanence” with commands like these, but they can be included in C:/NEXTOS/AUTOEXEC.BAT to be executed automatically at startup.