The You Game!

For everything not related to either Rayman or Pirate-Community.
Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
Bradandez
Annetta Fish
Posts: 18589
Joined: Wed Mar 21, 2012 12:50 am
Tings: 137530

Re: The You Game!

Post by Bradandez »

< isn't getting <'s copy of Smash Bros. until tomorrow.
Image
Master
Rayman 1
Posts: 53542
Joined: Sun Aug 21, 2011 10:14 am
Location: Somewhere specific, I'd assume.
Tings: 468310

Re: The You Game!

Post by Master »

Speaking of Smash, here's the Finale of Brawl in the Family, < will watch it in due time also:
GOT4N
Photographer
Posts: 3425
Joined: Tue Aug 24, 2010 7:10 pm
Tings: 400

Re: The You Game!

Post by GOT4N »

< got 3DS Smash Bros
Reese Riverson
Razorbeard
Posts: 40217
Joined: Wed Sep 03, 2003 5:32 pm
Location: R̸̨̧̛̝͎͔̹͉̫̞͚͎͈̫̲̘͕̞͔̼̣͍̞̤̹̫̘̼͚̤̮̟͍̺̯͍̜̹͓̤͖͎͌̀̿͗̍͌̈́̿̿͑̄̀͌̒̅͛̄̾̈͠ͅayman Pirate-Community Lodge
Contact:
Tings: 533732

Re: The You Game!

Post by Reese Riverson »

Mastré LeMashed wrote:Speaking of Smash, here's the Finale of Brawl in the Family, < will watch it in due time also:
< Finds that amusing.

< Also got the 3DS version this morning. :mrgreen:
Bradandez
Annetta Fish
Posts: 18589
Joined: Wed Mar 21, 2012 12:50 am
Tings: 137530

Re: The You Game!

Post by Bradandez »

Just rub it in <'s face, why don't ya!!! :mefiant:
Imco
Holly Luya
Posts: 9584
Joined: Sat Oct 23, 2010 3:16 pm
Location: Somewhere only we know
Contact:
Tings: 123540

Re: The You Game!

Post by Imco »

Hey Brad, you're not the only one who doesn't have it! < doesn't have it, because < doesn't like the stupid game :D
Reese Riverson
Razorbeard
Posts: 40217
Joined: Wed Sep 03, 2003 5:32 pm
Location: R̸̨̧̛̝͎͔̹͉̫̞͚͎͈̫̲̘͕̞͔̼̣͍̞̤̹̫̘̼͚̤̮̟͍̺̯͍̜̹͓̤͖͎͌̀̿͗̍͌̈́̿̿͑̄̀͌̒̅͛̄̾̈͠ͅayman Pirate-Community Lodge
Contact:
Tings: 533732

Re: The You Game!

Post by Reese Riverson »

< Likes the idea of being able to play the game on the go. :)

< Also wonders when Mastré LeMashed will be getting a 3DS.
Earth Gwee
Ly
Posts: 2689
Joined: Tue Apr 02, 2013 10:23 am
Location: The Glade of Dreams
Tings: 214195

Re: The You Game!

Post by Earth Gwee »

< is waiting for dinner and < is super hungry. <'s stomach won't shut up.
Bradandez
Annetta Fish
Posts: 18589
Joined: Wed Mar 21, 2012 12:50 am
Tings: 137530

Re: The You Game!

Post by Bradandez »

Imco97 wrote:Hey Brad, you're not the only one who doesn't have it! < doesn't have it, because < doesn't like the stupid game :D
Image
Hoodcom wrote:< Also wonders when Mastré LeMashed will be getting a 3DS.
Let's start a kickstarter to get him a 3DS.

< is eating waffles and filling out job applications.
Reese Riverson
Razorbeard
Posts: 40217
Joined: Wed Sep 03, 2003 5:32 pm
Location: R̸̨̧̛̝͎͔̹͉̫̞͚͎͈̫̲̘͕̞͔̼̣͍̞̤̹̫̘̼͚̤̮̟͍̺̯͍̜̹͓̤͖͎͌̀̿͗̍͌̈́̿̿͑̄̀͌̒̅͛̄̾̈͠ͅayman Pirate-Community Lodge
Contact:
Tings: 533732

Re: The You Game!

Post by Reese Riverson »

Bradandez wrote:
Imco97 wrote:Hey Brad, you're not the only one who doesn't have it! < doesn't have it, because < doesn't like the stupid game :D
Image
Hoodcom wrote:< Also wonders when Mastré LeMashed will be getting a 3DS.
Let's start a kickstarter to get him a 3DS.

