Skip to content

Commit 4aa3cbd

Browse files
committed
- Block dumper: added info for what BW blocks are
- Block dumper: enabled decrypting for BW block 38 - Memory link: added starter pokémon editing and importing from BW savefile - Grotto editor: no longer crashes if grotto tables are missing
1 parent d1c598d commit 4aa3cbd

File tree

6 files changed

+139
-81
lines changed

6 files changed

+139
-81
lines changed

BW_tool.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 11.00
33
# Visual Studio 2010
4-
# SharpDevelop 5.1
4+
# SharpDevelop 4.4
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BW_tool", "BW_tool\BW_tool.csproj", "{41ABAC38-D34B-489D-A450-3E9FADD07419}"
66
EndProject
77
Global

BW_tool/Editors/Dumper.Designer.cs

Lines changed: 58 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BW_tool/Editors/Grotto.cs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,22 @@ void Black2table_butClick(object sender, EventArgs e)
712712
Form form = new Form();
713713

714714
PictureBox pictureBox = new PictureBox();
715-
716-
pictureBox.Dock = DockStyle.Fill;
717-
pictureBox.Image = Image.FromFile("./grotto_tables/b2_"+Grotto_route.SelectedIndex+".png");
718-
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
719-
form.Controls.Add(pictureBox);
720-
Size size = new Size(720,300);
721-
form.Size = size;
722-
form.Show();
715+
try
716+
{
717+
pictureBox.Dock = DockStyle.Fill;
718+
pictureBox.Image = Image.FromFile("./grotto_tables/b2_"+Grotto_route.SelectedIndex+".png");
719+
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
720+
form.Controls.Add(pictureBox);
721+
Size size = new Size(720,300);
722+
form.Size = size;
723+
form.Show();
724+
}
725+
catch(System.IO.FileNotFoundException)
726+
{
727+
MessageBox.Show("There was an error opening the table.\n" +
728+
"Please check you have included grotto_tables folder in the same path as BW_tool.exe.");
729+
}
730+
723731
}
724732
void Grotto_helpClick(object sender, EventArgs e)
725733
{

BW_tool/Editors/MemoryLink.Designer.cs

Lines changed: 47 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BW_tool/Editors/MemoryLink.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void load_data()
6868
name.Text = ml.block2.name;
6969
tid.Value = ml.block2.TID;
7070
sid.Value = ml.block2.SID;
71+
starter.SelectedIndex = ml.block2.STARTER;
7172

7273
flag1.Checked = ml.block2.checkflag(0);
7374
flag2.Checked = ml.block2.checkflag(1);
@@ -84,6 +85,7 @@ void set_data()
8485
ml.block2.name = name.Text;
8586
ml.block2.TID = (UInt16)tid.Value;
8687
ml.block2.SID = (UInt16)sid.Value;
88+
ml.block2.STARTER = (byte)starter.SelectedIndex;
8789

8890
ml.block2.setflag(0, flag1.Checked);
8991
ml.block2.setflag(1, flag2.Checked);
@@ -209,6 +211,7 @@ void Import_bw1Click(object sender, EventArgs e)
209211
ml.block2.name_fromarray(bw1.Skip(0x19404).Take(0xF).ToArray());
210212
ml.block2.TID = BitConverter.ToUInt16(bw1, 0x19414);
211213
ml.block2.SID = BitConverter.ToUInt16(bw1, 0x19416);
214+
ml.block2.STARTER = bw1save.Data[0x20160];
212215

213216
ml.block2.set_hof(bw1.Skip(0x23B00).Take(0x168).ToArray());
214217

@@ -219,7 +222,7 @@ void Import_bw1Click(object sender, EventArgs e)
219222
//Reload all data
220223
load_data();
221224

222-
MessageBox.Show("Imported: Trainer Name, TID, SID, Hall of Fame");
225+
MessageBox.Show("Imported: Trainer Name, TID, SID, Starter, Hall of Fame");
223226
}
224227
else{
225228

@@ -488,6 +491,17 @@ public UInt16 SID
488491
setData(BitConverter.GetBytes((UInt16)value), 0x76);
489492
}
490493
}
494+
public byte STARTER
495+
{
496+
get
497+
{
498+
return Data[0x8E];
499+
}
500+
set
501+
{
502+
Data[0x8E]=(byte)value;
503+
}
504+
}
491505

492506
public bool checkflag(int index)
493507
{

BW_tool/SAV/SAV5.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,13 @@ public SAV5(byte[] data)
196196
blocks[i].crypto.length = 0xA90;
197197
blocks[i].crypto.seed = 0xA90;
198198
break;
199+
*/
199200
case 38: //Trainer card records
200201
blocks[i].encrypted=true;
201202
blocks[i].crypto.start = 0x04;
202203
blocks[i].crypto.length = 0x1DC;
203204
blocks[i].crypto.seed = 0x1DC;
204-
break;*/
205+
break;
205206
case 61: //Entralink forest
206207
blocks[i].encrypted=true;
207208
blocks[i].crypto.start = 0x00;

0 commit comments

Comments
 (0)