From 077782026074116470d9637507d988ffcc29ef58 Mon Sep 17 00:00:00 2001 From: Robert Lowe Date: Mon, 22 Jun 2015 00:17:38 -0400 Subject: [PATCH] Added the start of the text system library. Currently, all it does is find the locations of the BIOS fonts. ftest.c is a little program that renders the 8x16 font in ascii art. --- FTEST.EXE | Bin 0 -> 23123 bytes makefile | 123 ++++++++++++++++++++++++++---------------------- src/FTEST.C | 56 ++++++++++++++++++++++ src/lib/TEXT.C | 37 +++++++++++++++ src/lib/TEXT.H | 28 +++++++++++ src/lib/types.h | 56 +++++++++++----------- 6 files changed, 215 insertions(+), 85 deletions(-) create mode 100644 FTEST.EXE create mode 100644 src/FTEST.C create mode 100644 src/lib/TEXT.C create mode 100644 src/lib/TEXT.H diff --git a/FTEST.EXE b/FTEST.EXE new file mode 100644 index 0000000000000000000000000000000000000000..d9af81d7f907b535b528b895b859fe446746cdb0 GIT binary patch literal 23123 zcmdtKdwdkvkuQGwq0t~-;$iRu!(f8~$Pmd8uq=s(CCwNcgp5F78*3u;0NHv)(=Fj# zMaUkrQL7P~cy|-~CL2FDA&!5EUz-TLYh;ZrfxW~C94v&59Zbj!O|T4D5|Ws{-#R@n z5$-uv?kTB=*nDG@p@}ov{rfV-99rU*f)6 zVyr-BtPOwvWnBFct`HWmMa*9=!VADqJFW&PvwmSWqbHqPcXuFN&`I`jqdtz$8 zcB%Wz?l0%#)BHn=Wd5O9Drj2@bP>>Yr#C1!eAc!K&kqoJt23C_wiZtx;z@qte@dEj z@P(h_b4Y(@#MFO3WbXNgL34rG@{6EJZ0SGg(!NBNq{~{I)3sXdPwh7n+w#DI5kqv4 z_=9ilXM!=c&A}|*e`Vm^J+$kn@=41*{**JjjwoNYEnvoP(%Q0$>iXF%e?6ZUXf>g=FsK*UHD|DGoCr#Y_0Yq<{PhKz&%2z7tZ}lwG$^#l zDQC0}@44~bq4D)o+Jb^VTh=-=O;eeq^%bIl)11IW4U~qzX`Nj(0{eqP;5j*;cazZN z?C%z|V_HY6v%kwZI7R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(;NC|4rh(aY+ofa9(A8ECR=xlZ`BM@TJB zf98}FBr-;&@91T5nu}dZ7AXQ`46cLyf^!E-d6EY85 +#include "lib/types.h" +#include "lib/text.h" + +main() { + int i; + int j; + char l[16]; + char c; + word s, o; + word addr = (word) l; + textInit(); + + //print the addresses of the fonts + printf("ROM FONT Addresses\n"); + for(i=0; i<4; i++) { + printf("%d: %x:%x\n", i, romFonts[i].seg, romFonts[i].off); + } + + printf("Character: "); + scanf("%c", &c); + + s=romFonts[ROM_FONT_8x16].seg; + o=romFonts[ROM_FONT_8x16].off; + + //load the letter 'A' + __asm { + MOV DI, addr + MOV SI, o + MOV ES, s + SUB BH, BH + MOV BL, c ; the letter + SHL BX, 1 + SHL BX, 1 + SHL BX, 1 + SHL BX, 1 + ADD SI, BX ;the address of A + MOV CX, 16 + L1: MOV AX, ES:SI + MOV DS:DI, AX + INC SI + INC DI + DEC CX + JNZ L1 + } + + //render the letter in ascii art + for(i=0; i<16; i++) { + j=1<<8; + while(j) { + printf("%c", l[i] & j ? '*':' '); + j>>=1; + } + printf("\n"); + } +} diff --git a/src/lib/TEXT.C b/src/lib/TEXT.C new file mode 100644 index 00000000..107f8e94 --- /dev/null +++ b/src/lib/TEXT.C @@ -0,0 +1,37 @@ +#include "text.h" + +/* this array holds the rom font descriptors */ +font_t romFonts[4]; + + +static void getRomFontAddr(char fontNum, int index) { + word fontSeg; + word fontOff; + + __asm { + PUSH BP + MOV AX, 0x1130 ;I can haz font info plz? + MOV BH, fontNum ; where ur fontNum + INT 0x10 ;kthxbae + MOV AX, ES ;save teh segmentz + MOV BX, BP ;and all the base! + POP BP ;u can haz ur frame back! + MOV fontSeg, AX ;Storage + MOV fontOff, BX ;Storage + } + romFonts[index].seg = fontSeg; + romFonts[index].off = fontOff; + +} + +/* This function initializes the text engine */ +void textInit() { + getRomFontAddr(0x02, ROM_FONT_8x14); + getRomFontAddr(0x03, ROM_FONT_8x8_LOW); + getRomFontAddr(0x04, ROM_FONT_8x8_HIGH); + getRomFontAddr(0x06, ROM_FONT_8x16); + romFonts[ROM_FONT_8x14].charSize=14; + romFonts[ROM_FONT_8x8_LOW].charSize=8; + romFonts[ROM_FONT_8x8_HIGH].charSize=8; + romFonts[ROM_FONT_8x16].charSize=16; +} diff --git a/src/lib/TEXT.H b/src/lib/TEXT.H new file mode 100644 index 00000000..98c3b904 --- /dev/null +++ b/src/lib/TEXT.H @@ -0,0 +1,28 @@ +/* + * This is the text subsystem for project 16. + * These functions provide for the rendering of text strings + * using the BIOS fonts. + * They copy the font characters directly to VGA. + */ +#ifndef TEXT_H +#define TEXT_H +#include "types.h" + +/* font information type */ +typedef struct font { + word seg; //segment for the font + word off; //offset in the segment for the font + byte charSize; //bytes in each character +} font_t; + +/* storage for the rom fonts */ +extern font_t romFonts[4]; +#define ROM_FONT_8x14 0 +#define ROM_FONT_8x8_LOW 1 +#define ROM_FONT_8x8_HIGH 2 +#define ROM_FONT_8x16 3 + +/* This function initializes the text engine */ +void textInit(); + +#endif diff --git a/src/lib/types.h b/src/lib/types.h index fa880848..2055c20c 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -1,37 +1,37 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ +/* Project 16 Source Code~ + * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * + * This file is part of Project 16. + * + * Project 16 is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Project 16 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ /* * Just some handy typedefs that make it easier to think about the low * level code - */ - -#ifndef _TYPE_H_ -#define _TYPE_H_ + */ + +#ifndef _TYPE_H_ +#define _TYPE_H_ typedef unsigned char byte; typedef unsigned short word; typedef unsigned long dword; typedef signed char sbyte; typedef signed short sword; -typedef signed long sdword; - -#endif/*_TYPE_H_*/ +typedef signed long sdword; + +#endif/*_TYPE_H_*/ -- 2.39.5