OSDN Git Service

Initial Import
[nethackexpress/trunk.git] / sys / amiga / amitty.c
1 /*    SCCS Id: @(#)amitty.c     3.2    2000/01/12
2 /*    Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996  */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 /* TTY-specific code for the Amiga
6  * This is still experimental.
7  * Still to do:
8  * add real termcap handling - currently requires ANSI_DEFAULT
9  */
10
11 #include "hack.h"
12 #include "tcap.h"
13 #include <stdio.h>
14 #include <proto/dos.h>
15
16 #ifdef _DCC
17 # define getch() getchar()
18 #endif
19 #ifdef __SASC_60
20 # include <clib/dos_protos.h>
21 #endif
22
23 void NDECL( tty_change_color );
24 char *NDECL( tty_get_color_string );
25
26 #ifdef TTY_GRAPHICS
27
28 int amibbs=0;                   /* BBS mode */
29 char bbs_id[80]="";             /* BBS uid equivalent */
30 long afh_in, afh_out;           /* BBS mode Amiga filehandles */
31
32 void settty(const char *s){
33         end_screen();
34         if(s)raw_print(s);
35         iflags.cbreak=ON;       /* this is too easy: probably wrong */
36 #if 1 /* should be version>=36 */
37 /*      if(IsInteractive(afh_in)){ */
38                 SetMode(afh_in,0);      /* con mode */
39 /*      } */
40 #endif
41 }
42 void gettty(){
43 #if 1 /* should be VERSION >=36 */
44 /*      if(IsInteractive(afh_in)){ */
45                 SetMode(afh_in,1);      /* raw mode */
46 /*      } */
47 #endif
48 }
49 void setftty(){
50         iflags.cbreak=ON;       /* ditto */
51 }
52 char kill_char='X'-'@';
53 char erase_char='\b';
54 tgetch(){
55         char x;
56         Read(afh_in,&x,1);
57         return (x=='\r')?'\n':x;
58 }
59 void get_scr_size(){
60         CO=80;
61         LI=24;
62 }
63
64 #endif
65
66 void tty_change_color() {}
67 char *tty_get_color_string() { return( "" ); }