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

[linux-zaurus:64] Re: jfbterm rorate patch



  先に投げた patch は、8bit境界に納まらないフォントの表示が乱れるとい
う bug があったので、修正したものを添付しておきます。

<200206200136.KAA30283@xxxxxxxxxxxxxxxxxx>の記事において
私は書きました。

>>   知人が jfbterm の deb package maintainer なので状況を聞いてみると、
>> どうも既に unmaintained で、あちこちにパッチが散見されるような状態にあ
>> るようです。

  せめてパッチの収集、統合とバグ修正対応ぐらいはできないかと思い直し始
めています。
-- 
野首 貴嗣
E-mail: knok@xxxxxxxxxxxxx
	knok@xxxxxxxxxx / knok@xxxxxxxxxx

diff -ur jfbterm-0.3.10/Makefile.in jfbterm-0.3.10-lh/Makefile.in
--- jfbterm-0.3.10/Makefile.in	Mon Jun 17 14:36:34 2002
+++ jfbterm-0.3.10-lh/Makefile.in	Thu Jun 13 17:28:31 2002
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
 
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -116,7 +116,7 @@
 $(ACLOCAL_M4):  configure.in 
 	cd $(srcdir) && $(ACLOCAL)
 
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
 $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
 	cd $(srcdir) && $(AUTOCONF)
@@ -215,7 +215,7 @@
 	  awk '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
 	test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
-	  || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
 
 mostlyclean-tags:
 
diff -ur jfbterm-0.3.10/aclocal.m4 jfbterm-0.3.10-lh/aclocal.m4
--- jfbterm-0.3.10/aclocal.m4	Mon Jun 17 14:36:33 2002
+++ jfbterm-0.3.10-lh/aclocal.m4	Thu Jun 13 17:28:31 2002
@@ -1,6 +1,6 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
 
-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,7 +12,7 @@
 
 # Like AC_CONFIG_HEADER, but automatically create stamp file.
 
