summaryrefslogtreecommitdiff
path: root/f_reciev.c
blob: 4a6a6c87db91603731e35f718c7ba97811782101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "fossil.h"
#include <dos.h>
#include <conio.h>
#include <stdlib.h>

unsigned char F_Receive_Wait()
{
        union REGS      regs;
        unsigned char   key;
        double time_allowed;
        time_allowed = Set_Time(30);           /* sets the timer function */
        do {                    /* Watch carrier while waiting for next char */
                if (!local) {
                        if (F_Get_Status(CK_DCD) == FALSE)
                                return(FALSE);
               }
                if (Timer(time_allowed) == FALSE) /* if no one types it times */
                        return(FALSE);            /* out after 30 seconds   */
                if (Kb_Hit()) { /* Allows local keyboard over-ride */
                        key = (unsigned char) getche();
                        if (key == 0 || key == 0xe0)
                                key = (unsigned char) getche();
                        return(key);
               }}
                        while (!F_Peek());
                        if(!local) {
                        regs.h.ah = 0x02;
                        regs.h.al = 0x00;
                        regs.x.dx = port;
                        int86(FOSSIL_INT, &regs, &regs);
                        regs.h.ah = 0x00;
                        return(unsigned char)regs.h.al; }
                        return(FALSE);
               }