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 extern long afh_in; 29 settty(const char * s)30void settty(const char *s){ 31 end_screen(); 32 if(s)raw_print(s); 33 iflags.cbreak=ON; /* this is too easy: probably wrong */ 34 #if 1 /* should be version>=36 */ 35 /* if(IsInteractive(afh_in)){ */ 36 SetMode(afh_in,0); /* con mode */ 37 /* } */ 38 #endif 39 } gettty()40void gettty(){ 41 #if 1 /* should be VERSION >=36 */ 42 /* if(IsInteractive(afh_in)){ */ 43 SetMode(afh_in,1); /* raw mode */ 44 /* } */ 45 #endif 46 } setftty()47void setftty(){ 48 iflags.cbreak=ON; /* ditto */ 49 } 50 char kill_char='X'-'@'; 51 char erase_char='\b'; tgetch()52tgetch(){ 53 char x; 54 Read(afh_in,&x,1); 55 return (x=='\r')?'\n':x; 56 } get_scr_size()57void get_scr_size(){ 58 CO=80; 59 LI=24; 60 } 61 62 #endif 63 tty_change_color()64void tty_change_color() {} tty_get_color_string()65char *tty_get_color_string() { return( "" ); } 66