home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------------------------------------------*/
- /* */
- /* */
- /* ------------ Bit-Bucket Software <no-Inc> */
- /* \ 10001101 / Writers and Distributors of */
- /* \ 011110 / No-Cost<no-tm> Software. */
- /* \ 1011 / */
- /* ------ */
- /* */
- /* Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello */
- /* */
- /* */
- /* This module was originally written by Bob Hartman */
- /* */
- /* */
- /* BinkleyTerm VFOSSIL module */
- /* */
- /* */
- /* For complete details of the licensing restrictions, please refer */
- /* to the License agreement, which is published in its entirety in */
- /* the MAKEFILE and BT.C, and also contained in the file LICENSE.210. */
- /* */
- /* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
- /* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
- /* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
- /* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT THE AUTHORS */
- /* AT THE ADDRESSES LISTED BELOW. IN NO EVENT SHOULD YOU PROCEED TO */
- /* USE THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE */
- /* BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU */
- /* ARE ABLE TO REACH WITH THE AUTHORS. */
- /* */
- /* */
- /* The Authors can be reached at the following addresses: */
- /* */
- /* Robert C. Hartman Vincent E. Perriello */
- /* Spark Software VEP Software */
- /* 427-3 Amherst Street 111 Carroll Street */
- /* CS2032, Suite 232 Naugatuck, CT 06770 */
- /* Nashua, NH 03061 */
- /* */
- /* FidoNet 1:132/101 FidoNet 1:141/491 */
- /* Data (603) 888-8179 Data (203) 729-7569 */
- /* */
- /* Please feel free to contact us at any time to share your comments */
- /* about our software and/or licensing policies. */
- /* */
- /*--------------------------------------------------------------------------*/
-
- #include <stdio.h>
- #include "vfossil.h"
-
- /*PLF Fri 05-05-1989 05:35:11 OS/2 version notes:
- *
- * I have basically made this two completely different versions. A lot
- * of the original real mode version deals with the case when vfossil
- * does not exist. Under OS/2, it is always active.
- *
- */
-
- #ifdef OS_2 /*PLF Fri 05-05-1989 05:38:20 */
-
- extern int vfossil_installed;
-
- void vfossil_init(void )
- {
- vfossil_installed = 1;
- VioSetAnsi(ANSI_ON, 0L);
- }
-
- void vfossil_cursor(int st)
- {
- VIOCURSORINFO cur;
-
- VioGetCurType(&cur, 0);
- cur.attr = st ? 0 : -1;
- VioSetCurType(&cur, 0);
- }
-
- void vfossil_close(void )
- {
- vfossil_cursor(1);
- vfossil_installed = 0;
- }
-
- void fossil_gotoxy(int col, int row)
- {
- VioSetCurPos(row, col, 0);
- }
-
- int fossil_wherex(void)
- {
- USHORT row, col;
- VioGetCurPos(&row, &col, 0L);
- return(col);
- }
-
- int fossil_wherey(void)
- {
- USHORT row, col;
- VioGetCurPos(&row, &col, 0L);
- return(row);
- }
-
- #else /*PLF Fri 05-05-1989 05:38:45 */
-
- #include <dos.h>
- #include "com.h"
- #include "xfer.h"
- #include "zmodem.h"
- #include "keybd.h"
- #include "sbuf.h"
- #include "sched.h"
- #include "externs.h"
- #include "prototyp.h"
-
- static void vfossil_open (void);
-
- static VFOSSIL v;
-
- void vfossil_init ()
- {
- char far *q;
- union REGS r;
- struct SREGS s;
-
- v.vfossil_size = sizeof (VFOSSIL);
- q = (char far *) &v;
-
- r.h.ah = 0x81;
- r.h.al = 0;
-
- segread (&s);
- s.es = FP_SEG (q);
- r.x.di = FP_OFF (q);
- int86x (0x14, &r, &r, &s);
-
- if (r.x.ax == 0x1954)
- {
- /* There is a VFOSSIL out there, so set it up for use */
- vfossil_open ();
- }
- }
-
- static CURSOR _cursor;
-
- void vfossil_cursor (st)
- int st;
- {
- CURSOR far *q;
-
- if (vfossil_funcs[9])
- {
- q = (CURSOR far *) &_cursor;
- /* We can make the cursor go away */
- VioGetCurType (q, 0);
- _cursor.attr = st ? 0 : -1; /*PLF Fri 05-05-1989 05:14:33 */
- VioSetCurType (q, 0);
- }
- }
-
- static void vfossil_open ()
- {
- char far *q;
- union REGS r;
- struct SREGS s;
-
- segread (&s);
- r.h.ah = 0x81;
- r.h.al = 1;
- r.x.cx = 80;
- q = (char far *) vfossil_funcs;
- r.x.di = FP_OFF (q);
- s.es = FP_SEG (q);
- int86x (0x14, &r, &r, &s);
- if ((r.x.ax == 0x1954) && (r.x.bx >= 14))
- {
- /* It is really out there */
- vfossil_installed = 1;
- }
- else
- {
- vfossil_funcs[14] = write_screen;
- vfossil_funcs[15] = write_chars;
- }
- }
-
- void vfossil_close ()
- {
- union REGS r;
-
- vfossil_cursor (1);
-
- r.h.ah = 0x81;
- r.h.al = 2;
-
- int86 (0x14, &r, &r);
-
- vfossil_installed = 0;
- }
-
- int far pascal write_screen (s, l, r, c, h)
- CELL far *s;
- int l;
- int r;
- int c;
- int h;
- {
- int i;
-
- /* The following line is just to make -W3 happy */
- i = h;
-
- gotoxy (c, r);
-
- l = l / 2;
- for (i = 0; i < l; i++)
- {
- WRITE_BIOS (s->b.ch);
- ++s;
- }
-
- return (0);
- }
-
- int far pascal write_chars (s, l, r, c, h)
- char far *s;
- int l;
- int r;
- int c;
- int h;
- {
- int i;
-
- /* The following line is just to make -W3 happy */
- i = h;
-
- gotoxy (c, r);
-
- for (i = 0; i < l; i++)
- {
- WRITE_BIOS (*s);
- ++s;
- }
-
- return (0);
- }
- #endif /*PLF Fri 05-05-1989 05:38:34 */