From: sparky4 Date: Sun, 23 Nov 2014 23:35:12 +0000 (-0600) Subject: modified: Project 16.bfproject X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=48360bc891427eca1d1598644103becbbe304cee;p=16.git modified: Project 16.bfproject modified: modex16.c modified: modex16.h modified: pcxtest.exe new file: ptmp0.pcx modified: scroll.c modified: scroll.exe modified: test.exe modified: test2.exe --- diff --git a/Project 16.bfproject b/Project 16.bfproject index 698c75de..cb3ed63a 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -1,9 +1,10 @@ c2e.convert_special: 0 e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:0:0:0: -openfiles: /dos/z/16/scroll.c:4669:4145:1: -openfiles: /dos/z/16/modex16.c:2077:556:0: -openfiles: /dos/z/16/modex16.h:1150:0:0: +openfiles: /dos/z/16/scroll.c:12536:10702:1: +openfiles: /dos/z/16/modex16.c:15726:15322:0: +openfiles: /dos/z/16/modex16.h:2230:1258:0: +openfiles: /dos/z/16/pcxtest.c:1339:797:0: snr_recursion_level: 0 convertcolumn_horizontally: 0 adv_open_matchname: 0 @@ -18,20 +19,25 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16 wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: modexShowPage(spri->page); +ssearch_text: waitb snr_casesens: 1 view_blocks: 1 name: project 16 -replacelist: てすと -replacelist: \t -replacelist: putPixel_X -replacelist: SCREEN_WIDTH -replacelist: SCREEN_HEIGHT replacelist: modexClearPlayer(mv->page replacelist: animatePlayer(draw replacelist: animatePlayer(spri replacelist: modexDrawSpriteRegion(spri replacelist: spri->page = modexDefaultPage(); +replacelist: screen2=modexNextPage(mv.page); +replacelist: spri->page=draw->page; +replacelist: mv +replacelist: src +replacelist: mv->page, src->page, +replacelist: modexShowPage(spri +replacelist: modexShowPage(draw +replacelist: wPage(spri +replacelist: 34); +replacelist: bg fb_show_hidden_f: 0 editor_tab_width: 4 show_visible_spacing: 1 @@ -45,7 +51,6 @@ ssearch_regex: 0 e2c.convert_iso: 0 ssearch_casesens: 0 charmap_block: 1 -recent_files: file:///dos/z/16/16/lib/x/MXVS.ASM recent_files: file:///dos/z/16/16/lib/x/MAKEFILE recent_files: file:///dos/z/16/16/lib/x/MODEX.DEF recent_files: file:///dos/z/4x4_16/modex/DEMO01.PAS @@ -95,6 +100,7 @@ recent_files: file:///dos/z/16/scroll.c recent_files: file:///dos/z/16/doc/project.txt recent_files: file:///dos/z/16/modex16.h recent_files: file:///dos/z/16/modex16.c +recent_files: file:///dos/z/16/pcxtest.c snr_replacetype: 0 savedir: file:///dos/z/16 spell_check_default: 1 @@ -106,21 +112,21 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: SC_INDEX -searchlist: gq -searchlist: setvideo -searchlist: clock -searchlist: vga -searchlist: color 0 -searchlist: sprite -searchlist: clear -searchlist: modexClearRegion(mv->page -searchlist: animatePlayer(spri -searchlist: color -searchlist: modexShowPage(spri->page); -searchlist: animatePlayer(draw -searchlist: modexDrawSpriteRegion(draw -searchlist: spri->page=NULL; +searchlist: &mv, &src, +searchlist: modexCopyPageRegion +searchlist: modexShowPage(draw +searchlist: ->page +searchlist: w->page +searchlist: modexShowPage(spri +searchlist: howPage(draw +searchlist: wPage(draw +searchlist: 32); +searchlist: 33) +searchlist: 3) +searchlist: draw +searchlist: 34) +searchlist: 0x3DA +searchlist: waitb autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 diff --git a/modex16.c b/modex16.c index 256a08ef..8828d9ec 100644 --- a/modex16.c +++ b/modex16.c @@ -214,61 +214,6 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { } } - -void -modexClearPlayer(page_t *page, int x, int y, int w, int h) { - word pageOff = (word) page->data; - word xoff=x/4; /* xoffset that begins each row */ - word scanCount=w/4; /* number of iterations per row (excluding right clip)*/ - word poffset = pageOff + y*(page->width/4) + xoff; /* starting offset */ - word nextRow = page->width/4-scanCount-1; /* loc of next row */ - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ - byte rclip[] = {0x00, 0x01, 0x03, 0x07}; - byte left = lclip[x&0x03]; - byte right = rclip[(x+w)&0x03]; - - /* handle the case which requires an extra group */ - if((x & 0x03) && !((x+w) & 0x03)) { - right=0x0f; - } - - __asm { - MOV AX, SCREEN_SEG ; go to the VGA memory - MOV ES, AX - MOV DI, poffset ; go to the first pixel - MOV DX, SC_INDEX ; point to the map mask - MOV AL, MAP_MASK - OUT DX, AL - INC DX - MOV AL, NULL ; get ready to write colors - SCAN_START: - MOV CX, scanCount ; count the line - MOV BL, AL ; remember color - MOV AL, left ; do the left clip - OUT DX, AL ; set the left clip - MOV AL, BL ; restore color - STOSB ; write the color - DEC CX - JZ SCAN_DONE ; handle 1 group stuff - - ;-- write the main body of the scanline - MOV BL, AL ; remember color - MOV AL, 0x0f ; write to all pixels - OUT DX, AL - MOV AL, BL ; restore color - REP STOSB ; write the color - SCAN_DONE: - MOV BL, AL ; remeber color - MOV AL, right - OUT DX, AL ; do the right clip - MOV AL, BL ; restore color - STOSB ; write pixel - ADD DI, nextRow ; go to the next row - DEC h - JNZ SCAN_START - } -} - void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) { diff --git a/modex16.h b/modex16.h index 9ee36908..65b37d9d 100644 --- a/modex16.h +++ b/modex16.h @@ -30,7 +30,6 @@ void modexShowPage(page_t *page); void modexPanPage(page_t *page, int dx, int dy); void modexSelectPlane(byte plane); void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color); -void modexClearPlayer(page_t *page, int x, int y, int w, int h); void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp); void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); void modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp); diff --git a/pcxtest.exe b/pcxtest.exe index f70b085b..de765ece 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/ptmp0.pcx b/ptmp0.pcx new file mode 100644 index 00000000..e6693f53 Binary files /dev/null and b/ptmp0.pcx differ diff --git a/scroll.c b/scroll.c index dd84b2af..8f27cbb0 100644 --- a/scroll.c +++ b/scroll.c @@ -105,7 +105,7 @@ void main() { player.x = player.tx*TILEWH; player.y = player.ty*TILEWH; modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp); - modexCopyPageRegion(bg->page, spri->page, player.x-4, player.y-TILEWH-2, player.x-4, player.y-TILEWH-2, 24, 34); + modexCopyPageRegion(bg->page, spri->page, player.x-4, player.y-TILEWH-2, player.x-4, player.y-TILEWH-2, 24, 36); modexShowPage(spri->page); while(!keyp(1)) { @@ -114,6 +114,7 @@ void main() { //when player.tx or player.ty == 0 or player.tx == 20 or player.ty == 15 then stop because that is edge of map and you do not want to walk of the map //TODO: render the player properly with animation and sprite sheet + //TODO: fexible speeds if(keyp(77)) { if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10) @@ -448,9 +449,10 @@ mapDrawCol(map_view_t *mv, int tx, int ty, word x) { void animatePlayer(map_view_t *mv, map_view_t *src, short d1, short d2, int x, int y, int ls, bitmap_t *bmp) { - int qq; - int lo = ((TILEWH / SPEED) / 3); - int loo = (ls + lo); + short dire=32*d1; + short qq; + short lo = ((TILEWH / SPEED) / 3); + short loo = (ls + lo); if(d2==0) qq = 0; else qq = ((ls+1)*SPEED); @@ -458,47 +460,31 @@ void animatePlayer(map_view_t *mv, map_view_t *src, short d1, short d2, int x, i { case 0: //up - if(ls<1) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); } - if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); } - if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); } - if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); } + x=x-4; + y=y-qq-TILEWH; break; case 1: // right - if(ls<1) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); } - if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); } - if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); } - if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); } + x=x+qq-4; + y=y-TILEWH; break; case 2: //down - if(ls<1) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); } - if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); } - if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); } - if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34); - modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); } + x=x-4; + y=y+qq-TILEWH; break; case 3: //left - if(ls<1) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); } - if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); } - if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); } - if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder(); - modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); } + x=x-qq-4; + y=y-TILEWH; break; - } + } //TODO: make flexible animation thingy + if(ls<1) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder(); + modexDrawSpriteRegion(mv->page, x, y, 24, dire, 24, 32, bmp); }else + if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder(); + modexDrawSpriteRegion(mv->page, x, y, 48, dire, 24, 32, bmp); }else + if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder(); + modexDrawSpriteRegion(mv->page, x, y, 0, dire, 24, 32, bmp); }else + if(8>=ls && ls>=7) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder(); + modexDrawSpriteRegion(mv->page, x, y, 24, dire, 24, 32, bmp); }else ls-=ls; } diff --git a/scroll.exe b/scroll.exe index f7c0fafb..93e386f9 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/test.exe b/test.exe index 38a4eb9d..99404b1a 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index c71ba0e2..2b870eff 100644 Binary files a/test2.exe and b/test2.exe differ