A low-level, binary stream-based virtual multimedia terminal architecture.
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <windows.h>
#include <bluei.h>
int main(void) {
// Set stdout to binary mode to prevent Windows CRLF conversions
_setmode(_fileno(stdout), _O_BINARY);
unsigned char buf[256];
unsigned char* p = buf;
pCMD_ENV(p);
pCMD_SETWIN(p, 320, 240);
fwrite(buf, p - buf, 1, stdout);
fflush(stdout);
while (!(GetAsyncKeyState('Q') & 0x8000)) {
p = buf;
pCMD_SETCOLOR(p, 0x20, 0x20, 0x40, 0xFF);
pCMD_CLEAR(p);
fwrite(buf, p - buf, 1, stdout);
fflush(stdout);
Sleep(16);
}
return 0;
}