From c721ed46c712b88421969e72e995f5f847494436 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 12 Jan 2017 18:28:14 -0600 Subject: [PATCH] i am going to work on a really big area of code it will be on the refresh system, the walking/scrolling system, things that use showpage, adding disableing 8087 functions if no 8087 detected, and a bunch of other things i cannot remember off the top of my head because i am BURNT. I need a small break~ -- -- -- -- update! i am working on this i made ZC_WALK and i am going to move to VRL/VRS soon! . --- src/lib/scroll16.c | 26 +++++++++++++------------- src/lib/scroll16.h | 8 ++++---- src/scroll.c | 6 ++++-- src/test.c | 5 ----- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 9fae78b3..cab3823f 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -68,7 +68,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14); #endif @@ -112,7 +112,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10); #endif @@ -156,7 +156,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9); #endif @@ -200,7 +200,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12); #endif @@ -261,7 +261,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) else { #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14); #endif @@ -299,7 +299,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) else { #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10); #endif @@ -337,7 +337,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) else { #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9); #endif @@ -375,7 +375,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) else { #ifdef SPRITE - PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR); + modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR); #else modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12); #endif @@ -925,7 +925,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((dbg_mapdata[i])+1)); //modexprint(page, x, y, 1, 15, 0, (char const *)(t->debug_data[i])); #else - PBUFBFUN (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); + modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); /* then the sprite. note modding ram ptr means we just draw to (x&3,0) */ //draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header)); //modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); @@ -1147,10 +1147,10 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll } #ifdef SPRITE -#define FRAME1 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME2 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME3 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME4 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR); #else #define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire); #define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire); diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 7830f1f9..8feb3f48 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -40,15 +40,15 @@ #include #include -#define SPRITE +//#define SPRITE //#define TILERENDER -extern void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); +//extern void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); //modexDrawSpritePBufRegion //modexDrawBmpPBufRegion -#define PBUFSFUN modexDrawSpriteRegion -#define PBUFBFUN modexDrawBmpRegion +//#define PBUFSFUN modexDrawSpriteRegion +//#define PBUFBFUN modexDrawBmpRegion #define PLAYERBMPDATAVAR player[pn].data #define PLAYERBMPDATA *PLAYERBMPDATAVAR diff --git a/src/scroll.c b/src/scroll.c index ceb76bcc..cfb6ab2e 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -123,13 +123,13 @@ void main(int argc, char *argv[]) #ifndef SPRITE modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15); #else - PBUFSFUN(&gvar.video.page[0], player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, PCXBMPPTR); + modexDrawSpriteRegion(&gvar.video.page[0], player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, PCXBMPPTR); #endif if(!pageflipflop) VL_ShowPage(mv[1].page, 0, 0);//modexShowPage(mv[1].page); else ZC_ShowMV(&mv, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p) - modexDrawBmp(&gvar.video.page[0], 16, 16, PCXBMPPTR); + //modexDrawBmp(&gvar.video.page[0], 16, 16, PCXBMPPTR); /* buffer pages */ // modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47); // modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45); @@ -219,11 +219,13 @@ void main(int argc, char *argv[]) modexClearRegion(mv[3].page, 0, 0, 20, 36, 15); //IN_UserInput(1,1); } +#ifdef SPRITE if(IN_KeyDown(66)) //f8 { // modexDrawSprite(mv[0].page, 16, 16, &p); modexDrawSprite(mv[0].page, 32+72, 16, (PCXBMPVAR)); } +#endif FUNCTIONKEYFUNCTIONS; //9 diff --git a/src/test.c b/src/test.c index bd0f7e7c..49d71602 100755 --- a/src/test.c +++ b/src/test.c @@ -26,10 +26,6 @@ #include "src/lib/scroll16.h" #include "src/lib/bakapee.h" -#define PCXBMPVAR player[0].data -#define PCXBMP *PCXBMPVAR -#define PCXBMPPTR PCXBMPVAR - static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ void main(int argc, char *argv[]) @@ -193,7 +189,6 @@ void main(int argc, char *argv[]) // if(i>PAL_SIZE) i=0; }//9*/ if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.panp]); IN_UserInput(1,1); }//p - if(IN_KeyDown(sc_F8)){ modexDrawSprite(&gvar.video.page[0], 160, 120, PCXBMPPTR); IN_UserInput(1,1); }//f8 //VL_ShowPage(&gvar.video.page[gvar.video.panp], 0, 0); ZC_ShowMV(&mv, 0, 0); } -- 2.39.5