続 jfbterm for FreeBSD

確かに動いた。んでも、VESA フレームバッファコンソールは -current には既に無いし、いつものマウスが横にしか動かない病が発生したのでパッチが必要だった。
あー、でも BS キーと DEL キーで文字消せないなぁ。環境の設定が何か必要なのかなぁ。

--- framebuffer.c.orig	2009-03-20 21:35:06.000000000 +0900
+++ framebuffer.c	2009-03-20 22:17:03.000000000 +0900
@@ -1004,8 +1004,6 @@
 #elif defined (__NetBSD__)
 	if (ioctl(self->fd, WSDISPLAYIO_GTYPE, &wsdisplay_type) == -1)
 		errx(1, "%s is not a framebuffer device.", self->device);
-	if (wsdisplay_type != WSDISPLAY_TYPE_VESA)
-		errx(1, "%s is not a framebuffer device.", self->device);
 #elif defined (__OpenBSD__)
 	if (ioctl(self->fd, WSDISPLAYIO_GTYPE, &wsdisplay_type) == -1)
 		errx(1, "%s is not a framebuffer device.", self->device);
--- mouse.c.orig	2009-03-20 21:58:23.000000000 +0900
+++ mouse.c	2009-03-20 22:06:39.000000000 +0900
@@ -49,6 +49,7 @@
 #if defined (__FreeBSD__)
 #include <sys/mouse.h>
 #elif defined (__NetBSD__) || defined (__OpenBSD__)
+#include <sys/ioctl.h>
 #include <time.h>
 #include <dev/wscons/wsconsio.h>
 #endif
@@ -561,6 +562,13 @@
 		mouse.packetSize = mousemode.packetsize;
 	}
 #endif
+#if defined (__NetBSD__) && defined(WSMOUSEIO_SETVERSION)
+	if (mouse.type == MOUSE_TYPE_WSMOUSE) {
+		int version = WSMOUSE_EVENT_VERSION;
+		if (ioctl(mouse.fd, WSMOUSEIO_SETVERSION, &version) == -1)
+			err(1, "ioctl(WSMOUSEIO_SETVERION");
+	}
+#endif
 	if (mouse.type != MOUSE_TYPE_BUSMOUSE) {
 		setBaudRate(B9600, mouse.cFlag);
 		setBaudRate(B4800, mouse.cFlag);