User:Xerxes: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
hello. my name is xerxes, but you may also know me as momrocker. i've been interested in emulation and retro gaming (if you can call the gamecube "retro") since i was in middle school and i've always had a fondness for computers even earlier than that. i have crippling attention problems though which has kept me from contributing in any meaningful way. i have no formal education, and a very small but close group of friends. my real name is unimportant, but my friends call me xerxes or x anyways. once upon a time six or seven years ago, while still a teenager, i affiliated with a different community than the dolphin community. i probably shouldn't name it, but anyone who recognizes me would know anyways. that community was my favorite place on the internet and i eventually became obsessed and amazed by all the people there and their capabilities. i was just starting the process of teaching myself programming when i started using the site irc. it only took a few weeks before i got into a stupid, petty argument with the creator of the site, and instead of just backing off and letting it be, instead i saw weakness and i pressed the issue. i caused him (indirectly) to have a mental breakdown, and destroyed my favorite site, while also destroying any chance i had to learn from the people there and really become a contributor. nowadays the site is in complete shambles and i've blamed myself for it ever since. i can count on one hand the amount of times i've said anything on irc since all that happened. all i've ever tried to accomplish here is to atone for my past mistakes. i don't separate myself from the community out of a sense of spite or malice. i do it because i know if i let myself, i could cause the same thing to happen again. i'm sorry.
I test games and enjoy boring pedantic work. If I do something wrong/stupid please tell me on my discussion page or right here, I don't care where.
 
== TMD scrape script ==
Adapted from [[User:PowerKitten]]'s script to work on Linux.
 
Open a terminal, make a TMDs directory (<code>mkdir ~/TMDs</code>), then save the following script to your desktop in a text editor as <code>curl.sh</code>:
 
<pre>
#!/bin/bash
 
cd ~/TMDs && curl -f http://ccs.cdn.shop.wii.com/ccs/download/00010001{41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}{30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}{30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}{41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}/tmd --output 00010001#1#2#3#4.tmd
</pre>
 
Then in your terminal run <code>sh ~/Desktop/curl.sh</code> and it'll begin scraping the 850,000 possible IDs.
 
Make a copy of the ~/TMDs directory to ~/TMDcopy, and make another folder ~/renamedTMD. This is the C program I used to rename them all to Dolphin's 6-character IDs (pls no bully I wrote this, not portable, requires changing all the numbers and the username from "xerxes" to your username because I'm garbage):
 
<pre>
#include <stdio.h>
#include <string.h>
 
char hexToChar(int n)
{
switch (n)
{
case 0x0:
return '0';
case 0x1:
return '1';
case 0x2:
return '2';
case 0x3:
return '3';
case 0x4:
return '4';
case 0x5:
return '5';
case 0x6:
return '6';
case 0x7:
return '7';
case 0x8:
return '8';
case 0x9:
return '9';
case 0xA:
return 'A';
case 0xB:
return 'B';
case 0xC:
return 'C';
case 0xD:
return 'D';
case 0xE:
return 'E';
case 0xF:
return 'F';
default:
return '0';
}
return '0';
}
 
int main()
{
char fromfilename[100] = {0};
strcpy(fromfilename, "/home/xerxes/TMDcopy/000100014A414A4A.tmd\0");
char tofilename[100] = {0};
strcpy(tofilename, "/home/xerxes/renamedTMD/JAJJ01.tmd\0");
char buffer[2] = {0};
FILE *file;
int count = 1;
int i, k, m, o;
for (i = 0x41; i <= 0x5A; ++i)
{
fromfilename[29] = hexToChar(i / 16);
fromfilename[30] = hexToChar(i % 16);
for (k = 0x30; k <= 0x5A; ++k)
{
if (k == 0x3A)
{
k = 0x41;
}
fromfilename[31] = hexToChar(k / 16);
fromfilename[32] = hexToChar(k % 16);
for (m = 0x30; m <= 0x5A; ++m)
{
if (m == 0x3A)
{
m = 0x41;
}
fromfilename[33] = hexToChar(m / 16);
fromfilename[34] = hexToChar(m % 16);
for (o = 0x41; o <= 0x5A; ++o)
{
fromfilename[35] = hexToChar(o / 16);
fromfilename[36] = hexToChar(o % 16);
++count;
if ((file = fopen(fromfilename, "rb")))
{
tofilename[24] = i;
tofilename[25] = k;
tofilename[26] = m;
tofilename[27] = o;
fseek(file, 0x198, SEEK_SET);
fread(buffer, 1, 2, file);
tofilename[28] = buffer[0];
tofilename[29] = buffer[1];
printf("%d\t\t%s\n", count, tofilename);
fclose(file);
rename(fromfilename, tofilename);
}
}
}
}
}
}
</pre>
 
