73 lines
1.1 KiB
C++
73 lines
1.1 KiB
C++
// vconsole.h
|
|
// Author: Josh Holtrop
|
|
// Date: 08/02/04
|
|
// Modified: 05/11/05
|
|
|
|
#ifndef __HOS_VCONSOLE__
|
|
#define __HOS_VCONSOLE__ __HOS_VCONSOLE__
|
|
|
|
#define VCONSOLE_MAX 7
|
|
|
|
#ifdef _HOS_CPP_
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "hos_defines.h"
|
|
|
|
void vconsole_setup(int width, int height);
|
|
|
|
#ifdef _HOS_CPP_
|
|
}
|
|
|
|
#include "devices.h"
|
|
|
|
class VConsoleDriver : public DeviceDriver
|
|
{
|
|
public:
|
|
~VConsoleDriver();
|
|
int char_write(minor_t minor, int c);
|
|
};
|
|
|
|
class VConsole
|
|
{
|
|
protected:
|
|
u16_t *myBuffer;
|
|
u16_t myWidth;
|
|
u16_t myHeight;
|
|
u16_t myCursorPosition;
|
|
|
|
short myCursorStack[16];
|
|
u8_t myCursorStackPosition;
|
|
|
|
u32_t myEscapeValue[8];
|
|
u8_t myEscapeLevel;
|
|
u8_t myEscapePosition;
|
|
|
|
u8_t myAttribute;
|
|
u8_t myForeground;
|
|
u8_t myBackground;
|
|
u8_t myBold;
|
|
u8_t myReverse;
|
|
u8_t myBlink;
|
|
u8_t myConcealed;
|
|
|
|
u8_t myActive;
|
|
|
|
public:
|
|
VConsole(int width, int height);
|
|
~VConsole();
|
|
int char_read();
|
|
int char_write(int c);
|
|
void put_char(int c);
|
|
void update_cursor(u16_t position);
|
|
void update_cursor_coord(int y, int x);
|
|
void update_attribute();
|
|
void activate();
|
|
void deactivate();
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|