Risc PC Monitor Definition Files Explained


Number:254
Issue:1.02
Author:Dean Murphy
Date:5th September 1994

This application note describes in detail Risc PC monitor definition files. It should be read in conjunction with the !MakeModes documentation. !MakeModes is an application which assists the creation and editing of Risc PC monitor definition files.

The !MakeModes application and this application note assume a degree of technical knowledge concerning video display generation and is not intended for use by those unfamiliar with display technology.


Applicable Hardware: Acorn Risc PC

Related Application Notes: 63, 226, 262


Every effort has been made to ensure that the information in this document is true and correct at the time of printing. However, the products described in this document are subject to continuous development and improvements and Acorn Computers Limited reserves the right to change its specifications at any time. Acorn Computers Limited cannot accept liability for any loss or damage arising from the use of any information or particulars in this leaflet. Acorn, the Acorn Logo, Acorn Risc PC, ECONET, AUN, Pocket Book and ARCHIMEDES are trademarks of Acorn Computers Limited.

ARM is a trademark of Advance RISC Machines Limited.
All other trademarks acknowledged.
©1994 Acorn Computers Limited. All rights reserved.


Support Group
Acorn Computers Limited
Acorn House
Vision Park
Histon
Cambridge
CB4 4AE


Index

Introduction

The Acorn Risc PC, unlike any previous Acorn machine, does not have information on screen modes built into the operating system. Screen modes are instead defined in a Monitor Definition File (MDF) which is loaded when the machine boots up. This provides the user of a Risc PC with a much greater degree of flexibility when it comes to choosing a monitor as screen modes can now be individually tailored to suit the facilities offered by the monitor.

Overview

A Monitor Definition File which normally resides in the !Boot.Resources.Configure Monitors directory is a plain text file which defines all of the parameters necessary for the Risc PC to generate and display RISC OS screen modes. An example segment of an MDF follows...

Each screen mode that you wish to use should be defined as above within the monitor definition file. The application !MakeModes can be used to generate monitor definition files from data supplied by the user. It is available from your Acorn Dealer or local I.T. Centre. The application consists of a disc containing !MakeModes, a ReadMe file and an accompanying manual.

You are not advised to edit monitor definition files directly.

The parameters file_format, monitor_title and DPMS_state are set only once at the beginning of an MDF. The command startmode tells the machine that a mode definition follows. Below is a summary of all of the commands used in an MDF.

Where:

mode_name:
is a textual name for the mode that will be used in the display manager's mode menu. It is possible to prevent defined screen modes from appearing in the modes menu by simply leaving this field blank. Mode names are limited to 19 characters in length and may contain space characters.

x-resolution:

y-resolution:
hsync:
hbpch:
hlbdr:
hdisp:
hrbdr:
hfpch:
vsync:
vbpch:
vtbdr:
vdisp:
vbbdr:
vfpch:
pixel_rate:
sync_polarities:
All values on the h_timings line are in units of pixels, and all values on the v_timings line are in units of raster lines.

Note: VIDC20 imposes restrictions on these parameters. In particular, all the horizontal timing values must be in multiples of 2, and the horizontal total (hsync + hbpch + hlbdr + hdisp + hrbdr + hfpch) must be a multiple of 4.

The diagram below gives a graphical representation of this information.


Glossary of terms

Before describing in detail how these parameters can be used to define a new screen mode, it is necessary to understand some of the conventions that will be used in this application note.

Limiting Factors

Before creating a new screen mode or a new monitor definition file using the !MakeModes application, you should be fully aware of the factors limiting the display of a screen mode and the interrelationship of the variable paramaters.

The following describes these interrelationships and offers guidance on the limits for the screen mode definition. As values are changed, the MakeModes application automatically checks that the mode will be displayable, if it is not, MakeModes will inform you. However, much time will be saved when attempting to create new modes if you understand and work within the limits imposed rather than using a 'trial and error' method.

Listed below are the three main limiting factors which are discussed in this document.

Monitor Limitations

The screen mode must not exceed the monitor's line rate (horizontal frequency), frame rate (vertical frequency) or its maximum pixel rate. A monitors line and frame rate ranges can normally be found in its accompanying documentation. Please see the MakeModes manual for information on how to enter this information.

The Pixel rate is one of the principal variables that you will use in the MakeModes application. It can be used to increase or decrease a modes frame rate. Because a modes Line rate is directly affected by its Frame rate, altering the Pixel rate will change this value as well.

The Pixel rate is calculated from:

Pixel Rate = sum(h_timings) * sum(v_timings) * proposed frame rate

Frame and line rates can be calulated from:

Frame Rate = pixel_rate / (sum(h_timings) * sum(v_timings))

