]> 4ch.mooo.com Git - 16.git/commitdiff
wwww
authorsparky4 <sparky4@cock.li>
Wed, 1 Feb 2017 14:48:48 +0000 (08:48 -0600)
committersparky4 <sparky4@cock.li>
Wed, 1 Feb 2017 14:48:48 +0000 (08:48 -0600)
src/lib/16_hc.c
src/lib/16_mm.c
src/lib/16_vl.c
src/lib/16_vrs.c
src/lib/scroll16.c
src/sountest.c

index 0f77772c6317a46923fe8d6f6b84a20bad71d2ea..d2ecddacdfc28c9cb19b70fae21355ab128d5645 100755 (executable)
@@ -301,7 +301,7 @@ size_t _basedcoreleft(void)
        if( segu == _NULLSEG ) {\r
                printf( "Unable to allocate based heap\n" );\r
                return 0;\r
-               //exit( 1 );\r
+               \r
        }\r
        else\r
 \r
index f894464ea91d6ce0cd70496f4570fcf1f5db135f..b338e5910e3515bfa8a6722429595e00109de6df 100755 (executable)
@@ -943,7 +943,7 @@ void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar)
                printf("        *baseptr=%Fp    ", *baseptr); printf("*useptr=%Fp\n", *(gvar->mm.mmnew->useptr));
                printf("        &baseptr=%Fp    ", &baseptr); printf("&useptr=%Fp\n", &(gvar->mm.mmnew->useptr));
 #endif
-       //exit(-5); }
+       //Quit(gvar, "gvar->mm.mmnew->useptr==NULL"); }
        gvar->mm.mmnew->attributes = BASEATTRIBUTES;
 
 //tryagain:
@@ -1022,9 +1022,7 @@ void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar)
                //heapdump();
 #endif
                printf(OUT_OF_MEM_MSG,(size-gvar->mmi.nearheap));
-               printf("for stability reasons the program will shut down! wwww\n");
-               MM_Shutdown(gvar);
-               exit(-1);
+               Quit(gvar, "for stability reasons the program will shut down! wwww\n");
        }
        else
                gvar->mm.mmerror = true;
