From 7872dbf5d0240f01177588bd7966c3e042ced554 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sat, 22 Nov 2014 09:14:58 -0600 Subject: [PATCH] modified: 16/modex16/scroll.c modified: 16/modex16/scroll.exe made it use less memory --- 16/modex16/scroll.c | 54 ++++++++++++++++++++++-------------------- 16/modex16/scroll.exe | Bin 18598 -> 18566 bytes 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/16/modex16/scroll.c b/16/modex16/scroll.c index 14aec257..8a960eee 100644 --- a/16/modex16/scroll.c +++ b/16/modex16/scroll.c @@ -10,7 +10,7 @@ typedef struct { word tileHeight; word tileWidth; unsigned int rows; - unsigned int cols; + unsigned int cols; unsigned int tilex,tiley; // tile position on the map } tiles_t; @@ -48,24 +48,25 @@ 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); - -#define TILEWH 16 + +#define TILEWH 16 #define QUADWH (TILEWH/4) -#define SWAP(a, b) tmp=a; a=b; b=tmp; +//#define SWAP(a, b) tmp=a; a=b; b=tmp; void main() { - int show1=1; +// int show1=1; int tx, ty; int x, y; //int ch=0x0; - byte ch; +// byte ch; int q=0; - page_t screen,screen2; + page_t screen;//,screen2; map_t map; - map_view_t mv, mv2; - map_view_t *draw, *show, *tmp; - byte *ptr; + map_view_t mv;//, mv2; + map_view_t *draw;//, *show, *tmp; + byte *ptr; + //default player position on the viewable map - player.tx = 10; + player.tx = 10; player.ty = 8; setkb(1); @@ -73,7 +74,7 @@ void main() { map = allocMap(160,120); //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 = ↦ +// mv2.map = ↦ /* draw the tiles */ ptr = map.data; @@ -82,20 +83,21 @@ void main() { screen.width += (TILEWH*2); mv.page = &screen; mapGoTo(&mv, 16, 16); - screen2=modexNextPage(mv.page); - mv2.page = &screen2; - mapGoTo(&mv2, 16, 16); - modexShowPage(mv.page); - +// screen2=modexNextPage(mv.page); +// mv2.page = &screen2; +// mapGoTo(&mv2, 16, 16); +// modexShowPage(mv.page); + /* set up paging */ - show = &mv; - draw = &mv2; - - //TODO: set player position data here according to the viewable map screen thingy - - while(!keyp(1)) { - //TODO: 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 +// show = &mv; +// draw = &mv2; + draw = &mv; + + //TODO: set player position data here according to the viewable map screen thingy + + while(!keyp(1)) { + //TODO: 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 if(keyp(77)){ // for(q=0; qpage); } diff --git a/16/modex16/scroll.exe b/16/modex16/scroll.exe index af6590453e0369e539dd15735d2cb5f9c4eac73c..237625209c1e852c181a9daaff3091d00438534e 100755 GIT binary patch delta 2427 zcmY*b2~dVi>bth#Vecd9ee8Vbm33wq#w+ZdDY#Rs};e zv?D~eYt7+NiKt~{OWjOjet$LzFh;x;;zkOT@>r9`0i&x6Eb9E*4aDsBRCm9A{od=> z@4f#1Ia~?bE1`Jd;_YZ8G9VGPAXRM>8Hsj=B4k7T%_<@EkoCAh2vxH_EDWKySpN&_ zXIa1Kf4+;g0cnKfv50y?va?({_+Dv;twC2H1fd4q3c-M6Ky;3ztVi<4sC;b?-Hpl} z<9g_~Z0f;|4%#V}uf0X9wdIam*zus$L2Wfwgj>qlR*j}SucPwPADsuXSK_#MoLGcID5h&{7nj0m2p3kc#Wl-NSYor~nKw=j^XoV!V2=qf-*g zxFRx}E?kGd_lVnS3kCYrK)+V8sH7r%mhKD2KBgX$DbGO8Vp_=zh;l%spBg;B>YAgo z76svE+GZ*f9sY-m`q7-XhzEgH*ZMxYx!8xVE5AiFCm5gMhO*@X=E&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