GEM pages
Home -> GEM -> GEM driver patch area

GEM driver patch area

Many GEM drivers have a "settings" area, normally written to by GEMSETUP, which contains mouse settings. If you find that GEM does not recognise your mouse, then it may be possible to change the setting stored within the driver.

This works on ViewMAX drivers as well, although ViewMAX sets the values at run time, with the /M option (ViewMAX/1) or from VIEWMAX.INI (ViewMAX/2).

The patch area is usually fairly near the beginning of the .EXE file; on many drivers, it is 0x02EA bytes from the start of the driver file and 0x00EA bytes after the EXE header. It is not a requirement that the patch area be in this place, but it's a good place to start looking.

    DB  'zyxg'  ;Magic number. This indicates the start of the patch
		;area. In GEM 2.2, the preceding two bytes are the 
		;version number of the mouse driver, but this convention
                ;was not followed in GEM/3 which makes it a bit pointless.
    DB  port    ;0 for COM1, 1 for COM2. 
    DB  mouse   ;Mouse type. 
                ;   0 => none
                ;   1 => Mouse Systems (GEM's driver)
                ;   2 => Use
                ;   3 => Microsoft (GEM's driver)
                ; 4-9 => Various SummaSketch tablets (not in ViewMAX)
                ;  10 => PS/2 (GEM's driver)
    DS  13      ;Short driver description, ASCIIZ string (GEM/3 and ViewMAX)
    DB  ldesc   ;Long driver description, ASCIIZ string (GEM/3 and ViewMAX)
The "description" strings are printed by setup programs when they ask the user to choose the correct driver.

The ViewMAX drivers that support more than one mode have a second patch area, indicated by the ASCII string "temp":

    DB  'temp'
    DB  reserved	; Do not change
    DB  mode		; Video mode

The mode byte is set by a VidPatch= line in Viewmax.ini. If the mode byte is 80h-0FFh, it means 'autodetect'. Otherwise its meaning depends on the driver. UDUNI9 uses:

0: EGA mono   (UDUNI9)
1: EGA colour (UDUNI9)
2: VGA mono   (UDUNI9)
3: VGA colour (UDUNI9)

whereas UDCAT9 uses an actual BIOS mode number.

John Elliott 28-12-2006