[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.3.1 Mode (%M)

The Mode command is the primary means of setting the (S)VGA mode. The single argument specifies which Cogsys mode to switch into. This is the relationship between Cogsys modes and VGA modes:

Cogsys Mode (S)VGA mode (hex) Description
0 3 (0x0003) VGA Text, 80x25, 16 colors
1 17 (0x0011) VGA Graphics, 640x480, 2 colors
2 257 (0x0101) SVGA Graphics, 640x480, 256 colors

If a testlist uses mode 2, the video adapter on the run time system must be VESA BIOS Extensions (VBE) 2.0 compliant (1.2.1 Requirements). Testlists that do not need Cogsys mode 2 need only any VGA compatible system.

Cogsys will always start and stop in mode 0.

The text modes are those which can only display a certain set of characters at fixed locations on the screen. Currently, the only Cogsys text mode is 0. The graphics modes can access every pixel on this display (they are also called all points addressable (APA) modes). Currently, the Cogsys graphics modes are 1 and 2.

Switching into a graphics mode automatically loads the default fonts (2.3.4.9 Graphics-Mode Text Attributes (%A)) and initializes the graphics environment. Switching back to text mode automatically unloads the fonts.

If a testlist is going to switch modes, it is good practice to explicitly put a Mode command at the top of the testlist. This immediately identifies those lists which need graphics capabilities.

Name:
Mode
Class:
Video Control
Code:
%M
Syntax:
%Mmodenum
%M[modenum,fontpath]
modenum is a integer from 0-2 representing the Cogsys mode
fontpath is the path where fonts should be loaded from
System:
Switches into Cogsys mode modenum.
History:
The Cogsys 3 Mode command is completely redesigned.

In Cogsys 2.x, %M took an argument which explicitly set the VGA mode. This required the user to be familiar with the full list of VGA modes, even though only two (VGA Mode 3 and VGA Mode 17) were actually useful. Testlists which have `%M3' and `%M17' should be changed to %M0 and %M2, respectively.

Later versions of Cogsys 2.x used VGA Mode 16 (Graphics, 640x350, 16 color) in conjunction with the now-defunct `$B' command for multiframe displays on slower systems. Multiframe displays are now done with the new Multiframe Display Picture commands (see section Multiframe Picture Display) which do not use video page switching and rely on processor/adapter speed, instead (see section Requirements. Old testlists which use `%M16' must be rewritten with the Multiframe Display.

Finally, Cogsys 2.x (confusingly) used hexadecimal to set SVGA mode 257 (in hex, 0x0101). In addition, "color support" needed to be activated with a `$C' command--this cryptic requirement is no longer necessary. References to `$C%M101' should become %M2.

Test Files:
`MODE_T01.IN'
tests basic operation

Examples:

input
%M2#G[hello from graphics mode!]#W5000%M0
cogsys
Switches to Cogsys mode 2 (640x480x256 colors), displays the string, waits 5 seconds, and returns to text mode. The string is displayed in the default font, size, color and justification at the location 0,0 (top left of the screen).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Usman Muzaffar on June, 28 2000 using texi2html