home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / m / makemodes / Text
Encoding:
Text File  |  1995-06-20  |  15.0 KB  |  388 lines

  1. -----------------------------------------------------------------------------
  2. 5th September 1994
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 254
  6. Issue:  1.02
  7. Author: DM
  8. -----------------------------------------------------------------------------
  9. Risc PC monitor definition files explained
  10. -----------------------------------------------------------------------------
  11. Notes: 
  12. This application note describes in detail Risc PC monitor definition files.
  13. It should be read in conjunction with the !MakeModes documentation.
  14. !MakeModes is an application which assists the creation and editing of Risc
  15. PC monitor definition files.
  16.  
  17. The !MakeModes application and this application note assume a degree of
  18. technical knowledge concerning video display generation and is not intended
  19. for use by those unfamiliar with display technology.
  20. -----------------------------------------------------------------------------
  21. Applicable Hardware: 
  22. Risc PC range
  23.  
  24. Related Application Notes: 
  25. !MakeModes
  26.  
  27. -----------------------------------------------------------------------------
  28. Copyright (C) 1994 Acorn Computers Limited 
  29.  
  30. Every effort has been made to ensure that the information in this leaflet is 
  31. true and correct at the time of printing. However, the products described in
  32. this leaflet are subject to continuous development and improvements and
  33. Acorn Computers Limited reserves the right to change its specifications at
  34. any time. Acorn Computers Limited cannot accept liability for any loss or
  35. damage arising from the use of any information or particulars in this
  36. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  37. Limited.
  38. -----------------------------------------------------------------------------
  39. Support Group
  40. Acorn Computers Limited
  41. Acorn House
  42. Vision Park
  43. Histon
  44. Cambridge
  45. CB4 4AE                                                  
  46. -----------------------------------------------------------------------------
  47.  
  48. Introduction
  49. ------------
  50. The Acorn Risc PC, unlike any previous Acorn machine, does not have
  51. information on screen modes built into the operating system. Screen modes
  52. are instead defined in a Monitor Definition File (MDF) which is loaded when
  53. the machine boots up. This provides the user of a Risc PC with a much
  54. greater degree of flexibility when it comes to choosing a monitor as screen
  55. modes can now be individually tailored to suit the facilities offered by the
  56. monitor.
  57.  
  58. Overview
  59. --------
  60. A Monitor Definition File which normally resides in the
  61. !Boot.Resources.Configure Mon- itors directory is a plain text file which
  62. defines all of the parameters necessary for the Risc PC  to generate and
  63. display RISC OS screen modes. An example segment of an MDF follows...
  64.  
  65. file_format:1
  66. monitor_title:Acorn AKF60
  67. DPMS_state:1
  68.  
  69. # 320 x 250 (70Hz)
  70. startmode
  71. mode_name:320 x 250
  72. x_res:320
  73. y_res:250
  74. pixel_rate:12587
  75. h_timings:36,14,12,320,12,6
  76. v_timings:2,109,0,250,0,88
  77. sync_pol:2
  78. endmode
  79.  
  80. # 800 x 600 (75Hz)
  81. startmode
  82. mode_name:800 x 600
  83. x_res:800
  84. y_res:600
  85. pixel_rate:49500
  86. h_timings:80,46,42,800,42,46
  87. v_timings:3,21,0,600,0,1
  88. sync_pol:0
  89. endmode
  90.  
  91. # 1024 x 768 (60Hz)
  92. # High band
  93. startmode
  94. mode_name:1024 x 768
  95. x_res:1024
  96. y_res:768
  97. pixel_rate:65000
  98. h_timings:128,36,60,1024,60,36
  99. #    VESA:136,160,0,1024,0,24
  100. v_timings:6,29,0,768,0,3
  101. sync_pol:0
  102. endmode
  103.  
  104. Each screen mode that you wish to use should be defined as above within the
  105. monitor definition file. The application !MakeModes can be used to generate
  106. monitor definition files from data supplied by the user. It is available
  107. from your Acorn Dealer or local I.T. Centre. The application consists of a
  108. disc containing !MakeModes, a ReadMe file and an accompanying manual.
  109.  
  110. You are not advised to edit monitor definition files directly.
  111.  
  112. parameters file_format, monitor_title and DPMS_state are set only once at
  113. the beginning of an MDF. The command startmode tells the machine that a mode
  114. definition follows. Below is a summary of all of the commands used in an
  115. MDF.
  116.  
  117. file_format:    format
  118. monitor_title:  title
  119. DPMS_state:     state
  120.  
  121. startmode
  122.  mode_name:     mode_name
  123.  x_res:         x-resolution
  124.  y_res:         y-resolution
  125.  pixel_rate:    pixel_rate
  126.  h_timings:     hsync, hbpch, hlbdr,hdisp,hrbdr,hfpch
  127.  v_timings:     vsync, vbpch, vtbdr, vdisp. vbbdr, vfpch
  128.  sync_pol:      sync_polarities 
  129. endmode
  130.  
  131. where:
  132.  
  133. mode_name:      is a textual name for the mode that will be used in the
  134.                 display manager's mode menu. It is possible to prevent
  135.                 defined screen modes from appearing in the modes menu by
  136.                 simply leaving this field blank. Mode names are limited to
  137.                 19 characters in length and may contain space characters.
  138.  
  139. x-resolution:   is the number of pixels displayed across the screen
  140. y-resolution:   is the number of rasters displayed vertically (pixels)
  141.  
  142. hsync:          is the width of the horizontal sync pulse
  143. hbpch:          is the width of the horizontal back porch
  144. hlbdr:          is the width of the left border
  145. hdisp:          is the number of pixels displayed horizontally (which is
  146.                 normally the same as the x-resolution) 
  147. hrbdr:          is the width of the right border 
  148. hfpch:          is the width of the horizontal front porch
  149.  
  150. vsync:          is the width of the vertical sync pulse
  151. vbpch:          is the width of the vertical back porch
  152. vtbdr:          is the width of the top border
  153. vdisp:          is the number of rasters displayed vertically (pixels)
  154. vbbdr:          is the width of the bottom border
  155. vfpch:          is the width of the vertical front porch
  156.  
  157. pixel_rate:     is the pixel rate in kHz
  158. sync_polarities:is a number indicating what kind of sync signals are 
  159.                 required. The kinds of sync signal are as follows:
  160.  
  161.         0       hsync normal, vsync normal
  162.         1       hsync inverted, vsync normal
  163.         2       hsync normal, vsync inverted
  164.         3       hsync inverted, vsync inverted
  165.  
  166. All values on the h_timings line are in units of pixels, and all values on
  167. the v_timings line are in units of raster lines.
  168.  
  169. Note: VIDC20 imposes restrictions on these parameters. In particular, all
  170. the horizontal timing values must be in multiples of 2, and the horizontal
  171. total (hsync + hbpch + hlbdr + hdisp + hrbdr + hfpch) must be a multiple of
  172. 4.
  173.  
  174. The diagram below gives a graphical representation of this information.
  175.  
  176. <Insert Drawfiles.Fig1>
  177.  
  178. Glossary of terms
  179. -----------------
  180. Before describing in detail how these parameters can be used to define a new
  181. screen mode, it is necessary to understand some of the conventions that will
  182. be used in this application note. 
  183.  
  184. Video Bandwidth:
  185.  Video Bandwidth is the term used to describe the amount of video
  186. information that a Risc PC can process over a specified time period.
  187. Typically, video bandwidth will be specified as megabytes per second e.g. a
  188. Risc PC fitted with 2MB VRAM has a maximum video bandwidth of 156MB/sec. 
  189.  
  190. Dot Pitch:
  191. The dot pitch is the physical spacing of the phosphor dots that a monitor
  192. uses to generate a screen display. The smaller the dot pitch, the clearer
  193. the picture. Some high resolution screen modes may appear blurred if the dot
  194. pitch is not small enough to cope with the size of the pixels being
  195. generated by the computer.
  196.  
  197. Line Rate (Horizontal frequency):
  198. A monitor's line rate defines the speed at which a monitor can scan one
  199. horizontal line. The line rate is normally specified as a range in kHz i.e.
  200. the AKF60 has a line rate range of 30-50kHz.
  201.  
  202. Frame Rate (Vertical frequency):
  203. The frame rate is the speed at which the monitor can refresh the screen. The
  204. frame rate is normally specified as a range in Hz i.e. the AKF60 has a frame
  205. rate range of 40-90Hz.
  206.  
  207. Pixel Depth:
  208. Pixel depth dictates the number of colours that can be displayed on the
  209. screen. Pixel depth is measured in bits per pixel (bpp). The following table
  210. describes how bits per pixel relates to the number of colours that will be
  211. displayed;
  212.  
  213. Bits per pixel  Number of colours
  214.  
  215. 1   bpp                 2
  216. 2   bpp                 4
  217. 4   bpp                16
  218. 8   bpp               256
  219. 16 bpp              32000
  220. 32 bpp           16 Million
  221.  
  222.  
  223.  
  224. Limiting Factors
  225. ----------------
  226. Before creating a new screen mode or a new monitor definition file using the
  227. !MakeModes application, you should be fully aware of the factors limiting
  228. the display of a screen mode and the interrelationship of the variable
  229. parameters.
  230.  
  231. The following describes these interrelationships and offers guidance on the
  232. limits for the screen mode definition. As values are changed, the MakeModes
  233. application automatically checks that the mode will be displayable, if it is
  234. not, MakeModes will inform you. However, much time will be saved when
  235. attempting to create new modes if you understand and work within the limits
  236. imposed rather than using a 'trial and error' method.
  237.  
  238. Listed below are the three main limiting factors which are discussed in this
  239. document.
  240.  
  241.                 • Monitor Limitations
  242.                 • Memory Limitations
  243.                 • Bandwidth Limitations
  244.  
  245. Monitor Limitations
  246. -------------------
  247. The screen mode must not exceed the monitor's line rate (horizontal
  248. frequency), frame rate (vertical frequency) or its maximum pixel rate. A
  249. monitors line and frame rate ranges can normally be found in its
  250. accompanying documentation. Please see the MakeModes manual for information
  251. on how to enter this information.
  252.  
  253. The Pixel rate is one of the principal variables that you will use in the
  254. MakeModes application.  It can be used to increase or decrease a modes frame
  255. rate. Because a modes Line rate is directly affected by its Frame rate,
  256. altering the Pixel rate will change this value as well.The Pixel rate is
  257. calculated from:
  258.  
  259. Pixel Rate = sum(h_timings) * sum(v_timings) * proposed frame rate
  260. or
  261.  
  262. <Insert Drawfiles.Fig2>
  263.  
  264.  
  265. Frame and line rates can be calulated from:
  266.  
  267.  
  268.  
  269. Frame Rate = pixel_rate / (sum(h_timings) * sum(v_timings))
  270. or
  271.  
  272. <Insert Drawfiles.Fig3>
  273.  
  274. Line Rate = sum(v_timings) * frame_rate
  275. or
  276.  
  277. <Insert Drawfiles.Fig4>
  278.  
  279. Memory / Bandwidth Limitations
  280. ------------------------------
  281. The Risc PC can have up to three different screen memory configurations, no
  282. VRAM (DRAM only), 1MB VRAM or 2MB VRAM.
  283.  
  284. With no VRAM fitted the Risc PC will be forced to use DRAM which has a
  285. slower access time than dedicated Video RAM. This greatly increases the
  286. amount of time spent by the processor updating the screen and therefore
  287. limits the amount of memory that can be used as screen RAM. This limitation
  288. in turn limits the maximum resolution and pixel depth that can be used. On a
  289. machine with 1MB VRAM, the maximum amount of screen memory that the system
  290. can process is 80MB/sec, with 2MB of VRAM, this figure doubles giving a
  291. maximum video bandwidth of 160MB/sec. Without VRAM the maximum video
  292. bandwidth is 40MB/sec. In order to provide a safety margin, the bandwidth
  293. limit file stored in the !Boot directory on the Risc PC hard disc sets the
  294. maximum bandwidths to 38MB/sec, 76MB/sec and 152MB/sec respectively.
  295.  
  296. Is is important to be aware of both the memory and bandwidth calculations as
  297. it is possible to define a mode that fits within the available video RAM but
  298. exceeds the machines maximum video bandwidth. The MakeModes application will
  299. warn you if a proposed screen mode will exceed either of these limitations.
  300.  
  301. The following table shows an example of the screen modes and colour
  302. combinations (pixel depths) that can be used with the three different VRAM
  303. options.
  304.  
  305. <Insert Drawfiles.Fig5>
  306.  
  307. Calculating required bandwidth for a screen mode
  308. ------------------------------------------------
  309. The bandwidth used by a screen mode increases according to the number of
  310. colours being used. The calculations necessary to find the bandwidth for
  311. each bpp mode are listed below;
  312.  
  313.                 Bits per pixel  Calculation used
  314.  
  315.                 1   bpp         Video Bandwidth = (pixel_rate / 1000000) / 8
  316.                 2   bpp         Video Bandwidth = (pixel_rate / 1000000) / 4
  317.                 4   bpp         Video Bandwidth = (pixel_rate / 1000000) / 2
  318.                 8   bpp         Video Bandwidth = (pixel_rate / 1000000)
  319.                 16 bpp          Video Bandwidth = (pixel_rate / 1000000) * 2
  320.                 32 bpp          Video Bandwidth = (pixel_rate / 1000000) * 4
  321.  
  322. These calculations will give a result in MB/sec.
  323.  
  324.  
  325. Calculating memory requirements for a screen mode
  326. -------------------------------------------------
  327. Besides bandwidth limitations, another factor that one must also consider
  328. when creating a new mode is the amount of screen memory that will be needed.
  329. To work out how much memory a screen mode will need you must first find out
  330. how many pixels will be displayed in total. Multiplying the x_resolution by
  331. the y_resolution will give this figure.
  332.  
  333. pixel_total = x_resolution * y_resolution
  334.  
  335. This total is then used in conjunction with the number of bits per pixel
  336. (bpp) to calculate the amount of memory required.
  337.  
  338.                 Bits per pixel  Calculation used
  339.  
  340.                 1   bpp         VRAM = pixel_total / 8
  341.                 2   bpp         VRAM = pixel_total  / 4
  342.                 4   bpp         VRAM = pixel_total  / 2
  343.                 8   bpp         VRAM = pixel_total
  344.                 16 bpp          VRAM = pixel_total * 2
  345.                 32 bpp          VRAM = pixel_total * 4
  346.  
  347. Examples
  348. --------
  349. The following table gives an example of how much memory is required for some
  350. standard screen modes at various pixel depths.
  351.  
  352. <Insert Drawfiles.Fig6>
  353.  
  354. As can be seen from the table above, not all screen modes can be displayed
  355. at every pixel depth e.g. only machines with 2MB VRAM would be able to
  356. display 800 x 600 at 16 Million colours. Machines fitted with only 1MB VRAM
  357. could only display those modes that require 1024K or less. 
  358.  
  359. What the horizontal and vertical timings mean
  360. ---------------------------------------------
  361. The horizontal sync width (hsync) value is the time, in units of pixels of
  362. the horizontal sync pulse. If the hsync pulse is not wide enough the monitor
  363. will be unable to sync correctly.
  364.  
  365. The horizontal back porch (hbpch) and and horizontal front porch (hfpch)
  366. values define the time, in units of pixels, from the end of the hsync pulse
  367. to the start of the horizontal left border (hlbdr) and the end of the
  368. horizontal right border and to the end of the horizontal scan line
  369. respectively. Amongst other things the hsync+hbpch time period is used by
  370. the VIDC20 to switch between cursor and video data. If the combined time
  371. period is not long enough, the screen display will be corrupted as the
  372. VIDC20 will be unable to fetch video data before the screen display starts.
  373.  
  374. The horizontal left border and horizontal right border values define the
  375. time period, in units of pixels, for the left and right screen borders. The
  376. horizontal left border and horizontal back porch values can be altered to
  377. position the picture correctly.
  378.  
  379. The horizontal display (hdisp) value is the horizontal screen resolution i.e
  380. the number of pixels displayed across the screen.
  381.  
  382. The vertical sync (vsync) value is the width, in units of raster, of the
  383. sync width pulse. If this pulse is not wide enough, the monitor will be
  384. unable to sync to the signal.
  385.  
  386. The vertical porches (vbpch, vfpch), vertical borders (vtbdr, vbbdr) are the
  387. vertical equivalents of the horizontal values but are all measured in units
  388. of raster.