New definition for 16-bit regs; more use of them; and a fix for

PDC_set_ctrl_break(), which has been broken since before 2.0 (it just
called the get function again, rather than the set function).
This commit is contained in:
William McBrine
2006-10-18 22:35:11 +00:00
parent 1914c543c0
commit 83accde49e
5 changed files with 28 additions and 41 deletions

View File

@@ -15,7 +15,7 @@
#include <string.h>
RCSID("$Id: pdcdisp.c,v 1.54 2006/10/15 02:42:25 wmcbrine Exp $");
RCSID("$Id: pdcdisp.c,v 1.55 2006/10/18 22:35:11 wmcbrine Exp $");
#ifdef __PACIFIC__
void movedata(unsigned sseg, unsigned soff, unsigned dseg,
@@ -82,11 +82,7 @@ static void PDC_putc(chtype ch, unsigned short count)
regs.h.al = (unsigned char) (ch & 0xff);
regs.h.bh = 0;
regs.h.bl = chtype_attr(ch);
#ifdef __WATCOMC__
regs.w.cx = count;
#else
regs.x.cx = count;
#endif
regs.W.cx = count;
PDCINT(0x10, regs);
}

View File

@@ -11,7 +11,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: pdcdos.h,v 1.18 2006/10/15 02:42:25 wmcbrine Exp $ */
/* $Id: pdcdos.h,v 1.19 2006/10/18 22:35:11 wmcbrine Exp $ */
#include <curspriv.h>
@@ -119,6 +119,13 @@ void setdosmemword(int offs, unsigned short w);
# endif
#endif
/* Wide registers in REGS: w or x? */
#ifdef __WATCOMC__
# define W w
#else
# define W x
#endif
/* Monitor (terminal) type information */
enum
{

View File

@@ -19,7 +19,7 @@
#include "pdcdos.h"
RCSID("$Id: pdckbd.c,v 1.41 2006/10/15 02:42:25 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.42 2006/10/18 22:35:11 wmcbrine Exp $");
/************************************************************************
* Table for key code translation of function keys in keypad mode *
@@ -355,8 +355,8 @@ int PDC_set_ctrl_break(bool setting)
setcbrk(setting);
#else
regs.h.ah = 0x33;
regs.h.al = 0x00;
regs.h.dl = (unsigned char) (setting ? 1 : 0);
regs.h.al = 0x01;
regs.h.dl = setting;
PDCINT(0x21, regs);
#endif
return OK;

View File

@@ -20,7 +20,7 @@
# include <sys/movedata.h>
#endif
RCSID("$Id: pdcscrn.c,v 1.63 2006/10/15 02:42:25 wmcbrine Exp $");
RCSID("$Id: pdcscrn.c,v 1.64 2006/10/18 22:35:11 wmcbrine Exp $");
int pdc_adapter; /* screen type */
int pdc_scrnmode; /* default screen mode */
@@ -111,14 +111,12 @@ static void _set_font(int size)
switch (size)
{
case _FONT8:
regs.h.ah = 0x11;
regs.h.al = 0x12;
regs.W.ax = 0x1112;
regs.h.bl = 0x00;
PDCINT(0x10, regs);
break;
case _FONT14:
regs.h.ah = 0x11;
regs.h.al = 0x11;
regs.W.ax = 0x1111;
regs.h.bl = 0x00;
PDCINT(0x10, regs);
}
@@ -132,20 +130,17 @@ static void _set_font(int size)
switch (size)
{
case _FONT8:
regs.h.ah = 0x11;
regs.h.al = 0x12;
regs.W.ax = 0x1112;
regs.h.bl = 0x00;
PDCINT(0x10, regs);
break;
case _FONT14:
regs.h.ah = 0x11;
regs.h.al = 0x11;
regs.W.ax = 0x1111;
regs.h.bl = 0x00;
PDCINT(0x10, regs);
break;
case _FONT16:
regs.h.ah = 0x11;
regs.h.al = 0x14;
regs.W.ax = 0x1114;
regs.h.bl = 0x00;
PDCINT(0x10, regs);
}
@@ -297,8 +292,7 @@ static int _query_adapter_type(void)
/* attempt to call VGA Identify Adapter Function */
regs.h.ah = 0x1a;
regs.h.al = 0;
regs.W.ax = 0x1a00;
PDCINT(0x10, regs);
if ((regs.h.al == 0x1a) && (retval == _NONE))
@@ -350,11 +344,7 @@ static int _query_adapter_type(void)
bx == 0x0010 --> return EGA information */
regs.h.ah = 0x12;
# ifdef __WATCOMC__
regs.w.bx = 0x10;
# else
regs.x.bx = 0x10;
# endif
regs.W.bx = 0x10;
PDCINT(0x10, regs);
if ((regs.h.bl != 0x10) && (retval == _NONE))
@@ -714,8 +704,7 @@ static int _egapal(int color)
{
PDCREGS regs;
regs.h.ah = 0x10;
regs.h.al = 0x07;
regs.W.ax = 0x1007;
regs.h.bl = color;
PDCINT(0x10, regs);
@@ -736,8 +725,7 @@ int PDC_color_content(short color, short *red, short *green, short *blue)
/* Read single DAC register */
regs.h.ah = 0x10;
regs.h.al = 0x15;
regs.W.ax = 0x1015;
regs.h.bl = _egapal(color);
PDCINT(0x10, regs);
@@ -763,10 +751,8 @@ int PDC_init_color(short color, short red, short green, short blue)
/* Set single DAC register */
regs.h.ah = 0x10;
regs.h.al = 0x10;
regs.h.bh = 0;
regs.h.bl = _egapal(color);
regs.W.ax = 0x1010;
regs.W.bx = _egapal(color);
PDCINT(0x10, regs);

View File

@@ -13,7 +13,7 @@
#include "pdcdos.h"
RCSID("$Id: pdcsetsc.c,v 1.31 2006/10/15 02:42:25 wmcbrine Exp $");
RCSID("$Id: pdcsetsc.c,v 1.32 2006/10/18 22:35:11 wmcbrine Exp $");
int PDC_curs_set(int visibility)
{
@@ -82,10 +82,8 @@ int PDC_set_blink(bool blinkon)
case _EGAMONO:
case _VGACOLOR:
case _VGAMONO:
regs.h.ah = 0x10;
regs.h.al = 0x03;
regs.h.bh = 0;
regs.h.bl = blinkon;
regs.W.ax = 0x1003;
regs.W.bx = blinkon;
PDCINT(0x10, regs);