mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 15:26:23 -05:00
uemacs: ibmpc.c: Move the functions to the ANSI style declaration.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
81a3a0be6e
commit
54966da9f0
149
ibmpc.c
149
ibmpc.c
@ -1,4 +1,4 @@
|
|||||||
/* IBMPC.C
|
/* ibmpc.c
|
||||||
*
|
*
|
||||||
* The routines in this file provide support for the IBM-PC and other
|
* The routines in this file provide support for the IBM-PC and other
|
||||||
* compatible terminals. It goes directly to the graphics RAM to do
|
* compatible terminals. It goes directly to the graphics RAM to do
|
||||||
@ -130,24 +130,26 @@ struct terminal term = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if COLOR
|
#if COLOR
|
||||||
ibmfcol(color)
|
/* Set the current output color.
|
||||||
/* set the current output color */
|
*
|
||||||
int color; /* color to set */
|
* @color: color to set.
|
||||||
|
*/
|
||||||
|
void ibmfcol(int color)
|
||||||
{
|
{
|
||||||
cfcolor = ctrans[color];
|
cfcolor = ctrans[color];
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmbcol(color)
|
/* Set the current background color.
|
||||||
/* set the current background color */
|
*
|
||||||
int color; /* color to set */
|
* @color: color to set.
|
||||||
|
*/
|
||||||
|
void ibmbcol(int color)
|
||||||
{
|
{
|
||||||
cbcolor = ctrans[color];
|
cbcolor = ctrans[color];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ibmmove(row, col)
|
void ibmmove(int row, int col)
|
||||||
{
|
{
|
||||||
rg.h.ah = 2; /* set cursor position function code */
|
rg.h.ah = 2; /* set cursor position function code */
|
||||||
rg.h.dl = col;
|
rg.h.dl = col;
|
||||||
@ -156,7 +158,7 @@ ibmmove(row, col)
|
|||||||
int86(0x10, &rg, &rg);
|
int86(0x10, &rg, &rg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmeeol()
|
void ibmeeol(void)
|
||||||
{ /* erase to the end of the line */
|
{ /* erase to the end of the line */
|
||||||
unsigned int attr; /* attribute byte mask to place in RAM */
|
unsigned int attr; /* attribute byte mask to place in RAM */
|
||||||
unsigned int *lnptr; /* pointer to the destination line */
|
unsigned int *lnptr; /* pointer to the destination line */
|
||||||
@ -197,11 +199,8 @@ ibmeeol()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmputc(ch)
|
/* Put a character at the current position in the current colors */
|
||||||
/* put a character at the current position in the
|
void ibmputc(int ch)
|
||||||
current colors */
|
|
||||||
int ch;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
rg.h.ah = 14; /* write char to screen with current attrs */
|
rg.h.ah = 14; /* write char to screen with current attrs */
|
||||||
rg.h.al = ch;
|
rg.h.al = ch;
|
||||||
@ -216,7 +215,7 @@ int ch;
|
|||||||
int86(0x10, &rg, &rg);
|
int86(0x10, &rg, &rg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmeeop()
|
void ibmeeop(void)
|
||||||
{
|
{
|
||||||
int attr; /* attribute to fill screen with */
|
int attr; /* attribute to fill screen with */
|
||||||
|
|
||||||
@ -238,67 +237,73 @@ ibmeeop()
|
|||||||
int86(0x10, &rg, &rg);
|
int86(0x10, &rg, &rg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmrev(state)
|
/* Change reverse video state.
|
||||||
/* change reverse video state */
|
*
|
||||||
int state; /* TRUE = reverse, FALSE = normal */
|
* @state: TRUE = reverse, FALSE = normal.
|
||||||
|
*/
|
||||||
|
void ibmrev(int state)
|
||||||
{
|
{
|
||||||
/* This never gets used under the IBM-PC driver */
|
/* This never gets used under the IBM-PC driver */
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmcres(res)
|
/* Change screen resolution.
|
||||||
/* change screen resolution */
|
*
|
||||||
char *res; /* resolution to change to */
|
* @res: resolution to change to.
|
||||||
|
*/
|
||||||
|
void ibmcres(char *res)
|
||||||
{
|
{
|
||||||
int i; /* index */
|
int i;
|
||||||
|
for (i = 0; i < NDRIVE; i++) {
|
||||||
for (i = 0; i < NDRIVE; i++)
|
|
||||||
if (strcmp(res, drvname[i]) == 0) {
|
if (strcmp(res, drvname[i]) == 0) {
|
||||||
scinit(i);
|
scinit(i);
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
return (FALSE);
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SCROLLCODE
|
#if SCROLLCODE
|
||||||
|
|
||||||
/* move howmany lines starting at from to to */
|
/* Move howmany lines starting at from to to. */
|
||||||
ibmscroll_reg(from, to, howmany)
|
void ibmscroll_reg(from, to, howmany)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (to < from)
|
if (to < from) {
|
||||||
for (i = 0; i < howmany; i++)
|
for (i = 0; i < howmany; i++) {
|
||||||
movmem(scptr[from + i], scptr[to + i],
|
movmem(scptr[from + i], scptr[to + i],
|
||||||
term.t_ncol * 2);
|
term.t_ncol * 2);
|
||||||
else if (to > from)
|
}
|
||||||
for (i = howmany - 1; i >= 0; i--)
|
}
|
||||||
|
else if (to > from) {
|
||||||
|
for (i = howmany - 1; i >= 0; i--) {
|
||||||
movmem(scptr[from + i], scptr[to + i],
|
movmem(scptr[from + i], scptr[to + i],
|
||||||
term.t_ncol * 2);
|
term.t_ncol * 2);
|
||||||
return;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
spal()
|
/* Reset the pallette registers. */
|
||||||
{ /* reset the pallette registers */
|
void spal(void)
|
||||||
|
{
|
||||||
/* nothin here now..... */
|
/* nothin here now..... */
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmbeep()
|
void ibmbeep(void)
|
||||||
{
|
{
|
||||||
bdos(6, BEL, 0);
|
bdos(6, BEL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmopen()
|
void ibmopen(void)
|
||||||
{
|
{
|
||||||
scinit(CDSENSE);
|
scinit(CDSENSE);
|
||||||
revexist = TRUE;
|
revexist = TRUE;
|
||||||
ttopen();
|
ttopen();
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmclose()
|
void ibmclose(void)
|
||||||
{
|
{
|
||||||
#if COLOR
|
#if COLOR
|
||||||
ibmfcol(7);
|
ibmfcol(7);
|
||||||
@ -315,18 +320,21 @@ ibmclose()
|
|||||||
ttclose();
|
ttclose();
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmkopen()
|
/* Open the keyboard. */
|
||||||
{ /* open the keyboard */
|
void ibmkopen(void)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ibmkclose()
|
/* Close the keyboard. */
|
||||||
{ /* close the keyboard */
|
void ibmkclose(void)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
scinit(type)
|
/* Initialize the screen head pointers.
|
||||||
/* initialize the screen head pointers */
|
*
|
||||||
int type; /* type of adapter to init for */
|
* @type: type of adapter to init for.
|
||||||
|
*/
|
||||||
|
static int scinit(int type)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
long laddr; /* long form of address */
|
long laddr; /* long form of address */
|
||||||
@ -403,8 +411,7 @@ int type; /* type of adapter to init for */
|
|||||||
CGA set to CGA EGAexist = FALSE
|
CGA set to CGA EGAexist = FALSE
|
||||||
EGA set to CGA EGAexist = TRUE
|
EGA set to CGA EGAexist = TRUE
|
||||||
*/
|
*/
|
||||||
|
int getboard(void)
|
||||||
int getboard()
|
|
||||||
{
|
{
|
||||||
int type; /* board type to return */
|
int type; /* board type to return */
|
||||||
|
|
||||||
@ -421,8 +428,9 @@ int getboard()
|
|||||||
return (type);
|
return (type);
|
||||||
}
|
}
|
||||||
|
|
||||||
egaopen()
|
/* init the computer to work with the EGA */
|
||||||
{ /* init the computer to work with the EGA */
|
void egaopen(void)
|
||||||
|
{
|
||||||
/* put the beast into EGA 43 row mode */
|
/* put the beast into EGA 43 row mode */
|
||||||
rg.x.ax = 3;
|
rg.x.ax = 3;
|
||||||
int86(16, &rg, &rg);
|
int86(16, &rg, &rg);
|
||||||
@ -445,20 +453,21 @@ egaopen()
|
|||||||
outp(0x3d5, 6);
|
outp(0x3d5, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
egaclose()
|
void egaclose(void)
|
||||||
{
|
{
|
||||||
/* put the beast into 80 column mode */
|
/* put the beast into 80 column mode */
|
||||||
rg.x.ax = 3;
|
rg.x.ax = 3;
|
||||||
int86(16, &rg, &rg);
|
int86(16, &rg, &rg);
|
||||||
}
|
}
|
||||||
|
|
||||||
scwrite(row, outstr, forg, bacg)
|
/* Write a line out.
|
||||||
/* write a line out */
|
*
|
||||||
int row; /* row of screen to place outstr on */
|
* @row: row of screen to place outstr on.
|
||||||
char *outstr; /* string to write out (must be term.t_ncol long) */
|
* @outstr: string to write out (must be term.t_ncol long).
|
||||||
int forg; /* forground color of string to write */
|
* @forg: forground color of string to write.
|
||||||
int bacg; /* background color */
|
* @bacg: background color.
|
||||||
|
*/
|
||||||
|
void scwrite(int row, char *outstr, int forg, int bacg)
|
||||||
{
|
{
|
||||||
unsigned int attr; /* attribute byte mask to place in RAM */
|
unsigned int attr; /* attribute byte mask to place in RAM */
|
||||||
unsigned int *lnptr; /* pointer to the destination line */
|
unsigned int *lnptr; /* pointer to the destination line */
|
||||||
@ -467,9 +476,7 @@ int bacg; /* background color */
|
|||||||
/* build the attribute byte and setup the screen pointer */
|
/* build the attribute byte and setup the screen pointer */
|
||||||
#if COLOR
|
#if COLOR
|
||||||
if (dtype != CDMONO)
|
if (dtype != CDMONO)
|
||||||
attr =
|
attr = (((ctrans[bacg] & 15) << 4) | (ctrans[forg] & 15)) << 8;
|
||||||
(((ctrans[bacg] & 15) << 4) | (ctrans[forg] & 15)) <<
|
|
||||||
8;
|
|
||||||
else
|
else
|
||||||
attr = (((bacg & 15) << 4) | (forg & 15)) << 8;
|
attr = (((bacg & 15) << 4) | (forg & 15)) << 8;
|
||||||
#else
|
#else
|
||||||
@ -492,13 +499,15 @@ int bacg; /* background color */
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if FNLABEL
|
#if FNLABEL
|
||||||
fnclabel(f, n)
|
/* Label a function key.
|
||||||
/* label a function key */
|
*
|
||||||
int f, n; /* default flag, numeric argument [unused] */
|
* @f: default flag
|
||||||
|
* @n: numeric argument [unused].
|
||||||
|
*/
|
||||||
|
int fnclabel(int f, int n)
|
||||||
{
|
{
|
||||||
/* on machines with no function keys...don't bother */
|
/* on machines with no function keys...don't bother */
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user