summaryrefslogtreecommitdiff
path: root/Source/Library/Userland
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-11-13 18:05:27 +0100
committerAlexis211 <alexis211@gmail.com>2009-11-13 18:05:27 +0100
commit2b9e97b8635c20c5a2b87789b1014489863d1994 (patch)
tree58fa9f2fa82ac9477819193b6731b8b927187224 /Source/Library/Userland
parent7e3ecd80af5ddcedbfa3d849284400ed6568f516 (diff)
downloadMelon-2b9e97b8635c20c5a2b87789b1014489863d1994.tar.gz
Melon-2b9e97b8635c20c5a2b87789b1014489863d1994.zip
Added a game of life simulator demo
Diffstat (limited to 'Source/Library/Userland')
-rw-r--r--Source/Library/Userland/Binding/VirtualTerminal.class.h17
-rw-r--r--Source/Library/Userland/Start.cpp4
2 files changed, 17 insertions, 4 deletions
diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h
index 5fd9733..c8a4123 100644
--- a/Source/Library/Userland/Binding/VirtualTerminal.class.h
+++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h
@@ -4,6 +4,7 @@
#include <Syscall/RessourceCaller.class.h>
#include <VirtualTerminal.iface.h>
+#include <Kbd.iface.h>
#include <String.class.h>
#include <WChar.class.h>
@@ -29,6 +30,10 @@ class VirtualTerminal : public RessourceCaller {
void write(String s) {
doCall(VTIF_WRITE, (u32int)&s);
}
+ keypress_t getKeypress(bool show = true, bool block = true) {
+ keypress_t* ptr = (keypress_t*)doCall(VTIF_GETKEYPRESS, (show ? 1 : 0) | (block ? 2 : 0));
+ return *ptr;
+ }
String readLine(bool show = true) {
return String::unserialize(doCall(VTIF_READLINE, (show ? 1 : 0)));
}
@@ -44,9 +49,21 @@ class VirtualTerminal : public RessourceCaller {
bool isBoxed() {
return doCall(VTIF_ISBOXED) != 0;
}
+ u8int height() {
+ return doCall(VTIF_GETHEIGHT);
+ }
+ u8int width() {
+ return doCall(VTIF_GETWIDTH);
+ }
void put(WChar c) {
doCall(VTIF_PUT, c);
}
+ void moveCursor(u8int line, u8int col) {
+ doCall(VTIF_LOCATE, line, col);
+ }
+ void put(u8int line, u8int col, WChar c) {
+ moveCursor(line, col); put(c);
+ }
inline VirtualTerminal& operator<<(const String& s) { write(s); return *this; }
inline VirtualTerminal& operator<<(s32int i) { writeDec(i); return *this; }
diff --git a/Source/Library/Userland/Start.cpp b/Source/Library/Userland/Start.cpp
index 032450d..0c25491 100644
--- a/Source/Library/Userland/Start.cpp
+++ b/Source/Library/Userland/Start.cpp
@@ -4,10 +4,6 @@
#include <Heap.class.h>
-extern "C" void __cxa_pure_virtual() {} //Required when using abstract classes
-void *__dso_handle; //Required when using global objects
-extern "C" int __cxa_atexit(void (*f)(void*), void *p, void *d) { return 0; }
-
extern u32int start_ctors, end_ctors, start_dtors, end_dtors;
Heap heap;