From f52198a93b5e48ab56a93a5613723d65ada23251 Mon Sep 17 00:00:00 2001 From: Bernd Boeckmann Date: Sat, 11 May 2024 20:56:39 +0200 Subject: [PATCH] ansicon.c: respect selected video page --- source/fdisk/ansicon.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/fdisk/ansicon.c b/source/fdisk/ansicon.c index d330625..48ba566 100644 --- a/source/fdisk/ansicon.c +++ b/source/fdisk/ansicon.c @@ -56,6 +56,7 @@ static char con_is_device; static char con_is_monochrome; static char cursor_sync_disabled; +static unsigned char vid_page; static unsigned short __far *vid_mem; static void con_get_hw_cursor( int *x, int *y ); @@ -84,6 +85,7 @@ void con_init( int interpret_esc ) r.h.ah = 0xf; intr( 0x10, &r ); con_is_monochrome = ( r.h.al == 7 ); + vid_page = r.h.bh; vid_mem = ( con_is_monochrome ) ? MK_FP( 0xb000, 0 ) : MK_FP( 0xb800, 0 ); /* screen size ? */ @@ -199,8 +201,9 @@ static void con_get_hw_cursor( int *x, int *y ) { union REGPACK r; - r.x.ax = 0x0300; - r.x.bx = 0; + memset( &r, 0, sizeof( union REGPACK ) ); + r.h.ah = 0x03; + r.h.bh = vid_page; intr( 0x10, &r ); *x = r.h.dl + 1; @@ -216,8 +219,8 @@ static void con_set_hw_cursor( int x, int y ) } memset( &r, 0, sizeof( union REGPACK ) ); - r.w.ax = 0x0200; - r.w.bx = 0; + r.h.ah = 0x02; + r.h.bh = vid_page; r.h.dl = x - 1; r.h.dh = y - 1; intr( 0x10, &r );