/**
 * \brief Decodes Corridor 7 Shareware data 
 * \return Nothing.
 */
PUBLIC void corridor7share_decoder( void )
{
	printf( "Corridor 7 Alien Invasion Shareware Decoding\n\n" );

	if( ! buildCacheDirectories() )
    {
        fprintf( stderr, "Unable to create cache directories\n" );

		return;
    }
	
	if( GFXFile_Setup( "VGADICT.DMO", "VGAHEAD.DMO", "VGAGRAPH.DMO" ) )
	{
		GFXFile_decodeFont( 1, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 2, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 3, 256, 128, DIR_PICS );

		GFXFile_decodeGFX( 4, 42, corridor_gamepal, DIR_PICS );
	}
	GFXFile_Shutdown();

	PageFile_ReduxDecodePageData( "GFXTILES.DMO", DIR_WALLS, DIR_SPRITES, DIR_DSOUND, corridor_gamepal );


/*
	if( AudioFile_Setup( "AUDIOHED.DMO", "AUDIOT.DMO" ) )
	{
		AudioFile_ReduxDecodeSound( 0, 0, DIR_SOUNDFX );

		AudioFile_ReduxDecodeMusic( 0, 0, DIR_MUSIC, NULL );
	}
	AudioFile_Shutdown();
*/
}
/**
 * \brief Decodes Blake Stone Aliens of Gold Full Version data. 
 * \return Nothing. 
 */
PUBLIC void blakestoneAGfull_decoder( void )
{
	W32 width, height;
	void *data;
	char fname[ 1024 ];

	W8 *tempPalette;

	printf( "\n\nBlake Stone: Aliens of Gold Decoding\n" );

	if( ! buildCacheDirectories() )
    {
        printf( "Unable to create cache directories\n" );

		return;
    }
	
	if( GFXFile_Setup( "VGADICT.BS6", "VGAHEAD.BS6", "VGAGRAPH.BS6" ) )
	{
		GFXFile_decodeFont( 1, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 2, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 3, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 4, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 5, 256, 128, DIR_PICS );

		GFXFile_decodeScript( 181, 223, DIR_GSCRIPTS );

		GFXFile_decodeGFX( 6, 164, blakestone_gamepal, DIR_PICS );


		GFXFile_cacheChunk( 168 );
		tempPalette = (PW8)GFXFile_getChunk( 168 );

		data = GFXFile_decodeChunk_RGB24( 29, &width, &height, tempPalette );
		if( data )
		{
			wt_snprintf( fname, sizeof( fname ), "%s%c%.3d.tga", DIR_PICS, PATH_SEP, 29 );
			
			RGB24_adjustBrightness( data, width * height * 3 );
			
			TGA_write( fname, 24, width, height, data, 0, 1 );
			
			MM_FREE( data );
		}


		GFXFile_cacheChunk( 167 );
		tempPalette = (PW8)GFXFile_getChunk( 167 );

		data = GFXFile_decodeChunk_RGB24( 30, &width, &height, tempPalette );
		if( data )
		{
            wt_snprintf( fname, sizeof( fname ), "%s%c%.3d.tga", DIR_PICS, PATH_SEP, 30 );
			
			RGB24_adjustBrightness( data, width * height * 3 );
			
			TGA_write( fname, 24, width, height, data, 0, 1 );
			
			MM_FREE( data );
		}

	}
	GFXFile_Shutdown();

	

	PageFile_ReduxDecodePageData( "VSWAP.BS6", DIR_WALLS, DIR_SPRITES, DIR_DSOUND, blakestone_gamepal );

/*
	if( AudioFile_Setup( "AUDIOHED.BS6", "AUDIOT.BS6" ) )
	{
		AudioFile_ReduxDecodeSound( 0, 200, DIR_SOUNDFX );

		AudioFile_ReduxDecodeMusic( 200, 210, DIR_MUSIC, NULL );
	}
	AudioFile_Shutdown();
*/	
}
Ejemplo n.º 3
0
/**
 * \brief Decodes Wolfenstein 3-D Shareware versions 1.0 to 1.4
 * \return Nothing.
 */