index 782bd3d654306b22ee891e2d6df22ffa3bcdc382..fbf51fa6bbffd2dd6c91916dc6b291fad8d7f86f 100755 (executable)
@@ -649,8 +649,7 @@ modexNewPal() {
 \r
        /* handle errors */\r
        if(!ptr) {\r
-       printf("Could not allocate palette.\n");\r
-       exit(-1);\r
+               printf("Could not allocate palette.\n");\r
        }\r
 \r
        return ptr;\r
@@ -674,7 +673,6 @@ modexLoadPalFile(byte *filename, byte **palette) {
        file = fopen(filename, "rb");\r
        if(!file) {\r
        printf("Could not open palette file: %s\n", filename);\r
-       exit(-2);\r
        }\r
 \r
        /* read the file */\r
@@ -713,7 +711,6 @@ modexSavePalFile(char *filename, byte *pal) {
        file = fopen(filename, "wb");\r
        if(!file) {\r
        printf("Could not open %s for writing\n", filename);\r
-       exit(-2);\r
        }\r
 \r
        /* write the data to the file */\r
index 75908ace9267d61e923e9d6e1883d5f4e6f633ac..0b3fc8f5bf78b6c487a8c67dc3f8895f8a8c7060 100755 (executable)
@@ -102,8 +102,7 @@ int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container
        close(fd);\r
        if(!success)\r
        {\r
-               fprintf(stderr, "Unable to load file");\r
-               exit(3);\r
+               Quit (gvar, "Unable to load file");\r
        }\r
        vrs_cont->data_size = size - sizeof(struct vrs_header);\r
        vrs_cont->buffer = buffer;\r
index 5937b228487cae1db3d7cd2ca66cc5f9138ac035..5a9659c6b726925e3afe3688a26f35c1552412b2 100755 (executable)
@@ -324,80 +324,12 @@ void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)
        outp(AC_INDEX, (moo[0].page->dx & 0x03) << 1);\r
 }\r
 \r
-/*map_t\r
-allocMap(int w, int h) {\r
-       map_t result;\r
-\r
-       result.width =w;\r
-       result.height=h;\r
-       result.data = malloc(sizeof(byte) * w * h);\r
-       //result.data = (byte *)alloc_emem(((int)sizeof(byte) * w * h)/1024);\r
-       if(isEMS() || checkEMS())\r
-       {\r
-               XMOVE mm;\r
-               //emmhandle = mallocEMS(coretotalEMS());//alloc_emem((int)sizeof(map))\r
-               mm.length=sizeof(result);\r
-               mm.sourceH=0;\r
-               mm.sourceOff=ptr2long(&result);\r
-               mm.destH=emmhandle;\r
-               mm.destOff=0;\r
-               ist = move_emem(&mm);\r
-               if(!ist){ dealloc_emem(emmhandle); exit(5); }\r
-               printf("%d\n", coretotalEMS());\r
-       }\r
-\r
-       return result;\r
-}*/\r
-\r
 void\r
 initMap(map_t *map) {\r
        // just a place holder to fill out an alternating pattern\r
-       int x, y;//, xx, yy;\r
-       int i;//, q;\r
+       int x, y;\r
+       int i;\r
        int tile = 1;\r
-       //if(!isEMS() || !checkEMS())\r
-//             map->tiles = malloc(sizeof(tiles_t));\r
-       //else\r
-       //      map->tiles = (tiles_t *)alloc_emem(sizeof(tiles_t));\r
-\r
-        //create the tile set\r
-       //if(!isEMS() || !checkEMS())\r
-//             map->tiles->data = malloc(sizeof(bitmap_t));\r
-       //else\r
-       //      map->tiles->data = (bitmap_t *)alloc_emem(sizeof(bitmap_t));\r
-//     map->tiles->data->width = (TILEWH);\r
-//     map->tiles->data->height= TILEWH;\r
-       //if(!isEMS() || !checkEMS())\r
-//             map->tiles->data->data = malloc((TILEWH*2)*TILEWH);\r
-       //else\r
-       //      map->tiles->data->data = (byte *)alloc_emem((TILEWH*2)*TILEWH);\r
-//     map->tiles->tileHeight = TILEWH;\r
-//     map->tiles->tileWidth =TILEWH;\r
-//     map->tiles->rows = 1;\r
-//     map->tiles->cols = 1;//2;\r
-\r
-/*     q=0;\r
-       //for(y=0; y<map->height; y++) {\r
-       //for(x=0; x<map->width; x++) {\r
-       i=0;\r
-       for(yy=0; yy<TILEWH; yy++) {\r
-       for(xx=0; xx<(TILEWH); xx++) {\r
-               //if(x<TILEWH){\r
-                 map->tiles->data->data[i+1] = map->data[q];//28;//0x24;\r
-//               printf("[%d]", map->tiles->data->data[i]);\r
-               //}else{\r
-                 //map->tiles->data->data[i] = map->data[q];//0;//0x34;\r
-                 //printf("]%d[==[%d]", i, map->tiles->data->data[i]);\r
-               //}\r
-               i++;\r
-       }\r
-//     printf("\n");\r
-       }\r
-//     printf("[%d]", map->data[q]);\r
-       q++;*/\r
-//     }\r
-       //printf("\n\n");\r
-//     }\r
 \r
        i=0;\r
        for(y=0; y<map->height; y++) {\r
index ac8908c3d9e98a655be49efe4ad4a4a1b43f8537..c8353ef0c411751a3e8a8606a40921851ee96c1e 100755 (executable)
@@ -51,6 +51,7 @@ static unsigned int musical_scale[18] = {
 \r
 void main(int argc, char near *argv[])\r
 {\r
+       static global_game_variables_t gvar;\r
        word i;\r
 //     static FMInstrument testInst =\r
 //{\r
@@ -67,8 +68,7 @@ void main(int argc, char near *argv[])
        //FMSetVoice(0, &testInst);\r
        if(!init_adlib())\r
        {\r
-               printf("Cannot init library\n");\r
-               exit(-5);\r
+               Quit(gvar, "Cannot init library");\r
        }\r
 \r
        if (adlib_fm_voices > 9)\r