[OpenBIOS] r342 - in openbios-devel: arch/ppc/qemu arch/sparc64 config/examples include/openbios modules

svn at openbios.org svn at openbios.org
Fri Jan 2 14:32:16 CET 2009


Author: blueswirl
Date: 2009-01-02 14:32:15 +0100 (Fri, 02 Jan 2009)
New Revision: 342

Added:
   openbios-devel/include/openbios/fontdata.h
Modified:
   openbios-devel/arch/ppc/qemu/console.c
   openbios-devel/arch/sparc64/console.c
   openbios-devel/config/examples/cross-ppc_config.xml
   openbios-devel/config/examples/cross-sparc32_config.xml
   openbios-devel/config/examples/cross-sparc64_config.xml
   openbios-devel/config/examples/ppc_config.xml
   openbios-devel/config/examples/sparc32_config.xml
   openbios-devel/config/examples/sparc64_config.xml
   openbios-devel/modules/build.xml
   openbios-devel/modules/console.c
   openbios-devel/modules/font_8x16.c
   openbios-devel/modules/font_8x8.c
Log:
Clean up font handling

Modified: openbios-devel/arch/ppc/qemu/console.c
===================================================================
--- openbios-devel/arch/ppc/qemu/console.c	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/arch/ppc/qemu/console.c	2009-01-02 13:32:15 UTC (rev 342)
@@ -130,8 +130,6 @@
 	int             rb, w, h, depth;
 } osi_fb_info_t;
 
-#include "../../../modules/font_8x16.c"
-#undef FONTDATAMAX
 #include "../../../modules/video.c"
 #include "../../../modules/console.c"
 

Modified: openbios-devel/arch/sparc64/console.c
===================================================================
--- openbios-devel/arch/sparc64/console.c	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/arch/sparc64/console.c	2009-01-02 13:32:15 UTC (rev 342)
@@ -9,6 +9,7 @@
 #include "openbios/bindings.h"
 #include "openbios/kernel.h"
 #include "openbios/drivers.h"
+#include "openbios/fontdata.h"
 #include "openbios.h"
 #include "video_subr.h"
 #include "libc/vsprintf.h"
@@ -244,17 +245,14 @@
 	video_poscursor(xpos, ypos);
 }
 
-#ifdef CONFIG_DRIVER_VGA
-#include "../../modules/font_8x16.c"
-#endif
-
 void video_init(void)
 {
 	video=(unsigned char *)TEXT_BASE;
 
 #ifdef CONFIG_DRIVER_VGA
         vga_load_regs();
-        vga_font_load((unsigned char *)VGA_BASE, fontdata_8x16, 16, 256);
+        vga_font_load((unsigned char *)VGA_BASE, fontdata_8x16,
+                      FONT_HEIGHT_8X16, 256);
         vga_set_amode();
 #endif
 }

Modified: openbios-devel/config/examples/cross-ppc_config.xml
===================================================================
--- openbios-devel/config/examples/cross-ppc_config.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/config/examples/cross-ppc_config.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -32,8 +32,9 @@
   <!-- Module Configuration -->
   <option name="CONFIG_CMDLINE" type="boolean" value="true"/>
   <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
 
-
   <!-- Filesystem Configuration -->
   <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
   <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>

Modified: openbios-devel/config/examples/cross-sparc32_config.xml
===================================================================
--- openbios-devel/config/examples/cross-sparc32_config.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/config/examples/cross-sparc32_config.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -38,8 +38,9 @@
   <!-- Module Configuration -->
   <option name="CONFIG_CMDLINE" type="boolean" value="true"/>
   <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
 
-
   <!-- Filesystem Configuration -->
   <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
   <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>

Modified: openbios-devel/config/examples/cross-sparc64_config.xml
===================================================================
--- openbios-devel/config/examples/cross-sparc64_config.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/config/examples/cross-sparc64_config.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -35,8 +35,9 @@
   <!-- Module Configuration -->
   <option name="CONFIG_CMDLINE" type="boolean" value="true"/>
   <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X8" type="boolean" value="false"/>
+  <option name="CONFIG_FONT_8X16" type="boolean" value="true"/>
 
-
   <!-- Filesystem Configuration -->
   <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
   <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>

Modified: openbios-devel/config/examples/ppc_config.xml
===================================================================
--- openbios-devel/config/examples/ppc_config.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/config/examples/ppc_config.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -32,8 +32,9 @@
   <!-- Module Configuration -->
   <option name="CONFIG_CMDLINE" type="boolean" value="true"/>
   <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
 
-
   <!-- Filesystem Configuration -->
   <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
   <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>

Modified: openbios-devel/config/examples/sparc32_config.xml
===================================================================
--- openbios-devel/config/examples/sparc32_config.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/config/examples/sparc32_config.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -38,8 +38,9 @@
   <!-- Module Configuration -->
   <option name="CONFIG_CMDLINE" type="boolean" value="true"/>
   <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
 
