diff --git a/.vs/GBAPokemonGameEditor/v14/.suo b/.vs/GBAPokemonGameEditor/v14/.suo index 4d51a82..ea434c3 100644 Binary files a/.vs/GBAPokemonGameEditor/v14/.suo and b/.vs/GBAPokemonGameEditor/v14/.suo differ diff --git a/GBAPokemonGameEditor/AttackExpander.Designer.vb b/GBAPokemonGameEditor/AttackExpander.Designer.vb new file mode 100644 index 0000000..ac21c74 --- /dev/null +++ b/GBAPokemonGameEditor/AttackExpander.Designer.vb @@ -0,0 +1,169 @@ + _ +Partial Class AttackExpander + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AttackExpander)) + Me.TabControl1 = New System.Windows.Forms.TabControl() + Me.TabPage1 = New System.Windows.Forms.TabPage() + Me.CheckBox1 = New System.Windows.Forms.CheckBox() + Me.Button1 = New System.Windows.Forms.Button() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label1 = New System.Windows.Forms.Label() + Me.TabPage2 = New System.Windows.Forms.TabPage() + Me.LinkLabel1 = New System.Windows.Forms.LinkLabel() + Me.CheckBox2 = New System.Windows.Forms.CheckBox() + Me.TabControl1.SuspendLayout() + Me.TabPage1.SuspendLayout() + Me.SuspendLayout() + ' + 'TabControl1 + ' + Me.TabControl1.Controls.Add(Me.TabPage1) + Me.TabControl1.Controls.Add(Me.TabPage2) + Me.TabControl1.Location = New System.Drawing.Point(12, 12) + Me.TabControl1.Name = "TabControl1" + Me.TabControl1.SelectedIndex = 0 + Me.TabControl1.Size = New System.Drawing.Size(463, 311) + Me.TabControl1.TabIndex = 0 + ' + 'TabPage1 + ' + Me.TabPage1.Controls.Add(Me.CheckBox2) + Me.TabPage1.Controls.Add(Me.CheckBox1) + Me.TabPage1.Controls.Add(Me.Button1) + Me.TabPage1.Controls.Add(Me.TextBox1) + Me.TabPage1.Controls.Add(Me.Label2) + Me.TabPage1.Controls.Add(Me.Label1) + Me.TabPage1.Location = New System.Drawing.Point(4, 22) + Me.TabPage1.Name = "TabPage1" + Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage1.Size = New System.Drawing.Size(455, 285) + Me.TabPage1.TabIndex = 0 + Me.TabPage1.Text = "Fire Red" + Me.TabPage1.UseVisualStyleBackColor = True + ' + 'CheckBox1 + ' + Me.CheckBox1.AutoSize = True + Me.CheckBox1.Location = New System.Drawing.Point(20, 73) + Me.CheckBox1.Name = "CheckBox1" + Me.CheckBox1.Size = New System.Drawing.Size(141, 17) + Me.CheckBox1.TabIndex = 4 + Me.CheckBox1.Text = "Apply Move Table Hack" + Me.CheckBox1.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(347, 226) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 3 + Me.Button1.Text = "Expand" + Me.Button1.UseVisualStyleBackColor = True + ' + 'TextBox1 + ' + Me.TextBox1.Location = New System.Drawing.Point(154, 47) + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(46, 20) + Me.TextBox1.TabIndex = 2 + Me.TextBox1.Text = "100" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(17, 50) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(131, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Number of Attacks to add:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(17, 26) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(136, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Number of attacks in ROM:" + ' + 'TabPage2 + ' + Me.TabPage2.Location = New System.Drawing.Point(4, 22) + Me.TabPage2.Name = "TabPage2" + Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage2.Size = New System.Drawing.Size(455, 285) + Me.TabPage2.TabIndex = 1 + Me.TabPage2.Text = "Emerald" + Me.TabPage2.UseVisualStyleBackColor = True + ' + 'LinkLabel1 + ' + Me.LinkLabel1.Location = New System.Drawing.Point(46, 326) + Me.LinkLabel1.Name = "LinkLabel1" + Me.LinkLabel1.Size = New System.Drawing.Size(407, 61) + Me.LinkLabel1.TabIndex = 1 + Me.LinkLabel1.TabStop = True + Me.LinkLabel1.Text = resources.GetString("LinkLabel1.Text") + ' + 'CheckBox2 + ' + Me.CheckBox2.AutoSize = True + Me.CheckBox2.Location = New System.Drawing.Point(20, 96) + Me.CheckBox2.Name = "CheckBox2" + Me.CheckBox2.Size = New System.Drawing.Size(100, 17) + Me.CheckBox2.TabIndex = 5 + Me.CheckBox2.Text = "Delete Old data" + Me.CheckBox2.UseVisualStyleBackColor = True + ' + 'AttackExpander + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(483, 389) + Me.Controls.Add(Me.LinkLabel1) + Me.Controls.Add(Me.TabControl1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.MaximizeBox = False + Me.Name = "AttackExpander" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Attack Expander" + Me.TabControl1.ResumeLayout(False) + Me.TabPage1.ResumeLayout(False) + Me.TabPage1.PerformLayout() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents TabControl1 As TabControl + Friend WithEvents TabPage1 As TabPage + Friend WithEvents TabPage2 As TabPage + Friend WithEvents Label1 As Label + Friend WithEvents LinkLabel1 As LinkLabel + Friend WithEvents TextBox1 As TextBox + Friend WithEvents Label2 As Label + Friend WithEvents Button1 As Button + Friend WithEvents CheckBox1 As CheckBox + Friend WithEvents CheckBox2 As CheckBox +End Class diff --git a/GBAPokemonGameEditor/AttackExpander.resx b/GBAPokemonGameEditor/AttackExpander.resx new file mode 100644 index 0000000..901b81d --- /dev/null +++ b/GBAPokemonGameEditor/AttackExpander.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + To remain consistent with what other people may have already done this tool uses the research from the folowing thread. http://www.pokecommunity.com/showthread.php?t=263479 Click to view the webpage. + + \ No newline at end of file diff --git a/GBAPokemonGameEditor/AttackExpander.vb b/GBAPokemonGameEditor/AttackExpander.vb new file mode 100644 index 0000000..4d7683a --- /dev/null +++ b/GBAPokemonGameEditor/AttackExpander.vb @@ -0,0 +1,360 @@ +Imports System.IO + +Public Class AttackExpander + Private Sub AttackExpander_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If header2 = "BPE" Then + + TabControl1.TabPages(0).Enabled = False + TabControl1.TabPages(1).Enabled = True + + + MsgBox("Not added yet!") + + Me.Close() + + ElseIf header2 = "BPR" Then + + TabControl1.TabPages(0).Enabled = True + TabControl1.TabPages(1).Enabled = False + + Label1.Text = "Number of attacks in ROM: " & (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1 + + Else + + TabControl1.TabPages(0).Enabled = False + TabControl1.TabPages(1).Enabled = False + + MsgBox("Not supported.") + Me.Close() + + End If + + End Sub + + Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked + Process.Start("http://www.pokecommunity.com/showthread.php?t=263479") + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + + Dim countervar As Integer + + Dim AttackDataBuffer As String + Dim AttackDataNewOffset As String + + Dim AttackNamesBuffer As String + Dim AttackNamesNewOffset As String + + Dim AttackAnimationTableBuffer As String + Dim AttackAnimationTableNewOffset As String + + If System.IO.File.Exists((LoadedROM).Substring(0, LoadedROM.Length - 4) & ".ini") = True Then + + MsgBox("An INI for this ROM has been detected! Values will be updated as needed.") + + Else + + MsgBox("INI not found! One will now be created for this ROM in the same location as the ROM. Keep the ini with the ROM so that PGE can know the location of the data.") + + File.Copy(AppPath & "ini\roms.ini", (LoadedROM).Substring(0, LoadedROM.Length - 4) & ".ini", True) + + + End If + + Cursor = Cursors.WaitCursor + + 'Attack Data + + AttackDataBuffer = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "AttackData", "")), System.Globalization.NumberStyles.HexNumber), ((GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1) * 12) + + 'Deletes old data + + If CheckBox2.Checked Then + WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "AttackData", "")), System.Globalization.NumberStyles.HexNumber), MakeFreeSpaceString((Len(AttackDataBuffer) / 2))) + End If + + 'MsgBox((Len(AttackDataBuffer) / 2)) + + countervar = 0 + + While countervar < TextBox1.Text + countervar = countervar + 1 + + AttackDataBuffer = AttackDataBuffer & "000000000000000000000000" + + End While + + 'MsgBox(((Len(AttackDataBuffer) / 2) / 12)) + + AttackDataNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(AttackDataBuffer) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000")) + + ' MsgBox(Hex(AttackDataNewOffset)) + + ' MsgBox((Len(AttackDataBuffer) / 2) / 12) + + ' WriteString(GetINIFileLocation(), header, "NumberOfAttacks", ((Len(AttackDataBuffer) / 2) / 12) - 1) + + WriteHEX(LoadedROM, AttackDataNewOffset, AttackDataBuffer) + + WriteString(GetINIFileLocation(), header, "AttackData", Hex(AttackDataNewOffset)) + + 'Repoint Attack Data + + WriteHEX(LoadedROM, &H0001CC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H00E3D8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0128CC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H012BA4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H015060, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H015FBC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0160F0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H016238, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H016368, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0176D8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H017990, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H019544, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0197A4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H019BF0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01A0D0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01A6E8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01A740, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01AA40, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01AB0C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01AC00, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01ACDC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01ADB8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01AE8C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01AFF8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01CF00, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01D098, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01D29C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01D934, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01D9D0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01DA90, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01DBF0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01DC6C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01DDB4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01DE68, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01DF88, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E100, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E1A8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E288, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E4D8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E680, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E768, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E7F0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E830, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01E910, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01EA9C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01EAFC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01ED30, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01EDB4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01EDE4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01EE94, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01EFC8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01F030, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01F0C4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01F258, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01F53C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H01F750, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H021158, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H021190, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02334C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H023490, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02393C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H023B14, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H023C20, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H023C9C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H023E6C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0240C4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H025CFC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H026100, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02704C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H027468, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0286A0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H028744, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H028A6C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H028B4C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H029434, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0296AC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0297F4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02A180, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02A1F0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02A27C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02AD00, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02AE18, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02AE50, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02BAC0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02BE84, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02C6C0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02D014, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02E8B4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02E9F4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H02EA9C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0309C0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H033B40, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H038670, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0386BC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03941C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H039468, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03962C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0398C4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03A194, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03E94C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03E9D0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03EC3C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03ECE8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03ED3C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03ED60, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03F254, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03F3B4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H03F510, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H04105C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C7D90, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C7E00, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C7F34, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C7F5C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C80AC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8414, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8924, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8970, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8BD4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8CBC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8F2C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C8FA4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C9030, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C9084, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C946C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C9498, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0C94C4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0E5380, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0E53CC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0E543C, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1334D8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H133528, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1335AC, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1336F0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H133878, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H136950, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H136A64, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H136AB4, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000))) + + WriteHEX(LoadedROM, &H11510, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000 + 4))) + WriteHEX(LoadedROM, &H116C0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000 + 4))) + WriteHEX(LoadedROM, &H3E8F8, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000 + 4))) + WriteHEX(LoadedROM, &H3E9A0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000 + 4))) + WriteHEX(LoadedROM, &H40EE0, ReverseHEX(Hex((AttackDataNewOffset) + &H8000000 + 4))) + + + 'Attack Names + + + AttackNamesBuffer = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "AttackNames", "")), System.Globalization.NumberStyles.HexNumber), ((GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1) * 13) + + 'Deletes old data + + If CheckBox2.Checked Then + WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "AttackNames", "")), System.Globalization.NumberStyles.HexNumber), MakeFreeSpaceString((Len(AttackNamesBuffer) / 2))) + End If + + countervar = 0 + + While countervar < TextBox1.Text + countervar = countervar + 1 + + AttackNamesBuffer = AttackNamesBuffer & "ACACACACACACACFF0000000000" + + End While + + + AttackNamesNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(AttackNamesBuffer) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000")) + + WriteHEX(LoadedROM, AttackNamesNewOffset, AttackNamesBuffer) + + WriteString(GetINIFileLocation(), header, "AttackNames", Hex(AttackNamesNewOffset)) + + ''Repoint Attack Names + + WriteHEX(LoadedROM, &H000148, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0308A4, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H04EF84, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H06BE8C, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H09B524, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0BD830, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0BFAA4, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0CC914, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0D764C, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0D7EE0, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0D8500, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0E4E58, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H0E51F0, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H10D9C0, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1140F0, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H11C5A8, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H11C6E4, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1256BC, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H125948, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H125A2C, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H125BE4, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H125CE0, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H125FF8, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H12606C, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H126128, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1261FC, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H12627C, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H1267F0, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H126880, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H126E64, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H131E14, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + WriteHEX(LoadedROM, &H13695C, ReverseHEX(Hex((AttackNamesNewOffset) + &H8000000))) + + ''Attack Animations + + + AttackAnimationTableBuffer = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "AttackAnimationTable", "")), System.Globalization.NumberStyles.HexNumber), ((GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1) * 4) + + ''Deletes old data + + If CheckBox2.Checked Then + WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "AttackAnimationTable", "")), System.Globalization.NumberStyles.HexNumber), MakeFreeSpaceString((Len(AttackAnimationTableBuffer) / 2))) + End If + + countervar = 0 + + While countervar < TextBox1.Text + countervar = countervar + 1 + + AttackAnimationTableBuffer = AttackAnimationTableBuffer & "346F1C08" + + End While + + + AttackAnimationTableNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(AttackAnimationTableBuffer) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000")) + + WriteHEX(LoadedROM, AttackAnimationTableNewOffset, AttackAnimationTableBuffer) + + WriteString(GetINIFileLocation(), header, "AttackAnimationTable", Hex(AttackAnimationTableNewOffset)) + + 'Repoint Attack Animation Table + + WriteHEX(LoadedROM, &H725D0, ReverseHEX(Hex((AttackAnimationTableNewOffset) + &H8000000))) + + 'Only limiter in ROM patch + + WriteHEX(LoadedROM, "&HD75FC", "000000000000") + + 'Move Table hack stuff + If CheckBox1.Checked Then + WriteString(GetINIFileLocation(), header, "MoveTableHack", "True") + End If + + 'Updates the number of attacks + WriteString(GetINIFileLocation(), header, "NumberOfAttacks", CInt((GetString(GetINIFileLocation(), header, "NumberOfAttacks", ""))) + CInt(TextBox1.Text)) + + Label1.Text = "Number of attacks in ROM: " & (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1 + + Cursor = Cursors.Arrow + + MsgBox("Attacks expanded successfully!") + + End Sub +End Class \ No newline at end of file diff --git a/GBAPokemonGameEditor/GBAPokemonGameEditor.vbproj b/GBAPokemonGameEditor/GBAPokemonGameEditor.vbproj index 280a497..939c6ed 100644 --- a/GBAPokemonGameEditor/GBAPokemonGameEditor.vbproj +++ b/GBAPokemonGameEditor/GBAPokemonGameEditor.vbproj @@ -90,10 +90,6 @@ LocalIntranet - - False - bin\Debug\ICSharpCode.SharpZipLib.dll - @@ -143,6 +139,12 @@ Form + + AttackExpander.vb + + + Form + BattleFrontierEditor.vb @@ -244,6 +246,9 @@ AttackEditor.vb + + AttackExpander.vb + BattleFrontierEditor.vb diff --git a/GBAPokemonGameEditor/HexFunctions.vb b/GBAPokemonGameEditor/HexFunctions.vb index a194a7c..6aa9517 100644 --- a/GBAPokemonGameEditor/HexFunctions.vb +++ b/GBAPokemonGameEditor/HexFunctions.vb @@ -70,7 +70,7 @@ ErrHandle: Dim iFile As Integer Dim sPost As Integer Dim bytHex As Byte - Start = Start + 1 + ' Start = Start + 1 iFile = FreeFile sPost = 0 @@ -81,7 +81,7 @@ ErrHandle: Do While Len(Data) > 0 bytHex = Int32.Parse((Mid(Data, 1, 2)), System.Globalization.NumberStyles.HexNumber) 'UPGRADE_WARNING: Put was upgraded to FilePut and has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' - FilePut(iFile, bytHex, Start + sPost) + FilePut(iFile, bytHex, Start + 1 + sPost) Data = Right(Data, Len(Data) - 2) sPost = sPost + 1 Loop diff --git a/GBAPokemonGameEditor/MainFrm.Designer.vb b/GBAPokemonGameEditor/MainFrm.Designer.vb index d6fe57e..e4e2a9b 100644 --- a/GBAPokemonGameEditor/MainFrm.Designer.vb +++ b/GBAPokemonGameEditor/MainFrm.Designer.vb @@ -78,6 +78,7 @@ Partial Class MainFrm Me.Button40 = New System.Windows.Forms.Button() Me.Button41 = New System.Windows.Forms.Button() Me.TabPage1 = New System.Windows.Forms.TabPage() + Me.Button1 = New System.Windows.Forms.Button() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.Label1 = New System.Windows.Forms.Label() Me.MenuStrip1.SuspendLayout() @@ -85,6 +86,7 @@ Partial Class MainFrm Me.TabControl1.SuspendLayout() Me.TabPage2.SuspendLayout() Me.TabPage3.SuspendLayout() + Me.TabPage1.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' @@ -148,10 +150,12 @@ Partial Class MainFrm ' 'Jambo51MoveTableHackToolStripMenuItem ' + Me.Jambo51MoveTableHackToolStripMenuItem.Enabled = False Me.Jambo51MoveTableHackToolStripMenuItem.Name = "Jambo51MoveTableHackToolStripMenuItem" Me.Jambo51MoveTableHackToolStripMenuItem.Size = New System.Drawing.Size(654, 22) Me.Jambo51MoveTableHackToolStripMenuItem.Text = "Use Jambo51's move table hack (If you don't know what it is don't use it. Your RO" & "M will break! I warned you...)" + Me.Jambo51MoveTableHackToolStripMenuItem.Visible = False ' 'UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem ' @@ -596,6 +600,7 @@ Partial Class MainFrm ' 'TabPage1 ' + Me.TabPage1.Controls.Add(Me.Button1) Me.TabPage1.Location = New System.Drawing.Point(4, 22) Me.TabPage1.Name = "TabPage1" Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) @@ -604,6 +609,16 @@ Partial Class MainFrm Me.TabPage1.Text = "Patchers and Expanders" Me.TabPage1.UseVisualStyleBackColor = True ' + 'Button1 + ' + Me.Button1.Enabled = False + Me.Button1.Location = New System.Drawing.Point(3, 6) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(81, 55) + Me.Button1.TabIndex = 15 + Me.Button1.Text = "Attack Expander" + Me.Button1.UseVisualStyleBackColor = True + ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.Label1) @@ -646,6 +661,7 @@ Partial Class MainFrm Me.TabControl1.ResumeLayout(False) Me.TabPage2.ResumeLayout(False) Me.TabPage3.ResumeLayout(False) + Me.TabPage1.ResumeLayout(False) Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) @@ -709,5 +725,5 @@ Partial Class MainFrm Friend WithEvents Button40 As System.Windows.Forms.Button Friend WithEvents Button41 As System.Windows.Forms.Button Friend WithEvents LinuxToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - + Friend WithEvents Button1 As Button End Class diff --git a/GBAPokemonGameEditor/MainFrm.vb b/GBAPokemonGameEditor/MainFrm.vb index b0cc3c4..0d7eda4 100644 --- a/GBAPokemonGameEditor/MainFrm.vb +++ b/GBAPokemonGameEditor/MainFrm.vb @@ -325,6 +325,7 @@ Public Class MainFrm Button33.Enabled = False Button34.Enabled = False Button35.Enabled = False + Button1.Enabled = False MessageBox.Show("I haven't added Jap support out of pure lazziness. I will though if it get's highly Demanded.") Else @@ -340,6 +341,7 @@ Public Class MainFrm Button33.Enabled = True Button34.Enabled = True Button35.Enabled = True + Button1.Enabled = True End If Else Label2.Text = "" @@ -354,6 +356,7 @@ Public Class MainFrm Button33.Enabled = False Button34.Enabled = False Button35.Enabled = False + Button1.Enabled = False MessageBox.Show("Not one of the Pokemon games...") End If @@ -798,4 +801,10 @@ Public Class MainFrm TMHMEditor.Show() Me.Cursor = Cursors.Arrow End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + Me.Cursor = Cursors.WaitCursor + AttackExpander.Show() + Me.Cursor = Cursors.Arrow + End Sub End Class diff --git a/GBAPokemonGameEditor/Pokemonedit.vb b/GBAPokemonGameEditor/Pokemonedit.vb index f236ec9..4905809 100644 --- a/GBAPokemonGameEditor/Pokemonedit.vb +++ b/GBAPokemonGameEditor/Pokemonedit.vb @@ -1663,8 +1663,8 @@ Public Class Pokemonedit Dim binarythebitch As String Dim at As String Dim lvl As String - 'Dim loopme As Integer - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 0 Then + + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "False" Then AttackTable = Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonAttackTable", "")), System.Globalization.NumberStyles.HexNumber) @@ -1701,7 +1701,7 @@ Public Class Pokemonedit End If - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 1 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "True" Then AttackTable = Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonAttackTable", "")), System.Globalization.NumberStyles.HexNumber) LvlUpAttPointer.Text = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackTable) + (4) + (PKMNames.SelectedIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000) @@ -1729,7 +1729,7 @@ Public Class Pokemonedit Dim at As String Dim lvl As String - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 0 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "False" Then i = PKMNames.SelectedIndex WriteHEX(LoadedROM, (AttackTable) + (4) + (i * 4), ReverseHEX(Hex(Int32.Parse(((LvlUpAttPointer.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000))) lvlupattacks.Items.Clear() @@ -1762,7 +1762,7 @@ Public Class Pokemonedit End While End If - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 1 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "True" Then i = PKMNames.SelectedIndex WriteHEX(LoadedROM, (AttackTable) + (4) + (i * 4), ReverseHEX(Hex(Val("&H" & (LvlUpAttPointer.Text)) + &H8000000))) lvlupattacks.Items.Clear() @@ -1961,7 +1961,7 @@ Public Class Pokemonedit Dim pointer As String 'Dim loopme As Integer - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 0 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "False" Then pointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackTable) + (4) + (PKMNames.SelectedIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000) @@ -1987,7 +1987,7 @@ Public Class Pokemonedit AtLvl.Text = lvl NewAt.SelectedIndex = at End If - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 1 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "True" Then pointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackTable) + (4) + (PKMNames.SelectedIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000) @@ -2015,7 +2015,7 @@ Public Class Pokemonedit Dim temp As Integer 'Dim loopme As Integer - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 0 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "False" Then holder = lvlupattacks.SelectedIndex pointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackTable) + (4) + (PKMNames.SelectedIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000) @@ -2046,7 +2046,7 @@ Public Class Pokemonedit End If - If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = 1 Then + If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "True" Then holder = lvlupattacks.SelectedIndex pointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackTable) + (4) + (PKMNames.SelectedIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000) diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.application b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.application index 59d0d74..8ec7bda 100644 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.application +++ b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.application @@ -16,7 +16,7 @@ - u+h2dlwyE4m7k6KzZn8kvsLkhq8= + XyOEDKFMxBvklN+6056G84y6/uo= diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe index 41b3659..a328411 100644 Binary files a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe.manifest index 0f13fe3..fc25b2d 100644 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe.manifest +++ b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.exe.manifest @@ -43,14 +43,14 @@ - + - 74fVe1F6uKRZK4xS3qBGl562ew0= + PAf6FxgFYUAixqkl7QKqzILPITA= diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.pdb b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.pdb index 1b7f927..444a77a 100644 Binary files a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.pdb and b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.pdb differ diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application index 59d0d74..8ec7bda 100644 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application +++ b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.application @@ -16,7 +16,7 @@ - u+h2dlwyE4m7k6KzZn8kvsLkhq8= + XyOEDKFMxBvklN+6056G84y6/uo= diff --git a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest index 0f13fe3..fc25b2d 100644 --- a/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest +++ b/GBAPokemonGameEditor/bin/Debug/GBAPokemonGameEditor.vshost.exe.manifest @@ -43,14 +43,14 @@ - + - 74fVe1F6uKRZK4xS3qBGl562ew0= + PAf6FxgFYUAixqkl7QKqzILPITA= diff --git a/GBAPokemonGameEditor/bin/Debug/app.publish/GBAPokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/app.publish/GBAPokemonGameEditor.exe index 41b3659..a328411 100644 Binary files a/GBAPokemonGameEditor/bin/Debug/app.publish/GBAPokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/app.publish/GBAPokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/mMain.vb b/GBAPokemonGameEditor/mMain.vb index 567f498..74ac140 100644 --- a/GBAPokemonGameEditor/mMain.vb +++ b/GBAPokemonGameEditor/mMain.vb @@ -82,5 +82,22 @@ Module mMain End Function + Public Function MakeFreeSpaceString(NeededLength As Integer) + + Dim PrivLoopVar As Integer + Dim OutBuffThing As String = "" + + PrivLoopVar = 0 + + While (PrivLoopVar < NeededLength) + + OutBuffThing = OutBuffThing & "FF" + + PrivLoopVar = PrivLoopVar + 1 + End While + + MakeFreeSpaceString = OutBuffThing + End Function + End Module diff --git a/GBAPokemonGameEditor/modSearchFreeSpace.vb b/GBAPokemonGameEditor/modSearchFreeSpace.vb index 60623e4..b17d929 100644 --- a/GBAPokemonGameEditor/modSearchFreeSpace.vb +++ b/GBAPokemonGameEditor/modSearchFreeSpace.vb @@ -133,4 +133,25 @@ LocalHandler: End Function + Public Function SearchFreeSpaceFourAligned(ByVal FileName As String, ByVal FreeSpaceByte As Byte, ByVal NeededBytes As Long, Optional ByVal StartOffset As Long = 0) As Long + + Dim SearchIncrement As String + Dim CurSearchOffset As String + + CurSearchOffset = Hex(SearchFreeSpace(FileName, FreeSpaceByte, NeededBytes, StartOffset, 100)) + + SearchIncrement = 1 + + While (((CurSearchOffset(CurSearchOffset.Length - 1)) <> "0") AndAlso ((CurSearchOffset(CurSearchOffset.Length - 1)) <> "4") AndAlso ((CurSearchOffset(CurSearchOffset.Length - 1)) <> "8") AndAlso ((CurSearchOffset(CurSearchOffset.Length - 1)) <> "C")) + + CurSearchOffset = Hex(SearchFreeSpace(FileName, FreeSpaceByte, NeededBytes, (StartOffset) + SearchIncrement)) + + SearchIncrement = SearchIncrement + 1 + + End While + + Return "&H" & CurSearchOffset + + End Function + End Module diff --git a/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache index 43fe21b..9c40fb6 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache and b/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.AttackExpander.resources b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.AttackExpander.resources new file mode 100644 index 0000000..3d930f3 Binary files /dev/null and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.AttackExpander.resources differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.application b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.application index 59d0d74..8ec7bda 100644 --- a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.application +++ b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.application @@ -16,7 +16,7 @@ - u+h2dlwyE4m7k6KzZn8kvsLkhq8= + XyOEDKFMxBvklN+6056G84y6/uo= diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe index 41b3659..a328411 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe.manifest index 0f13fe3..fc25b2d 100644 --- a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe.manifest +++ b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.exe.manifest @@ -43,14 +43,14 @@ - + - 74fVe1F6uKRZK4xS3qBGl562ew0= + PAf6FxgFYUAixqkl7QKqzILPITA= diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.pdb b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.pdb index 1b7f927..444a77a 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.pdb and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.pdb differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt index c5d1165..a7b2df0 100644 --- a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt +++ b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.FileListAbsolute.txt @@ -174,3 +174,4 @@ C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.pdb C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.TMHMEditor.resources C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.ItemEditor.resources +C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.AttackExpander.resources diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache index e100b7d..d585f53 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache differ