game_termios.c_cc[VMIN] = 1;
game_termios.c_cc[VTIME] = 0;
- /* Turn off flow control */
- game_termios.c_iflag &= ~IXON;
-
#endif
#ifdef USE_TERMIO
game_termio.c_cc[VMIN] = 1;
game_termio.c_cc[VTIME] = 0;
- /* Turn off flow control */
- game_termio.c_iflag &= ~IXON;
-
#endif
#ifdef USE_TCHARS
game_tchars.t_quitc = (char)-1;
game_tchars.t_eofc = (char)-1;
game_tchars.t_brkc = (char)-1;
-
- /* XXX XXX XXX Should maybe turn off flow control too. How? */
-
+
#endif
}
/*
* Initialize sound
*/
-static bool init_sound()
+static bool init_sound(void)
{
/* Initialize once */
if (!can_use_sound)
sprintf(wav, "%s.wav", angband_sound_name[i]);
/* Access the sound */
- path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, wav);
+ path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, wav);
/* Save the sound filename, if it exists */
if (check_file(buf)) sound_file[i] = string_make(buf);
return (0);
}
+
+static void hook_quit(cptr str)
+{
+ /* Exit curses */
+ endwin();
+}
+
+
/*
* Prepare "curses" for use by the file "term.c"
*
#ifdef USE_SOUND
/* Build the "sound" path */
- path_build(path, 1024, ANGBAND_DIR_XTRA, "sound");
+ path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "sound");
/* Allocate the path */
ANGBAND_DIR_XTRA_SOUND = string_make(path);
if (initscr() == (WINDOW*)ERR) return (-1);
#endif
+ /* Activate hooks */
+ quit_aux = hook_quit;
+ core_aux = hook_quit;
+
/* Hack -- Require large screen, or Quit with message */
i = ((LINES < 24) || (COLS < 80));
if (i) quit("Angband needs an 80x24 'curses' screen");
cbreak();
noecho();
nonl();
+ raw();
/* Extract the game keymap */
keymap_game_prepare();