old-MTGos-old/user/mtgos.cpp
Morten Delenk f71e781839 This is v0.01 release. I added the first syscall!
! Fixes in malloc. Now space-areas will no longer overlap.
2016-05-22 18:13:06 +00:00

31 lines
812 B
C++

#include <mtgos.hpp>
extern "C" {
void * screenout_init(int err);
void * screenout_out(void* handle, char *str);
void * screenout_clear(void* handle);
void * screenout_setcolor(void* handle, uint32_t BG, uint32_t FG);
void * screenout_destroy(void * handle);
}
ScreenOut::ScreenOut(bool err) {
handle=screenout_init(err);
}
auto ScreenOut::operator<<(char * str) -> ScreenOut & {
screenout_out(handle, str);
return *this;
}
auto ScreenOut::clrscr() -> ScreenOut & {
screenout_clear(handle);
return *this;
}
auto ScreenOut::setColor(BGColor bg, FGColor fg) -> ScreenOut & {
screenout_setcolor(handle, static_cast<uint32_t>(bg), static_cast<uint32_t>(fg));
return *this;
}
ScreenOut::~ScreenOut() {
handle=screenout_destroy(handle);
}
void main();
extern "C" void _start() {
main();
for(;;);
}