File: amitty.c

package info (click to toggle)
glhack 1.2-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,744 kB
  • sloc: ansic: 208,571; cpp: 13,139; yacc: 2,005; makefile: 1,152; lex: 377; sh: 121; awk: 89; sed: 11
file content (67 lines) | stat: -rw-r--r-- 1,405 bytes parent folder | download | duplicates (23)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*    SCCS Id: @(#)amitty.c     3.2    2000/01/12
/*    Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996  */
/* NetHack may be freely redistributed.  See license for details. */

/* TTY-specific code for the Amiga
 * This is still experimental.
 * Still to do:
 * add real termcap handling - currently requires ANSI_DEFAULT
 */

#include "hack.h"
#include "tcap.h"
#include <stdio.h>
#include <proto/dos.h>

#ifdef _DCC
# define getch() getchar()
#endif
#ifdef __SASC_60
# include <clib/dos_protos.h>
#endif

void NDECL( tty_change_color );
char *NDECL( tty_get_color_string );

#ifdef TTY_GRAPHICS

int amibbs=0;			/* BBS mode */
char bbs_id[80]="";		/* BBS uid equivalent */
long afh_in, afh_out;		/* BBS mode Amiga filehandles */

void settty(const char *s){
	end_screen();
	if(s)raw_print(s);
	iflags.cbreak=ON;	/* this is too easy: probably wrong */
#if 1 /* should be version>=36 */
/*	if(IsInteractive(afh_in)){ */
		SetMode(afh_in,0);	/* con mode */
/*	} */
#endif
}
void gettty(){
#if 1 /* should be VERSION >=36 */
/*	if(IsInteractive(afh_in)){ */
		SetMode(afh_in,1);	/* raw mode */
/*	} */
#endif
}
void setftty(){
	iflags.cbreak=ON;	/* ditto */
}
char kill_char='X'-'@';
char erase_char='\b';
tgetch(){
	char x;
	Read(afh_in,&x,1);
	return (x=='\r')?'\n':x;
}
void get_scr_size(){
	CO=80;
	LI=24;
}

#endif

void tty_change_color() {}
char *tty_get_color_string() { return( "" ); }