home *** CD-ROM | disk | FTP | other *** search
- Hints and Tips (Programmer's Guide)
- ==============
-
- Below is a compilation of hints and notes that, we think, may be of value.
-
- As we were developing and experimenting with this package we gradually built
- this library of general knowledge and tips. They are in random order, added
- to the manual as we encountered them.
-
- Some of the Hints and Tips have been updated for !UniMode2 and RISCOS 3.1
-
- If not specified otherwise PixelRate is expressed in kHz
-
- * When a MDF is loaded by UniMode the ID Text is automatically displayed.
- This can be a nuisance if you have a *ModeLoad in a !Boot or !Run file. To
- get around this use the following syntax (mind the spaces!):
-
- *ModeLoad <filename> <mode#> { > null: }
-
- This will redirect the output of the command towards the electronic
- hunting fields.
-
- * A Broadcast Standard Display Mode (BSDM) is specifically designed for
- Standard50Hz monitors (MonitorType 0) and has the following
- specifications:
-
- ¤ linefrequency : 15625 Hz
- ¤ rasterfrequency : 50 Hz
- ¤ line time : 64 µs
- ¤ HSYNC : 4.5 µs
- ¤ HorizontalBackPorch : 5.8 µs
- ¤ HorizontalFrontPorch: 1.3 µs
- ¤ VCR : 312 lines
- ¤ VSYNC (=VSWR) : 3 lines
- ¤ VerticalBackPorch : 15 lines
- ¤ VerticalFrontPorch : 10 lines
-
- Refer to the MDS 'DIY_BSDM' for an example of how to make your own BSDM.
-
- Other modes must obey the monitor's specs. Look for them in your manual.
-
- * Both porches, front and back, are with respect to the SYNC-pulse. Thus
- the frontporch is between the end of the border and the start of
- the SYNC-pulse of the next line (flyback). The backporch is between the
- end of the SYNC-pulse and the start of the border.
-
- * All registers and variables must be correctly programmed, to obtain a
- useable mode and all depend on each other.
-
- * Normally a character is 8 by 8 pixels. This means that if you want
- RISC OS to print readable characters, you should use multiples of 8
- pixels and lines when defining the width and height of the active
- display.
-
- * Use the ID to give a short description of the mode, and the date you
- made it.
-
- * Linefrequency = the number of times a horizontal line is written by the
- monitor per second.
-
- * Rasterfrequency = the number of times a complete screen is written per
- second. It should at least equal 50Hz, otherwise the screen will become
- flickery. There is a utility included: 'TimeRaster' to measure the
- rasterfrequency of the current mode. You can also calculate it with this
- formula:
-
- PixelRate * 1E3
- --------------- = Rasterfrequency
- HCR * VCR
-
-
-
- * A pixel is not necessarily part of the active display. To define the
- H-registers, the unit pixel is also used. In this case only the time a
- pixel takes is important. Only pixels part of the active display can be
- given another colour (apart from the one-coloured border).
-
- * The active display is that part of the entire screen that can be seen
- and changed by other programs. It is the part you usually work on.
-
- * For those of us who cannot afford a VidcEnhancer, there might be a
- software solution: when the original mode has a pixelrate of 8000, 12000
- or 16000 kHz you can 'turn on' your 'VidcEnhancer' by changing these
- values to resp. 12000, 16000 or 24000. 12000 kHz modes can be changed to
- 16000 kHz, and so use a higher scanrate, but the the Enhancer-on-off-ratio
- of 1.5 is not reached.
-
- * [VCR]...[HCR] gives you a rectangle. Within this rectangle the actual
- mode is programmed.
-
- * When you are designing a new mode you can save yourself a lot of work
- if you use the definition of an existing mode. Especially RISC OS modes
- are very suitable. Simply take the definition of a mode that looks like
- what you want and change the appropriate registers and/or variables.
-
- * The HSWR is the register which is the most difficult to define. The
- HSYNC must be long enough so that the DMA Address Generator in the MEMC
- can reset the screen pointer. This takes 2125ns. You can therefore
- calculate the minimum value that must be programmed into the HSWR with
- the following formula:
-
- 2125 * PixelRate
- HSWR = ---------------- (Round up to the next integer)
- 1E6
-
- During the HorizontalBackPorch the Video FIFO needs to load at least
- one word 4 pixel-times before the display starts. The length of the
- HorizontalBackPorch can be calculated with:
-
- 1437 * PR + 4000
- ---------------- = HorizontalBackPorch
- 1000 (Round up to the next integer)
-
- These values are needed to calculate the HBSR as follows:
-
- HBSR = HSWR + HorizontalBackPorch
-
- NOTE: IF your machine has a faster MEMC (i.e.> 8 MHz ) you might be able
- to program the HSWR with a lower value without any problems. The
- compiler will still give a warning and the MDF may not give a good
- result on other machines. The minimum value suggested by the
- compiler ensures that the MDF works on almost all machines. Keep
- also in mind that the HSWR must be long enough for the monitor to
- synchronize to it as well !!
-
- * If you want UniMode to 'intelligently' switch the VidcEnhancer on
- whenever you select the mode, make sure that the rasterfrequency of this
- mode is less than 50Hz (with the VidcEnhancer switched off).
- You can (sometimes!) do this by increasing the HCR and/or VCR. After
- that you may have to re-align the display by changing the other
- registers also. Remember, that this method is not guaranteed to work and
- you may not like the result. Alternatively, try adjusting the <high> and
- <low> threshold values with *Vidc Threshold (see the maual)
-
- * 8 MHz; 1 bpp modes (with VidcOff) are not supported by the VIDC-chip.
- Sometimes however you may be able to display them if you switch the
- VidcEnhancer On and Off again.
-
- * You can use ARMBE (the ARMBasicEditor) with your favourite mode if you
- load the ModeDescriptionFile at modenumber 32. Then setup the ARMBE to
- use mode 32. Make sure that you have enough ScreenMemory available and
- that the MDF has been loaded prior to entering the BasicEditor or the
- BasicEditor will re-configure the mode used to 0. This works because
- mode 32 is not used by RISC OS. The ARMBE can only use RISC OS modes. To
- ARMBE mode 32 is a RISC OS mode. This way you can fool ARMBE into using
- a soft-mode without ARMBE knowing about it.
-
- * When you save an MDS you drag the Textfile-icon to a directory-viewer.
- Alternatively, you can drag the icon to an icon bar icon. If the
- application (eg. !Edit) supports data-transfer via Wimp$Scrap the MDS
- will be automatically loaded into the application.
-
- * Usually Log2BPP and Log2BPC will contain the same value.
-
- * It is our experience that people will try to define a mode which
- takes their own monitor to it's very limits (Eg. The highest or lowest
- rasterfrequency possible; or a very wide display that only just fits).
- Although this is perfectly "legal" in your own case remember this:
- Not all monitors have the same specs. And the MDF you created may not
- work properly on other monitors.
-
- * Do you see flickering pixels in the upper-left corner of the display?
- Does the first display-line behave "strangely"?
- These are the telltale signs of a (too) short HorizontalBackPorch. As
- explained, the HorizontalBackPorch must be long enough to allow the
- Video FIFO to load one word four pixel-times BEFORE the display starts.
- If the HorizontalBackPorch is too short this word will not have been
- loaded into the Video FIFO resulting in the first few pixels not being
- displayed properly.
-
- * While experimenting you may discover that your monitor can display modes
- with a rasterfrequency higher than the specifications of your monitor
- given by the manufacturer. Your monitor's manufacturer had a good reason
- for those specifications, so stick to them. We can't tell what might
- happen...
-
- * What to do if the VidcEnhancer does not respond.
- 1. Check the *HardwareRevision set and adjust it to yours.
- 2. Check if there are any modules providing modes or controlling the
- enhancer are loaded (except UniversalMode). *RMKill them, perhaps you
- might like to Extract some modes from the modules first.
- 3. You may have a Watford VidcEnhancer. We don't know how to control it.
- If you DO know how to do this let us know and we'll send you an update.
- 4. You may have a VidcEnhancer that we have never heard of. Let us know.
-
- * On some monitors the colour white may appear to be somewhat yellowish.
- You may want to improve the visual appearance of white. There is a trick
- that is used in the paper-making industry to make paper appear more
- white, the same trick is also used by many people when they do their
- laundry. The trick is to add some blue to the whites. The visual
- appearance of white with a teint of blue is: "Whiter than white" as they
- say in washing-powder commercials. How do you implement this trick on
- your desktop? It's easy:
-
- 1. Click SELECT over the palette icon on the icon-bar.
- 2. Click SELECT over the colour white (colournumber 0)
- 3. Reduce the amount of red by one unit.
- 4. Reduce the amount of green by one unit.
- 5. Wait a few seconds for your eyes to adjust.
-
- You may want to save this palette to a convenient spot (the
- Library-directory perhaps?) on your boot-disk and include the filename
- into your !Boot file. Thus, these settings will be loaded whenever you
- start your computer. NOTE, however, that this does not work on 256
- colour modes because a different method of colour selection is used
- here.
-
- * It is possible to load an MDF on a RISC OS mode (= Overlay). However, you
- can not change the BaseMode or the variables in the WorkspaceList. This
- can be useful if you have to change your monitor's vertical and/or
- horizontal adjust when you change modes or if a mode is displayed
- unsteadily. You might want to increase the rasterfrequency to stabilise
- the display. Or you could adjust some of the VIDC registers to center the
- modes on the display, so that you never ever have to adjust your monitor
- again.
-
- * The Dutch ministry of "Sociale Zaken en Werkgelegenheid" has published some
- tips and general knowledge about the (ergonomic) use of Video Display
- Units (VDUs or monitors). We have enclosed some of these pointers below
- and enhanced them a bit:
- 1. There is no danger in the radiation emitted from a VDU. People who
- work with a VDU all day and sit at a distance of approximately 50 cm
- from it, receive annually a dose of radiation hundreds of times less
- than the amount of radiation they receive through natural causes.
- 2. Sound generated by a VDU usually has a frequency of about 15 kHz.
- This tone can sometimes be very annoying and should therefore not
- exceed 25 dB.
- 3. The display should not flicker. To achieve this a rasterfrequency of
- at least 50 Hz is required for displays that have a light text on a
- dark background. A rasterfrequency of at least 70 Hz is advised for
- displays that have a dark text on a light background. The latter, by
- the way, is the natural way our eyes and brains are used to reading
- text, so you might want to consider changing the settings of your
- text-editors to display black (7) text on a white (0) background.
- However, if the lighting of the workplace comes below 100...200 lux
- white text on a black background is advised.
- 4. Lighting of the workplace must be sufficient (Approximately 500 lux)
- 5. Shiny or light emitting objects should not be reflected in the
- display. Position the display at right angles with any window(s) or
- shield the window(s). Displays that use dark text on a light
- background generally suffer less from reflections.
-
- * If you discover any bugs or if you encounter difficulties which you
- cannot solve or if you have any questions, the authors would greatly
- appreciate hearing from you. It is our policy to give users all the
- support that we can give. Keep in mind that more (clearer) information
- supplied to us increases your chances of satisfaction. If you send us a
- disc containing the offending MDF, MDS or utility and a clear
- description (maybe even a log-file?) of the problem we will most
- certainly try to solve your problem. Since we only have a low budget;
- including some stamps (or cash to buy them) will guarantee you the
- return of your disc.
-
- We can be reached at:
-
- Jean-Piërre Hendrix
- Kanaalstraat 33
- 5104 AA Dongen
- The Netherlands
-
- or
-
- Maurice Hendrix
- Bergeijkstraat 17
- 5043 BD Tilburg
- The Netherlands
-
- If you have acces to e-mail you can also reach us on the InterNET at:
-
- MHE@gpa.fuji-ef.nl
-