;************************************************************************ ;* Copyright 1999, Caldera Thin Clients, Inc. * ;* This software is licenced under the GNU Public License. * ;* Please see LICENSE.TXT for further information. * ;* * ;* Historical Copyright * ;* * ;* * ;* * ;* Copyright (c) 1987, Digital Research, Inc. All Rights Reserved. * ;* The Software Code contained in this listing is proprietary to * ;* Digital Research, Inc., Monterey, California and is covered by U.S. * ;* and other copyright protection. Unauthorized copying, adaptation, * ;* distribution, use or display is prohibited and may be subject to * ;* civil and criminal penalties. Disclosure to others is prohibited. * ;* For the terms and conditions of software code use refer to the * ;* appropriate Digital Research License Agreement. * ;* * ;************************************************************************ ; W_0 equ word ptr 0 W_1 equ word ptr 2 W_2 equ word ptr 4 W_3 equ word ptr 6 W_4 equ word ptr 8 W_5 equ word ptr 10 W_6 equ word ptr 12 W_7 equ word ptr 14 W_8 equ word ptr 16 W_9 equ word ptr 18 W_10 equ word ptr 20 W_11 equ word ptr 22 ; include externs.a86 ; cseg extrn SCREEN:near ; public entry entry: push si pushf ;save state on old stack pop si pushf ; dx = old flag state cli or ax,ax ;if ax contains 0, it is OW call, jnz not_OW ;else ax contains data segment mov ax,seg data_seg Not_OW: mov cx,sp mov bx,ss mov ss,ax mov sp, offset stack_top ;set up local stack push cx ; save sp push bx ; save ss push si popf ; get orriginal flag state mov es,ax ;ax is our dseg mov di,offset contrl_ptr ;point to array pointer storage mov si,dx mov cx,10 rep movsw ;store 5 long array pointers mov ds,ax ;set ds to data seg mov di,offset CONTRL ;point es:di to our control array push ds lds si,contrl_ptr ;point ds:si to app control array mov cx,CONTRL_SIZE rep movsw ;copy control array in to our dseg pop ds mov si,offset CONTRL mov W_2[si],0 ;init intout count and ptsout count mov W_4[si],0 mov cx,W_1[si] ;length of ptsin shl cx,1 ;two words per point cmp cx,PTSIN_SIZE jb ptsok mov cx,PTSIN_SIZE mov W_1[si], cx shr W_1[si], 1 ptsok: mov di,offset PTSIN push ds lds si,ptsin_ptr rep movsw ;copy ptsin array to our dseg pop ds mov si,offset CONTRL mov cx,W_3[si] ;length of intin cmp cx,2 ja chk_intin_max mov cx,2 jmps intok chk_intin_max: cmp cx,INTIN_SIZE jb intok mov cx,INTIN_SIZE mov W_3[si], cx intok: mov di,offset INTIN push ds lds si,intin_ptr rep movsw ;mov intin array to our dseg pop ds mov si, offset ptsout ; jn, justified text fix mov points_out, si ; jn, justified text fix mov FLIP_Y,0 ;set the flip y flag ; call SCREEN ;go to 'C' part of driver ; mov si,offset CONTRL les di,contrl_ptr mov bx,W_8[si] mov es:W_8[di],bx ;contrl[8] mov bx,W_7[si] mov es:W_7[di],bx ;contrl[7] mov bx,W_4[si] mov es:W_4[di],bx ;contrl[4] = intout size mov cx,W_2[si] mov es:W_2[di],cx ;contrl[2] = ptsout size and cx,cx jz ret_intout shl cx,1 ;two words per point les di,ptsout_ptr ; mov si,offset PTSOUT ; jn, justified text fix mov si, points_out ; jn, justified text fix rep movsw ret_intout: and bx,bx jz ret_done mov cx,bx les di,intout_ptr mov si,offset INTOUT rep movsw ret_done: mov ax,FLIP_Y ; return the flip flag 0 ok 1 = no cli pop cx ;get the old ss pop bx ;get the old sp mov ss,cx mov sp,bx popf pop si ;get orriginal si back retf ; ;************************************************************************ ;* data area * ;************************************************************************ ; DATA dseg PUBLIC word DGROUP GROUP DATA public CONTRL,INTIN,PTSIN,INTOUT,PTSOUT public FLIP_Y public XFM_MODE public contrl_ptr public points_out ; jn, justified text fix ; data_seg rw 0 ; points_out rw 1 ; jn, justified text fix contrl_ptr rd 1 intin_ptr rd 1 ptsin_ptr rd 1 intout_ptr rd 1 ptsout_ptr rd 1 ; CONTRL rw CONTRL_SIZE ; INTIN rw INTIN_SIZE ; PTSOUT rw PTSOUT_SIZE ; PTSIN rw PTSIN_SIZE ; INTOUT rw INTOUT_SIZE ; stack rw 128 stack_top rw 0 ;push decrements before store FLIP_Y dw 0 XFM_MODE dw 0 end entry