< is eating waffles and filling out job applications.
< Absolutely wants to watch Ed, Edd, and Eddy after ^ posted that picture of Kevin with the Dork sign. :mrgreen:

< Also finds the kickstarter idea to be a good idea, it would be for a good cause!
Rayfist
Edith Up
Posts: 12553
Joined: Wed Jul 07, 2010 8:36 pm
Location: Right here, right now!
Tings: 176605

Re: The You Game!

Post by Rayfist »

Hoodcom wrote:
Mastré LeMashed wrote:Speaking of Smash, here's the Finale of Brawl in the Family, < will watch it in due time also:
< Finds that amusing.

< Also got the 3DS version this morning. :mrgreen:
Battle < in Smash Bros
THEdragon
Clark
Posts: 4845
Joined: Fri Nov 11, 2011 12:43 pm
Location: The Valley
Tings: 47510

Re: The You Game!

Post by THEdragon »

< Changed the desktop background of <'s parents computer to an image of the Musician tiling repeatedly. They have yet to find out.
Fifo
Razorwife
Posts: 10771
Joined: Thu Sep 19, 2013 7:08 pm
Location: rm –rf /*
Contact:
Tings: 104505

Re: The You Game!

Post by Fifo »

< wonders how to decode the Rayman 2 soundtrack. < wants something to do. <’s bored.
Shrooblord
Mr Stone
Posts: 15762
Joined: Tue Sep 07, 2010 5:07 pm
Location: The Buccaneer MK. II
Tings: 68850

Re: The You Game!

Post by Shrooblord »

< wonders why ^ wants to do that. They're all simply audio files in one of the folders of either the install directory or the CD itself. < has near to no hacking skill whatsoever and easily found them.
Fifo
Razorwife
Posts: 10771
Joined: Thu Sep 19, 2013 7:08 pm
Location: rm –rf /*
Contact:
Tings: 104505

Re: The You Game!

Post by Fifo »

Shrooblord wrote:< wonders why ^ wants to do that. They're all simply audio files in one of the folders of either the install directory or the CD itself. < has near to no hacking skill whatsoever and easily found them.
< is bored and < wants something to do.
incognito
Electoon
Posts: 15619
Joined: Wed Oct 02, 2013 10:34 am
Tings: 0

Re: The You Game!

Post by incognito »

Fifo wrote:
Shrooblord wrote:< wonders why ^ wants to do that. They're all simply audio files in one of the folders of either the install directory or the CD itself. < has near to no hacking skill whatsoever and easily found them.
< is bored and < wants something to do.

viewtopic.php?t=2406
Fifo
Razorwife
Posts: 10771
Joined: Thu Sep 19, 2013 7:08 pm
Location: rm –rf /*
Contact:
Tings: 104505

Re: The You Game!

Post by Fifo »

< finally found the solution:

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// The IMA step table
const unsigned short step_table[89] = { 
  7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 
  19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 
  50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 
  130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
  337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
  876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 
  2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
  5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 
  15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 
};

// The IMA index table
const signed char index_table[8] = {
  -1, -1, -1, -1, 2, 4, 6, 8
};

signed int decode(unsigned char nibble, signed short *stepindex, signed int *step, signed int predictor)
{
/*
	The following algorithm has been taken from the Multimedia Wiki,
	and optimized for stereo output.
		-> http://wiki.multimedia.cx/index.php?title=IMA_ADPCM

	Don't ask me how it works...
*/

	signed short diff = 0;

	*stepindex += index_table[(nibble & 7)];
	diff = *step >> 3;
	if (nibble & 1) diff += (*step >> 2);
	if (nibble & 2) diff += (*step >> 1);
	if (nibble & 4) diff += *step;
	if (nibble & 8) diff = -diff;
	predictor += diff;
	if (predictor > 32767) predictor = 32767;
	else if (predictor < -32768) predictor = -32768;
	if (*stepindex > 88) *stepindex = 88;
	else if (*stepindex < 0) *stepindex = 0;
	*step = step_table[(*stepindex)];

	return predictor;
}


