Short:        Allows to search in screenmodes
Author:       megacz@usa.com
Uploader:     megacz usa com
Type:         util/wb
Version:      0.1
Requires:     68020+/os2.04+
Architecture: m68k-amigaos

findsm-0.1
------------

---

'findsm' allows to find screenmode in the system, it is not just another
toy that has been written to annoy ppl, it is incredibly useful when
making "intelligent" startups.

---

NOTES:

Requires 68020(no FPU)+, OS 2.04, 4096+ bytes of memory

By default proggy returns last screenmode on the list.

Program returns 'FFFFFFFF' and $RC = 5 if screenmode wasnt found.

If you use 'bootcontrol' then 'DblNTSC' will be doubled, if you dont
like that use '0x0000FFFF-0xFFFFFFFF' as a [range] string.

---

HELP:

 *** template: findsm [modeid=res] [range] [dec/s] [names/s] [count/s]

             [modeid=res]  -  decimal or hexadecimal screenmode id,
                              or desired resolution(xXy, 640X480) -
                              when 0xFFFFFFFF or no arg is passed will 
                              return last screenmode on the list
                              (in case of resolution it is important
                               to specify both parameters and 'X' must
                               be upper case, you may also use [range])

                  [range]  -  decimal or hexadecimal range values, like
                              0x000AFFFF-0xFFFFFFFF - this will search 
                              in graphics board modes most probably
                              (it is important to specify both params)

                  [dec/s]  -  outputs value in decimal rather than hex.

                [names/s]  -  dumps names of all loaded drivers, you
                              may use [range] with this switch

                [count/s]  -  [names/s] companion, will output number
                              of entries instead of names

---

EXAMPLES:

   ; check for screenmode, standard
   FAILAT 21
   findsm >NIL: 0x00099004
   IF warn
     ECHO "error, screenmode not found!"
   ELSE
     ECHO "all okay!"
   ENDIF

   ; check for screenmode by comparing
   ; (the advantage over the first method is that you wont
   ;  see any error message, even if command does not exist,
   ;  so perhaps more 'startup-sequence' friendly)
   FAILAT 21
   IF "`findsm 0x00099004`" not eq "00099004"
     ECHO "error, screenmode not found!"
   ELSE
     ECHO "all okay!"
   ENDIF

   ; check if 'monitor-driver' actually works
   FAILAT 21
   SET lastmonstate `findsm names count`
   SET driverrun `monitor-driver`
   IF "`findsm names count`" eq "$lastmonstate"
     ECHO "error, driver doesnt work!"
   ELSE
     ECHO "driver initialised."
   ENDIF

   ; check for nearest 640x480 res. in nat. screenmodes only
   findsm 640X480 0x0-0xAFFFF

   ; check for overscanned 704x480 res. in nat. screenmodes only
   findsm 704X480 0x0-0xAFFFF

   ; check for nearest 640x480 res. in graphics board(s) modes
   findsm 640X480 0xAFFFF-0xFFFFFFFF

---
megacz@usa.com
