void reset_tty (void) /*{{{*/ { if (TTY_Initialized == 0) return; TTY_Initialized = 0; restore_int9_handler(); set_ctrl_break(1); if (Batch) return; #ifdef HAS_MOUSE if (X_Close_Mouse_Hook != NULL) (*X_Close_Mouse_Hook) (); #endif SLtt_reset_video(); }
int init_tty (void) /*{{{*/ { union REGS r; struct SREGS s; if (TTY_Initialized) return 0; bios_key_f = peekb(0x40,0x96) & 0x10; /* enhanced keyboard flag */ /* Check for system type */ delay_ptr = delay; r.x.ax = 0xC000; int86x (0x15, &r, &r, &s); if ((r.x.cflag == 0) && (r.h.al == 0)) { unsigned char *table; table = MK_FP(s.es, r.x.bx); switch (table[2]) { case 0xFF: /* pc */ case 0xFE: /* xt */ case 0xFB: /* xt */ case 0xFD: /* pc-jr */ break; /* AT and higher */ default: delay_ptr = my_delay; } } set_ctrl_break(0); ctrlbrk(ctrl_break); init_int9_handler(); TTY_Initialized = 1; if (Batch == 0) { if (X_Open_Mouse_Hook != NULL) (*X_Open_Mouse_Hook) (); } X_Set_Abort_Char_Hook = ibmpc_set_abort_char; return 0; }
/*----------------------------------------------------------------------*\ * Function: void SLang_reset_tty (void); * * reset the tty before exiting \*----------------------------------------------------------------------*/ void SLang_reset_tty (void) { SLw32_Hstdin = INVALID_HANDLE_VALUE; set_ctrl_break (1); }