-#ifdef SERGEEV
#define _GNU_SOURCE
-#endif /* SERGEEV */
#include <stdio.h>
-#ifdef SERGEEV
#include <unistd.h>
-#endif /* SERGEEV */
#include <termios.h>
#include <curses.h>
#include <signal.h>
#include <ctype.h>
#include <stdarg.h>
-#ifdef SERGEEV
-#include <conio.h>
-#endif /* SERGEEV */
-#ifdef MSDOS
-#include <dos.h>
-#endif
#include <time.h>
-#ifdef SERGEEV
+#include "conio.h"
#include "sstlinux.h"
-#endif /* SERGEEV */
#include "sst.h"
#ifndef SERGEEV
}
void iostart(int usecurses) {
+#ifdef SERGEEV
+ textattr(7);
+ clrscr();
+ setwnd(FULLSCREEN_WINDOW);
+#else
(void) signal(SIGINT, fastexit);
(void) signal(SIGINT, fastexit);
#ifdef SIGIOT
if (LINES)
screenheight = atoi(LINES);
}
+#endif /* SERGEEV */
}
void ioend(void) {
+#ifndef SERGEEV
outro(0);
+#endif /* SERGEEV */
}
void waitfor(void) {
#endif /* SERGEEV */
}
+void cgetline(char *line, int max) {
+ if (curses) {
+#ifndef SERGEEV
+ wgetnstr(stdscr, line, max);
+ wrefresh(stdscr);
+#else /* SERGEEV */
+ line[0]=max-1;
+ cgets(line);
+ memmove(line,&line[2],max-3);
+#endif /* SERGEEV */
+ } else {
+ fgets(line, max, stdin);
+ line[strlen(line)-1] = '\0';
+ }
+}
+
+void setwnd(short wndnum){
+/* change windows -- OK for this to be a no-op in tty mode */
+#ifdef SERGEEV
+ int cury;
+ cury=wherey()+wnds[curwnd].wndtop-wnds[wndnum].wndtop;
+ if ((curwnd==FULLSCREEN_WINDOW)&&(wndnum!=FULLSCREEN_WINDOW)) clrscr();
+ window(wnds[wndnum].wndleft, wnds[wndnum].wndtop, wnds[wndnum].wndright, wnds[wndnum].wndbottom);
+ if ((curwnd==wndnum)&&(cury>wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1)){
+ gotoxy(wnds[wndnum].wndright-wnds[wndnum].wndleft+1,wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1);
+ skip(1);
+ }
+ curwnd=wndnum;
+ gotoxy(1,cury);
+#endif /* SERGEEV */
+}
+
+void commandhook(char *cmd, int before) {
+}
+
+/*
+ * Things past this point have policy implications.
+ */
+
+void drawmaps(short l) {
+/* hook to be called after moving to redraw maps */
+#ifdef SERGEEV
+ _setcursortype(_NOCURSOR);
+ if (l==1) sensor();
+ if (l!=2) setwnd(LEFTUPPER_WINDOW);
+ gotoxy(1,1);
+ strcpy(line,"s");
+ srscan(1);
+ if (l!=2){
+ setwnd(SRSCAN_WINDOW);
+ clrscr();
+ srscan(2);
+ setwnd(LRSCAN_WINDOW);
+ clrscr();
+ strcpy(line,"l");
+ lrscan();
+ _setcursortype(_NORMALCURSOR);
+ }
+#endif /* SERGEEV */
+}
+
void warble(void)
/* sound and visual effects for teleportation */
{
#endif /* SERGEEV */
}
-void getline(char *line, int max) {
- if (curses) {
-#ifndef SERGEEV
- wgetnstr(stdscr, line, max);
- wrefresh(stdscr);
-#else /* SERGEEV */
- line[0]=max-1;
- cgets(line);
- memmove(line,&line[2],max-3);
-#endif /* SERGEEV */
- } else {
- fgets(line, max, stdin);
- line[strlen(line)-1] = '\0';
- }
-}
-
-void setwnd(short wndnum){
-/* change windows -- OK for this to be a no-op in tty mode */
-#ifdef SERGEEV
- int cury;
- cury=wherey()+wnds[curwnd].wndtop-wnds[wndnum].wndtop;
- if ((curwnd==FULLSCREEN_WINDOW)&&(wndnum!=FULLSCREEN_WINDOW)) clrscr();
- window(wnds[wndnum].wndleft, wnds[wndnum].wndtop, wnds[wndnum].wndright, wnds[wndnum].wndbottom);
- if ((curwnd==wndnum)&&(cury>wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1)){
- gotoxy(wnds[wndnum].wndright-wnds[wndnum].wndleft+1,wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1);
- skip(1);
- }
- curwnd=wndnum;
- gotoxy(1,cury);
-#endif /* SERGEEV */
-}
-
-void commandhook(char *cmd, int before) {
-}