From: sparky4 Date: Sun, 24 May 2015 10:30:53 +0000 (-0500) Subject: far huge guts! wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=f8aa708d074bbb922c6bdc481f9909c2ffd6274a;p=16.git far huge guts! wwww modified: data/g.pal modified: makefile modified: maptest.exe modified: pcxtest.exe modified: scroll.exe modified: src/lib/bitmap.c modified: src/lib/bitmap.h modified: src/lib/modex16.c modified: src/pcxtest.c modified: test.exe modified: test2.exe --- diff --git a/data/g.pal b/data/g.pal index e1036203..cf668e35 100644 Binary files a/data/g.pal and b/data/g.pal differ diff --git a/makefile b/makefile index d471bb71..f3f44d92 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,9 @@ -OFLAGS=-ot -ox -ob -ol -oh -or -FLAGS=-0 -d2 -wo $(OFLAGS) -mh +#-zk0u = translate kanji to unicode... wwww +#-zk0 = kanji support~ +#-zkl = current codepage + +OFLAGS=-ot -ox -ob -oh# -or -om -ol -ol+ +FLAGS=-0 -d2 -wo $(OFLAGS) -zkl# -mh# -zdp# -zm# -zp16 -zq DIRSEP=\ SRC=src$(DIRSEP) SRCLIB=$(SRC)lib$(DIRSEP) @@ -11,14 +15,14 @@ scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj li wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj# 16/lib/x/modex.lib scroll.obj: $(SRC)scroll.c wcl $(FLAGS) -c $(SRC)scroll.c -test.exe: test.obj modex16.obj bitmap.obj - wcl $(FLAGS) test.obj modex16.obj bitmap.obj +test.exe: test.obj modex16.obj bitmap.obj lib_head.obj + wcl $(FLAGS) test.obj modex16.obj bitmap.obj lib_head.obj -test2.exe: test2.obj modex16.obj bitmap.obj planar.obj - wcl $(FLAGS) test2.obj modex16.obj bitmap.obj planar.obj +test2.exe: test2.obj modex16.obj bitmap.obj planar.obj lib_head.obj + wcl $(FLAGS) test2.obj modex16.obj bitmap.obj planar.obj lib_head.obj -pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj - wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj +pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj lib_head.obj + wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj lib_head.obj maptest.exe: maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj wcl $(FLAGS) maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj @@ -49,7 +53,7 @@ bitmap.obj: $(SRCLIB)bitmap.h $(SRCLIB)bitmap.c planar.obj: $(SRCLIB)planar.h $(SRCLIB)planar.c wcl $(FLAGS) -c $(SRCLIB)planar.c -mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c# lib_head.obj jsmn.obj +mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c wcl $(FLAGS) -c $(SRCLIB)mapread.c lib_head.obj: $(SRCLIB)lib_head.h $(SRCLIB)lib_head.c @@ -58,6 +62,6 @@ lib_head.obj: $(SRCLIB)lib_head.h $(SRCLIB)lib_head.c jsmn.obj: $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c wcl $(FLAGS) -c $(JSMNLIB)jsmn.c -clean: - del *.obj -# del *.exe +clean: .symbolic + @del *.obj +# @del *.exe diff --git a/maptest.exe b/maptest.exe index 36e27fca..f97c38a9 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index c06f9368..fbde82ae 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.exe b/scroll.exe index 352c5f92..d42d6553 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index ea35c172..cdec73bd 100644 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -88,14 +88,19 @@ bitmapLoadPcx(char *filename) { /* load the first part of the pcx file */ loadPcxStage1(file, &result); - /* allocate the buffer */ - bufSize = (result.width * result.height); - result.data = malloc((bufSize)); - printf("Size of block is %u bytes\n", _msize(result.data)); - printf("Size of bufSize is %lu bytes\n", bufSize); - printf("Size of result.width is %d \n", result.width); - printf("Size of result.height is %d \n", result.height); - printf("Dimensions of result is %lu\n", result.width*result.height); + /* allocate the buffer */ + //printf("%zu\n", _memmax()); + 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", _fmsize(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) { fprintf(stderr, "Could not allocate memory for bitmap data."); @@ -115,7 +120,7 @@ bitmapLoadPcx(char *filename) { val = count; count = 1; } - + /* write the pixel the specified number of times */ for(; count && index < bufSize; count--,index++) { result.data[index] = val; diff --git a/src/lib/bitmap.h b/src/lib/bitmap.h index f1b126e5..31b94438 100644 --- a/src/lib/bitmap.h +++ b/src/lib/bitmap.h @@ -7,7 +7,7 @@ #include "src/lib/lib_head.h" typedef struct { - byte *data; + byte far *data; word width; word height; byte *palette; diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 08ab753d..fc1456db 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 *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; @@ -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 *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; diff --git a/src/pcxtest.c b/src/pcxtest.c index 26aea719..ea1d296c 100644 --- a/src/pcxtest.c +++ b/src/pcxtest.c @@ -64,8 +64,8 @@ void main() { page=modexDefaultPage(); //0000 bmp = bitmapLoadPcx("data/koishi~~.pcx"); - bmp = bitmapLoadPcx("data/chikyuu.pcx"); -// bmp = bitmapLoadPcx("data/koishi^^.pcx"); +// bmp = bitmapLoadPcx("data/chikyuu.pcx"); + bmp = bitmapLoadPcx("data/koishi^^.pcx"); // bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx"); //0000 p = planar_buf_from_bitmap(&bmp); modexEnter(); diff --git a/test.exe b/test.exe index ee37f8b6..f6db9fe4 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 9b4249c7..81fa5885 100644 Binary files a/test2.exe and b/test2.exe differ