-
   <!-- Filesystem Configuration -->
   <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
   <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>

Modified: openbios-devel/config/examples/sparc64_config.xml
===================================================================
--- openbios-devel/config/examples/sparc64_config.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/config/examples/sparc64_config.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -35,8 +35,9 @@
   <!-- Module Configuration -->
   <option name="CONFIG_CMDLINE" type="boolean" value="true"/>
   <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
+  <option name="CONFIG_FONT_8X8" type="boolean" value="false"/>
+  <option name="CONFIG_FONT_8X16" type="boolean" value="true"/>
 
-
   <!-- Filesystem Configuration -->
   <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
   <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>

Added: openbios-devel/include/openbios/fontdata.h
===================================================================
--- openbios-devel/include/openbios/fontdata.h	                        (rev 0)
+++ openbios-devel/include/openbios/fontdata.h	2009-01-02 13:32:15 UTC (rev 342)
@@ -0,0 +1,18 @@
+/* Font definitions */
+
+#ifndef OPENBIOS_FONTDATA_H
+#define OPENBIOS_FONTDATA_H
+
+#define FONTDATAMAX_8X8 2048
+#define FONT_WIDTH_8X8 8
+#define FONT_HEIGHT_8X8 8
+
+extern const unsigned char fontdata_8x8[FONTDATAMAX_8X8];
+
+#define FONTDATAMAX_8X16 4096
+#define FONT_WIDTH_8X16 8
+#define FONT_HEIGHT_8X16 16
+
+extern const unsigned char fontdata_8x16[FONTDATAMAX_8X16];
+
+#endif /* OPENBIOS_FONTDATA_H */

Modified: openbios-devel/modules/build.xml
===================================================================
--- openbios-devel/modules/build.xml	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/modules/build.xml	2009-01-02 13:32:15 UTC (rev 342)
@@ -19,6 +19,8 @@
   <object source="mac-parts.c" condition="MAC_PARTS"/>
   <object source="pc-parts.c" condition="PC_PARTS"/>
   <object source="sun-parts.c" condition="SUN_PARTS"/>
+  <object source="font_8x8.c" condition="FONT_8X8"/>
+  <object source="font_8x16.c" condition="FONT_8X16"/>
  </library>
 
  <dictionary name="openbios" target="forth">
@@ -26,5 +28,5 @@
   <object source="support.fs"/>
   <object source="helpers.fs"/>
  </dictionary>
-  
+
 </build>

Modified: openbios-devel/modules/console.c
===================================================================
--- openbios-devel/modules/console.c	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/modules/console.c	2009-01-02 13:32:15 UTC (rev 342)
@@ -14,8 +14,21 @@
 
 #include "openbios/config.h"
 #include "openbios/bindings.h"
+#include "openbios/fontdata.h"
 
-#include "font_8x8.c"
+#if !defined(fontdata)
+#if defined(CONFIG_FONT_8X8)
+#define fontdata fontdata_8x8
+#define FONT_HEIGHT FONT_HEIGHT_8X8
+#define FONT_WIDTH FONT_WIDTH_8X8
+#elif defined(CONFIG_FONT_8X16)
+#define fontdata fontdata_8x16
+#define FONT_HEIGHT FONT_HEIGHT_8X16
+#define FONT_WIDTH FONT_WIDTH_8X16
+#else
+#error no font selected
+#endif
+#endif
 
 #define FONT_ADJ_HEIGHT	 (FONT_HEIGHT + 2)
 #define NCOLS	80

Modified: openbios-devel/modules/font_8x16.c
===================================================================
--- openbios-devel/modules/font_8x16.c	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/modules/font_8x16.c	2009-01-02 13:32:15 UTC (rev 342)
@@ -7,11 +7,10 @@
  *                                            *
  **********************************************/
 
+#include "openbios/fontdata.h"
 
-#define FONTDATAMAX 4096
+const unsigned char fontdata_8x16[FONTDATAMAX_8X16] = {
 
-static const unsigned char fontdata_8x16[FONTDATAMAX] = {
-
 	/* 0 0x00 '^@' */
 	0x00, /* 00000000 */
 	0x00, /* 00000000 */

Modified: openbios-devel/modules/font_8x8.c
===================================================================
--- openbios-devel/modules/font_8x8.c	2009-01-02 07:41:40 UTC (rev 341)
+++ openbios-devel/modules/font_8x8.c	2009-01-02 13:32:15 UTC (rev 342)
@@ -4,11 +4,9 @@
 /*                                            */
 /**********************************************/
 
-#define FONTDATAMAX 2048
-#define FONT_WIDTH 8
-#define FONT_HEIGHT 8
+#include "openbios/fontdata.h"
 
-static const unsigned char fontdata[FONTDATAMAX] = {
+const unsigned char fontdata_8x8[FONTDATAMAX_8X8] = {
 
 	/* 0 0x00 '^@' */
 	0x00, /* 00000000 */




More information about the OpenBIOS mailing list