int main(int argc, char* argv[])
{
	// Checking the command syntax
	if (argc != 2)
	{
		printf("Error: too");
		if (argc < 2) printf(" few ");
		else printf(" many ");
		printf("arguments.\nUsage: ray2get.exe file.apm file.wav\n");
		exit(EXIT_FAILURE);
	}

	// Variables
	unsigned char nibblel = 0; // The data to decode
	unsigned char nibbler = 0;
	signed int predictorl = 0; // The PCM16 data
	signed int predictorr = 0;
	signed short step_indexl = 0;
	signed short step_indexr = 0;
	signed int stepl = 0;
	signed int stepr = 0;
	unsigned int file_length = 0;
	unsigned int tmp32;
	char pcm_filename[strlen(argv[1]) + 5];
	char* dot_in_filename = NULL;

	// File buffers
	FILE *adp = NULL;
	FILE *pcm = NULL;

	adp = fopen(argv[1], "rb");
	if (adp == NULL)
	{
		printf("Error: unable to open file %s.\n", argv[1]);
		exit(EXIT_FAILURE);
	}

	// Give the apm file's name to the wave file, changing the
	// extension to .wav
	strcpy(pcm_filename, argv[1]);
	dot_in_filename = strrchr(pcm_filename, '.');
	if (dot_in_filename != NULL) *dot_in_filename = 0;
	strcat(pcm_filename, ".wav");

	pcm = fopen(pcm_filename, "wb");
	if (pcm == NULL)
	{
		printf("Error: unable to create output file.\n");
		fclose(adp);
		exit(EXIT_FAILURE);
	}

	// Wave file rendering...
	// RIFF chunk
	fprintf(pcm, "RIFF");
	fseek(adp, 0, SEEK_END);
	file_length = ftell(adp);
	file_length -= 0x62; file_length *= 4; file_length += 36;
	fwrite(&file_length, 4, 1, pcm);
	// Format subchunk
	fprintf(pcm, "WAVEfmt ");
	tmp32 = 16; fwrite(&tmp32, 4, 1, pcm); // Subchunk size
	tmp32 = 1; fwrite(&tmp32, 2, 1, pcm); // PCM
	tmp32 = 2; fwrite(&tmp32, 2, 1, pcm); // Stereo
	tmp32 = 22050; fwrite(&tmp32, 4, 1, pcm); // Frequency
	tmp32 = 88200; fwrite(&tmp32, 4, 1, pcm); // Byte rate
	tmp32 = 4; fwrite(&tmp32, 2, 1, pcm); // Block align
	tmp32 = 16; fwrite(&tmp32, 2, 1, pcm); // Bits per sample
	// Data subchunk
	fprintf(pcm, "data");
	file_length -= 36; fwrite(&file_length, 4, 1, pcm);

	// Reading the initial values
	// (predictor and step index for both channels)
	fseek(adp, 0x2c, SEEK_SET);
	fread(&predictorr, 4, 1, adp);
	fread(&step_indexr, 2, 1, adp);
	fseek(adp, 6, SEEK_CUR);
	fread(&predictorl, 4, 1, adp);
	fread(&step_indexl, 2, 1, adp);

	// Initializing steps for predictors
	stepl = step_table[step_indexl];
	stepr = step_table[step_indexr];

	// Seek for DATA chunk in apm file
	fseek(adp, 0x64, SEEK_SET);

	while (!feof(adp))
	{
		// First nibble decoding, left channel
		fread(&nibblel, 1, 1, adp);
		predictorl = decode(nibblel >> 4, &step_indexl, &stepl, predictorl);
		// Writing output...
		fwrite(&predictorl, 2, 1, pcm); // Writing output...

		// First nibble decoding, right channel
		fread(&nibbler, 1, 1, adp);
		predictorr = decode(nibbler >> 4, &step_indexr, &stepr, predictorr);
		// Writing output...
		fwrite(&predictorr, 2, 1, pcm); // Writing output...

		// Second nibble decoding, left channel
		predictorl = decode(nibblel, &step_indexl, &stepl, predictorl);
		// Writing output...
		fwrite(&predictorl, 2, 1, pcm); // Writing output...

		// Second nibble decoding, right channel
		predictorr = decode(nibbler, &step_indexr, &stepr, predictorr);
		fwrite(&predictorr, 2, 1, pcm); // Writing output...
	}

	fclose(pcm);
	fclose(adp);
	return 0;
}
THEdragon
Clark
Posts: 4845
Joined: Fri Nov 11, 2011 12:43 pm
Location: The Valley
Tings: 47510

Re: The You Game!

Post by THEdragon »

< Wants to draw the picture of the Musician's child that < saw in <'s dream.
rolesfamily
Uglette
Posts: 10232
Joined: Wed Oct 23, 2013 6:43 pm
Tings: 74925

Re: The You Game!

Post by rolesfamily »

<Has just got out of the bath - kinky
THEdragon
Clark
Posts: 4845
Joined: Fri Nov 11, 2011 12:43 pm
Location: The Valley
Tings: 47510

Re: The You Game!

Post by THEdragon »

< Drew the thing < said < wanted to draw.

Image
Post Reply