From eb6ad448312af4d538f16064b27c40d78d82b79f Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 4 Dec 2014 19:20:14 -0600 Subject: [PATCH] modified: Project 16.bfproject modified: scroll.exe modified: src/scroll.c --- Project 16.bfproject | 33 +- scroll.exe | Bin 48811 -> 49040 bytes src/scroll.c | 1232 +++++++++++++++++++++--------------------- 3 files changed, 639 insertions(+), 626 deletions(-) diff --git a/Project 16.bfproject b/Project 16.bfproject index d88f2d07..efeda4a8 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -2,13 +2,14 @@ c2e.convert_special: 0 e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:60:0:0: openfiles: /dos/z/16/16.c:0:0:0: -openfiles: /dos/z/16/src/scroll.c:4410:3763:1: +openfiles: /dos/z/16/src/scroll.c:9353:8838:1: openfiles: /dos/z/16/src/lib/scroll.c:1666:0:0: openfiles: /dos/z/16/src/lib/scroll.h:1961:241:0: +openfiles: /dos/z/16/src/v2/source/ENGINE/CONTROLS.C:2441:1179:0: openfiles: /dos/z/16/src/lib/modex16.c:13778:13034:0: openfiles: /dos/z/16/src/lib/modex16.h:2059:913:0: openfiles: /dos/z/16/src/pcxtest.c:68:0:0: -openfiles: /dos/z/16/src/lib/dos_kb.c:107:0:0: +openfiles: /dos/z/16/src/lib/dos_kb.c:3352:2801:0: openfiles: /dos/z/16/src/lib/dos_kb.h:62:0:0: openfiles: /dos/z/16/src/lib/lib_head.h:165:0:0: openfiles: /dos/z/16/src/palettec.c:176:0:0: @@ -32,10 +33,10 @@ view_left_panel: 0 default_mime_type: text/plain e2c.convert_xml: 1 c2e.convert_iso: 0 -opendir: file:///dos/z/16/16 +opendir: file:///dos/z/16/src/v2/source/ENGINE wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: modexPalUpdate +ssearch_text: UnPress( snr_casesens: 1 view_blocks: 1 name: project 16 @@ -67,7 +68,6 @@ ssearch_regex: 0 e2c.convert_iso: 0 ssearch_casesens: 0 charmap_block: 1 -recent_files: file:///dos/z/16/16/modex16/modex16.h recent_files: file:///dos/z/16/16/modex16/scroll.c recent_files: file:///dos/z/16/16/modex16/dos_kb.c recent_files: file:///dos/z/16/16/modex16/makefile @@ -96,27 +96,28 @@ recent_files: file:///dos/z/keen-src/id_rf.h recent_files: file:///dos/z/keen-src/id_rf_a.asm recent_files: file:///dos/z/keen-src/id_rf.c recent_files: file:///dos/z/16/gfx.pal -recent_files: file:///dos/z/16/src/test.c +recent_files: file:///dos/z/16/src/scroll.c recent_files: file:///dos/z/16/doc/project.txt -recent_files: file:///dos/z/16/src/lib/modex16.h -recent_files: file:///dos/z/16/src/lib/modex16.c recent_files: file:///dos/z/16/src/lib/scroll.h recent_files: file:///dos/z/16/src/lib/scroll.c +recent_files: file:///dos/z/16/src/lib/modex16.h +recent_files: file:///dos/z/16/src/pcxtest.c +recent_files: file:///dos/z/16/16.c +recent_files: file:///dos/z/16/src/lib/modex16.c recent_files: file:///dos/z/16/src/lib/dos_kb.c recent_files: file:///dos/z/16/src/lib/dos_kb.h recent_files: file:///dos/z/16/src/lib/lib_head.h -recent_files: file:///dos/z/16/src/pcxtest.c -recent_files: file:///dos/z/16/16.c -recent_files: file:///dos/z/16/src/scroll.c -recent_files: file:///dos/z/16/src/test2.c -recent_files: file:///dos/z/16/src/lib/lib_head.cpp -recent_files: file:///dos/z/16/src/lib/bitmap.c recent_files: file:///dos/z/16/src/palettec.c +recent_files: file:///dos/z/16/src/test.c +recent_files: file:///dos/z/16/src/test2.c recent_files: file:///dos/z/16/src/lib/bitmap.h -recent_files: file:///dos/z/16/src/lib/types.h +recent_files: file:///dos/z/16/src/lib/bitmap.c +recent_files: file:///dos/z/16/src/lib/lib_head.cpp recent_files: file:///dos/z/16/makefile +recent_files: file:///dos/z/16/src/lib/types.h recent_files: file:///dos/z/16/16/dos_gfx.h recent_files: file:///dos/z/16/16/dos_gfx.cpp +recent_files: file:///dos/z/16/src/v2/source/ENGINE/CONTROLS.C snr_replacetype: 0 savedir: file:///dos/z/16/src spell_check_default: 1 @@ -128,7 +129,6 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: MAPX/2 searchlist: mapDrawTile searchlist: dxThresh searchlist: PalFile @@ -143,6 +143,7 @@ searchlist: modexPalBlack( searchlist: fadePalette( searchlist: modexPalBlack( searchlist: modexPalUpdate +searchlist: UnPress( autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 diff --git a/scroll.exe b/scroll.exe index 6ec502479cc9f2a469f13fcc47cd6d83443ff52c..b1fd1a2bb7764cc7108d458fd6ea0daa99740c34 100644 GIT binary patch delta 11002 zcmZ8n34Bw<)}OniNtbj<_dQMbg>I~mrL<65!2*?*RcT1uTw2?vB}sv5pU4R}% zWRaFdpFnxi0!AJp%Tw?@5dj6C_z*=je1IY&tKLB&YIzC*+jNNEwIE(K148gCi_?4_opc+OCGT z%y?)OiLE`%Ha_z324X!;+7_;}9d>K|sQp;m(yRFMDH6NzYRkK76WsA>$=k`EZ?NZ) z7Rvl&)nLWdw%eK}drh0Y=4x8g$`RX2we5(n?P^3z-gmat$d(!3(N?d7wjFBhvu*UV z*V)MGAVVwd+SQ!bscz2O9@Cb$(USLSOWvz(hwA!l=N-zY?aFly<+i-jmb@P13efG3 znQY-{yPdYYk1cse+e&s?O76FnykRN1+m?64l6NoTa>n_Vy!*C8N;|r1+pBCTx!;m6 z%G}6~Oc`Rh!=-RGctxR3x!aP<+tvnQUka_>r0}RW*)O(4jF4TphQ9&BWEZ|_S$el+ z0&n@jb_go@h^G53X5Mn#a>v&0-%@h7C7-uV@}rR;>XpaL!i`Jv<}4hNdiR#R-)&Ye zHb~7`qh&nGKIO3O<|dIedQpe8V)IGA<-eUKjr`4i!fjMUrp(OWjP1&lWsh+q^=NO1 z%+;(o^}L~vBR3&cRKhHIEV@6>)ep`JGRd ztXLG_(0)n%*^5<1+S9_doEb?jLb+ zxNr1xC_d{Aw_KR}F3w?bX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M))6|Bnc4IMc#4cEr3fOBBZy67qi- C_hoqi diff --git a/src/scroll.c b/src/scroll.c index 76bc9f1f..625aa7bf 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -1,623 +1,635 @@ -#include "src\lib\modex16.h" -#include -#include -#include "src\lib\dos_kb.h" -#include "src\lib\wtest\wtest.c" - -//word far *clock= (word far*) 0x046C; /* 18.2hz clock */ - -typedef struct { - bitmap_t *data; - word tileHeight; - word tileWidth; - unsigned int rows; - unsigned int cols; -} tiles_t; - - -typedef struct { - byte *data; - tiles_t *tiles; - int width; - int height; -} map_t; - - -typedef struct { - map_t *map; - page_t *page; - int tx; //appears to be the top left tile position on the viewable screen map - int ty; //appears to be the top left tile position on the viewable screen map - word dxThresh; //???? - word dyThresh; //???? -} map_view_t; - -//TODO: make this into actor_t -struct { - int x; //player exact position on the viewable map - int y; //player exact position on the viewable map - int tx; //player tile position on the viewable map - int ty; //player tile position on the viewable map - int triggerx; //player's trigger box tile position on the viewable map - int triggery; //player's trigger box tile position on the viewable map - sword q; //loop variable - sword d; //direction - int hp; //hitpoints of the player -} player; - - -map_t allocMap(int w, int h); -void initMap(map_t *map); -void mapScrollRight(map_view_t *mv, byte offset); -void mapScrollLeft(map_view_t *mv, byte offest); -void mapScrollUp(map_view_t *mv, byte offset); -void mapScrollDown(map_view_t *mv, byte offset); -void mapGoTo(map_view_t *mv, int tx, int ty); -void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); -void mapDrawRow(map_view_t *mv, int tx, int ty, word y); +#include "src\lib\modex16.h" +#include +#include +#include "src\lib\dos_kb.h" +#include "src\lib\wtest\wtest.c" + +//word far *clock= (word far*) 0x046C; /* 18.2hz clock */ + +typedef struct { + bitmap_t *data; + word tileHeight; + word tileWidth; + unsigned int rows; + unsigned int cols; +} tiles_t; + + +typedef struct { + byte *data; + tiles_t *tiles; + int width; + int height; +} map_t; + + +typedef struct { + map_t *map; + page_t *page; + int tx; //appears to be the top left tile position on the viewable screen map + int ty; //appears to be the top left tile position on the viewable screen map + word dxThresh; //???? + word dyThresh; //???? +} map_view_t; + +//TODO: make this into actor_t +struct { + int x; //player exact position on the viewable map + int y; //player exact position on the viewable map + int tx; //player tile position on the viewable map + int ty; //player tile position on the viewable map + int triggerx; //player's trigger box tile position on the viewable map + int triggery; //player's trigger box tile position on the viewable map + sword q; //loop variable + sword d; //direction + int hp; //hitpoints of the player +} player; + + +map_t allocMap(int w, int h); +void initMap(map_t *map); +void mapScrollRight(map_view_t *mv, byte offset); +void mapScrollLeft(map_view_t *mv, byte offest); +void mapScrollUp(map_view_t *mv, byte offset); +void mapScrollDown(map_view_t *mv, byte offset); +void mapGoTo(map_view_t *mv, int tx, int ty); +void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); +void mapDrawRow(map_view_t *mv, int tx, int ty, word y); void mapDrawCol(map_view_t *mv, int tx, int ty, word x); -void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp); - -#define TILEWH 16 -#define QUADWH (TILEWH/4) -#define SPEED 4 -//#define LOOPMAX (TILEWH/SPEED) - -//place holder definitions -#define MAPX 200 -#define MAPY 150 -#define TRIGGX 10 -#define TRIGGY 9 -//#define SWAP(a, b) tmp=a; a=b; b=tmp; -void main() { - bitmap_t ptmp; // player sprite - //word q=1; - const char *cpus; - static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ - page_t screen, screen2, screen3; - map_t map; - map_view_t mv, mv2, mv3; - map_view_t *bg, *spri, *mask;//, *tmp; - byte *pal; +sword dpad(sword keypressed); +void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp); + +#define TILEWH 16 +#define QUADWH (TILEWH/4) +#define SPEED 4 +//#define LOOPMAX (TILEWH/SPEED) + +//place holder definitions +#define MAPX 200 +#define MAPY 150 +#define TRIGGX 10 +#define TRIGGY 9 +//#define SWAP(a, b) tmp=a; a=b; b=tmp; +void main() { + bitmap_t ptmp; // player sprite + const char *cpus; + static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ + page_t screen, screen2, screen3; + map_t map; + map_view_t mv, mv2, mv3; + map_view_t *bg, *spri, *mask;//, *tmp; + byte *pal; byte *ptr; - - player.q=1; - player.d=0; - + sword keypressed = 0; + + player.q=1; + player.d=0; + /* save the palette */ pal = modexNewPal(); modexPalSave(pal); modexFadeOff(4, pal); - modexPalBlack(); - - /* create the map */ - map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly - initMap(&map); - mv.map = ↦ - mv2.map = ↦ - mv3.map = ↦ - - /* draw the tiles */ - ptr = map.data; - /*data\\*/ - ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite - setkb(1); - modexEnter(); - modexPalBlack(); - modexPalUpdate(ptmp.palette); - modexFadeOn(4, ptmp.palette); - screen = modexDefaultPage(); - screen.width += (TILEWH*2); - screen.height += (TILEWH*2)+QUADWH; - mv.page = &screen; - screen2 = modexNextPage(mv.page); - mv2.page = &screen2; - screen3 = screen2; - mv3.page = &screen3; - - /* set up paging */ - bg = &mv; - spri = &mv2; - mask = &mv3; - -//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(bg, 0, 0); - mapGoTo(spri, 0, 0); - //mapGoTo(mask, 0, 0); - - //TODO: put player in starting position of spot - //default player position on the viewable map - player.tx = bg->tx + 10; - player.ty = bg->ty + 8; - player.x = player.tx*TILEWH; - player.y = player.ty*TILEWH; - player.triggerx = player.tx; - player.triggery = player.ty+1; - //TODO: erase player initial draw - modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp); - //temp draw trigger box - modexClearRegion(spri->page, player.triggerx*16, player.triggery*16, 16, 16, 1); - modexClearRegion(bg->page, player.triggerx*16, player.triggery*16, 16, 16, 1); - modexShowPage(spri->page); - while(!keyp(1)) - { - //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square - //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction - //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: make this better - if(keyp(77) && !keyp(75) && player.q == 1) player.d = 2; - if(keyp(75) && !keyp(77) && player.q == 1) player.d = 4; - if(keyp(80) && !keyp(72) && player.q == 1) player.d = 3; - if(keyp(72) && !keyp(80) && player.q == 1) player.d = 1; - //if(player.d>0) player.q=1; - - #define INC_PER_FRAME if(player.q&1) persist_aniframe++; if(persist_aniframe>4) persist_aniframe = 1; - - if(player.d == 2) - { - if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10 && !(player.tx+1 == TRIGGX && player.ty == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - //animatePlayer(bg, spri, mask, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 1, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); - mapScrollRight(bg, SPEED); - mapScrollRight(spri, SPEED); - //mapScrollRight(mask, SPEED); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.tx++; } - } - else if(player.tx < MAPX && !(player.tx+1 == TRIGGX && player.ty == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - player.x+=SPEED; - //animatePlayer(bg, spri, mask, 1, 0, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 1, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.tx++; } - } - else - { - modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); - modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp); - modexShowPage(spri->page); - player.d = 0; - } - player.triggerx = player.tx+1; - player.triggery = player.ty; - } - - if(player.d == 4) - { - if(bg->tx > 0 && bg->tx+20 <= MAPX && player.tx == bg->tx + 10 && !(player.tx-1 == TRIGGX && player.ty == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - //animatePlayer(bg, spri, mask, 3, 1, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 3, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); - mapScrollLeft(bg, SPEED); - mapScrollLeft(spri, SPEED); - //mapScrollLeft(mask, SPEED); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.tx--; } - } - else if(player.tx > 1 && !(player.tx-1 == TRIGGX && player.ty == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - player.x-=SPEED; - //animatePlayer(bg, spri, mask, 3, 0, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 3, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.tx--; } - } - else - { - modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); - modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp); - modexShowPage(spri->page); - player.d = 0; - } - player.triggerx = player.tx-1; - player.triggery = player.ty; - } - - if(player.d == 3) - { - if(bg->ty >= 0 && bg->ty+15 < MAPY && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty+1 == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - //animatePlayer(bg, spri, mask, 2, 1, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 2, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); - mapScrollDown(bg, SPEED); - mapScrollDown(spri, SPEED); - //mapScrollDown(mask, SPEED); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.ty++; } - } - else if(player.ty < MAPY && !(player.tx == TRIGGX && player.ty+1 == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - player.y+=SPEED; - //animatePlayer(bg, spri, mask, 2, 0, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 2, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.ty++; } - } - else - { - modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); - modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp); - modexShowPage(spri->page); - player.d = 0; - } - player.triggerx = player.tx; - player.triggery = player.ty+1; - } - - if(player.d == 1) - { - if(bg->ty > 0 && bg->ty+15 <= MAPY && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty-1 == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - //animatePlayer(bg, spri, mask, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, 0, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); - mapScrollUp(bg, SPEED); - mapScrollUp(spri, SPEED); - //mapScrollUp(mask, SPEED); - modexShowPage(spri->page); - player.q++; - } else { player.q = 1; player.d = 0; player.ty--; } - } - else if(player.ty > 1 && !(player.tx == TRIGGX && player.ty-1 == TRIGGY)) - { - //for(q=1; q<=(TILEWH/SPEED); q++) - if(player.q<=(TILEWH/SPEED)) - { - INC_PER_FRAME; - player.y-=SPEED; - //animatePlayer(bg, spri, mask, 0, 0, player.x, player.y, persist_aniframe, q, &ptmp); - modexShowPage(spri->page); - animatePlayer(bg, spri, 0, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); - player.q++; - } else { player.q = 1; player.d = 0; player.ty--; } - } - else - { - modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); - modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 0, 24, 32, &ptmp); - modexShowPage(spri->page); - player.d = 0; - } - player.triggerx = player.tx; - player.triggery = player.ty-1; - } - //modexClearRegion(mask->page, 66, 66, 2, 40, 0); - - if((player.triggerx == TRIGGX && player.triggery == TRIGGY) && keyp(KEY_ENTER)) - { - short i; - for(i=600; i>=400; i--) - { - sound(i); - } - nosound(); - } - } - + modexPalBlack(); + + /* create the map */ + map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly + initMap(&map); + mv.map = ↦ + mv2.map = ↦ + mv3.map = ↦ + + /* draw the tiles */ + ptr = map.data; + /*data\\*/ + ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite + setkb(1); + modexEnter(); + modexPalBlack(); + modexPalUpdate(ptmp.palette); + modexFadeOn(4, ptmp.palette); + screen = modexDefaultPage(); + screen.width += (TILEWH*2); + screen.height += (TILEWH*2)+QUADWH; + mv.page = &screen; + screen2 = modexNextPage(mv.page); + mv2.page = &screen2; + screen3 = screen2; + mv3.page = &screen3; + + /* set up paging */ + bg = &mv; + spri = &mv2; + mask = &mv3; + +//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen + mapGoTo(bg, 0, 0); + mapGoTo(spri, 0, 0); + //mapGoTo(mask, 0, 0); + + //TODO: put player in starting position of spot + //default player position on the viewable map + player.tx = bg->tx + 10; + player.ty = bg->ty + 8; + player.x = player.tx*TILEWH; + player.y = player.ty*TILEWH; + player.triggerx = player.tx; + player.triggery = player.ty+1; + //TODO: erase player initial draw + modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp); + //temp draw trigger box + modexClearRegion(spri->page, player.triggerx*16, player.triggery*16, 16, 16, 1); + modexClearRegion(bg->page, player.triggerx*16, player.triggery*16, 16, 16, 1); + modexShowPage(spri->page); + while(!keyp(1)) + { + //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square + //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction + //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: make this better like rpg maker 2000 better + if(player.q == 1) + { + dpad(keypressed); + //if(keypressed>1){ keypressed=0; dpad(keypressed); } + keypressed = 0; + } + + #define INC_PER_FRAME if(player.q&1) persist_aniframe++; if(persist_aniframe>4) persist_aniframe = 1; + + if(player.d == 2) + { + if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10 && !(player.tx+1 == TRIGGX && player.ty == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + //animatePlayer(bg, spri, mask, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 1, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); + mapScrollRight(bg, SPEED); + mapScrollRight(spri, SPEED); + //mapScrollRight(mask, SPEED); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.tx++; } + } + else if(player.tx < MAPX && !(player.tx+1 == TRIGGX && player.ty == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + player.x+=SPEED; + //animatePlayer(bg, spri, mask, 1, 0, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 1, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.tx++; } + } + else + { + modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); + modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp); + modexShowPage(spri->page); + player.d = 0; + } + player.triggerx = player.tx+1; + player.triggery = player.ty; + } + + if(player.d == 4) + { + if(bg->tx > 0 && bg->tx+20 <= MAPX && player.tx == bg->tx + 10 && !(player.tx-1 == TRIGGX && player.ty == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + //animatePlayer(bg, spri, mask, 3, 1, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 3, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); + mapScrollLeft(bg, SPEED); + mapScrollLeft(spri, SPEED); + //mapScrollLeft(mask, SPEED); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.tx--; } + } + else if(player.tx > 1 && !(player.tx-1 == TRIGGX && player.ty == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + player.x-=SPEED; + //animatePlayer(bg, spri, mask, 3, 0, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 3, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.tx--; } + } + else + { + modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); + modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp); + modexShowPage(spri->page); + player.d = 0; + } + player.triggerx = player.tx-1; + player.triggery = player.ty; + } + + if(player.d == 3) + { + if(bg->ty >= 0 && bg->ty+15 < MAPY && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty+1 == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + //animatePlayer(bg, spri, mask, 2, 1, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 2, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); + mapScrollDown(bg, SPEED); + mapScrollDown(spri, SPEED); + //mapScrollDown(mask, SPEED); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.ty++; } + } + else if(player.ty < MAPY && !(player.tx == TRIGGX && player.ty+1 == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + player.y+=SPEED; + //animatePlayer(bg, spri, mask, 2, 0, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 2, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.ty++; } + } + else + { + modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); + modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp); + modexShowPage(spri->page); + player.d = 0; + } + player.triggerx = player.tx; + player.triggery = player.ty+1; + } + + if(player.d == 1) + { + if(bg->ty > 0 && bg->ty+15 <= MAPY && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty-1 == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + //animatePlayer(bg, spri, mask, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp); + animatePlayer(bg, spri, 0, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); + mapScrollUp(bg, SPEED); + mapScrollUp(spri, SPEED); + //mapScrollUp(mask, SPEED); + modexShowPage(spri->page); + player.q++; + } else { player.q = 1; player.d = 0; player.ty--; } + } + else if(player.ty > 1 && !(player.tx == TRIGGX && player.ty-1 == TRIGGY)) + { + //for(q=1; q<=(TILEWH/SPEED); q++) + if(player.q<=(TILEWH/SPEED)) + { + INC_PER_FRAME; + player.y-=SPEED; + //animatePlayer(bg, spri, mask, 0, 0, player.x, player.y, persist_aniframe, q, &ptmp); + modexShowPage(spri->page); + animatePlayer(bg, spri, 0, 0, player.x, player.y, persist_aniframe, player.q, &ptmp); + player.q++; + } else { player.q = 1; player.d = 0; player.ty--; } + } + else + { + modexCopyPageRegion(spri->page, bg->page, player.x-4, player.y-TILEWH, player.x-4, player.y-TILEWH, 24, 32); + modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 0, 24, 32, &ptmp); + modexShowPage(spri->page); + player.d = 0; + } + player.triggerx = player.tx; + player.triggery = player.ty-1; + } + //modexClearRegion(mask->page, 66, 66, 2, 40, 0); + + if((player.triggerx == TRIGGX && player.triggery == TRIGGY) && keyp(KEY_ENTER)) + { + short i; + for(i=600; i>=400; i--) + { + sound(i); + } + nosound(); + } + } + /* fade back to text mode */ modexFadeOff(4, ptmp.palette); modexPalBlack(); modexLeave(); - setkb(0); - printf("Project 16 scroll.exe\n"); - printf("tx: %d\n", bg->tx); - printf("ty: %d\n", bg->ty); - printf("player.x: %d\n", player.x); - printf("player.y: %d\n", player.y); - printf("player.tx: %d\n", player.tx); - printf("player.ty: %d\n", player.ty); - printf("player.triggx: %d\n", player.triggerx); - printf("player.triggy: %d\n", player.triggery); - printf("player.q: %d\n", player.q); - printf("player.d: %d\n", player.d); - printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); - printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); - printf("\n"); - switch(detectcpu()) - { - case 0: cpus = "8086/8088 or 186/88"; break; - case 1: cpus = "286"; break; - case 2: cpus = "386 or newer"; break; - default: cpus = "internal error"; break; - } - printf("detected CPU type: %s\n", cpus); + setkb(0); + printf("Project 16 scroll.exe\n"); + printf("tx: %d\n", bg->tx); + printf("ty: %d\n", bg->ty); + printf("player.x: %d\n", player.x); + printf("player.y: %d\n", player.y); + printf("player.tx: %d\n", player.tx); + printf("player.ty: %d\n", player.ty); + printf("player.triggx: %d\n", player.triggerx); + printf("player.triggy: %d\n", player.triggery); + printf("player.q: %d\n", player.q); + printf("player.d: %d\n", player.d); + printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); + printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); + printf("\n"); + switch(detectcpu()) + { + case 0: cpus = "8086/8088 or 186/88"; break; + case 1: cpus = "286"; break; + case 2: cpus = "386 or newer"; break; + default: cpus = "internal error"; break; + } + printf("detected CPU type: %s\n", cpus); modexPalBlack(); - modexFadeOn(4, pal); -} - - -map_t -allocMap(int w, int h) { - map_t result; - - result.width =w; - result.height=h; - result.data = malloc(sizeof(byte) * w * h); - - return result; -} - - -void -initMap(map_t *map) { - /* just a place holder to fill out an alternating pattern */ - int x, y; - int i; - int tile = 1; - map->tiles = malloc(sizeof(tiles_t)); - - /* create the tile set */ - map->tiles->data = malloc(sizeof(bitmap_t)); - map->tiles->data->width = (TILEWH*2); - map->tiles->data->height= TILEWH; - map->tiles->data->data = malloc((TILEWH*2)*TILEWH); - map->tiles->tileHeight = TILEWH; - map->tiles->tileWidth =TILEWH; - map->tiles->rows = 1; - map->tiles->cols = 2; - - i=0; - for(y=0; ytiles->data->data[i] = 28;//0x24; - else - map->tiles->data->data[i] = 0;//0x34; - i++; - } - } - - i=0; - for(y=0; yheight; y++) { - for(x=0; xwidth; x++) { - map->data[i] = tile; - tile = tile ? 0 : 1; - i++; - } - tile = tile ? 0 : 1; - } -} - - -void -mapScrollRight(map_view_t *mv, byte offset) { - word x, y; /* coordinate for drawing */ - - /* increment the pixel position and update the page */ - mv->page->dx += offset; - - /* check to see if this changes the tile */ - if(mv->page->dx >= mv->dxThresh ) { - /* go forward one tile */ - mv->tx++; - /* Snap the origin forward */ - mv->page->data += 4; - mv->page->dx = mv->map->tiles->tileWidth; - //} - - /* draw the next column */ - x= SCREEN_WIDTH + mv->map->tiles->tileWidth; - mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x); - } -} - - -void -mapScrollLeft(map_view_t *mv, byte offset) { - word x, y; /* coordinate for drawing */ - - /* increment the pixel position and update the page */ - mv->page->dx -= offset; - - /* check to see if this changes the tile */ - if(mv->page->dx == 0) { - /* go backward one tile */ - mv->tx--; - - /* Snap the origin backward */ - mv->page->data -= 4; - mv->page->dx = mv->map->tiles->tileWidth; - //} - /* draw the next column */ - mapDrawCol(mv, mv->tx-1, mv->ty-1, 0); - } -} - - -void -mapScrollUp(map_view_t *mv, byte offset) { - word x, y; /* coordinate for drawing */ - - /* increment the pixel position and update the page */ - mv->page->dy -= offset; - - /* check to see if this changes the tile */ - if(mv->page->dy == 0 ) { - /* go down one tile */ - mv->ty--; - /* Snap the origin downward */ - mv->page->data -= mv->page->width*4; - mv->page->dy = mv->map->tiles->tileHeight; - //} - - /* draw the next row */ - y= 0; - mapDrawRow(mv, mv->tx-1 , mv->ty-1, y); - } -} - - -void -mapScrollDown(map_view_t *mv, byte offset) { - word x, y; /* coordinate for drawing */ - - /* increment the pixel position and update the page */ - mv->page->dy += offset; - - /* check to see if this changes the tile */ - if(mv->page->dy >= mv->dyThresh ) { - /* go down one tile */ - mv->ty++; - /* Snap the origin downward */ - mv->page->data += mv->page->width*4; - mv->page->dy = mv->map->tiles->tileHeight; - //} - - /* draw the next row */ - y= SCREEN_HEIGHT + mv->map->tiles->tileHeight; - mapDrawRow(mv, mv->tx-1 , mv->ty+15, y); - } - -} - - -void -mapGoTo(map_view_t *mv, int tx, int ty) { - int px, py; - unsigned int i; - - /* set up the coordinates */ - mv->tx = tx; - mv->ty = ty; - mv->page->dx = mv->map->tiles->tileWidth; - mv->page->dy = mv->map->tiles->tileHeight; - - /* set up the thresholds */ - mv->dxThresh = mv->map->tiles->tileWidth * 2; - mv->dyThresh = mv->map->tiles->tileHeight * 2; - - /* draw the tiles */ - modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0); - py=0; - i=mv->ty * mv->map->width + mv->tx; - for(ty=mv->ty-1; py < SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) { - mapDrawRow(mv, tx-1, ty, py); - i+=mv->map->width - tx; - } -} - - -void -mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { - word rx; - word ry; - rx = (i % t->cols) * t->tileWidth; - ry = (i / t->cols) * t->tileHeight; - modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, t->data); -} - - -void -mapDrawRow(map_view_t *mv, int tx, int ty, word y) { - word x; - int i; - - /* the position within the map array */ - i=ty * mv->map->width + tx; - for(x=0; xdxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) { - if(i>=0) { - /* we are in the map, so copy! */ - mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); - } - i++; /* next! */ - } -} - -void -mapDrawCol(map_view_t *mv, int tx, int ty, word x) { - int y; - int i; - - /* location in the map array */ - i=ty * mv->map->width + tx; - - /* We'll copy all of the columns in the screen, - i + 1 row above and one below */ - for(y=0; ydyThresh && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) { - if(i>=0) { - /* we are in the map, so copy away! */ - mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); - } - i += mv->map->width; - } -} - -void -animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp) + modexFadeOn(4, pal); +} + + +map_t +allocMap(int w, int h) { + map_t result; + + result.width =w; + result.height=h; + result.data = malloc(sizeof(byte) * w * h); + + return result; +} + + +void +initMap(map_t *map) { + /* just a place holder to fill out an alternating pattern */ + int x, y; + int i; + int tile = 1; + map->tiles = malloc(sizeof(tiles_t)); + + /* create the tile set */ + map->tiles->data = malloc(sizeof(bitmap_t)); + map->tiles->data->width = (TILEWH*2); + map->tiles->data->height= TILEWH; + map->tiles->data->data = malloc((TILEWH*2)*TILEWH); + map->tiles->tileHeight = TILEWH; + map->tiles->tileWidth =TILEWH; + map->tiles->rows = 1; + map->tiles->cols = 2; + + i=0; + for(y=0; ytiles->data->data[i] = 28;//0x24; + else + map->tiles->data->data[i] = 0;//0x34; + i++; + } + } + + i=0; + for(y=0; yheight; y++) { + for(x=0; xwidth; x++) { + map->data[i] = tile; + tile = tile ? 0 : 1; + i++; + } + tile = tile ? 0 : 1; + } +} + + +void +mapScrollRight(map_view_t *mv, byte offset) { + word x, y; /* coordinate for drawing */ + + /* increment the pixel position and update the page */ + mv->page->dx += offset; + + /* check to see if this changes the tile */ + if(mv->page->dx >= mv->dxThresh ) { + /* go forward one tile */ + mv->tx++; + /* Snap the origin forward */ + mv->page->data += 4; + mv->page->dx = mv->map->tiles->tileWidth; + //} + + /* draw the next column */ + x= SCREEN_WIDTH + mv->map->tiles->tileWidth; + mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x); + } +} + + +void +mapScrollLeft(map_view_t *mv, byte offset) { + word x, y; /* coordinate for drawing */ + + /* increment the pixel position and update the page */ + mv->page->dx -= offset; + + /* check to see if this changes the tile */ + if(mv->page->dx == 0) { + /* go backward one tile */ + mv->tx--; + + /* Snap the origin backward */ + mv->page->data -= 4; + mv->page->dx = mv->map->tiles->tileWidth; + //} + /* draw the next column */ + mapDrawCol(mv, mv->tx-1, mv->ty-1, 0); + } +} + + +void +mapScrollUp(map_view_t *mv, byte offset) { + word x, y; /* coordinate for drawing */ + + /* increment the pixel position and update the page */ + mv->page->dy -= offset; + + /* check to see if this changes the tile */ + if(mv->page->dy == 0 ) { + /* go down one tile */ + mv->ty--; + /* Snap the origin downward */ + mv->page->data -= mv->page->width*4; + mv->page->dy = mv->map->tiles->tileHeight; + //} + + /* draw the next row */ + y= 0; + mapDrawRow(mv, mv->tx-1 , mv->ty-1, y); + } +} + + +void +mapScrollDown(map_view_t *mv, byte offset) { + word x, y; /* coordinate for drawing */ + + /* increment the pixel position and update the page */ + mv->page->dy += offset; + + /* check to see if this changes the tile */ + if(mv->page->dy >= mv->dyThresh ) { + /* go down one tile */ + mv->ty++; + /* Snap the origin downward */ + mv->page->data += mv->page->width*4; + mv->page->dy = mv->map->tiles->tileHeight; + //} + + /* draw the next row */ + y= SCREEN_HEIGHT + mv->map->tiles->tileHeight; + mapDrawRow(mv, mv->tx-1 , mv->ty+15, y); + } + +} + + +void +mapGoTo(map_view_t *mv, int tx, int ty) { + int px, py; + unsigned int i; + + /* set up the coordinates */ + mv->tx = tx; + mv->ty = ty; + mv->page->dx = mv->map->tiles->tileWidth; + mv->page->dy = mv->map->tiles->tileHeight; + + /* set up the thresholds */ + mv->dxThresh = mv->map->tiles->tileWidth * 2; + mv->dyThresh = mv->map->tiles->tileHeight * 2; + + /* draw the tiles */ + modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0); + py=0; + i=mv->ty * mv->map->width + mv->tx; + for(ty=mv->ty-1; py < SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) { + mapDrawRow(mv, tx-1, ty, py); + i+=mv->map->width - tx; + } +} + + +void +mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { + word rx; + word ry; + rx = (i % t->cols) * t->tileWidth; + ry = (i / t->cols) * t->tileHeight; + modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, t->data); +} + + +void +mapDrawRow(map_view_t *mv, int tx, int ty, word y) { + word x; + int i; + + /* the position within the map array */ + i=ty * mv->map->width + tx; + for(x=0; xdxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) { + if(i>=0) { + /* we are in the map, so copy! */ + mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); + } + i++; /* next! */ + } +} + +void +mapDrawCol(map_view_t *mv, int tx, int ty, word x) { + int y; + int i; + + /* location in the map array */ + i=ty * mv->map->width + tx; + + /* We'll copy all of the columns in the screen, + i + 1 row above and one below */ + for(y=0; ydyThresh && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) { + if(i>=0) { + /* we are in the map, so copy away! */ + mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); + } + i += mv->map->width; + } +} + +sword +dpad(sword keypressed) { - short dire=32*d1; //direction - short qq; //scroll offset - - if(d2==0) qq = 0; - else qq = ((lp)*SPEED); - switch (d1) - { - case 0: - //up - x=x-4; - y=y-qq-TILEWH; - break; - case 1: - // right - x=x+qq-4; - y=y-TILEWH; - break; - case 2: - //down - x=x-4; - y=y+qq-TILEWH; - break; - case 3: - //left - x=x-qq-4; - y=y-TILEWH; - break; - } - modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40); - if(2>ls && ls>=1) { modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else - if(3>ls && ls>=2) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else - if(4>ls && ls>=3) { modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else - if(5>ls && ls>=4) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); } - //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); - //turn this off if XT - if(detectcpu() > 0) modexWaitBorder(); + if(keyp(75) && !keyp(77)){ player.d = 4; keypressed++; } + if(keyp(80) && !keyp(72)){ player.d = 3; keypressed++; } + if(keyp(77) && !keyp(75)){ player.d = 2; keypressed++; } + if(keyp(72) && !keyp(80)){ player.d = 1; keypressed++; } + return keypressed; } + +void +animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp) +{ + short dire=32*d1; //direction + short qq; //scroll offset + + if(d2==0) qq = 0; + else qq = ((lp)*SPEED); + switch (d1) + { + case 0: + //up + x=x-4; + y=y-qq-TILEWH; + break; + case 1: + // right + x=x+qq-4; + y=y-TILEWH; + break; + case 2: + //down + x=x-4; + y=y+qq-TILEWH; + break; + case 3: + //left + x=x-qq-4; + y=y-TILEWH; + break; + } + modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40); + if(2>ls && ls>=1) { modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else + if(3>ls && ls>=2) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else + if(4>ls && ls>=3) { modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else + if(5>ls && ls>=4) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); } + //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); + //turn this off if XT + if(detectcpu() > 0) modexWaitBorder(); +} -- 2.39.5