window-port updates

Remove start_screen() and end_screen() from the
Window-port interface.

They were only ever used by tty, and there was a comment
carried to several window-ports about how they "really
should go away. They are tty-specific"

term_start_screen() and term_end_screen() are part of
terminal/NO_TERMS supporting routines now.
This commit is contained in:
nhmall
2025-01-04 23:38:34 -05:00
parent 63dfb84d00
commit be5143bb74
42 changed files with 59 additions and 334 deletions

View File

@@ -277,7 +277,7 @@ extern void vga_update_positionbar(char *);
extern void vga_HideCursor(void);
#endif
extern void vga_Init(void);
extern void vga_tty_end_screen(void);
extern void vga_term_end_screen(void);
extern void vga_term_startup(int *, int *);
extern void vga_xputs(const char *, int, int);
extern void vga_xputc(char, int);
@@ -308,7 +308,7 @@ extern void vesa_update_positionbar(char *);
extern void vesa_HideCursor(void);
#endif
extern void vesa_Init(void);
extern void vesa_tty_end_screen(void);
extern void vesa_term_end_screen(void);
extern void vesa_term_startup(int *, int *);
extern void vesa_xputs(const char *, int, int);
extern void vesa_xputc(char, int);

View File

@@ -471,7 +471,7 @@ tty_delay_output(void)
}
void
tty_end_screen(void)
term_end_screen(void)
{
if (!iflags.grmode) {
txt_clear_screen();
@@ -480,11 +480,11 @@ tty_end_screen(void)
#endif
#ifdef SCREEN_VGA
} else if (iflags.usevga) {
vga_tty_end_screen();
vga_term_end_screen();
#endif
#ifdef SCREEN_VESA
} else if (iflags.usevesa) {
vesa_tty_end_screen();
vesa_term_end_screen();
#endif
}
}
@@ -546,7 +546,7 @@ term_startup(int *wid, int *hgt)
}
void
tty_start_screen(void)
term_start_screen(void)
{
#ifdef PC9800
fputs("\033[>1h", stdout);

View File

@@ -596,7 +596,7 @@ vesa_cl_eos(int cy)
}
void
vesa_tty_end_screen(void)
vesa_term_end_screen(void)
{
vesa_clear_screen(BACKGROUND_VESA_COLOR);
vesa_SwitchMode(MODETEXT);

View File

@@ -290,7 +290,7 @@ void vga_cl_eos(int cy)
}
void
vga_tty_end_screen(void)
vga_term_end_screen(void)
{
vga_clear_screen(BACKGROUND_VGA_COLOR);
vga_SwitchMode(MODETEXT);

View File

@@ -38,7 +38,7 @@ settty(const char *s)
#if defined(MSDOS) && defined(NO_TERMS)
gr_finish();
#endif
end_screen();
term_end_screen();
if (s)
raw_print(s);
#if !defined(TOS)
@@ -50,7 +50,7 @@ settty(const char *s)
void
setftty(void)
{
start_screen();
term_start_screen();
}
#if defined(TIMED_DELAY) && defined(_MSC_VER)
@@ -77,7 +77,7 @@ VA_DECL(const char *, s)
VA_INIT(s, const char *);
/* error() may get called before tty is initialized */
if (iflags.window_inited)
end_screen();
term_end_screen();
putchar('\n');
Vprintf(s, VA_ARGS);
putchar('\n');

View File

@@ -11,6 +11,7 @@
#define NEED_VARARGS
#include "hack.h"
#include "wintty.h"
/*
* The distinctions here are not BSD - rest but rather USG - rest, as
@@ -229,7 +230,10 @@ gettty(void)
void
settty(const char *s)
{
end_screen();
#ifdef TTY_GRAPHICS
if (WINDOWPORT(tty))
term_end_screen();
#endif
if (s)
raw_print(s);
if (STTY(&inittyb) < 0 || STTY2(&inittyb2) < 0)
@@ -306,7 +310,11 @@ setftty(void)
if (change)
setctty();
start_screen();
#ifdef TTY_GRAPHICS
if (WINDOWPORT(tty))
term_start_screen();
#endif
}
void intron(void) /* enable kbd interrupts if enabled when game started */
@@ -480,7 +488,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
#ifdef ENHANCED_SYMBOLS
/*
* set in tty_start_screen() and allows
* set in term_start_screen() and allows
* OS-specific changes that may be
* required for support of utf8.
*/

View File

@@ -513,7 +513,7 @@ setftty(void)
sg.sm.tt2_char = tt2_char_active;
setctty();
start_screen();
term_start_screen();
settty_needed = TRUE;
}
@@ -601,7 +601,7 @@ getwindowsz(void)
#ifdef ENHANCED_SYMBOLS
/*
* set in tty_start_screen() and allows
* set in term_start_screen() and allows
* OS-specific changes that may be
* required for support of utf8.
* Currently a placeholder for VMS.

View File

@@ -1052,7 +1052,7 @@ void
settty(const char *s)
{
cmov(ttyDisplay->curx, ttyDisplay->cury);
end_screen();
term_end_screen();
if (s)
raw_print(s);
restore_original_console_font();
@@ -1075,7 +1075,7 @@ settty(const char *s)
void
setftty(void)
{
start_screen();
term_start_screen();
}
void
@@ -1113,7 +1113,7 @@ graph_off(void)
#endif
void
tty_end_screen(void)
term_end_screen(void)
{
term_clear_screen();
really_move_cursor();
@@ -1123,7 +1123,7 @@ tty_end_screen(void)
}
void
tty_start_screen(void)
term_start_screen(void)
{
if (iflags.num_pad)
tty_number_pad(1); /* make keypad send digits */

View File

@@ -231,8 +231,10 @@ VA_DECL(const char *, s)
VA_START(s);
VA_INIT(s, const char *);
/* error() may get called before tty is initialized */
#ifdef TTY_GRAPHICS
if (iflags.window_inited)
end_screen();
term_end_screen();
#endif
if (WINDOWPORT(tty)) {
buf[0] = '\n';
(void) vsnprintf(&buf[1], sizeof buf - (1 + sizeof "\n"), s, VA_ARGS);