Beispiel #1
0
console_t *console_open(const char *id)
{
    console_t *console;

    enable_text();
    clrscr();
    _set_screen_lines(43);
    _setcursortype(_SOLIDCURSOR);

    old_input_mode = setmode(STDIN_FILENO, O_TEXT);
    old_output_mode = setmode(STDOUT_FILENO, O_TEXT);

    mon_output = fopen("CON", "wt");
    mon_input = fopen("CON", "rt");
    setbuf(mon_output, NULL); /* No buffering.  */

    console = lib_malloc(sizeof(console_t));

    console->console_xres = 80;
    console->console_yres = 25;
    console->console_can_stay_open = 0;
    console->console_cannot_output = 0;

    return console;
}
Beispiel #2
0
void term_reinit(int wait)             /* fixup after running other progs */
{
   struct text_info dat;

   gppconio_init();
   gettextinfo(&dat);

   if (dat.screenheight != screen_h) {
      _set_screen_lines(screen_h);
      gettextinfo(&dat);
      screen_h = dat.screenheight;
      screen_w = dat.screenwidth;
      mouse_init();
   }

   set_bright_backgrounds();

   if (wait) {
      clear_keybuf();
      gch();
   }

   __djgpp_set_ctrl_c(0);
   setcbrk(0);
}
Beispiel #3
0
void term_init(int screenheight)
{
   struct text_info dat;

   if (saved_lines <= 0) {
      gettextinfo(&dat);
      screen_h = saved_lines = dat.screenheight;
      screen_w = dat.screenwidth;
      norm_attrib = dat.normattr;
   }

   if (screen_h != screenheight) {
      _set_screen_lines(screenheight);
      gettextinfo(&dat);
      screen_h = dat.screenheight;
      screen_w = dat.screenwidth;
   }

   set_bright_backgrounds();

   n_vid();
   textattr(attrib);
   cls();

   mouse_init();

   errno = 0;
}
Beispiel #4
0
void tui_init(void)
{
    set_gfx_mode(GFX_TEXT, 80, 25, 0, 0);

    /* FIXME: this should be made more flexible, to handle other screen modes
       automatically. */
    _set_screen_lines(25);

    gettextinfo(&text_mode_info);
    /* _setcursortype(_NOCURSOR); */
}
Beispiel #5
0
void term_exit()                     /* close down the screen */
{
   textattr(norm_attrib);

   if (saved_lines != screen_h) {
      _set_screen_lines(saved_lines);
      cls();
   }
   else {
      goto2(0,screen_h-1);
      putch('\n');
   }

   _setcursortype(_NORMALCURSOR);
   show_c();
}
Beispiel #6
0
/*------------------------------------------------------------------------*/
int main()
{
  int ok;

  read_config();
  _set_screen_lines(25);
  _setcursortype(_NOCURSOR);

  Screen("Joystick configuration utility for Atari 800 emulator",BACKGROUND+TITLE);
  ok=mainmenu();

  window(1,1,80,25);
  textattr(0xf);
  clrscr();
  _setcursortype(_NORMALCURSOR);

  if (ok) save_config();

  return 0;
}