|This article is very short and not very detailed. Please help to improve it.|
|Abbreviation:||gR or gR cL|
|Token code:||$de (222)|
in BASIC ROM:
|List of all BASIC keywords|
Type: Command General Programming-Syntax: GRAPHIC <mode>[,<clear>[,<text>]] or GRAPHIC CLR
The command GRAPHIC the corresponding graphics or text mode is set. In the case of a graphics mode a part of the free BASIC RAM is reserved for graphics use. This is about 10 KByte. With the C128 and Plus/4 here the BASIC program beginning is shifted upward, while with the C16/116 it is shortened because of the small working memory.
For the parameter Mode the following values are allowed:
- 0 : Text mode with 40 characters per line.
- 1 : high resolution graphics (320×200 pixels)
- 2 : high resolution graphic mixed with text (split screen).
- 3 : multicolor graphic (160×200 pixels)
- 4 : Multicolor graphic mixed with text (split screen).
- 5 : Text mode with 80 characters per line (not for C16/C116 and Plus/4, but only for C128!).
The parameter Clear (0 or 1) specifies whether the graphic modes 1 to 4 are cleared when called with the value 1. With the mixed modes 2 and 4 also the text area is deleted.
Only BASIC 7.0: The text line parameter (0 to 25) determines, for mixed graphics modes 2 and 4, how many screen lines are devoted to the graphic relative to the text mode.
In contrast to switching to text mode with GRAPHIC 0, only a GRAPHIC CLR achieves that additionally also the reserved graphics area is cleared and reallocated to the free BASIC RAM.
BASIC 3.5 bug: GRAPHIC CLR forgets to copy the BASIC memory back down at 32 KByte. However, the next GRAPHIC 1 puts it back on top, which eventually causes an overflow into the TED registers and the Zeropage.
Values other than those specified for Mode and Delete, or for values for Textline outside the allowed range, will cause an error message to be displayed.
Attention by using VERIFY or DVERIFY: On those computers, where the BASIC program is moved with active graphics, the program, which is identical in itself, can nevertheless differ from the one in memory, depending on whether it was saved with or without activated graphics (since in the BASIC code the line link addresses are contained as absolute memory addresses and differ depending on the position of the program). So one must take care to save and compare the program with identical graphics constellation.
The hires graphic mode is activated.
GRAPHIC 2, 1
The mixed text mode (with 5 coloumns) and hires graphic mode is activated and the screen is deleting.