mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Clean up font handling
git-svn-id: svn://coreboot.org/openbios/openbios-devel@342 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -130,8 +130,6 @@ typedef struct osi_fb_info {
|
|||||||
int rb, w, h, depth;
|
int rb, w, h, depth;
|
||||||
} osi_fb_info_t;
|
} osi_fb_info_t;
|
||||||
|
|
||||||
#include "../../../modules/font_8x16.c"
|
|
||||||
#undef FONTDATAMAX
|
|
||||||
#include "../../../modules/video.c"
|
#include "../../../modules/video.c"
|
||||||
#include "../../../modules/console.c"
|
#include "../../../modules/console.c"
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "openbios/bindings.h"
|
#include "openbios/bindings.h"
|
||||||
#include "openbios/kernel.h"
|
#include "openbios/kernel.h"
|
||||||
#include "openbios/drivers.h"
|
#include "openbios/drivers.h"
|
||||||
|
#include "openbios/fontdata.h"
|
||||||
#include "openbios.h"
|
#include "openbios.h"
|
||||||
#include "video_subr.h"
|
#include "video_subr.h"
|
||||||
#include "libc/vsprintf.h"
|
#include "libc/vsprintf.h"
|
||||||
@@ -244,17 +245,14 @@ static void video_cls(void)
|
|||||||
video_poscursor(xpos, ypos);
|
video_poscursor(xpos, ypos);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DRIVER_VGA
|
|
||||||
#include "../../modules/font_8x16.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void video_init(void)
|
void video_init(void)
|
||||||
{
|
{
|
||||||
video=(unsigned char *)TEXT_BASE;
|
video=(unsigned char *)TEXT_BASE;
|
||||||
|
|
||||||
#ifdef CONFIG_DRIVER_VGA
|
#ifdef CONFIG_DRIVER_VGA
|
||||||
vga_load_regs();
|
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();
|
vga_set_amode();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
<!-- Module Configuration -->
|
<!-- Module Configuration -->
|
||||||
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
||||||
<option name="CONFIG_DEBLOCKER" 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 -->
|
<!-- Filesystem Configuration -->
|
||||||
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
<!-- Module Configuration -->
|
<!-- Module Configuration -->
|
||||||
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
||||||
<option name="CONFIG_DEBLOCKER" 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 -->
|
<!-- Filesystem Configuration -->
|
||||||
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
||||||
|
|||||||
@@ -35,7 +35,8 @@
|
|||||||
<!-- Module Configuration -->
|
<!-- Module Configuration -->
|
||||||
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
||||||
<option name="CONFIG_DEBLOCKER" 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 -->
|
<!-- Filesystem Configuration -->
|
||||||
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
<!-- Module Configuration -->
|
<!-- Module Configuration -->
|
||||||
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
||||||
<option name="CONFIG_DEBLOCKER" 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 -->
|
<!-- Filesystem Configuration -->
|
||||||
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
<!-- Module Configuration -->
|
<!-- Module Configuration -->
|
||||||
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
||||||
<option name="CONFIG_DEBLOCKER" 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 -->
|
<!-- Filesystem Configuration -->
|
||||||
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
||||||
|
|||||||
@@ -35,7 +35,8 @@
|
|||||||
<!-- Module Configuration -->
|
<!-- Module Configuration -->
|
||||||
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
|
||||||
<option name="CONFIG_DEBLOCKER" 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 -->
|
<!-- Filesystem Configuration -->
|
||||||
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
|
||||||
|
|||||||
18
include/openbios/fontdata.h
Normal file
18
include/openbios/fontdata.h
Normal file
@@ -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 */
|
||||||
@@ -19,6 +19,8 @@
|
|||||||
<object source="mac-parts.c" condition="MAC_PARTS"/>
|
<object source="mac-parts.c" condition="MAC_PARTS"/>
|
||||||
<object source="pc-parts.c" condition="PC_PARTS"/>
|
<object source="pc-parts.c" condition="PC_PARTS"/>
|
||||||
<object source="sun-parts.c" condition="SUN_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>
|
</library>
|
||||||
|
|
||||||
<dictionary name="openbios" target="forth">
|
<dictionary name="openbios" target="forth">
|
||||||
@@ -26,5 +28,5 @@
|
|||||||
<object source="support.fs"/>
|
<object source="support.fs"/>
|
||||||
<object source="helpers.fs"/>
|
<object source="helpers.fs"/>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -14,8 +14,21 @@
|
|||||||
|
|
||||||
#include "openbios/config.h"
|
#include "openbios/config.h"
|
||||||
#include "openbios/bindings.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 FONT_ADJ_HEIGHT (FONT_HEIGHT + 2)
|
||||||
#define NCOLS 80
|
#define NCOLS 80
|
||||||
|
|||||||
@@ -7,10 +7,9 @@
|
|||||||
* *
|
* *
|
||||||
**********************************************/
|
**********************************************/
|
||||||
|
|
||||||
|
#include "openbios/fontdata.h"
|
||||||
|
|
||||||
#define FONTDATAMAX 4096
|
const unsigned char fontdata_8x16[FONTDATAMAX_8X16] = {
|
||||||
|
|
||||||
static const unsigned char fontdata_8x16[FONTDATAMAX] = {
|
|
||||||
|
|
||||||
/* 0 0x00 '^@' */
|
/* 0 0x00 '^@' */
|
||||||
0x00, /* 00000000 */
|
0x00, /* 00000000 */
|
||||||
|
|||||||
@@ -4,11 +4,9 @@
|
|||||||
/* */
|
/* */
|
||||||
/**********************************************/
|
/**********************************************/
|
||||||
|
|
||||||
#define FONTDATAMAX 2048
|
#include "openbios/fontdata.h"
|
||||||
#define FONT_WIDTH 8
|
|
||||||
#define FONT_HEIGHT 8
|
|
||||||
|
|
||||||
static const unsigned char fontdata[FONTDATAMAX] = {
|
const unsigned char fontdata_8x8[FONTDATAMAX_8X8] = {
|
||||||
|
|
||||||
/* 0 0x00 '^@' */
|
/* 0 0x00 '^@' */
|
||||||
0x00, /* 00000000 */
|
0x00, /* 00000000 */
|
||||||
|
|||||||
Reference in New Issue
Block a user