Skip to content

Commit

Permalink
Add GC PAL Support & NL Int Scanning Setting
Browse files Browse the repository at this point in the history
Title.
  • Loading branch information
Cuyler36 committed Jul 10, 2017
1 parent 0ad6a43 commit fc2a550
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Classes/Save.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public static SaveType GetSaveType(byte[] Save_Data)
else if (Save_Data.Length == 0x72040 || Save_Data.Length == 0x72150)
{
string Game_ID = Encoding.ASCII.GetString(Save_Data, Save_Data.Length == 0x72150 ? 0x110 : 0, 4);
if (Game_ID == "GAFE")
if (Game_ID == "GAFE" || Game_ID == "GAFP") // GAFP is PAL.
return SaveType.Animal_Crossing;
else if (Game_ID == "GAFJ")
return SaveType.Doubutsu_no_Mori_Plus;
Expand Down
15 changes: 9 additions & 6 deletions Classes/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;

Expand All @@ -13,12 +14,14 @@ public static void Scan_For_NL_Int32()
{
if (NewMainForm.Save_File != null && (NewMainForm.Save_File.Save_Type == SaveType.New_Leaf || NewMainForm.Save_File.Save_Type == SaveType.Welcome_Amiibo))
{
for (int i = 0; i < NewMainForm.Save_File.Working_Save_Data.Length; i += 4)
{
NL_Int32 Possible_NL_Int32 = new NL_Int32(NewMainForm.Save_File.ReadUInt32(i), NewMainForm.Save_File.ReadUInt32(i + 4));
if (Possible_NL_Int32.Valid)
System.Windows.Forms.MessageBox.Show(string.Format("Found Valid NL_Int32 at offset 0x{0} | Value: {1}", i.ToString("X"), Possible_NL_Int32.Value));
}
using (StreamWriter Int32_Stream = File.CreateText(NewMainForm.Assembly_Location + "\\" +
(NewMainForm.Save_File.Save_Type == SaveType.Welcome_Amiibo ? "WA_" : "") + "NL_Int32_Database.txt"))
for (int i = 0; i < NewMainForm.Save_File.Working_Save_Data.Length - 4; i += 4)
{
NL_Int32 Possible_NL_Int32 = new NL_Int32(NewMainForm.Save_File.ReadUInt32(i), NewMainForm.Save_File.ReadUInt32(i + 4));
if (Possible_NL_Int32.Valid)
Int32_Stream.WriteLine(string.Format("Found Valid NL_Int32 at offset 0x{0} | Value: {1}", i.ToString("X"), Possible_NL_Int32.Value));
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions Forms/NewMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,18 @@ public void SetupEditor(Save save)
Acres[i] = new Normal_Acre(Acre_Data[i], i);
}
}

townNameBox.Text = new ACString(save.ReadByteArray(save.Save_Data_Start_Offset + Current_Save_Info.Save_Offsets.Town_Name,
Save_File.Save_Type == SaveType.City_Folk ? 16 : ((Save_File.Save_Type == SaveType.New_Leaf || Save_File.Save_Type == SaveType.Welcome_Amiibo)
? 0x12 : 8)), save.Save_Type).Trim();
SetupAcreEditorTreeView();
SetupMapPictureBoxes();

if (Buildings != null)
SetupBuildingList();
//Fix_Buried_Empty_Spots(); //Temp
//Temp
//Utility.Scan_For_NL_Int32();

if (Properties.Settings.Default.OutputInt32s)
Utility.Scan_For_NL_Int32();
}

public void SetPlayersEnabled()
Expand Down
16 changes: 16 additions & 0 deletions Forms/SettingsMenuForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Forms/SettingsMenuForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public SettingsMenuForm()
imageSizeModeComboBox.SelectedIndexChanged += new EventHandler((object o, EventArgs e) => ImageResizeMode_Changed());
debugLevelComboBox.SelectedIndex = (int)Properties.Settings.Default.DebugLevel;
debugLevelComboBox.SelectedIndexChanged += new EventHandler((object o, EventArgs e) => DebugLevel_Changed());
scanForInt32Checkbox.Checked = Properties.Settings.Default.OutputInt32s;
}

private void ImageResizeMode_Changed()
Expand All @@ -35,6 +36,11 @@ private void DebugLevel_Changed()
Properties.Settings.Default.DebugLevel = (DebugLevel)Math.Max(0, debugLevelComboBox.SelectedIndex);
}

private void scanForInt32Checkbox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.OutputInt32s = scanForInt32Checkbox.Checked;
}

private void doneButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Save();
Expand Down
3 changes: 3 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
<Setting Name="DebugLevel" Type="ACSE.DebugLevel" Scope="User">
<Value Profile="(Default)">Info</Value>
</Setting>
<Setting Name="OutputInt32s" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
14 changes: 13 additions & 1 deletion Properties/Settings1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc2a550

Please sign in to comment.