void wolfshare_decoder( void )
{
	picNum_t picNum;
	W32 retCheck = 0;
    W32 pic_end = 147;
    char pakName[64];

    // Following values are for share V14
    W32 soundChunkStart = 87;
    W32 soundChunkEnd = 174;
    W32 musicChunkStart = 261;
    W32 musicChunkEnd = 261+27;

    W32 __WL1_L_COLONPIC = WL1_L_COLONPIC;
    W32 __WL1_L_NUM0PIC = WL1_L_NUM0PIC;
    W32 __WL1_L_NUM9PIC = WL1_L_NUM9PIC;
    W32 __WL1_L_PERCENTPIC = WL1_L_PERCENTPIC;
    W32 __WL1_L_APIC = WL1_L_APIC;
    W32 __WL1_L_ZPIC = WL1_L_ZPIC;
    W32 __WL1_L_EXPOINTPIC = WL1_L_EXPOINTPIC;
    W32 __WL1_L_APOSTROPHEPIC = WL1_L_APOSTROPHEPIC;
    W32 __WL1_STATUSBARPIC = WL1_STATUSBARPIC;
    W32 __WL1_NOKEYPIC = WL1_NOKEYPIC;
    W32 __WL1_N_BLANKPIC = WL1_N_BLANKPIC;
    W32 __WL1_N_0PIC = WL1_N_0PIC;
    W32 __WL1_N_1PIC = WL1_N_1PIC;
    W32 __WL1_N_9PIC = WL1_N_9PIC;
    W32 __WL1_H_BOTTOMINFOPIC = WL1_H_BOTTOMINFOPIC;

        
	printf( "Wolfenstein 3-D Shareware" );
    if( wolf_version == WL1_V10 )
    {
        printf( " V1.0" );


        wt_snprintf( pakName, sizeof(pakName), "%s", "wolf_shareV10.pak" );
        
        pic_end = 139;

        soundChunkStart = 87;
        soundChunkEnd = 146;
        musicChunkStart = 219;
        musicChunkEnd = 219+27;

         __WL1_L_COLONPIC = 49;
         __WL1_L_NUM0PIC = 50;
         __WL1_L_NUM9PIC = 59;
         __WL1_L_PERCENTPIC = 60;
         __WL1_L_APIC = 61;
         __WL1_L_ZPIC = 86;
         __WL1_L_EXPOINTPIC = 87;
         __WL1_L_APOSTROPHEPIC = 87; // none

         __WL1_STATUSBARPIC = 90;
		 __WL1_NOKEYPIC = 99;
         __WL1_N_BLANKPIC = 102;

         __WL1_N_0PIC = 103;
         __WL1_N_1PIC = 104;
         __WL1_N_9PIC = 112;

         __WL1_H_BOTTOMINFOPIC = 20;
    }
    if( wolf_version == WL1_V11 )
    {
        printf( " V1.1" );

        wt_snprintf( pakName, sizeof(pakName), "%s", "wolf_shareV11.pak" );

        pic_end = 141;

         __WL1_L_COLONPIC = 53;
         __WL1_L_NUM0PIC = 54;
         __WL1_L_NUM9PIC = 63;
         __WL1_L_PERCENTPIC = 64;
         __WL1_L_APIC = 65;
         __WL1_L_ZPIC = 90;
         __WL1_L_EXPOINTPIC = 91;
         __WL1_L_APOSTROPHEPIC = 92; 

         __WL1_STATUSBARPIC = 95;
		 __WL1_NOKEYPIC = 104;
         __WL1_N_BLANKPIC = 107;

         __WL1_N_0PIC = 108;
         __WL1_N_1PIC = 109;
         __WL1_N_9PIC = 117;

         __WL1_H_BOTTOMINFOPIC = 20;
    }
    if( wolf_version == WL1_V14 )
    {
        printf( " V1.4" );

        wt_snprintf( pakName, sizeof(pakName), "%s", "wolf_shareV14.pak" );
    }
    printf( " Decoding\n\n" );

	if( ! buildCacheDirectories() )
    {
        fprintf( stderr, "Unable to create cache directories\n" );

		return;
    }

	picNum.PN_StatusBar = __WL1_STATUSBARPIC;
    picNum.PN_NoKey = __WL1_NOKEYPIC;
    picNum.PN_Blank = __WL1_N_BLANKPIC;
    picNum.PN_Title1 = 999;
    picNum.PN_Title2 = 999;
    picNum.PN_TitlePalette = 999;
    picNum.PN_0 = __WL1_N_0PIC;
    picNum.PN_1 = __WL1_N_1PIC;
    picNum.PN_9 = __WL1_N_9PIC;
    picNum.PN_Colon = __WL1_L_COLONPIC;
    picNum.PN_Num0 = __WL1_L_NUM0PIC;
    picNum.PN_Num9 = __WL1_L_NUM9PIC;
    picNum.PN_Percent = __WL1_L_PERCENTPIC;
    picNum.PN_A = __WL1_L_APIC;
    picNum.PN_Z = __WL1_L_ZPIC;
    picNum.PN_Expoint = __WL1_L_EXPOINTPIC;
    picNum.PN_Apostrophe = __WL1_L_APOSTROPHEPIC;
    picNum.PN_IDGuys1 = 999;
    picNum.PN_IDGuys2 = 999;
    picNum.PN_EndScreen1 = 999;
    picNum.PN_EndScreen9 = 999;
	picNum.PN_HelpScript = 0;
	picNum.PN_ScriptStart = 0;
    picNum.PN_ScriptEnd = 0;
    picNum.PN_bottomInfoPic = __WL1_H_BOTTOMINFOPIC;
    
    
    
	retCheck += wolf3d_gfx( "VGADICT.WL1", "VGAHEAD.WL1", "VGAGRAPH.WL1", 3, pic_end, &picNum, WL1_GetReduxGFXFileName );	

	retCheck += PageFile_ReduxDecodePageData( "VSWAP.WL1", DIR_WALLS, DIR_SPRITES, DIR_DSOUND, wolf_gamepal );
    
    if( _doRedux )
    {
    	retCheck += MapFile_ReduxDecodeMapData( "MAPHEAD.WL1",  wolf_version == WL1_V10 ? "MAPTEMP.WL1" : "GAMEMAPS.WL1", DIR_MAPS, wolf_gamepal, CeilingColourWL6, WL6_songs, parTimesWL6, "%s/w%.2d.map" );  
    }

	if( AudioFile_Setup( "AUDIOHED.WL1", "AUDIOT.WL1" ) )
	{
		retCheck += AudioFile_ReduxDecodeSound( soundChunkStart, soundChunkEnd, DIR_SOUNDFX );
        
		retCheck += AudioFile_ReduxDecodeMusic( musicChunkStart, musicChunkEnd, DIR_MUSIC, songTitles );
	}
	AudioFile_Shutdown();
	

    if( retCheck == 5 && ! _outputInDirectory )
    {
    	PAK_builder( pakName, 0, true );
    }

}
/**
 * \brief Decodes Blake Stone Planet Strike data. 
 * \return Nothing. 
 */
