X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tail.c;h=9cb0e76997507b1c8dbbb1eb3d7503c98a4877ee;hb=f888d29c0ceaa48568b15f3269df70e6498c9dbc;hp=83e20b852476c63d233a5558017bb47f81b4a9f0;hpb=8fe59539760b4d569c902912818c12bb5ffa9dde;p=16.git diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index 83e20b85..9cb0e769 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -142,6 +142,112 @@ void ShutdownCAMMPM (global_game_variables_t *gvar) //=========================================================================== +//////////////////////////////////////////////////////////////////// +// +// HANDLE INTRO SCREEN (SYSTEM CONFIG) +// +//////////////////////////////////////////////////////////////////// +void MU_IntroScreen(global_game_variables_t *gvar) +{ +#define MAINCOLOR 0x6c +#define EMSCOLOR 0x6c +#define XMSCOLOR 0x6c + +#define FILLCOLOR 14 + + long memory,emshere,xmshere; + int i,num,ems[10]={100,200,300,400,500,600,700,800,900,1000}, + xms[10]={100,200,300,400,500,600,700,800,900,1000}, + main[10]={32,64,96,128,160,192,224,256,288,320}; + + gvar->video.print.t=1; + gvar->video.print.tlsw=1; + gvar->video.print.bgcolor=8; + gvar->video.print.color=5; + + // + // DRAW MAIN MEMORY + // + num=32; + gvar->video.print.x=49-32; + + memory=(1023l+gvar->mmi.nearheap+gvar->mmi.farheap)/1024l; + for (i=0;i<10;i++) + if (memory>=main[i]) + { + gvar->video.print.y=163-8*i; + sprintf(global_temp_status_text, "% 4u", num); VL_print(global_temp_status_text, 0, gvar); + VL_Bar(49,163-8*i,6,5,MAINCOLOR-i,gvar); + num+=32; + } + gvar->video.print.y=171; + VL_print("MAIN", 0, gvar); + + + // + // DRAW EMS MEMORY + // + if (gvar->pm.emm.EMSPresent) + { + num=100; + gvar->video.print.x=89-32; + + emshere=4l*gvar->pm.emm.EMSPagesAvail; + for (i=0;i<10;i++) + if (emshere>=ems[i]) + { + gvar->video.print.y=163-8*i; + sprintf(global_temp_status_text, "% 4u", num); VL_print(global_temp_status_text, 0, gvar); + VL_Bar(89,163-8*i,6,5,EMSCOLOR-i,gvar); + num+=100; + } + gvar->video.print.y=171; + VL_print(" EMS", 0, gvar); + } + + // + // DRAW XMS MEMORY + // + if (gvar->pm.xmm.XMSPresent) + { + num=100; + gvar->video.print.x=129-32; + + xmshere=4l*gvar->pm.xmm.XMSPagesAvail; + for (i=0;i<10;i++) + if (xmshere>=xms[i]) + { + gvar->video.print.y=163-8*i; + sprintf(global_temp_status_text, "% 4u", num); VL_print(global_temp_status_text, 0, gvar); + VL_Bar(129,163-8*i,6,5,XMSCOLOR-i,gvar); + num+=100; + } + gvar->video.print.y=171; + VL_print(" XMS", 0, gvar); + } + + // + // FILL BOXES + // + if (gvar->in.MousePresent) + VL_Bar(164,82,12,2,FILLCOLOR,gvar); + + if (gvar->in.JoysPresent[0] || gvar->in.JoysPresent[1]) + VL_Bar(164,105,12,2,FILLCOLOR,gvar); + +//++++ if (gvar->sd.AdLibPresent)//SB && !SoundBlasterPresent) +//++++ VL_Bar(164,128,12,2,FILLCOLOR,gvar); + +//SB if (SoundBlasterPresent) +//SB VL_Bar(164,151,12,2,FILLCOLOR,gvar); + +//SS if (SoundSourcePresent) +//SS VL_Bar(164,174,12,2,FILLCOLOR,gvar); + IN_Ack (gvar); +} + +//=========================================================================== + /* ==================== = @@ -171,7 +277,6 @@ void ReadConfig(void) read(file,&mouseenabled,sizeof(mouseenabled)); read(file,&joystickenabled,sizeof(joystickenabled)); - read(file,&joypadenabled,sizeof(joypadenabled)); read(file,&joystickprogressive,sizeof(joystickprogressive)); read(file,&joystickport,sizeof(joystickport)); @@ -230,7 +335,6 @@ void ReadConfig(void) mouseenabled = true; joystickenabled = false; - joypadenabled = false; joystickport = 0; joystickprogressive = false; @@ -269,7 +373,6 @@ void WriteConfig(void) write(file,&mouseenabled,sizeof(mouseenabled)); write(file,&joystickenabled,sizeof(joystickenabled)); - write(file,&joypadenabled,sizeof(joypadenabled)); write(file,&joystickprogressive,sizeof(joystickprogressive)); write(file,&joystickport,sizeof(joystickport)); @@ -497,7 +600,7 @@ void TestSprites(void) spr = &spritetable[sprite-STARTSPRITES]; block = (spritetype _seg *)grsegs[sprite]; - VWB_Bar (hx,hy,TEXTWIDTH,bottomy-hy,WHITE); + VL_Bar (hx,hy,TEXTWIDTH,bottomy-hy,WHITE); PrintX=hx; PrintY=hy; @@ -528,7 +631,7 @@ void TestSprites(void) // // draw the current shift, then wait for key // - VWB_Bar(topx,hy,DISPWIDTH,bottomy-hy,WHITE); + VL_Bar(topx,hy,DISPWIDTH,bottomy-hy,WHITE); if (block) { PrintX = topx; @@ -646,10 +749,6 @@ void Quit (global_game_variables_t *gvar, char *error) //=========================================================================== -//#ifndef __WATCOMC__ -//char global_temp_status_text[512]; -//char global_temp_status_text2[512]; -//#else #ifdef __WATCOMC__ // // for mary4 (XT) @@ -693,64 +792,3 @@ void turboXT(byte bakapee) } } #endif - -const char *word_to_binary(word x) -{ - static char b[17]; - int z; - - b[0] = '\0'; - for (z = 16; z > 0; z >>= 1) - { - strcat(b, ((x & z) == z) ? "1" : "0"); - } - return b; -} - -const char *nibble_to_binary(nibble x) -{ - static char b[9]; - int z; - - b[0] = '\0'; - for (z = 8; z > 0; z >>= 1) - { - strcat(b, ((x & z) == z) ? "1" : "0"); - } - return b; -} - -const char *boolean_to_binary(boolean x) -{ - static char b[9]; - int z; - - b[0] = '\0'; - for (z = 1; z > 0; z >>= 1) - { - strcat(b, ((x & z) == z) ? "1" : "0"); - } - return b; -} - -void nibbletest() -{ - nibble pee; - printf("nibbletest\n"); - /* nibble to binary string */ - for(pee=0;pee<18;pee++) - printf(" %u %s\n", pee, nibble_to_binary(pee)); - printf(" sizeof(nibble)=%s\n", nibble_to_binary(sizeof(nibble))); - printf("end of nibble test\n"); -} - -void booleantest() -{ - boolean pee; - printf("booleantest\n"); - /* boolean to binary string */ - for(pee=0;pee<4;pee++) - printf(" %u %s\n", pee, boolean_to_binary(pee)); - printf(" sizeof(boolean)=%s\n", boolean_to_binary(sizeof(boolean))); - printf("end of boolean test\n"); -}