From ee5eabc08d125136522d536bfe93f67f644ed20b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 20 Jun 2016 12:19:06 -0500 Subject: [PATCH] readded OLD sprite drawing now for fixing the background stuff ww --- scroll.l16 | 180 +++------------------------------------------ src/lib/modex16.c | 2 +- src/lib/scroll16.c | 32 ++++---- 3 files changed, 28 insertions(+), 186 deletions(-) diff --git a/scroll.l16 b/scroll.l16 index 9e997b12..2849d369 100755 --- a/scroll.l16 +++ b/scroll.l16 @@ -71,86 +71,6 @@ x=164 y=112 bx=164 by=128 x=168 y=112 bx=164 by=128 x=172 y=112 bx=164 by=128 x=176 y=112 bx=164 by=128 -x=164 y=112 bx=164 by=128 -x=168 y=112 bx=164 by=128 -x=172 y=112 bx=164 by=128 -x=176 y=112 bx=164 by=128 -x=164 y=112 bx=164 by=128 -x=168 y=112 bx=164 by=128 -x=172 y=112 bx=164 by=128 -x=176 y=112 bx=164 by=128 -x=164 y=112 bx=168 by=128 -x=168 y=112 bx=172 by=128 -x=172 y=112 bx=176 by=128 -x=176 y=112 bx=180 by=128 -x=172 y=112 bx=168 by=128 -x=168 y=112 bx=164 by=128 -x=164 y=112 bx=160 by=128 -x=160 y=112 bx=156 by=128 -x=156 y=112 bx=156 by=128 -x=152 y=112 bx=156 by=128 -x=148 y=112 bx=156 by=128 -x=144 y=112 bx=156 by=128 -x=156 y=112 bx=156 by=128 -x=152 y=112 bx=156 by=128 -x=148 y=112 bx=156 by=128 -x=144 y=112 bx=156 by=128 -x=156 y=112 bx=156 by=128 -x=152 y=112 bx=156 by=128 -x=148 y=112 bx=156 by=128 -x=144 y=112 bx=156 by=128 -x=156 y=112 bx=156 by=128 -x=152 y=112 bx=156 by=128 -x=148 y=112 bx=156 by=128 -x=144 y=112 bx=156 by=128 -x=164 y=112 bx=164 by=128 -x=168 y=112 bx=164 by=128 -x=172 y=112 bx=164 by=128 -x=176 y=112 bx=164 by=128 -x=164 y=112 bx=164 by=128 -x=168 y=112 bx=164 by=128 -x=172 y=112 bx=164 by=128 -x=176 y=112 bx=164 by=128 -x=164 y=112 bx=164 by=128 -x=168 y=112 bx=164 by=128 -x=172 y=112 bx=164 by=128 -x=176 y=112 bx=164 by=128 -x=164 y=112 bx=164 by=128 -x=168 y=112 bx=164 by=128 -x=172 y=112 bx=164 by=128 -x=176 y=112 bx=164 by=128 -x=164 y=112 bx=168 by=128 -x=168 y=112 bx=172 by=128 -x=172 y=112 bx=176 by=128 -x=176 y=112 bx=180 by=128 -x=180 y=112 bx=184 by=128 -x=184 y=112 bx=188 by=128 -x=188 y=112 bx=192 by=128 -x=192 y=112 bx=196 by=128 -x=196 y=112 bx=200 by=128 -x=200 y=112 bx=204 by=128 -x=204 y=112 bx=208 by=128 -x=208 y=112 bx=212 by=128 -x=204 y=112 bx=200 by=128 -x=200 y=112 bx=196 by=128 -x=196 y=112 bx=192 by=128 -x=192 y=112 bx=188 by=128 -x=188 y=112 bx=184 by=128 -x=184 y=112 bx=180 by=128 -x=180 y=112 bx=176 by=128 -x=176 y=112 bx=172 by=128 -x=172 y=112 bx=168 by=128 -x=168 y=112 bx=164 by=128 -x=164 y=112 bx=160 by=128 -x=160 y=112 bx=156 by=128 -x=156 y=112 bx=156 by=128 -x=152 y=112 bx=156 by=128 -x=148 y=112 bx=156 by=128 -x=144 y=112 bx=156 by=128 -x=156 y=112 bx=156 by=128 -x=152 y=112 bx=156 by=128 -x=148 y=112 bx=156 by=128 -x=144 y=112 bx=156 by=128 x=156 y=112 bx=156 by=128 x=152 y=112 bx=156 by=128 x=148 y=112 bx=156 by=128 @@ -223,106 +143,26 @@ x=156 y=112 bx=156 by=128 x=152 y=112 bx=156 by=128 x=148 y=112 bx=156 by=128 x=144 y=112 bx=156 by=128 -x=156 y=112 bx=152 by=128 -x=152 y=112 bx=148 by=128 -x=148 y=112 bx=144 by=128 -x=144 y=112 bx=140 by=128 -x=144 y=116 bx=144 by=132 -x=144 y=120 bx=144 by=132 -x=144 y=124 bx=144 by=132 -x=144 y=128 bx=144 by=132 -x=144 y=116 bx=144 by=132 -x=144 y=120 bx=144 by=132 -x=144 y=124 bx=144 by=132 -x=144 y=128 bx=144 by=132 -x=140 y=112 bx=136 by=128 -x=136 y=112 bx=132 by=128 -x=132 y=112 bx=128 by=128 -x=128 y=112 bx=124 by=128 -x=124 y=112 bx=120 by=128 -x=120 y=112 bx=116 by=128 -x=116 y=112 bx=112 by=128 -x=112 y=112 bx=108 by=128 -x=108 y=112 bx=104 by=128 -x=104 y=112 bx=100 by=128 -x=100 y=112 bx=96 by=128 -x=96 y=112 bx=92 by=128 -x=92 y=112 bx=88 by=128 -x=88 y=112 bx=84 by=128 -x=84 y=112 bx=80 by=128 -x=80 y=112 bx=76 by=128 -x=76 y=112 bx=72 by=128 -x=72 y=112 bx=68 by=128 -x=68 y=112 bx=64 by=128 -x=64 y=112 bx=60 by=128 -x=60 y=112 bx=56 by=128 -x=56 y=112 bx=52 by=128 -x=52 y=112 bx=48 by=128 -x=48 y=112 bx=44 by=128 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 -x=48 y=116 bx=48 by=132 -x=48 y=120 bx=48 by=132 -x=48 y=124 bx=48 by=132 -x=48 y=128 bx=48 by=132 Project 16 scroll.exe. This is just a test file! -version Jun 20 2016 11:28:21 -tx: 0 ty: 13 +version Jun 20 2016 11:56:31 +tx: 0 ty: 0 player vars: - x: 48 y: 128 - tx: 3 ty: 21 - triggx: 3 triggy: 22 + x: 160 y: 128 + tx: 10 ty: 8 + triggx: 10 triggy: 9 hp: 4 q: 1 player.info.dir: 2 player.d: 2 pdir=4 - tile data value at player trigger position: 1 + tile data value at player trigger position: 0 Virtual Screen: 352x272 Screen: 320x240 virtual tile resolution: 22x17 tile resolution: 20x15 middle tile position: 10x8 -video memory remaining: 65535 -page [0]=(a000:4780) size=23936 w=352 h=272 sw=320 sh=240 pi=4 +video memory remaining: 6399 +page [0]=(a000:0000) size=23936 w=352 h=272 sw=320 sh=240 pi=4 [1]=(a000:5d80) size=23936 w=352 h=272 sw=320 sh=240 pi=4 - [2]=(a000:bb00) size=1024 w=64 h=64 sw=64 sh=64 pi=1408 - [3]=(a000:bf00) size=16640 w=320 h=208 sw=320 sh=208 pi=1408 + [2]=(a000:bb00) size=5632 w=352 h=64 sw=352 sh=64 pi=1408 + [3]=(a000:bb00) size=5632 w=352 h=64 sw=352 sh=64 pi=1408 gvar.video.p=0 gvar.video.r=0 pageflipflop=1 diff --git a/src/lib/modex16.c b/src/lib/modex16.c index c9930e4a..eeba90fc 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -314,7 +314,7 @@ modexShowPage(page_t *page) { 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 6029069e..bf1e8849 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -658,7 +658,7 @@ void mapGoTo(map_view_t *mv, int tx, int ty) // vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15! // } // } - modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 16, 0, 16, 32); + modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 32, 16, 16, 32); } @@ -836,8 +836,8 @@ void shinku(global_game_variables_t *gv) break; case 1: //turn this off if XT - modexWaitBorder(); - //vga_wait_for_vsync(); + //modexWaitBorder(); + vga_wait_for_vsync(); gv->kurokku.frames_per_second=60; break; } @@ -859,8 +859,8 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll { sword x = player[pn].x; sword y = player[pn].y; - sword bx = player[pn].x; //buffer's x - sword by = player[pn].y; //buffer's 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].persist_aniframe; @@ -907,17 +907,17 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll } ///*!*/(pip->video->p) -#define PAGENUMB 3 +#define PAGENUMB 0 #ifdef SPRITE -// #define FRAME1 PBUFSFUN(pip[1].page, x, y, 32, dire, 16, 32, PLAYERBMPDATA); -// #define FRAME2 PBUFSFUN(pip[1].page, x, y, 16, dire, 16, 32, PLAYERBMPDATA); -// #define FRAME3 PBUFSFUN(pip[1].page, x, y, 0, dire, 16, 32, PLAYERBMPDATA); -// #define FRAME4 PBUFSFUN(pip[1].page, x, y, 16, dire, 16, 32, PLAYERBMPDATA); -#define FRAME1 PBUFSFUN(pip[PAGENUMB].page, 0, 0, 32, dire, 16, 32, PLAYERBMPDATA); +/*#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); #define FRAME3 PBUFSFUN(pip[PAGENUMB].page, 0, 0, 0, dire, 16, 32, PLAYERBMPDATA); -#define FRAME4 PBUFSFUN(pip[PAGENUMB].page, 0, 0, 16, dire, 16, 32, PLAYERBMPDATA); +#define FRAME4 PBUFSFUN(pip[PAGENUMB].page, 0, 0, 16, dire, 16, 32, PLAYERBMPDATA);*/ +#define FRAME1 PBUFSFUN(pip[PAGENUMB].page, x, y, 32, dire, 16, 32, PLAYERBMPDATA); +#define FRAME2 PBUFSFUN(pip[PAGENUMB].page, x, y, 16, dire, 16, 32, PLAYERBMPDATA); +#define FRAME3 PBUFSFUN(pip[PAGENUMB].page, x, y, 0, dire, 16, 32, PLAYERBMPDATA); +#define FRAME4 PBUFSFUN(pip[PAGENUMB].page, x, y, 16, dire, 16, 32, PLAYERBMPDATA); #else #define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+dire); #define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire); @@ -926,7 +926,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, 0, 0, 16, 32); + else modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 16, 0, 16, 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, @@ -952,8 +952,10 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll // 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, 16, 32); - printf("x=%d y=%d bx=%d by=%d\n", x, y, bx, by); +// delay(500); + //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 16, 32); +// 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); -- 2.39.5