]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Link text into copy_pixels.
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 14 Dec 2008 01:02:58 +0000 (20:02 -0500)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 14 Dec 2008 01:02:58 +0000 (20:02 -0500)
aseg-paging/Makefile
include/fb.h
include/text.h
video/generic.c [moved from video/checksumrect.c with 63% similarity]
video/generic.h [moved from video/checksumrect.h with 63% similarity]
video/text.c
video/tnt2.c

index 1eeee83eb8de2f5411eba421504b553c0b5e2c9e..6c0cd76ef15a33ea698a5a85a46c6301fa5e54c7 100644 (file)
@@ -46,7 +46,7 @@ OBJS =        ../ich2/smi.o \
        ../net/rfb.o \
        ../video/tnt2.o \
        ../video/fb.o \
-       ../video/checksumrect.o \
+       ../video/generic.o \
        ../video/text.o \
        drivers.o \
        ../lib/minilib.o \
index dd868948071b823966d2d8af260838597b51ca9e..79f05b510ab2f282775f4f695003b8b04873a75d 100644 (file)
@@ -12,6 +12,7 @@ typedef enum {
 
 typedef void (*getvmode_t)(void *);
 typedef uint32_t (*checksum_rect_t)(int x, int y, int width, int height);
+typedef void (*copy_pixels_t)(char *buf, int x, int y, int width, int height);
 
 struct vmode {
        int text:1;
@@ -25,6 +26,7 @@ struct fbdevice {
        void *priv;
        getvmode_t getvmode;
        checksum_rect_t checksum_rect;
+       copy_pixels_t copy_pixels;
        struct vmode curmode;
 };
 
index 9506d40ed9419b682303bf8313682c32f5b84a73..474e1235c2bf24caf53944e22257b79d8a343778 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdint.h>
 
 extern void text_init();
-extern void text_render(unsigned char *buf, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
+extern void text_render(char *buf, int x, int y, int w, int h);
 extern uint32_t text_checksum(int x, int y, int w, int h);
 
 #endif
similarity index 63%
rename from video/checksumrect.c
rename to video/generic.c
index f96c033ca95ceb9d27cf39d6c87ad37d37a3c20f..6168df20af5b459636f41a43c68443e2c78f052a 100644 (file)
@@ -24,3 +24,16 @@ uint32_t checksum_rect_generic32(int x, int y, int width, int height) {
         return sum;
 }
 
+void copy_pixels_generic32(char *buf, int x, int y, int width, int height)
+{
+       int cx, cy;
+       unsigned int *ibuf = (unsigned int *)buf;
+       unsigned int *fbuf;
+       for (cy = y; cy < (y + height); cy++)
+       {
+               fbuf = (unsigned int *)fb->fbaddr;
+               fbuf += y * (fb->curmode.xres) + x;
+               for (cx = x; cx < (x + width); cx++)
+                       *(ibuf++) = *(fbuf++);
+       }
+}
similarity index 63%
rename from video/checksumrect.h
rename to video/generic.h
index 8dd2a6de5b145a890b979975bcf70cde5551de81..64f2b5f3d033d7b08cf7e6a7d7ecd8fd156836d2 100644 (file)
@@ -2,5 +2,6 @@
 #define _CHECKSUM_RECT_H
 
 uint32_t checksum_rect_generic32(int x, int y, int width, int height);
+void copy_pixels_generic32(char *buf, int x, int y, int width, int height);
 
 #endif
index c9068b9794d5fae973e2b54fec2c402c5d3f3e2e..7197bad4e38fcdaba4ab92eaa398bf672cb972cf 100644 (file)
@@ -20,7 +20,7 @@ void text_init()
        outb(0x3CF, oldread);
 }
 
-void text_render(unsigned char *buf, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
+void text_render(char *buf, int x, int y, int w, int h)
 {
        unsigned char *video = p2v(0xB8000);
        unsigned int textx = x / 9;
@@ -58,6 +58,7 @@ void text_render(unsigned char *buf, unsigned int x, unsigned int y, unsigned in
                                *(buf++) = (at & 0x20) ? 0xFF : 0x00;
                                *(buf++) = (at & 0x40) ? 0xFF : 0x00;
                        }
+                       *(buf++) = 0;
                }
        }
 }
index f23a9d7d86aced6f786d0232edaf2f6d2769a299..382739370db83a4bfc607aad4b11f1c88096d104 100644 (file)
@@ -6,7 +6,7 @@
 #include <paging.h>
 #include <text.h>
 
-#include "checksumrect.h"
+#include "generic.h"
 
 static void tnt2_getvmode(void *priv);
 
@@ -31,14 +31,17 @@ static void tnt2_getvmode(void *priv)
                tnt2_fb.curmode.bytestride = 4;
                tnt2_fb.curmode.text = 0;
                tnt2_fb.checksum_rect = checksum_rect_generic32;
+               tnt2_fb.copy_pixels = copy_pixels_generic32;
                break;
        case 0:
                tnt2_fb.curmode.text = 1;
-               tnt2_fb.checksum_rect = (checksum_rect_t) text_checksum;
+               tnt2_fb.checksum_rect = text_checksum;
+               tnt2_fb.copy_pixels = text_render;
                break;
        default:
                tnt2_fb.curmode.text = 1;
-               tnt2_fb.checksum_rect = (checksum_rect_t) text_checksum;
+               tnt2_fb.checksum_rect = text_checksum;
+               tnt2_fb.copy_pixels = text_render;
                outputf("Unknown TNT2 format %x", vgard(0x28));
                break;
        }
This page took 0.033077 seconds and 4 git commands to generate.