diff --git a/GBAPokemonGameEditor.v12.suo b/GBAPokemonGameEditor.v12.suo index 4a218f8..905b7f0 100644 Binary files a/GBAPokemonGameEditor.v12.suo and b/GBAPokemonGameEditor.v12.suo differ diff --git a/GBAPokemonGameEditor/ChangeNameFunctions.vb b/GBAPokemonGameEditor/ChangeNameFunctions.vb index 91dadd3..ac7a73d 100644 --- a/GBAPokemonGameEditor/ChangeNameFunctions.vb +++ b/GBAPokemonGameEditor/ChangeNameFunctions.vb @@ -3,6 +3,48 @@ Option Explicit Off Module ChangeNameFunctions + Public Function ChangePokedexTypeName(ByVal Index As Integer, ByVal NewName As String) + Dim offvar As Long + + offvar = Int32.Parse((GetString(AppPath & "ini\roms.ini", header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + + If header3 = "J" Then + + If header2 = "AXP" Or header2 = "AXV" Then + SkipVar = "36" + ElseIf header2 = "BPR" Or header2 = "BPG" Then + SkipVar = "36" + ElseIf header2 = "BPE" Then + SkipVar = "32" + End If + + Else + If header2 = "AXP" Or header2 = "AXV" Then + SkipVar = "36" + ElseIf header2 = "BPR" Or header2 = "BPG" Then + SkipVar = "36" + ElseIf header2 = "BPE" Then + SkipVar = "32" + End If + End If + + If header3 = "J" Then + + Else + + FileNum = FreeFile() + FileOpen(FileNum, LoadedROM, OpenMode.Binary) + Dim PokeType As String = "xxxxxxxxxxx" + Dim filler As Byte = "&HFF" + PokeType = NameAsc2Sapp(NewName) + FilePut(FileNum, PokeType, offvar + 1 + (SkipVar * Index)) + FilePut(FileNum, filler, offvar + 1 + (SkipVar * Index) + Len(NewName)) + + + End If + FileClose(FileNum) + ChangePokedexTypeName = NewName + End Function Public Function ChangePokemonName(ByVal Index As Integer, ByVal NewName As String) Dim offvar As Long diff --git a/GBAPokemonGameEditor/PokedexDataEditor.Designer.vb b/GBAPokemonGameEditor/PokedexDataEditor.Designer.vb index 39175de..eca5d51 100644 --- a/GBAPokemonGameEditor/PokedexDataEditor.Designer.vb +++ b/GBAPokemonGameEditor/PokedexDataEditor.Designer.vb @@ -24,6 +24,8 @@ Partial Class PokedexDataEditor Private Sub InitializeComponent() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.ListBox1 = New System.Windows.Forms.ListBox() + Me.Type1 = New System.Windows.Forms.TextBox() + Me.Label3 = New System.Windows.Forms.Label() Me.GroupBox6 = New System.Windows.Forms.GroupBox() Me.Button4 = New System.Windows.Forms.Button() Me.Description2 = New System.Windows.Forms.TextBox() @@ -33,6 +35,7 @@ Partial Class PokedexDataEditor Me.Pointer1 = New System.Windows.Forms.TextBox() Me.Label6 = New System.Windows.Forms.Label() Me.GroupBox3 = New System.Windows.Forms.GroupBox() + Me.Offset_1 = New System.Windows.Forms.TextBox() Me.Label11 = New System.Windows.Forms.Label() Me.Label10 = New System.Windows.Forms.Label() Me.Offset_2 = New System.Windows.Forms.TextBox() @@ -54,10 +57,7 @@ Partial Class PokedexDataEditor Me.Hght = New System.Windows.Forms.TextBox() Me.Label5 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() - Me.Type1 = New System.Windows.Forms.TextBox() - Me.Label3 = New System.Windows.Forms.Label() Me.Button3 = New System.Windows.Forms.Button() - Me.Offset_1 = New System.Windows.Forms.TextBox() Me.GroupBox1.SuspendLayout() Me.GroupBox6.SuspendLayout() Me.GroupBox3.SuspendLayout() @@ -84,6 +84,23 @@ Partial Class PokedexDataEditor Me.ListBox1.Size = New System.Drawing.Size(164, 147) Me.ListBox1.TabIndex = 0 ' + 'Type1 + ' + Me.Type1.Location = New System.Drawing.Point(57, 180) + Me.Type1.MaxLength = 11 + Me.Type1.Name = "Type1" + Me.Type1.Size = New System.Drawing.Size(127, 20) + Me.Type1.TabIndex = 14 + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(17, 180) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(34, 13) + Me.Label3.TabIndex = 13 + Me.Label3.Text = "Type:" + ' 'GroupBox6 ' Me.GroupBox6.Controls.Add(Me.Button4) @@ -101,6 +118,7 @@ Partial Class PokedexDataEditor ' 'Button4 ' + Me.Button4.Enabled = False Me.Button4.Location = New System.Drawing.Point(9, 123) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(95, 24) @@ -130,6 +148,7 @@ Partial Class PokedexDataEditor ' 'Button1 ' + Me.Button1.Enabled = False Me.Button1.Location = New System.Drawing.Point(9, 93) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(95, 24) @@ -178,6 +197,13 @@ Partial Class PokedexDataEditor Me.GroupBox3.TabStop = False Me.GroupBox3.Text = "Size Comparison" ' + 'Offset_1 + ' + Me.Offset_1.Location = New System.Drawing.Point(55, 92) + Me.Offset_1.Name = "Offset_1" + Me.Offset_1.Size = New System.Drawing.Size(38, 20) + Me.Offset_1.TabIndex = 9 + ' 'Label11 ' Me.Label11.AutoSize = True @@ -368,23 +394,6 @@ Partial Class PokedexDataEditor Me.Label4.TabIndex = 1 Me.Label4.Text = "Height:" ' - 'Type1 - ' - Me.Type1.Location = New System.Drawing.Point(57, 180) - Me.Type1.MaxLength = 11 - Me.Type1.Name = "Type1" - Me.Type1.Size = New System.Drawing.Size(127, 20) - Me.Type1.TabIndex = 14 - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(17, 180) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(34, 13) - Me.Label3.TabIndex = 13 - Me.Label3.Text = "Type:" - ' 'Button3 ' Me.Button3.Location = New System.Drawing.Point(12, 237) @@ -394,13 +403,6 @@ Partial Class PokedexDataEditor Me.Button3.Text = "Save" Me.Button3.UseVisualStyleBackColor = True ' - 'Offset_1 - ' - Me.Offset_1.Location = New System.Drawing.Point(55, 92) - Me.Offset_1.Name = "Offset_1" - Me.Offset_1.Size = New System.Drawing.Size(38, 20) - Me.Offset_1.TabIndex = 9 - ' 'PokedexDataEditor ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/GBAPokemonGameEditor/PokedexDataEditor.vb b/GBAPokemonGameEditor/PokedexDataEditor.vb index 3c481a7..4d77ce0 100644 --- a/GBAPokemonGameEditor/PokedexDataEditor.vb +++ b/GBAPokemonGameEditor/PokedexDataEditor.vb @@ -3,6 +3,55 @@ Option Explicit Off Imports VB = Microsoft.VisualBasic Public Class PokedexDataEditor Dim offset1 As Integer + + Private Sub PokedexDataEditor_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed + + End Sub + + Private Sub EnglishRSDescpLoad() + + FileNum = FreeFile() + FileOpen(FileNum, LoadedROM, OpenMode.Binary) + Dim DexDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + + FileGet(FileNum, DexDescp, ("&H" & (Pointer1.Text)) + 1, True) + DexDescp = Sapp2Asc(DexDescp) + DexDescp = Mid$(DexDescp, 1, InStr(1, DexDescp, "\x")) + DexDescp = Replace(DexDescp, "\n", vbCrLf) + DexDescp = Replace(RTrim$(DexDescp), "\", "") + Description1.Text = DexDescp + Description1.MaxLength = Len(DexDescp) + + DexDescp = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + + FileGet(FileNum, DexDescp, ("&H" & (Pointer2.Text)) + 1, True) + DexDescp = Sapp2Asc(DexDescp) + DexDescp = Mid$(DexDescp, 1, InStr(1, DexDescp, "\x")) + DexDescp = Replace(DexDescp, "\n", vbCrLf) + DexDescp = Replace(RTrim$(DexDescp), "\", "") + Description2.Text = DexDescp + Description2.MaxLength = Len(DexDescp) + + FileClose(FileNum) + End Sub + + Private Sub EnglishFRLGEDescpLoad() + + FileNum = FreeFile() + FileOpen(FileNum, LoadedROM, OpenMode.Binary) + + Dim DexDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + + FileGet(FileNum, DexDescp, ("&H" & (Pointer1.Text)) + 1, True) + DexDescp = Sapp2Asc(DexDescp) + DexDescp = Mid$(DexDescp, 1, InStr(1, DexDescp, "\x")) + DexDescp = Replace(DexDescp, "\n", vbCrLf) + DexDescp = Replace(RTrim$(DexDescp), "\", "") + Description1.Text = DexDescp + Description1.MaxLength = Len(DexDescp) + + FileClose(FileNum) + End Sub Private Sub PokedexDataEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Or header2 = "AXP" Or header2 = "AXV" Then @@ -73,12 +122,18 @@ Public Class PokedexDataEditor If header2 = "AXP" Or header2 = "AXV" Then Pointer2.Text = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 8 + +12 + (ListBox1.SelectedIndex * SkipVar), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000) + EnglishRSDescpLoad() ElseIf header2 = "BPR" Or header2 = "BPG" Then + EnglishFRLGEDescpLoad() ElseIf header2 = "BPE" Then + EnglishFRLGEDescpLoad() End If + Type1.Text = GetPokedexTypeName(ListBox1.SelectedIndex) + + End Sub Private Sub Hght_TextChanged(sender As Object, e As EventArgs) Handles Hght.TextChanged @@ -98,4 +153,57 @@ Public Class PokedexDataEditor Label19.Text = Val(Label18.Text) * 2.2 End Sub + + Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click + i = ListBox1.SelectedIndex + offset1 = Int32.Parse((GetString(AppPath & "ini\roms.ini", header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + + + If header2 = "AXP" Or header2 = "AXV" Then + + WriteHEX(LoadedROM, offset1 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght.Text), 4))) + WriteHEX(LoadedROM, offset1 + 2 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght.Text), 4))) + WriteHEX(LoadedROM, offset1 + 14 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4))) + WriteHEX(LoadedROM, offset1 + 16 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4))) + WriteHEX(LoadedROM, offset1 + 18 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4))) + WriteHEX(LoadedROM, offset1 + 20 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4))) + + ElseIf header2 = "BPR" Or header2 = "BPG" Then + + WriteHEX(LoadedROM, offset1 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght.Text), 4))) + WriteHEX(LoadedROM, offset1 + 2 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght.Text), 4))) + WriteHEX(LoadedROM, offset1 + 14 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4))) + WriteHEX(LoadedROM, offset1 + 16 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4))) + WriteHEX(LoadedROM, offset1 + 18 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4))) + WriteHEX(LoadedROM, offset1 + 20 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4))) + + ElseIf header2 = "BPE" Then + + WriteHEX(LoadedROM, offset1 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght.Text), 4))) + WriteHEX(LoadedROM, offset1 + 2 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght.Text), 4))) + WriteHEX(LoadedROM, offset1 + 10 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4))) + WriteHEX(LoadedROM, offset1 + 12 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4))) + WriteHEX(LoadedROM, offset1 + 14 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4))) + WriteHEX(LoadedROM, offset1 + 16 + 12 + (i * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4))) + + End If + + ChangePokedexTypeName(i, Type1.Text) + + ListBox1.Items.Clear() + + Dim varloop As Integer = 0 + + While varloop < (GetString(AppPath & "ini\roms.ini", header, "NumberOfDexEntries", "")) + + + ListBox1.Items.Add(VB.Right("0000" & (varloop), 4) & ". " & GetPokedexTypeName(varloop)) + varloop = varloop + 1 + End While + ListBox1.SelectedIndex = 1 + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + + End Sub End Class \ No newline at end of file diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application deleted file mode 100644 index 2f8c534..0000000 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - NnV1KXGO/MRb4YcM1KJqNh98rfw= - - - - \ No newline at end of file diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe deleted file mode 100644 index f443805..0000000 Binary files a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe and /dev/null differ diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.config b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.config deleted file mode 100644 index 3a327fa..0000000 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest deleted file mode 100644 index 0bcd618..0000000 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5zIhH9s3/ZhHe64fdpEgfeicFUo= - - - - - - - - - - zmtMKrAEuvsQh2jJFtlCNruBIWE= - - - - - - - - - rPjxYWyVTxOTFNPtQSvhQ6KPzKY= - - - - - - - - - - \ No newline at end of file diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe new file mode 100644 index 0000000..a9e5564 Binary files /dev/null and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt index ebed2ea..9add495 100644 --- a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt +++ b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt @@ -119,3 +119,6 @@ C:\Users\Gamer2020\sources\PokemonGameEditor\GBAPokemonGameEditor\GBAPokemonGame C:\Users\Gamer2020\sources\PokemonGameEditor\GBAPokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.application C:\Users\Gamer2020\sources\PokemonGameEditor\GBAPokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbprojResolveAssemblyReference.cache C:\Users\Gamer2020\sources\PokemonGameEditor\GBAPokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbproj.GenerateResource.Cache +C:\Users\JOSEWORK\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\GBAPokemonGameEditor.exe +C:\Users\JOSEWORK\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\GBAPokemonGameEditor.pdb +C:\Users\JOSEWORK\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.exe