OSDN Git Service

^^
authorsparky4 <sparky4@cock.li>
Thu, 23 Jul 2015 13:40:10 +0000 (08:40 -0500)
committersparky4 <sparky4@cock.li>
Thu, 23 Jul 2015 13:40:10 +0000 (08:40 -0500)
modified:   fmemtest.exe
modified:   src/fmemtest.c
modified:   src/lib/16text.c
renamed:    src/text.h -> src/lib/16text.h
deleted:    src/text.c

fmemtest.exe
src/fmemtest.c
src/lib/16text.c
src/lib/16text.h
src/text.c [deleted file]
src/text.h [deleted file]

index 05eaa8a..dd8b328 100644 (file)
Binary files a/fmemtest.exe and b/fmemtest.exe differ
index af61ffe..2cdbadd 100644 (file)
@@ -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]);
index 59420b5..fc7c775 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>, or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
 #include "16text.h"\r
 \r
 /* this array holds the rom font descriptors */\r
index 9f0034e..a445373 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>, or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
 /*\r
  * This is the text subsystem for project 16.\r
  * These functions provide for the rendering of text strings\r
@@ -6,8 +27,10 @@
  */\r
 #ifndef TEXT_H\r
 #define TEXT_H
+#ifdef __WATCOMC__
 #include <jstring.h>
 #include <jctype.h>\r
+#endif
 #include "src/lib/types.h"\r
 \r
 /* font information type */\r
diff --git a/src/text.c b/src/text.c
deleted file mode 100644 (file)
index 5101c54..0000000
+++ /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 <http://www.gnu.org/licenses/>, 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 (file)
index 74d636f..0000000
+++ /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 <http://www.gnu.org/licenses/>, 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 <jstring.h>
-#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