From: sparky4 Date: Tue, 17 Jan 2017 19:31:40 +0000 (-0600) Subject: palllist not being worked on right now... i will work on sprite animation VERY soon X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=bf06387d9965c5a922b00539f62ec705857fcb22;p=16.git palllist not being worked on right now... i will work on sprite animation VERY soon --- diff --git a/DEBUG.16W b/DEBUG.16W index 2ab6f890..8eb06ade 100755 --- a/DEBUG.16W +++ b/DEBUG.16W @@ -1,210 +1,210 @@ -Seg:0 Size:9823 Owner:0x0 +Seg:0 Size:9822 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++0000 -Seg:2727 Size:44 Owner:0x0 +Seg:2726 Size:44 Owner:0x0 + -Seg:2753 Size:256 Owner:0x1964 +Seg:2752 Size:256 Owner:0x1964 +++++ -Seg:2853 Size:256 Owner:0x1756 +Seg:2852 Size:256 Owner:0x1756 ++++ -Seg:2953 Size:256 Owner:0x1758 +Seg:2952 Size:256 Owner:0x1758 ++++ -Seg:2a53 Size:256 Owner:0x175a +Seg:2a52 Size:256 Owner:0x175a ++++ -Seg:2b53 Size:256 Owner:0x175c +Seg:2b52 Size:256 Owner:0x175c ++++ -Seg:2c53 Size:256 Owner:0x175e +Seg:2c52 Size:256 Owner:0x175e +++++ -Seg:2d53 Size:256 Owner:0x1760 +Seg:2d52 Size:256 Owner:0x1760 ++++ -Seg:2e53 Size:256 Owner:0x1762 +Seg:2e52 Size:256 Owner:0x1762 ++++ -Seg:2f53 Size:256 Owner:0x1764 +Seg:2f52 Size:256 Owner:0x1764 ++++ -Seg:3053 Size:256 Owner:0x1766 +Seg:3052 Size:256 Owner:0x1766 ++++ -Seg:3153 Size:256 Owner:0x1768 +Seg:3152 Size:256 Owner:0x1768 +++++ -Seg:3253 Size:256 Owner:0x176a +Seg:3252 Size:256 Owner:0x176a ++++ -Seg:3353 Size:256 Owner:0x176c +Seg:3352 Size:256 Owner:0x176c ++++ -Seg:3453 Size:256 Owner:0x176e +Seg:3452 Size:256 Owner:0x176e ++++ -Seg:3553 Size:256 Owner:0x1770 +Seg:3552 Size:256 Owner:0x1770 ++++ -Seg:3653 Size:256 Owner:0x1772 +Seg:3652 Size:256 Owner:0x1772 +++++ -Seg:3753 Size:256 Owner:0x1774 +Seg:3752 Size:256 Owner:0x1774 ++++ -Seg:3853 Size:256 Owner:0x1776 +Seg:3852 Size:256 Owner:0x1776 ++++ -Seg:3953 Size:256 Owner:0x1778 +Seg:3952 Size:256 Owner:0x1778 ++++ -Seg:3a53 Size:256 Owner:0x177a +Seg:3a52 Size:256 Owner:0x177a ++++ -Seg:3b53 Size:256 Owner:0x177c +Seg:3b52 Size:256 Owner:0x177c +++++ -Seg:3c53 Size:256 Owner:0x177e +Seg:3c52 Size:256 Owner:0x177e ++++ -Seg:3d53 Size:256 Owner:0x1780 +Seg:3d52 Size:256 Owner:0x1780 ++++ -Seg:3e53 Size:256 Owner:0x1782 +Seg:3e52 Size:256 Owner:0x1782 ++++ -Seg:3f53 Size:256 Owner:0x1784 +Seg:3f52 Size:256 Owner:0x1784 ++++ -Seg:4053 Size:256 Owner:0x1786 +Seg:4052 Size:256 Owner:0x1786 +++++ -Seg:4153 Size:256 Owner:0x1788 +Seg:4152 Size:256 Owner:0x1788 ++++ -Seg:4253 Size:256 Owner:0x178a +Seg:4252 Size:256 Owner:0x178a ++++ -Seg:4353 Size:256 Owner:0x178c +Seg:4352 Size:256 Owner:0x178c ++++ -Seg:4453 Size:256 Owner:0x178e +Seg:4452 Size:256 Owner:0x178e ++++ -Seg:4553 Size:256 Owner:0x1790 +Seg:4552 Size:256 Owner:0x1790 +++++ -Seg:4653 Size:256 Owner:0x1792 +Seg:4652 Size:256 Owner:0x1792 ++++ -Seg:4753 Size:256 Owner:0x1794 +Seg:4752 Size:256 Owner:0x1794 ++++ -Seg:4853 Size:256 Owner:0x1796 +Seg:4852 Size:256 Owner:0x1796 ++++ -Seg:4953 Size:256 Owner:0x1798 +Seg:4952 Size:256 Owner:0x1798 ++++ -Seg:4a53 Size:256 Owner:0x179a +Seg:4a52 Size:256 Owner:0x179a +++++ -Seg:4b53 Size:256 Owner:0x179c +Seg:4b52 Size:256 Owner:0x179c ++++ -Seg:4c53 Size:256 Owner:0x179e +Seg:4c52 Size:256 Owner:0x179e ++++ -Seg:4d53 Size:256 Owner:0x17a0 +Seg:4d52 Size:256 Owner:0x17a0 ++++ -Seg:4e53 Size:256 Owner:0x17a2 +Seg:4e52 Size:256 Owner:0x17a2 ++++ -Seg:4f53 Size:256 Owner:0x17a4 +Seg:4f52 Size:256 Owner:0x17a4 +++++ -Seg:5053 Size:256 Owner:0x17a6 +Seg:5052 Size:256 Owner:0x17a6 ++++ -Seg:5153 Size:256 Owner:0x17a8 +Seg:5152 Size:256 Owner:0x17a8 ++++ -Seg:5253 Size:256 Owner:0x17aa +Seg:5252 Size:256 Owner:0x17aa ++++ -Seg:5353 Size:256 Owner:0x17ac +Seg:5352 Size:256 Owner:0x17ac ++++ -Seg:5453 Size:256 Owner:0x17ae +Seg:5452 Size:256 Owner:0x17ae +++++ -Seg:5553 Size:256 Owner:0x17b0 +Seg:5552 Size:256 Owner:0x17b0 ++++ -Seg:5653 Size:256 Owner:0x17b2 +Seg:5652 Size:256 Owner:0x17b2 ++++ -Seg:5753 Size:256 Owner:0x17b4 +Seg:5752 Size:256 Owner:0x17b4 ++++ -Seg:5853 Size:256 Owner:0x17b6 +Seg:5852 Size:256 Owner:0x17b6 ++++ -Seg:5953 Size:256 Owner:0x17b8 +Seg:5952 Size:256 Owner:0x17b8 +++++ -Seg:5a53 Size:256 Owner:0x17ba +Seg:5a52 Size:256 Owner:0x17ba ++++ -Seg:5b53 Size:256 Owner:0x17bc +Seg:5b52 Size:256 Owner:0x17bc ++++ -Seg:5c53 Size:256 Owner:0x17be +Seg:5c52 Size:256 Owner:0x17be ++++ -Seg:5d53 Size:256 Owner:0x17c0 +Seg:5d52 Size:256 Owner:0x17c0 ++++ -Seg:5e53 Size:256 Owner:0x17c2 +Seg:5e52 Size:256 Owner:0x17c2 +++++ -Seg:5f53 Size:256 Owner:0x17c4 +Seg:5f52 Size:256 Owner:0x17c4 ++++ -Seg:6053 Size:256 Owner:0x17c6 +Seg:6052 Size:256 Owner:0x17c6 ++++ -Seg:6153 Size:256 Owner:0x17c8 +Seg:6152 Size:256 Owner:0x17c8 ++++ -Seg:6253 Size:256 Owner:0x17ca +Seg:6252 Size:256 Owner:0x17ca ++++ -Seg:6353 Size:256 Owner:0x17cc +Seg:6352 Size:256 Owner:0x17cc +++++ -Seg:6453 Size:256 Owner:0x17ce +Seg:6452 Size:256 Owner:0x17ce ++++ -Seg:6553 Size:256 Owner:0x17d0 +Seg:6552 Size:256 Owner:0x17d0 ++++ -Seg:6653 Size:256 Owner:0x17d2 +Seg:6652 Size:256 Owner:0x17d2 ++++ -Seg:6753 Size:256 Owner:0x17d4 +Seg:6752 Size:256 Owner:0x17d4 ++++ -Seg:6853 Size:256 Owner:0x17d6 +Seg:6852 Size:256 Owner:0x17d6 +++++ -Seg:6953 Size:256 Owner:0x17d8 +Seg:6952 Size:256 Owner:0x17d8 ++++ -Seg:6a53 Size:256 Owner:0x17da +Seg:6a52 Size:256 Owner:0x17da ++++ -Seg:6b53 Size:256 Owner:0x17dc +Seg:6b52 Size:256 Owner:0x17dc ++++ -Seg:6c53 Size:256 Owner:0x17de +Seg:6c52 Size:256 Owner:0x17de ++++ -Seg:6d53 Size:256 Owner:0x17e0 +Seg:6d52 Size:256 Owner:0x17e0 +++++ -Seg:6e53 Size:256 Owner:0x17e2 +Seg:6e52 Size:256 Owner:0x17e2 ++++ -Seg:6f53 Size:256 Owner:0x17e4 +Seg:6f52 Size:256 Owner:0x17e4 ++++ -Seg:7053 Size:256 Owner:0x17e6 +Seg:7052 Size:256 Owner:0x17e6 ++++ -Seg:7153 Size:256 Owner:0x17e8 +Seg:7152 Size:256 Owner:0x17e8 ++++ -Seg:7253 Size:256 Owner:0x17ea +Seg:7252 Size:256 Owner:0x17ea +++++ -Seg:7353 Size:256 Owner:0x17ec +Seg:7352 Size:256 Owner:0x17ec ++++ -Seg:7453 Size:256 Owner:0x17ee +Seg:7452 Size:256 Owner:0x17ee ++++ -Seg:7553 Size:256 Owner:0x17f0 +Seg:7552 Size:256 Owner:0x17f0 ++++ -Seg:7653 Size:256 Owner:0x17f2 +Seg:7652 Size:256 Owner:0x17f2 ++++ -Seg:7753 Size:256 Owner:0x17f4 +Seg:7752 Size:256 Owner:0x17f4 +++++ -Seg:7853 Size:256 Owner:0x17f6 +Seg:7852 Size:256 Owner:0x17f6 ++++ -Seg:7953 Size:256 Owner:0x17f8 +Seg:7952 Size:256 Owner:0x17f8 ++++ -Seg:7a53 Size:256 Owner:0x17fa +Seg:7a52 Size:256 Owner:0x17fa ++++ -Seg:7b53 Size:256 Owner:0x17fc +Seg:7b52 Size:256 Owner:0x17fc ++++ -Seg:7c53 Size:256 Owner:0x17fe +Seg:7c52 Size:256 Owner:0x17fe +++++ -Seg:7d53 Size:256 Owner:0x1800 +Seg:7d52 Size:256 Owner:0x1800 ++++ -Seg:7e53 Size:256 Owner:0x1802 +Seg:7e52 Size:256 Owner:0x1802 ++++ -Seg:7f53 Size:256 Owner:0x1804 +Seg:7f52 Size:256 Owner:0x1804 ++++ -Seg:8053 Size:256 Owner:0x1806 +Seg:8052 Size:256 Owner:0x1806 ++++ -Seg:8153 Size:256 Owner:0x1808 +Seg:8152 Size:256 Owner:0x1808 +++++ -Seg:8253 Size:256 Owner:0x180a +Seg:8252 Size:256 Owner:0x180a ++++ -Seg:8353 Size:256 Owner:0x180c +Seg:8352 Size:256 Owner:0x180c ++++ -Seg:8453 Size:256 Owner:0x180e +Seg:8452 Size:256 Owner:0x180e ++++ -Seg:8553 Size:256 Owner:0x1810 +Seg:8552 Size:256 Owner:0x1810 ++++ -Seg:8653 Size:256 Owner:0x1812 +Seg:8652 Size:256 Owner:0x1812 +++++ -Seg:8753 Size:256 Owner:0x1814 +Seg:8752 Size:256 Owner:0x1814 ++++ -Seg:8853 Size:256 Owner:0x1816 +Seg:8852 Size:256 Owner:0x1816 ++++ -Seg:8953 Size:256 Owner:0x1818 +Seg:8952 Size:256 Owner:0x1818 ++++ -Seg:8a53 Size:256 Owner:0x181a +Seg:8a52 Size:256 Owner:0x181a ++++ -Seg:8b53 Size:256 Owner:0x181c +Seg:8b52 Size:256 Owner:0x181c +++++ -Seg:8c53 Size:401 Owner:0xef32 +Seg:8c52 Size:401 Owner:0xef32 ++++++ -Seg:b753 Size:18604 Owner:0x0 +Seg:b752 Size:18605 Owner:0x0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W index 32ccf16f..456f1a62 100755 --- a/HEAP.16W +++ b/HEAP.16W @@ -1,57 +1,57 @@ == default == - USED block at 27490016 of size 136 - FREE block at 2749009e of size 68 - USED block at 274900e2 of size 50 - USED block at 27490114 of size 50 - USED block at 27490146 of size 50 - USED block at 27490178 of size 50 - USED block at 274901aa of size 50 - USED block at 274901dc of size 50 - USED block at 2749020e of size 50 - USED block at 27490240 of size 50 - USED block at 27490272 of size 50 - USED block at 274902a4 of size 50 - USED block at 274902d6 of size 50 - USED block at 27490308 of size 50 - FREE block at 2749033a of size 14 - USED block at 27490348 of size 20 - FREE block at 2749035c of size 7328 + USED block at 27480016 of size 136 + FREE block at 2748009e of size 68 + USED block at 274800e2 of size 50 + USED block at 27480114 of size 50 + USED block at 27480146 of size 50 + USED block at 27480178 of size 50 + USED block at 274801aa of size 50 + USED block at 274801dc of size 50 + USED block at 2748020e of size 50 + USED block at 27480240 of size 50 + USED block at 27480272 of size 50 + USED block at 274802a4 of size 50 + USED block at 274802d6 of size 50 + USED block at 27480308 of size 50 + FREE block at 2748033a of size 14 + USED block at 27480348 of size 20 + FREE block at 2748035c of size 7328 OK - end of heap == near == - USED block at 1748ef76 of size 12 - USED block at 1748ef82 of size 330 - USED block at 1748f0cc of size 52 - USED block at 1748f100 of size 20 - USED block at 1748f114 of size 20 - USED block at 1748f128 of size 20 - USED block at 1748f13c of size 20 - USED block at 1748f150 of size 20 - USED block at 1748f164 of size 3736 + USED block at 1747ef76 of size 12 + USED block at 1747ef82 of size 330 + USED block at 1747f0cc of size 52 + USED block at 1747f100 of size 20 + USED block at 1747f114 of size 20 + USED block at 1747f128 of size 20 + USED block at 1747f13c of size 20 + USED block at 1747f150 of size 20 + USED block at 1747f164 of size 3736 OK - end of heap == far == - USED block at 27490016 of size 136 - USED block at 2749009e of size 68 - USED block at 274900e2 of size 50 - USED block at 27490114 of size 50 - USED block at 27490146 of size 50 - USED block at 27490178 of size 50 - USED block at 274901aa of size 50 - USED block at 274901dc of size 50 - USED block at 2749020e of size 50 - USED block at 27490240 of size 50 - USED block at 27490272 of size 50 - USED block at 274902a4 of size 50 - USED block at 274902d6 of size 50 - USED block at 27490308 of size 50 - USED block at 2749033a of size 14 - USED block at 27490348 of size 20 - USED block at 2749035c of size 7328 + USED block at 27480016 of size 136 + USED block at 2748009e of size 68 + USED block at 274800e2 of size 50 + USED block at 27480114 of size 50 + USED block at 27480146 of size 50 + USED block at 27480178 of size 50 + USED block at 274801aa of size 50 + USED block at 274801dc of size 50 + USED block at 2748020e of size 50 + USED block at 27480240 of size 50 + USED block at 27480272 of size 50 + USED block at 274802a4 of size 50 + USED block at 274802d6 of size 50 + USED block at 27480308 of size 50 + USED block at 2748033a of size 14 + USED block at 27480348 of size 20 + USED block at 2748035c of size 7328 OK - end of heap Memory Type Total Used Free diff --git a/MMDUMP.16W b/MMDUMP.16W index 96cca1d9..8d3b00cf 100755 Binary files a/MMDUMP.16W and b/MMDUMP.16W differ diff --git a/src/lib/16_sprit.c b/src/lib/16_sprit.c index 2ca0a59a..e74b3907 100755 --- a/src/lib/16_sprit.c +++ b/src/lib/16_sprit.c @@ -152,8 +152,9 @@ void animate_spri(struct sprite *spri, global_game_variables_t *gv) */ void animate_spri(struct sprite *spri, global_game_variables_t *gv) { -#define VMEMPAGESIZE2 gv->video.page[0].pagesize+gv->video.page[1].pagesize -#define VMEMPAGEDATA2 gv->video.page[2].data +#define GVARVIDEO gv->video +#define VMEMPAGESIZE2 GVARVIDEO.page[0].pagesize+GVARVIDEO.page[1].pagesize +#define VMEMPAGEDATA2 GVARVIDEO.page[2].data unsigned int i,o,o2; int j; int x,y,rx,ry,w,h; int overdraw = 1; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks. @@ -176,25 +177,25 @@ void animate_spri(struct sprite *spri, global_game_variables_t *gv) // render box bounds. y does not need modification, but x and width must be multiple of 4 if (x >= overdraw) rx = (x - overdraw) & (~3); - else rx = -(gv->video.page[0].dx); + else rx = -(GVARVIDEO.page[0].dx); if (y >= overdraw) ry = (y - overdraw); - else ry = -(gv->video.page[0].dy); + else ry = -(GVARVIDEO.page[0].dy); h = spri->sprite_vrl_cont->vrl_header->height + overdraw + y - ry; w = (x + spri->sprite_vrl_cont->vrl_header->width + (overdraw*2) + 3 - rx) & (~3);//round up - if ((rx+w) > gv->video.page[0].width) w = gv->video.page[0].width-rx; - if ((ry+h) > gv->video.page[0].height) h = gv->video.page[0].height-ry; + if ((rx+w) > GVARVIDEO.page[0].width) w = GVARVIDEO.page[0].width-rx; + if ((ry+h) > GVARVIDEO.page[0].height) h = GVARVIDEO.page[0].height-ry; // block copy pattern to where we will draw the sprite vga_setup_wm1_block_copy(); o2 = VMEMPAGESIZE2; - o = (0x10000UL - (uint16_t)VMEMPAGEDATA2) + (ry * gv->video.page[0].stridew) + (rx >> 2); // source offscreen - for (i=0;i < h;i++,o += gv->video.page[0].stridew,o2 += (w >> 2)) vga_wm1_mem_block_copy(o2,o,w >> 2); + o = (0x10000UL - (uint16_t)VMEMPAGEDATA2) + (ry * GVARVIDEO.page[0].stridew) + (rx >> 2); // source offscreen + for (i=0;i < h;i++,o += GVARVIDEO.page[0].stridew,o2 += (w >> 2)) vga_wm1_mem_block_copy(o2,o,w >> 2); // must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally vga_restore_rm0wm0(); // replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0) - vga_state.vga_draw_stride_limit = (gv->video.page[0].width + 3 - x) >> 2;//round up + vga_state.vga_draw_stride_limit = (GVARVIDEO.page[0].width + 3 - x) >> 2;//round up vga_state.vga_draw_stride = w >> 2; vga_state.vga_graphics_ram = omemptr + VMEMPAGESIZE2; @@ -214,13 +215,13 @@ void animate_spri(struct sprite *spri, global_game_variables_t *gv) // block copy to visible RAM from offscreen vga_setup_wm1_block_copy(); o = VMEMPAGESIZE2; // source offscreen - o2 = (ry * gv->video.page[0].stridew) + (rx >> 2); // dest visible (original stride) - for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += gv->video.page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2); + o2 = (ry * GVARVIDEO.page[0].stridew) + (rx >> 2); // dest visible (original stride) + for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += GVARVIDEO.page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2); // must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally vga_restore_rm0wm0(); // restore stride - vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = gv->video.page[0].stridew; + vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = GVARVIDEO.page[0].stridew; // Depending on delay, update indices switch(spri->delay){ diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 7dd71342..8a29dc79 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -1196,9 +1196,11 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll } /* +void animate_spri(struct sprite *spri, global_game_variables_t *gv) { -#define VMEMPAGESIZE2 gv->video.page[0].pagesize+gv->video.page[1].pagesize -#define VMEMPAGEDATA2 gv->video.page[2].data +#define GVARVIDEO gv->video +#define VMEMPAGESIZE2 GVARVIDEO.page[0].pagesize+GVARVIDEO.page[1].pagesize +#define VMEMPAGEDATA2 GVARVIDEO.page[2].data unsigned int i,o,o2; int j; int x,y,rx,ry,w,h; int overdraw = 1; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks. @@ -1221,25 +1223,25 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll // render box bounds. y does not need modification, but x and width must be multiple of 4 if (x >= overdraw) rx = (x - overdraw) & (~3); - else rx = -(gv->video.page[0].dx); + else rx = -(GVARVIDEO.page[0].dx); if (y >= overdraw) ry = (y - overdraw); - else ry = -(gv->video.page[0].dy); + else ry = -(GVARVIDEO.page[0].dy); h = spri->sprite_vrl_cont->vrl_header->height + overdraw + y - ry; w = (x + spri->sprite_vrl_cont->vrl_header->width + (overdraw*2) + 3 - rx) & (~3);//round up - if ((rx+w) > gv->video.page[0].width) w = gv->video.page[0].width-rx; - if ((ry+h) > gv->video.page[0].height) h = gv->video.page[0].height-ry; + if ((rx+w) > GVARVIDEO.page[0].width) w = GVARVIDEO.page[0].width-rx; + if ((ry+h) > GVARVIDEO.page[0].height) h = GVARVIDEO.page[0].height-ry; // block copy pattern to where we will draw the sprite vga_setup_wm1_block_copy(); o2 = VMEMPAGESIZE2; - o = (0x10000UL - (uint16_t)VMEMPAGEDATA2) + (ry * gv->video.page[0].stridew) + (rx >> 2); // source offscreen - for (i=0;i < h;i++,o += gv->video.page[0].stridew,o2 += (w >> 2)) vga_wm1_mem_block_copy(o2,o,w >> 2); + o = (0x10000UL - (uint16_t)VMEMPAGEDATA2) + (ry * GVARVIDEO.page[0].stridew) + (rx >> 2); // source offscreen + for (i=0;i < h;i++,o += GVARVIDEO.page[0].stridew,o2 += (w >> 2)) vga_wm1_mem_block_copy(o2,o,w >> 2); // must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally vga_restore_rm0wm0(); // replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0) - vga_state.vga_draw_stride_limit = (gv->video.page[0].width + 3 - x) >> 2;//round up + vga_state.vga_draw_stride_limit = (GVARVIDEO.page[0].width + 3 - x) >> 2;//round up vga_state.vga_draw_stride = w >> 2; vga_state.vga_graphics_ram = omemptr + VMEMPAGESIZE2; @@ -1259,13 +1261,13 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll // block copy to visible RAM from offscreen vga_setup_wm1_block_copy(); o = VMEMPAGESIZE2; // source offscreen - o2 = (ry * gv->video.page[0].stridew) + (rx >> 2); // dest visible (original stride) - for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += gv->video.page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2); + o2 = (ry * GVARVIDEO.page[0].stridew) + (rx >> 2); // dest visible (original stride) + for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += GVARVIDEO.page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2); // must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally vga_restore_rm0wm0(); // restore stride - vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = gv->video.page[0].stridew; + vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = GVARVIDEO.page[0].stridew; // Depending on delay, update indices switch(spri->delay){ @@ -1292,16 +1294,18 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll } */ //void animate_spri(struct sprite *spri, global_game_variables_t *gv) -void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch, global_game_variables_t *gv) +void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch) { + struct sprite *spri = player[pn].ent->spri; sword x = player[pn].enti.x; sword y = player[pn].enti.y; - sword bx = x+16; //buffer's x - sword by = y+16; //buffer's y word dire=32; //direction sword qq; //scroll offset word ls = player[pn].enti.persist_aniframe; + spri->x=x; + spri->y=y; + switch(scrollswitch) { case 0: @@ -1319,13 +1323,11 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr //up dire*=player[pn].enti.d; y-=qq; - by-=4; break; case 3: // right dire*=(player[pn].enti.d-2); x+=qq; - bx+=4; break; case 2: break; @@ -1333,56 +1335,38 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr //down dire*=(player[pn].enti.d-2); y+=qq; - by+=4; break; case 1: //left dire*=(player[pn].enti.d+2); x-=qq; - bx-=4; break; } - //if(!pageflipflop) - // modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36); - //else{ - //copy old bg to page0 - //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0, 20, 36); - //update buffer - //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 20, 36); - //} -//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, - pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 36);*/ -// else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40); - //#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); //#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire); //#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire); +#define NFRAME1 +#define NFRAME2 +#define NFRAME3 +#define NFRAME4 switch(ls) { case 1: - FRAME1 + NFRAME1 break; case 2: - FRAME2 + NFRAME2 break; case 3: - FRAME3 + NFRAME3 break; case 4: - FRAME4 + NFRAME4 break; } -// if(2>ls && ls>=1) { FRAME1 }else -// if(3>ls && ls>=2) { FRAME2 }else -// if(4>ls && ls>=3) { FRAME3 }else -// if(5>ls && ls>=4) { FRAME4 } - //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32); - //printf("x=%d y=%d bx=%d by=%d\n", x, y, bx, by); pip->video->r=1; } diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 382b3857..f514f416 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -163,7 +163,7 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); //void qclean(); void shinku(global_game_variables_t *gv); void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch); -void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch, global_game_variables_t *gv); +void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch); // Move an entity around. Should actually be in 16_entity boolean ZC_walk2(entity_t *ent, map_view_t *map_v);