home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
utilitys
/
swdemo15.arc
/
SWCPMUPD.ME
< prev
next >
Wrap
Text File
|
1991-08-11
|
6KB
|
153 lines
New TCAP support for CPM:
SWIND will now offer support for the new Z3 style TCAP functions
of Graphics ON/OFF and business graphics. This is implemented in the
main windowing library by providing the dependence routines of WCOUT
and WGOXYC a special code for the attribute byte with bit 4 set.
If this bit is set, the character for display is selected using the
low 4 bits of the character data as an index into the TCAP data
starting at the Upper Left Corner code. Also the internal window
bordering routines will make automatic use of the ULC/URC/LLC/LRC/Hor/Ver
codes for bordering.
This provides a method of selection of any of 16 possible graphics
characters for display in 'graphics' mode, but since the proposed TCAP
defines only thirteen codes, all output greater than or equal to 0Dh will
be displayed as non-graphics. See next paragraph.
If the character code presented is greater than 0Ch, then graphics
mode is automatically disabled and the character is presented in
alpha-numerics, with an auto conversion back to graphics when the
next code in the 0-0Ch range in received ( assuming that bit 4 of the
attributes is still set thru all entries).
In addition, if any of the low 4 bits of the attribute byte are set,
the StandOut codes will also be activated for the character, else the
Standout End codes will be used. As with all other attribute changes,
the dependence routines are 'smart' in that they know if attributes/grpahics
have changed since last entry and will only 'send' to the display if they
have changed.
SWIND now also supports the new TCAP proposal functions of Cursor ON/OFF.
This is implemented in the library itself, and routines that will cause
non-interactive window operations will now turn the cursor off, then back
on at the end of the operation. Actual ON/OFF is performed by a routine
in the dependence routine. This is only used if there are non-zero
TCAP codes for these functions.
How do I use it?:
SWIND provides three methods of displaying information.
The lowest level is via the dependence routines of WCOUT and WGOXYC.
These routines provide a method of 'writing on the glass' without window
data base storage, IE: it is non-permanent and not maintained for any
window in particular. To use these routines for graphics, the following
calls and parameters will do:
ld hl,1000h High byte is the attributes/low the character
Select graphics mode, index character
0 of the TCAP graphics characters, and
display in non-standout video
push hl On the stack for C routine
ld hl,4 C routine required # bytes on stack +2
call wcout
or
ld hl,1 Set X cursor position at 1
push hl
ld hl,10 Set Y cursor position at 10
push hl
ld hl,1111h Select graphics mode, index character
17 of the TCAP graphics characters, and
display in StandOut video
push hl
ld hl,8 C routine required
call wgoxyc
The next lowest level is thru the window data base raw mode output using
the routine WPUTCH. Here characters and attributes are maintained in the
data base under control of the windowing library, but are not 'cooked',
Ie: no interpretations of the data is provided and it is stored as given
at the current pen position under the rules of the current window flags.
The attribute to use for the character is that as was last set using the
call to WSCATT. As an example the following code will enable graphics
mode, display TCAP graphics codes 0 thru 4, display alpha numerics 'EF',
then convert back to graphics automatically.
ld hl,11h Select graphics mode with Stand Out video
push hl
ld hl,4
call wscatt
jr t2
t1: db 0,1,2,3,4,45h,46h,8,9 Characters to display are TCAP graphics
characters 0 thru 9
t2: ld b,$-t1 Get count of characters to display
ld hl,t1 Point to Array of characters to display
t3: push bc
push hl
ld e,(hl) Get current character
ld d,0
push de On the stack for the C routine
ld hl,4 C language call overhead
call wputch Do it
DE was 'popped' by the C interface routine
pop hl
pop bc
inc hl
djnz t3
The third method is thru the virtual terminal('cooked') mode output
routine WDOCHR. This method is not recommended because of the cooking
process, Ie: character codes 8 (BS), 9 (TAB), 0A (LF), 0D (CR) are
interpreted and all others in the range of the graphics characters are
passed as is to the dependence output routines with NO storage in the
window data base. However, it is possible to use the 'escape' code
for attribute setting for manipulation of the character attributes.
As an example:
t4: db 1bh,'F',11h Virtual terminal codes for
set attributes
t5: db 9,8,7,6,5,4,3,2,1,0 Will display these characters
ld hl,t4 Point to the Virtual codes
ld bc,3 Three of them
t6: push hl
push bc
ld e,(hl)
ld d,0
push de Put it on stack for C routine
ld hl,4 C routine overhead
call wdochr Give this code to virtual terminal
pop bc
pop hl
inc hl
djnz t6
ld hl,t5 Point to array of characters to display
ld b,10 Ten of them
call t3 Use routine from the last example
to display them
In Summary:
The method outlined above should provide complete TCAP dependence. It
is the responsibilities of the dependence routine to provide actual TCAP
usage ( which is supplied ).
For those developers that do not want the TCAP dependence, the routines
for WOPEN/WSBATT have been modified to allow specifying the codes to
use for displaying the horizontal and vertical members of the borders, and
a single character to use as the 'corners' of the windows. There are
seperate libraries provided in the distribution package for both full TCAP
business graphics support and no business graphics support.
See the new SWFTNS1.ME file for a description of these changes.