[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lost] [PATCH] [5/5] + Testprogramm fuer Grafikausgabe



Nur ein kleines Testprogramm für die diversen Grafikbefehle. Ein großer Teil ist gerade auskommentiert, einfach ausprobieren.

Mathias
From 04355d44d70d6dace8b3464411b074fca5b44a65 Mon Sep 17 00:00:00 2001
From: Mathias Gottschlag <mathias-go@xxxxxx>
Date: Tue, 14 Oct 2008 15:57:38 +0200
Subject: [PATCH] + Testprogramm fuer Grafikausgabe

---
 src/modules/c/gfxtest/Makefile.all |    8 +
 src/modules/c/gfxtest/gfxtest.c    |  382 ++++++++++++++++++++++++++++++++++++
 2 files changed, 390 insertions(+), 0 deletions(-)
 create mode 100644 src/modules/c/gfxtest/Makefile.all
 create mode 100644 src/modules/c/gfxtest/gfxtest.c

diff --git a/src/modules/c/gfxtest/Makefile.all b/src/modules/c/gfxtest/Makefile.all
new file mode 100644
index 0000000..ad34934
--- /dev/null
+++ b/src/modules/c/gfxtest/Makefile.all
@@ -0,0 +1,8 @@
+shopt -s extglob
+source $LOST_BUILDMK_ROOT/config.sh
+
+echo "LD   $1/apps/gfxtest"
+$LOST_TOOLS_LD -ogfxtest -Ttext=0x40000000 *.o --start-group $2 --end-group
+
+
+mv gfxtest $1/apps/
diff --git a/src/modules/c/gfxtest/gfxtest.c b/src/modules/c/gfxtest/gfxtest.c
new file mode 100644
index 0000000..1db4e32
--- /dev/null
+++ b/src/modules/c/gfxtest/gfxtest.c
@@ -0,0 +1,382 @@
+/*  
+ * Copyright (c) 2007 The LOST Project. All rights reserved.
+ *
+ * This code is derived from software contributed to the LOST Project
+ * by Mathias Gottschlag.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the LOST Project
+ *     and its contributors.
+ * 4. Neither the name of the LOST Project nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */  
+
+#include <init.h>
+
+#include "types.h"
+#include "syscall.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "unistd.h"
+#include "string.h"
+#include "rpc.h"
+#include "io.h"
+#include "dir.h"
+#include "lostio.h"
+#include <video/video.h>
+#include <video/drawing.h>
+
+// 8x8 terminal font
+static unsigned char g_8x8_font[2048] =
+{
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E,
+	0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0x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, 0x00,
+	0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00,
+	0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 
+	0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, 
+	0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, 
+	0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, 
+	0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 
+	0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, 
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00,
+	0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 
+	0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 
+	0x18, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x18, 0x00, 
+	0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00,
+	0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
+	0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00, 
+	0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
+	0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 
+	0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30,
+	0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00,
+	0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0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, 0x60, 0x78, 0x00,
+	0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00,
+	0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 
+	0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 
+	0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 
+	0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00, 
+	0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00,
+	0x1C, 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0x76, 0x00,
+	0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 
+	0x38, 0x6C, 0x64, 0xF0, 0x60, 0x60, 0xF0, 0x00, 
+	0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, 
+	0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00, 
+	0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 
+	0x0C, 0x00, 0x1C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 
+	0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00,
+	0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 
+	0x00, 0x00, 0xCC, 0xFE, 0xFE, 0xD6, 0xD6, 0x00, 
+	0x00, 0x00, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 
+	0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 
+	0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0, 
+	0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E, 
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x18, 0xF8, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18,
+	0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
+	0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 
+	0x00, 0x00, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, 
+	0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+	0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 
+	0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00,
+	0x18, 0x18, 0xF8, 0x18, 0xF8, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, 
+	0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 
+	0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 
+	0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 
+	0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 
+	0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 
+	0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 
+	0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00,
+	0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 
+	0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 
+	0x36, 0x36, 0x36, 0x36, 0xFF, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18, 
+	0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0x36, 0x36, 0x3F, 0x00, 0x00, 0x00, 
+	0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 
+	0x00, 0x00, 0x00, 0x00, 0x3F, 0x36, 0x36, 0x36, 
+	0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
+	0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 
+	0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 
+	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+	0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 
+	0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+	0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 
+	0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00,
+	0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0,
+	0x00, 0xFC, 0xCC, 0xC0, 0xC0, 0xC0, 0xC0, 0x00,
+	0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
+	0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00,
+	0x00, 0x00, 0x7E, 0xD8, 0xD8, 0xD8, 0x70, 0x00,
+	0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0,
+	0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00,
+	0xFC, 0x30, 0x78, 0xCC, 0xCC, 0x78, 0x30, 0xFC,
+	0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00,
+	0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00,
+	0x1C, 0x30, 0x18, 0x7C, 0xCC, 0xCC, 0x78, 0x00,
+	0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00,
+	0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0,
+	0x38, 0x60, 0xC0, 0xF8, 0xC0, 0x60, 0x38, 0x00,
+	0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
+	0x00, 0x7E, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00,
+	0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x7E, 0x00,
+	0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00,
+	0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00,
+	0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
+	0x18, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x18, 0x00,
+	0x00, 0x76, 0xDC, 0x00, 0x76, 0xDC, 0x00, 0x00,
+	0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+	0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
+	0x58, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00,
+	0x70, 0x98, 0x30, 0x60, 0xF8, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+int needupdate = 0;
+
+void activate_gfx(void)
+{
+    needupdate = 1;
+}
+
+void draw_string(int x, int y, int bitmap, char *str)
+{
+    while (*str) {
+        video_draw_bitmap_part(bitmap, x, y, 0, *str * 8, 8, 8);
+        x += 8;
+        str++;
+    }
+}
+
+int main(int argc, char* argv[])
+{
+    syscall_putsn(10, "gfxtest.\n");
+    if (!video_init()) {
+        printf("[ gfxtest ] Konnte Videoausgabe nicht initialisieren.\n");
+        return -1;
+    }
+    video_set_activate_callback(activate_gfx);
+    video_set_resolution(1024, 768, 24);
+    
+    int bitmap = video_upload_bitmap(g_8x8_font, 8, 8 * 256, BITMAP_FORMAT_MONO_1);
+    if (!bitmap) printf("Konnte Bitmap nicht laden.\n");
+    
+    video_start_command();
+    video_set_rop(ROP_COPY);
+    video_draw_solid_rect(0x003300, 0, 0, 1024, 768);
+    video_end_command();
+    int position = 0;
+    int direction = 1;
+    while (getchar() != 'q') {
+        position += direction;
+        if (position == 924) direction = -1;
+        if (position == 0) direction = 1;
+        
+        /*video_start_command();
+        video_set_rop(ROP_COPY);
+        video_draw_solid_rect(0x003300, 0, 0, 1024, 256);
+        //video_draw_bitmap(bitmap, 50, 50);
+        //video_draw_bitmap_part(bitmap, 60, 60, 0, 'A' * 8, 8, 8);
+        draw_string(60, 60, bitmap, "Hello world!");
+        video_draw_dot(0xFF0000, 10, 10);
+        video_draw_line(0xFF0000, 20, 20, 10, 100);
+        video_draw_ellipse(0x0000FF, 300, 50, 150, 100);
+        video_draw_solid_rect(0x003300, 0, 256, position, 256);
+        video_draw_solid_rect(0xFFFFFF, position, 256, 100, 256);
+        video_draw_solid_rect(0x003300, position + 100, 256, 1024 - position - 100, 256);
+        video_draw_solid_rect(0x003300, 0, 512, 1024, 256);
+        video_set_rop(ROP_XOR);
+        video_draw_solid_rect(0xFFFFFF, position + 50, 256 + 128, 100, 256);
+        video_end_command();*/
+        
+        // Screen test
+        int i;
+        video_start_command();
+        video_set_rop(ROP_COPY);
+        for (i = 0; i < 83; i++) {
+            draw_string(10, i * 9 + 10, bitmap, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
+        }
+        video_copy_screen(100, 100, 80, 80, 100, 100);
+        video_end_command();
+    }
+    
+    video_close();
+    return 0;
+}
-- 
1.5.4.3