How BASin differs from a real Spectrum

BASin

How BASin differs from a real Spectrum

This section is intended for Adults who are familiar with the Sinclair Spectrum to read

BASin, although as functionally close to being a Sinclair Spectrum on a PC as possible, has several differences. Mostly these affect the way you enter programs into the emulated Spectrum. Firstly, the Spectrum ROM used has been patched extensively to allow new features and bug-fixes, though no changes have been made to the ROM that would affect how your programs would run on a real Spectrum. One example of this is the lack of K, L, C, E, and G cursors - because of the addition of PC keyboard support, these are no longer necessary, as is also the case with the Symbol Shift key. The main cursor in INPUT commands is now a white and blue flashing square, which hovers over the input rather than nestled between tokens. The editor does support the usual text processing operations such as cut, copy, paste and search/replace functions.

Editor and keyboard

Tokens are handled differently too. You no longer enter entire words using a single key-press - the editor is based on the 128k Spectrum, which means full typing support with the available use of every key on a modern keyboard. You are also free to use the mouse to make selections and get context sensitive help. For more information, consult the section devoted to Using the Editor.

As mentioned before, the keyboard does not function as a 48k Spectrum's keyboard would. This means that retrieving key states by reading the result of a BASIC IN instruction from port $FE (254) no longer works. INKEY$ is not affected, however. Machine code instructions that read the keyboard from a Z80 IN opcode will retrieve the correct keys - but the keyboard is significantly different from a PC. The CTRL key is designated to Symbol Shift, the Shift keys act as expected, but bear in mind that CTRL-P will produce a quote (") mark, as opposed to shift-2 on a UK keyboard.

Screen display

The main display output (the Spectrum "screen") sits to the right of the Editor in the main window. When a program is running, this window will be where any program output appears. It behaves exactly the same way as a real Spectrum's display. Because the editor is now in a separate area to the display, runtime errors no longer report to the bottom of the display - they can be redirected to an error dialog which also provides information on that error. This again helps prevent display corruption, but is a feature that can be turned off.

prompts have been enhanced: they use the same blue-and-white cursor as the editor, and they support cut and paste operations.

Loading and saving files

BASin uses text files with the .bas extension to store BASIC code. This code is in raw text format (windows notepad compatible) with escape codes to represent tokens that cannot be rendered in plain text. See the chapter on .BAS File Format for more details. These files can be used just like tape files on the original hardware - they can store runtime variable contents and auto-start when loaded. BASin for Beginners can load any of the formats that BASin supports, but can only save in .szx format. This is to ensure that any program saved by BASin can be run on a Sinclair Spectrum Vega.

See Loading and saving files for more information.