From: sparky4 Date: Wed, 22 Jun 2016 14:50:44 +0000 (-0500) Subject: meh i should organize gvar and mv soon and use the memory manager and i cleaned the... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=3874a9cb6927a17c012c93c7bf306241253f8812;p=16.git meh i should organize gvar and mv soon and use the memory manager and i cleaned the code up a bit --- diff --git a/src/lib/modex16.c b/src/lib/modex16.c index eeba90fc..85651bac 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -307,14 +307,14 @@ modexShowPage(page_t *page) { low_address = LOW_ADDRESS | (offset << 8); /* wait for appropriate timing and then program CRTC */ - //while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); + while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); outpw(CRTC_INDEX, high_address); outpw(CRTC_INDEX, low_address); outp(CRTC_INDEX, 0x13); outp(CRTC_DATA, crtcOffset); /* wait for one retrace */ - //while (!(inp(INPUT_STATUS_1) & VRETRACE)); + while (!(inp(INPUT_STATUS_1) & VRETRACE)); /* do PEL panning here */ outp(AC_INDEX, 0x33); diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index d4082a6c..c56efd91 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -661,7 +661,6 @@ void mapGoTo(map_view_t *mv, int tx, int ty) modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 32, 16, 16, 32); } - void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { @@ -794,14 +793,8 @@ void shinku(global_game_variables_t *gv) { word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen - word w = 64; - word h = 8; - word col = 7; - word bgcol = 0; - word type = 1; + word w = 64, h = 8, col = 7, bgcol = 0, type = 1; byte o,o2,i; - //modexClearRegion(&gv->video.page[2], 0, 0, gv->video.page[2].sw, gv->video.page[2].sh, 47); - //modexClearRegion(&gv->video.page[3], 0, 0, gv->video.page[3].sw, gv->video.page[3].sh, 45); //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4); /* block copy to visible RAM from offscreen */ // vga_setup_wm1_block_copy(); @@ -906,8 +899,6 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll break; } -///*!*/(pip->video->p) - #ifdef SPRITE /*#define FRAME1 PBUFSFUN(pip[PAGENUMB].page, 0, 0, 32, dire, 16, 32, PLAYERBMPDATA); #define FRAME2 PBUFSFUN(pip[PAGENUMB].page, 0, 0, 16, dire, 16, 32, PLAYERBMPDATA); @@ -925,7 +916,7 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll #endif if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36); - else modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 16, 0, 16, 36); + else modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0, 16, 32); //modexCopyPageRegion(page_t *dest, page_t *src, word sx, word sy, word dx, word dy, word width, word height); //modexCopyPageRegion(pip[3].page, pip[!(pip->video->p)].page, x-4, y-4, 0, 128, 28, 36); /*modexCopyPageRegion(pip[pip->video->p].page, @@ -956,7 +947,4 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll // delay(500); //printf("x=%d y=%d bx=%d by=%d\n", x, y, bx, by); pip->video->r=1; - //TODO: mask copy //modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40); - //modexClearRegion(top->page, 66, 66, 2, 40, 0); - //modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40); } diff --git a/src/scroll.c b/src/scroll.c index 1490ad0b..56dd70fc 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -28,7 +28,7 @@ #define MODEX //this is for mode x initiating //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ -bitmap_t *p; +//bitmap_t *p; global_game_variables_t gvar; static map_t map; player_t player[MaxPlayers]; @@ -113,9 +113,7 @@ void main(int argc, char *argv[]) //mappalptr = map.tiles->btdata->palette; /* data */ - p = malloc(48*128); //TODO use exmm - player[0].data = p; - *p = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite + player[0].data = malloc(48*128); //TODO use exmm *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite @@ -151,7 +149,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(player[0].data->palette); //++++0000 modexPalUpdate1(map.tiles->btdata->palette); //printf(" %d\n", sizeof(ptmp->data)); //printf("1: %d\n", paloffset); @@ -196,7 +194,7 @@ void main(int argc, char *argv[]) //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, p); + PBUFSFUN(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, player[0].data); #endif if(!pageflipflop) modexShowPage(mv[1].page); @@ -300,7 +298,7 @@ void main(int argc, char *argv[]) } if(IN_KeyDown(66)) //f8 { - modexDrawSprite(mv[0].page, 16, 16, p); +// modexDrawSprite(mv[0].page, 16, 16, p); modexDrawSprite(mv[0].page, 32+48, 16, (player[0].data)); } //TODO fmemtest into page