Attack table inserter improved!

I've made it so the attack table inserter can search for free space.
This commit is contained in:
Gamer2020
2016-01-17 18:23:46 -05:00
parent 287367c5d3
commit e9c9349005
15 changed files with 64 additions and 20 deletions

Binary file not shown.

View File

@@ -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

View File

@@ -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

View File

@@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>yEKWVz5tA6qxZpILp8cDyoiS11w=</dsig:DigestValue>
<dsig:DigestValue>PoPChwn6Uv+GQRKkvz4LdV//0BM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1475584">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1476608">
<assemblyIdentity name="PokemonGameEditor" version="3.3.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>4wuWFhFZkW4jxmQebop8gflazw4=</dsig:DigestValue>
<dsig:DigestValue>T45A1rQN60iD0gCcqkGA9V79nhU=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>yEKWVz5tA6qxZpILp8cDyoiS11w=</dsig:DigestValue>
<dsig:DigestValue>PoPChwn6Uv+GQRKkvz4LdV//0BM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1475584">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1476608">
<assemblyIdentity name="PokemonGameEditor" version="3.3.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>4wuWFhFZkW4jxmQebop8gflazw4=</dsig:DigestValue>
<dsig:DigestValue>T45A1rQN60iD0gCcqkGA9V79nhU=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>yEKWVz5tA6qxZpILp8cDyoiS11w=</dsig:DigestValue>
<dsig:DigestValue>PoPChwn6Uv+GQRKkvz4LdV//0BM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1475584">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1476608">
<assemblyIdentity name="PokemonGameEditor" version="3.3.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>4wuWFhFZkW4jxmQebop8gflazw4=</dsig:DigestValue>
<dsig:DigestValue>T45A1rQN60iD0gCcqkGA9V79nhU=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>