Skip to content

Commit

Permalink
ansicon.c: respect selected video page
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann committed May 11, 2024
1 parent 8126a21 commit f52198a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/fdisk/ansicon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 ? */
Expand Down Expand Up @@ -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;
Expand All @@ -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 );
Expand Down

0 comments on commit f52198a

Please sign in to comment.