1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:47:46 +00:00

Implement 'H' and 'J' escape sequences.

This commit is contained in:
Andreas Kling 2018-10-27 23:42:20 +02:00
parent cc7e3519a6
commit 8289a5c93c
5 changed files with 168 additions and 14 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include <AK/Compiler.h>
#include <AK/Vector.h>
#include <VirtualFileSystem/CharacterDevice.h>
class Console final : public CharacterDevice {
@ -17,6 +18,9 @@ public:
void putChar(char);
private:
void escape$H(const Vector<unsigned>&);
void escape$J(const Vector<unsigned>&);
const byte m_rows { 25 };
const byte m_columns { 80 };
byte m_cursorRow { 0 };
@ -24,6 +28,19 @@ private:
byte m_currentAttribute { 0x07 };
void executeEscapeSequence(byte final);
enum EscapeState {
Normal,
ExpectBracket,
ExpectParameter,
ExpectIntermediate,
ExpectFinal,
};
EscapeState m_escState { Normal };
Vector<byte> m_parameters;
Vector<byte> m_intermediates;
const byte* s_vgaMemory { (const byte*)0xb8000 };
};