SVI-BASIC
This page was last modified 15:00, 24 August 2022 by Mars2000you. Based on work by NYYRIKKI.

Contents

Description

SVI-BASIC is provided with the Spectravideo SVI-318 and SVI-328 computers.

This BASIC variant is very close to the MSX-BASIC available on MSX1 machines.

We will here mainly give info about the differences, so you can adapt SVI-3x8 programs for the MSX system.

Note: SVI-BASIC can be extended with the SVI Disk BASIC instructions.

Character sets

There are some differences between SVI and MSX character sets:

  • The SVI-BASIC ability to work on SCREEN 0 with an inverse character set by using PRINT CHR$(27)+"p" and go back to normal characters with PRINT CHR$(27)+"q" is not available on MSX, as the necessary characters are used for the specific MSX graphic characters and punctuation marks.

To use inverse characters on MSX, you need to write a routine - see examples in this thread: https://www.msx.org/forum/msx-talk/general-discussion/inverted-text

  • The SVI graphic characters are, except for a few, not present (and/or have a different ASCII code) on MSX.

Instructions that work differently

CLOAD and CSAVE

The SVI version of the CLOAD instruction can use S as second parameter to load a visible (text or graphic) screen, previously saved to tape.

The SVI version of the CSAVE instruction can use S as second parameter to save the current visible (text or graphic) screen to tape.

It's not possible in MSX-BASIC. You need the routine published in C.U.C. computer INFO 12.

CLS

The SVI version of the CLS instruction is a little different as contrary to MSX, it makes also disappear the sprites.

To get the same result on MSX for the sprites, you need to switch to SCREEN 0 (and optionally go back to SCREEN 2 or 3).

LOCATE and PRINT

LOCATE is generally used to put the cursor at a specified place on the screen before displaying a text with PRINT.

Contrary to MSX, LOCATE is not limited to text screens, but can also be used on graphic screens. In the same way, PRINT does not requires a special syntax on graphic screens with SVI-318/328.

When adapting such program for MSX, you need to make 3 things:

  • add OPEN"GRP:"AS1 in the beginning of the program
  • replace LOCATE x,y by PRESET(x,y) or DRAW"BMx,y"
  • use PRINT #1, <Item> instead of PRINT <Item> - <Item> can be a character string, an expression, a variable or a value to display

Notes:

  • Both coordinates need to be specified with PRESET, contrary to LOCATE that can be used with only one coordinate
  • You need to add extra PRESET instructions when a SVI-3x8 program mixes LOCATE, PRINT and DRAW instructions
  • The characters on graphic screens are 6x8 on SVI-3x8 instead of 8x8 on MSX, so you can have maximum 42 characters per line on SVI-3x8 while it is limited to 32 characters on MSX. It can be a problem in the conversion, but you can fix it by
    • changing the coordinates with PRESET and/or the length of the text
    • using a routine reducing the character size and the space between characters - see routine at the end of the Pistol (Pistool) game in C.U.C. INFO 06
  • When the program includes a full repeat of its execution, you need to insert CLOSE1 before this repeat.

SCREEN

Contrary to MSX, the SCREEN instruction has only 2 parameters: <DisplayMode>,<SpriteSize>.

<DisplayMode> is a value between 0 and 2, as the MSX Screen 1 mode is not available.

It means you need to replace SCREEN 1 by SCREEN 2, and SCREEN 2 by SCREEN 3 when adapting the program for MSX.

<SpriteSize> is a value between 0 and 3, just like on MSX. However, it has a special effect in SCREEN 0: value 0 removes the line with the content of function keys (= KEY OFF in MSX-BASIC) and value 1 restores this line (= KEY ON in MSX-BASIC).

Note: the cassette baudrate can't be changed, it's always fixed to 1800 baud on SVI-318/328

Instructions that require advanced knowledge

DEF USR, INP, OUT, PEEK, POKE and USR

The DEF USR, INP(), OUT, PEEK(), POKE and USR() instructions work like on MSX, but the problem is that the SVI BIOS uses addresses that are different from the MSX BIOS.

The adaptation of these instructions requires to know very well both BIOS. When it's a very simple ML trick, you can try to just skip it by adding a REM before the concerned instructions.

Specific instructions

CLICK ON/OFF

This instruction allows to enable/disable the keyclick.

You need to replace it by using the third parameter of the MSX SCREEN instruction.

GET and PUT

The GET instruction reads the pixel colors of a screen zone specified by 2 coordinates. They can then be used with the PUT instruction.

Example: GET (10,10) - (40,40), C - the name of the screen zone is here C

The PUT instruction writes pixel colors from a screen zone previously read by GET on another location on the screen, by specifying starting coordinates and optionally an operator (PSET - PRESET - AND - OR - XOR) for special effects on the pixel colors.

Example: PUT (100, 100), A, OR - the name of the screen zone is here A

The adaptation for MSX is not easy, especially when SCREEN 2 (= SCREEN 3 on MSX) is used and/or the program displays characters on a graphic screen (size 6x8 on SVI-3x8, 8x8 on MSX):

  • A partial solution can be found with the EddyII BASIC extension and its CALL TRIMMING instruction, but it can't handle the special effects based on an operator.
  • You can also use COPY on MSX2 and higher, but you need to use a higher screen mode (5 to 8, 10 to 12) and will therefore lose overlapping color effects.

SOUND ON/OFF

This instruction enables/disables the cassette drive monitor speaker that allows hearing the load sounds or playing music directly from cassette to user when combined with MOTOR ON/OFF.

This speaker how ever was only available in SV-903 and it was removed from later SV-904 data recorder model. This design change made the instruction obsolete.

It can't be used on MSX.

Links

Note: The Swedish manual is more accurate and complete than the English and Spanish manuals.