From 414f8943ce83290e937ad2fa93a01154360b3af5 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 13 Mar 2017 12:01:05 -0500 Subject: [PATCH] broken --- ZCROLL.L16 | 34 ++++++++++++++++++++++++++++++++++ src/0.c | 13 +++++++------ src/lib/16_tail.h | 16 +++++++++------- src/scroll.c | 36 ++++++++++++++++++------------------ src/test.c | 9 +++++---- src/zcroll.c | 25 +++++++++++++------------ 6 files changed, 86 insertions(+), 47 deletions(-) create mode 100755 ZCROLL.L16 diff --git a/ZCROLL.L16 b/ZCROLL.L16 new file mode 100755 index 00000000..fd9bf43f --- /dev/null +++ b/ZCROLL.L16 @@ -0,0 +1,34 @@ +objects detected +Object 4's name: 'trunk' + properties: { + "walkable":"0" + } + walkable: 0 +Object 4's name: 'stump' + properties: { + "walkable":"0" + } + walkable: 0 + +Project 16 zcroll.exe. This is just a test file! +version Mar 13 2017 11:55:15 +page[0]dxy: 16x16 + +player vars: + xy: 160x128 txy: 16x8 triggxy: 17x8 + hp: 4 q: 1 info.dir: 2 d: 2 dire: 21 pdir: 3 + delay=1 + +VL_PrintmodexmemInfo: + Virtual Screen: 352x272 Tile: 22x17=((Virtual Screen)/16) + Screen: 320x240 Tile: 20x15=((Screen)/16) + Free Video Memory: 767 + page [0]=(a000:0018) size=23936 w=352 h=272 sw=320 sh=240 pi=1408 + [1]=(a000:5d98) size=23936 w=352 h=272 sw=320 sh=240 pi=1408 + [2]=(a000:bb18) size=8448 w=352 h=96 sw=352 sh=96 pi=1408 + [3]=(a000:dc18) size=8448 w=352 h=96 sw=352 sh=96 pi=1408 +gvar.video: + r=0 bgps=1 + +detected CPU type: 80386 or newer +detected FPU type: 80387 diff --git a/src/0.c b/src/0.c index 901d8ef7..fc9b2e92 100755 --- a/src/0.c +++ b/src/0.c @@ -34,6 +34,7 @@ #define INITTNUM 1 +map_view_t mv[4]; map_t map;//junk var int main(int argc,char **argv) @@ -106,8 +107,8 @@ int main(int argc,char **argv) /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&gvar.mv, &map, &gvar); - ZC_ShowMV(&gvar.mv, gvar.video.sp, 0); + ZC_MVSetup(&MVVAR, &map, &gvar); + ZC_ShowMV(&MVVAR, gvar.video.sp, 0); // VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw); VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1); @@ -150,7 +151,7 @@ int main(int argc,char **argv) } if(IN_KeyDown(sc_R)){ gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16; - gvar.mv[0].tx = gvar.mv[0].ty = gvar.mv[1].tx = gvar.mv[1].ty = INITTNUM; + MVVAR[0].tx = MVVAR[0].ty = MVVAR[1].tx = MVVAR[1].ty = INITTNUM; VL_ShowPage(&gvar.video.page[gvar.video.sp], 1, 0); gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; x=y=0; @@ -216,7 +217,7 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header //===========================================================================// - ZC_ShowMV(&gvar.mv, 0, 0); + ZC_ShowMV(&MVVAR, 0, 0); if(!noanim) { /* another handy "demo" effect using VGA write mode 1. * we can take what's on screen and vertically squash it like an old analog TV set turning off. */ @@ -311,7 +312,7 @@ if(!noanim) { printf("\nProject 16 0.exe. This is just a test file!\n"); printf("version %s\n", VERSION); //SCROLLEXITMESG; - printf("mv 0\n- tx=%d ty=%d dx=%d dy=%d\n", gvar.mv[0].tx, gvar.mv[0].ty, gvar.video.page[0].dx, gvar.video.page[0].dy); - printf("mv 1\n- tx=%d ty=%d dx=%d dy=%d\n", gvar.mv[1].tx, gvar.mv[1].ty, gvar.video.page[1].dx, gvar.video.page[1].dy); + printf("mv 0\n- tx=%d ty=%d dx=%d dy=%d\n", MVVAR[0].tx, MVVAR[0].ty, gvar.video.page[0].dx, gvar.video.page[0].dy); + printf("mv 1\n- tx=%d ty=%d dx=%d dy=%d\n", MVVAR[1].tx, MVVAR[1].ty, gvar.video.page[1].dx, gvar.video.page[1].dy); return 0; } diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h index f6b73ff4..18109754 100755 --- a/src/lib/16_tail.h +++ b/src/lib/16_tail.h @@ -33,6 +33,8 @@ #include "src/lib/16_vl.h" #include "src/lib/testpatt.h" +#define MVVAR gvar.mv + #define TAIL_FUNCTIONKEYFUNCTIONS \ if(IN_KeyDown(88)){ panswitch=!panswitch; IN_UserInput(1); } \ TAIL_FUNCTIONKEYFUNCTIONS0EXE @@ -43,8 +45,8 @@ if(IN_KeyDown(68/*sc_F10*/)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1); } \ if(IN_KeyDown(sc_F9)){ pagenorendermap=!pagenorendermap; IN_UserInput(1); } \ if(IN_KeyDown(sc_F8)){ gvar.video.bgps=!gvar.video.bgps; IN_UserInput(1); } \ - if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&gvar.mv, 0, 1); IN_UserInput(1); } \ - if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&gvar.mv, 0, 0); IN_UserInput(1); } \ + if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&MVVAR, 0, 1); IN_UserInput(1); } \ + if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&MVVAR, 0, 0); IN_UserInput(1); } \ if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss; IN_UserInput(1); } \ if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]); IN_UserInput(1); } @@ -53,13 +55,13 @@ TAIL_FUNCTIONKEYDRAWJUNK #define TAIL_PANKEYFUNZC \ - ZC_panPageManual(&gvar.mv, &gvar.player, 0); + ZC_panPageManual(&MVVAR, &gvar.player, 0); #define FUNCTIONKEYSHOWMV \ - if(IN_KeyDown(1+1)){ gvar.video.sp=0; ZC_ShowMV(&gvar.mv, 0, 0); } \ - if(IN_KeyDown(2+1)){ gvar.video.sp=1; ZC_ShowMV(&gvar.mv, 0, 0); } \ - if(IN_KeyDown(3+1)){ gvar.video.sp=2; ZC_ShowMV(&gvar.mv, 0, 1); } \ - if(IN_KeyDown(4+1)){ gvar.video.sp=3; ZC_ShowMV(&gvar.mv, 0, 1); } + if(IN_KeyDown(1+1)){ gvar.video.sp=0; ZC_ShowMV(&MVVAR, 0, 0); } \ + if(IN_KeyDown(2+1)){ gvar.video.sp=1; ZC_ShowMV(&MVVAR, 0, 0); } \ + if(IN_KeyDown(3+1)){ gvar.video.sp=2; ZC_ShowMV(&MVVAR, 0, 1); } \ + if(IN_KeyDown(4+1)){ gvar.video.sp=3; ZC_ShowMV(&MVVAR, 0, 1); } #define TAIL_FUNCTIONKEYDRAWJUNK \ FUNCTIONKEYSHOWMV \ diff --git a/src/scroll.c b/src/scroll.c index 43adbd8d..c166a3ba 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -106,16 +106,16 @@ void main(int argc, char *argv[]) /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&gvar.mv, &map, &gvar); + ZC_MVSetup(&MVVAR, &map, &gvar); //renderswitch gvar.video.rss=1; /* set up paging */ //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(&gvar.mv, 0, 0); + mapGoTo(&MVVAR, 0, 0); - ZC_gvar.playerXYpos(0, 0, &gvar.player, &gvar.mv, 0, 1); + ZC_gvar.playerXYpos(0, 0, &gvar.player, &MVVAR, 0, 1); EN_initgvar.player(&gvar.player, 0, &gvar.video); if (gvar.video.sprifilei == -1) { @@ -129,19 +129,19 @@ void main(int argc, char *argv[]) } #ifndef SPRITE - modexClearRegion(mv[0].page, gvar.player[0].enti.x, gvar.player[0].enti.y-TILEWH, 16, 32, 15); + modexClearRegion(MVVAR[0].page, gvar.player[0].enti.x, gvar.player[0].enti.y-TILEWH, 16, 32, 15); #else modexDrawSpriteRegion(&gvar.video.page[0], gvar.player[0].enti.x, gvar.player[0].enti.y-TILEWH, 16, 64, 16, 32, PCXBMPPTR); #endif //if(!pageflipflop) - VL_ShowPage(mv[1].page, 0, 0);//modexShowPage(mv[1].page); - //else ZC_ShowMV(&gvar.mv, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p) + VL_ShowPage(MVVAR[1].page, 0, 0);//modexShowPage(MVVAR[1].page); + //else ZC_ShowMV(&MVVAR, 0, 0);//modexShowPage(MVVAR[0].page);//!(gvar.video.p) //modexDrawBmp(&gvar.video.page[0], 16, 16, PCXBMPPTR); /* buffer pages */ -// modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47); -// modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45); +// modexClearRegion(MVVAR[2].page, 0, 0, MVVAR[2].page->width, MVVAR[2].page->height, 47); +// modexClearRegion(MVVAR[3].page, 0, 0, MVVAR[3].page->width, MVVAR[3].page->height, 45); // { // unsigned int k,j,o; // /* fill screen with a distinctive pattern */ @@ -152,7 +152,7 @@ void main(int argc, char *argv[]) // vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15! // } // } - modexClearRegion(mv[3].page, 0, 128, 24, 36, 15); + modexClearRegion(MVVAR[3].page, 0, 128, 24, 36, 15); #ifdef MODEX #ifdef FADE @@ -169,15 +169,15 @@ void main(int argc, char *argv[]) //gvar.player movement IN_ReadControl(0, &gvar.player); if(!panswitch){ - ZC_walk(&gvar.mv, &gvar.player, 0); + ZC_walk(&MVVAR, &gvar.player, 0); }else{ - PANKEYFUNZC;//panPageManual(&gvar.mv, &gvar.player, 0); + PANKEYFUNZC;//panPageManual(&MVVAR, &gvar.player, 0); //printf(" gvar.player[0].enti.q: %d", gvar.player[0].enti.q); printf(" gvar.player[0].d: %d\n", gvar.player[0].d); } //the scripting stuff.... //if(((gvar.player[0].enti.triggerx == TRIGGX && gvar.player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) - if(((mv[0].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) + if(((MVVAR[0].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) { short i; for(i=800; i>=400; i--) @@ -190,13 +190,13 @@ void main(int argc, char *argv[]) //debugging binds! #ifdef MODEX #ifdef FADE - if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1); } //p + if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); paloffset=0; modexpdump(MVVAR[0].page); modexpdump(MVVAR[1].page); IN_UserInput(1); } //p /*if(IN_KeyDown(22)){ paloffset=0; modexPalBlack(); modexPalUpdate(PCXBMPVAR, &paloffset, 0, 0); printf("1paloffset = %d\n", paloffset/3); modexPalUpdate(map.tiles->data, &paloffset, 0, 0); printf("2paloffset = %d\n", paloffset/3); - modexpdump(mv[0].page); modexpdump(mv[1].page); + modexpdump(MVVAR[0].page); modexpdump(MVVAR[1].page); IN_UserInput(1); }*/ #endif @@ -204,10 +204,10 @@ void main(int argc, char *argv[]) //pan switch if(IN_KeyDown(62)) //f3 { - modexClearRegion(mv[1].page, 0, 0, mv[1].page->width, mv[1].page->height, 2); - modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 3); - modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 4); - modexClearRegion(mv[3].page, 0, 0, 20, 36, 15); + modexClearRegion(MVVAR[1].page, 0, 0, MVVAR[1].page->width, MVVAR[1].page->height, 2); + modexClearRegion(MVVAR[2].page, 0, 0, MVVAR[2].page->width, MVVAR[2].page->height, 3); + modexClearRegion(MVVAR[3].page, 0, 0, MVVAR[3].page->width, MVVAR[3].page->height, 4); + modexClearRegion(MVVAR[3].page, 0, 0, 20, 36, 15); //IN_UserInput(1); } diff --git a/src/test.c b/src/test.c index 5464355e..cfbd462c 100755 --- a/src/test.c +++ b/src/test.c @@ -49,6 +49,7 @@ void main(int argc, char *argv[]) static word paloffset=0; static global_game_variables_t gvar; +// map_view_t mv[4]; map_t map; int i, j; @@ -121,7 +122,7 @@ void main(int argc, char *argv[]) /* set up the page, but with 16 pixels on all borders in offscreen mem */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&gvar.mv, &map, &gvar); + ZC_MVSetup(&MVVAR, &map, &gvar); /* fill the page with one color, but with a black border */ /*modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[1].width, gvar.video.page[1].height, 15); @@ -149,7 +150,7 @@ void main(int argc, char *argv[]) while(!IN_KeyDown(sc_Escape)) { IN_ReadControl(&gvar.player[0]); - ZC_panPageManual(&gvar.mv, &gvar.player, 0); + ZC_panPageManual(&MVVAR, &gvar.player, 0); // if(IN_KeyDown(sc_5)){ modexClearRegion(&gvar.video.page[1], gvar.video.page[1].sw, 16, 8, 4, 45); } // if(IN_KeyDown(sc_4)){ // modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 128); @@ -173,7 +174,7 @@ void main(int argc, char *argv[]) if(IN_KeyDown(sc_I)){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1); }//i if(IN_KeyDown(sc_O)){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1); }//o //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0); - ZC_ShowMV(&gvar.mv, 0, 0); + ZC_ShowMV(&MVVAR, 0, 0); } endclk = *clockw; @@ -186,7 +187,7 @@ void main(int argc, char *argv[]) printf("Project 16 test.exe. This is just a test file!\n"); printf("version %s\n", VERSION); VL_PrintmodexmemInfo(&gvar.video); - printf("tx=%d ", gvar.mv[gvar.video.sp].tx); printf("ty=%d ", gvar.mv[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); + printf("tx=%d ", MVVAR[gvar.video.sp].tx); printf("ty=%d ", MVVAR[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); printf("\n====\n"); printf("0 paloffset= %d\n", paloffset/3); printf("====\n\n"); diff --git a/src/zcroll.c b/src/zcroll.c index 716cc876..0f57d4c7 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -27,6 +27,7 @@ #define FADE +//map_view_t mv[4]; static map_t map; float t; @@ -73,7 +74,7 @@ void main(int argc, char *argv[]) // OK, this one takes hellova time and needs to be done in farmalloc or MM_... //IN CA i think you use CAL_SetupGrFile but i do think we should work together on this part --sparky4 //gvar.player[0].enti.spri = malloc(sizeof(struct sprite)); - gvar.player[0].enti.spri.spritesheet = malloc(sizeof(struct vrs_container)); + //gvar.player[0].enti.spri.spritesheet = malloc(sizeof(struct vrs_container)); // create the map // fprintf(stderr, "testing map load~ "); @@ -117,13 +118,13 @@ void main(int argc, char *argv[]) // setup camera and screen~ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&gvar.mv, &map, &gvar); + ZC_MVSetup(&MVVAR, &map, &gvar); // set up paging //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(&gvar.mv, 0, 0); + mapGoTo(&MVVAR, 0, 0); - ZC_PlayerXYpos(0, 0, &gvar.player, &gvar.mv, 0, 1); + ZC_PlayerXYpos(0, 0, &gvar.player, &MVVAR, 0, 1); EN_initPlayer(&gvar.player[0], &gvar.video); //print_anim_ids(gvar.player[0].enti.spri); if (gvar.video.sprifilei == -1) @@ -138,17 +139,17 @@ void main(int argc, char *argv[]) } // while(!IN_KeyDown(sc_Escape) && !IN_KeyDown(sc_Space) && !IN_KeyDown(sc_Enter)){ FUNCTIONKEYSHOWMV } - gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; - gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH; + gvar.video.page[0].tlx=MVVAR[0].tx*TILEWH; + gvar.video.page[0].tly=MVVAR[0].ty*TILEWH; shinku(&gvar); -//modexpdump(gvar.mv[0].page); +//modexpdump(MVVAR[0].page); #ifdef FADE modexFadeOn(4, &gvar.video.palette); #endif while(!IN_KeyDown(sc_Escape) && gvar.player[0].enti.hp>0) { - gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; - gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH; + gvar.video.page[0].tlx=MVVAR[0].tx*TILEWH; + gvar.video.page[0].tly=MVVAR[0].ty*TILEWH; shinku(&gvar); //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 gvar.player position data move to the edge of the screen with respect to the direction @@ -158,7 +159,7 @@ void main(int argc, char *argv[]) IN_ReadControl(&gvar.player[0]); if(!panswitch){ //ZC_walk2(gvar.player[0].ent, mv); - ZC_walk(&gvar.mv, &gvar.player, 0); + ZC_walk(&MVVAR, &gvar.player, 0); }else{ TAIL_PANKEYFUNZC; //printf(" gvar.player[0].enti.q: %d", gvar.player[0].enti.q); printf(" gvar.player[0].d: %d\n", gvar.player[0].d); @@ -166,7 +167,7 @@ void main(int argc, char *argv[]) //the scripting stuff.... //if(((gvar.player[0].enti.triggerx == TRIGGX && gvar.player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) - if(((gvar.mv[0].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) + if(((MVVAR[0].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) { short i; for(i=800; i>=400; i--) @@ -178,7 +179,7 @@ void main(int argc, char *argv[]) if(gvar.player[0].enti.q == (TILEWH/(gvar.player[0].enti.speed))+1 && gvar.player[0].info.dir != 2 && (gvar.player[0].enti.triggerx == 5 && gvar.player[0].enti.triggery == 5)){ gvar.player[0].enti.hp--; } //debugging binds! - if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1); } //o + if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(MVVAR[0].page); IN_UserInput(1); } //o if(IN_KeyDown(22)){ modexPalUpdate0(&gvar.video.palette); } //u TAIL_FUNCTIONKEYFUNCTIONS -- 2.39.5