X-Git-Url: http://git.osdn.net/view?p=proj16%2F16.git;a=blobdiff_plain;f=src%2Flib%2F16_tail.c;h=1824789253778cefca01ed53774a788f33abdc09;hp=78831b024fc8726c0be853d7ed9ce50a5a72c48c;hb=4d4c2774d4e51f7356f7a5ef32ef61a9fd2c299a;hpb=fc31f3038cce0a7c28fb15915a6309fc7f853428 diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index 78831b02..18247892 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-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -106,8 +106,7 @@ void StartupCAMMPM (global_game_variables_t *gvar) MM_Startup(gvar); #ifdef __16_PM__ PM_Startup(gvar); -//???? - PM_CheckMainMem(gvar); +//???? PM_CheckMainMem(gvar); PM_UnlockMainMem(gvar); #endif CA_Startup(gvar); @@ -143,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); +} + +//=========================================================================== + /* ==================== = @@ -172,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)); @@ -231,7 +335,6 @@ void ReadConfig(void) mouseenabled = true; joystickenabled = false; - joypadenabled = false; joystickport = 0; joystickprogressive = false; @@ -270,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)); @@ -498,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; @@ -529,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; @@ -690,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"); -}