From: sparky4 Date: Sat, 23 May 2015 22:17:14 +0000 (-0500) Subject: hmm something is broke? X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=441b49b204a673fca48a4a294d9d90b12df5a02c;p=16.git hmm something is broke? modified: makefile modified: pcxtest.exe modified: scroll.exe modified: src/lib/bitmap.c modified: src/lib/bitmap.h modified: src/lib/modex16.c modified: test.exe modified: test2.exe --- diff --git a/makefile b/makefile index a5c9a375..3037233f 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ -FLAGS=-0 -d2 -mh +FLAGS=-0 -d2 SRC=src\ SRCLIB=$(SRC)lib\ all: test.exe pcxtest.exe test2.exe scroll.exe diff --git a/pcxtest.exe b/pcxtest.exe index 7855c2e4..988abb27 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.exe b/scroll.exe index 66b51f7d..43c383fe 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index cc57552a..a5a43944 100644 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -89,7 +89,7 @@ bitmapLoadPcx(char *filename) { /* allocate the buffer */ bufSize = result.width * result.height; - result.data = _fmalloc(bufSize); //it breaks right here~ + result.data = malloc(bufSize); //it breaks right here~ if(!result.data) { printf("Could not allocate memory for bitmap data."); fclose(file); @@ -147,8 +147,8 @@ bitmapLoadPcxTiles(char *filename, word twidth, word theight) { ts.palette = result.palette; /* allocate the pixel storage for the tiles */ - ts.data = _fmalloc(sizeof(byte*) * ts.ntiles); - ts.data[0] = _fmalloc(sizeof(byte) * ts.ntiles * twidth * theight); + ts.data = malloc(sizeof(byte*) * ts.ntiles); + ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight); for(i=1; i < ts.ntiles; i++) { ts.data[i] = ts.data[i-1] + twidth * theight; } diff --git a/src/lib/bitmap.h b/src/lib/bitmap.h index 21009dcc..17bb0d94 100644 --- a/src/lib/bitmap.h +++ b/src/lib/bitmap.h @@ -6,7 +6,7 @@ #include #include "src/lib/types.h" typedef struct { - byte far *data; + byte *data; word width; word height; byte *palette; @@ -14,7 +14,7 @@ typedef struct { } bitmap_t; typedef struct { - byte far **data; + byte **data; word ntiles; /* the number of tiles */ word twidth; /* width of the tiles */ word theight; /* height of the tiles */ diff --git a/src/lib/modex16.c b/src/lib/modex16.c index fc1456db..08ab753d 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -226,7 +226,7 @@ void 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 far *data = bmp->data;//+bmp->offset; + byte *data = bmp->data;//+bmp->offset; word bmpOffset = (word) data + ry * bmp->width + rx; word width = rw; word height = rh; @@ -307,7 +307,7 @@ void 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 far *data = bmp->data;//+bmp->offset; + byte *data = bmp->data;//+bmp->offset; word bmpOffset = (word) data + ry * bmp->width + rx; word width = rw; word height = rh; diff --git a/test.exe b/test.exe index 6ca0d627..736b224a 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 7f079f4f..da9ec199 100644 Binary files a/test2.exe and b/test2.exe differ