+++ /dev/null
-\r
- == default ==\r
-\r
- USED block at 1c840016 of size 66\r
- FREE block at 1c840058 of size 18\r
- USED block at 1c84006a of size 136\r
- USED block at 1c8400f2 of size 20\r
- FREE block at 1c840106 of size 7926\r
-OK - end of heap\r
-\r
- == near ==\r
-\r
- USED block at c8385b6 of size 12\r
- USED block at c8385c2 of size 294\r
- USED block at c8386e8 of size 42\r
- USED block at c838712 of size 20\r
- USED block at c838726 of size 20\r
- USED block at c83873a of size 20\r
- USED block at c83874e of size 20\r
- USED block at c838762 of size 20\r
- USED block at c838776 of size 30854\r
-OK - end of heap\r
-\r
- == far ==\r
-\r
- USED block at 1c840016 of size 66\r
- USED block at 1c840058 of size 18\r
- USED block at 1c84006a of size 136\r
- USED block at 1c8400f2 of size 20\r
- USED block at 1c840106 of size 7926\r
-OK - end of heap\r
-\r
-Memory Type Total Used Free\r
----------------- -------- -------- --------\r
-Default 8166 222 7944\r
-Near 31302 448 30854\r
-Far 8166 222 7944\r
----------------- -------- -------- --------\r
-coreleft = 30852\r
-farcoreleft = 38600\r
-GetFreeSize = 7768\r
-GetNearFreeSize = 30854\r
-GetFarFreeSize = 7768\r
-memavl = 30852\r
-stackavail = 15059\r
-/* 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.
- *
- */
-
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
#include <stdio.h>\r
-#include <stdlib.h>
-#include <malloc.h>
+#include <stdlib.h>\r
+#include <malloc.h>\r
#include "src/lib/bitmap.h"\r
#include "src/lib/modex16.h"\r
\r
bitmap_t result;\r
dword bufSize;\r
int index;\r
- byte count, val;
+ byte count, val;\r
\r
/* open the PCX file for reading */\r
file = fopen(filename, "rb");\r
}\r
\r
/* load the first part of the pcx file */\r
- loadPcxStage1(file, &result);
+ loadPcxStage1(file, &result);\r
\r
- /* allocate the buffer */
+ /* allocate the buffer */\r
//printf("%zu\n", _memmax());\r
- bufSize = (/*(dword)*/result.width * result.height);
- result.data = malloc(bufSize);
-// result.data = (byte far *)_fmalloc(bufSize);
-// result.data = (byte __huge *)halloc(bufSize, sizeof(byte));
- /*printf("&bufSize=%p\n", &bufSize);
- printf("&result.data=%p\n", result.data);
- printf("Size of block is %zu bytes\n", _msize(result.data));
- printf("Size of bufSize is %zu bytes\n", bufSize);
- printf("Size of result.width is %zu \n", result.width);
- printf("Size of result.height is %zu \n", result.height);
- printf("Dimensions of result is %lu\n", (dword)result.width*result.height);*/
- //exit(0);
- if(!result.data) {
+ bufSize = (/*(dword)*/result.width * result.height);\r
+ result.data = malloc(bufSize);\r
+// result.data = (byte far *)_fmalloc(bufSize);\r
+// result.data = (byte __huge *)halloc(bufSize, sizeof(byte));\r
+ /*printf("&bufSize=%p\n", &bufSize);\r
+ printf("&result.data=%p\n", result.data);\r
+ printf("Size of block is %zu bytes\n", _msize(result.data));\r
+ printf("Size of bufSize is %zu bytes\n", bufSize);\r
+ printf("Size of result.width is %zu \n", result.width);\r
+ printf("Size of result.height is %zu \n", result.height);\r
+ printf("Dimensions of result is %lu\n", (dword)result.width*result.height);*/\r
+ //exit(0);\r
+ if(!result.data) {\r
fprintf(stderr, "Could not allocate memory for bitmap data.");\r
fclose(file);\r
exit(-1);\r
val = count;\r
count = 1;\r
}\r
-
+\r
/* write the pixel the specified number of times */\r
for(; count && index < bufSize; count--,index++) {\r
result.data[index] = val;\r
modexDrawBmpRegion(page_t *page, int x, int y,\r
int rx, int ry, int rw, int rh, bitmap_t *bmp) {\r
word poffset = (word) page->data + y*(page->width/4) + x/4;\r
- byte *data = bmp->data;//+bmp->offset;\r
+ byte far *data = bmp->data;//+bmp->offset;\r
word bmpOffset = (word) data + ry * bmp->width + rx;\r
word width = rw;\r
word height = rh;\r
word rowCounter;\r
byte planeCounter = 4;\r
\r
- printf("bmp->data=%Fp\n",bmp->data);\r
+/* printf("bmp->data=%Fp\n",bmp->data);\r
printf("*bmp->data=%Fp\n",*(bmp->data));\r
- printf("&bmp->data=%Fp\n",&(bmp->data));\r
+ printf("&bmp->data=%Fp\n",&(bmp->data));*/\r
\r
//code is a bit slow here\r
__asm {\r
start = *clockw;\r
//for(i=0; i<100 ;i++) {\r
//0000 modexDrawBmp(&page, 20, 20, &bmp);\r
- modexDrawBmp(&page, 100, 100, &bmp);\r
+ modexDrawBmp(&page, 160, 120, &bmp);\r
//}\r
t1 = (*clockw-start) /18.2;\r
\r
start = *clockw;\r
//for(i=0; i<100 ;i++) {\r
//0000 modexDrawSprite(&page, 20, 20, &bmp);\r
- modexDrawSprite(&page, 100, 100, &bmp);\r
+ modexDrawSprite(&page, 160, 120, &bmp);\r
//}\r
//_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));\r
//modexDrawBmp(&page, 0, 0, &bmp);\r
//DrawPBuf(&page, 0, 0, p, 0);\r
}\r
modexLeave();\r
- printf("main=%Fp\n", &i);\r
+ /*printf("\nmain=%Fp\n\n", &i);\r
+ printf("bmp.data=%Fp\n", bmp.data);\r
+ printf("*bmp.data=%Fp\n", *(bmp.data));\r
+ printf("&bmp.data=%Fp\n", &(bmp.data));\r
\r
printf("\n%d\n", sizeof(p->plane));\r
- printf("%d\n", sizeof(bmp));\r
+ printf("%d\n", sizeof(bmp));*/\r
\r
/*for(i=0; i<(320*240); i++)\r
{\r
fprintf(stdout, "%d", bmp.data[i]);\r
- if(i%320==0) fprintf(stdout, "\n");\r
+ if(i%bmp.width==0) fprintf(stdout, "\n");\r
}*/\r
printf("CPU to VGA: %f\n", t1);\r
printf("VGA to VGA: %f\n", t2);\r