From: sparky4 Date: Thu, 5 Nov 2015 20:50:37 +0000 (-0600) Subject: attempted~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=b4b0b1050a3f3d2e2d9f71a42520bb84bff86a43;p=16.git attempted~ --- diff --git a/16.exe b/16.exe index af195bdf..48fb8651 100755 Binary files a/16.exe and b/16.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index bd504973..3e842ea0 100755 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/makefile b/makefile index dbdf3324..797d320e 100755 --- a/makefile +++ b/makefile @@ -72,7 +72,7 @@ DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) timer.$(OBJ) # #3812intf.$(OBJ) -GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) +GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) planar16.$(OBJ) TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe planrpcx.exe # tsthimem.exe @@ -281,6 +281,9 @@ bakapee.$(OBJ): $(SRCLIB)bakapee.h $(SRCLIB)bakapee.c 16render.$(OBJ): $(MODEXLIB)16render.h $(MODEXLIB)16render.c wcl $(FLAGS) -c $(MODEXLIB)16render.c +planar16.$(OBJ): $(MODEXLIB)planar16.h $(MODEXLIB)planar16.c + wcl $(FLAGS) -c $(MODEXLIB)planar16.c + bitmap.$(OBJ): $(SRCLIB)bitmap.h $(SRCLIB)bitmap.c wcl $(FLAGS) -c $(SRCLIB)bitmap.c diff --git a/maptest.exe b/maptest.exe index 3d121242..cb781a89 100755 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index b9526816..ce969505 100755 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/pcxtest2.exe b/pcxtest2.exe index cc9c7903..c5a32e5a 100755 Binary files a/pcxtest2.exe and b/pcxtest2.exe differ diff --git a/planrpcx.exe b/planrpcx.exe index 69bdf755..1a4ceb08 100755 Binary files a/planrpcx.exe and b/planrpcx.exe differ diff --git a/scroll.exe b/scroll.exe index 30bb525f..ce081df5 100755 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 85f85b1b..b7ba5d14 100755 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -27,88 +27,88 @@ #include "src/lib/modex16.h" static struct pcxHeader { - byte id; - byte version; - byte encoding; - byte bpp; - word xmin; - word ymin; - word xmax; - word ymax; - word hres; - word vres; - byte pal16[48]; - byte res1; - word bpplane; - word palType; - word hScreenSize; - word vScreenSize; - byte padding[54]; + byte id; + byte version; + byte encoding; + byte bpp; + word xmin; + word ymin; + word xmax; + word ymax; + word hres; + word vres; + byte pal16[48]; + byte res1; + word bpplane; + word palType; + word hScreenSize; + word vScreenSize; + byte padding[54]; } head; static void loadPcxStage1(FILE *file, bitmap_t *result) { - long bufSize; - int index; - byte count, val; - long int pos; + long bufSize; + int index; + byte count, val; + long int pos; - /* read the header */ - fread(&head, sizeof(char), sizeof(struct pcxHeader), file); + /* read the header */ + fread(&head, sizeof(char), sizeof(struct pcxHeader), file); - /* get the width and height */ - result->width = head.xmax - head.xmin + 1; - result->height = head.ymax - head.ymin + 1; + /* get the width and height */ + result->width = head.xmax - head.xmin + 1; + result->height = head.ymax - head.ymin + 1; - /* make sure this is 8bpp */ - if(head.bpp != 8) { + /* make sure this is 8bpp */ + if(head.bpp != 8) { printf("I only know how to handle 8bpp pcx files!\n"); fclose(file); exit(-2); - } + } } static void loadPcxPalette(FILE *file, bitmap_t *result) { - byte val; - int index; - - /* handle the palette */ - fseek(file, -769, SEEK_END); - val = fgetc(file); - result->palette = modexNewPal(); - if(head.version == 5 && val == 12) { + byte val; + int index; + + /* handle the palette */ + fseek(file, -769, SEEK_END); + val = fgetc(file); + result->palette = modexNewPal(); + if(head.version == 5 && val == 12) { /* use the vga palette */ for(index=0; !feof(file) && index < PAL_SIZE; index++) { - val = fgetc(file); - result->palette[index] = val >> 2; + val = fgetc(file); + result->palette[index] = val >> 2; } - } else { + } else { /* use the 16 color palette */ for(index=0; index<48; index++) { - result->palette[index] = head.pal16[index]; + result->palette[index] = head.pal16[index]; + } } - } } bitmap_t bitmapLoadPcx(char *filename) { - FILE *file; - bitmap_t result; - dword bufSize; - int index; - byte count, val; - - /* open the PCX file for reading */ - file = fopen(filename, "rb"); - if(!file) { + FILE *file; + bitmap_t result; + dword bufSize; + int index; + byte count, val; + + /* open the PCX file for reading */ + file = fopen(filename, "rb"); + if(!file) { printf("Could not open %s for reading.\n", filename); exit(-2); - } + } - /* load the first part of the pcx file */ - loadPcxStage1(file, &result); + /* load the first part of the pcx file */ + loadPcxStage1(file, &result); /* allocate the buffer */ //printf("%zu\n", _memmax()); @@ -130,9 +130,9 @@ bitmapLoadPcx(char *filename) { exit(-1); } - /* read the buffer in */ - index = 0; - do { + /* read the buffer in */ + index = 0; + do { /* get the run length and the value */ count = fgetc(file); if(0xC0 == (count & 0xC0)) { /* this is the run count */ @@ -147,38 +147,38 @@ bitmapLoadPcx(char *filename) { for(; count && index < bufSize; count--,index++) { result.data[index] = val; } - } while(index < bufSize); + } while(index < bufSize); - loadPcxPalette(file, &result); + loadPcxPalette(file, &result); - fclose(file); + fclose(file); - return result; + return result; } -//update!! +//TODO: update!! tileset_t bitmapLoadPcxTiles(char *filename, word twidth, word theight) { - tileset_t ts; - FILE *file; - bitmap_t result; - int i; + tileset_t ts; + FILE *file; + bitmap_t result; + int i; - /* open the PCX file for reading */ - file = fopen(filename, "rb"); + /* open the PCX file for reading */ + file = fopen(filename, "rb"); if(!file) { printf("Could not open %s for reading.\n", filename); exit(-2); } - /* load the first part of the pcx file */ - loadPcxStage1(file, &result); + /* load the first part of the pcx file */ + loadPcxStage1(file, &result); - /* get the number of tiles and set up the result structure */ - ts.twidth = twidth; - ts.theight = theight; - ts.ntiles = (result.width/twidth) * (result.height/theight); - ts.palette = result.palette; + /* get the number of tiles and set up the result structure */ + ts.twidth = twidth; + ts.theight = theight; + ts.ntiles = (result.width/twidth) * (result.height/theight); + ts.palette = result.palette; /* allocate the pixel storage for the tiles */ ts.data = malloc(sizeof(byte*) * ts.ntiles); @@ -187,10 +187,10 @@ bitmapLoadPcxTiles(char *filename, word twidth, word theight) { ts.data[i] = ts.data[i-1] + twidth * theight; } - /* finish off the file */ - loadPcxPalette(file, &result); + /* finish off the file */ + loadPcxPalette(file, &result); - fclose(file); + fclose(file); - return ts; + return ts; } diff --git a/src/lib/mapread.c b/src/lib/mapread.c index d0bdd810..23cbfa0d 100755 --- a/src/lib/mapread.c +++ b/src/lib/mapread.c @@ -13,7 +13,6 @@ word dump(const char *js, jsmntok_t *t, size_t count, word indent, char *js_sv, dword i; word j;//, k; bitmap_t bp; - planar_buf_t bpp; #ifdef DEBUG_JS if(indent==0) { @@ -73,14 +72,11 @@ word dump(const char *js, jsmntok_t *t, size_t count, word indent, char *js_sv, map->data = malloc(sizeof(byte) * (t+1)->size); map->tiles = malloc(sizeof(tiles_t)); map->tiles->btdata = malloc(sizeof(bitmap_t)); - map->tiles->btdata = malloc(sizeof(bitmap_t)); //fix this to be far~ -// bp = bitmapLoadPcx("data/ed.pcx"); - bp = bitmapLoadPcx("data/koishi^^.pcx"); - bpp = planar_buf_from_bitmap0(&bp); + bp = bitmapLoadPcx("data/ed.pcx"); +// bp = bitmapLoadPcx("data/koishi^^.pcx"); map->tiles->btdata = &bp; - //0000++++map->tiles->data = planar_buf_from_bitmap0(&bp); - map->tiles->data = bpp; + map->tiles->data = planar_buf_from_bitmap(&bp); //map->tiles->data->data = malloc((16/**2*/)*16); //map->tiles->data->width = (16/**2*/); //map->tiles->data->height= 16; diff --git a/src/lib/mapread.h b/src/lib/mapread.h index 0cda1073..b2bf0fd4 100755 --- a/src/lib/mapread.h +++ b/src/lib/mapread.h @@ -17,7 +17,7 @@ typedef struct { bitmap_t huge *btdata; - planar_buf_t data; + planar_buf_t huge *data; word tileHeight; word tileWidth; unsigned int rows; diff --git a/src/lib/modex16/planar16.c b/src/lib/modex16/planar16.c new file mode 100755 index 00000000..2615d2de --- /dev/null +++ b/src/lib/modex16/planar16.c @@ -0,0 +1,193 @@ +/* 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 , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include "src/lib/modex16/planar16.h" +#include "src/lib/modex16.h" + +static struct pcxHeader { + byte id; + byte version; + byte encoding; + byte bpp; + word xmin; + word ymin; + word xmax; + word ymax; + word hres; + word vres; + byte pal16[48]; + byte res1; + word bpplane; + word palType; + word hScreenSize; + word vScreenSize; + byte padding[54]; +} head; + + +static void loadPcxStage1(FILE *file, planar_buf_t *result) { + int index; + byte count, val; + long int pos; + + /* read the header */ + fread(&head, sizeof(char), sizeof(struct pcxHeader), file); + + /* get the width and height */ + result->width = head.xmax - head.xmin + 1; + result->height = head.ymax - head.ymin + 1; + + /* make sure this is 8bpp */ + if(head.bpp != 8) { + printf("I only know how to handle 8bpp pcx files!\n"); + fclose(file); + exit(-2); + } +} + + +static void loadPcxPalette(FILE *file, planar_buf_t *result) { + byte val; + int index; + + /* handle the palette */ + fseek(file, -769, SEEK_END); + val = fgetc(file); + result->palette = modexNewPal(); + if(head.version == 5 && val == 12) { + /* use the vga palette */ + for(index=0; !feof(file) && index < PAL_SIZE; index++) { + val = fgetc(file); + result->palette[index] = val >> 2; + } + } else { + /* use the 16 color palette */ + for(index=0; index<48; index++) { + result->palette[index] = head.pal16[index]; + } + } +} + +/* sparky4's functions~ */ +planar_buf_t planarLoadPcx(char *filename) +{ + FILE *file; + planar_buf_t result; + dword bufSize; + int index, plane, x, y; + byte count, val; + word q; + + /* open the PCX file for reading */ + file = fopen(filename, "rb"); + if(!file) { + fprintf(stderr, "Could not open %s for reading.\n", filename); + //exit(-2); + } + + /* load the first part of the pcx file */ + loadPcxStage1(file, &result); + + /* allocate the buffer */ + bufSize = (/*(dword)*/result.pwidth * result.height); + result = *planar_buf_alloc(result.width, result.height); + if(!result.plane[0]) { + fprintf(stderr, "Could not allocate memory for bitmap data."); + fclose(file); + //exit(-1); + } + + /* read the buffer in */ + index = 0; + do { + /* get the run length and the value */ + count = fgetc(file); + if(0xC0 == (count & 0xC0)) { /* this is the run count */ + count &= 0x3f; + val = fgetc(file); + } else { + val = count; + count = 1; + } + + // start on the first plane + plane=0; + /* write the pixel the specified number of times */ + for(; count && index < bufSize; count--,index++) { + switch (plane) + { + case 4: + plane=0; + break; + } + // copy to each plane + result.plane[plane++][index]=val; + } + } while(index < bufSize); + + loadPcxPalette(file, &result); + fclose(file); + return result; + +} + +//TODO: update!! +tileset_t +planarLoadPcxTiles(char *filename, word twidth, word theight) { + tileset_t ts; + FILE *file; + planar_buf_t result; + int i; + + /* open the PCX file for reading */ + file = fopen(filename, "rb"); + if(!file) { + printf("Could not open %s for reading.\n", filename); + exit(-2); + } + + /* load the first part of the pcx file */ + loadPcxStage1(file, &result); + + /* get the number of tiles and set up the result structure */ + ts.twidth = twidth; + ts.theight = theight; + ts.ntiles = (result.width/twidth) * (result.height/theight); + ts.palette = result.palette; + + /* allocate the pixel storage for the tiles */ + /*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; + }*/ + + /* finish off the file */ + loadPcxPalette(file, &result); + + fclose(file); + + return ts; +} diff --git a/src/lib/modex16/planar16.h b/src/lib/modex16/planar16.h new file mode 100755 index 00000000..bf8334ae --- /dev/null +++ b/src/lib/modex16/planar16.h @@ -0,0 +1,38 @@ +/* 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 , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +/* + * Functions and types for a planar image buffer. + * This is meant to be able to load into video memory faster. + * Functions and types for loading and manipulating bitmaps. + */ + +#ifndef PLANARW_H +#define PLANARW_H + +#include "src/lib/16_head.h" +#include "src/lib/planar.h" + +#define PALSIZE 768 + +planar_buf_t planarLoadPcx(char *filename); +tileset_t planarLoadPcxTiles(char *filename, word twidth, word theight); +#endif diff --git a/src/lib/planar.c b/src/lib/planar.c index 4eda4515..41a3182e 100755 --- a/src/lib/planar.c +++ b/src/lib/planar.c @@ -104,41 +104,3 @@ planar_buf_free(planar_buf_t *p) { /* free the structure */ free(p); } - -/* non pointer version */ -planar_buf_t planar_buf_from_bitmap0(bitmap_t *b) { - planar_buf_t p; - int plane, bi, pi, x, y; - word q=0; - - /* allocate the buffer */ - p = *planar_buf_alloc(b->width, b->height); - - /* copy the bitmap data into the planar format */ - bi=0; - pi=0; - for(y=0; y < b->height; y++) { - /* start on the first plane */ - plane=0; - for(x=0; x < b->width; x++) { - /* copy to each plane */ - p.plane[plane++][pi]=b->data[bi++]; - - /* handle the completion of 4 planes. */ - if(plane==4) { - plane=0; - pi++; - } - } - - /* correct for images not divisible by 4 */ - if(plane) pi++; - } - p.palette = modexNewPal(); - for(;qpalette[q]; - } - - return p; -} diff --git a/src/lib/planar.h b/src/lib/planar.h index 4cd7365b..70c20b70 100755 --- a/src/lib/planar.h +++ b/src/lib/planar.h @@ -27,9 +27,6 @@ #define PLANAR_H #include "src/lib/bitmap.h" -#include "src/lib/16_ca.h" -#include "src/lib/16_mm.h" -#include "src/lib/16_hc.h" extern byte *modexNewPal(); @@ -54,7 +51,5 @@ planar_buf_t huge *planar_buf_alloc(word width, word height); /* deallocates a planar buffer */ void planar_buf_free(planar_buf_t *p); -/* non pointer version~ */ -planar_buf_t planar_buf_from_bitmap0(bitmap_t *b); #endif diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 16fd5d07..2bdb28f3 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -478,8 +478,8 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) } else { - rx = (((i-1) % ((t->data.width)/t->tileWidth)) * t->tileWidth); - ry = (((i-1) / ((t->data.height)/t->tileHeight)) * t->tileHeight); + rx = (((i-1) % ((t->data->width)/t->tileWidth)) * t->tileWidth); + ry = (((i-1) / ((t->data->height)/t->tileHeight)) * t->tileHeight); ////0000printf("i=%d\n", i); switch(t->debug_text) { @@ -488,7 +488,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((t->debug_data[i])+1)); //cannot print number value du to it being slow as bakapee #else - PBUFBFUN(page, x, y, rx, ry, t->tileWidth, t->tileHeight, &(t->data)); + PBUFBFUN(page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); //modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->btdata)); #endif break; diff --git a/src/planrpcx.c b/src/planrpcx.c index fea908f5..fdbc6df3 100755 --- a/src/planrpcx.c +++ b/src/planrpcx.c @@ -24,13 +24,10 @@ #include #include #include "src/lib/modex16.h" -#include "src/lib/bitmap.h" -#include "src/lib/planar.h" +#include "src/lib/modex16/planar16.h" global_game_variables_t gvar; -bitmap_t bmp, ptmpbt; -//planar_buf_t *p, *ptmp; -planar_buf_t pnp, ptmpnp; +planar_buf_t huge p, ptmp; void main(int argc, char *argv[]) { @@ -56,17 +53,13 @@ void main(int argc, char *argv[]) // else baka = 1; - bmp = bitmapLoadPcx(bakapeee); - //p = planar_buf_from_bitmap(&bmp); - pnp = planar_buf_from_bitmap0(&bmp); - ptmpbt = bitmapLoadPcx("data/ptmp.pcx"); - //ptmp = planar_buf_from_bitmap(&ptmpbt); - ptmpnp = planar_buf_from_bitmap0(&ptmpbt); + p = planarLoadPcx(bakapeee); + ptmp = planarLoadPcx("data/ptmp.pcx"); VGAmodeX(baka, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); /* fix up the palette and everything */ - modexPalUpdate1(bmp.palette); + modexPalUpdate1(p.palette); /* clear and draw one sprite and one bitmap */ modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].sw, gvar.video.page[0].sh, 0); @@ -80,8 +73,8 @@ baka = 1; start = *clockw; // oldDrawBmp(VGA, 20, 20, &bmp, 0); for(i=0; i<100 ;i++) { -// modexDrawBmpPBufRegion (&gvar.video.page[0], 32, 32, 0, 0, pnp.width, pnp.height, &pnp); - modexDrawBmpPBuf (&gvar.video.page[0], 32, 32, &pnp); + modexDrawBmpPBufRegion (&gvar.video.page[0], 32, 32, 0, 0, p.width, p.height, &p); +// modexDrawBmpPBuf (&gvar.video.page[0], 32, 32, p); } t1 = (*clockw-start) /18.2; // start = *clockw; @@ -89,13 +82,13 @@ baka = 1; // t2 = (*clockw-start)/18.2; start = *clockw; for(i=0; i<100 ;i++) { - modexDrawPBuf(&gvar.video.page[0], 0, 0, &pnp, 0); + modexDrawPBuf(&gvar.video.page[0], 0, 0, &p, 0); } t2 = (*clockw-start) /18.2; getch(); - modexPalUpdate1(ptmpbt.palette); - //modexDrawBmpPBufRegion(&gvar.video.page[0], 64, 64, 48, 32, 24, 32, &ptmpnp); - modexDrawPBuf(&gvar.video.page[0], 64, 64, &ptmpnp, 0); + modexPalUpdate1(ptmp.palette); + //modexDrawBmpPBufRegion(&gvar.video.page[0], 64, 64, 48, 32, 24, 32, ptmp); + modexDrawPBuf(&gvar.video.page[0], 64, 64, &ptmp, 0); while(!kbhit()) { } @@ -105,9 +98,9 @@ baka = 1; for(plane=0; plane < 4; plane++) { i=0; printf("Plane %d\n", plane); - for(py=0; py < ptmpnp.height; py++) { - for(px=0; px < ptmpnp.pwidth; px++) { - printf("%02X ", (int) ptmpnp.plane[plane][i++]); + for(py=0; py < ptmp.height; py++) { + for(px=0; px < ptmp.pwidth; px++) { + printf("%02X ", (int) ptmp.plane[plane][i++]); } printf("\n"); } @@ -135,12 +128,12 @@ baka = 1; chw += xp; fprintf(stderr,"Project 16 planrpcx.exe. This is just a test file!\n"); fprintf(stderr,"version %s\n", VERSION); - fprintf(stderr,"%d\n", sizeof(pnp.plane)); - fprintf(stderr,"pw=%d\n", pnp.width); - fprintf(stderr,"ph=%d\n", pnp.height); - fprintf(stderr,"ppw=%d\n", pnp.pwidth); - fprintf(stderr,"%d\n", sizeof(bmp)); - fprintf(stderr,"%dx%d\n", gvar.video.page[0].sw-(pnp.width), gvar.video.page[0].sh-(pnp.height)); + fprintf(stderr,"%d\n", sizeof(p.plane)); + fprintf(stderr,"pw=%d\n", p.width); + fprintf(stderr,"ph=%d\n", p.height); + fprintf(stderr,"ppw=%d\n", p.pwidth); + fprintf(stderr,"%d\n", sizeof(p)); + fprintf(stderr,"%dx%d\n", gvar.video.page[0].sw-(p.width), gvar.video.page[0].sh-(p.height)); //planar_buf_free(p); free(bakapeee); fprintf(stderr, "modexDrawBmpPBuf: %f\n", t1); diff --git a/src/scroll.c b/src/scroll.c index f7865cc3..b89d1291 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -37,7 +37,7 @@ map_view_t mv[3]; map_view_t *bg, *spri, *mask;//, *tmp; bitmap_t p; word pn=0; -static planar_buf_t pp; +static planar_buf_t huge *pp; float t; sword bakapee; @@ -97,7 +97,7 @@ void main(int argc, char *argv[]) /* create the planar buffer */ ////++++ (player[0].data) = *planar_buf_from_bitmap(&p); printf("load pee!!\n"); - pp = planar_buf_from_bitmap0(&p); + pp = planar_buf_from_bitmap(&p); printf("done!\n"); #endif diff --git a/test.exe b/test.exe index 01cec23d..c9843178 100755 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 9235035a..527a1589 100755 Binary files a/test2.exe and b/test2.exe differ