Line rates can be calculated from:

Line Rate = sum(v_timings) * frame_rate

Memory / Bandwidth Limitations

The Risc PC can have up to three different screen memory configurations, no VRAM (DRAM only), 1MB VRAM or 2MB VRAM.

With no VRAM fitted the Risc PC will be forced to use DRAM which has a slower access time than dedicated Video RAM. This greatly increases the amount of time spent by the processor updating the screen and therefore limits the amount of memory that can be used as screen RAM. This limitation in turn limits the maximum resolution and pixel depth that can be used. On a machine with 1MB VRAM, the maximum amount of screen memory that the system can process is 80MB/sec, with 2MB of VRAM, this figure doubles giving a maximum video bandwidth of 160MB/sec. Without VRAM the maximum video bandwidth is 40MB/sec. In order to provide a safety margin, the bandwidth limit file stored in the !Boot directory on the Risc PC hard disc sets the maximum bandwidths to 38MB/sec, 76MB/sec and 152MB/sec respectively.

Is is important to be aware of both the memory and bandwidth calculations as it is possible to define a mode that fits within the available video RAM but exceeds the machines maximum video bandwidth. The MakeModes application will warn you if a proposed screen mode will exceed either of these limitations.

The following table shows an example of the screen modes and colour combinations (pixel depths) that can be used with the three different VRAM options.


Calculating required bandwidth for a screen mode

The bandwidth used by a screen mode increases according to the number of colours being used. The calculations necessary to find the bandwidth for each bpp mode are listed below;

	Bits per pixel	Calculation used

	1   bpp		Video Bandwidth = (pixel_rate / 1000000) / 8
	2   bpp		Video Bandwidth = (pixel_rate / 1000000) / 4
	4   bpp		Video Bandwidth = (pixel_rate / 1000000) / 2
	8   bpp		Video Bandwidth = (pixel_rate / 1000000)
	16  bpp		Video Bandwidth = (pixel_rate / 1000000) * 2
	32  bpp		Video Bandwidth = (pixel_rate / 1000000) * 4

These calculations will give a result in MB/sec.

Calculating memory requirements for a screen mode

Besides bandwidth limitations, another factor that one must also consider when creating a new mode is the amount of screen memory that will be needed. To work out how much memory a screen mode will need you must first find out how many pixels will be displayed in total. Multiplying the x_resolution by the y_resolution will give this figure.

pixel_total = x_resolution * y_resolution

This total is then used in conjunction with the number of bits per pixel (bpp) to calculate the amount of memory required.

		Bits per pixel	Calculation used

		1   bpp		VRAM = pixel_total / 8
		2   bpp		VRAM = pixel_total / 4
		4   bpp		VRAM = pixel_total / 2
		8   bpp		VRAM = pixel_total
		16  bpp		VRAM = pixel_total * 2
		32  bpp		VRAM = pixel_total * 4

Examples

The following table gives an example of how much memory is required for some standard screen modes at various pixel depths.


As can be seen from the table above, not all screen modes can be displayed at every pixel depth e.g. only machines with 2MB VRAM would be able to display 800 x 600 at 16 Million colours. Machines fitted with only 1MB VRAM could only display those modes that require 1024K or less.

What the horizontal and vertical timings mean

The horizontal sync width (hsync) value is the time, in units of pixels of the horizontal sync pulse. If the hsync pulse is not wide enough the monitor will be unable to sync correctly.

The horizontal back porch (hbpch) and and horizontal front porch (hfpch) values define the time, in units of pixels, from the end of the hsync pulse to the start of the horizontal left border (hlbdr) and the end of the horizontal right border and to the end of the horizontal scan line respectively. Amongst other things the hsync+hbpch time period is used by the VIDC20 to switch between cursor and video data. If the combined time period is not long enough, the screen display will be corrupted as the VIDC20 will be unable to fetch video data before the screen display starts.

The horizontal left border and horizontal right border values define the time period, in units of pixels, for the left and right screen borders. The horizontal left border and horizontal back porch values can be altered to position the picture correctly.

The horizontal display (hdisp) value is the horizontal screen resolution i.e the number of pixels displayed across the screen.

The vertical sync (vsync) value is the width, in units of raster, of the sync width pulse. If this pulse is not wide enough, the monitor will be unable to sync to the signal.

The vertical porches (vbpch, vfpch), vertical borders (vtbdr, vbbdr) are the vertical equivalents of the horizontal values but are all measured in units of raster.

-----Hot links to other pages-----
Acorn Computer Group Acorn Education


© 1995 Acorn Computer Group plc.
Design: © 1995 Cave Rock Software Ltd.