More work on docs for the new opcodes.
[retro/experimental.git] / ngaro / c-mat / tty_devices.c
blobfc5768605988bfa5b735c1eb07c8ffe3eab60970
1 /******************************************************
2 * Ngaro
4 *|F|
5 *|F| FILE: devices.c
6 *|F|
8 * Written by Charles Childers, released into the public
9 * domain
10 ******************************************************/
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <termios.h>
16 #include "functions.h"
17 #include "vm.h"
19 /* From vm.c */
20 extern VM_STATE vm;
22 struct termios new_termios, old_termios;
25 /******************************************************
26 *|F| void draw_character(int character)
27 ******************************************************/
28 void draw_character(int character)
30 putchar((char)character);
34 /******************************************************
35 *|F| void init_devices()
36 ******************************************************/
37 void init_devices()
39 tcgetattr(0, &old_termios);
40 new_termios = old_termios;
41 new_termios.c_iflag &= ~(BRKINT+ISTRIP+IXON+IXOFF);
42 new_termios.c_iflag |= (IGNBRK+IGNPAR);
43 new_termios.c_lflag &= ~(ICANON+ISIG+IEXTEN+ECHO);
44 new_termios.c_cc[VMIN] = 1;
45 new_termios.c_cc[VTIME] = 0;
46 tcsetattr(0, TCSANOW, &new_termios);
51 /******************************************************
52 *|F| void cleanup_devices()
53 ******************************************************/
54 void cleanup_devices()
56 tcsetattr(0, TCSANOW, &old_termios);