From e465a280b562cf0ed4ab136e240437f6574189f8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 30 Dec 2010 05:04:04 +0100 Subject: old Virtual OSC Controller project exported from SVN working copy unfortunately the repository is long gone, so is its history working and tested for: * POSIX/gcc (Linux, Windows Cygwin, OS/2 EMX) * Open Watcom C (native OS/2 and Windows) --- src/biosfont.h.cpp | 750 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 750 insertions(+) create mode 100644 src/biosfont.h.cpp (limited to 'src/biosfont.h.cpp') diff --git a/src/biosfont.h.cpp b/src/biosfont.h.cpp new file mode 100644 index 0000000..fc97ea6 --- /dev/null +++ b/src/biosfont.h.cpp @@ -0,0 +1,750 @@ +/*****************************************************************************/ +/// @file biosfont.h.cpp with "modified BSD license" +/// @author Jonathan D. Lettvin (jlettvin|gmail|com) Apr 5 2008 +/* +* Copyright (c) 2008, Jonathan D. Lettvin +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of Jonathan Lettvin Consulting nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY JONATHAN D. LETTVIN ''AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL JONATHAN D. LETTVIN BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/// @brief (http://en.wikipedia.org/wiki/BSD_license) +/*****************************************************************************/ +/// @brief Usage and example compilations: +/// Include this file in other source code: +/// /// #define BIOSFONT_STATICS /// In one compilation unit. +/// #include "biosfont.h.cpp" +/// Example of autonomous unit test compilation and execution. +/// g++ -Wall -W4 -O4 -DBIOSFONT_UNIT_TEST biosfont biosfont.h.cpp +/// strip biosfont +/// ./biosfont +/// This code also compiles in ordinary C (by eliminating namespacing). +/// gcc -Wall -W4 -O4 -DBIOSFONT_UNIT_TEST biosfont biosfont.h.cpp +/*****************************************************************************/ +/// @brief Purpose: This file provides an absolute bitmapped graphics font. +/// This is a (slightly adjusted) iAPX86 ROM BIOS font. +/// This font supports ASCII codes 00H-FFH. +/// This code is invariant to endian issues. +/// No external resources, libraries, or calls are needed or used. +/// EBCDIC and other encodings are not supported. +/*****************************************************************************/ +/// @brief File naming convention: (why *.h.cpp?) +/// Managing multiple source files can be cumbersome. +/// Files implementing very simple tables and code can be +/// entirely autonomous, making distribution/integration easy: +/// This file can be used as a pure header. +/// There is no restriction on including .cpp files as headers. +/// Using a .cpp extension enables direct unit test compilation. +/// Naming it .h.cpp is sufficiently unique to be recognized. +/// I offer this naming style for headers with built-in unit testing. +/*****************************************************************************/ +/// @brief Organization: +/// This files shows a sample debug font acquisition. +/// This is followed by the magnified font. +/// This is followed by the font bitmap value table. +/// This is followed by an inline font bit accessor function. +/// This is followed by unit test functions and a main function. +/*****************************************************************************/ +/// @brief Size and Technical details: +/// 256 8 x 8 bit glyphs fit into 64 bits each for a +/// memory footprint of 2KBytes both here and in BIOS. +/// Compiled unit test size including main and runtime libraries: +/// 9,216 Windows XP with gcc version 3.4.5 (mingw special) +/// Bits start at the upper left and end at the lower right. +/// US English BIOS provides ASCII 0-127 at F000:FA6E and +/// extension codes 128-255 at the address stored in 0000:007C. +/// Note: the bits of each byte have been swapped end-to-end +/// (i.e. 000100111 becomes 111001000). +/// This reduces reconstruction complexity. +/*****************************************************************************/ +/// @brief How the iAPX86 ROM BIOS font was copied. +/// Early IBM PCs provided fonts burned into ROM. +/// (http://en.wikipedia.org/wiki/Color_Graphics_Adapter) +/// The following web-page is useful for DEBUG novitiates. +/// (http://mirror.href.com/thestarman/asm/debug/debug2.htm) +/// Data was acquired by the following DOS operation. +/*****************************************************************************/ +/*This is both user input and debug output. +C:\>DEBUG ;Start debug from a command prompt +-N lower ;Prompted by '-', Name the outut file +-R CX ;Request to change the byte count +CX 0000 ;Currently it is 0 +:400 ;You set it to 400H (1024) +-RBX ;Make sure this is zero +BX 0000 ;Currently it is 0 +:0000 ;You set it to 0H (0) +W F000:FA6E ;Write that many bytes to named file +Writing 00400 bytes;Debug tells you what it did +-N upper ;Name a second output file +-D 0000:007C L 4 ;Get contents of INT 1F +0000:0070 34 30 00 C0 +W C000:3034 ;Reverse order the bytes +Writing 00400 bytes +-Q ;Quit because you're done +C:\> + */ +/*****************************************************************************/ +/// The BIOS font appearance (magnified): +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | ****** | ****** | ** ** | * | *** | | | +//| |* *|********|******* | *** | ***** | * | | +//| |* * * *|** ** **|******* | ***** | *** | *** | ** | +//| |* *|********|******* |******* |******* | ***** | **** | +//| |* **** *|** **| ***** | ***** |******* |******* | **** | +//| |* ** *|*** ***| *** | *** |* * * | ***** | ** | +//| |* *|********| * | * | * | *** | | +//| | ****** | ****** | | | ***** | ***** | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|********| |********| ****| **** | ******| *******|* ** *| +//|********| **** |** **| ***| ** ** | ** **| ** **| * ** * | +//|*** ***| ** ** |* ** *| ****| ** ** | ******| *******| **** | +//|** **| * * |* **** *| ***** *| ** ** | ** | ** **|*** ***| +//|** **| * * |* **** *|** ** | **** | ** | ** **|*** ***| +//|*** ***| ** ** |* ** *|** ** | ** | *** | ** ***| **** | +//|********| **** |** **|** ** | ****** |**** |*** ** | * ** * | +//|********| |********| **** | ** |*** |** |* ** *| +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|* | * | ** | ** ** | *******| ***** | | ** | +//|*** | *** | **** | ** ** |** ** **| ** **| | **** | +//|***** | ***** | ****** | ** ** |** ** **| *** | | ****** | +//|******* |******* | ** | ** ** | **** **| ** ** | | ** | +//|***** | ***** | ** | ** ** | ** **| ** ** | ****** | ****** | +//|*** | *** | ****** | | ** **| *** | ****** | **** | +//|* | * | **** | ** ** | ** **|* ** | ****** | ** | +//| | | ** | | |****** | |********| +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** | ** | | | | | | | +//| **** | ** | ** | ** | | * * | ** |********| +//| ****** | ** | ** | ** |** | ** ** | **** |********| +//| ** | ** |******* |******* |** |********| ****** | ****** | +//| ** | ****** | ** | ** |** | ** ** |********| **** | +//| ** | **** | ** | ** |******* | * * |********| ** | +//| ** | ** | | | | | | | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | ** | ** ** | ** ** | ** | | *** | ** | +//| | **** | ** ** | ** ** | ****** |** ** | ** ** | ** | +//| | **** | ** ** |******* |** |** ** | *** | ** | +//| | ** | | ** ** | ***** | ** | *** ** | | +//| | ** | |******* | ** | ** |** *** | | +//| | | | ** ** |****** | ** ** |** ** | | +//| | ** | | ** ** | ** |** ** | *** ** | | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** | ** | | | | | | ** | +//| ** | ** | ** ** | ** | | | | ** | +//| ** | ** | **** | ** | | | | ** | +//| ** | ** |********| ****** | | ****** | | ** | +//| ** | ** | **** | ** | | | | ** | +//| ** | ** | ** ** | ** | ** | | ** |** | +//| ** | ** | | | ** | | ** |* | +//| | | | | ** | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ***** | ** | **** | **** | *** |****** | *** |****** | +//|** *** | *** |** ** |** ** | **** |** | ** |** ** | +//|** **** | ** | ** | ** | ** ** |***** |** | ** | +//|**** ** | ** | *** | *** |** ** | ** |***** | ** | +//|*** ** | ** | ** | ** |******* | ** |** ** | ** | +//|** ** | ** |** ** |** ** | ** |** ** |** ** | ** | +//| ***** |****** |****** | **** | **** | **** | **** | ** | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| **** | **** | | | ** | | ** | **** | +//|** ** |** ** | ** | ** | ** | | ** | ** ** | +//|** ** |** ** | ** | ** | ** | ****** | ** | ** | +//| **** | ***** | | |** | | ** | ** | +//|** ** | ** | | | ** | ****** | ** | ** | +//|** ** | ** | ** | ** | ** | | ** | | +//| **** | *** | ** | ** | ** | | ** | ** | +//| | | | ** | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ***** | ** |****** | **** |***** |******* |******* | **** | +//|** ** | **** | ** ** | ** ** | ** ** | ** * | ** * | ** ** | +//|** **** |** ** | ** ** |** | ** ** | ** * | ** * |** | +//|** **** |** ** | ***** |** | ** ** | **** | **** |** | +//|** *** |****** | ** ** |** | ** ** | ** * | ** * |** *** | +//|** |** ** | ** ** | ** ** | ** ** | ** * | ** | ** ** | +//| ***** |** ** |****** | **** |***** |******* |**** | *** * | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|** ** | **** | **** |*** ** |**** |** ** |** ** | *** | +//|** ** | ** | ** | ** ** | ** |*** *** |*** ** | ** ** | +//|** ** | ** | ** | ** ** | ** |******* |**** ** |** ** | +//|****** | ** | ** | **** | ** |******* |** **** |** ** | +//|** ** | ** |** ** | ** ** | ** * |** * ** |** *** |** ** | +//|** ** | ** |** ** | ** ** | ** ** |** ** |** ** | ** ** | +//|** ** | **** | **** |*** ** |******* |** ** |** ** | *** | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|****** | ***** |****** | ***** |****** |** ** |** ** |** ** | +//| ** ** |** ** | ** ** |** ** |* ** * |** ** |** ** |** ** | +//| ** ** |** ** | ** ** |*** | ** |** ** |** ** |** ** | +//| ***** |** ** | ***** | **** | ** |** ** |** ** |** ** | +//| ** |** * ** | ** ** | *** | ** |** ** |** ** |** * ** | +//| ** | ***** | ** ** |** ** | ** |** ** | **** |******* | +//|**** | *** |*** ** | ***** | **** |****** | ** | ** ** | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|** ** |** ** |******* | **** |** | **** | * | | +//|** ** |** ** |** ** | ** | ** | ** | *** | | +//| ** ** |** ** |* ** | ** | ** | ** | ** ** | | +//| *** | **** | ** | ** | ** | ** |** ** | | +//| ** ** | ** | ** * | ** | ** | ** | | | +//|** ** | ** | ** ** | ** | ** | ** | | | +//|** ** | **** |******* | **** | * | **** | | | +//| | | | | | | |********| +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** | |*** | | *** | | *** | | +//| ** | | ** | | ** | | ** ** | | +//| ** | **** | ** | **** | ** | **** | ** * | *** ** | +//| | ** | ***** |** ** | ***** |** ** |**** |** ** | +//| | ***** | ** ** |** |** ** |****** | ** |** ** | +//| |** ** | ** ** |** ** |** ** |** | ** | ***** | +//| | *** ** |** *** | **** | *** ** | **** |**** | ** | +//| | | | | | | |***** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|*** | ** | ** |*** | *** | | | | +//| ** | | | ** | ** | | | | +//| ** ** | *** | *** | ** ** | ** |** ** |* *** | **** | +//| *** ** | ** | ** | ** ** | ** |******* |** ** |** ** | +//| ** ** | ** | ** | **** | ** |******* |** ** |** ** | +//| ** ** | ** |** ** | ** ** | ** |** * ** |** ** |** ** | +//|*** ** | **** |** ** |*** ** | **** |** * ** |** ** | **** | +//| | | **** | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | | | | * | | | | +//| | | | | ** | | | | +//|** *** | *** ** |** *** | ***** |****** |** ** |** ** |** ** | +//| ** ** |** ** | *** ** |** | ** |** ** |** ** |** ** | +//| ** ** |** ** | ** * | *** | ** |** ** |** ** |** * ** | +//| ***** | ***** | ** | *** | ** * |** ** | **** |******* | +//| ** | ** |**** |***** | ** | *** ** | ** | ** ** | +//|**** | **** | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | | | *** | ** |*** | *** ** | | +//| | | | ** | ** | ** |** *** | * | +//|** ** |** ** |****** | ** | ** | ** | | *** | +//| ** ** |** ** |* ** |*** | | *** | | ** ** | +//| *** |** ** | ** | ** | ** | ** | |** ** | +//| ** ** | ***** | ** * | ** | ** | ** | |** ** | +//|** ** | ** |****** | *** | ** |*** | |******* | +//| |***** | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| **** | | *** | ****** |** ** |*** | ** | | +//|** ** |** ** | |** **| | | ** | | +//|** | | **** | **** | **** | **** | **** | **** | +//|** ** |** ** |** ** | ** | ** | ** | ** |** | +//| **** |** ** |****** | ***** | ***** | ***** | ***** |** | +//| ** |** ** |** | ** ** |** ** |** ** |** ** | **** | +//| ** | ****** | **** | ******| ****** | ****** | ****** | ** | +//| **** | | | | | | | *** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ****** |** ** |*** |** ** | ***** |*** |** ** | ** | +//|** **| | | |** ** | | *** | ** | +//| **** | **** | **** | *** | *** | *** | ** ** | | +//| ** ** |** ** |** ** | ** | ** | ** |** ** | **** | +//| ****** |****** |****** | ** | ** | ** |******* |** ** | +//| ** |** |** | ** | ** | ** |** ** |****** | +//| **** | **** | **** | **** | **** | **** |** ** |** ** | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| *** | | ***** | **** | | | **** | | +//| | | ** ** |** ** |** ** |*** |** ** |*** | +//|****** | *******|** ** | | | | | | +//| ** | ** |******* | **** | **** | **** |** ** |** ** | +//| **** | *******|** ** |** ** |** ** |** ** |** ** |** ** | +//| ** |** ** |** ** |** ** |** ** |** ** |** ** |** ** | +//|****** | *******|** *** | **** | **** | **** | ****** | ****** | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| |** **|** ** | ** | *** |** ** |***** | *** | +//|** ** | ** | | ** | ** ** |** ** |** ** | ** **| +//| | **** |** ** | ****** | ** * | **** |** ** | ** | +//|** ** | ** ** |** ** |** |**** |****** |***** * | **** | +//|** ** | ** ** |** ** |** | ** | ** |** ** | ** | +//| ***** | **** |** ** | ****** |*** ** |****** |** ****| ** | +//| ** | ** | **** | ** |****** | ** |** ** |** ** | +//|***** | | | ** | | ** |** ***| *** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| *** | *** | | | |****** | **** | *** | +//| | | *** | *** |***** | | ** ** | ** ** | +//| **** | *** | | | |** ** | ** ** | ** ** | +//| ** | ** | **** |** ** |***** |*** ** | ***** | *** | +//| ***** | ** |** ** |** ** |** ** |****** | | | +//|** ** | ** |** ** |** ** |** ** |** *** | ****** | ***** | +//| ****** | **** | **** | ****** |** ** |** ** | | | +//| | | | | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** | | |** **|** **| ** | | | +//| | | |** ** |** ** | ** | ** **|** ** | +//| ** | | |** ** |** ** | | ** ** | ** ** | +//| ** |****** |****** |** **** |** ** **| ** |** ** | ** **| +//|** |** | ** | ** **| ** ***| ** | ** ** | ** ** | +//|** ** |** | ** | ** ** | ** ****| ** | ** **|** ** | +//| **** | | |** ** |** ****| ** | | | +//| | | | ****| **| | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| * * | * * * *|** ** **| ** | ** | ** | ** ** | | +//|* * |* * * * | *** ***| ** | ** | ** | ** ** | | +//| * * | * * * *|** ** **| ** | ** |***** | ** ** | | +//|* * |* * * * |*** *** | ** | ** | ** | ** ** | | +//| * * | * * * *|** ** **| ** |***** |***** |**** ** |******* | +//|* * |* * * * | *** ***| ** | ** | ** | ** ** | ** ** | +//| * * | * * * *|** ** **| ** | ** | ** | ** ** | ** ** | +//|* * |* * * * |*** *** | ** | ** | ** | ** ** | ** ** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | ** ** | ** ** | | ** ** | ** ** | ** | | +//| | ** ** | ** ** | | ** ** | ** ** | ** | | +//|***** |**** ** | ** ** |******* |**** ** | ** ** |***** | | +//| ** | ** | ** ** | ** | ** | ** ** | ** | | +//|***** |**** ** | ** ** |**** ** |******* |******* |***** |***** | +//| ** | ** ** | ** ** | ** ** | | | | ** | +//| ** | ** ** | ** ** | ** ** | | | | ** | +//| ** | ** ** | ** ** | ** ** | | | | ** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** | ** | | ** | | ** | ** | ** ** | +//| ** | ** | | ** | | ** | ** | ** ** | +//| ** | ** | | ** | | ** | *****| ** ** | +//| ** | ** | | ** | | ** | ** | ** ** | +//| *****|********|********| *****|********|********| *****| ** ***| +//| | | ** | ** | | ** | ** | ** ** | +//| | | ** | ** | | ** | ** | ** ** | +//| | | ** | ** | | ** | ** | ** ** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** ** | | ** ** | | ** ** | | ** ** | ** | +//| ** ** | | ** ** | | ** ** | | ** ** | ** | +//| ** ***| ******|**** ***|********| ** ***|********|**** ***|********| +//| ** | ** | | | ** | | | | +//| ******| ** ***|********|**** ***| ** ***|********|**** ***|********| +//| | ** ** | | ** ** | ** ** | | ** ** | | +//| | ** ** | | ** ** | ** ** | | ** ** | | +//| | ** ** | | ** ** | ** ** | | ** ** | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** ** | | | ** ** | ** | | | ** ** | +//| ** ** | | | ** ** | ** | | | ** ** | +//| ** ** |********| | ** ** | *****| *****| | ** ** | +//| ** ** | | | ** ** | ** | ** | | ** ** | +//|********|********|********| ******| *****| *****| ******|********| +//| | ** | ** ** | | | ** | ** ** | ** ** | +//| | ** | ** ** | | | ** | ** ** | ** ** | +//| | ** | ** ** | | | ** | ** ** | ** ** | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| ** | ** | |********| |**** | ****|********| +//| ** | ** | |********| |**** | ****|********| +//|********| ** | |********| |**** | ****|********| +//| ** | ** | |********| |**** | ****|********| +//|********|***** | *****|********|********|**** | ****| | +//| ** | | ** |********|********|**** | ****| | +//| ** | | ** |********|********|**** | ****| | +//| ** | | ** |********|********|**** | ****| | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | | | |****** | | | | +//| | **** |****** |******* |** ** | | ** ** | *** ** | +//| *** ** |** ** |** ** | ** ** | ** | ****** | ** ** |** *** | +//|** *** |***** |** | ** ** | ** |** ** | ** ** | ** | +//|** * |** ** |** | ** ** | ** |** ** | ** ** | ** | +//|** *** |***** |** | ** ** |** ** |** ** | ***** | ** | +//| *** ** |** |** | ** ** |****** | *** | ** | ** | +//| |** | | | | |** | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//|****** | *** | *** | *** | | ** | *** | **** | +//| ** | ** ** | ** ** | ** | | ** | ** |** ** | +//| **** |** ** |** ** | ** | ****** | ****** |** |** ** | +//|** ** |******* |** ** | ***** |** ** **|** ** **|***** |** ** | +//|** ** |** ** | ** ** |** ** |** ** **|** ** **|** |** ** | +//| **** | ** ** | ** ** |** ** | ****** | ****** | ** |** ** | +//| ** | *** |*** *** | **** | | ** | *** |** ** | +//|****** | | | | |** | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| | ** | ** | ** | *** | ** | ** | | +//|****** | ** | ** | ** | ** **| ** | ** | *** ** | +//| |****** | ** | ** | ** **| ** | |** *** | +//|****** | ** | ** | ** | ** | ** |****** | | +//| | ** | ** | ** | ** | ** | | *** ** | +//|****** | | | | ** |** ** | ** |** *** | +//| |****** |****** |****** | ** |** ** | ** | | +//| | | | | ** | *** | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +//| *** | | | ****| **** | *** | | | +//| ** ** | | | ** | ** ** | ** | | | +//| ** ** | | | ** | ** ** | ** | **** | | +//| *** | ** | | ** | ** ** | ** | **** | | +//| | ** | ** |*** ** | ** ** | **** | **** | | +//| | | | ** ** | | | **** | | +//| | | | **** | | | | | +//| | | | *** | | | | | +//+--------+--------+--------+--------+--------+--------+--------+--------+ +/*****************************************************************************/ +#ifndef BIOSFONT_H +#define BIOSFONT_H +/*****************************************************************************/ +#ifdef BIOSFONT_UNIT_TEST +#define BIOSFONT_STATIC +#endif//BIOSFONT_UNIT_TEST +/*****************************************************************************/ +#ifdef __cplusplus +namespace BIOSfont { +#endif//__cplusplus +#ifdef BIOSFONT_STATIC + static const unsigned char bytes[ 256 ][ 8 ] = { + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} ///< character 0x00 | ^@| + ,{0x7e,0x81,0xa5,0x81,0xbd,0x99,0x81,0x7e} ///< character 0x01 | ^A| + ,{0x7e,0xff,0xdb,0xff,0xc3,0xe7,0xff,0x7e} ///< character 0x02 | ^B| + ,{0x36,0x7f,0x7f,0x7f,0x3e,0x1c,0x08,0x00} ///< character 0x03 | ^C| + ,{0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x08,0x00} ///< character 0x04 | ^D| + ,{0x1c,0x3e,0x1c,0x7f,0x7f,0x49,0x08,0x3e} ///< character 0x05 | ^E| + ,{0x00,0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x3e} ///< character 0x06 | ^F| + ,{0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00} ///< character 0x07 | ^G| + ,{0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff} ///< character 0x08 | ^H| + ,{0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00} ///< character 0x09 | ^I| + ,{0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff} ///< character 0x0a | ^J| + ,{0xf0,0xe0,0xf0,0xbe,0x33,0x33,0x33,0x1e} ///< character 0x0b | ^K| + ,{0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18} ///< character 0x0c | ^L| + ,{0xfc,0xcc,0xfc,0x0c,0x0c,0x0e,0x0f,0x07} ///< character 0x0d | ^M| + ,{0xfe,0xc6,0xfe,0xc6,0xc6,0xe6,0x67,0x03} ///< character 0x0e | ^N| + ,{0x99,0x5a,0x3c,0xe7,0xe7,0x3c,0x5a,0x99} ///< character 0x0f | ^O| + ,{0x01,0x07,0x1f,0x7f,0x1f,0x07,0x01,0x00} ///< character 0x10 | ^P| + ,{0x40,0x70,0x7c,0x7f,0x7c,0x70,0x40,0x00} ///< character 0x11 | ^Q| + ,{0x18,0x3c,0x7e,0x18,0x18,0x7e,0x3c,0x18} ///< character 0x12 | ^R| + ,{0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x00} ///< character 0x13 | ^S| + ,{0xfe,0xdb,0xdb,0xde,0xd8,0xd8,0xd8,0x00} ///< character 0x14 | ^T| + ,{0x7c,0xc6,0x1c,0x36,0x36,0x1c,0x61,0x3f} ///< character 0x15 | ^U| + ,{0x00,0x00,0x00,0x00,0x7e,0x7e,0x7e,0x00} ///< character 0x16 | ^V| + ,{0x18,0x3c,0x7e,0x18,0x7e,0x3c,0x18,0xff} ///< character 0x17 | ^W| + ,{0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x00} ///< character 0x18 | ^X| + ,{0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00} ///< character 0x19 | ^Y| + ,{0x00,0x18,0x30,0x7f,0x30,0x18,0x00,0x00} ///< character 0x1a | ^Z| + ,{0x00,0x0c,0x06,0x7f,0x06,0x0c,0x00,0x00} ///< character 0x1b | ^[| + ,{0x00,0x00,0x03,0x03,0x03,0x7f,0x00,0x00} ///< character 0x1c | ^\| + ,{0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00} ///< character 0x1d | ^]| + ,{0x00,0x18,0x3c,0x7e,0xff,0xff,0x00,0x00} ///< character 0x1e | ^^| + ,{0x00,0xff,0xff,0x7e,0x3c,0x18,0x00,0x00} ///< character 0x1f | ^_| + ,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} ///< character 0x20 | | + ,{0x18,0x3c,0x3c,0x18,0x18,0x00,0x18,0x00} ///< character 0x21 | !| + ,{0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00} ///< character 0x22 | "| + ,{0x36,0x36,0x7f,0x36,0x7f,0x36,0x36,0x00} ///< character 0x23 | #| + ,{0x18,0x7e,0x03,0x3e,0x60,0x3f,0x18,0x00} ///< character 0x24 | $| + ,{0x00,0x63,0x33,0x18,0x0c,0x66,0x63,0x00} ///< character 0x25 | %| + ,{0x1c,0x36,0x1c,0x6e,0x3b,0x33,0x6e,0x00} ///< character 0x26 | &| + ,{0x0c,0x0c,0x06,0x00,0x00,0x00,0x00,0x00} ///< character 0x27 | '| + ,{0x18,0x0c,0x06,0x06,0x06,0x0c,0x18,0x00} ///< character 0x28 | (| + ,{0x06,0x0c,0x18,0x18,0x18,0x0c,0x06,0x00} ///< character 0x29 | )| + ,{0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00} ///< character 0x2a | *| + ,{0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00} ///< character 0x2b | +| + ,{0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x0c} ///< character 0x2c | ,| + ,{0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00} ///< character 0x2d | -| + ,{0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00} ///< character 0x2e | .| + ,{0x60,0x30,0x18,0x0c,0x06,0x03,0x01,0x00} ///< character 0x2f | /| + ,{0x3e,0x73,0x7b,0x6f,0x67,0x63,0x3e,0x00} ///< character 0x30 | 0| + ,{0x0c,0x0e,0x0c,0x0c,0x0c,0x0c,0x3f,0x00} ///< character 0x31 | 1| + ,{0x1e,0x33,0x30,0x1c,0x06,0x33,0x3f,0x00} ///< character 0x32 | 2| + ,{0x1e,0x33,0x30,0x1c,0x30,0x33,0x1e,0x00} ///< character 0x33 | 3| + ,{0x38,0x3c,0x36,0x33,0x7f,0x30,0x78,0x00} ///< character 0x34 | 4| + ,{0x3f,0x03,0x1f,0x30,0x30,0x33,0x1e,0x00} ///< character 0x35 | 5| + ,{0x1c,0x06,0x03,0x1f,0x33,0x33,0x1e,0x00} ///< character 0x36 | 6| + ,{0x3f,0x33,0x30,0x18,0x0c,0x0c,0x0c,0x00} ///< character 0x37 | 7| + ,{0x1e,0x33,0x33,0x1e,0x33,0x33,0x1e,0x00} ///< character 0x38 | 8| + ,{0x1e,0x33,0x33,0x3e,0x30,0x18,0x0e,0x00} ///< character 0x39 | 9| + ,{0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00} ///< character 0x3a | :| + ,{0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x0c} ///< character 0x3b | ;| + ,{0x18,0x0c,0x06,0x03,0x06,0x0c,0x18,0x00} ///< character 0x3c | <| + ,{0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00} ///< character 0x3d | =| + ,{0x06,0x0c,0x18,0x30,0x18,0x0c,0x06,0x00} ///< character 0x3e | >| + ,{0x3c,0x66,0x30,0x18,0x18,0x00,0x18,0x00} ///< character 0x3f | ?| + ,{0x3e,0x63,0x7b,0x7b,0x3b,0x03,0x3e,0x00} ///< character 0x40 | @| + ,{0x0c,0x1e,0x33,0x33,0x3f,0x33,0x33,0x00} ///< character 0x41 | A| + ,{0x3f,0x66,0x66,0x3e,0x66,0x66,0x3f,0x00} ///< character 0x42 | B| + ,{0x3c,0x66,0x03,0x03,0x03,0x66,0x3c,0x00} ///< character 0x43 | C| + ,{0x1f,0x36,0x66,0x66,0x66,0x36,0x1f,0x00} ///< character 0x44 | D| + ,{0x7f,0x46,0x16,0x1e,0x16,0x46,0x7f,0x00} ///< character 0x45 | E| + ,{0x7f,0x46,0x16,0x1e,0x16,0x06,0x0f,0x00} ///< character 0x46 | F| + ,{0x3c,0x66,0x03,0x03,0x73,0x66,0x5c,0x00} ///< character 0x47 | G| + ,{0x33,0x33,0x33,0x3f,0x33,0x33,0x33,0x00} ///< character 0x48 | H| + ,{0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0x49 | I| + ,{0x78,0x30,0x30,0x30,0x33,0x33,0x1e,0x00} ///< character 0x4a | J| + ,{0x67,0x66,0x36,0x1e,0x36,0x66,0x67,0x00} ///< character 0x4b | K| + ,{0x0f,0x06,0x06,0x06,0x46,0x66,0x7f,0x00} ///< character 0x4c | L| + ,{0x63,0x77,0x7f,0x7f,0x6b,0x63,0x63,0x00} ///< character 0x4d | M| + ,{0x63,0x67,0x6f,0x7b,0x73,0x63,0x63,0x00} ///< character 0x4e | N| + ,{0x1c,0x36,0x63,0x63,0x63,0x36,0x1c,0x00} ///< character 0x4f | O| + ,{0x3f,0x66,0x66,0x3e,0x06,0x06,0x0f,0x00} ///< character 0x50 | P| + ,{0x3e,0x63,0x63,0x63,0x6b,0x3e,0x70,0x00} ///< character 0x51 | Q| + ,{0x3f,0x66,0x66,0x3e,0x36,0x66,0x67,0x00} ///< character 0x52 | R| + ,{0x3e,0x63,0x07,0x1e,0x70,0x63,0x3e,0x00} ///< character 0x53 | S| + ,{0x3f,0x2d,0x0c,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0x54 | T| + ,{0x33,0x33,0x33,0x33,0x33,0x33,0x3f,0x00} ///< character 0x55 | U| + ,{0x33,0x33,0x33,0x33,0x33,0x1e,0x0c,0x00} ///< character 0x56 | V| + ,{0x63,0x63,0x63,0x63,0x6b,0x7f,0x36,0x00} ///< character 0x57 | W| + ,{0x63,0x63,0x36,0x1c,0x36,0x63,0x63,0x00} ///< character 0x58 | X| + ,{0x33,0x33,0x33,0x1e,0x0c,0x0c,0x1e,0x00} ///< character 0x59 | Y| + ,{0x7f,0x63,0x31,0x18,0x4c,0x66,0x7f,0x00} ///< character 0x5a | Z| + ,{0x1e,0x06,0x06,0x06,0x06,0x06,0x1e,0x00} ///< character 0x5b | [| + ,{0x03,0x06,0x0c,0x18,0x30,0x60,0x40,0x00} ///< character 0x5c | \| + ,{0x1e,0x18,0x18,0x18,0x18,0x18,0x1e,0x00} ///< character 0x5d | ]| + ,{0x08,0x1c,0x36,0x63,0x00,0x00,0x00,0x00} ///< character 0x5e | ^| + ,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff} ///< character 0x5f | _| + ,{0x0c,0x0c,0x18,0x00,0x00,0x00,0x00,0x00} ///< character 0x60 | `| + ,{0x00,0x00,0x1e,0x30,0x3e,0x33,0x6e,0x00} ///< character 0x61 | a| + ,{0x07,0x06,0x06,0x3e,0x66,0x66,0x3b,0x00} ///< character 0x62 | b| + ,{0x00,0x00,0x1e,0x33,0x03,0x33,0x1e,0x00} ///< character 0x63 | c| + ,{0x38,0x30,0x30,0x3e,0x33,0x33,0x6e,0x00} ///< character 0x64 | d| + ,{0x00,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00} ///< character 0x65 | e| + ,{0x1c,0x36,0x26,0x0f,0x06,0x06,0x0f,0x00} ///< character 0x66 | f| + ,{0x00,0x00,0x6e,0x33,0x33,0x3e,0x30,0x1f} ///< character 0x67 | g| + ,{0x07,0x06,0x36,0x6e,0x66,0x66,0x67,0x00} ///< character 0x68 | h| + ,{0x0c,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0x69 | i| + ,{0x30,0x00,0x38,0x30,0x30,0x33,0x33,0x1e} ///< character 0x6a | j| + ,{0x07,0x06,0x66,0x36,0x1e,0x36,0x67,0x00} ///< character 0x6b | k| + ,{0x0e,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0x6c | l| + ,{0x00,0x00,0x33,0x7f,0x7f,0x6b,0x6b,0x00} ///< character 0x6d | m| + ,{0x00,0x00,0x1d,0x33,0x33,0x33,0x33,0x00} ///< character 0x6e | n| + ,{0x00,0x00,0x1e,0x33,0x33,0x33,0x1e,0x00} ///< character 0x6f | o| + ,{0x00,0x00,0x3b,0x66,0x66,0x3e,0x06,0x0f} ///< character 0x70 | p| + ,{0x00,0x00,0x6e,0x33,0x33,0x3e,0x30,0x78} ///< character 0x71 | q| + ,{0x00,0x00,0x3b,0x6e,0x46,0x06,0x0f,0x00} ///< character 0x72 | r| + ,{0x00,0x00,0x3e,0x03,0x0e,0x38,0x1f,0x00} ///< character 0x73 | s| + ,{0x08,0x0c,0x3f,0x0c,0x0c,0x2c,0x18,0x00} ///< character 0x74 | t| + ,{0x00,0x00,0x33,0x33,0x33,0x33,0x6e,0x00} ///< character 0x75 | u| + ,{0x00,0x00,0x33,0x33,0x33,0x1e,0x0c,0x00} ///< character 0x76 | v| + ,{0x00,0x00,0x63,0x63,0x6b,0x7f,0x36,0x00} ///< character 0x77 | w| + ,{0x00,0x00,0x63,0x36,0x1c,0x36,0x63,0x00} ///< character 0x78 | x| + ,{0x00,0x00,0x33,0x33,0x33,0x3e,0x30,0x1f} ///< character 0x79 | y| + ,{0x00,0x00,0x3f,0x19,0x0c,0x26,0x3f,0x00} ///< character 0x7a | z| + ,{0x38,0x0c,0x0c,0x07,0x0c,0x0c,0x38,0x00} ///< character 0x7b | {| + ,{0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00} ///< character 0x7c | || + ,{0x07,0x0c,0x0c,0x38,0x0c,0x0c,0x07,0x00} ///< character 0x7d | }| + ,{0x6e,0x3b,0x00,0x00,0x00,0x00,0x00,0x00} ///< character 0x7e | ~| + ,{0x00,0x08,0x1c,0x36,0x63,0x63,0x7f,0x00} ///< character 0x7f | | + ,{0x1e,0x33,0x03,0x33,0x1e,0x18,0x30,0x1e} ///< character 0x80 |^M-@| + ,{0x00,0x33,0x00,0x33,0x33,0x33,0x7e,0x00} ///< character 0x81 |^M-A| + ,{0x38,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00} ///< character 0x82 |^M-B| + ,{0x7e,0xc3,0x3c,0x60,0x7c,0x66,0xfc,0x00} ///< character 0x83 |^M-C| + ,{0x33,0x00,0x1e,0x30,0x3e,0x33,0x7e,0x00} ///< character 0x84 |^M-D| + ,{0x07,0x00,0x1e,0x30,0x3e,0x33,0x7e,0x00} ///< character 0x85 |^M-E| + ,{0x0c,0x0c,0x1e,0x30,0x3e,0x33,0x7e,0x00} ///< character 0x86 |^M-F| + ,{0x00,0x00,0x1e,0x03,0x03,0x1e,0x30,0x1c} ///< character 0x87 |^M-G| + ,{0x7e,0xc3,0x3c,0x66,0x7e,0x06,0x3c,0x00} ///< character 0x88 |^M-H| + ,{0x33,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00} ///< character 0x89 |^M-I| + ,{0x07,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00} ///< character 0x8a |^M-J| + ,{0x33,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0x8b |^M-K| + ,{0x3e,0x63,0x1c,0x18,0x18,0x18,0x3c,0x00} ///< character 0x8c |^M-L| + ,{0x07,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0x8d |^M-M| + ,{0x63,0x1c,0x36,0x63,0x7f,0x63,0x63,0x00} ///< character 0x8e |^M-N| + ,{0x0c,0x0c,0x00,0x1e,0x33,0x3f,0x33,0x00} ///< character 0x8f |^M-O| + ,{0x38,0x00,0x3f,0x06,0x1e,0x06,0x3f,0x00} ///< character 0x90 |^M-P| + ,{0x00,0x00,0xfe,0x30,0xfe,0x33,0xfe,0x00} ///< character 0x91 |^M-Q| + ,{0x7c,0x36,0x33,0x7f,0x33,0x33,0x73,0x00} ///< character 0x92 |^M-R| + ,{0x1e,0x33,0x00,0x1e,0x33,0x33,0x1e,0x00} ///< character 0x93 |^M-S| + ,{0x00,0x33,0x00,0x1e,0x33,0x33,0x1e,0x00} ///< character 0x94 |^M-T| + ,{0x00,0x07,0x00,0x1e,0x33,0x33,0x1e,0x00} ///< character 0x95 |^M-U| + ,{0x1e,0x33,0x00,0x33,0x33,0x33,0x7e,0x00} ///< character 0x96 |^M-V| + ,{0x00,0x07,0x00,0x33,0x33,0x33,0x7e,0x00} ///< character 0x97 |^M-W| + ,{0x00,0x33,0x00,0x33,0x33,0x3e,0x30,0x1f} ///< character 0x98 |^M-X| + ,{0xc3,0x18,0x3c,0x66,0x66,0x3c,0x18,0x00} ///< character 0x99 |^M-Y| + ,{0x33,0x00,0x33,0x33,0x33,0x33,0x1e,0x00} ///< character 0x9a |^M-Z| + ,{0x18,0x18,0x7e,0x03,0x03,0x7e,0x18,0x18} ///< character 0x9b |^M-[| + ,{0x1c,0x36,0x26,0x0f,0x06,0x67,0x3f,0x00} ///< character 0x9c |^M-\| + ,{0x33,0x33,0x1e,0x3f,0x0c,0x3f,0x0c,0x0c} ///< character 0x9d |^M-]| + ,{0x1f,0x33,0x33,0x5f,0x63,0xf3,0x63,0xe3} ///< character 0x9e |^M-^| + ,{0x70,0xd8,0x18,0x3c,0x18,0x18,0x1b,0x0e} ///< character 0x9f |^M-_| + ,{0x38,0x00,0x1e,0x30,0x3e,0x33,0x7e,0x00} ///< character 0xa0 | M- | + ,{0x1c,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00} ///< character 0xa1 | M-!| + ,{0x00,0x38,0x00,0x1e,0x33,0x33,0x1e,0x00} ///< character 0xa2 | M-"| + ,{0x00,0x38,0x00,0x33,0x33,0x33,0x7e,0x00} ///< character 0xa3 | M-#| + ,{0x00,0x1f,0x00,0x1f,0x33,0x33,0x33,0x00} ///< character 0xa4 | M-$| + ,{0x3f,0x00,0x33,0x37,0x3f,0x3b,0x33,0x00} ///< character 0xa5 | M-%| + ,{0x3c,0x36,0x36,0x7c,0x00,0x7e,0x00,0x00} ///< character 0xa6 | M-&| + ,{0x1c,0x36,0x36,0x1c,0x00,0x3e,0x00,0x00} ///< character 0xa7 | M-'| + ,{0x0c,0x00,0x0c,0x06,0x03,0x33,0x1e,0x00} ///< character 0xa8 | M-(| + ,{0x00,0x00,0x00,0x3f,0x03,0x03,0x00,0x00} ///< character 0xa9 | M-)| + ,{0x00,0x00,0x00,0x3f,0x30,0x30,0x00,0x00} ///< character 0xaa | M-*| + ,{0xc3,0x63,0x33,0x7b,0xcc,0x66,0x33,0xf0} ///< character 0xab | M-+| + ,{0xc3,0x63,0x33,0xdb,0xec,0xf6,0xf3,0xc0} ///< character 0xac | M-,| + ,{0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00} ///< character 0xad | M--| + ,{0x00,0xcc,0x66,0x33,0x66,0xcc,0x00,0x00} ///< character 0xae | M-.| + ,{0x00,0x33,0x66,0xcc,0x66,0x33,0x00,0x00} ///< character 0xaf | M-/| + ,{0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11} ///< character 0xb0 | M-0| + ,{0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55} ///< character 0xb1 | M-1| + ,{0xdb,0xee,0xdb,0x77,0xdb,0xee,0xdb,0x77} ///< character 0xb2 | M-2| + ,{0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18} ///< character 0xb3 | M-3| + ,{0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18} ///< character 0xb4 | M-4| + ,{0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18} ///< character 0xb5 | M-5| + ,{0x6c,0x6c,0x6c,0x6c,0x6f,0x6c,0x6c,0x6c} ///< character 0xb6 | M-6| + ,{0x00,0x00,0x00,0x00,0x7f,0x6c,0x6c,0x6c} ///< character 0xb7 | M-7| + ,{0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18} ///< character 0xb8 | M-8| + ,{0x6c,0x6c,0x6f,0x60,0x6f,0x6c,0x6c,0x6c} ///< character 0xb9 | M-9| + ,{0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c} ///< character 0xba | M-:| + ,{0x00,0x00,0x7f,0x60,0x6f,0x6c,0x6c,0x6c} ///< character 0xbb | M-;| + ,{0x6c,0x6c,0x6f,0x60,0x7f,0x00,0x00,0x00} ///< character 0xbc | M-<| + ,{0x6c,0x6c,0x6c,0x6c,0x7f,0x00,0x00,0x00} ///< character 0xbd | M-=| + ,{0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00} ///< character 0xbe | M->| + ,{0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18} ///< character 0xbf | M-?| + ,{0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00} ///< character 0xc0 | M-@| + ,{0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00} ///< character 0xc1 | M-A| + ,{0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18} ///< character 0xc2 | M-B| + ,{0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18} ///< character 0xc3 | M-C| + ,{0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00} ///< character 0xc4 | M-D| + ,{0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18} ///< character 0xc5 | M-E| + ,{0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18} ///< character 0xc6 | M-F| + ,{0x6c,0x6c,0x6c,0x6c,0xec,0x6c,0x6c,0x6c} ///< character 0xc7 | M-G| + ,{0x6c,0x6c,0xec,0x0c,0xfc,0x00,0x00,0x00} ///< character 0xc8 | M-H| + ,{0x00,0x00,0xfc,0x0c,0xec,0x6c,0x6c,0x6c} ///< character 0xc9 | M-I| + ,{0x6c,0x6c,0xef,0x00,0xff,0x00,0x00,0x00} ///< character 0xca | M-J| + ,{0x00,0x00,0xff,0x00,0xef,0x6c,0x6c,0x6c} ///< character 0xcb | M-K| + ,{0x6c,0x6c,0xec,0x0c,0xec,0x6c,0x6c,0x6c} ///< character 0xcc | M-L| + ,{0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00} ///< character 0xcd | M-M| + ,{0x6c,0x6c,0xef,0x00,0xef,0x6c,0x6c,0x6c} ///< character 0xce | M-N| + ,{0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00} ///< character 0xcf | M-O| + ,{0x6c,0x6c,0x6c,0x6c,0xff,0x00,0x00,0x00} ///< character 0xd0 | M-P| + ,{0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18} ///< character 0xd1 | M-Q| + ,{0x00,0x00,0x00,0x00,0xff,0x6c,0x6c,0x6c} ///< character 0xd2 | M-R| + ,{0x6c,0x6c,0x6c,0x6c,0xfc,0x00,0x00,0x00} ///< character 0xd3 | M-S| + ,{0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00} ///< character 0xd4 | M-T| + ,{0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18} ///< character 0xd5 | M-U| + ,{0x00,0x00,0x00,0x00,0xfc,0x6c,0x6c,0x6c} ///< character 0xd6 | M-V| + ,{0x6c,0x6c,0x6c,0x6c,0xff,0x6c,0x6c,0x6c} ///< character 0xd7 | M-W| + ,{0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18} ///< character 0xd8 | M-X| + ,{0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00} ///< character 0xd9 | M-Y| + ,{0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18} ///< character 0xda | M-Z| + ,{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff} ///< character 0xdb | M-[| + ,{0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff} ///< character 0xdc | M-\| + ,{0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f} ///< character 0xdd | M-]| + ,{0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0} ///< character 0xde | M-^| + ,{0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00} ///< character 0xdf | M-_| + ,{0x00,0x00,0x6e,0x3b,0x13,0x3b,0x6e,0x00} ///< character 0xe0 | M-`| + ,{0x00,0x1e,0x33,0x1f,0x33,0x1f,0x03,0x03} ///< character 0xe1 | M-a| + ,{0x00,0x3f,0x33,0x03,0x03,0x03,0x03,0x00} ///< character 0xe2 | M-b| + ,{0x00,0x7f,0x36,0x36,0x36,0x36,0x36,0x00} ///< character 0xe3 | M-c| + ,{0x3f,0x33,0x06,0x0c,0x06,0x33,0x3f,0x00} ///< character 0xe4 | M-d| + ,{0x00,0x00,0x7e,0x1b,0x1b,0x1b,0x0e,0x00} ///< character 0xe5 | M-e| + ,{0x00,0x66,0x66,0x66,0x66,0x3e,0x06,0x03} ///< character 0xe6 | M-f| + ,{0x00,0x6e,0x3b,0x18,0x18,0x18,0x18,0x00} ///< character 0xe7 | M-g| + ,{0x3f,0x0c,0x1e,0x33,0x33,0x1e,0x0c,0x3f} ///< character 0xe8 | M-h| + ,{0x1c,0x36,0x63,0x7f,0x63,0x36,0x1c,0x00} ///< character 0xe9 | M-i| + ,{0x1c,0x36,0x63,0x63,0x36,0x36,0x77,0x00} ///< character 0xea | M-j| + ,{0x38,0x0c,0x18,0x3e,0x33,0x33,0x1e,0x00} ///< character 0xeb | M-k| + ,{0x00,0x00,0x7e,0xdb,0xdb,0x7e,0x00,0x00} ///< character 0xec | M-l| + ,{0x60,0x30,0x7e,0xdb,0xdb,0x7e,0x06,0x03} ///< character 0xed | M-m| + ,{0x1c,0x06,0x03,0x1f,0x03,0x06,0x1c,0x00} ///< character 0xee | M-n| + ,{0x1e,0x33,0x33,0x33,0x33,0x33,0x33,0x00} ///< character 0xef | M-o| + ,{0x00,0x3f,0x00,0x3f,0x00,0x3f,0x00,0x00} ///< character 0xf0 | M-p| + ,{0x0c,0x0c,0x3f,0x0c,0x0c,0x00,0x3f,0x00} ///< character 0xf1 | M-q| + ,{0x06,0x0c,0x18,0x0c,0x06,0x00,0x3f,0x00} ///< character 0xf2 | M-r| + ,{0x18,0x0c,0x06,0x0c,0x18,0x00,0x3f,0x00} ///< character 0xf3 | M-s| + ,{0x70,0xd8,0xd8,0x18,0x18,0x18,0x18,0x18} ///< character 0xf4 | M-t| + ,{0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x0e} ///< character 0xf5 | M-u| + ,{0x0c,0x0c,0x00,0x3f,0x00,0x0c,0x0c,0x00} ///< character 0xf6 | M-v| + ,{0x00,0x6e,0x3b,0x00,0x6e,0x3b,0x00,0x00} ///< character 0xf7 | M-w| + ,{0x1c,0x36,0x36,0x1c,0x00,0x00,0x00,0x00} ///< character 0xf8 | M-x| + ,{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00} ///< character 0xf9 | M-y| + ,{0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00} ///< character 0xfa | M-z| + ,{0xf0,0x30,0x30,0x30,0x37,0x36,0x3c,0x38} ///< character 0xfb | M-{| + ,{0x1e,0x36,0x36,0x36,0x36,0x00,0x00,0x00} ///< character 0xfc | M-|| + ,{0x0e,0x18,0x0c,0x06,0x1e,0x00,0x00,0x00} ///< character 0xfd | M-}| + ,{0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00} ///< character 0xfe | M-~| + ,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} ///< character 0xff | | + }; +#else + extern const unsigned long long bytes[ 256 ][ 8 ]; +#endif//BIOSFONT_STATIC + +/*****************************************************************************/ +/// @brief This recovers one font bit. + inline bool + fontbit( const unsigned char c, const unsigned x, const unsigned y ) { + return !!(bytes[ c ][ y ] & (1< + +/*****************************************************************************/ +/// @brief This encodes one scan line for 1 character. +inline char * +scanchar( char *scan, const unsigned code, const unsigned line ) { + const char bit[ 2 ] = { ' ', '*' }; + scan[ 0 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x01) ]; + scan[ 1 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x02) ]; + scan[ 2 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x04) ]; + scan[ 3 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x08) ]; + scan[ 4 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x10) ]; + scan[ 5 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x20) ]; + scan[ 6 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x40) ]; + scan[ 7 ] = bit[ !!(BIOSfont::bytes[ code ][ line ] & 0x80) ]; + return scan; +} + +/*****************************************************************************/ +/// @brief This encodes one scan line for 8 characters across. +inline char * +scanline( char *cells, const unsigned start, const unsigned line ) { + scanchar( cells + 1 + 9 * 0, start + 0, line ); + scanchar( cells + 1 + 9 * 1, start + 1, line ); + scanchar( cells + 1 + 9 * 2, start + 2, line ); + scanchar( cells + 1 + 9 * 3, start + 3, line ); + scanchar( cells + 1 + 9 * 4, start + 4, line ); + scanchar( cells + 1 + 9 * 5, start + 5, line ); + scanchar( cells + 1 + 9 * 6, start + 6, line ); + scanchar( cells + 1 + 9 * 7, start + 7, line ); + return cells; +} + +/*****************************************************************************/ +/// @brief This encodes one set of 8 characters starting at code. +/// It marches through one set of eight, scan-line at a time.. +void display( const unsigned start ) { + static char line[ 80 ] = + "+--------+--------+--------+--------+--------+--------+--------+--------+"; + static char cells[ 80 ] = + "| | | | | | | | |"; + puts( line ); + if( start >= 0x100 ) return; + puts( scanline( cells, start, 0 ) ); + puts( scanline( cells, start, 1 ) ); + puts( scanline( cells, start, 2 ) ); + puts( scanline( cells, start, 3 ) ); + puts( scanline( cells, start, 4 ) ); + puts( scanline( cells, start, 5 ) ); + puts( scanline( cells, start, 6 ) ); + puts( scanline( cells, start, 7 ) ); +} + +/*****************************************************************************/ +/// @brief This causes the entire font to be displayed magnified. +void display( ) { for( unsigned c = 0; c <= 0x100; c += 0x08 ) display( c );} + +/*****************************************************************************/ +int main( int argc, char *argv[ ] ) { + if( argc > 1 ) puts( argv[ 0 ] ); + display( ); + return 0; +} +/*****************************************************************************/ +#endif//BIOSFONT_UNIT_TEST +#endif//BIOSFONT_H +/// biosfont.h +/*****************************************************************************/ -- cgit v1.2.3