CALL KANJI
This page was last modified 03:19, 10 September 2017 by KdL. Based on work by Mars2000you and Gdx and others.

Contents

Effect

Activates the Kanji driver and switches the screen mode to one of the 4 KANJI text modes on MSX2+ and higher machines.

Note: When this instruction is executed at first time, all variables and status of instructions FOR...NEXT, GOSUB...RETURN are reset because the Kanji driver is installed.

Syntax

CALL KANJI[<kanji mode>]

Parameter

<kanji mode> can vary between 0 and 3. Do not put a space between KANJI and the kanji mode! When the parameter is not specified, the Kanji mode 0 is chosen.

KANJI mode Displayable characters Characters size Colors Remarks
0 32 or 64 x 13 8 x 16 16 of 512 RGB Characters from Kanji-ROM are displayed as is
1 40 or 80 x 13 6 x 16 16 of 512 RGB Characters are reduced to be displayed except
with Kanji-ROM from Panasonic that has 12 bit font
2 32 or 64 x 24 8 x 16 16 of 512 RGB Same as Kanji mode 0 but in screen mode interlaced
3 40 or 80 x 24 6 x 16 16 of 512 RGB Same as Kanji mode 1 but in screen mode interlaced


Displayable characters and used screen mode depend from the value entered with the instruction WIDTH. Used screen mode is screen 5 or 7. The screen mode switches when the value passes from one half to the other.

KANJI mode WIDTH Used SCREEN Used pixels
0 < 33 5 256 x 208
> 32 7 512 x 208
1 < 41 5 256 x 208
> 40 7 512 x 208
2 < 33 5 256 x 384
> 32 7 512 x 384
3 < 41 5 256 x 384
> 40 7 512 x 384


Note: Default/Initial width depends on the last text mode used (SCREEN 0 or SCREEN 1). In Kanji mode, you can restore the initial width with SCREEN 0 or SCREEN 1 instruction.

Example

CALL KANJI2

Particularities

- CALL KANJI uses a small part of the free memory and disables the following commands : CLS, COLOR=, SCREEN 9
- CHR$() is limited to the characters 33 to 128, 161 to 223, 253 and 254 in Kanji modes, and the character displayed for CHR$(128), CHR$(253) and CHR$(254) is not correct in Kanji modes 0 and 2 (? bug in Kanji BASIC)
- COLOR works slightly differently in Kanji mode
- WIDTH does not accept values lower than 26 in Kanji mode
- To clear the screen in Kanji mode, you need to use CALL CLS
- To alter the palette in Kanji mode, you need to use CALL PALETTE
- To go back to the 'standard' SCREEN 0 or SCREEN 1 and deactivate Kanji mode, you need to use CALL ANK
- If you use version 4 of Hangul BASIC in ROM format, are in Kanji mode and want to use SCREEN 9, first make a reboot with CALL REBOOT
- With exception of SCREEN 9, all the 'standard' SCREEN (0 to 8, 10 to 12) can be used while the Kanji mode remains enabled
- To fix the screen position in Kanji mode 2 and 3, you need to use VDP(10)=VDP(10)AND127

Related to

CALL ANK, CALL CLS, CALL PALETTE, CALL REBOOT, CHR$(), CLS, COLOR=, Hangul BASIC, SCREEN, WIDTH

Compatibility

Kanji BASIC