-AC_DEFUN([AM_CONFIG_HEADER],
+AC_DEFUN(AM_CONFIG_HEADER,
 [AC_PREREQ([2.12])
 AC_CONFIG_HEADER([$1])
 dnl When config.status generates a header, we must update the stamp-h file.
@@ -42,7 +42,7 @@
 dnl Usage:
 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
-AC_DEFUN([AM_INIT_AUTOMAKE],
+AC_DEFUN(AM_INIT_AUTOMAKE,
 [AC_REQUIRE([AC_PROG_INSTALL])
 PACKAGE=[$1]
 AC_SUBST(PACKAGE)
@@ -70,7 +70,7 @@
 # Check to make sure that the build environment is sane.
 #
 
-AC_DEFUN([AM_SANITY_CHECK],
+AC_DEFUN(AM_SANITY_CHECK,
 [AC_MSG_CHECKING([whether build environment is sane])
 # Just in case
 sleep 1
@@ -111,7 +111,7 @@
 
 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
 dnl The program must properly implement --version.
-AC_DEFUN([AM_MISSING_PROG],
+AC_DEFUN(AM_MISSING_PROG,
 [AC_MSG_CHECKING(for working $2)
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
diff -ur jfbterm-0.3.10/fbcommon.c jfbterm-0.3.10-lh/fbcommon.c
--- jfbterm-0.3.10/fbcommon.c	Mon Jun 17 14:35:23 2002
+++ jfbterm-0.3.10-lh/fbcommon.c	Tue Jun 18 13:28:02 2002
@@ -85,6 +85,15 @@
 	},
 #endif
 #if (defined(JFB_16BPP) && defined(JFB_PACKED) && defined(JFB_TRUECOLOR))
+#ifdef JFB_ROTATE
+	{	
+		16, FB_TYPE_PACKED_PIXELS, FB_VISUAL_TRUECOLOR,
+		tfbm_fill_rect_16bpp_packed_rot,
+		tfbm_overlay_16bpp_packed_rot,
+		tfbm_clear_all_16bpp_packed_rot,
+		tfbm_reverse_16bpp_packed_rot
+	},
+#else
 	{	
 		16, FB_TYPE_PACKED_PIXELS, FB_VISUAL_TRUECOLOR,
 		tfbm_fill_rect_16bpp_packed,
@@ -92,6 +101,7 @@
 		tfbm_clear_all_16bpp_packed,
 		tfbm_reverse_16bpp_packed
 	},
+#endif /* JFB_ROTATE */
 #endif
 #if (defined(JFB_16BPP) && defined(JFB_PACKED) && defined(JFB_DIRECTCOLOR))
 	{	
@@ -499,8 +509,16 @@
 	tfbm_initcolors(p, &fb_var, &fb_fix);
 
 	/* fix: scanline length is not necessarily the same as display width */
+#if !defined(JFB_ROTATE)
 	p->width = fb_var.xres;
 	p->height = fb_var.yres;
+#else
+	p->width = fb_var.yres;
+	p->height = fb_var.xres;
+#ifdef DEBUG
+	fprintf(stderr, "swap x/y axis\n");
+#endif
+#endif
 	p->bytePerLine = fb_fix.line_length;
 
 	p->soff = (u_long)(fb_fix.smem_start) & (~PAGE_MASK);
diff -ur jfbterm-0.3.10/fbdpsp.c jfbterm-0.3.10-lh/fbdpsp.c
--- jfbterm-0.3.10/fbdpsp.c	Mon Jun 17 14:35:23 2002
+++ jfbterm-0.3.10-lh/fbdpsp.c	Thu Jun 20 19:29:17 2002
@@ -301,6 +301,7 @@
 #endif /* JFBTERM_15BPP */
 
 #ifdef JFB_16BPP
+#if !defined(JFB_ROTATE)
 /* 16 bpp */
 void tfbm_fill_rect_16bpp_packed(
 	TFrameBufferMemory* p,
@@ -397,6 +398,105 @@
 		}
 	}
 }
+
+#else /* JFB_ROTATE */
+/* rotated 16 bpp */
+void tfbm_fill_rect_16bpp_packed_rot(
+	TFrameBufferMemory* p,
+	u_int sx, u_int sy, u_int lx, u_int ly, u_int color)
+{
+	u_int	x,y;
+	u_short	*d;
+	u_short icol;
+
+	icol = tfbm_select_16_color(color);
+	for (y = sy ; y < sy+ly ; y++) {
+	        d = (u_short*)(p->smem + p->bytePerLine + sx * p->bytePerLine - y * 2);
+		for(x=0;x<lx;x++){
+			*(d + p->bytePerLine * x/2) = icol;
+		}
+	}
+}
+
+void tfbm_clear_all_16bpp_packed_rot(
+	TFrameBufferMemory* p, u_int color)
+{
+	u_int lp;
+	u_short	*d=(u_short*)(p->smem);
+	u_short icol;
+
+	icol = tfbm_select_16_color(color);
+	for(lp=0;lp<((p->slen)/2);lp++){
+		d[lp]=icol;
+	}
+}
+
+void tfbm_overlay_16bpp_packed_rot(
+	TFrameBufferMemory* p,
+	u_int xd, u_int yd,
+	const u_char* ps, u_int lx, u_int ly, u_int gap, u_int color)
+{
+	u_int y;
+	u_short* wp;
+	const u_char* tps;
+	u_int i;
+	u_int sb;
+	u_short icol;
+
+	icol = tfbm_select_16_color(color);
+	for (y = yd ; y < yd+ly ; y++) {
+		tps = ps;
+		wp = (u_short*)(p->smem + p->bytePerLine + xd * p->bytePerLine - y * 2);
+		for (i = lx ; i >= 8 ; i -= 8) {
+			sb = *tps++;
+			if (sb & 0x80) *wp = icol;
+			if (sb & 0x40) *(wp + p->bytePerLine * 1/2) = icol;
+			if (sb & 0x20) *(wp + p->bytePerLine * 2/2) = icol;
+			if (sb & 0x10) *(wp + p->bytePerLine * 3/2) = icol;
+			if (sb & 0x08) *(wp + p->bytePerLine * 4/2) = icol;
+			if (sb & 0x04) *(wp + p->bytePerLine * 5/2) = icol;
+			if (sb & 0x02) *(wp + p->bytePerLine * 6/2) = icol;
+			if (sb & 0x01) *(wp + p->bytePerLine * 7/2) = icol;
+			wp += p->bytePerLine * 8/2;
+		}
+		if (i) {
+			sb = *tps++;
+			switch (i) {
+			case 7:	if (sb & 0x02) *(wp + p->bytePerLine * 6/2) = icol;
+			case 6:	if (sb & 0x04) *(wp + p->bytePerLine * 5/2) = icol;
+			case 5:	if (sb & 0x08) *(wp + p->bytePerLine * 4/2) = icol;
+			case 4:	if (sb & 0x10) *(wp + p->bytePerLine * 3/2) = icol;
+			case 3:	if (sb & 0x20) *(wp + p->bytePerLine * 2/2) = icol;
+			case 2:	if (sb & 0x40) *(wp + p->bytePerLine * 1/2) = icol;
+			case 1:	if (sb & 0x80) *(wp + p->bytePerLine * 0) = icol;
+			}
+		}
+		ps += gap;
+	}
+}
+
+#ifndef min
+#  define min(a, b)	(((a) > (b))?(b):(a))
+#endif
+
+void tfbm_reverse_16bpp_packed_rot(
+	TFrameBufferMemory* p,
+	u_int sx, u_int sy, u_int lx, u_int ly, u_int color)
+{
+	u_int x,y;
+	u_short	*d;
+	u_short icol;
+
+	icol = tfbm_select_16_color(color);
+	for (y = sy ; y < min(sy+ly, p->height) ; y++) {
+	    d = (u_short*)(p->smem + p->bytePerLine + sx * p->bytePerLine - y * 2);
+		for (x = 0 ; x < lx ; x++) {
+			*(d + p->bytePerLine * x/2) ^= icol;
+		}
+	}
+}
+#endif /* JFB_ROTATE */
+
 #endif /* JFB_16BPP */
 
 #ifdef JFB_24BPP
diff -ur jfbterm-0.3.10/fbdpsp.h jfbterm-0.3.10-lh/fbdpsp.h
--- jfbterm-0.3.10/fbdpsp.h	Mon Oct 18 07:16:47 1999
+++ jfbterm-0.3.10-lh/fbdpsp.h	Fri Jun 14 19:15:42 2002
@@ -72,6 +72,20 @@
 #endif /* JFB_15BPP */
 
 #ifdef JFB_16BPP
+#ifdef JFB_ROTATE
+void tfbm_fill_rect_16bpp_packed_rot(
+	TFrameBufferMemory* p,
+	u_int sx, u_int sy, u_int lx, u_int ly, u_int color);
+void tfbm_overlay_16bpp_packed_rot(
+	TFrameBufferMemory* p,
+	u_int xd, u_int yd,
+	const u_char* ps, u_int lx, u_int ly, u_int gap, u_int color);
+void tfbm_clear_all_16bpp_packed_rot(
+	struct Raw_TFrameBufferMemory* p, u_int color);
+void tfbm_reverse_16bpp_packed_rot(
+	TFrameBufferMemory* p,
+	u_int sx, u_int sy, u_int lx, u_int ly, u_int color);
+#else
 void tfbm_fill_rect_16bpp_packed(
 	TFrameBufferMemory* p,
 	u_int sx, u_int sy, u_int lx, u_int ly, u_int color);
@@ -84,6 +98,7 @@
 void tfbm_reverse_16bpp_packed(
 	TFrameBufferMemory* p,
 	u_int sx, u_int sy, u_int lx, u_int ly, u_int color);
+#endif /* JFB_ROTATE */
 #endif /* JFB_16BPP */
 
 #ifdef JFB_24BPP

--
ML: linux-zaurus@xxxxxxxxxxx
使い方: http://QuickML.com/