From: sparky4 Date: Thu, 23 Jul 2015 13:40:10 +0000 (-0500) Subject: ^^ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=351c4812d3c1db4a33cd6f2c166456d6b0b757e0;p=16.git ^^ modified: fmemtest.exe modified: src/fmemtest.c modified: src/lib/16text.c renamed: src/text.h -> src/lib/16text.h deleted: src/text.c --- diff --git a/fmemtest.exe b/fmemtest.exe index 05eaa8a8..dd8b328a 100644 Binary files a/fmemtest.exe and b/fmemtest.exe differ diff --git a/src/fmemtest.c b/src/fmemtest.c index af61ffe2..2cdbadd0 100644 --- a/src/fmemtest.c +++ b/src/fmemtest.c @@ -31,12 +31,17 @@ main(int argc, char *argv[]) int x=420; int huge *ptr=&x; int *ptr0=&x; - void __based(__self) *pee; + //void __based(__self) *pee; + memptr pee; void __near *npee; - memptr bigbuffer; + void __far *fpee; + void *dpee; __segment segu; //word csw=0,dsw=0,esw=0,ssw=0,ipw=0; + _nheapgrow(); + _fheapgrow(); + _heapgrow(); //ptr=&x; printf("&main()=%Fp\n", *argv[0]); printf("ptr0=%Fp\n", ptr0); @@ -62,8 +67,11 @@ main(int argc, char *argv[]) //printf("cs=%u\n", csw); //printf("ds=%u\n", dsw); //printf("es=%u\n", esw); - printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer)); - printf("size of pee~=%u\n", _bmsize(segu, pee)); + printf("memavl=%u\n", _memavl()); + printf("size of based pee~=%u %FP\n", _bmsize(segu, pee), pee); + printf("size of default pee~=%u %FP\n", _msize(dpee), dpee); + printf("size of near pee~=%u %FP\n", _nmsize(npee), npee); + printf("size of far pee~=%u %FP\n", _fmsize(fpee), fpee); printf("pee=%Fp\n", pee); printf("npee=%Fp\n", npee); printf("&main()=%Fp\n", *argv[0]); diff --git a/src/lib/16text.c b/src/lib/16text.c index 59420b5c..fc7c775f 100644 --- a/src/lib/16text.c +++ b/src/lib/16text.c @@ -1,3 +1,25 @@ +/* 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. + * + */ + #include "16text.h" /* this array holds the rom font descriptors */ diff --git a/src/lib/16text.h b/src/lib/16text.h index 9f0034e4..a4453739 100644 --- a/src/lib/16text.h +++ b/src/lib/16text.h @@ -1,3 +1,24 @@ +/* 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. + * + */ /* * This is the text subsystem for project 16. * These functions provide for the rendering of text strings @@ -6,8 +27,10 @@ */ #ifndef TEXT_H #define TEXT_H +#ifdef __WATCOMC__ #include #include +#endif #include "src/lib/types.h" /* font information type */ diff --git a/src/text.c b/src/text.c deleted file mode 100644 index 5101c545..00000000 --- a/src/text.c +++ /dev/null @@ -1,59 +0,0 @@ -/* 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. - * - */ - -#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/text.h b/src/text.h deleted file mode 100644 index 74d636f9..00000000 --- a/src/text.h +++ /dev/null @@ -1,52 +0,0 @@ -/* 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. - * - */ -/* - * 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 -#ifdef __WATCOMC__ -#include -#endif -#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