PUBLIC void blakestonePS_decoder( void )
{
	W32 width, height;
	void *data;
	char fname[ 256 ];

	W8 *tempPalette;


	printf( "Blake Stone: Planet Strike Decoding\n\n" );

	if( ! buildCacheDirectories() )
    {
        fprintf( stderr, "Unable to create cache directories\n" );

		return;
    }
	
	if( GFXFile_Setup( "VGADICT.VSI", "VGAHEAD.VSI", "VGAGRAPH.VSI" ) )
	{
		GFXFile_decodeFont( 1, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 2, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 3, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 4, 256, 128, DIR_PICS );
		GFXFile_decodeFont( 5, 256, 128, DIR_PICS );


        GFXFile_decodeScript( 216, 248, DIR_GSCRIPTS );
		

		GFXFile_decodeGFX( 6, 197, blakestone_gamepal, DIR_PICS );
	
		
		
		GFXFile_cacheChunk( 201 );
		tempPalette = (PW8)GFXFile_getChunk( 201 );

		data = GFXFile_decodeChunk_RGB24( 53, &width, &height, tempPalette );
		if( data )
		{
            wt_snprintf( fname, sizeof( fname ), "%s%c%.3d.tga", DIR_PICS, PATH_SEP, 53 );
			
			RGB24_adjustBrightness( data, width * height * 3 );
			
			TGA_write( fname, 24, width, height, data, 0, 1 );
			
			MM_FREE( data );
		}


		GFXFile_cacheChunk( 203 );
		tempPalette = (PW8)GFXFile_getChunk( 203 );

		data = GFXFile_decodeChunk_RGB24( 143, &width, &height, tempPalette );
		if( data )
		{
            wt_snprintf( fname, sizeof( fname ), "%s%c%.3d.tga", DIR_PICS, PATH_SEP, 143 );
			
			RGB24_adjustBrightness( data, width * height * 3 );
			
			TGA_write( fname, 24, width, height, data, 0, 1 );
			
			MM_FREE( data );
		}

		data = GFXFile_decodeChunk_RGB24( 144, &width, &height, tempPalette );
		if( data )
		{
            wt_snprintf( fname, sizeof( fname ), "%s%c%.3d.tga", DIR_PICS, PATH_SEP, 144 );
			
			RGB24_adjustBrightness( data, width * height * 3 );
			
			TGA_write( fname, 24, width, height, data, 0, 1 );
			
			MM_FREE( data );
		}
	
	}
	GFXFile_Shutdown();

	

	PageFile_ReduxDecodePageData( "VSWAP.VSI", DIR_WALLS, DIR_SPRITES, DIR_DSOUND, blakestone_gamepal );

/*
	if( AudioFile_Setup( "AUDIOHED.VSI", "AUDIOT.VSI" ) )
	{
		AudioFile_ReduxDecodeSound( 0, 0, DIR_SOUNDFX );

		AudioFile_ReduxDecodeMusic( 0, 0, DIR_MUSIC, NULL );
	}
	AudioFile_Shutdown();
*/
}
Ejemplo n.º 5
0
/**
 * \brief Decodes Wolfenstein 3-D full version. 
 * \return Nothing.
 */
