Demo compiling with emu
authorlekernel <sebastien.bourdeauducq@lekernel.net>
Tue, 20 Oct 2009 19:48:09 +0000 (21:48 +0200)
committerlekernel <sebastien.bourdeauducq@lekernel.net>
Tue, 20 Oct 2009 19:48:09 +0000 (21:48 +0200)
software/demo/Makefile.emu
software/demo/ui.c
software/include/console.h

index d4ae8b1..8a4debd 100644 (file)
@@ -23,7 +23,7 @@ spam.h: spam.raw
        xxd -i spam.raw spam.h
 
 emu: bandfilters.h spam.h $(OBJECTS)
-       $(CC) $(LDFLAGS) -o $@ -L$(MMEMUDIR)/src --start-group $(OBJECTS) -lmmemulation --end-group
+       $(CC) $(LDFLAGS) -o $@ -L$(MMEMUDIR)/src --start-group $(OBJECTS) -lmmemulation -lm --end-group
 
 .PHONY: clean
 
index e20f347..d424d36 100644 (file)
 
 #ifdef EMULATION
 
+#include <cffat.h>
+
+#include "renderer.h"
+
 void ui_init()
 {
 }
@@ -29,6 +33,25 @@ void ui_tick()
 {
 }
 
+int ui_render_from_file(const char *filename)
+{
+       char buffer[8192];
+       int size;
+
+       if(!cffat_init()) return 0;
+       if(!cffat_load(filename, buffer, sizeof(buffer), &size)) return 0;
+       cffat_done();
+       buffer[size] = 0;
+
+       if(!renderer_start(buffer)) return 0;
+       return 1;
+}
+
+void ui_render_stop()
+{
+       renderer_stop();
+}
+
 #else
 
 #include <stdio.h>
index 5c0053d..0b499f7 100644 (file)
 #ifndef __CONSOLE_H
 #define __CONSOLE_H
 
-void writechar(char c);
 int puts(const char *s);
 void putsnonl(const char *s);
-char readchar();
 void readstr(char *s, int size);
 
 #endif /* __CONSOLE_H */