summaryrefslogtreecommitdiff
path: root/com32/lua
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lua')
-rw-r--r--com32/lua/src/Makefile2
-rw-r--r--com32/lua/src/vesa.c21
2 files changed, 22 insertions, 1 deletions
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 3ff05e38..1bd1c653 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -54,7 +54,7 @@ LIBLUA_OBJS += lauxlib.o lbaselib.o ldblib.o ltablib.o \
LIBLUA_OBJS += liolib.o
LIBLUA_OBJS += dmi.o ../../modules/dmi.o
LIBLUA_OBJS += pci.o
-LIBLUA_OBJS += vesa.o
+LIBLUA_OBJS += vesa.o ../../lib/sys/vesa/initvesa.o
# add function __parse_argv
LIBLUA_OBJS += ../../../com32/lib/sys/argv.o
# add function sleep()
diff --git a/com32/lua/src/vesa.c b/com32/lua/src/vesa.c
index d58dfaa3..6f34820a 100644
--- a/com32/lua/src/vesa.c
+++ b/com32/lua/src/vesa.c
@@ -4,9 +4,11 @@
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
+#include "../../include/console.h"
#include "../../lib/sys/vesa/vesa.h"
#include "../../lib/sys/vesa/video.h"
+int vesacon_load_background(const char *filename);
static int __constfunc is_power_of_2(unsigned int x)
{
@@ -113,8 +115,27 @@ static int vesa_getmodes(lua_State *L)
}
+static int vesa_setmode(lua_State *L)
+{
+ openconsole(&dev_rawcon_r, &dev_vesaserial_w);
+
+ return 0;
+}
+
+
+static int vesa_load_background(lua_State *L)
+{
+ const char *filename = luaL_checkstring(L, 1);
+
+ vesacon_load_background(filename);
+
+ return 0;
+}
+
static const luaL_reg vesalib[] = {
{"getmodes", vesa_getmodes},
+ {"setmode", vesa_setmode},
+ {"load_background", vesa_load_background},
{NULL, NULL}
};