diff --git a/.vs/GBAPokemonGameEditor/v14/.suo b/.vs/GBAPokemonGameEditor/v14/.suo
index 4e92ea1..a4c9ae3 100644
Binary files a/.vs/GBAPokemonGameEditor/v14/.suo and b/.vs/GBAPokemonGameEditor/v14/.suo differ
diff --git a/GBAPokemonGameEditor/InputAttacks.Designer.vb b/GBAPokemonGameEditor/InputAttacks.Designer.vb
index b014d99..e6ca52f 100644
--- a/GBAPokemonGameEditor/InputAttacks.Designer.vb
+++ b/GBAPokemonGameEditor/InputAttacks.Designer.vb
@@ -28,6 +28,7 @@ Partial Class InputAttacks
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
+ Me.CheckBox2 = New System.Windows.Forms.CheckBox()
Me.SuspendLayout()
'
'Label1
@@ -42,7 +43,7 @@ Partial Class InputAttacks
'Label2
'
Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(18, 49)
+ Me.Label2.Location = New System.Drawing.Point(18, 74)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(97, 13)
Me.Label2.TabIndex = 1
@@ -58,7 +59,7 @@ Partial Class InputAttacks
'
'TextBox2
'
- Me.TextBox2.Location = New System.Drawing.Point(121, 49)
+ Me.TextBox2.Location = New System.Drawing.Point(121, 71)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(24, 20)
Me.TextBox2.TabIndex = 3
@@ -66,7 +67,7 @@ Partial Class InputAttacks
'
'Button1
'
- Me.Button1.Location = New System.Drawing.Point(198, 68)
+ Me.Button1.Location = New System.Drawing.Point(193, 83)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(77, 25)
Me.Button1.TabIndex = 4
@@ -76,18 +77,29 @@ Partial Class InputAttacks
'CheckBox1
'
Me.CheckBox1.AutoSize = True
- Me.CheckBox1.Location = New System.Drawing.Point(21, 73)
+ Me.CheckBox1.Location = New System.Drawing.Point(21, 98)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Size = New System.Drawing.Size(86, 17)
Me.CheckBox1.TabIndex = 5
Me.CheckBox1.Text = "Jambo Hack"
Me.CheckBox1.UseVisualStyleBackColor = True
'
+ 'CheckBox2
+ '
+ Me.CheckBox2.AutoSize = True
+ Me.CheckBox2.Location = New System.Drawing.Point(21, 51)
+ Me.CheckBox2.Name = "CheckBox2"
+ Me.CheckBox2.Size = New System.Drawing.Size(161, 17)
+ Me.CheckBox2.TabIndex = 6
+ Me.CheckBox2.Text = "Automatically find free space"
+ Me.CheckBox2.UseVisualStyleBackColor = True
+ '
'InputAttacks
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.ClientSize = New System.Drawing.Size(277, 98)
+ Me.ClientSize = New System.Drawing.Size(282, 137)
+ Me.Controls.Add(Me.CheckBox2)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox2)
@@ -109,4 +121,5 @@ Partial Class InputAttacks
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
+ Friend WithEvents CheckBox2 As CheckBox
End Class
diff --git a/GBAPokemonGameEditor/InputAttacks.vb b/GBAPokemonGameEditor/InputAttacks.vb
index 62edcc8..86cbc6a 100644
--- a/GBAPokemonGameEditor/InputAttacks.vb
+++ b/GBAPokemonGameEditor/InputAttacks.vb
@@ -2,28 +2,59 @@
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim looper As Integer
+ Dim offsettowrite As String = ""
+
+ If CheckBox2.Checked = True Then
+
+ If CheckBox1.Checked = True Then
+ offsettowrite = Hex(SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((TextBox2.Text * 3) + Len(GetString(AppPath & "ini\roms.ini", header, "JamboLearnableMovesTerm", "")) + 1), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000")))
+ ElseIf CheckBox1.Checked = False Then
+ offsettowrite = Hex(SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((TextBox2.Text * 2) + 3), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000")))
+ End If
+
+ ElseIf CheckBox2.Checked = False
+ offsettowrite = TextBox1.Text
+ End If
+
+
If CheckBox1.Checked = True Then
looper = 0
While looper < TextBox2.Text
- WriteHEX(LoadedROM, ("&H" & TextBox1.Text) + (looper * 3), "010001")
+ WriteHEX(LoadedROM, ("&H" & offsettowrite) + (looper * 3), "010001")
looper = looper + 1
End While
- WriteHEX(LoadedROM, ("&H" & TextBox1.Text) + (looper * 3), GetString(AppPath & "ini\roms.ini", header, "JamboLearnableMovesTerm", ""))
- Me.Close()
+ WriteHEX(LoadedROM, ("&H" & offsettowrite) + (looper * 3), GetString(AppPath & "ini\roms.ini", header, "JamboLearnableMovesTerm", "") & "00")
+
ElseIf CheckBox1.Checked = False Then
looper = 0
While looper < TextBox2.Text
- WriteHEX(LoadedROM, ("&H" & TextBox1.Text) + (looper * 2), "0102")
+ WriteHEX(LoadedROM, ("&H" & offsettowrite) + (looper * 2), "0102")
looper = looper + 1
End While
- WriteHEX(LoadedROM, ("&H" & TextBox1.Text) + (looper * 2), "FFFF")
- Me.Close()
+ WriteHEX(LoadedROM, ("&H" & offsettowrite) + (looper * 2), "FFFF00")
+
+ End If
+
+ TextBox1.Text = offsettowrite
+
+ MsgBox("Attacks inserted!")
+
+ End Sub
+
+ Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
+
+ If CheckBox2.Checked = True Then
+ TextBox1.ReadOnly = True
+ End If
+
+ If CheckBox2.Checked = False Then
+ TextBox1.ReadOnly = False
End If
End Sub
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
index 58a0031..f4d8b5f 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
@@ -16,7 +16,7 @@
- yEKWVz5tA6qxZpILp8cDyoiS11w=
+ PoPChwn6Uv+GQRKkvz4LdV//0BM=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe
index 8645ad4..1ef4bf1 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
index 6859004..1b580f2 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
@@ -43,14 +43,14 @@
-
+
- 4wuWFhFZkW4jxmQebop8gflazw4=
+ T45A1rQN60iD0gCcqkGA9V79nhU=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb
index a7685f4..82ff86c 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb differ
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
index 58a0031..f4d8b5f 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
@@ -16,7 +16,7 @@
- yEKWVz5tA6qxZpILp8cDyoiS11w=
+ PoPChwn6Uv+GQRKkvz4LdV//0BM=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
index 6859004..1b580f2 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
@@ -43,14 +43,14 @@
-
+
- 4wuWFhFZkW4jxmQebop8gflazw4=
+ T45A1rQN60iD0gCcqkGA9V79nhU=
diff --git a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe
index 8645ad4..1ef4bf1 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache
index 5b1d4f4..1d70904 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
index 58a0031..f4d8b5f 100644
--- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
+++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
@@ -16,7 +16,7 @@
- yEKWVz5tA6qxZpILp8cDyoiS11w=
+ PoPChwn6Uv+GQRKkvz4LdV//0BM=
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe
index 8645ad4..1ef4bf1 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
index 6859004..1b580f2 100644
--- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
+++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
@@ -43,14 +43,14 @@
-
+
- 4wuWFhFZkW4jxmQebop8gflazw4=
+ T45A1rQN60iD0gCcqkGA9V79nhU=
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb
index a7685f4..82ff86c 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb differ