From 77d513c45df6caa3230d4905bafbfeb78b05a144 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 4 Apr 2017 12:10:30 -0500 Subject: [PATCH] p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] --- makefile | 4 ++-- src/0.c | 13 +++++-------- src/exmmtest.c | 17 +++++++---------- src/xcroll.c | 20 +++++++++----------- 4 files changed, 23 insertions(+), 31 deletions(-) diff --git a/makefile b/makefile index 2a083bc1..27e487c8 100755 --- a/makefile +++ b/makefile @@ -193,6 +193,8 @@ TESTEXEC = & xcroll.exe & inputest.exe & vrstest.exe & + tesuto.exe & + 0.exe & maptest.exe #zcroll.exe & TESTEXEC2 = & @@ -202,8 +204,6 @@ TESTEXEC2 = & fonttest.exe & fontgfx.exe & test0.exe & - tesuto.exe & - 0.exe & $(EXTERNTESTEXEC) TESTEXEC3= & pcxtest2.exe diff --git a/src/0.c b/src/0.c index 051bb332..69e6e39e 100755 --- a/src/0.c +++ b/src/0.c @@ -46,21 +46,18 @@ int main(int argc,char **argv) unsigned int bufsz; int fd; //nibble i; - char *bakapee1,*bakapee2; + char bakapee1[64],bakapee2[64]; boolean anim=1,noanim=0,zerostoppause=1; - bakapee1=malloc(64); - bakapee2=malloc(64); - if (argc < 2) { //fprintf(stderr,"drawvrl \n palette file optional\n"); - bakapee1 = FILENAME_1;//"data/aconita.vrl"; - bakapee2 = FILENAME_2;//"data/aconita.pal"; + strcpy(bakapee1, FILENAME_1);//"data/aconita.vrl"; + strcpy(bakapee2, FILENAME_2);//"data/aconita.pal"; }else{ - if(argv[1]) bakapee1 = argv[1]; - if(argv[2]) bakapee2 = argv[2]; + if(argv[1]){ strcpy(bakapee1, argv[1]);//bakapee1[] = *argv[1]; + if(argv[2]) strcpy(bakapee2, argv[2]); }//bakapee2[] = argv[2]; } } fd = open(bakapee1,O_RDONLY|O_BINARY); diff --git a/src/exmmtest.c b/src/exmmtest.c index 106ebab7..0e7bb0ce 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -110,6 +110,8 @@ void segatesuto() } #endif + + void main(int argc, char *argv[]) { @@ -125,17 +127,12 @@ main(int argc, char *argv[]) //#ifdef __WATCOMC__ // __segment sega; //#endif - //static byte bakapee[64]; - char *bakapee1, *bakapee2; + char bakapee1[64],bakapee2[64]; word baka; #ifdef __BORLANDC__ argc=argc; #endif - //file name // - bakapee1 = malloc(24); - bakapee2 = malloc(24); - //file name // #ifdef __16_PM__ #ifdef __DEBUG_PM__ @@ -149,12 +146,12 @@ main(int argc, char *argv[]) #ifdef PRINTBBDUMP //0000PRINTBB; KEYP #endif - if(argv[1]){ bakapee1 = argv[1]; - if(argv[2]) bakapee2 = argv[2]; } + if(argv[1]){ strcpy(bakapee1, argv[1]);//bakapee1[] = *argv[1]; + if(argv[2]) strcpy(bakapee2, argv[2]); }//bakapee2[] = argv[2]; } else{ //{ printf("filename!: "); scanf("%[^\n]", &bakapee); } - bakapee1 = "data/koishi~.pcx"; - bakapee2 = "data/test.map"; + strcpy(bakapee1, "data/koishi~.pcx"); //bakapee1 = "data/koishi~.pcx"; + strcpy(bakapee2, "data/test.map"); //bakapee2 = "data/test.map"; } #ifndef NOVID Startup16(&gvar); diff --git a/src/xcroll.c b/src/xcroll.c index fcc7778d..f8ee37b2 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -51,7 +51,7 @@ memptr pal; void main(int argc, char *argv[]) { static global_game_variables_t gvar; - char *bakapee1,*bakapee1p; + char bakapee1[64],bakapee1p[64]; struct glob_game_vars *ggvv; // sword bakapee; // if(argv[1]) bakapee = atoi(argv[1]); @@ -59,18 +59,16 @@ void main(int argc, char *argv[]) Startup16(&gvar); - bakapee1=malloc(64); - bakapee1p=malloc(64); ggvv=&gvar; if (argc < 2) { //fprintf(stderr,"drawvrl \n palette file optional\n"); - bakapee1 = FILENAME_1; - bakapee1p = FILENAME_1P; + strcpy(bakapee1, FILENAME_1); + strcpy(bakapee1p, FILENAME_1P); }else{ - if(argv[1]) bakapee1 = argv[1]; - if(argv[2]) bakapee1p = argv[2]; + if(argv[1]){ strcpy(bakapee1, argv[1]); + if(argv[2]) strcpy(bakapee1p, argv[2]); } } // OK, this one takes hellova time and needs to be done in farmalloc or MM_... @@ -190,14 +188,14 @@ void main(int argc, char *argv[]) { if(gvar.in.inst->Keyboard[sc_J]) { - bakapee1=FILENAME_1; - bakapee1p=FILENAME_1P; + strcpy(bakapee1, FILENAME_1); + strcpy(bakapee1p, FILENAME_1P); gvar.player[0].enti.overdraww=0; } if(gvar.in.inst->Keyboard[sc_K]) { - bakapee1=FILENAME_2; - bakapee1p=FILENAME_2P; + strcpy(bakapee1, FILENAME_2); + strcpy(bakapee1p, FILENAME_2P); gvar.player[0].enti.overdraww=2; } //read_vrs(&gvar, bakapee1, gvar.player[0].enti.spri->spritesheet); -- 2.39.2