From 99cf9c4dc5855b1f5f26d00267fdbbe672ee27a7 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Mon, 5 Oct 2015 08:38:46 -0400 Subject: Initial commit --- f_reciev.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 f_reciev.c (limited to 'f_reciev.c') diff --git a/f_reciev.c b/f_reciev.c new file mode 100644 index 0000000..4a6a6c8 --- /dev/null +++ b/f_reciev.c @@ -0,0 +1,34 @@ +#include "fossil.h" +#include +#include +#include + +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, ®s, ®s); + regs.h.ah = 0x00; + return(unsigned char)regs.h.al; } + return(FALSE); + } -- cgit v1.2.3