source: buchla-68k/iolib/waitcr.c@ ca867c1

Last change on this file since ca867c1 was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Zero redundant declarations.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 =============================================================================
3 waitcr.c -- wait for a CR from the console and allow for debugging
4 Version 3 -- 1987-07-15 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10/*
11 =============================================================================
12 waitcr() -- wait for a CR or a CTL-G. CR returns control to the
13 caller, CTL-G invokes xtrap15(), which if it returns, returns to
14 the caller. The xtrap15() escape is to allow a convenient debug
15 point whenever we wait on the console. The character that caused
16 the return (CR or CTL-G) is returned as the value of the function.
17 =============================================================================
18*/
19
20int16_t waitcr(void)
21{
22 int16_t c;
23
24 BIOS(B_PUTC, CON_DEV, '\007'); /* wake up the operator */
25
26 /* await a CR, in which case we just exit */
27
28 while ('\r' NE (c = (0x007F & (int16_t)BIOS(B_GETC, CON_DEV))))
29 if (c EQ '\007') /* ... or a control-G */
30 xtrap15(); /* ... in which case we trap first */
31
32 return(c); /* return the character that caused us to exit */
33}
34
Note: See TracBrowser for help on using the repository browser.