name  : Modes
author: Dennis Ranke (exoticorn/icebid)
size  : 1012 bytes
needs : RiscPC
descr.: provides any mode that has a lower or euqal height than the highest
        mode in you MDF

=oOo-oOo=oOo-oOo=oOo-oOo=oOo-oOo=oOo-oOo=oOo-oOo=oOo-oOo=oOo-oOo=oOo-oOo=

This module has been written to remove the need to add all this strange
modes to your MDF that some programms use. (Or worse, having to construct
these modes all yourself because the authors mode doesn't work with your
monitor...)

It will also make any of the following modes available in the wimp mode
selector if they can be formed by the module. (ie. their height is smaller
or equal to the heighest mode in you MDF)

768  x 288
640  x 640
640  x 512
800  x 600
1024 x 768
1200 x 1024



How it works:

  When a mode is requested, the module will try first if it is a mode which
  is in your MDF. If that fails, it goes through all modes in the MDF which
  are higher or equal the requested mode, then doubling its width until it is
  also higher or equal the width of the requested mode. It will then calculate
  the area of this mode and eventually choose the one with the lowest, which
  resolution is subsequentely reduced by increasing the borders.
  I'll give an example:
  
    You have defined three modes in your MDF, 192x144, 320x256 and 384x288.
    Some programm needs the strange resolution of 380x200.
    Now 192x144 can't be used as 144 is smaller than 200.
    The width of 320x256 is doubled to 640x256 which is bigger than the
    requested mode, the area is 163840.
    384x288 is already bigger than the requested mode, its area is 110592.
    So 384x288 has the smallest area and is therefore used to form the
    requested mode by increasing the left and right border by 2 pixels
    and the upper and lower border by 44 pixels each.

Notes:

  o You'll need ExtBas to assemble the source. (Or you'll have to change the
    dcb's and dcd's a bit...)
  
  o There may appear a nasty sideeffect when using this module, which is
    caused by the way the OS selects the old style mode numbers. It will
    first try the original frequency and only afterwards go for any
    other one. So if you have for example no 50Hz modes except for 1024x768,
    then any MODE 13 will be displayed as a 320x256 window on a 1024x768
    screen. However, you may uncomment lines 500 and 510 in the source to
    ignore all frequency requests...
  
  o The modes the module will try to make available in the wimp mode selector
    are the ones which sit in the "restab2" in lines 2790-2840 of the
    source. (Just in case you want to edit this list...)

--
If you find any bugs or for any other reason, feel free to contact me at:

  dennis.ranke@arcormail.de