/* hercules.c - hercules console interface */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2001,2002 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef SUPPORT_HERCULES
#include <shared.h>
#include <hercules.h>
#include <term.h>
/* The position of the cursor. */
static int herc_x;
static int herc_y;
/* Write a byte to a port. */
static inline void
{
}
static void
herc_set_cursor (void)
{
outb (0x80, 0);
outb (0x80, 0);
outb (0x80, 0);
outb (0x80, 0);
}
void
hercules_putchar (int c)
{
switch (c)
{
case '\b':
if (herc_x > 0)
herc_x--;
break;
case '\n':
herc_y++;
break;
case '\r':
herc_x = 0;
break;
case '\a':
break;
default:
{
volatile unsigned short *video
= (unsigned short *) HERCULES_VIDEO_ADDR;
= (herc_current_color << 8) | c;
herc_x++;
if (herc_x >= HERCULES_WIDTH)
{
herc_x = 0;
herc_y++;
}
}
break;
}
if (herc_y >= HERCULES_HEIGHT)
{
int i;
grub_memmove ((char *) HERCULES_VIDEO_ADDR,
i++)
video[i] = 0x07200720;
}
}
void
hercules_cls (void)
{
int i;
video[i] = 0x07200720;
herc_set_cursor ();
}
int
hercules_getxy (void)
{
}
void
hercules_gotoxy (int x, int y)
{
herc_x = x;
herc_y = y;
herc_set_cursor ();
}
void
{
switch (state) {
case COLOR_STATE_STANDARD:
break;
case COLOR_STATE_NORMAL:
break;
case COLOR_STATE_HIGHLIGHT:
break;
default:
break;
}
}
void
{
}
int
{
outb (0x80, 0);
outb (0x80, 0);
return old_state;
}
#endif /* SUPPORT_HERCULES */