home *** CD-ROM | disk | FTP | other *** search
- # Termcap for Acorn vdu drivers.
- #
- # Radically altered from the standard UnixLib one by Alun Jones.
- # Questions to auj@aber.ac.uk
- #
- # I'll try to explain what the codes do and how to add new modes,
- # since I've had a few enquiries on this front.
- #
- # A termcap file contains entries for a number of terminal types.
- # The entries encode the special character sequences required to achieve
- # certain effects on a given terminal. One useful feature is the ability to
- # inherit features from one terminal to another.
- #
- # I have therefore defined a terminal type called acorn_generic, which
- # contains default values which should work in all VDU modes. All other
- # Acorn terminal types inherit undefined termcap entries from this one.
- #
- # I'm told that \200 is used to represent NUL characters in termcap
- # entries.
- #
-
- # The generic acorn terminal driver. It stores a default screen size of
- # 80x32 but this is unlikely to be used because UnixLib can read the screen
- # size directly.
- # The definition has keycodes stored too. Keycodes are a real pain under
- # RISC OS because what you receive depends on how you receive it - e.g.
- # under a taskwindow many keycodes can be different to what are expected.
- # The definition stored here is correct for the keyboard when it has been
- # setup with the following (or equivalent)
- # *fx 4 2 0
- # *fx 225 192 0
- # *fx 226 228 0
- # These definitions are the same as those expected by old versions of
- # LineEditor and are the definitions used by vim, more and readline, as
- # ported by me.
- GG|acorn_generic|Acorn Generic VDU driver:\
- :li#32:\
- :co#80:\
- :am:\
- :bs:\
- :bw:\
- :bl=^G:\
- :ce=^W^H^E^F\200\200\200\200\200\200:\
- :cl=^L:\
- :is=^C^F^O^D:\
- :cm=^_%r%.%.:\
- :ho=^^:\
- :le=\010:\
- :cr=\015:\
- :me=^W^Q^E\200\200\200\200\200\200\200:\
- :mr=^W^Q^E\200\200\200\200\200\200\200:\
- :sb=^W^G^A^B\200\200\200\200\200\200:\
- :se=^W^Q^E\200\200\200\200\200\200\200:\
- :sf=^W^G^A^C\200\200\200\200\200\200:\
- :so=^W^Q^E\200\200\200\200\200\200\200:\
- :sr=^W^G^A^B\200\200\200\200\200\200:\
- :up=^K:\
- :vb=^R^C^G^Y^D\200\200\200\200^Ye\200^E\200^D^Ye\200\200\200\200:\
- :vi=^W^A\200\200\200\200\200\200\200\200:\
- :ve=^W^A^A\200\200\200\200\200\200\200:\
- :ku=\317:\
- :kd=\316:\
- :kl=\314:\
- :kr=\315:\
- :kP=\337:\
- :kN=\336:\
- :kh=\036:\
- :kH=\313:\
- :su=\337:\
- :sd=\336:\
- :#4=\334:\
- :%i=\335:\
- :k1=\301:\
- :k2=\302:\
- :k3=\303:\
- :k4=\304:\
- :k5=\305:\
- :k6=\306:\
- :k7=\307:\
- :k8=\310:\
- :k9=\311:\
- :F1=\321:\
- :F2=\322:\
- :F3=\323:\
- :F4=\324:\
- :F5=\325:\
- :F6=\326:\
- :F7=\327:\
- :F8=\330:\
- :F9=\331:\
- :
-
- # Right, having got that out of the way, let's have some example terminal
- # definitions.
- # The first line is a description of the terminal type. It has three parts
- # separated by |'s. The first part is always 2 characters long and is not
- # used for anything under RISC OS (so far as I know this field is only kept
- # for backward compatibility with older Unices). The second part is the
- # terminal name. This is the bit which is named in your TERM environment
- # variable. The third part is a verbose description.
- #
- # cl= tells programs how to clear the screen. Since the terminal type is
- # for mode 0, this must contain the octal for codes 22 and 0. Personally
- # I like green screens, so I've followed this up with 19,1,2,0,0,0
- # (remember that 0 is coded as \200).
- # is= tells programs how to initialise the terminal. In this case I tell it
- # 3,6,22,0,19,1,2,0,0,0. The 3,6 ensures that it's not spooling to
- # printer and vdu output is not disabled.
- # tc= tells termcap itself to include all the remaining characteristics from
- # the acorn_generic terminal type.
- # :cl=\026\200\023\001\002\200\200\200:\
-
- a0|acorn0|Acorn VDU Driver Mode 0:\
- :cl=^V\200^S^A^B\200\200\200:\
- :is=\003\006\026\200\023\001\002\200\200\200:\
- :tc=acorn_generic
-
- # A definition for running in mode 16. This time we have to give a screen
- # size since it isn't the default size, a cl which sets mode 16 with green
- # text, and a vb (visual bell) which flashes a bigger rectangle on the
- # screen. In this example I've used the control-code notation. This is
- # equivalent to the octal notation but can be more comprehensible for an
- # old BBC hacker like me ;-) (so 19,7,2,0,0,0 is ^S^G^B\200\200\200).
- aG|acorn16|Acorn VDU Driver Mode 16:\
- :li#32:co#132:\
- :cl=^V^P^S^G^B\200\200\200:\
- :is=^C^F^V\200^S^G^B\200\200\200:\
- :vb=^R^C^G^Y^D\200\200\200\200^Ye\200^I\200^D^Ye\200\200\200\200:\
- :is=^C^F^V^P^S^A^B\200\200\200:\
- :tc=acorn_generic
-
- # What if I want different colours in mode 16 sometimes?
- # Well, redefine the cl and is strings to contain the appropriate
- # VDU 19 sequences, then inherit from acorn16.
- sk|sick16|Acorn VDU driver Mode 16, revolting colours:\
- :cl=^V\200^S^A^D\200\200\200^S\200^C\200\200\200:\
- :is=^C^F^V\200^S^A^D\200\200\200^S\200^C\200\200\200:\
- :tc=acorn16
-
- # So, to add, for example, a multisync mode, you need to create
- # a termcap entry, specify its shape, how to start up in that mode
- # (both for "cl" and "is" entries), then inherit the generic entry.
- # Here's my guess for mode 21 (Can't test it though :-()
- # We can't munge the palette in mode 21, so just stay black and white.
- # I suppose you could mess with VDU 17,n to change the foreground colour
- # instead.
- am|acorn21|Acorn VDU Driver Mode 21:\
- :li#64:co#80:cl=^V^U:is=^C^F^V^U:tc=acorn_generic
-
- # Finally this is one for when you are porting stuff and want to know
- # just what a program is outputting. It just prints the termcap codes
- # rather than expanding them to real vdu operations.
- db|debug|For debugging termcap output:\
- :al=[al]^J^M:AL=[AL(%d)]^J^M:ac=[ac]^J^M:ae=[ae]^J^M:as=[as]^J^M:\
- :bl=[bl]^J^M:cd=[cd]^J^M:ce=[ce]^J^M:cl=[cl]^J^M:cm=[cm(%d,%d)]^J^M:\
- :cr=[cr]^J^M:cs=[cs(%d,%d)]^J^M:ct=[ct]^J^M:DC=[DC(%d)]^J^M:\
- :dl=[dl]^J^M:DL=[DL(%d)]^J^M:do=[do]^J^M:DO=[DO(%d)]^J^M:\
- :ds=[ds]^J^M:ei=[ei]^J^M:ho=[ho]^J^M:ic=[ic]^J^M:IC=[IC(%d)]^J^M:\
- :im=[im]^J^M:le=[le]^J^M:LE=[LE(%d)]^J^M:mb=[mb]^J^M:md=[md]^J^M:\
- :me=[me]^J^M:mh=[mh]^J^M:mk=[mk]^J^M:mr=[mr]^J^M:nd=[nd]^J^M:\
- :pc=[pc]^J^M:RA=[RA]^J^M:rc=[rc]^J^M:RI=[RI(%d)]^J^M:SA=[SA]^J^M:\
- :sc=[sc]^J^M:se=[se]^J^M:sf=[sf]^J^M:so=[so]^J^M:sr=[sr]^J^M:\
- :SR=[SR(%d)]^J^M:ta=[ta]^J^M:ue=[ue]^J^M:up=[up]^J^M:UP=[UP(%d)]^J^M:\
- :us=[us]^J^M:vb=[vb]^J^M:ve=[ve]^J^M:vi=[vi]^J^M:vs=[vs]^J^M:\
- :wi=[wi(%d,%d,%d,%d)]^J^M:tc=acorn_generic
-