-FLAGS=-0 -d2 \r
+FLAGS=-0 -d2 -mh\r
SRC=src\\r
SRCLIB=$(SRC)lib\\r
all: test.exe pcxtest.exe test2.exe scroll.exe\r
\r
mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c jsmn.obj lib_head.obj\r
wcl $(FLAGS) -c $(SRCLIB)mapread.c\r
-
+\r
lib_head.obj: $(SRCLIB)lib_head.h $(SRCLIB)lib_head.c\r
- wcl $(FLAGS) -c $(SRCLIB)lib_head.c
+ wcl $(FLAGS) -c $(SRCLIB)lib_head.c\r
\r
jsmn.obj: $(SRCLIB)jsmn\jsmn.h $(SRCLIB)jsmn\jsmn.c\r
wcl $(FLAGS) -c $(SRCLIB)jsmn\jsmn.c\r
#include <stdio.h>\r
#include <stdlib.h>\r
-#include "src\lib\bitmap.h"\r
-#include "src\lib\modex16.h"\r
+#include "src/lib/bitmap.h"\r
+#include "src/lib/modex16.h"\r
\r
static struct pcxHeader {\r
byte id;\r
\r
/* allocate the buffer */\r
bufSize = result.width * result.height;
- result.data = malloc(bufSize); //it breaks right here~
+ result.data = _fmalloc(bufSize); //it breaks right here~
if(!result.data) {\r
printf("Could not allocate memory for bitmap data.");\r
fclose(file);\r
ts.palette = result.palette;\r
\r
/* allocate the pixel storage for the tiles */\r
- ts.data = malloc(sizeof(byte*) * ts.ntiles);\r
- ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight);\r
+ ts.data = _fmalloc(sizeof(byte*) * ts.ntiles);\r
+ ts.data[0] = _fmalloc(sizeof(byte) * ts.ntiles * twidth * theight);\r
for(i=1; i < ts.ntiles; i++) {\r
ts.data[i] = ts.data[i-1] + twidth * theight;\r
}\r
- \r
+\r
/* finish off the file */\r
loadPcxPalette(file, &result);\r
\r
* Functions and types for loading and manipulating bitmaps.\r
*/\r
#ifndef BITMAP_H\r
-#define BITMAP_H\r
-#include "src\lib\types.h"\r
+#define BITMAP_H
+#include <malloc.h>\r
+#include "src/lib/types.h"\r
typedef struct {\r
- byte *data;
+ byte far *data;
word width;\r
word height;\r
byte *palette;
} bitmap_t;\r
\r
typedef struct {\r
- byte **data;\r
+ byte far **data;\r
word ntiles; /* the number of tiles */\r
word twidth; /* width of the tiles */\r
word theight; /* height of the tiles */\r
#include <conio.h>
\r
#include "memory.h"
+#include "../types.h"
#define PEMMDATAPAGENUM 4\r
\r
\r
#include "emmret.h"\r
#include "emmsize.h"
-#include "../types.h"\r
\r
#define CMM 0\r
#define EMM 1\r
FUCK well i am stuck.... wwww
*/
- map->data[q] = (byte)strtol(js+t->start, &(char *)t->end, 10);
+ map->data[q] = (byte)strtol(js+t->start, (char **)t->end, 10);
// printf("%d[%d]", q, map->data[q]);
}
else
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
-#include "src\lib\modex16.h"
+#include "src/lib/modex16.h"
byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */
modexDrawBmpRegion(page_t *page, int x, int y,
int rx, int ry, int rw, int rh, bitmap_t *bmp) {
word poffset = (word) page->data + y*(page->width/4) + x/4;
- byte *data = bmp->data;//+bmp->offset;
+ byte far *data = bmp->data;//+bmp->offset;
word bmpOffset = (word) data + ry * bmp->width + rx;
word width = rw;
word height = rh;
modexDrawSpriteRegion(page_t *page, int x, int y,
int rx, int ry, int rw, int rh, bitmap_t *bmp) {
word poffset = (word)page->data + y*(page->width/4) + x/4;
- byte *data = bmp->data;//+bmp->offset;
+ byte far *data = bmp->data;//+bmp->offset;
word bmpOffset = (word) data + ry * bmp->width + rx;
word width = rw;
word height = rh;