Walda

Walda Pepper (Japanese: ハコガミ アヤノ Ayano Hakogami) is a young girl in Rustboro City who is very sick. She has only appeared in . Her father bought her multiple Poké Dolls—of Pokémon such as and the Hoenn first partner Pokémon—to cheer her up, but it has not worked. If the player is able to say something to make her laugh, her father will reward them with a new wallpaper for the Pokémon Storage System.
==Custom wallpaper==
If the player tells Walda a specifically-crafted passphrase, she will laugh, and her father will reward the player with a new wallpaper for the Pokémon Storage System. The wallpaper is a custom wallpaper that depends on the passphrase used. The player can only have one customized wallpaper, which is categorized under "Friends".
The passphrase depends on the player's Trainer ID number, making it less likely the same passphrase can be shared among players. The passphrase encodes the wallpaper's pattern, icon, background color, and foreground color. Some patterns and icons are only available in the Japanese version.
===Official distribution===
The only known official distribution of a custom wallpaper using this system was on the Pokémon Daisuki Club website around the time of Emerald's launch in Japan in September 2004.https://web.archive.org/web/20041130004801/http://www.pokemon.co.jp/game/gba/emerald.html Club members could input their Trainer ID number into a generator, and this would provide a code for a Pikachu patterned wallpaper with the HEX colour codes #f850a0 (primary, used on banner and circle symbols) and #f850f8 (secondary, used on heart symbol).
==Passphrase calculation==
There are 256 different passphrases for every possible wallpaper Walda's father can grant. The primary components that go into a passphrase are:
* The player's Trainer ID (this will be referred to as tid)
* An index number for the pattern of the wallpaper (pat)
* An index number for the icon in the wallpaper (ico)
* A value for the background color, influencing the majority of the pattern (bcolor)
* A value for the foreground color, influencing the icons and specific parts of the pattern (fcolor)
The final component can be any random number ranging from 0 to 255 (this will be referred to as key). Different values for this number can create vastly different passphrases, but they will all unlock the same wallpaper. This number simply masks and scrambles the other values.
This section will explain the process of creating a passphrase from the required components, but the game can easily reverse this process to create the proper wallpaper from a given passphrase.
===Components===
====Colors====
The colors are 2-byte values that represent the five highest bits of the red, green, and blue values in an RGB color in the manner shown below:
:00000000 00000000
As an example, if the green color used above—represented as "99FF99" in hexadecimal or 10011001 11111111 10011001 in binary—were chosen for the wallpaper's background, it would be encoded as 01001111 11110011 (0x4FF3 or 20,467) for bcolor.
====Patterns and icons====
There are 16 different possible patterns and 30 possible icons that can be placed within the patterns. They are described below as they are named in the filb.de generator linked at the bottom of this page. A sample of each of the patterns and some of the icons may be seen here.
{| class="roundy" style="background: #; border: 3px solid #"	Index 	Pattern
0 	Zigzagoon 	
1 	Screen 	
2 	Horizontal 	
3 	Diagonal 	
4 	Block 	
5 	Ribbon 	
6 	Pokémon Center	
7 	Frame 	
8 	Symbol 	
9 	Circle 	
10	Azumarill 	
11	Pikachu 	
12	Legendary 	
13	Dusclops 	
14	Ludicolo 	
15	Whiscash 	
The icons that are marked with an asterisk (*) are only available in Japanese versions of Pokémon Emerald. If this index is used in an English passphrase, no icon will appear in the resulting wallpaper. This does not apply to the Ribbon wallpaper, however; that wallpaper can be unlocked in the English version of Emerald, but it is slightly different from the Japanese version.
===Algorithm===
tid, bcolor, and fcolor are all 2-byte values. However, this algorithm deals with the bytes in these values separately. tid1, bcolor1, and fcolor1 will refer to the lowest byte of these values, while tid2, bcolor2, and fcolor2 will refer to the highest byte. For example, if the value of tid is 511 (00000001 11111111), then tid1 is 255 (11111111) and tid2 is 1 (00000001).
The player's Trainer ID undergoes a transformation before it is used in the rest of the algorithm.
:x = bcolor1 ⊕ fcolor1 ⊕ ico ⊕ tid2
:y = bcolor2 ⊕ fcolor2 ⊕ pat ⊕ tid1
A 9-byte string is then created by joining all of the current values together as follows:
:U = (bcolor1) (bcolor2) (fcolor1) (fcolor2) (ico) (pat) (x) (y) (key)
Next, a bitmask is created using the highest four bits of key. These four bits are repeated to fill the highest 8 bytes of a 9-byte string, with the bits in the lowest byte remaining 0; this string is represented below as mask.
:V = U ⊕ mask
Then, the highest 8 bytes of V are treated as if they are a circular structure (with the lowest bit "connected" back around to the highest bit) and are shifted to the right by (key % 16) bit positions. After this, the whole 9-bytes are treated as a circular structure and shifted right by 21 bit positions. This result will be referred to below as W.
W is the string that will finally be used to create the passphrase. Since a passphrase requires inputting a full-length word and the maximum length of input differs between Japanese and English games, the method of interpreting W to arrive at the passphrase differs between Japanese and English games.
In English games, every 5 bits in W represent a letter in the passphrase. Since W is a 9-byte string (or 72 bits long), it contains enough bits for 14 full letters, with 2 bits left over. To form the last letter and reach the maximum 15-letter length for English input, the letter effectively wraps back to the top of W, using the two lowest bits of W for the letter's two highest bits and the three highest bits of W for the letter's three lowest bits. Letters can be determined by matching the value of each 5-bit number with a character below:
0	1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20	21	22	23	24	25	26	27	28	29	30	31
B	C	D	F	G	H	J	K	L	M	N 	P 	Q 	R 	S 	T 	V 	W 	Z 	b 	c 	d 	f 	g 	h 	j 	k 	m 	n 	p 	q 	s
This is largely the first 32 capital and lowercase English letters without vowels, with a select few other letters excluded as well.
So, in an English game, if the first (highest) two bytes of W are 01110111 01011000, the first three letters of the passphrase will be "S" (01110, or 14), "p" (11101, or 29), and "Q" (01100, or 12). If the last (lowest) byte of W is also 00000001, then the last letter of the passphrase will be "P" (01011, or 11).
In Japanese games, every 6 bits in W represent a letter in the passphrase. Since W is a 9-byte string (or 72 bits long), this divides W evenly into a maximum length, 12-letter passphrase. Letters can be determined by matching the value of each 6-bit number with a character below:
0 	1 	2 	3 	4 	5 	6 	7 	8 	9 	10	11	12	13	14	15	16	17	18	19	20	21	22	23	24	25	26	27	28	29	30	31
あ 	い 	う 	え 	お 	か 	き 	く 	け 	こ 	さ 	し 	す 	せ 	そ 	た 	ち 	つ 	て 	と 	な 	に 	ぬ 	ね 	の 	は 	ひ 	ふ 	へ 	ほ 	ま 	み
 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	
32	33	34	35	36	37	38	39	40	41	42	43	44	45	46	47	48	49	50	51	52	53	54	55	56	57	58	59	60	61	62	63
む 	め 	も 	や 	ゆ 	よ 	ら 	り 	る 	れ 	ろ 	わ 	を 	ん 	ぁ 	ぃ 	ぅ 	ぇ 	ぉ 	ゃ 	ゅ 	ょ 	が 	ぎ 	ぐ 	げ 	ご 	ざ 	じ 	ず 	ぜ 	ぞ
This corresponds to the first 64 characters in the game's Japanese character encoding, offset by 1 to skip the space in the 0 position.
So, in a Japanese game, if the first (highest) two bytes of W are 00001110 00011101, the first two letters of the passphrase will be "え" (000011, or 3) and "め" (100001, or 33).
Note that when the original 9-byte string U (and then V) was being manipulated, the random bitmask and shifting based on key avoided the part of the string (the lowest byte) that contained key itself. The only time key is manipulated is in the final, set shift by 21 bits. Because of this, the game can know exactly how to retrieve key from a passphrase and reverse the entire algorithm to extract the wallpaper components from the passphrase.
==Quotes==
;Walda's father
* If the player has not told Walda's father a phrase yet:
:"Oh, hello! Welcome to the <sc>Pepper</sc> household. I have a question for you. Have you ever baby-sat? You see, I'm a new father, so raising a child is all new to me. And I have a problem. My daughter <sc>Walda</sc> doesn't laugh enough. I think she'd laugh for me if I told her something funny. Do you know of a funny word or phrase you can tell me?"
* If the player has told Walda's father a phrase before:
:"I've been saying "<phrase>" to amuse her lately. Do you know of a better word or a phrase that might work?"
:No: "Oh, is that right? Well, if you come up with a good suggestion, I'm all ears."
:Yes: "Oh, that's wonderful. So, let's hear it, your suggestion."
:* If the phrase unlocks a wallpaper:
::"Ah, I see. Well, let's give it a try, shall we?"
::"<phrase>. <phrase>. Oh, yes! She's laughing! Oh, I am as delighted as she!"
::"Thank you! Thanks to you, my darling <sc>Walda</sc> laughed for me! Actually, I may not look all that special, but I'm one of <sc>Devon Corporation</sc>'s top researchers. So, how about I do something in return for you? I know, I'll add some new wallpaper patterns for the <sc>Boxes</sc> in the PC Storage System. In the wallpaper pattern menu, select “<sc>Friends</sc>.” That will give you access to the new wallpaper patterns."
:* If the phrase does not unlock a wallpaper:
::"Ah, I see. Well, let's give it a try, shall we?"
::"<phrase>. <phrase>. Hmmm… She's not smiling at all. Maybe <sc>Walda</sc> is one serious child…"
:* If player has not told Walda's father a phrase yet and the phrase is left blank:
::"Oh, so you don't know any good words. I'd better think for myself, then. Hmm… How about "PEEKABOO!"? Let's see if that will work."
::"PEEKABOO!. PEEKABOO!. Hmmm… She's not smiling at all. Maybe <sc>Walda</sc> is one serious child…"
:* If the player has told Walda's father a phrase before and the phrase is left blank or is the same as the previous phrase:
::"Oh, so you don't know any good words. I guess I'll try to amuse her with the saying I used before. Anyways, if you have a good suggestion, don't hesitate in telling me, okay?"
;Walda's mother
:"Oh, it's so hard every day… What's hard? You need to ask? It's trying to figure out what to make for meals every day. It really isn't easy coming up with meals every day."'
==Names==
Language	Name 	Origin
Japanese	ハコガミ アヤノ Ayano Hakogami 	From 文 aya (design), 箱 hako (box), and 壁紙 kabegami (wallpaper)
English 	Walda Pepper 	From wallpaper
German 	Tapetra Schläfer 	From Tapete (wallpaper)
Spanish 	Anapel 	From papel (paper)
French 	Bercia Bofond 	From bercer (to cradle) and fond (background)
Italian 	Nina De Sfondis 	From sfondo (background)
==References==
==External links==
* Secret Code Generator at pokewiki.de
Category:Game characters
Category:Emerald characters
Category:Female characters
zh:文乃