From: sparky4 Date: Mon, 20 Jun 2016 15:49:50 +0000 (-0500) Subject: readded OLD sprite drawing now for fixing the background stuff ww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=d0b4d523e0a90d036da0512a224389bf40895c09;p=16.git readded OLD sprite drawing now for fixing the background stuff ww --- diff --git a/data/chikyuu.pcx b/data/chikyuu.pcx index 54427871..83de56ba 100755 Binary files a/data/chikyuu.pcx and b/data/chikyuu.pcx differ diff --git a/src/lib/16_in.h b/src/lib/16_in.h index beb6a3d3..186158ea 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -230,7 +230,7 @@ typedef struct //0000 planar_buf_t huge *data; //supposively the sprite sheet data // planar_buf_t data; //supposively the sprite sheet data ////0000---- - bitmap_t huge *data; //supposively the sprite sheet data + bitmap_t *data; //supposively the sprite sheet data sword hp; //hitpoints of the player int persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */ CursorInfo info; diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 43321733..d2480baf 100755 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -126,7 +126,7 @@ bitmapLoadPcx(char *filename) { result.data[index] = val; } } while(index < bufSize); - printf("index=%d\n", index); + //printf("index=%d\n", index); loadPcxPalette(file, &result); diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index f5218379..c8e4a1a8 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -38,12 +38,14 @@ #include #include -//#define SPRITE +#define SPRITE //#define TILERENDER -#define PBUFSFUN modexDrawSpritePBufRegion -#define PBUFBFUN modexDrawBmpPBufRegion -#define PLAYERBMPDATA &player[pn].data +//modexDrawSpritePBufRegion +//modexDrawBmpPBufRegion +#define PBUFSFUN modexDrawSpriteRegion +#define PBUFBFUN modexDrawBmpRegion +#define PLAYERBMPDATA player[pn].data typedef struct { map_t *map; diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 2f8d7a45..da79ebc8 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -42,7 +42,7 @@ * typedefs of the game variables! */ typedef struct { - byte huge *data; + byte *data; word width; word height; byte *palette; diff --git a/src/pcxtest.c b/src/pcxtest.c index c05cff5f..99e2669e 100755 --- a/src/pcxtest.c +++ b/src/pcxtest.c @@ -37,9 +37,30 @@ void main() { int plane; float t1, t2; + // DOSLIB: check our environment + probe_dos(); + + // DOSLIB: what CPU are we using? + // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. + // So this code by itself shouldn't care too much what CPU it's running on. Except that other + // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for + // the CPU to carry out tasks. --J.C. + cpu_probe(); + + // DOSLIB: check for VGA + if (!probe_vga()) { + printf("VGA probe failed\n"); + return; + } + // hardware must be VGA or higher! + if (!(vga_state.vga_flags & VGA_IS_VGA)) { + printf("This program requires VGA or higher graphics hardware\n"); + return; + } + //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"); p = planar_buf_from_bitmap(&bmp); VGAmodeX(1, 1, &gvar); diff --git a/src/pcxtest2.c b/src/pcxtest2.c index 059b448a..aea2eb9a 100755 --- a/src/pcxtest2.c +++ b/src/pcxtest2.c @@ -62,9 +62,30 @@ void main() { int plane; float t1, t2; + // DOSLIB: check our environment + probe_dos(); + + // DOSLIB: what CPU are we using? + // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. + // So this code by itself shouldn't care too much what CPU it's running on. Except that other + // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for + // the CPU to carry out tasks. --J.C. + cpu_probe(); + + // DOSLIB: check for VGA + if (!probe_vga()) { + printf("VGA probe failed\n"); + return; + } + // hardware must be VGA or higher! + if (!(vga_state.vga_flags & VGA_IS_VGA)) { + printf("This program requires VGA or higher graphics hardware\n"); + return; + } + //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"); p = planar_buf_from_bitmap(&bmp); VGAmodeX(1, 1, &gvar); diff --git a/src/scroll.c b/src/scroll.c index cd143846..ff380454 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -28,15 +28,14 @@ #define MODEX //this is for mode x initiating //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ - +bitmap_t *p; global_game_variables_t gvar; static map_t map; player_t player[MaxPlayers]; //page_t screen, gvar.video.page[1], gvar.video.page[2]; map_view_t mv[4]; -bitmap_t p; //word pn=0; //i forgot ww -static planar_buf_t huge *pp; +//static planar_buf_t huge *pp; float t; sword bakapee; pan_t pan; @@ -115,7 +114,11 @@ void main(int argc, char *argv[]) //mappalptr = map.tiles->btdata->palette; /* data */ - //++++p = bitmapLoadPcx("data/ptmp.pcx"); // load sprite + //++++ + p = malloc(48*128); + player[0].data = p; + *p = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite + *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite /* create the planar buffer */ @@ -150,7 +153,7 @@ void main(int argc, char *argv[]) // printf("Total used @ before palette initiation: %zu\n", oldfreemem-GetFreeSize()); //++++ player[0].data.offset=(paloffset/3); //++++ modexPalUpdate1(&player[0].data, &paloffset, 0, 0); - //modexPalUpdate1(p.palette); + modexPalUpdate1(p->palette); //++++0000 modexPalUpdate1(map.tiles->btdata->palette); //printf(" %d\n", sizeof(ptmp->data)); //printf("1: %d\n", paloffset); @@ -190,12 +193,14 @@ void main(int argc, char *argv[]) IN_initplayer(&player, 0); //IN_initplayer(&player, 1); + modexDrawSprite(mv[0].page, 16, 16, p); + modexDrawSprite(mv[0].page, 32+48, 16, (player[0].data)); #ifndef SPRITE modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15); //modexClearRegion(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 32, 15); #else //PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 24, 32, PLAYERBMPDATA); - PBUFSFUN(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, &pp); + PBUFSFUN(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, p); #endif if(!pageflipflop) modexShowPage(mv[1].page); @@ -262,7 +267,7 @@ void main(int argc, char *argv[]) #ifdef FADE if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } if(IN_KeyDown(22)){ - paloffset=0; modexPalBlack(); modexPalUpdate(&player[0].data, &paloffset, 0, 0); + paloffset=0; modexPalBlack(); modexPalUpdate(player[0].data, &paloffset, 0, 0); printf("1paloffset = %d\n", paloffset/3); modexPalUpdate(map.tiles->data, &paloffset, 0, 0); printf("2paloffset = %d\n", paloffset/3); @@ -297,6 +302,11 @@ void main(int argc, char *argv[]) modexClearRegion(mv[3].page, 0, 128, 28, 36, 15); //IN_UserInput(1,1); } + if(IN_KeyDown(66)) //f8 + { + modexDrawSprite(mv[0].page, 16, 16, p); + modexDrawSprite(mv[0].page, 32+48, 16, (player[0].data)); + } //TODO fmemtest into page /*if(IN_KeyDown(4+1)) //4 {