With that done, this should rename and then move each TMD file to an appropriate "ID".tmd file with the ID used by Dolphin within the ~/renamedTMD folder. Then you're done!
 
== Trivia ==
On September 3-5, 2017, I got to watch [[User:Lucario]] and [[User:Kolano]] make a [https://wiki.dolphin-emu.org/index.php?title=Template%3AGlobalProblems%2Fsandbox&type=revision&diff=150359&oldid=149179 near-perfect forgery] of MediaWiki's default header because it [https://wiki.dolphin-emu.org/index.php?title=Template_talk%3AGlobalProblems%2FVirtual_Console&type=revision&diff=150376&oldid=149204 seemed like a better place to put a link].

Revision as of 20:12, 24 October 2019

I test games and enjoy boring pedantic work. If I do something wrong/stupid please tell me on my discussion page or right here, I don't care where.

TMD scrape script

Adapted from User:PowerKitten's script to work on Linux.

Open a terminal, make a TMDs directory (mkdir ~/TMDs), then save the following script to your desktop in a text editor as curl.sh:

#!/bin/bash

cd ~/TMDs && curl -f http://ccs.cdn.shop.wii.com/ccs/download/00010001{41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}{30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}{30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}{41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F,50,51,52,53,54,55,56,57,58,59,5A}/tmd --output 00010001#1#2#3#4.tmd

Then in your terminal run sh ~/Desktop/curl.sh and it'll begin scraping the 850,000 possible IDs.

Make a copy of the ~/TMDs directory to ~/TMDcopy, and make another folder ~/renamedTMD. This is the C program I used to rename them all to Dolphin's 6-character IDs (pls no bully I wrote this, not portable, requires changing all the numbers and the username from "xerxes" to your username because I'm garbage):

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

char hexToChar(int n)
{
	switch (n)
	{
		case 0x0:
			return '0';
		case 0x1:
			return '1';
		case 0x2:
			return '2';
		case 0x3:
			return '3';
		case 0x4:
			return '4';
		case 0x5:
			return '5';
		case 0x6:
			return '6';
		case 0x7:
			return '7';
		case 0x8:
			return '8';
		case 0x9:
			return '9';
		case 0xA:
			return 'A';
		case 0xB:
			return 'B';
		case 0xC:
			return 'C';
		case 0xD:
			return 'D';
		case 0xE:
			return 'E';
		case 0xF:
			return 'F';
		default:
			return '0';
	}
	return '0';
}

int main()
{
	char fromfilename[100] = {0};
	strcpy(fromfilename, "/home/xerxes/TMDcopy/000100014A414A4A.tmd\0");
	
	char tofilename[100] = {0};
	strcpy(tofilename, "/home/xerxes/renamedTMD/JAJJ01.tmd\0");
	
	char buffer[2] = {0};
	
	FILE *file;
	
	int count = 1;
	
	int i, k, m, o;
	
	for (i = 0x41; i <= 0x5A; ++i)
	{
		fromfilename[29] = hexToChar(i / 16);
		fromfilename[30] = hexToChar(i % 16);
		for (k = 0x30; k <= 0x5A; ++k)
		{
			if (k == 0x3A)
			{
				k = 0x41;
			}
			fromfilename[31] = hexToChar(k / 16);
			fromfilename[32] = hexToChar(k % 16);
			for (m = 0x30; m <= 0x5A; ++m)
			{
				if (m == 0x3A)
				{
					m = 0x41;
				}
				fromfilename[33] = hexToChar(m / 16);
				fromfilename[34] = hexToChar(m % 16);
				for (o = 0x41; o <= 0x5A; ++o)
				{
					fromfilename[35] = hexToChar(o / 16);
					fromfilename[36] = hexToChar(o % 16);
					
					++count;
					
					if ((file = fopen(fromfilename, "rb")))
					{
						tofilename[24] = i;
						tofilename[25] = k;
						tofilename[26] = m;
						tofilename[27] = o;
						fseek(file, 0x198, SEEK_SET);
						fread(buffer, 1, 2, file);
						tofilename[28] = buffer[0];
						tofilename[29] = buffer[1];
						printf("%d\t\t%s\n", count, tofilename);
						fclose(file);
						rename(fromfilename, tofilename);
					}
				}
			}
		}
	}
}

With that done, this should rename and then move each TMD file to an appropriate "ID".tmd file with the ID used by Dolphin within the ~/renamedTMD folder. Then you're done!

Trivia

On September 3-5, 2017, I got to watch User:Lucario and User:Kolano make a near-perfect forgery of MediaWiki's default header because it seemed like a better place to put a link.