From 47c09acbb1eb6319d7327313668c4f0ec268f31b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 13 Mar 2017 12:09:10 -0500 Subject: [PATCH] still broken --- src/0.c | 12 ++++++------ src/lib/16_tail.h | 16 +++++++--------- src/test.c | 8 ++++---- src/zcroll.c | 24 ++++++++++++------------ 4 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/0.c b/src/0.c index fc9b2e92..28d5ff05 100755 --- a/src/0.c +++ b/src/0.c @@ -107,8 +107,8 @@ int main(int argc,char **argv) /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&MVVAR, &map, &gvar); - ZC_ShowMV(&MVVAR, gvar.video.sp, 0); + ZC_MVSetup(&gvar.mv, &map, &gvar); + ZC_ShowMV(&gvar.mv, 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); @@ -151,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; - MVVAR[0].tx = MVVAR[0].ty = MVVAR[1].tx = MVVAR[1].ty = INITTNUM; + gvar.mv[0].tx = gvar.mv[0].ty = gvar.mv[1].tx = gvar.mv[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; @@ -217,7 +217,7 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header //===========================================================================// - ZC_ShowMV(&MVVAR, 0, 0); + ZC_ShowMV(&gvar.mv, 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. */ @@ -312,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", 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); + 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); return 0; } diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h index 18109754..f6b73ff4 100755 --- a/src/lib/16_tail.h +++ b/src/lib/16_tail.h @@ -33,8 +33,6 @@ #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 @@ -45,8 +43,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(&MVVAR, 0, 1); IN_UserInput(1); } \ - if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&MVVAR, 0, 0); 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_T)){ gvar.video.rss=!gvar.video.rss; IN_UserInput(1); } \ if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]); IN_UserInput(1); } @@ -55,13 +53,13 @@ TAIL_FUNCTIONKEYDRAWJUNK #define TAIL_PANKEYFUNZC \ - ZC_panPageManual(&MVVAR, &gvar.player, 0); + ZC_panPageManual(&gvar.mv, &gvar.player, 0); #define FUNCTIONKEYSHOWMV \ - 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); } + 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); } #define TAIL_FUNCTIONKEYDRAWJUNK \ FUNCTIONKEYSHOWMV \ diff --git a/src/test.c b/src/test.c index cfbd462c..a4a7f489 100755 --- a/src/test.c +++ b/src/test.c @@ -122,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(&MVVAR, &map, &gvar); + ZC_MVSetup(&gvar.mv, &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); @@ -150,7 +150,7 @@ void main(int argc, char *argv[]) while(!IN_KeyDown(sc_Escape)) { IN_ReadControl(&gvar.player[0]); - ZC_panPageManual(&MVVAR, &gvar.player, 0); + ZC_panPageManual(&gvar.mv, &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); @@ -174,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(&MVVAR, 0, 0); + ZC_ShowMV(&gvar.mv, 0, 0); } endclk = *clockw; @@ -187,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 ", 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("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("\n====\n"); printf("0 paloffset= %d\n", paloffset/3); printf("====\n\n"); diff --git a/src/zcroll.c b/src/zcroll.c index 0f57d4c7..0cdfadfe 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -74,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~ "); @@ -118,13 +118,13 @@ void main(int argc, char *argv[]) // setup camera and screen~ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&MVVAR, &map, &gvar); + ZC_MVSetup(&gvar.mv, &map, &gvar); // set up paging //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(&MVVAR, 0, 0); + mapGoTo(&gvar.mv, 0, 0); - ZC_PlayerXYpos(0, 0, &gvar.player, &MVVAR, 0, 1); + ZC_PlayerXYpos(0, 0, &gvar.player, &gvar.mv, 0, 1); EN_initPlayer(&gvar.player[0], &gvar.video); //print_anim_ids(gvar.player[0].enti.spri); if (gvar.video.sprifilei == -1) @@ -139,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=MVVAR[0].tx*TILEWH; - gvar.video.page[0].tly=MVVAR[0].ty*TILEWH; + gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; + gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH; shinku(&gvar); -//modexpdump(MVVAR[0].page); +//modexpdump(gvar.mv[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=MVVAR[0].tx*TILEWH; - gvar.video.page[0].tly=MVVAR[0].ty*TILEWH; + gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; + gvar.video.page[0].tly=gvar.mv[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 @@ -159,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(&MVVAR, &gvar.player, 0); + ZC_walk(&gvar.mv, &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); @@ -167,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(((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)) + 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)) { short i; for(i=800; i>=400; i--) @@ -179,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(MVVAR[0].page); IN_UserInput(1); } //o + if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1); } //o if(IN_KeyDown(22)){ modexPalUpdate0(&gvar.video.palette); } //u TAIL_FUNCTIONKEYFUNCTIONS -- 2.39.5