PUBLIC void wolffull_decoder( void )
{
	picNum_t picNum;
	W32 retCheck = 0;
		
	printf( "Wolfenstein 3-D Decoding\n\n" );

	if( ! buildCacheDirectories() )
    {
        fprintf( stderr, "Unable to create cache directories\n" );

		return;
    }

    picNum.PN_StatusBar = WL6_STATUSBARPIC;
    picNum.PN_NoKey = WL6_NOKEYPIC;
    picNum.PN_Blank = WL6_N_BLANKPIC;
    picNum.PN_Title1 = 999;
    picNum.PN_Title2 = 999;
    picNum.PN_TitlePalette = 999;
    picNum.PN_0 = WL6_N_0PIC;
    picNum.PN_1 = WL6_N_1PIC;
    picNum.PN_9 = WL6_N_9PIC;
    picNum.PN_Colon = WL6_L_COLONPIC;
    picNum.PN_Num0 = WL6_L_NUM0PIC;
    picNum.PN_Num9 = WL6_L_NUM9PIC;
    picNum.PN_Percent = WL6_L_PERCENTPIC;
    picNum.PN_A = WL6_L_APIC;
    picNum.PN_Z = WL6_L_ZPIC;
    picNum.PN_Expoint = WL6_L_EXPOINTPIC;
    picNum.PN_Apostrophe = WL6_L_APOSTROPHEPIC;
    picNum.PN_IDGuys1 = 999;
    picNum.PN_IDGuys2 = 999;
    picNum.PN_EndScreen1 = 999;
    picNum.PN_EndScreen9 = 999;
	picNum.PN_HelpScript = 138;
	picNum.PN_ScriptStart = 143;
    picNum.PN_ScriptEnd = 149;
    picNum.PN_bottomInfoPic = WL6_H_BOTTOMINFOPIC;
		

	retCheck += wolf3d_gfx( "VGADICT.WL6", "VGAHEAD.WL6", "VGAGRAPH.WL6", 3, 135, &picNum, WL6_GetReduxGFXFileName );
		

	retCheck += PageFile_ReduxDecodePageData( "VSWAP.WL6", DIR_WALLS, DIR_SPRITES, DIR_DSOUND, wolf_gamepal );


    if( _doRedux )
    {
    	retCheck += MapFile_ReduxDecodeMapData( "MAPHEAD.WL6", "GAMEMAPS.WL6", DIR_MAPS, wolf_gamepal, CeilingColourWL6, WL6_songs, parTimesWL6, "%s/w%.2d.map" );  
    }

	if( AudioFile_Setup( "AUDIOHED.WL6", "AUDIOT.WL6" ) )
	{
		retCheck += AudioFile_ReduxDecodeSound( 87, 174, DIR_SOUNDFX );

		retCheck += AudioFile_ReduxDecodeMusic( 261, 261+27, DIR_MUSIC, songTitles );
	}
	AudioFile_Shutdown();
	

    if( retCheck == 5  && ! _outputInDirectory )
    {
    	PAK_builder( "wolf.pak", 0, true );
    }


}