We need this for the MTX512 but it will also be useful later for MSX, as the
MSX also has a load of VDP RAM that we can use to support multiple text
consoles just like Xenix and later Linux did on a PC.
#define VT_INITIAL_LINE 0
#endif
+struct vt_switch {
+ uint8_t vtmode;
+ signed char cursorx;
+ signed char cursory;
+ signed char ncursory;
+};
+
/* Core functions */
void vtoutput(unsigned char *p, unsigned int len);
void vtinit(void);
+/* Mode switcher functions */
+void vt_save(struct vt_switch *vt);
+void vt_load(struct vt_switch *vt);
/* Platform functions */
void clear_lines(int8_t y, int8_t ct);
void clear_across(int8_t y, int8_t x, int16_t l);
#include <kernel.h>
#include <vt.h>
+#include <devtty.h>
#ifdef CONFIG_VT
/*
*/
-static int vtmode;
+static uint8_t vtmode;
static signed char cursorx;
static signed char cursory = VT_INITIAL_LINE;
-static int ncursory;
+static signed char ncursory;
static void cursor_fix(void)
{
cursor_on(0, 0);
}
+#ifdef CONFIG_VT_MULTI
+
+void vt_save(struct vt_switch *vt)
+{
+ cursor_off();
+ vt->vtmode = vtmode;
+ vt->cursorx = cursorx;
+ vt->cursory = cursory;
+ vt->ncursory = ncursory;
+}
+
+void vt_load(struct vt_switch *vt)
+{
+ vtmode = vt->vtmode;
+ cursorx = vt->cursorx;
+ cursory = vt->cursory;
+ ncursory = vt->ncursory;
+ cursor_on(cursory, cursorx);
+}
+#endif
#ifdef CONFIG_VT_SIMPLE