../net/rfb.o \
../video/tnt2.o \
../video/fb.o \
- ../video/checksumrect.o \
+ ../video/generic.o \
../video/text.o \
drivers.o \
../lib/minilib.o \
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;
void *priv;
getvmode_t getvmode;
checksum_rect_t checksum_rect;
+ copy_pixels_t copy_pixels;
struct vmode curmode;
};
#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
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++);
+ }
+}
#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
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;
*(buf++) = (at & 0x20) ? 0xFF : 0x00;
*(buf++) = (at & 0x40) ? 0xFF : 0x00;
}
+ *(buf++) = 0;
}
}
}
#include <paging.h>
#include <text.h>
-#include "checksumrect.h"
+#include "generic.h"
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;
}