SCREEN
This page was last modified 21:11, 16 April 2017 by Mars2000you. Based on work by Gdx and NYYRIKKI and others.

Sets graphic mode, spritesize, keyboardclick, cassettespeed, printertype and displaymode.

Contents

Syntax

SCREEN [mode],[sprite],[click],[baud],[printertype][,displaymode]

Note: Do not put a comma if no parameters are behind.

Mode

(1) = set with WIDTH (2) = interlaced by default

SCREEN Type Characters, Max Pixel resolution/screen Color resolution/screen, Max blocks Colors / block (MSX2) Max colors / screen
MSX 0 Text 40 (1) x 24, 256 240 x 192 1 x 1, 1 2 of 16 (of 512 RGB) 2
1 Text 32 (1) x 24, 256 256 x 192 32 x 24, 32 2 of 16 (of 512 RGB) 16
2 Graphic 32 x 24 , 768 256 x 192 32 x 192, 6144 2 of 16 (of 512 RGB) 16
3 Graphic 32 x 24, 256 64 x 48 64 x 48, 3072 1 of 16 (of 512 RGB) 16


SCREEN 1 is a text screen, but the charset can be filled with game graphics and sprites can also be used.

SCREEN Type Characters, Max Pixel resolution/screen Color resolution/screen, Max blocks Colors / block Max colors / screen
MSX2 0 Text 80 (1) x 24, 256 480 x 192 80 x 24, 1920 2 of 2+2 of 16 of 512 RGB 4
4 Graphic 32 x 24, 768 256 x 192 32 x 192, 6144 2 of 16 of 512 RGB 16
5 Graphic Bitmap 256 x 212 256 x 212 16 of 512 RGB 16
6 Graphic Bitmap 512 x 212 512 x 212 4 of 512 RGB 4
7 Graphic Bitmap 512 x 212 512 x 212 16 of 512 RGB 16
8 Graphic Bitmap 256 x 212 256 x 212 256 RGB 256


MSX2 and MSX2+ modes have better sprite possibilities compared to MSX1 modes. On MSX2 and higher you can change between 40x24 and 80x24 SCREEN 0 mode by using WIDTH-command.

SCREEN 9: Available only on Korean MSX2 computers and consoles, but version 4 of Hangul BASIC developed by Korean MSX fan Plaire extends SCREEN 9 to non-Korean MSX2, MSX2+ and MSX Turbo R machines, and its working is the same as in the Korean MSX2 consoles.

SCREEN Type Displayable characters Characters size WIDTH Used SCREEN Used pixels Colors
9 Text 40 or 80 (1) x 24 6 x 16 Computers 6 512 x 384 (2) 4 of 512 RGB
Consoles < 41 5 256 x 384 (2) 16 of 512 RGB
> 40 6 512 x 384 (2) 4 of 512 RGB


SCREEN Type Characters Pixel resolution/screen Color resolution/screen Max colors / block or screen
MSX2+ 10 Graphic Bitmap 256 x 212 (Y, RGB) 64 x 212 (J,K) 16 out of 512 RGB + 12499 YJK
11 Graphic Bitmap 256 x 212 (Y, RGB) 64 x 212 (J,K) 12499 YJK + 16 out of 512 RGB
12 Graphic Bitmap 256 x 212 64 x 212 (J,K) 19268 YJK


KANJI screens: Besides SCREEN 0 to 8, 10 to 12, the Japanese MSX2+ and MSX Turbo R computers have 4 Kanji text modes, that can be activated with CALL KANJI.

By default, without using of SET SCREEN on MSX2 and higher, the MSX-BASIC screen after booting is displayed in SCREEN 1 on Korean and Arabic MSX machines, Daewoo CPC-300, Perfect MSX-2, Korean MSX2 consoles, Brazilian MSX2+ Ciel machines and all Japanese machines, in SCREEN 0 on all other machines.

Sprite

0: Spritesize is 8 by 8 pixels - default value
1: Spritesize is 8 by 8 pixels, magnified to 16 by 16 pixels
2: Spritesize is 16 by 16 pixels
3: Spritesize is 16 by 16 pixels, magnified to 32 by 32 pixels

Click

0: Keyclick off
1: Keyclick on - default value

Baud

1: Cassette writing speed is 1200 baud - default value
2: Cassette writing speed is 2400 baud

This parameter is ignored on MSX Turbo R.

Printertype

0: MSX Printer - default value
1: No MSX Printer

Displaymode

0: Normal - default value for SCREEN 0 to 8, 10 to 12
1: Interlaced - default value for SCREEN 9
2: Normal, alternating even/uneven
3: Interlaced, alternating even/uneven

This parameter requires a MSX2 or higher machine (don't use it on MSX1, it will lead to a 'Syntax error' message). Displaymodes 2 and 3 are only possible when uneven pagenumbers are used (see SET PAGE).

Examples

5 ' Example for MSX1
10 SCREEN 0: PRINT"You are in SCREEN 0 - Press a key"
20 A$=INKEY$
30 IF A$="" THEN 20
40 ' Baud and printertype are not changed
50 SCREEN 2,3,0
60 OPEN"GRP:"AS 1:PRINT #1,"You are in SCREEN 2 - Press a key"
70 A$=INKEY$
80 IF A$="" THEN 70
90 ' Back to default values in SCREEN 0
100 SCREEN 0,0,1
5 ' Example for MSX2 and higher
10 SCREEN 0: PRINT"You are in SCREEN 0 - Press a key"
20 A$=INKEY$
30 IF A$="" THEN 20
40 ' Baud and printertype are not changed
50 SCREEN 2,3,0,,,1
60 OPEN"GRP:"AS 1:PRINT #1,"You are in SCREEN 2 - Press a key"
70 A$=INKEY$
80 IF A$="" THEN 70
90 ' Back to default values in SCREEN 0
100 SCREEN 0,0,1,,,0

How to change the default values

With exception for the spritesize, all parameters of SCREEN that will be used each time that you boot the computer are stored in the Real Time Clock (RTC) with the SET SCREEN command on the MSX2, MSX2+ and MSX Turbo R machines.

The parameters related to the displaymode are generally limited to screen 0 or screen 1, as these screens are used for the BASIC screen after booting, it implies that the 'alternating even/uneven' parameter is not saved in the RTC.

On the mentioned machines, you can change the default values by using first SCREEN, then SET SCREEN to save the new parameters in the RTC.

If you use SET SCREEN when you are on SCREEN 9, the computer will display the MSX-BASIC screen after booting in SCREEN 9 instead of SCREEN 0 or 1; some parameters of the other screens, especially SCREEN 0 and SCREEN 1, will also be modified.

Compatibility

MSX-BASIC 1.0 or higher

Related to

BASE(), CALL KANJI, COLOR, CSAVE, Hangul BASIC, LPRINT, LLIST, SET PAGE, SET SCREEN, WIDTH