Massive update!
I was away for a month or so without internet. In that time I continued to work on PGE. There are a lot of new things in this version. The Attack adder has been updated. I've completed Jambo51's move table hack for Fire Red and made it so the Attack adder installs it. I still have yet to port the hack to Emerald. The Pokemon adder works for English Fire Red. I made it add Pokemon the same way that it's done in DoesntKnowHowToPlay's tutorial in order to remain consistent with what others may have already done. If any problems occur with the Pokemon adder please let me know. Unlike G3HS, cries and other things are expanded correctly by PGE. I advise not using G3HS to add more Pokemon. When an offset is missing from the ini, PGE will now dump text to a file named errors.txt letting you know what offset is missing and for what ROM. I may expand on this in the future. Improved importing and exporting of data. Attacks, Abilities, and Pokemon can be exported and imported as inis. It is now handled better than in older versions. I fixed the Pokedex data editor because it seems it wasn't loading some data properly. I've added a Pokedex tab to the Pokemon Editor. Even though I feel they should be seperate I mainly added it because I want Pokedex data to be included when you export Pokemon Data. I made it so that the Pokedex tab shows you how big the sprites will be in the size compare. I will make it show where the sprites will be onscreen once I figure out the formula for it. Bulbapedia is wrong when it comes to the Pokedex data. Added the item use anitmation (FR/LG) bytes to the Pokemon Editor. Added editing of the in battle sprite positions. Has the preview from Advance Series. (Loading of all the Pokemon data seems slow now. Eventually I will have to come back and optimize things.) Pokemon sprites can be imported and exported. The format is the same as Advance Series. The importing and exporting of the animations from Emerald are handled better than in Advance Series. Pokemon Icons can now be imported and exported. Advance Series compatable as well. Pokemon Footprints can be imported and exported. Other Miscellaneous fixes and additions.
120
GBAPokemonGameEditor/AbilityEdit.Designer.vb
generated
|
|
@ -24,6 +24,7 @@ Partial Class AbilityEdit
|
|||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AbilityEdit))
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.Button15 = New System.Windows.Forms.Button()
|
||||
Me.AbilityList = New System.Windows.Forms.ComboBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.AbilityIndexTextBox = New System.Windows.Forms.TextBox()
|
||||
|
|
@ -31,11 +32,19 @@ Partial Class AbilityEdit
|
|||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.TextBox1 = New System.Windows.Forms.TextBox()
|
||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label21 = New System.Windows.Forms.Label()
|
||||
Me.Button6 = New System.Windows.Forms.Button()
|
||||
Me.TextBox3 = New System.Windows.Forms.TextBox()
|
||||
Me.Button2 = New System.Windows.Forms.Button()
|
||||
Me.TextBox2 = New System.Windows.Forms.TextBox()
|
||||
Me.Label21 = New System.Windows.Forms.Label()
|
||||
Me.Button6 = New System.Windows.Forms.Button()
|
||||
Me.ProgressBar = New System.Windows.Forms.ProgressBar()
|
||||
Me.Button3 = New System.Windows.Forms.Button()
|
||||
Me.Button4 = New System.Windows.Forms.Button()
|
||||
Me.Button5 = New System.Windows.Forms.Button()
|
||||
Me.Button7 = New System.Windows.Forms.Button()
|
||||
Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog()
|
||||
Me.FolderBrowserDialog = New System.Windows.Forms.FolderBrowserDialog()
|
||||
Me.fileOpenDialog = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.GroupBox1.SuspendLayout()
|
||||
Me.GroupBox2.SuspendLayout()
|
||||
Me.GroupBox3.SuspendLayout()
|
||||
|
|
@ -43,19 +52,28 @@ Partial Class AbilityEdit
|
|||
'
|
||||
'GroupBox1
|
||||
'
|
||||
Me.GroupBox1.Controls.Add(Me.Button15)
|
||||
Me.GroupBox1.Controls.Add(Me.AbilityList)
|
||||
Me.GroupBox1.Controls.Add(Me.Label1)
|
||||
Me.GroupBox1.Controls.Add(Me.AbilityIndexTextBox)
|
||||
Me.GroupBox1.Location = New System.Drawing.Point(12, 13)
|
||||
Me.GroupBox1.Name = "GroupBox1"
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(134, 89)
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(134, 115)
|
||||
Me.GroupBox1.TabIndex = 2
|
||||
Me.GroupBox1.TabStop = False
|
||||
Me.GroupBox1.Text = "Ability Selection"
|
||||
'
|
||||
'Button15
|
||||
'
|
||||
Me.Button15.Location = New System.Drawing.Point(6, 83)
|
||||
Me.Button15.Name = "Button15"
|
||||
Me.Button15.Size = New System.Drawing.Size(121, 23)
|
||||
Me.Button15.TabIndex = 11
|
||||
Me.Button15.Text = "Decap. all names!"
|
||||
Me.Button15.UseVisualStyleBackColor = True
|
||||
'
|
||||
'AbilityList
|
||||
'
|
||||
Me.AbilityList.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.AbilityList.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.AbilityList.FormattingEnabled = True
|
||||
Me.AbilityList.Location = New System.Drawing.Point(6, 22)
|
||||
|
|
@ -84,9 +102,9 @@ Partial Class AbilityEdit
|
|||
'
|
||||
Me.GroupBox2.Controls.Add(Me.Button1)
|
||||
Me.GroupBox2.Controls.Add(Me.TextBox1)
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(12, 108)
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(12, 134)
|
||||
Me.GroupBox2.Name = "GroupBox2"
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(134, 113)
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(134, 87)
|
||||
Me.GroupBox2.TabIndex = 3
|
||||
Me.GroupBox2.TabStop = False
|
||||
Me.GroupBox2.Text = "Name"
|
||||
|
|
@ -121,6 +139,25 @@ Partial Class AbilityEdit
|
|||
Me.GroupBox3.TabStop = False
|
||||
Me.GroupBox3.Text = "Description"
|
||||
'
|
||||
'Label21
|
||||
'
|
||||
Me.Label21.AutoSize = True
|
||||
Me.Label21.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.Label21.Location = New System.Drawing.Point(9, 156)
|
||||
Me.Label21.Name = "Label21"
|
||||
Me.Label21.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label21.TabIndex = 31
|
||||
Me.Label21.Text = "Length:"
|
||||
'
|
||||
'Button6
|
||||
'
|
||||
Me.Button6.Location = New System.Drawing.Point(119, 172)
|
||||
Me.Button6.Name = "Button6"
|
||||
Me.Button6.Size = New System.Drawing.Size(67, 20)
|
||||
Me.Button6.TabIndex = 30
|
||||
Me.Button6.Text = "Save"
|
||||
Me.Button6.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TextBox3
|
||||
'
|
||||
Me.TextBox3.Location = New System.Drawing.Point(12, 57)
|
||||
|
|
@ -146,30 +183,60 @@ Partial Class AbilityEdit
|
|||
Me.TextBox2.Size = New System.Drawing.Size(90, 20)
|
||||
Me.TextBox2.TabIndex = 0
|
||||
'
|
||||
'Label21
|
||||
'ProgressBar
|
||||
'
|
||||
Me.Label21.AutoSize = True
|
||||
Me.Label21.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.Label21.Location = New System.Drawing.Point(9, 156)
|
||||
Me.Label21.Name = "Label21"
|
||||
Me.Label21.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label21.TabIndex = 31
|
||||
Me.Label21.Text = "Length:"
|
||||
Me.ProgressBar.Location = New System.Drawing.Point(12, 255)
|
||||
Me.ProgressBar.Name = "ProgressBar"
|
||||
Me.ProgressBar.Size = New System.Drawing.Size(361, 23)
|
||||
Me.ProgressBar.TabIndex = 5
|
||||
Me.ProgressBar.Visible = False
|
||||
'
|
||||
'Button6
|
||||
'Button3
|
||||
'
|
||||
Me.Button6.Location = New System.Drawing.Point(119, 172)
|
||||
Me.Button6.Name = "Button6"
|
||||
Me.Button6.Size = New System.Drawing.Size(67, 20)
|
||||
Me.Button6.TabIndex = 30
|
||||
Me.Button6.Text = "Save"
|
||||
Me.Button6.UseVisualStyleBackColor = True
|
||||
Me.Button3.Location = New System.Drawing.Point(31, 226)
|
||||
Me.Button3.Name = "Button3"
|
||||
Me.Button3.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button3.TabIndex = 6
|
||||
Me.Button3.Text = "Import Ability"
|
||||
Me.Button3.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button4
|
||||
'
|
||||
Me.Button4.Location = New System.Drawing.Point(112, 226)
|
||||
Me.Button4.Name = "Button4"
|
||||
Me.Button4.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button4.TabIndex = 7
|
||||
Me.Button4.Text = "Import All"
|
||||
Me.Button4.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button5
|
||||
'
|
||||
Me.Button5.Location = New System.Drawing.Point(193, 226)
|
||||
Me.Button5.Name = "Button5"
|
||||
Me.Button5.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button5.TabIndex = 8
|
||||
Me.Button5.Text = "Export Ability"
|
||||
Me.Button5.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button7
|
||||
'
|
||||
Me.Button7.Location = New System.Drawing.Point(274, 226)
|
||||
Me.Button7.Name = "Button7"
|
||||
Me.Button7.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button7.TabIndex = 9
|
||||
Me.Button7.Text = "Export All"
|
||||
Me.Button7.UseVisualStyleBackColor = True
|
||||
'
|
||||
'AbilityEdit
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(385, 227)
|
||||
Me.ClientSize = New System.Drawing.Size(385, 285)
|
||||
Me.Controls.Add(Me.Button7)
|
||||
Me.Controls.Add(Me.Button5)
|
||||
Me.Controls.Add(Me.Button4)
|
||||
Me.Controls.Add(Me.Button3)
|
||||
Me.Controls.Add(Me.ProgressBar)
|
||||
Me.Controls.Add(Me.GroupBox3)
|
||||
Me.Controls.Add(Me.GroupBox2)
|
||||
Me.Controls.Add(Me.GroupBox1)
|
||||
|
|
@ -201,4 +268,13 @@ Partial Class AbilityEdit
|
|||
Friend WithEvents AbilityList As ComboBox
|
||||
Friend WithEvents Label21 As Label
|
||||
Friend WithEvents Button6 As Button
|
||||
Friend WithEvents ProgressBar As ProgressBar
|
||||
Friend WithEvents Button15 As Button
|
||||
Friend WithEvents Button3 As Button
|
||||
Friend WithEvents Button4 As Button
|
||||
Friend WithEvents Button5 As Button
|
||||
Friend WithEvents Button7 As Button
|
||||
Friend WithEvents SaveFileDialog As SaveFileDialog
|
||||
Friend WithEvents FolderBrowserDialog As FolderBrowserDialog
|
||||
Friend WithEvents fileOpenDialog As OpenFileDialog
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -117,6 +117,15 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="SaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="FolderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>148, 17</value>
|
||||
</metadata>
|
||||
<metadata name="fileOpenDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>313, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
Public Class AbilityEdit
|
||||
Imports System.IO.Directory
|
||||
Public Class AbilityEdit
|
||||
Dim AbilityDesc As Integer
|
||||
Dim CurrentAbilityDescripLength As Integer
|
||||
|
||||
|
|
@ -180,4 +181,265 @@
|
|||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
|
||||
Me.Text = "Please wait..."
|
||||
Me.UseWaitCursor = True
|
||||
ProgressBar.Value = 0
|
||||
ProgressBar.Visible = True
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAbilities", "")) - 1 = True
|
||||
AbilityList.SelectedIndex = LoopVar
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
Me.Refresh()
|
||||
Me.Enabled = False
|
||||
|
||||
ChangeAbilityName(LoopVar, DecapString(GetAbilityName(LoopVar)))
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfAbilities", ""))) * 100
|
||||
End While
|
||||
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
AbilityList.Items.Clear()
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAbilities", "")) = True
|
||||
|
||||
AbilityList.Items.Add(GetAbilityName(LoopVar))
|
||||
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
|
||||
|
||||
End While
|
||||
|
||||
AbilityList.SelectedIndex = 0
|
||||
|
||||
Me.Text = "Ability Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
End Sub
|
||||
|
||||
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||
SaveFileDialog.FileName = (AbilityList.SelectedIndex) & ".ini"
|
||||
'SaveFileDialog.CheckFileExists = True
|
||||
|
||||
' Check to ensure that the selected path exists. Dialog box displays
|
||||
' a warning otherwise.
|
||||
SaveFileDialog.CheckPathExists = True
|
||||
|
||||
' Get or set default extension. Doesn't include the leading ".".
|
||||
SaveFileDialog.DefaultExt = "ini"
|
||||
|
||||
' Return the file referenced by a link? If False, simply returns the selected link
|
||||
' file. If True, returns the file linked to the LNK file.
|
||||
SaveFileDialog.DereferenceLinks = True
|
||||
|
||||
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
|
||||
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
|
||||
' trailing "|". You can set the FilterIndex property as well, to select the default
|
||||
' filter. The first filter is numbered 1 (not 0). The default is 1.
|
||||
SaveFileDialog.Filter =
|
||||
"(*.ini)|*.ini*"
|
||||
|
||||
'SaveFileDialog.Multiselect = False
|
||||
|
||||
' Restore the original directory when done selecting
|
||||
' a file? If False, the current directory changes
|
||||
' to the directory in which you selected the file.
|
||||
' Set this to True to put the current folder back
|
||||
' where it was when you started.
|
||||
' The default is False.
|
||||
'.RestoreDirectory = False
|
||||
|
||||
' Show the Help button and Read-Only checkbox?
|
||||
SaveFileDialog.ShowHelp = False
|
||||
'SaveFileDialog.ShowReadOnly = False
|
||||
|
||||
' Start out with the read-only check box checked?
|
||||
' This only make sense if ShowReadOnly is True.
|
||||
'SaveFileDialog.ReadOnlyChecked = False
|
||||
|
||||
SaveFileDialog.Title = "Save as"
|
||||
|
||||
' Only accept valid Win32 file names?
|
||||
SaveFileDialog.ValidateNames = True
|
||||
|
||||
|
||||
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
|
||||
ExportAbilityINI(SaveFileDialog.FileName, (AbilityList.SelectedIndex))
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
FolderBrowserDialog.Description = "Select folder to export all Abilities to:"
|
||||
|
||||
If FolderBrowserDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
Me.Text = "Please wait..."
|
||||
Me.UseWaitCursor = True
|
||||
ProgressBar.Value = 0
|
||||
ProgressBar.Visible = True
|
||||
|
||||
If System.IO.Directory.Exists(FolderBrowserDialog.SelectedPath & "\Abilities") = False Then
|
||||
CreateDirectory(FolderBrowserDialog.SelectedPath & "\Abilities")
|
||||
End If
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAbilities", "")) - 1 = True
|
||||
LoopVar = LoopVar + 1
|
||||
AbilityList.SelectedIndex = LoopVar
|
||||
|
||||
Me.Refresh()
|
||||
Me.Enabled = False
|
||||
|
||||
ExportAbilityINI(FolderBrowserDialog.SelectedPath & "\Abilities\" & LoopVar & ".ini", LoopVar)
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfAbilities", ""))) * 100
|
||||
End While
|
||||
|
||||
Me.Text = "Ability Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
||||
fileOpenDialog.FileName = ""
|
||||
fileOpenDialog.CheckFileExists = True
|
||||
|
||||
' Check to ensure that the selected path exists. Dialog box displays
|
||||
' a warning otherwise.
|
||||
fileOpenDialog.CheckPathExists = True
|
||||
|
||||
' Get or set default extension. Doesn't include the leading ".".
|
||||
fileOpenDialog.DefaultExt = "ini"
|
||||
|
||||
' Return the file referenced by a link? If False, simply returns the selected link
|
||||
' file. If True, returns the file linked to the LNK file.
|
||||
fileOpenDialog.DereferenceLinks = True
|
||||
|
||||
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
|
||||
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
|
||||
' trailing "|". You can set the FilterIndex property as well, to select the default
|
||||
' filter. The first filter is numbered 1 (not 0). The default is 1.
|
||||
fileOpenDialog.Filter =
|
||||
"(*.ini)|*.ini*"
|
||||
|
||||
fileOpenDialog.Multiselect = False
|
||||
|
||||
' Restore the original directory when done selecting
|
||||
' a file? If False, the current directory changes
|
||||
' to the directory in which you selected the file.
|
||||
' Set this to True to put the current folder back
|
||||
' where it was when you started.
|
||||
' The default is False.
|
||||
'.RestoreDirectory = False
|
||||
|
||||
' Show the Help button and Read-Only checkbox?
|
||||
fileOpenDialog.ShowHelp = False
|
||||
fileOpenDialog.ShowReadOnly = False
|
||||
|
||||
' Start out with the read-only check box checked?
|
||||
' This only make sense if ShowReadOnly is True.
|
||||
fileOpenDialog.ReadOnlyChecked = False
|
||||
|
||||
fileOpenDialog.Title = "Select ini file to import"
|
||||
|
||||
' Only accept valid Win32 file names?
|
||||
fileOpenDialog.ValidateNames = True
|
||||
|
||||
|
||||
If fileOpenDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
|
||||
ImportAbilityINI(fileOpenDialog.FileName, (AbilityList.SelectedIndex))
|
||||
|
||||
Dim refreshvar As Integer
|
||||
|
||||
refreshvar = AbilityList.SelectedIndex
|
||||
|
||||
If AbilityList.SelectedIndex = 0 Then
|
||||
AbilityList.SelectedIndex = AbilityList.SelectedIndex + 1
|
||||
Else
|
||||
AbilityList.SelectedIndex = AbilityList.SelectedIndex - 1
|
||||
End If
|
||||
|
||||
AbilityList.Items.Insert(refreshvar, GetAbilityName(refreshvar))
|
||||
|
||||
AbilityList.Items.RemoveAt(refreshvar + 1)
|
||||
|
||||
AbilityList.SelectedIndex = refreshvar
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
FolderBrowserDialog.Description = "Select folder to import Abilities from:"
|
||||
|
||||
If FolderBrowserDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
Me.Text = "Please wait..."
|
||||
Me.UseWaitCursor = True
|
||||
ProgressBar.Value = 0
|
||||
ProgressBar.Visible = True
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAbilities", "")) - 1 = True
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
AbilityList.SelectedIndex = LoopVar
|
||||
|
||||
Me.Refresh()
|
||||
Me.Enabled = False
|
||||
|
||||
If System.IO.File.Exists(FolderBrowserDialog.SelectedPath & "\" & LoopVar & ".ini") Then
|
||||
ImportAbilityINI(FolderBrowserDialog.SelectedPath & "\" & LoopVar & ".ini", LoopVar)
|
||||
End If
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfAbilities", ""))) * 100
|
||||
End While
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
AbilityList.Items.Clear()
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAbilities", "")) = True
|
||||
|
||||
AbilityList.Items.Add(GetAbilityName(LoopVar))
|
||||
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
|
||||
|
||||
End While
|
||||
|
||||
AbilityList.SelectedIndex = 0
|
||||
|
||||
Me.Text = "Ability Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
4
GBAPokemonGameEditor/AttackAdder.Designer.vb
generated
|
|
@ -73,6 +73,8 @@ Partial Class AttackAdder
|
|||
'CheckBox2
|
||||
'
|
||||
Me.CheckBox2.AutoSize = True
|
||||
Me.CheckBox2.Checked = True
|
||||
Me.CheckBox2.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.CheckBox2.Location = New System.Drawing.Point(20, 96)
|
||||
Me.CheckBox2.Name = "CheckBox2"
|
||||
Me.CheckBox2.Size = New System.Drawing.Size(100, 17)
|
||||
|
|
@ -83,6 +85,8 @@ Partial Class AttackAdder
|
|||
'CheckBox1
|
||||
'
|
||||
Me.CheckBox1.AutoSize = True
|
||||
Me.CheckBox1.Checked = True
|
||||
Me.CheckBox1.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.CheckBox1.Location = New System.Drawing.Point(20, 73)
|
||||
Me.CheckBox1.Name = "CheckBox1"
|
||||
Me.CheckBox1.Size = New System.Drawing.Size(141, 17)
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ Public Class AttackAdder
|
|||
TabControl1.TabPages(1).Enabled = False
|
||||
TabControl1.SelectedIndex = 0
|
||||
|
||||
MsgBox("I've recently realized that Jambo51's move hack is incomplete. It works in it's current state but needs 3 more routines. - Gamer2020")
|
||||
|
||||
Label1.Text = "Number of attacks in ROM: " & (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1
|
||||
|
||||
Else
|
||||
|
|
@ -456,6 +454,10 @@ Public Class AttackAdder
|
|||
CurAttacksLooper = CurAttacksLooper + 1
|
||||
End While
|
||||
|
||||
If CurAttacksLooper = 0 Then
|
||||
CurPokeAttacksBuff = CurPokeAttacksBuff & "0100" & "01"
|
||||
End If
|
||||
|
||||
'deletes the old moves
|
||||
|
||||
If CheckBox2.Checked Then
|
||||
|
|
@ -477,11 +479,17 @@ Public Class AttackAdder
|
|||
|
||||
Dim routine1 As String = "494689001148401800680F4E063637787900C9194318997854468C4203D0FF290BD00137F4E7084A01373770597809021878084310800249084702480047C04665EB030873EB030822400202" & ReverseHEX(Hex(AttackTable + &H8000000))
|
||||
Dim routine2 As String = "8178FF22914225D01202FF32914600235800C0181949891909684718B8785446A04217DC7978387809020143404600930C1C00F017F8FF25009B484504D14046211C00F013F8009B0133032178188078A842DDD101B038BC9846A146AA46F0BC01BC0047F0B581B0024F3847F0B5024F3847C046B5E8030843EC0308" & ReverseHEX(Hex(AttackTable + &H8000000))
|
||||
Dim routine3 As String = "6A0052190499501880780399171C0135AC46884249DC0024814214D00124644205982B4946186B46023B3D1C02330134032C08DC3068281802784078000210431A889042F2D1042C2FD1002454451CDA494608683818027841780902114302980288914211D00599194A8E18029B3D1C02330134544508DA3068281802784078000210431A889042F2D154450DD15046013082466200029952184C4620683818017840780002084310806546494608686900491909188878FF28A1D1504606B038BC9846A146AA46F0BC02BC0847C046" & ReverseHEX(Hex(AttackTable + &H8000000))
|
||||
Dim routine3 As String = "00253D4EB9008A19136898780591FF2868D09146049303226A4304995018171C017843781B020B43807803990135AC4688424BDC002468460188181C814211D005982D4946186B463D1C02330134032C08DC3068281801784078000208431A888242F2D1042C31D1002454451CDA4946086838180178407800020843029A1288824211D005991C4A8E18029B3D1C02330134544508DA3068281801784078000208431A888242F2D154450FD1504601300006000E82466200029952184C4620683818017840780002084310806546132D08DC4946086803216943091808888878FF2898D1504606B038BC9846A146AA46F0BC02BC0847C046" & ReverseHEX(Hex(AttackTable + &H8000000))
|
||||
Dim routine4 As String = "F0B557464E464546E0B48FB0061C00208246301C41210022524B00F0A1F80004040C301C382100224E4B00F099F80006000E0C90CE204000844201D1002087E00025A4000E946C46291C0D31301C0022444B00F085F8208002340135032DF3DD0025414B0E9AD11808688078FF286ED089466C4608340D944946086803226A43101880780C9C211C171C0135AC46884252DC002448460068017840780002084369460988814211D00E982F4946186B463D1C02330134032C08DC3068281801784078000208431A888242F2D1042C33D1002454451EDA49460868381801784078000201430D980288081C02A9824211D00E9A1D4816180B1C3D1C02330134544508DA3068281801784078000208431A888242F2D154450FD1504601300006000E824662000D9CA218494608683818017840780002084310806546132D07DC4A4610680321694309188878FF2894D150460FB038BC9846A146AA46F0BC02BC08471847C046E9FB0308" & ReverseHEX(Hex(AttackTable + &H8000000))
|
||||
Dim routine5 As String = "0321484319684018817801480047C04605EB0308"
|
||||
Dim routine6 As String = "F0B50E1C0004002500241049800B401802689078FF2812D0131C291C481C0006050E490089191A78587800021043088003330134132C02DC9878FF28EDD1281CF0BC02BC0847C046" & ReverseHEX(Hex(AttackTable + &H8000000))
|
||||
|
||||
Dim routine1offset As String = ""
|
||||
Dim routine2offset As String = ""
|
||||
Dim routine3offset As String = ""
|
||||
Dim routine4offset As String = ""
|
||||
Dim routine5offset As String = ""
|
||||
Dim routine6offset As String = ""
|
||||
|
||||
routine1offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(routine1) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
|
|
@ -500,7 +508,26 @@ Public Class AttackAdder
|
|||
|
||||
WriteHEX(LoadedROM, routine3offset, routine3)
|
||||
|
||||
WriteHEX(LoadedROM, &H43CE8, "004A1047" & ReverseHEX(Hex((routine3offset) + &H8000001)))
|
||||
WriteHEX(LoadedROM, &H43CD0, "00490847" & ReverseHEX(Hex((routine3offset) + &H8000001)))
|
||||
|
||||
routine4offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(routine4) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, routine4offset, routine4)
|
||||
|
||||
WriteHEX(LoadedROM, &H43E2C, "004B1847" & ReverseHEX(Hex((routine4offset) + &H8000001)))
|
||||
|
||||
|
||||
routine5offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(routine5) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, routine5offset, routine5)
|
||||
|
||||
WriteHEX(LoadedROM, &H3EAD4, "8078C046C046C046C046")
|
||||
WriteHEX(LoadedROM, &H3EB04, "FF29")
|
||||
WriteHEX(LoadedROM, &H3EAE2, "5446C046")
|
||||
WriteHEX(LoadedROM, &H3EB18, "081CC046")
|
||||
WriteHEX(LoadedROM, &H3EAFC, "00490847" & ReverseHEX(Hex((routine5offset) + &H8000001)))
|
||||
|
||||
WriteHEX(LoadedROM, &H43DD4, routine6)
|
||||
|
||||
'Enable the hack in the ini file.
|
||||
WriteString(GetINIFileLocation(), header, "MoveTableHack", "True")
|
||||
|
|
|
|||
149
GBAPokemonGameEditor/AttackEditor.Designer.vb
generated
|
|
@ -24,6 +24,7 @@ Partial Class AttackEditor
|
|||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AttackEditor))
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.Button15 = New System.Windows.Forms.Button()
|
||||
Me.AttackListIndex = New System.Windows.Forms.TextBox()
|
||||
Me.Label20 = New System.Windows.Forms.Label()
|
||||
Me.ComboBox3 = New System.Windows.Forms.ComboBox()
|
||||
|
|
@ -35,8 +36,10 @@ Partial Class AttackEditor
|
|||
Me.Label21 = New System.Windows.Forms.Label()
|
||||
Me.Button6 = New System.Windows.Forms.Button()
|
||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||
Me.TextBox15 = New System.Windows.Forms.TextBox()
|
||||
Me.Label22 = New System.Windows.Forms.Label()
|
||||
Me.TextBox14 = New System.Windows.Forms.TextBox()
|
||||
Me.ComboBox8 = New System.Windows.Forms.ComboBox()
|
||||
Me.ComboBox7 = New System.Windows.Forms.ComboBox()
|
||||
Me.Label19 = New System.Windows.Forms.Label()
|
||||
Me.Label18 = New System.Windows.Forms.Label()
|
||||
Me.Button2 = New System.Windows.Forms.Button()
|
||||
|
|
@ -89,6 +92,14 @@ Partial Class AttackEditor
|
|||
Me.GroupBox4 = New System.Windows.Forms.GroupBox()
|
||||
Me.Button4 = New System.Windows.Forms.Button()
|
||||
Me.AnimationPointer = New System.Windows.Forms.TextBox()
|
||||
Me.ProgressBar = New System.Windows.Forms.ProgressBar()
|
||||
Me.Button7 = New System.Windows.Forms.Button()
|
||||
Me.Button8 = New System.Windows.Forms.Button()
|
||||
Me.Button9 = New System.Windows.Forms.Button()
|
||||
Me.Button10 = New System.Windows.Forms.Button()
|
||||
Me.fileOpenDialog = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog()
|
||||
Me.FolderBrowserDialog = New System.Windows.Forms.FolderBrowserDialog()
|
||||
Me.GroupBox1.SuspendLayout()
|
||||
Me.GroupBox2.SuspendLayout()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
|
|
@ -101,16 +112,26 @@ Partial Class AttackEditor
|
|||
'
|
||||
'GroupBox1
|
||||
'
|
||||
Me.GroupBox1.Controls.Add(Me.Button15)
|
||||
Me.GroupBox1.Controls.Add(Me.AttackListIndex)
|
||||
Me.GroupBox1.Controls.Add(Me.Label20)
|
||||
Me.GroupBox1.Controls.Add(Me.ComboBox3)
|
||||
Me.GroupBox1.Location = New System.Drawing.Point(12, 23)
|
||||
Me.GroupBox1.Name = "GroupBox1"
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(137, 74)
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(137, 101)
|
||||
Me.GroupBox1.TabIndex = 23
|
||||
Me.GroupBox1.TabStop = False
|
||||
Me.GroupBox1.Text = "Attack Selection:"
|
||||
'
|
||||
'Button15
|
||||
'
|
||||
Me.Button15.Location = New System.Drawing.Point(6, 74)
|
||||
Me.Button15.Name = "Button15"
|
||||
Me.Button15.Size = New System.Drawing.Size(120, 23)
|
||||
Me.Button15.TabIndex = 26
|
||||
Me.Button15.Text = "Decap. all names!"
|
||||
Me.Button15.UseVisualStyleBackColor = True
|
||||
'
|
||||
'AttackListIndex
|
||||
'
|
||||
Me.AttackListIndex.Location = New System.Drawing.Point(46, 46)
|
||||
|
|
@ -131,7 +152,6 @@ Partial Class AttackEditor
|
|||
'ComboBox3
|
||||
'
|
||||
Me.ComboBox3.AllowDrop = True
|
||||
Me.ComboBox3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.ComboBox3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.ComboBox3.FormattingEnabled = True
|
||||
Me.ComboBox3.Location = New System.Drawing.Point(6, 19)
|
||||
|
|
@ -143,9 +163,9 @@ Partial Class AttackEditor
|
|||
'
|
||||
Me.GroupBox2.Controls.Add(Me.Button1)
|
||||
Me.GroupBox2.Controls.Add(Me.TextBox1)
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(12, 102)
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(12, 126)
|
||||
Me.GroupBox2.Name = "GroupBox2"
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(137, 83)
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(137, 74)
|
||||
Me.GroupBox2.TabIndex = 24
|
||||
Me.GroupBox2.TabStop = False
|
||||
Me.GroupBox2.Text = "Rename Attack"
|
||||
|
|
@ -154,7 +174,7 @@ Partial Class AttackEditor
|
|||
'
|
||||
Me.Button1.Location = New System.Drawing.Point(6, 45)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(120, 32)
|
||||
Me.Button1.Size = New System.Drawing.Size(121, 23)
|
||||
Me.Button1.TabIndex = 1
|
||||
Me.Button1.Text = "Rename"
|
||||
Me.Button1.UseVisualStyleBackColor = True
|
||||
|
|
@ -238,17 +258,42 @@ Partial Class AttackEditor
|
|||
'
|
||||
'GroupBox3
|
||||
'
|
||||
Me.GroupBox3.Controls.Add(Me.TextBox15)
|
||||
Me.GroupBox3.Controls.Add(Me.Label22)
|
||||
Me.GroupBox3.Controls.Add(Me.TextBox14)
|
||||
Me.GroupBox3.Controls.Add(Me.ComboBox8)
|
||||
Me.GroupBox3.Controls.Add(Me.ComboBox7)
|
||||
Me.GroupBox3.Controls.Add(Me.Label19)
|
||||
Me.GroupBox3.Controls.Add(Me.Label18)
|
||||
Me.GroupBox3.Location = New System.Drawing.Point(21, 225)
|
||||
Me.GroupBox3.Name = "GroupBox3"
|
||||
Me.GroupBox3.Size = New System.Drawing.Size(179, 74)
|
||||
Me.GroupBox3.Size = New System.Drawing.Size(179, 106)
|
||||
Me.GroupBox3.TabIndex = 27
|
||||
Me.GroupBox3.TabStop = False
|
||||
Me.GroupBox3.Text = "Extras"
|
||||
'
|
||||
'TextBox15
|
||||
'
|
||||
Me.TextBox15.Location = New System.Drawing.Point(77, 73)
|
||||
Me.TextBox15.Name = "TextBox15"
|
||||
Me.TextBox15.Size = New System.Drawing.Size(40, 20)
|
||||
Me.TextBox15.TabIndex = 6
|
||||
'
|
||||
'Label22
|
||||
'
|
||||
Me.Label22.AutoSize = True
|
||||
Me.Label22.Location = New System.Drawing.Point(7, 78)
|
||||
Me.Label22.Name = "Label22"
|
||||
Me.Label22.Size = New System.Drawing.Size(62, 13)
|
||||
Me.Label22.TabIndex = 5
|
||||
Me.Label22.Text = "Pad Byte 3:"
|
||||
'
|
||||
'TextBox14
|
||||
'
|
||||
Me.TextBox14.Location = New System.Drawing.Point(77, 14)
|
||||
Me.TextBox14.Name = "TextBox14"
|
||||
Me.TextBox14.Size = New System.Drawing.Size(40, 20)
|
||||
Me.TextBox14.TabIndex = 4
|
||||
'
|
||||
'ComboBox8
|
||||
'
|
||||
Me.ComboBox8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
|
|
@ -259,16 +304,6 @@ Partial Class AttackEditor
|
|||
Me.ComboBox8.Size = New System.Drawing.Size(93, 21)
|
||||
Me.ComboBox8.TabIndex = 3
|
||||
'
|
||||
'ComboBox7
|
||||
'
|
||||
Me.ComboBox7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.ComboBox7.FormattingEnabled = True
|
||||
Me.ComboBox7.Items.AddRange(New Object() {"0", "1", "2"})
|
||||
Me.ComboBox7.Location = New System.Drawing.Point(77, 16)
|
||||
Me.ComboBox7.Name = "ComboBox7"
|
||||
Me.ComboBox7.Size = New System.Drawing.Size(94, 21)
|
||||
Me.ComboBox7.TabIndex = 2
|
||||
'
|
||||
'Label19
|
||||
'
|
||||
Me.Label19.AutoSize = True
|
||||
|
|
@ -283,9 +318,9 @@ Partial Class AttackEditor
|
|||
Me.Label18.AutoSize = True
|
||||
Me.Label18.Location = New System.Drawing.Point(7, 19)
|
||||
Me.Label18.Name = "Label18"
|
||||
Me.Label18.Size = New System.Drawing.Size(68, 13)
|
||||
Me.Label18.Size = New System.Drawing.Size(62, 13)
|
||||
Me.Label18.TabIndex = 0
|
||||
Me.Label18.Text = "Effect Table:"
|
||||
Me.Label18.Text = "Pad Byte 1:"
|
||||
'
|
||||
'Button2
|
||||
'
|
||||
|
|
@ -709,9 +744,9 @@ Partial Class AttackEditor
|
|||
'
|
||||
'Button3
|
||||
'
|
||||
Me.Button3.Location = New System.Drawing.Point(18, 294)
|
||||
Me.Button3.Location = New System.Drawing.Point(18, 287)
|
||||
Me.Button3.Name = "Button3"
|
||||
Me.Button3.Size = New System.Drawing.Size(120, 33)
|
||||
Me.Button3.Size = New System.Drawing.Size(120, 23)
|
||||
Me.Button3.TabIndex = 26
|
||||
Me.Button3.Text = "Save"
|
||||
Me.Button3.UseVisualStyleBackColor = True
|
||||
|
|
@ -720,9 +755,9 @@ Partial Class AttackEditor
|
|||
'
|
||||
Me.GroupBox4.Controls.Add(Me.Button4)
|
||||
Me.GroupBox4.Controls.Add(Me.AnimationPointer)
|
||||
Me.GroupBox4.Location = New System.Drawing.Point(12, 195)
|
||||
Me.GroupBox4.Location = New System.Drawing.Point(12, 204)
|
||||
Me.GroupBox4.Name = "GroupBox4"
|
||||
Me.GroupBox4.Size = New System.Drawing.Size(137, 83)
|
||||
Me.GroupBox4.Size = New System.Drawing.Size(137, 77)
|
||||
Me.GroupBox4.TabIndex = 27
|
||||
Me.GroupBox4.TabStop = False
|
||||
Me.GroupBox4.Text = "Animation Pointer"
|
||||
|
|
@ -731,7 +766,7 @@ Partial Class AttackEditor
|
|||
'
|
||||
Me.Button4.Location = New System.Drawing.Point(6, 45)
|
||||
Me.Button4.Name = "Button4"
|
||||
Me.Button4.Size = New System.Drawing.Size(121, 30)
|
||||
Me.Button4.Size = New System.Drawing.Size(121, 23)
|
||||
Me.Button4.TabIndex = 1
|
||||
Me.Button4.Text = "Repoint"
|
||||
Me.Button4.UseVisualStyleBackColor = True
|
||||
|
|
@ -743,11 +778,60 @@ Partial Class AttackEditor
|
|||
Me.AnimationPointer.Size = New System.Drawing.Size(121, 20)
|
||||
Me.AnimationPointer.TabIndex = 0
|
||||
'
|
||||
'ProgressBar
|
||||
'
|
||||
Me.ProgressBar.Location = New System.Drawing.Point(12, 442)
|
||||
Me.ProgressBar.Name = "ProgressBar"
|
||||
Me.ProgressBar.Size = New System.Drawing.Size(626, 23)
|
||||
Me.ProgressBar.TabIndex = 28
|
||||
Me.ProgressBar.Visible = False
|
||||
'
|
||||
'Button7
|
||||
'
|
||||
Me.Button7.Location = New System.Drawing.Point(18, 319)
|
||||
Me.Button7.Name = "Button7"
|
||||
Me.Button7.Size = New System.Drawing.Size(120, 23)
|
||||
Me.Button7.TabIndex = 29
|
||||
Me.Button7.Text = "Import Attack"
|
||||
Me.Button7.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button8
|
||||
'
|
||||
Me.Button8.Location = New System.Drawing.Point(18, 348)
|
||||
Me.Button8.Name = "Button8"
|
||||
Me.Button8.Size = New System.Drawing.Size(120, 23)
|
||||
Me.Button8.TabIndex = 30
|
||||
Me.Button8.Text = "Import All"
|
||||
Me.Button8.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button9
|
||||
'
|
||||
Me.Button9.Location = New System.Drawing.Point(18, 406)
|
||||
Me.Button9.Name = "Button9"
|
||||
Me.Button9.Size = New System.Drawing.Size(120, 23)
|
||||
Me.Button9.TabIndex = 32
|
||||
Me.Button9.Text = "Export All"
|
||||
Me.Button9.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button10
|
||||
'
|
||||
Me.Button10.Location = New System.Drawing.Point(18, 377)
|
||||
Me.Button10.Name = "Button10"
|
||||
Me.Button10.Size = New System.Drawing.Size(120, 23)
|
||||
Me.Button10.TabIndex = 31
|
||||
Me.Button10.Text = "Export Attack"
|
||||
Me.Button10.UseVisualStyleBackColor = True
|
||||
'
|
||||
'AttackEditor
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(650, 448)
|
||||
Me.ClientSize = New System.Drawing.Size(650, 474)
|
||||
Me.Controls.Add(Me.Button9)
|
||||
Me.Controls.Add(Me.Button10)
|
||||
Me.Controls.Add(Me.Button8)
|
||||
Me.Controls.Add(Me.Button7)
|
||||
Me.Controls.Add(Me.ProgressBar)
|
||||
Me.Controls.Add(Me.GroupBox4)
|
||||
Me.Controls.Add(Me.Button3)
|
||||
Me.Controls.Add(Me.TabControl1)
|
||||
|
|
@ -829,7 +913,6 @@ Partial Class AttackEditor
|
|||
Friend WithEvents Button3 As System.Windows.Forms.Button
|
||||
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents ComboBox8 As System.Windows.Forms.ComboBox
|
||||
Friend WithEvents ComboBox7 As System.Windows.Forms.ComboBox
|
||||
Friend WithEvents Label19 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label18 As System.Windows.Forms.Label
|
||||
Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
|
||||
|
|
@ -843,4 +926,16 @@ Partial Class AttackEditor
|
|||
Friend WithEvents Label20 As Label
|
||||
Friend WithEvents Button6 As Button
|
||||
Friend WithEvents Label21 As Label
|
||||
Friend WithEvents ProgressBar As ProgressBar
|
||||
Friend WithEvents Button15 As Button
|
||||
Friend WithEvents Button7 As Button
|
||||
Friend WithEvents Button8 As Button
|
||||
Friend WithEvents Button9 As Button
|
||||
Friend WithEvents Button10 As Button
|
||||
Friend WithEvents fileOpenDialog As OpenFileDialog
|
||||
Friend WithEvents SaveFileDialog As SaveFileDialog
|
||||
Friend WithEvents FolderBrowserDialog As FolderBrowserDialog
|
||||
Friend WithEvents TextBox14 As TextBox
|
||||
Friend WithEvents TextBox15 As TextBox
|
||||
Friend WithEvents Label22 As Label
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -117,6 +117,15 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="fileOpenDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="SaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>150, 17</value>
|
||||
</metadata>
|
||||
<metadata name="FolderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>281, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
Public Class AttackEditor
|
||||
Imports System.IO.Directory
|
||||
|
||||
Public Class AttackEditor
|
||||
Dim AttackDesc As Integer
|
||||
Dim AttackData As Integer
|
||||
Dim AttackAni As Integer
|
||||
|
|
@ -76,8 +78,9 @@
|
|||
TextBox4.Text = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 5) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
ComboBox2.SelectedIndex = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 6) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
TextBox5.Text = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 7) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
ComboBox7.SelectedIndex = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 9) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
TextBox14.Text = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 9) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
ComboBox8.SelectedIndex = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 10) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
TextBox15.Text = Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, ((AttackData) + 12 + 11) + (ComboBox3.SelectedIndex * 12), 1)))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
Dim bita As String
|
||||
Dim bitb As String
|
||||
|
|
@ -221,15 +224,16 @@
|
|||
|
||||
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12) + (ComboBox3.SelectedIndex * 12), Hex(Effects.SelectedIndex))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 1) + (ComboBox3.SelectedIndex * 12), Hex(BasePower.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 1) + (ComboBox3.SelectedIndex * 12), Hex(BasePower.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 2) + (ComboBox3.SelectedIndex * 12), Hex(ComboBox1.SelectedIndex))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 3) + (ComboBox3.SelectedIndex * 12), Hex(TextBox2.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 4) + (ComboBox3.SelectedIndex * 12), Hex(TextBox3.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 5) + (ComboBox3.SelectedIndex * 12), Hex(TextBox4.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 5) + (ComboBox3.SelectedIndex * 12), Hex(TextBox4.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 6) + (ComboBox3.SelectedIndex * 12), Hex(ComboBox2.SelectedIndex))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 7) + (ComboBox3.SelectedIndex * 12), Hex(TextBox5.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 9) + (ComboBox3.SelectedIndex * 12), Hex(ComboBox7.SelectedIndex))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 9) + (ComboBox3.SelectedIndex * 12), Hex(TextBox14.Text))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 10) + (ComboBox3.SelectedIndex * 12), Hex(ComboBox8.SelectedIndex))
|
||||
WriteHEX(LoadedROM, ((AttackData) + 12 + 11) + (ComboBox3.SelectedIndex * 12), Hex(TextBox15.Text))
|
||||
|
||||
Dim bita As String = ""
|
||||
Dim bitb As String = ""
|
||||
|
|
@ -410,4 +414,268 @@
|
|||
|
||||
Private Sub ComboBox6_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox6.SelectedIndexChanged
|
||||
End Sub
|
||||
|
||||
Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
|
||||
Me.Text = "Please wait..."
|
||||
Me.UseWaitCursor = True
|
||||
ProgressBar.Value = 0
|
||||
ProgressBar.Visible = True
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) = True
|
||||
|
||||
ComboBox3.SelectedIndex = LoopVar
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
Me.Refresh()
|
||||
Me.Enabled = False
|
||||
|
||||
ChangeAttackName(LoopVar, DecapString(GetAttackName(LoopVar)))
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfAttacks", ""))) * 100
|
||||
|
||||
End While
|
||||
|
||||
LoopVar = 1
|
||||
|
||||
ComboBox3.Items.Clear()
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1 = True
|
||||
|
||||
|
||||
ComboBox3.Items.Add(GetAttackName(LoopVar))
|
||||
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
End While
|
||||
|
||||
ComboBox3.SelectedIndex = 0
|
||||
|
||||
Me.Text = "Attack Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
|
||||
SaveFileDialog.FileName = (ComboBox3.SelectedIndex + 1) & ".ini"
|
||||
'SaveFileDialog.CheckFileExists = True
|
||||
|
||||
' Check to ensure that the selected path exists. Dialog box displays
|
||||
' a warning otherwise.
|
||||
SaveFileDialog.CheckPathExists = True
|
||||
|
||||
' Get or set default extension. Doesn't include the leading ".".
|
||||
SaveFileDialog.DefaultExt = "ini"
|
||||
|
||||
' Return the file referenced by a link? If False, simply returns the selected link
|
||||
' file. If True, returns the file linked to the LNK file.
|
||||
SaveFileDialog.DereferenceLinks = True
|
||||
|
||||
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
|
||||
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
|
||||
' trailing "|". You can set the FilterIndex property as well, to select the default
|
||||
' filter. The first filter is numbered 1 (not 0). The default is 1.
|
||||
SaveFileDialog.Filter =
|
||||
"(*.ini)|*.ini*"
|
||||
|
||||
'SaveFileDialog.Multiselect = False
|
||||
|
||||
' Restore the original directory when done selecting
|
||||
' a file? If False, the current directory changes
|
||||
' to the directory in which you selected the file.
|
||||
' Set this to True to put the current folder back
|
||||
' where it was when you started.
|
||||
' The default is False.
|
||||
'.RestoreDirectory = False
|
||||
|
||||
' Show the Help button and Read-Only checkbox?
|
||||
SaveFileDialog.ShowHelp = False
|
||||
'SaveFileDialog.ShowReadOnly = False
|
||||
|
||||
' Start out with the read-only check box checked?
|
||||
' This only make sense if ShowReadOnly is True.
|
||||
'SaveFileDialog.ReadOnlyChecked = False
|
||||
|
||||
SaveFileDialog.Title = "Save as"
|
||||
|
||||
' Only accept valid Win32 file names?
|
||||
SaveFileDialog.ValidateNames = True
|
||||
|
||||
|
||||
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
|
||||
ExportAttackINI(SaveFileDialog.FileName, (ComboBox3.SelectedIndex + 1))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
|
||||
FolderBrowserDialog.Description = "Select folder to export all Attacks to:"
|
||||
|
||||
If FolderBrowserDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
Me.Text = "Please wait..."
|
||||
Me.UseWaitCursor = True
|
||||
ProgressBar.Value = 0
|
||||
ProgressBar.Visible = True
|
||||
|
||||
If System.IO.Directory.Exists(FolderBrowserDialog.SelectedPath & "\Attacks") = False Then
|
||||
CreateDirectory(FolderBrowserDialog.SelectedPath & "\Attacks")
|
||||
End If
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) = True
|
||||
|
||||
ComboBox3.SelectedIndex = LoopVar
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
Me.Refresh()
|
||||
Me.Enabled = False
|
||||
|
||||
ExportAttackINI(FolderBrowserDialog.SelectedPath & "\Attacks\" & LoopVar & ".ini", LoopVar)
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfAttacks", ""))) * 100
|
||||
End While
|
||||
|
||||
Me.Text = "Attack Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
fileOpenDialog.FileName = ""
|
||||
fileOpenDialog.CheckFileExists = True
|
||||
|
||||
' Check to ensure that the selected path exists. Dialog box displays
|
||||
' a warning otherwise.
|
||||
fileOpenDialog.CheckPathExists = True
|
||||
|
||||
' Get or set default extension. Doesn't include the leading ".".
|
||||
fileOpenDialog.DefaultExt = "ini"
|
||||
|
||||
' Return the file referenced by a link? If False, simply returns the selected link
|
||||
' file. If True, returns the file linked to the LNK file.
|
||||
fileOpenDialog.DereferenceLinks = True
|
||||
|
||||
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
|
||||
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
|
||||
' trailing "|". You can set the FilterIndex property as well, to select the default
|
||||
' filter. The first filter is numbered 1 (not 0). The default is 1.
|
||||
fileOpenDialog.Filter =
|
||||
"(*.ini)|*.ini*"
|
||||
|
||||
fileOpenDialog.Multiselect = False
|
||||
|
||||
' Restore the original directory when done selecting
|
||||
' a file? If False, the current directory changes
|
||||
' to the directory in which you selected the file.
|
||||
' Set this to True to put the current folder back
|
||||
' where it was when you started.
|
||||
' The default is False.
|
||||
'.RestoreDirectory = False
|
||||
|
||||
' Show the Help button and Read-Only checkbox?
|
||||
fileOpenDialog.ShowHelp = False
|
||||
fileOpenDialog.ShowReadOnly = False
|
||||
|
||||
' Start out with the read-only check box checked?
|
||||
' This only make sense if ShowReadOnly is True.
|
||||
fileOpenDialog.ReadOnlyChecked = False
|
||||
|
||||
fileOpenDialog.Title = "Select ini file to import"
|
||||
|
||||
' Only accept valid Win32 file names?
|
||||
fileOpenDialog.ValidateNames = True
|
||||
|
||||
|
||||
If fileOpenDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
|
||||
ImportAttackINI(fileOpenDialog.FileName, (ComboBox3.SelectedIndex + 1))
|
||||
|
||||
Dim refreshvar As Integer
|
||||
|
||||
refreshvar = ComboBox3.SelectedIndex
|
||||
|
||||
If ComboBox3.SelectedIndex = 0 Then
|
||||
ComboBox3.SelectedIndex = ComboBox3.SelectedIndex + 1
|
||||
Else
|
||||
ComboBox3.SelectedIndex = ComboBox3.SelectedIndex - 1
|
||||
End If
|
||||
|
||||
ComboBox3.Items.Insert(refreshvar, GetAttackName(refreshvar + 1))
|
||||
|
||||
ComboBox3.Items.RemoveAt(refreshvar + 1)
|
||||
|
||||
ComboBox3.SelectedIndex = refreshvar
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
|
||||
FolderBrowserDialog.Description = "Select folder to import Pokemon from:"
|
||||
|
||||
If FolderBrowserDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
Me.Text = "Please wait..."
|
||||
Me.UseWaitCursor = True
|
||||
ProgressBar.Value = 0
|
||||
ProgressBar.Visible = True
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) = True
|
||||
ComboBox3.SelectedIndex = LoopVar
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
Me.Refresh()
|
||||
Me.Enabled = False
|
||||
|
||||
If System.IO.File.Exists(FolderBrowserDialog.SelectedPath & "\" & LoopVar & ".ini") Then
|
||||
ImportAttackINI(FolderBrowserDialog.SelectedPath & "\" & LoopVar & ".ini", LoopVar)
|
||||
End If
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfAttacks", ""))) * 100
|
||||
End While
|
||||
|
||||
LoopVar = 1
|
||||
|
||||
ComboBox3.Items.Clear()
|
||||
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1 = True
|
||||
|
||||
|
||||
ComboBox3.Items.Add(GetAttackName(LoopVar))
|
||||
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
End While
|
||||
|
||||
ComboBox3.SelectedIndex = 0
|
||||
|
||||
Me.Text = "Attack Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox5.SelectedIndexChanged
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
209
GBAPokemonGameEditor/ChangeImageFunctions.vb
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
Imports VB = Microsoft.VisualBasic
|
||||
Module ChangeImageFunctions
|
||||
Public Sub SaveFrontSpriteToFreeSpace(Pokemonindex As Integer, Sprite As Byte(), pallete As Color())
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonFrontSprites", ""), System.Globalization.NumberStyles.HexNumber) + (Pokemonindex * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (Pokemonindex * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
|
||||
Dim ImgString As String
|
||||
Dim PalString As String
|
||||
|
||||
Dim ImgBytes As Byte()
|
||||
Dim PalBytes As Byte()
|
||||
|
||||
Dim ImgNewOffset As String
|
||||
Dim PalNewOffset As String
|
||||
|
||||
ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(Sprite)))
|
||||
PalBytes = ConvertStringToByteArray(CompressLz77String(ConvertPaletteToString(pallete)))
|
||||
|
||||
ImgString = ByteArrayToHexString(ImgBytes)
|
||||
PalString = ByteArrayToHexString(PalBytes)
|
||||
|
||||
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
|
||||
|
||||
WriteHEX(LoadedROM, sOffset, ReverseHEX(Hex((ImgNewOffset) + &H8000000)))
|
||||
|
||||
PalNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, PalNewOffset, PalString)
|
||||
|
||||
WriteHEX(LoadedROM, pOffset, ReverseHEX(Hex((PalNewOffset) + &H8000000)))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub SaveBackSpriteToFreeSpace(Pokemonindex As Integer, Sprite As Byte(), pallete As Color())
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonBackSprites", ""), System.Globalization.NumberStyles.HexNumber) + (Pokemonindex * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (Pokemonindex * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
|
||||
Dim ImgString As String
|
||||
Dim PalString As String
|
||||
|
||||
Dim ImgBytes As Byte()
|
||||
Dim PalBytes As Byte()
|
||||
|
||||
Dim ImgNewOffset As String
|
||||
Dim PalNewOffset As String
|
||||
|
||||
ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(Sprite)))
|
||||
PalBytes = ConvertStringToByteArray(CompressLz77String(ConvertPaletteToString(pallete)))
|
||||
|
||||
ImgString = ByteArrayToHexString(ImgBytes)
|
||||
PalString = ByteArrayToHexString(PalBytes)
|
||||
|
||||
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
|
||||
|
||||
WriteHEX(LoadedROM, sOffset, ReverseHEX(Hex((ImgNewOffset) + &H8000000)))
|
||||
|
||||
PalNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, PalNewOffset, PalString)
|
||||
|
||||
WriteHEX(LoadedROM, pOffset, ReverseHEX(Hex((PalNewOffset) + &H8000000)))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub SaveAnimationSpriteToFreeSpace(Pokemonindex As Integer, Sprite As Byte())
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + (Pokemonindex * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
|
||||
Dim ImgString As String
|
||||
|
||||
Dim ImgBytes As Byte()
|
||||
|
||||
Dim ImgNewOffset As String
|
||||
|
||||
|
||||
ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(Sprite)))
|
||||
|
||||
ImgString = ByteArrayToHexString(ImgBytes)
|
||||
|
||||
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
|
||||
|
||||
WriteHEX(LoadedROM, sOffset, ReverseHEX(Hex((ImgNewOffset) + &H8000000)))
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function ConvertFootPrintImageToHexString(Image As Bitmap) As String
|
||||
|
||||
Dim OutPutBuffer0 As String = ""
|
||||
Dim OutPutBuffer1 As String = ""
|
||||
Dim OutPutBuffer2 As String = ""
|
||||
Dim OutPutBuffer3 As String = ""
|
||||
Dim BitBuffer0 As String = ""
|
||||
Dim BitBuffer1 As String = ""
|
||||
Dim BitBuffer2 As String = ""
|
||||
Dim BitBuffer3 As String = ""
|
||||
Dim Palette2 As Color
|
||||
|
||||
Dim sideways As Integer = 0
|
||||
Dim updown As Integer = 0
|
||||
Dim CurSquare As Integer = 0
|
||||
|
||||
Palette2 = Image.GetPixel(sideways, updown)
|
||||
|
||||
While updown < 16
|
||||
While sideways < 8
|
||||
|
||||
If CurSquare = 0 Then
|
||||
|
||||
If Image.GetPixel(sideways, updown) = Palette2 Then
|
||||
BitBuffer0 = BitBuffer0 & 0
|
||||
Else
|
||||
BitBuffer0 = BitBuffer0 & 1
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If CurSquare = 1 Then
|
||||
|
||||
If Image.GetPixel((CurSquare * 8) + sideways, updown - (CurSquare * 8)) = Palette2 Then
|
||||
BitBuffer1 = BitBuffer1 & 0
|
||||
Else
|
||||
BitBuffer1 = BitBuffer1 & 1
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If CurSquare = 2 Then
|
||||
|
||||
If Image.GetPixel(sideways, updown + (8)) = Palette2 Then
|
||||
BitBuffer2 = BitBuffer2 & 0
|
||||
Else
|
||||
BitBuffer2 = BitBuffer2 & 1
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If CurSquare = 3 Then
|
||||
|
||||
If Image.GetPixel((8) + sideways, updown) = Palette2 Then
|
||||
BitBuffer3 = BitBuffer3 & 0
|
||||
Else
|
||||
|
||||
BitBuffer3 = BitBuffer3 & 1
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Len(BitBuffer0) = 8 Then
|
||||
OutPutBuffer0 = OutPutBuffer0 & VB.Right("00" & Hex(Convert.ToInt32(BitBuffer0, 2)), 2)
|
||||
BitBuffer0 = ""
|
||||
End If
|
||||
|
||||
If Len(BitBuffer1) = 8 Then
|
||||
OutPutBuffer1 = OutPutBuffer1 & VB.Right("00" & Hex(Convert.ToInt32(BitBuffer1, 2)), 2)
|
||||
BitBuffer1 = ""
|
||||
End If
|
||||
|
||||
If Len(BitBuffer2) = 8 Then
|
||||
OutPutBuffer2 = OutPutBuffer2 & VB.Right("00" & Hex(Convert.ToInt32(BitBuffer2, 2)), 2)
|
||||
BitBuffer2 = ""
|
||||
End If
|
||||
|
||||
If Len(BitBuffer3) = 8 Then
|
||||
OutPutBuffer3 = OutPutBuffer3 & VB.Right("00" & Hex(Convert.ToInt32(BitBuffer3, 2)), 2)
|
||||
BitBuffer3 = ""
|
||||
End If
|
||||
|
||||
sideways = sideways + 1
|
||||
End While
|
||||
|
||||
sideways = 0
|
||||
|
||||
If updown = 7 And CurSquare = 0 Then
|
||||
CurSquare = CurSquare + 1
|
||||
End If
|
||||
|
||||
If updown = 15 And CurSquare = 1 Then
|
||||
CurSquare = CurSquare + 1
|
||||
updown = -1
|
||||
End If
|
||||
|
||||
If updown = 7 And CurSquare = 2 Then
|
||||
CurSquare = CurSquare + 1
|
||||
|
||||
End If
|
||||
|
||||
If updown = 15 And CurSquare = 3 Then
|
||||
CurSquare = CurSquare + 1
|
||||
End If
|
||||
|
||||
updown = updown + 1
|
||||
|
||||
End While
|
||||
|
||||
|
||||
ConvertFootPrintImageToHexString = OutPutBuffer1 & OutPutBuffer0 & OutPutBuffer3 & OutPutBuffer2
|
||||
End Function
|
||||
|
||||
End Module
|
||||
2
GBAPokemonGameEditor/EggMoveEditor.Designer.vb
generated
|
|
@ -60,7 +60,6 @@ Partial Class EggMoveEditor
|
|||
'
|
||||
'ComboBox1
|
||||
'
|
||||
Me.ComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.ComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.ComboBox1.FormattingEnabled = True
|
||||
Me.ComboBox1.Location = New System.Drawing.Point(272, 14)
|
||||
|
|
@ -70,7 +69,6 @@ Partial Class EggMoveEditor
|
|||
'
|
||||
'ComboBox2
|
||||
'
|
||||
Me.ComboBox2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.ComboBox2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.ComboBox2.FormattingEnabled = True
|
||||
Me.ComboBox2.Location = New System.Drawing.Point(272, 128)
|
||||
|
|
|
|||
422
GBAPokemonGameEditor/ExportDataFunctions.vb
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
Imports VB = Microsoft.VisualBasic
|
||||
Module ExportDataFunctions
|
||||
Public Sub ExportPokemonINI(INIFileName As String, PokemonIndex As Integer)
|
||||
|
||||
'Declare vars
|
||||
|
||||
Dim BaseStats As String
|
||||
|
||||
Dim PlayerY As String
|
||||
Dim EnemyY As String
|
||||
Dim EnemyAlt As String
|
||||
|
||||
Dim ItemAnimation As String = ""
|
||||
|
||||
Dim EvolutionData As String
|
||||
|
||||
Dim LevelUpAttacksOriginal As String = ""
|
||||
Dim LevelUpAttacksJambo51 As String = ""
|
||||
Dim CurAttackListOffset As String
|
||||
Dim at As String
|
||||
Dim lvl As String
|
||||
Dim Looper As Integer
|
||||
Dim TempLoadBuff As Integer
|
||||
Dim binarybuffer As String
|
||||
|
||||
Dim MoveTutorCompatibility As String = ""
|
||||
|
||||
Dim TMHMCompatibility As String
|
||||
|
||||
Dim NationalDexNumber As String
|
||||
Dim SecondDexNumber As String
|
||||
|
||||
Dim Pointer1 As String = ""
|
||||
Dim Pointer2 As String = ""
|
||||
Dim Pointer1Description As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
Dim Pointer2Description As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
Dim PokedexDescription As String = ""
|
||||
Dim Hght As String = ""
|
||||
Dim Wght As String = ""
|
||||
Dim Scale1 As String = ""
|
||||
Dim Scale2 As String = ""
|
||||
Dim Offset_1 As String = ""
|
||||
Dim Offset_2 As String = ""
|
||||
Dim PokedexType As String = ""
|
||||
|
||||
'Fill vars with proper data
|
||||
|
||||
BaseStats = ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonData", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 28), 28)
|
||||
|
||||
PlayerY = ((ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PlayerYTable", "")), System.Globalization.NumberStyles.HexNumber)) + 1 + (PokemonIndex * 4), 1)))
|
||||
EnemyY = ((ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "EnemyYTable", "")), System.Globalization.NumberStyles.HexNumber)) + 1 + (PokemonIndex * 4), 1)))
|
||||
EnemyAlt = ((ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "EnemyAltitudeTable", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 1), 1)))
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Then
|
||||
ItemAnimation = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "ItemAnimationTable", "")), System.Globalization.NumberStyles.HexNumber) + ((PokemonIndex - 1) * 5), 5)
|
||||
End If
|
||||
|
||||
EvolutionData = ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonEvolutions", "")), System.Globalization.NumberStyles.HexNumber)) + ((PokemonIndex) * (8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", "")))), (8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", ""))))
|
||||
|
||||
|
||||
CurAttackListOffset = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonAttackTable", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
|
||||
If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "False" Then
|
||||
|
||||
Looper = 0
|
||||
|
||||
While ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2) = "FFFF" = False
|
||||
|
||||
LevelUpAttacksOriginal = LevelUpAttacksOriginal & ((ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2)))
|
||||
|
||||
Looper = Looper + 1
|
||||
End While
|
||||
|
||||
Looper = 0
|
||||
|
||||
While ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2) = "FFFF" = False
|
||||
|
||||
TempLoadBuff = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
binarybuffer = Convert.ToString(TempLoadBuff, 2)
|
||||
|
||||
While Len(binarybuffer) < 16
|
||||
|
||||
binarybuffer = "0" & binarybuffer
|
||||
|
||||
End While
|
||||
|
||||
lvl = Mid(binarybuffer, 1, 7)
|
||||
|
||||
at = Mid(binarybuffer, 8, 9)
|
||||
|
||||
lvl = Convert.ToInt32(lvl, 2)
|
||||
|
||||
at = Convert.ToInt32(at, 2)
|
||||
|
||||
lvl = VB.Right("00" & Hex(lvl), 2)
|
||||
at = ReverseHEX(VB.Right("0000" & Hex(at), 4))
|
||||
|
||||
|
||||
LevelUpAttacksJambo51 = LevelUpAttacksJambo51 & at & lvl
|
||||
|
||||
Looper = Looper + 1
|
||||
End While
|
||||
|
||||
|
||||
ElseIf GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "True" Then
|
||||
|
||||
Looper = 0
|
||||
|
||||
Dim temp As Integer
|
||||
|
||||
While ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 3), 3) = GetString(GetINIFileLocation(), header, "JamboLearnableMovesTerm", "") = False
|
||||
|
||||
lvl = Int32.Parse(((ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 3) + 2, 1))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
at = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((CurAttackListOffset), System.Globalization.NumberStyles.HexNumber) + (Looper * 3), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
LevelUpAttacksJambo51 = LevelUpAttacksJambo51 & ReverseHEX(VB.Right("0000" & Hex(at), 4)) & VB.Right("00" & Hex(lvl), 2)
|
||||
Looper = Looper + 1
|
||||
|
||||
temp = lvl
|
||||
|
||||
lvl = Convert.ToString(temp, 2)
|
||||
|
||||
temp = at
|
||||
|
||||
at = Convert.ToString(temp, 2)
|
||||
|
||||
While Len(lvl) < 7
|
||||
|
||||
lvl = "0" & lvl
|
||||
|
||||
End While
|
||||
|
||||
While Len(at) < 9
|
||||
|
||||
at = "0" & at
|
||||
|
||||
End While
|
||||
|
||||
If Len(at) > 9 Then
|
||||
at = "111111111"
|
||||
End If
|
||||
|
||||
If Len(lvl) > 7 Then
|
||||
lvl = "1111111"
|
||||
End If
|
||||
|
||||
LevelUpAttacksOriginal = LevelUpAttacksOriginal & ReverseHEX(VB.Right("0000" & Hex(Convert.ToInt32(lvl & at, 2)), 4))
|
||||
|
||||
End While
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
|
||||
MoveTutorCompatibility = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "MoveTutorCompatibility", "")), System.Globalization.NumberStyles.HexNumber) + (((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8)) + ((PokemonIndex - 1) * (((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8))), ((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8))
|
||||
End If
|
||||
|
||||
TMHMCompatibility = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "TMHMCompatibility", "")), System.Globalization.NumberStyles.HexNumber) + (PokemonIndex * (Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", "")))), (Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", ""))))
|
||||
|
||||
NationalDexNumber = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((PokemonIndex - 1) * 2), 2)
|
||||
SecondDexNumber = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "SecondDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((PokemonIndex - 1) * 2), 2)
|
||||
|
||||
NationalDexNumber = Int32.Parse(ReverseHEX(NationalDexNumber), System.Globalization.NumberStyles.HexNumber)
|
||||
SecondDexNumber = Int32.Parse(ReverseHEX(SecondDexNumber), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
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
|
||||
|
||||
If NationalDexNumber < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
|
||||
|
||||
Pointer1 = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 4 + 12 + (NationalDexNumber * SkipVar), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
Hght = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 12 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Wght = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 2 + 12 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
|
||||
If header2 = "AXP" Or header2 = "AXV" Then
|
||||
|
||||
Scale1 = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1 = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2 = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 30 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2 = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 32 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
Pointer2 = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 8 + +12 + (NationalDexNumber * SkipVar), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FileGet(FileNum, Pointer1Description, Int32.Parse(((Pointer1)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
Pointer1Description = Sapp2Asc(Pointer1Description)
|
||||
Pointer1Description = Mid$(Pointer1Description, 1, InStr(1, Pointer1Description, "\x"))
|
||||
Pointer1Description = Pointer1Description & "x"
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FileGet(FileNum, Pointer2Description, Int32.Parse(((Pointer2)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
Pointer2Description = Sapp2Asc(Pointer2Description)
|
||||
Pointer2Description = Mid$(Pointer2Description, 1, InStr(1, Pointer2Description, "\x"))
|
||||
Pointer2Description = Pointer2Description & "x"
|
||||
PokedexDescription = Pointer1Description & Pointer2Description
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
|
||||
ElseIf header2 = "BPR" Or header2 = "BPG" Then
|
||||
|
||||
Scale1 = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1 = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2 = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 30 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2 = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 32 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FileGet(FileNum, Pointer1Description, Int32.Parse(((Pointer1)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
Pointer1Description = Sapp2Asc(Pointer1Description)
|
||||
Pointer1Description = Mid$(Pointer1Description, 1, InStr(1, Pointer1Description, "\x"))
|
||||
Pointer1Description = Pointer1Description & "x"
|
||||
PokedexDescription = Pointer1Description
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
ElseIf header2 = "BPE" Then
|
||||
|
||||
Scale1 = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 22 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1 = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 24 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2 = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2 = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FileGet(FileNum, Pointer1Description, Int32.Parse(((Pointer1)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
Pointer1Description = Sapp2Asc(Pointer1Description)
|
||||
Pointer1Description = Mid$(Pointer1Description, 1, InStr(1, Pointer1Description, "\x"))
|
||||
Pointer1Description = Pointer1Description & "x"
|
||||
PokedexDescription = Pointer1Description
|
||||
|
||||
FileClose(FileNum)
|
||||
End If
|
||||
|
||||
PokedexType = GetPokedexTypeName(NationalDexNumber)
|
||||
|
||||
End If
|
||||
|
||||
'Write values to ini
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "PokemonName", GetPokemonName(PokemonIndex))
|
||||
WriteString(INIFileName, "Pokemon", "BaseStats", BaseStats)
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "PlayerY", PlayerY)
|
||||
WriteString(INIFileName, "Pokemon", "EnemyY", EnemyY)
|
||||
WriteString(INIFileName, "Pokemon", "EnemyAlt", EnemyAlt)
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Then
|
||||
WriteString(INIFileName, "Pokemon", "ItemAnimation", ItemAnimation)
|
||||
End If
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "EvolutionData", EvolutionData)
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "LevelUpAttacksOriginal", LevelUpAttacksOriginal & "FFFF0000")
|
||||
WriteString(INIFileName, "Pokemon", "LevelUpAttacksJambo51", LevelUpAttacksJambo51 & "0000FF00")
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
|
||||
WriteString(INIFileName, "Pokemon", "MoveTutorCompatibility", MoveTutorCompatibility)
|
||||
End If
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "TMHMCompatibility", TMHMCompatibility)
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "NationalDexNumber", NationalDexNumber)
|
||||
WriteString(INIFileName, "Pokemon", "SecondDexNumber", SecondDexNumber)
|
||||
|
||||
If NationalDexNumber < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
|
||||
|
||||
WriteString(INIFileName, "Pokemon", "Hght", Hght)
|
||||
WriteString(INIFileName, "Pokemon", "Wght", Wght)
|
||||
WriteString(INIFileName, "Pokemon", "Scale1", Scale1)
|
||||
WriteString(INIFileName, "Pokemon", "Scale2", Scale2)
|
||||
WriteString(INIFileName, "Pokemon", "Offset_1", Offset_1)
|
||||
WriteString(INIFileName, "Pokemon", "Offset_2", Offset_2)
|
||||
WriteString(INIFileName, "Pokemon", "PokedexDescription", PokedexDescription)
|
||||
WriteString(INIFileName, "Pokemon", "PokedexType", PokedexType)
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ExportAbilityINI(INIFileName As String, AbilityIndex As Integer)
|
||||
|
||||
Dim AbilityDescription As String
|
||||
Dim AbilityDescriptionTable As Integer
|
||||
Dim CurAbilityDescriptionPointer As String
|
||||
|
||||
AbilityDescriptionTable = Int32.Parse((GetString(GetINIFileLocation(), header, "AbilityDescriptionTable", "")), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
CurAbilityDescriptionPointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AbilityDescriptionTable) + (AbilityIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
Dim AbDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
|
||||
FileGet(FileNum, AbDescp, Int32.Parse(((CurAbilityDescriptionPointer)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
AbDescp = Sapp2Asc(AbDescp)
|
||||
AbDescp = Mid$(AbDescp, 1, InStr(1, AbDescp, "\x"))
|
||||
'AbDescp = Replace(AbDescp, "\n", vbCrLf)
|
||||
'AbDescp = Replace(RTrim$(AbDescp), "\", "")
|
||||
AbDescp = AbDescp & "x"
|
||||
AbilityDescription = AbDescp
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
WriteString(INIFileName, "Ability", "AbilityName", GetAbilityName(AbilityIndex))
|
||||
WriteString(INIFileName, "Ability", "AbilityDescription", AbilityDescription)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ExportAttackINI(INIFileName As String, AttackIndex As Integer)
|
||||
|
||||
Dim AttackData As String
|
||||
Dim AttackDescription As String
|
||||
Dim AttackDescriptionTable As Integer
|
||||
Dim CurAttackDescriptionPointer As String
|
||||
Dim ContestData As String
|
||||
|
||||
AttackDescriptionTable = Int32.Parse((GetString(GetINIFileLocation(), header, "AttackDescriptionTable", "")), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
CurAttackDescriptionPointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackDescriptionTable) + ((AttackIndex - 1) * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
Dim ATDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
|
||||
FileGet(FileNum, ATDescp, Int32.Parse(((CurAttackDescriptionPointer)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
ATDescp = Sapp2Asc(ATDescp)
|
||||
ATDescp = Mid$(ATDescp, 1, InStr(1, ATDescp, "\x"))
|
||||
'AbDescp = Replace(AbDescp, "\n", vbCrLf)
|
||||
'AtDescp = Replace(RTrim$(AtDescp), "\", "")
|
||||
ATDescp = ATDescp & "x"
|
||||
AttackDescription = ATDescp
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
AttackData = ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "AttackData", "")), System.Globalization.NumberStyles.HexNumber)) + (AttackIndex * 12), 12)
|
||||
|
||||
WriteString(INIFileName, "Attack", "AttackName", GetAttackName(AttackIndex))
|
||||
WriteString(INIFileName, "Attack", "AttackData", AttackData)
|
||||
WriteString(INIFileName, "Attack", "AttackDescription", AttackDescription)
|
||||
|
||||
If header2 = "AXP" Or header2 = "AXV" Or header2 = "BPE" Then
|
||||
|
||||
ContestData = ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "ContestMoveData", "")), System.Globalization.NumberStyles.HexNumber)) + (AttackIndex * 8), 8)
|
||||
|
||||
WriteString(INIFileName, "Attack", "ContestData", ContestData)
|
||||
|
||||
Else
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ExportAseriesSheet(FileName As String, PokemonIndex As Integer)
|
||||
|
||||
Dim ExportBitMap As Bitmap
|
||||
|
||||
If header2 = "BPE" Then
|
||||
Dim destBitmap As New Bitmap(&H100, &H80)
|
||||
|
||||
BitmapBLT(GetNormalAnimationPokemonPicToBitmap(PokemonIndex), destBitmap, 0, 0, 0, 0, &H40, &H80)
|
||||
BitmapBLT(GetShinyAnimationPokemonPicToBitmap(PokemonIndex), destBitmap, &H40, 0, 0, 0, &H40, &H80)
|
||||
BitmapBLT(GetNormalBackPokemonPicToBitmap(PokemonIndex), destBitmap, &H80, 0, 0, 0, &H40, &H40)
|
||||
BitmapBLT(GetBackPokemonPicToBitmap(PokemonIndex), destBitmap, &HC0, 0, 0, 0, &H40, &H40)
|
||||
|
||||
ExportBitMap = destBitmap
|
||||
|
||||
Else
|
||||
Dim destBitmap2 As New Bitmap(&H100, &H40)
|
||||
|
||||
BitmapBLT(GetFrontPokemonPicToBitmap(PokemonIndex), destBitmap2, 0, 0, 0, 0, &H40, &H40)
|
||||
BitmapBLT(GetShinyFrontPokemonPicToBitmap(PokemonIndex), destBitmap2, &H40, 0, 0, 0, &H40, &H40)
|
||||
BitmapBLT(GetNormalBackPokemonPicToBitmap(PokemonIndex), destBitmap2, &H80, 0, 0, 0, &H40, &H40)
|
||||
BitmapBLT(GetBackPokemonPicToBitmap(PokemonIndex), destBitmap2, &HC0, 0, 0, 0, &H40, &H40)
|
||||
|
||||
ExportBitMap = destBitmap2
|
||||
|
||||
End If
|
||||
|
||||
ExportBitMap.Save(FileName)
|
||||
ExportBitMap.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ExportPokemonIcon(filename As String, PokemonIndex As Integer)
|
||||
|
||||
Dim bitout As Bitmap = GetAndDrawPokemonIconToBitmap(PokemonIndex, Int32.Parse(((ReadHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "IconPalTable", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex), 1))), System.Globalization.NumberStyles.HexNumber), True)
|
||||
|
||||
bitout.Save(filename)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ExportPokemonFootprint(filename As String, PokemonIndex As Integer)
|
||||
|
||||
Dim bitout As Bitmap = GetPokemonFootPrintToBitmap(PokemonIndex)
|
||||
|
||||
bitout.Save(filename)
|
||||
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
|
@ -159,6 +159,7 @@
|
|||
<Compile Include="BattleFrontierEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ChangeImageFunctions.vb" />
|
||||
<Compile Include="ChangeNameFunctions.vb" />
|
||||
<Compile Include="EggMoveEditor.Designer.vb">
|
||||
<DependentUpon>EggMoveEditor.vb</DependentUpon>
|
||||
|
|
@ -166,6 +167,7 @@
|
|||
<Compile Include="EggMoveEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ExportDataFunctions.vb" />
|
||||
<Compile Include="GetImageFunctions.vb" />
|
||||
<Compile Include="GetNameFunctions.vb" />
|
||||
<Compile Include="HabitatEditor.Designer.vb">
|
||||
|
|
@ -175,6 +177,7 @@
|
|||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HexFunctions.vb" />
|
||||
<Compile Include="ImportDataFunctions.vb" />
|
||||
<Compile Include="InputAttacks.Designer.vb">
|
||||
<DependentUpon>InputAttacks.vb</DependentUpon>
|
||||
</Compile>
|
||||
|
|
@ -269,6 +272,8 @@
|
|||
<Compile Include="TMHMEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WichuRomFunctions.vb" />
|
||||
<Compile Include="WichuSpriteFunctions.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="AbilityAdder.resx">
|
||||
|
|
|
|||
|
|
@ -193,6 +193,188 @@ Module GetImageFunctions
|
|||
|
||||
End Sub
|
||||
|
||||
Public Function GetFrontPokemonPicToBitmap(ByVal index As Integer, Optional ShowBackcolor As Boolean = True) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonFrontSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, ShowBackcolor)
|
||||
GetFrontPokemonPicToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetShinyFrontPokemonPicToBitmap(ByVal index As Integer, Optional ShowBackcolor As Boolean = True) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonFrontSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, ShowBackcolor)
|
||||
GetShinyFrontPokemonPicToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetFrontPokemonPicToByteArray(ByVal index As Integer) As Byte()
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonFrontSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, 0)
|
||||
LoadBitmapFromArray(Image, Palette32, bSprite, 64, 64)
|
||||
'bSprite = LoadSprite(Image, Palette32, 64, 64, 0)
|
||||
GetFrontPokemonPicToByteArray = SaveBitmapToArray(bSprite, Palette32)
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub GetAndDrawFrontPokemonPicBLACK(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonFrontSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
Palette32(1) = Color.Black
|
||||
Palette32(2) = Color.Black
|
||||
Palette32(3) = Color.Black
|
||||
Palette32(4) = Color.Black
|
||||
Palette32(5) = Color.Black
|
||||
Palette32(6) = Color.Black
|
||||
Palette32(7) = Color.Black
|
||||
Palette32(8) = Color.Black
|
||||
Palette32(9) = Color.Black
|
||||
Palette32(10) = Color.Black
|
||||
Palette32(11) = Color.Black
|
||||
Palette32(12) = Color.Black
|
||||
Palette32(13) = Color.Black
|
||||
Palette32(14) = Color.Black
|
||||
Palette32(15) = Color.Black
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, GetString(AppPath & "GBAPGESettings.ini", "Settings", "TransparentImages", "0"))
|
||||
picBox.Image = bSprite
|
||||
picBox.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub GetAndDrawFrontPokemonPicShiny(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonFrontSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, GetString(AppPath & "GBAPGESettings.ini", "Settings", "TransparentImages", "0"))
|
||||
picBox.Image = bSprite
|
||||
picBox.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub GetAndDrawBackPokemonPic(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonBackSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
|
|
@ -227,6 +409,106 @@ Module GetImageFunctions
|
|||
|
||||
End Sub
|
||||
|
||||
Public Function GetBackPokemonPicToBitmap(ByVal index As Integer, Optional ShowBackcolor As Boolean = True) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonBackSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, ShowBackcolor)
|
||||
GetBackPokemonPicToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetNormalBackPokemonPicToBitmap(ByVal index As Integer, Optional ShowBackcolor As Boolean = True) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonBackSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, ShowBackcolor)
|
||||
GetNormalBackPokemonPicToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub GetAndDrawBackPokemonPicNormal(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonBackSprites", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, GetString(AppPath & "GBAPGESettings.ini", "Settings", "TransparentImages", "0"))
|
||||
picBox.Image = bSprite
|
||||
picBox.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub GetAndDrawAnimationPokemonPic(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
|
|
@ -261,6 +543,139 @@ Module GetImageFunctions
|
|||
|
||||
End Sub
|
||||
|
||||
Public Function GetNormalAnimationPokemonPicToBitmap(ByVal index As Integer, Optional ShowBackcolor As Boolean = True) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 128, ShowBackcolor)
|
||||
GetNormalAnimationPokemonPicToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetShinyAnimationPokemonPicToBitmap(ByVal index As Integer, Optional ShowBackcolor As Boolean = True) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 128, ShowBackcolor)
|
||||
GetShinyAnimationPokemonPicToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetAnimationPicToByteArray(ByVal index As Integer) As Byte()
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonNormalPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 128, 0)
|
||||
LoadBitmapFromArray(Image, Palette32, bSprite, 64, 128)
|
||||
'bSprite = LoadSprite(Image, Palette32, 64, 64, 0)
|
||||
GetAnimationPicToByteArray = SaveBitmapToArray(bSprite, Palette32)
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub GetAndDrawAnimationPokemonPicShiny(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonAnimations", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "PokemonShinyPal", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 128, GetString(AppPath & "GBAPGESettings.ini", "Settings", "TransparentImages", "0"))
|
||||
picBox.Image = bSprite
|
||||
picBox.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub GetAndDrawShadowAnimationPokemonPic(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "ShadowFronts", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon front sprites, + 8 = Bulbasaur.
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "ShadowPals", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8) 'Pointer to Pokemon normal palettes, + 8 = Bulbasaur.
|
||||
|
|
@ -432,7 +847,7 @@ ErrorHandle:
|
|||
End Function
|
||||
|
||||
Public Sub GetAndDrawPokemonIconPic(ByVal picBox As PictureBox, ByVal index As Integer, ByVal palindex As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable", ""), System.Globalization.NumberStyles.HexNumber) + (4 + (index * 4))
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable", ""), System.Globalization.NumberStyles.HexNumber) + ((index * 4))
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPals", ""), System.Globalization.NumberStyles.HexNumber) + (palindex * 32)
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
|
|
@ -466,13 +881,44 @@ ErrorHandle:
|
|||
|
||||
End Sub
|
||||
|
||||
Public Function GetAndDrawPokemonIconToBitmap(ByVal index As Integer, ByVal palindex As Integer, Optional ShowBackColor As Boolean = False) As Bitmap
|
||||
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable", ""), System.Globalization.NumberStyles.HexNumber) + ((index * 4))
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPals", ""), System.Globalization.NumberStyles.HexNumber) + (palindex * 32)
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
'LZ77UnComp(Temp, Image)
|
||||
Image = Temp
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
'fs.Position = pOffset
|
||||
'pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
'LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Temp)
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 32, 64, ShowBackColor)
|
||||
GetAndDrawPokemonIconToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Function Load2BPSprite16By16(ByRef Bits() As Byte, ByVal Palette() As Color) As Bitmap
|
||||
On Error GoTo ErrorHandle
|
||||
Dim x1 As Integer, y1 As Integer
|
||||
Dim x2 As Integer, y2 As Integer
|
||||
|
||||
Dim bmpTiles As New Bitmap(16, 16)
|
||||
Dim Temp As Byte
|
||||
Dim i As Integer
|
||||
|
||||
Dim sideways As Integer = 0
|
||||
Dim updown As Integer = 0
|
||||
|
|
@ -595,7 +1041,7 @@ ErrorHandle:
|
|||
End Using
|
||||
End Using
|
||||
|
||||
Palette32(0) = Color.White
|
||||
Palette32(0) = Color.Transparent
|
||||
Palette32(1) = Color.Black
|
||||
|
||||
bSprite = Load2BPSprite16By16(Image, Palette32)
|
||||
|
|
@ -604,4 +1050,78 @@ ErrorHandle:
|
|||
|
||||
End Sub
|
||||
|
||||
Public Function GetPokemonFootPrintToBitmap(ByVal index As Integer) As Bitmap
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "FootPrintTable", ""), System.Globalization.NumberStyles.HexNumber) + ((index * 4))
|
||||
Dim Temp(&HFF) As Byte
|
||||
Dim Image(&HFF) As Byte
|
||||
Dim Palette32(1) As Color
|
||||
Dim bSprite As Bitmap
|
||||
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFF)
|
||||
Image = Temp
|
||||
End Using
|
||||
End Using
|
||||
|
||||
Palette32(0) = Color.Transparent
|
||||
Palette32(1) = Color.Black
|
||||
|
||||
bSprite = Load2BPSprite16By16(Image, Palette32)
|
||||
GetPokemonFootPrintToBitmap = bSprite
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub GetAndDrawTrainerPicBLACK(ByVal picBox As PictureBox, ByVal index As Integer)
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "TrainerImageTable", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8)
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "TrainerPaletteTable", ""), System.Globalization.NumberStyles.HexNumber) + (index * 8)
|
||||
Dim Temp(&HFFF) As Byte
|
||||
Dim Image(&HFFFF) As Byte
|
||||
Dim Palette15(&HFFF) As Byte
|
||||
Dim Palette32() As Color
|
||||
Dim bSprite As Bitmap
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = sOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Image)
|
||||
|
||||
ReDim Temp(&HFFF)
|
||||
fs.Position = pOffset
|
||||
pOffset = r.ReadInt32 - &H8000000
|
||||
fs.Position = pOffset
|
||||
r.Read(Temp, 0, &HFFF)
|
||||
LZ77UnComp(Temp, Palette15)
|
||||
|
||||
Palette32 = LoadPalette(Palette15)
|
||||
Palette32(1) = Color.Black
|
||||
Palette32(2) = Color.Black
|
||||
Palette32(3) = Color.Black
|
||||
Palette32(4) = Color.Black
|
||||
Palette32(5) = Color.Black
|
||||
Palette32(6) = Color.Black
|
||||
Palette32(7) = Color.Black
|
||||
Palette32(8) = Color.Black
|
||||
Palette32(9) = Color.Black
|
||||
Palette32(10) = Color.Black
|
||||
Palette32(11) = Color.Black
|
||||
Palette32(12) = Color.Black
|
||||
Palette32(13) = Color.Black
|
||||
Palette32(14) = Color.Black
|
||||
Palette32(15) = Color.Black
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
bSprite = LoadSprite(Image, Palette32, 64, 64, GetString(AppPath & "GBAPGESettings.ini", "Settings", "TransparentImages", "0"))
|
||||
picBox.Image = bSprite
|
||||
picBox.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
|
|
|||
1
GBAPokemonGameEditor/HabitatEditor.Designer.vb
generated
|
|
@ -198,7 +198,6 @@ Partial Class HabitatEditor
|
|||
'
|
||||
'ComboBox1
|
||||
'
|
||||
Me.ComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.ComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.ComboBox1.FormattingEnabled = True
|
||||
Me.ComboBox1.Location = New System.Drawing.Point(12, 265)
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ ErrHandle:
|
|||
FileClose(iFile)
|
||||
Exit Function
|
||||
ErrHandle:
|
||||
MsgBox(Err.Description, MsgBoxStyle.OKOnly, "Error: " & Err.Number)
|
||||
MsgBox(Err.Description, MsgBoxStyle.OkOnly, "Error: " & Err.Number)
|
||||
|
||||
End Function
|
||||
End Module
|
||||
|
|
@ -34,6 +34,12 @@
|
|||
If intCharCount > 0 Then GetString =
|
||||
Left(objResult.ToString, intCharCount)
|
||||
|
||||
|
||||
'This should probably be commented out if used for another program!
|
||||
If GetString = "" And GetINIFileLocation() = strFilename Then
|
||||
OutPutError("Error! " & Key & " is missing for ROM " & Section & "!")
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Public Function WriteString(ByVal strFilename As String, ByVal Section As String, _
|
||||
|
|
|
|||
729
GBAPokemonGameEditor/ImportDataFunctions.vb
Normal file
|
|
@ -0,0 +1,729 @@
|
|||
Imports System.IO
|
||||
Imports System.Windows.Forms.Application
|
||||
Imports System.Net
|
||||
Imports VB = Microsoft.VisualBasic
|
||||
Module ImportDataFunctions
|
||||
|
||||
Private FrontPalette As Color() = New Color(&H11 - 1) {}
|
||||
Private BackPalette As Color() = New Color(&H11 - 1) {}
|
||||
|
||||
Private FrontSprite As Byte()
|
||||
Private BackSprite As Byte()
|
||||
|
||||
Private AnimationNormalPalette As Color() = New Color(&H11 - 1) {}
|
||||
Private AnimationShinyPalette As Color() = New Color(&H11 - 1) {}
|
||||
|
||||
Private AnimationNormalSprite As Byte()
|
||||
Private AnimationShinySprite As Byte()
|
||||
|
||||
Public Sub ImportPokemonINI(INIFileName As String, PokemonIndex As Integer)
|
||||
|
||||
'Declare vars
|
||||
|
||||
Dim BaseStats As String
|
||||
|
||||
Dim PlayerY As String
|
||||
Dim EnemyY As String
|
||||
Dim EnemyAlt As String
|
||||
|
||||
Dim ItemAnimation As String = ""
|
||||
|
||||
Dim EvolutionData As String
|
||||
|
||||
Dim lvlupattacksoffset As String = ""
|
||||
Dim lvlupattacks As String = ""
|
||||
|
||||
Dim MoveTutorCompatibility As String = ""
|
||||
|
||||
Dim TMHMCompatibility As String
|
||||
|
||||
Dim NationalDexNumber As String
|
||||
Dim SecondDexNumber As String
|
||||
|
||||
Dim Pointer1 As String = ""
|
||||
Dim PokedexDescription As String = ""
|
||||
Dim PokedexDescriptionOff As String = ""
|
||||
Dim Hght As String = ""
|
||||
Dim Wght As String = ""
|
||||
Dim Scale1 As String = ""
|
||||
Dim Scale2 As String = ""
|
||||
Dim Offset_1 As String = ""
|
||||
Dim Offset_2 As String = ""
|
||||
Dim PokedexType As String = ""
|
||||
|
||||
|
||||
'Load data
|
||||
|
||||
ChangePokemonName(PokemonIndex, GetString(INIFileName, "Pokemon", "PokemonName", "?"))
|
||||
|
||||
BaseStats = GetString(INIFileName, "Pokemon", "BaseStats", "2D31312D41410C032D400001000000001F1446030107410000030000")
|
||||
|
||||
PlayerY = GetString(INIFileName, "Pokemon", "PlayerY", "00")
|
||||
EnemyY = GetString(INIFileName, "Pokemon", "EnemyY", "00")
|
||||
EnemyAlt = GetString(INIFileName, "Pokemon", "EnemyAlt", "00")
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Then
|
||||
ItemAnimation = GetString(INIFileName, "Pokemon", "ItemAnimation", "161B301629")
|
||||
End If
|
||||
|
||||
EvolutionData = GetString(INIFileName, "Pokemon", "EvolutionData", MakeFreeSpaceString((8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", ""))), "00"))
|
||||
|
||||
If (Len(EvolutionData) / 2) > (8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", ""))) Then
|
||||
EvolutionData = EvolutionData.Remove((8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", ""))) * 2)
|
||||
End If
|
||||
|
||||
If GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "False" Then
|
||||
lvlupattacks = GetString(INIFileName, "Pokemon", "LevelUpAttacksOriginal", "2102FFFF0000")
|
||||
ElseIf GetString(GetINIFileLocation(), header, "MoveTableHack", "False") = "True" Then
|
||||
lvlupattacks = GetString(INIFileName, "Pokemon", "LevelUpAttacksJambo51", "2100010000FF00")
|
||||
End If
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
|
||||
MoveTutorCompatibility = GetString(INIFileName, "Pokemon", "MoveTutorCompatibility", MakeFreeSpaceString((((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8)), "00"))
|
||||
|
||||
If (Len(MoveTutorCompatibility) / 2) > (((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8)) Then
|
||||
MoveTutorCompatibility = MoveTutorCompatibility.Remove((((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8) * 2))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
TMHMCompatibility = GetString(INIFileName, "Pokemon", "TMHMCompatibility", MakeFreeSpaceString((Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", ""))), "00"))
|
||||
|
||||
If (Len(TMHMCompatibility) / 2) > (Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", ""))) Then
|
||||
TMHMCompatibility = TMHMCompatibility.Remove((Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", ""))) * 2)
|
||||
End If
|
||||
|
||||
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
|
||||
|
||||
NationalDexNumber = GetString(INIFileName, "Pokemon", "NationalDexNumber", "0")
|
||||
SecondDexNumber = GetString(INIFileName, "Pokemon", "SecondDexNumber", "0")
|
||||
|
||||
If NationalDexNumber < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
|
||||
PokedexDescription = Asc2Sapp(GetString(INIFileName, "Pokemon", "PokedexDescription", "Description\x")) & " "
|
||||
Hght = GetString(INIFileName, "Pokemon", "Hght", "1")
|
||||
Wght = GetString(INIFileName, "Pokemon", "Wght", "1")
|
||||
Scale1 = GetString(INIFileName, "Pokemon", "Scale1", "256")
|
||||
Scale2 = GetString(INIFileName, "Pokemon", "Scale2", "256")
|
||||
Offset_1 = GetString(INIFileName, "Pokemon", "Offset_1", "0")
|
||||
Offset_2 = GetString(INIFileName, "Pokemon", "Offset_2", "0")
|
||||
PokedexType = GetString(INIFileName, "Pokemon", "PokedexType", "Seed")
|
||||
End If
|
||||
|
||||
'Write data to ROM.
|
||||
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonData", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 28), BaseStats)
|
||||
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PlayerYTable", "")), System.Globalization.NumberStyles.HexNumber)) + 1 + (PokemonIndex * 4), PlayerY)
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "EnemyYTable", "")), System.Globalization.NumberStyles.HexNumber)) + 1 + (PokemonIndex * 4), EnemyY)
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "EnemyAltitudeTable", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 1), EnemyAlt)
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Then
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "ItemAnimationTable", "")), System.Globalization.NumberStyles.HexNumber) + ((PokemonIndex - 1) * 5), ItemAnimation)
|
||||
End If
|
||||
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonEvolutions", "")), System.Globalization.NumberStyles.HexNumber)) + ((PokemonIndex) * (8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", "")))), EvolutionData)
|
||||
|
||||
lvlupattacksoffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(lvlupattacks) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
WriteHEX(LoadedROM, lvlupattacksoffset, lvlupattacks)
|
||||
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonAttackTable", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 4), ReverseHEX(Hex(((lvlupattacksoffset)) + &H8000000)))
|
||||
|
||||
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "MoveTutorCompatibility", "")), System.Globalization.NumberStyles.HexNumber) + (((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8)) + ((PokemonIndex - 1) * (((Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", ""))) / 8))), MoveTutorCompatibility)
|
||||
End If
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "TMHMCompatibility", "")), System.Globalization.NumberStyles.HexNumber) + (PokemonIndex * (Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", "")))), TMHMCompatibility)
|
||||
|
||||
If NationalDexNumber < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
|
||||
|
||||
If header2 = "AXP" Or header2 = "AXV" Then
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 2 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght), 4)))
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 30 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 32 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2), 4)))
|
||||
|
||||
ElseIf header2 = "BPR" Or header2 = "BPG" Then
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 2 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght), 4)))
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 30 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 32 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2), 4)))
|
||||
|
||||
|
||||
PokedexDescriptionOff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(PokedexDescription)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
FileNum = FreeFile()
|
||||
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FilePut(FileNum, PokedexDescription, ("&H" & Hex(PokedexDescriptionOff)) + 1, False)
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 4 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(Hex(Val("&H" & (Hex(PokedexDescriptionOff))) + &H8000000)))
|
||||
|
||||
|
||||
ElseIf header2 = "BPE" Then
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 2 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght), 4)))
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 22 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 24 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2), 4)))
|
||||
|
||||
|
||||
PokedexDescriptionOff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(PokedexDescription)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
FileNum = FreeFile()
|
||||
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FilePut(FileNum, PokedexDescription, ("&H" & Hex(PokedexDescriptionOff)) + 1, False)
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 4 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(Hex(Val("&H" & (Hex(PokedexDescriptionOff))) + &H8000000)))
|
||||
|
||||
|
||||
End If
|
||||
|
||||
ChangePokedexTypeName(NationalDexNumber, PokedexType)
|
||||
|
||||
End If
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((PokemonIndex - 1) * 2), ReverseHEX(VB.Right("0000" & Hex(NationalDexNumber), 4)))
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "SecondDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((PokemonIndex - 1) * 2), ReverseHEX(VB.Right("0000" & Hex(SecondDexNumber), 4)))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ImportAbilityINI(INIFileName As String, AbilityIndex As Integer)
|
||||
|
||||
Dim AbilityDescriptionTable As Integer
|
||||
Dim CurAbilityDescriptionPointer As String
|
||||
Dim destowrite As String
|
||||
|
||||
AbilityDescriptionTable = Int32.Parse((GetString(GetINIFileLocation(), header, "AbilityDescriptionTable", "")), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
CurAbilityDescriptionPointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AbilityDescriptionTable) + (AbilityIndex * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
Dim AbDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
|
||||
FileGet(FileNum, AbDescp, Int32.Parse(((CurAbilityDescriptionPointer)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
AbDescp = Sapp2Asc(AbDescp)
|
||||
AbDescp = Mid$(AbDescp, 1, InStr(1, AbDescp, "\x"))
|
||||
'AbDescp = Replace(AbDescp, "\n", vbCrLf)
|
||||
'AbDescp = Replace(RTrim$(AbDescp), "\", "")
|
||||
AbDescp = AbDescp & "x"
|
||||
FileClose(FileNum)
|
||||
|
||||
ChangeAbilityName(AbilityIndex, GetString(INIFileName, "Ability", "AbilityName", "STENCH"))
|
||||
|
||||
If Len(Asc2Sapp(AbDescp)) < Len(Asc2Sapp(GetString(INIFileName, "Ability", "AbilityDescription", "Description"))) Then
|
||||
|
||||
destowrite = Asc2Sapp(GetString(INIFileName, "Ability", "AbilityDescription", "Description"))
|
||||
|
||||
|
||||
Dim newtextoff As String
|
||||
|
||||
newtextoff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(destowrite & " ")), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
FileNum = FreeFile()
|
||||
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FilePut(FileNum, destowrite & " ", ("&H" & Hex(newtextoff)) + 1, False)
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
WriteHEX(LoadedROM, (AbilityDescriptionTable) + (AbilityIndex * 4), ReverseHEX(Hex(Val("&H" & Hex(newtextoff)) + &H8000000)))
|
||||
|
||||
Else
|
||||
|
||||
destowrite = Asc2Sapp(GetString(INIFileName, "Ability", "AbilityDescription", "Description"))
|
||||
|
||||
FileNum = FreeFile()
|
||||
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FilePut(FileNum, destowrite, ("&H" & CurAbilityDescriptionPointer) + 1, False)
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ImportAttackINI(INIFileName As String, AttackIndex As Integer)
|
||||
|
||||
Dim AttackData As String
|
||||
Dim AttackDescriptionTable As Integer
|
||||
Dim CurAttackDescriptionPointer As String
|
||||
Dim destowrite As String
|
||||
Dim ContestMoveData As String
|
||||
|
||||
AttackDescriptionTable = Int32.Parse((GetString(GetINIFileLocation(), header, "AttackDescriptionTable", "")), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
CurAttackDescriptionPointer = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, (AttackDescriptionTable) + ((AttackIndex - 1) * 4), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
|
||||
|
||||
FileNum = FreeFile()
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
Dim ATDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
|
||||
FileGet(FileNum, ATDescp, Int32.Parse(((CurAttackDescriptionPointer)), System.Globalization.NumberStyles.HexNumber) + 1, True)
|
||||
ATDescp = Sapp2Asc(ATDescp)
|
||||
ATDescp = Mid$(ATDescp, 1, InStr(1, ATDescp, "\x"))
|
||||
'AbDescp = Replace(AbDescp, "\n", vbCrLf)
|
||||
'ATDescp = Replace(RTrim$(ATDescp), "\", "")
|
||||
ATDescp = ATDescp & "x"
|
||||
FileClose(FileNum)
|
||||
|
||||
ChangeAttackName(AttackIndex, GetString(INIFileName, "Attack", "AttackName", "?"))
|
||||
|
||||
AttackData = GetString(INIFileName, "Attack", "AttackData", "002800642300000033000000")
|
||||
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "AttackData", "")), System.Globalization.NumberStyles.HexNumber)) + (AttackIndex * 12), AttackData)
|
||||
|
||||
|
||||
If Len(Asc2Sapp(ATDescp)) < Len(Asc2Sapp(GetString(INIFileName, "Attack", "AttackDescription", "Description"))) Then
|
||||
|
||||
destowrite = Asc2Sapp(GetString(INIFileName, "Attack", "AttackDescription", "Description"))
|
||||
|
||||
|
||||
Dim newtextoff As String
|
||||
|
||||
newtextoff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(destowrite & " ")), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
FileNum = FreeFile()
|
||||
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FilePut(FileNum, destowrite & " ", ("&H" & Hex(newtextoff)) + 1, False)
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
WriteHEX(LoadedROM, (AttackDescriptionTable) + ((AttackIndex - 1) * 4), ReverseHEX(Hex(Val("&H" & Hex(newtextoff)) + &H8000000)))
|
||||
|
||||
Else
|
||||
|
||||
destowrite = Asc2Sapp(GetString(INIFileName, "Attack", "AttackDescription", "Description"))
|
||||
|
||||
FileNum = FreeFile()
|
||||
|
||||
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
|
||||
|
||||
FilePut(FileNum, destowrite, ("&H" & CurAttackDescriptionPointer) + 1, False)
|
||||
|
||||
FileClose(FileNum)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If header2 = "AXP" Or header2 = "AXV" Or header2 = "BPE" Then
|
||||
|
||||
ContestMoveData = GetString(INIFileName, "Attack", "ContestData", "0000000000000000")
|
||||
|
||||
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "ContestMoveData", "")), System.Globalization.NumberStyles.HexNumber)) + (AttackIndex * 8), ContestMoveData)
|
||||
|
||||
Else
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ImportAseriesSheet(FileName As String, PokemonIndex As Integer)
|
||||
|
||||
Dim mainbitmap As New Bitmap(FileName)
|
||||
|
||||
FrontSprite = GetFrontPokemonPicToByteArray(PokemonIndex)
|
||||
BackSprite = GetFrontPokemonPicToByteArray(PokemonIndex)
|
||||
|
||||
Dim ONormalBackBitmap As Bitmap = New Bitmap(&H40, &H40)
|
||||
Dim ONormalFrontBitmap As Bitmap = New Bitmap(&H40, &H40)
|
||||
Dim OShinyBackBitmap As Bitmap = New Bitmap(&H40, &H40)
|
||||
Dim OShinyFrontBitmap As Bitmap = New Bitmap(&H40, &H40)
|
||||
|
||||
Dim LoadAnimationFlag As Boolean = False
|
||||
|
||||
Dim ONormalBackBitmapAnimation As Bitmap = New Bitmap(&H40, &H40)
|
||||
Dim ONormalFrontBitmapAnimation As Bitmap = New Bitmap(&H40, &H80)
|
||||
Dim OShinyBackBitmapAnimation As Bitmap = New Bitmap(&H40, &H40)
|
||||
Dim OShinyFrontBitmapAnimation As Bitmap = New Bitmap(&H40, &H80)
|
||||
|
||||
If header2 = "BPE" Then
|
||||
|
||||
AnimationNormalSprite = GetAnimationPicToByteArray(PokemonIndex)
|
||||
AnimationShinySprite = GetAnimationPicToByteArray(PokemonIndex)
|
||||
|
||||
If mainbitmap.Height = 64 And mainbitmap.Width = 256 Then
|
||||
|
||||
'MsgBox("The Animation seems to be missing. Sheet will be loaded without animations.")
|
||||
|
||||
ElseIf mainbitmap.Height = 128 And mainbitmap.Width = 256 Then
|
||||
LoadAnimationFlag = True
|
||||
Else
|
||||
|
||||
MsgBox("The dimensions of the file" & FileName & " does not seem correct. Aborting...")
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
If mainbitmap.Height = 64 And mainbitmap.Width = 256 Then
|
||||
ElseIf mainbitmap.Height = 128 And mainbitmap.Width = 256 Then
|
||||
|
||||
'MsgBox("Sheet contains animation. The animation will not be loaded for this ROM.")
|
||||
|
||||
Else
|
||||
MsgBox("The dimensions of the file" & FileName & " does not seem correct. Aborting...")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
BitmapBLT(mainbitmap, ONormalFrontBitmap, 0, 0, 0, 0, &H40, &H40, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
BitmapBLT(mainbitmap, OShinyFrontBitmap, 0, 0, &H40, 0, &H40, &H40, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
BitmapBLT(mainbitmap, ONormalBackBitmap, 0, 0, &H80, 0, &H40, &H40, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
BitmapBLT(mainbitmap, OShinyBackBitmap, 0, 0, &HC0, 0, &H40, &H40, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
|
||||
If LoadAnimationFlag = True Then
|
||||
BitmapBLT(mainbitmap, ONormalFrontBitmapAnimation, 0, 0, 0, 0, &H40, &H80, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
BitmapBLT(mainbitmap, OShinyFrontBitmapAnimation, 0, 0, &H40, 0, &H40, &H80, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
BitmapBLT(mainbitmap, ONormalBackBitmapAnimation, 0, 0, &H80, 0, &H40, &H40, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
BitmapBLT(mainbitmap, OShinyBackBitmapAnimation, 0, 0, &HC0, 0, &H40, &H40, Color.FromArgb(&HFF, 200, 200, &HA8))
|
||||
|
||||
End If
|
||||
|
||||
'synchpals
|
||||
|
||||
Dim num As Byte
|
||||
Dim palcolor As Color
|
||||
Dim flag As Boolean = False
|
||||
|
||||
Array.Clear(FrontPalette, 0, &H10)
|
||||
Array.Clear(BackPalette, 0, &H10)
|
||||
|
||||
If LoadAnimationFlag = True Then
|
||||
Array.Clear(AnimationNormalPalette, 0, &H10)
|
||||
Array.Clear(AnimationShinyPalette, 0, &H10)
|
||||
|
||||
End If
|
||||
|
||||
Dim num11 As Integer = ((1 * &H40) - 1)
|
||||
Dim ivar As UInteger = 0
|
||||
Do While (ivar <= num11)
|
||||
Dim num3 As UInteger = 0
|
||||
Do
|
||||
palcolor = GetQuantizedPixel(ONormalFrontBitmap, num3, ivar)
|
||||
If Not Enumerable.Contains(Of Color)(FrontPalette, palcolor) Then
|
||||
FrontPalette(num) = palcolor
|
||||
BackPalette(num) = GetQuantizedPixel(OShinyFrontBitmap, num3, ivar)
|
||||
num = ((num + 1))
|
||||
If (num > 15) Then
|
||||
flag = True
|
||||
Exit Do
|
||||
End If
|
||||
End If
|
||||
num3 += 1
|
||||
Loop While (num3 <= &H3F)
|
||||
If flag Then
|
||||
Exit Do
|
||||
End If
|
||||
ivar += 1
|
||||
Loop
|
||||
|
||||
Dim num12 As Integer = ((1 * &H40) - 1)
|
||||
Dim j As UInteger = 0
|
||||
Do While (j <= num12)
|
||||
Dim num5 As UInteger = 0
|
||||
Do
|
||||
palcolor = GetQuantizedPixel(ONormalBackBitmap, num5, j)
|
||||
If Not Enumerable.Contains(Of Color)(FrontPalette, palcolor) Then
|
||||
FrontPalette(num) = palcolor
|
||||
BackPalette(num) = GetQuantizedPixel(OShinyBackBitmap, num5, j)
|
||||
num = ((num + 1))
|
||||
If (num > 15) Then
|
||||
flag = True
|
||||
Exit Do
|
||||
End If
|
||||
End If
|
||||
num5 += 1
|
||||
Loop While (num5 <= &H3F)
|
||||
If flag Then
|
||||
Exit Do
|
||||
End If
|
||||
j += 1
|
||||
Loop
|
||||
|
||||
Dim num13 As Integer = ((1 * &H40) - 1)
|
||||
Dim k As UInteger = 0
|
||||
Do While (k <= num13)
|
||||
Dim num7 As UInteger = 0
|
||||
Do
|
||||
palcolor = GetQuantizedPixel(OShinyFrontBitmap, num7, k)
|
||||
If Not Enumerable.Contains(Of Color)(BackPalette, palcolor) Then
|
||||
BackPalette(num) = palcolor
|
||||
FrontPalette(num) = GetQuantizedPixel(ONormalFrontBitmap, num7, k)
|
||||
num = CByte((num + 1))
|
||||
If (num > 15) Then
|
||||
flag = True
|
||||
Exit Do
|
||||
End If
|
||||
End If
|
||||
num7 += 1
|
||||
Loop While (num7 <= &H3F)
|
||||
If flag Then
|
||||
Exit Do
|
||||
End If
|
||||
k += 1
|
||||
Loop
|
||||
|
||||
Dim num14 As Integer = ((1 * &H40) - 1)
|
||||
Dim m As UInteger = 0
|
||||
Do While (m <= num14)
|
||||
Dim num9 As UInteger = 0
|
||||
Do
|
||||
palcolor = GetQuantizedPixel(OShinyBackBitmap, num9, m)
|
||||
If Not Enumerable.Contains(Of Color)(BackPalette, palcolor) Then
|
||||
BackPalette(num) = palcolor
|
||||
FrontPalette(num) = GetQuantizedPixel(ONormalBackBitmap, num9, m)
|
||||
num = CByte((num + 1))
|
||||
If (num > 15) Then
|
||||
flag = True
|
||||
Exit Do
|
||||
End If
|
||||
End If
|
||||
num9 += 1
|
||||
Loop While (num9 <= &H3F)
|
||||
If flag Then
|
||||
Exit Do
|
||||
End If
|
||||
m += 1
|
||||
Loop
|
||||
|
||||
Dim n As Integer = num
|
||||
Do While (n <= 15)
|
||||
FrontPalette(n) = Color.Black
|
||||
BackPalette(n) = Color.Black
|
||||
n += 1
|
||||
Loop
|
||||
|
||||
If LoadAnimationFlag = True Then
|
||||
AnimationNormalPalette = FrontPalette
|
||||
AnimationShinyPalette = BackPalette
|
||||
End If
|
||||
|
||||
ConvertBitmapToPalette(ONormalFrontBitmap, FrontPalette, True)
|
||||
ConvertBitmapToPalette(OShinyFrontBitmap, BackPalette, True)
|
||||
ConvertBitmapToPalette(ONormalBackBitmap, FrontPalette, True)
|
||||
ConvertBitmapToPalette(OShinyBackBitmap, BackPalette, True)
|
||||
|
||||
If LoadAnimationFlag = True Then
|
||||
ConvertBitmapToPalette(ONormalFrontBitmapAnimation, AnimationNormalPalette, True)
|
||||
ConvertBitmapToPalette(OShinyFrontBitmapAnimation, AnimationShinyPalette, True)
|
||||
ConvertBitmapToPalette(ONormalBackBitmapAnimation, AnimationNormalPalette, True)
|
||||
ConvertBitmapToPalette(OShinyBackBitmapAnimation, AnimationShinyPalette, True)
|
||||
End If
|
||||
|
||||
SynchSprite(FrontSprite, ONormalFrontBitmap, OShinyFrontBitmap)
|
||||
SynchSprite(BackSprite, ONormalBackBitmap, OShinyBackBitmap)
|
||||
|
||||
If LoadAnimationFlag = True Then
|
||||
SynchSprite2(AnimationNormalSprite, ONormalFrontBitmapAnimation, OShinyFrontBitmapAnimation)
|
||||
End If
|
||||
|
||||
mainbitmap.Dispose()
|
||||
|
||||
SaveFrontSpriteToFreeSpace(PokemonIndex, FrontSprite, FrontPalette)
|
||||
SaveBackSpriteToFreeSpace(PokemonIndex, BackSprite, BackPalette)
|
||||
|
||||
If LoadAnimationFlag = True Then
|
||||
SaveAnimationSpriteToFreeSpace(PokemonIndex, AnimationNormalSprite)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SynchSprite(ByRef SpriteArray As Byte(), ByRef NormalSprite As Bitmap, ByRef ShinySprite As Bitmap)
|
||||
Dim num11 As Double = ((CDbl(SpriteArray.Length) / 256) - 1)
|
||||
Dim i As Double = 0
|
||||
Do While (i <= num11)
|
||||
Dim num8 As Integer = 0
|
||||
Do
|
||||
Dim num9 As Integer = 0
|
||||
Do
|
||||
Dim num10 As Integer = 0
|
||||
Do
|
||||
Dim num3 As Byte
|
||||
Dim num4 As UInt32
|
||||
Dim index As Byte = CByte(Array.IndexOf(Of Color)(FrontPalette, NormalSprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
Dim num2 As Byte = CByte(Array.IndexOf(Of Color)(FrontPalette, NormalSprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
Dim num5 As Byte = CByte(Array.IndexOf(Of Color)(BackPalette, ShinySprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
Dim num6 As Byte = CByte(Array.IndexOf(Of Color)(BackPalette, ShinySprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
If (num5 > index) Then
|
||||
num3 = num5
|
||||
Else
|
||||
num3 = index
|
||||
End If
|
||||
If (num6 > num2) Then
|
||||
num3 = CByte((num3 Or CByte((num6 << 4))))
|
||||
Else
|
||||
num3 = CByte((num3 Or CByte((num2 << 4))))
|
||||
End If
|
||||
SpriteArray(num4) = num3
|
||||
Dim addvar As UInteger = 1
|
||||
num4 = (num4 + addvar)
|
||||
num10 += 1
|
||||
Loop While (num10 <= 3)
|
||||
num9 += 1
|
||||
Loop While (num9 <= 7)
|
||||
num8 += 1
|
||||
Loop While (num8 <= 7)
|
||||
i += 1
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Private Sub SynchSprite2(ByRef SpriteArray As Byte(), ByRef NormalSprite As Bitmap, ByRef ShinySprite As Bitmap)
|
||||
Dim num11 As Double = ((CDbl(SpriteArray.Length) / 256) - 1)
|
||||
Dim i As Double = 0
|
||||
Do While (i <= num11)
|
||||
Dim num8 As Integer = 0
|
||||
Do
|
||||
Dim num9 As Integer = 0
|
||||
Do
|
||||
Dim num10 As Integer = 0
|
||||
Do
|
||||
Dim num3 As Byte
|
||||
Dim num4 As UInt32
|
||||
Dim index As Byte = CByte(Array.IndexOf(Of Color)(AnimationNormalPalette, NormalSprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
Dim num2 As Byte = CByte(Array.IndexOf(Of Color)(AnimationNormalPalette, NormalSprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
Dim num5 As Byte = CByte(Array.IndexOf(Of Color)(AnimationShinyPalette, ShinySprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
Dim num6 As Byte = CByte(Array.IndexOf(Of Color)(AnimationShinyPalette, ShinySprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9)))))))
|
||||
If (num5 > index) Then
|
||||
num3 = num5
|
||||
Else
|
||||
num3 = index
|
||||
End If
|
||||
If (num6 > num2) Then
|
||||
num3 = CByte((num3 Or CByte((num6 << 4))))
|
||||
Else
|
||||
num3 = CByte((num3 Or CByte((num2 << 4))))
|
||||
End If
|
||||
SpriteArray(num4) = num3
|
||||
Dim addvar As UInteger = 1
|
||||
num4 = (num4 + addvar)
|
||||
num10 += 1
|
||||
Loop While (num10 <= 3)
|
||||
num9 += 1
|
||||
Loop While (num9 <= 7)
|
||||
num8 += 1
|
||||
Loop While (num8 <= 7)
|
||||
i += 1
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Sub ImportPokemonIcon(filename As String, PokemonIndex As Integer)
|
||||
|
||||
Dim iconpals(2)() As Color
|
||||
|
||||
Dim importimg As New Bitmap(filename)
|
||||
|
||||
|
||||
If importimg.Height <> &H40 Or importimg.Width <> &H20 Then
|
||||
|
||||
MsgBox("Image dimensions must be 32 by 64! Aborting...")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim palval As Integer
|
||||
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable", ""), System.Globalization.NumberStyles.HexNumber) + (PokemonIndex * 4)
|
||||
|
||||
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPals", ""), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
Dim hexstring As String = ""
|
||||
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
|
||||
fs.Position = pOffset
|
||||
|
||||
Dim indexvar As Integer = 0
|
||||
|
||||
Do
|
||||
iconpals(indexvar) = LoadPaletteFromROM(fs)
|
||||
indexvar += 1
|
||||
Loop While (indexvar <= 2)
|
||||
|
||||
fs.Close()
|
||||
r.Close()
|
||||
|
||||
End Using
|
||||
End Using
|
||||
|
||||
palval = GetClosestPalette(importimg, iconpals)
|
||||
|
||||
ConvertBitmapToPalette(importimg, iconpals(palval), True)
|
||||
|
||||
hexstring = ByteArrayToHexString(SaveBitmapToArray(importimg, iconpals(palval)))
|
||||
|
||||
WriteHEX(LoadedROM, sOffset, hexstring)
|
||||
|
||||
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "IconPalTable", "")), System.Globalization.NumberStyles.HexNumber) + PokemonIndex, Hex(palval))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ImportPokemonFootPrint(filename As String, PokemonIndex As Integer)
|
||||
|
||||
Dim importimg As New Bitmap(filename)
|
||||
|
||||
|
||||
If importimg.Height <> 16 Or importimg.Width <> 16 Then
|
||||
|
||||
MsgBox("Image dimensions must be 16 by 16! Aborting...")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "FootPrintTable", ""), System.Globalization.NumberStyles.HexNumber) + (PokemonIndex * 4)
|
||||
|
||||
Dim hexstring As String = ""
|
||||
|
||||
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
|
||||
Using r As New BinaryReader(fs)
|
||||
|
||||
fs.Position = sOffset
|
||||
sOffset = r.ReadInt32 - &H8000000
|
||||
|
||||
|
||||
fs.Close()
|
||||
r.Close()
|
||||
|
||||
End Using
|
||||
End Using
|
||||
|
||||
hexstring = ConvertFootPrintImageToHexString(importimg)
|
||||
|
||||
WriteHEX(LoadedROM, sOffset, hexstring)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
looper = looper + 1
|
||||
End While
|
||||
WriteHEX(LoadedROM, ("&H" & offsettowrite) + (looper * 2), "FFFF00")
|
||||
WriteHEX(LoadedROM, ("&H" & offsettowrite) + (looper * 2), "FFFF0000")
|
||||
|
||||
End If
|
||||
|
||||
|
|
|
|||
43
GBAPokemonGameEditor/ItemEditor.Designer.vb
generated
|
|
@ -43,6 +43,8 @@ Partial Class ItemEditor
|
|||
Me.DsrptnTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.DescribPointTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label21 = New System.Windows.Forms.Label()
|
||||
Me.Button6 = New System.Windows.Forms.Button()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.HoldEffectTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
|
|
@ -61,8 +63,6 @@ Partial Class ItemEditor
|
|||
Me.BattleUsagePTTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.Label14 = New System.Windows.Forms.Label()
|
||||
Me.BUTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.Label21 = New System.Windows.Forms.Label()
|
||||
Me.Button6 = New System.Windows.Forms.Button()
|
||||
Me.GroupBox1.SuspendLayout()
|
||||
Me.GroupBox2.SuspendLayout()
|
||||
CType(Me.ItemImagePictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
|
|
@ -90,7 +90,6 @@ Partial Class ItemEditor
|
|||
'
|
||||
'ItemListComboBox
|
||||
'
|
||||
Me.ItemListComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.ItemListComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.ItemListComboBox.FormattingEnabled = True
|
||||
Me.ItemListComboBox.Location = New System.Drawing.Point(18, 19)
|
||||
|
|
@ -251,6 +250,25 @@ Partial Class ItemEditor
|
|||
Me.GroupBox3.TabStop = False
|
||||
Me.GroupBox3.Text = "Description Pointer:"
|
||||
'
|
||||
'Label21
|
||||
'
|
||||
Me.Label21.AutoSize = True
|
||||
Me.Label21.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.Label21.Location = New System.Drawing.Point(14, 149)
|
||||
Me.Label21.Name = "Label21"
|
||||
Me.Label21.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label21.TabIndex = 33
|
||||
Me.Label21.Text = "Length:"
|
||||
'
|
||||
'Button6
|
||||
'
|
||||
Me.Button6.Location = New System.Drawing.Point(104, 162)
|
||||
Me.Button6.Name = "Button6"
|
||||
Me.Button6.Size = New System.Drawing.Size(67, 20)
|
||||
Me.Button6.TabIndex = 32
|
||||
Me.Button6.Text = "Save"
|
||||
Me.Button6.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
|
|
@ -398,25 +416,6 @@ Partial Class ItemEditor
|
|||
Me.BUTextBox.Size = New System.Drawing.Size(25, 20)
|
||||
Me.BUTextBox.TabIndex = 50
|
||||
'
|
||||
'Label21
|
||||
'
|
||||
Me.Label21.AutoSize = True
|
||||
Me.Label21.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.Label21.Location = New System.Drawing.Point(14, 149)
|
||||
Me.Label21.Name = "Label21"
|
||||
Me.Label21.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label21.TabIndex = 33
|
||||
Me.Label21.Text = "Length:"
|
||||
'
|
||||
'Button6
|
||||
'
|
||||
Me.Button6.Location = New System.Drawing.Point(104, 162)
|
||||
Me.Button6.Name = "Button6"
|
||||
Me.Button6.Size = New System.Drawing.Size(67, 20)
|
||||
Me.Button6.TabIndex = 32
|
||||
Me.Button6.Text = "Save"
|
||||
Me.Button6.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ItemEditor
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
|
|
|
|||
64
GBAPokemonGameEditor/MainFrm.Designer.vb
generated
|
|
@ -32,8 +32,6 @@ Partial Class MainFrm
|
|||
Me.AddOrRemoveProgramsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.TransparentBackgroundsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.DisablePokemonImageLoadingToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.Jambo51MoveTableHackToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.LinuxToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.HelpToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.EditRomsiniToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
|
|
@ -79,12 +77,12 @@ 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.Button9 = New System.Windows.Forms.Button()
|
||||
Me.Button8 = New System.Windows.Forms.Button()
|
||||
Me.Button3 = New System.Windows.Forms.Button()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Button9 = New System.Windows.Forms.Button()
|
||||
Me.MenuStrip1.SuspendLayout()
|
||||
Me.GroupBox4.SuspendLayout()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
|
|
@ -113,23 +111,23 @@ Partial Class MainFrm
|
|||
'OpenToolStripMenuItem
|
||||
'
|
||||
Me.OpenToolStripMenuItem.Name = "OpenToolStripMenuItem"
|
||||
Me.OpenToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
||||
Me.OpenToolStripMenuItem.Size = New System.Drawing.Size(103, 22)
|
||||
Me.OpenToolStripMenuItem.Text = "&Open"
|
||||
'
|
||||
'ToolStripMenuItem2
|
||||
'
|
||||
Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2"
|
||||
Me.ToolStripMenuItem2.Size = New System.Drawing.Size(149, 6)
|
||||
Me.ToolStripMenuItem2.Size = New System.Drawing.Size(100, 6)
|
||||
'
|
||||
'ExitToolStripMenuItem
|
||||
'
|
||||
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
|
||||
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
||||
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(103, 22)
|
||||
Me.ExitToolStripMenuItem.Text = "E&xit"
|
||||
'
|
||||
'SettingsToolStripMenuItem
|
||||
'
|
||||
Me.SettingsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AddOrRemoveProgramsToolStripMenuItem, Me.TransparentBackgroundsToolStripMenuItem, Me.DisablePokemonImageLoadingToolStripMenuItem, Me.Jambo51MoveTableHackToolStripMenuItem, Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem, Me.LinuxToolStripMenuItem})
|
||||
Me.SettingsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AddOrRemoveProgramsToolStripMenuItem, Me.TransparentBackgroundsToolStripMenuItem, Me.DisablePokemonImageLoadingToolStripMenuItem, Me.LinuxToolStripMenuItem})
|
||||
Me.SettingsToolStripMenuItem.Name = "SettingsToolStripMenuItem"
|
||||
Me.SettingsToolStripMenuItem.Size = New System.Drawing.Size(61, 20)
|
||||
Me.SettingsToolStripMenuItem.Text = "&Settings"
|
||||
|
|
@ -137,43 +135,27 @@ Partial Class MainFrm
|
|||
'AddOrRemoveProgramsToolStripMenuItem
|
||||
'
|
||||
Me.AddOrRemoveProgramsToolStripMenuItem.Name = "AddOrRemoveProgramsToolStripMenuItem"
|
||||
Me.AddOrRemoveProgramsToolStripMenuItem.Size = New System.Drawing.Size(654, 22)
|
||||
Me.AddOrRemoveProgramsToolStripMenuItem.Size = New System.Drawing.Size(258, 22)
|
||||
Me.AddOrRemoveProgramsToolStripMenuItem.Text = "Add or Remove Programs"
|
||||
'
|
||||
'TransparentBackgroundsToolStripMenuItem
|
||||
'
|
||||
Me.TransparentBackgroundsToolStripMenuItem.Name = "TransparentBackgroundsToolStripMenuItem"
|
||||
Me.TransparentBackgroundsToolStripMenuItem.Size = New System.Drawing.Size(654, 22)
|
||||
Me.TransparentBackgroundsToolStripMenuItem.Size = New System.Drawing.Size(258, 22)
|
||||
Me.TransparentBackgroundsToolStripMenuItem.Text = "Transparent backgrounded images"
|
||||
Me.TransparentBackgroundsToolStripMenuItem.Visible = False
|
||||
'
|
||||
'DisablePokemonImageLoadingToolStripMenuItem
|
||||
'
|
||||
Me.DisablePokemonImageLoadingToolStripMenuItem.Name = "DisablePokemonImageLoadingToolStripMenuItem"
|
||||
Me.DisablePokemonImageLoadingToolStripMenuItem.Size = New System.Drawing.Size(654, 22)
|
||||
Me.DisablePokemonImageLoadingToolStripMenuItem.Size = New System.Drawing.Size(258, 22)
|
||||
Me.DisablePokemonImageLoadingToolStripMenuItem.Text = "Disable Pokemon Image loading"
|
||||
'
|
||||
'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
|
||||
'
|
||||
Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.Enabled = False
|
||||
Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.Name = "UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem"
|
||||
Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.Size = New System.Drawing.Size(654, 22)
|
||||
Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.Text = "Use Jambo51's TM/HM extension hack. (If you don't know what this is don't use it." &
|
||||
")"
|
||||
Me.UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.Visible = False
|
||||
Me.DisablePokemonImageLoadingToolStripMenuItem.Visible = False
|
||||
'
|
||||
'LinuxToolStripMenuItem
|
||||
'
|
||||
Me.LinuxToolStripMenuItem.Name = "LinuxToolStripMenuItem"
|
||||
Me.LinuxToolStripMenuItem.Size = New System.Drawing.Size(654, 22)
|
||||
Me.LinuxToolStripMenuItem.Size = New System.Drawing.Size(258, 22)
|
||||
Me.LinuxToolStripMenuItem.Text = "Linux Operating System"
|
||||
Me.LinuxToolStripMenuItem.Visible = False
|
||||
'
|
||||
|
|
@ -433,7 +415,7 @@ Partial Class MainFrm
|
|||
Me.Button2.Name = "Button2"
|
||||
Me.Button2.Size = New System.Drawing.Size(81, 55)
|
||||
Me.Button2.TabIndex = 47
|
||||
Me.Button2.Text = "Habitat Editor"
|
||||
Me.Button2.Text = "Habitat Editor (FR/LG)"
|
||||
Me.Button2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TabPage3
|
||||
|
|
@ -629,6 +611,16 @@ Partial Class MainFrm
|
|||
Me.TabPage1.Text = "Patchers and Expanders"
|
||||
Me.TabPage1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button9
|
||||
'
|
||||
Me.Button9.Enabled = False
|
||||
Me.Button9.Location = New System.Drawing.Point(177, 6)
|
||||
Me.Button9.Name = "Button9"
|
||||
Me.Button9.Size = New System.Drawing.Size(81, 55)
|
||||
Me.Button9.TabIndex = 36
|
||||
Me.Button9.Text = "Pokemon Adder"
|
||||
Me.Button9.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button8
|
||||
'
|
||||
Me.Button8.Enabled = False
|
||||
|
|
@ -678,16 +670,6 @@ Partial Class MainFrm
|
|||
Me.Label1.TabIndex = 0
|
||||
Me.Label1.Text = "Copyright © 2016 Gamer2020 All Rights Reserved. "
|
||||
'
|
||||
'Button9
|
||||
'
|
||||
Me.Button9.Enabled = False
|
||||
Me.Button9.Location = New System.Drawing.Point(177, 6)
|
||||
Me.Button9.Name = "Button9"
|
||||
Me.Button9.Size = New System.Drawing.Size(81, 55)
|
||||
Me.Button9.TabIndex = 36
|
||||
Me.Button9.Text = "Pokemon Adder"
|
||||
Me.Button9.UseVisualStyleBackColor = True
|
||||
'
|
||||
'MainFrm
|
||||
'
|
||||
Me.AllowDrop = True
|
||||
|
|
@ -738,9 +720,7 @@ Partial Class MainFrm
|
|||
Friend WithEvents Button26 As System.Windows.Forms.Button
|
||||
Friend WithEvents SettingsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents TransparentBackgroundsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents Jambo51MoveTableHackToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents DisablePokemonImageLoadingToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents Button27 As System.Windows.Forms.Button
|
||||
Friend WithEvents Button28 As System.Windows.Forms.Button
|
||||
Friend WithEvents Button29 As System.Windows.Forms.Button
|
||||
|
|
|
|||
|
|
@ -18,18 +18,6 @@ Public Class MainFrm
|
|||
|
||||
End If
|
||||
|
||||
If GetString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0") = "1" Then
|
||||
|
||||
Jambo51MoveTableHackToolStripMenuItem.CheckState = CheckState.Checked
|
||||
|
||||
End If
|
||||
|
||||
If GetString(AppPath & "GBAPGESettings.ini", "Settings", "jamboTMextensionHack", "0") = "1" Then
|
||||
|
||||
UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.CheckState = CheckState.Checked
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If GetString(AppPath & "GBAPGESettings.ini", "Settings", "DisablePKMImages", "0") = "1" Then
|
||||
|
||||
|
|
@ -439,22 +427,6 @@ Public Class MainFrm
|
|||
Me.Cursor = Cursors.Arrow
|
||||
End Sub
|
||||
|
||||
Private Sub Jambo51MoveTableHackToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jambo51MoveTableHackToolStripMenuItem.Click
|
||||
If Jambo51MoveTableHackToolStripMenuItem.CheckState = CheckState.Checked Then
|
||||
|
||||
Jambo51MoveTableHackToolStripMenuItem.CheckState = CheckState.Unchecked
|
||||
|
||||
WriteString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "0")
|
||||
|
||||
ElseIf Jambo51MoveTableHackToolStripMenuItem.CheckState = CheckState.Unchecked Then
|
||||
|
||||
Jambo51MoveTableHackToolStripMenuItem.CheckState = CheckState.Checked
|
||||
|
||||
WriteString(AppPath & "GBAPGESettings.ini", "Settings", "MoveTableHack", "1")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button26.Click
|
||||
|
|
@ -480,22 +452,6 @@ Public Class MainFrm
|
|||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.Click
|
||||
If UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.CheckState = CheckState.Checked Then
|
||||
|
||||
UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.CheckState = CheckState.Unchecked
|
||||
|
||||
WriteString(AppPath & "GBAPGESettings.ini", "Settings", "jamboTMextensionHack", "0")
|
||||
|
||||
ElseIf UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.CheckState = CheckState.Unchecked Then
|
||||
|
||||
UseJambo51sTMHMExtensionHackIfYouDontKnowWhatThisIsDontUseItToolStripMenuItem.CheckState = CheckState.Checked
|
||||
|
||||
WriteString(AppPath & "GBAPGESettings.ini", "Settings", "jamboTMextensionHack", "1")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AddOrRemoveProgramsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddOrRemoveProgramsToolStripMenuItem.Click
|
||||
AddOrRemovePrograms.ShowDialog()
|
||||
End Sub
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 303 KiB |
53
GBAPokemonGameEditor/PokedexDataEditor.Designer.vb
generated
|
|
@ -28,6 +28,8 @@ Partial Class PokedexDataEditor
|
|||
Me.Type1 = New System.Windows.Forms.TextBox()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.GroupBox6 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Button4 = New System.Windows.Forms.Button()
|
||||
Me.Description2 = New System.Windows.Forms.TextBox()
|
||||
Me.Description1 = New System.Windows.Forms.TextBox()
|
||||
|
|
@ -59,8 +61,6 @@ Partial Class PokedexDataEditor
|
|||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.Button3 = New System.Windows.Forms.Button()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.GroupBox1.SuspendLayout()
|
||||
Me.GroupBox6.SuspendLayout()
|
||||
Me.GroupBox3.SuspendLayout()
|
||||
|
|
@ -120,6 +120,25 @@ Partial Class PokedexDataEditor
|
|||
Me.GroupBox6.Size = New System.Drawing.Size(387, 262)
|
||||
Me.GroupBox6.TabIndex = 17
|
||||
Me.GroupBox6.TabStop = False
|
||||
Me.GroupBox6.Text = "Entry Text"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(110, 228)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label2.TabIndex = 8
|
||||
Me.Label2.Text = "Length:"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(110, 104)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label1.TabIndex = 7
|
||||
Me.Label1.Text = "Length:"
|
||||
'
|
||||
'Button4
|
||||
'
|
||||
|
|
@ -202,7 +221,7 @@ Partial Class PokedexDataEditor
|
|||
'
|
||||
'Offset_1
|
||||
'
|
||||
Me.Offset_1.Location = New System.Drawing.Point(55, 92)
|
||||
Me.Offset_1.Location = New System.Drawing.Point(55, 47)
|
||||
Me.Offset_1.Name = "Offset_1"
|
||||
Me.Offset_1.Size = New System.Drawing.Size(38, 20)
|
||||
Me.Offset_1.TabIndex = 9
|
||||
|
|
@ -210,7 +229,7 @@ Partial Class PokedexDataEditor
|
|||
'Label11
|
||||
'
|
||||
Me.Label11.AutoSize = True
|
||||
Me.Label11.Location = New System.Drawing.Point(4, 92)
|
||||
Me.Label11.Location = New System.Drawing.Point(12, 50)
|
||||
Me.Label11.Name = "Label11"
|
||||
Me.Label11.Size = New System.Drawing.Size(38, 13)
|
||||
Me.Label11.TabIndex = 8
|
||||
|
|
@ -219,7 +238,7 @@ Partial Class PokedexDataEditor
|
|||
'Label10
|
||||
'
|
||||
Me.Label10.AutoSize = True
|
||||
Me.Label10.Location = New System.Drawing.Point(4, 47)
|
||||
Me.Label10.Location = New System.Drawing.Point(12, 95)
|
||||
Me.Label10.Name = "Label10"
|
||||
Me.Label10.Size = New System.Drawing.Size(37, 13)
|
||||
Me.Label10.TabIndex = 7
|
||||
|
|
@ -227,7 +246,7 @@ Partial Class PokedexDataEditor
|
|||
'
|
||||
'Offset_2
|
||||
'
|
||||
Me.Offset_2.Location = New System.Drawing.Point(120, 92)
|
||||
Me.Offset_2.Location = New System.Drawing.Point(119, 47)
|
||||
Me.Offset_2.Name = "Offset_2"
|
||||
Me.Offset_2.Size = New System.Drawing.Size(38, 20)
|
||||
Me.Offset_2.TabIndex = 6
|
||||
|
|
@ -243,14 +262,14 @@ Partial Class PokedexDataEditor
|
|||
'
|
||||
'Scale2
|
||||
'
|
||||
Me.Scale2.Location = New System.Drawing.Point(120, 47)
|
||||
Me.Scale2.Location = New System.Drawing.Point(120, 91)
|
||||
Me.Scale2.Name = "Scale2"
|
||||
Me.Scale2.Size = New System.Drawing.Size(38, 20)
|
||||
Me.Scale2.TabIndex = 3
|
||||
'
|
||||
'Scale1
|
||||
'
|
||||
Me.Scale1.Location = New System.Drawing.Point(55, 45)
|
||||
Me.Scale1.Location = New System.Drawing.Point(55, 92)
|
||||
Me.Scale1.Name = "Scale1"
|
||||
Me.Scale1.Size = New System.Drawing.Size(39, 20)
|
||||
Me.Scale1.TabIndex = 2
|
||||
|
|
@ -406,24 +425,6 @@ Partial Class PokedexDataEditor
|
|||
Me.Button3.Text = "Save"
|
||||
Me.Button3.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(110, 104)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label1.TabIndex = 7
|
||||
Me.Label1.Text = "Length:"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(110, 228)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(43, 13)
|
||||
Me.Label2.TabIndex = 8
|
||||
Me.Label2.Text = "Length:"
|
||||
'
|
||||
'PokedexDataEditor
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
|
|
|
|||
|
|
@ -131,17 +131,33 @@ Public Class PokedexDataEditor
|
|||
|
||||
Hght.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 12 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Wght.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 2 + 12 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale1.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 14 + 12 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 16 + 12 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 18 + 12 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 20 + 12 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
If header2 = "AXP" Or header2 = "AXV" Then
|
||||
|
||||
Scale1.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 26 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1.Text = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 28 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 30 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2.Text = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 32 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
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
|
||||
|
||||
Scale1.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 26 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1.Text = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 28 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 30 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2.Text = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 32 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
|
||||
EnglishFRLGEDescpLoad()
|
||||
ElseIf header2 = "BPE" Then
|
||||
|
||||
Scale1.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 22 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_1.Text = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 24 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Scale2.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 26 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
Offset_2.Text = Int16.Parse((ReverseHEX(ReadHEX(LoadedROM, offset1 + 28 + (ListBox1.SelectedIndex * SkipVar), 2))), System.Globalization.NumberStyles.HexNumber)
|
||||
|
||||
|
||||
EnglishFRLGEDescpLoad()
|
||||
End If
|
||||
|
||||
|
|
@ -181,28 +197,31 @@ Public Class PokedexDataEditor
|
|||
|
||||
WriteHEX(LoadedROM, offset1 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 2 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 14 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 16 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 18 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 20 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4)))
|
||||
|
||||
WriteHEX(LoadedROM, offset1 + 26 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 28 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 30 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 32 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4)))
|
||||
|
||||
ElseIf header2 = "BPR" Or header2 = "BPG" Then
|
||||
|
||||
WriteHEX(LoadedROM, offset1 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 2 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 14 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 16 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 18 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 20 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4)))
|
||||
|
||||
WriteHEX(LoadedROM, offset1 + 26 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 28 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 30 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 32 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4)))
|
||||
|
||||
ElseIf header2 = "BPE" Then
|
||||
|
||||
WriteHEX(LoadedROM, offset1 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Hght.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 2 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Wght.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 10 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 12 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 14 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 16 + 12 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4)))
|
||||
|
||||
WriteHEX(LoadedROM, offset1 + 22 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 24 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_1.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 26 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2.Text), 4)))
|
||||
WriteHEX(LoadedROM, offset1 + 28 + (indexbuff * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2.Text), 4)))
|
||||
|
||||
End If
|
||||
|
||||
|
|
@ -517,4 +536,5 @@ Public Class PokedexDataEditor
|
|||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
|
@ -61,7 +61,7 @@ Partial Class PokedexOrderEditor
|
|||
Me.GroupBox2.Size = New System.Drawing.Size(152, 105)
|
||||
Me.GroupBox2.TabIndex = 2
|
||||
Me.GroupBox2.TabStop = False
|
||||
Me.GroupBox2.Text = "National/Regional"
|
||||
Me.GroupBox2.Text = "National"
|
||||
'
|
||||
'ListBox2
|
||||
'
|
||||
|
|
@ -80,7 +80,7 @@ Partial Class PokedexOrderEditor
|
|||
Me.GroupBox3.Size = New System.Drawing.Size(152, 105)
|
||||
Me.GroupBox3.TabIndex = 3
|
||||
Me.GroupBox3.TabStop = False
|
||||
Me.GroupBox3.Text = "????"
|
||||
Me.GroupBox3.Text = "Second Table"
|
||||
'
|
||||
'ListBox3
|
||||
'
|
||||
|
|
|
|||
200
GBAPokemonGameEditor/PokemonAdder.Designer.vb
generated
|
|
@ -25,21 +25,21 @@ Partial Class PokemonAdder
|
|||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PokemonAdder))
|
||||
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
||||
Me.TabPage1 = New System.Windows.Forms.TabPage()
|
||||
Me.CheckBox2 = New System.Windows.Forms.CheckBox()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
Me.TextBox3 = New System.Windows.Forms.TextBox()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.TextBox2 = New System.Windows.Forms.TextBox()
|
||||
Me.TextBox1 = New System.Windows.Forms.TextBox()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.LinkLabel1 = New System.Windows.Forms.LinkLabel()
|
||||
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
|
||||
Me.TabPage2 = New System.Windows.Forms.TabPage()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.TextBox1 = New System.Windows.Forms.TextBox()
|
||||
Me.TextBox2 = New System.Windows.Forms.TextBox()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.TextBox3 = New System.Windows.Forms.TextBox()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
Me.CheckBox2 = New System.Windows.Forms.CheckBox()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
Me.TabPage1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
|
|
@ -78,6 +78,96 @@ Partial Class PokemonAdder
|
|||
Me.TabPage1.Text = "Fire Red"
|
||||
Me.TabPage1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'CheckBox2
|
||||
'
|
||||
Me.CheckBox2.AutoSize = True
|
||||
Me.CheckBox2.Checked = True
|
||||
Me.CheckBox2.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.CheckBox2.Location = New System.Drawing.Point(14, 109)
|
||||
Me.CheckBox2.Name = "CheckBox2"
|
||||
Me.CheckBox2.Size = New System.Drawing.Size(100, 17)
|
||||
Me.CheckBox2.TabIndex = 13
|
||||
Me.CheckBox2.Text = "Delete Old data"
|
||||
Me.CheckBox2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label7
|
||||
'
|
||||
Me.Label7.AutoSize = True
|
||||
Me.Label7.Location = New System.Drawing.Point(11, 217)
|
||||
Me.Label7.Name = "Label7"
|
||||
Me.Label7.Size = New System.Drawing.Size(109, 13)
|
||||
Me.Label7.TabIndex = 12
|
||||
Me.Label7.Text = "Caught flags location:"
|
||||
'
|
||||
'Label6
|
||||
'
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Location = New System.Drawing.Point(11, 192)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(103, 13)
|
||||
Me.Label6.TabIndex = 11
|
||||
Me.Label6.Text = "Seen flags location: "
|
||||
'
|
||||
'TextBox3
|
||||
'
|
||||
Me.TextBox3.Location = New System.Drawing.Point(167, 163)
|
||||
Me.TextBox3.Name = "TextBox3"
|
||||
Me.TextBox3.Size = New System.Drawing.Size(67, 20)
|
||||
Me.TextBox3.TabIndex = 10
|
||||
Me.TextBox3.Text = "0203C0C8"
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(11, 166)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(135, 13)
|
||||
Me.Label5.TabIndex = 9
|
||||
Me.Label5.Text = "Base offset to use for flags:"
|
||||
'
|
||||
'TextBox2
|
||||
'
|
||||
Me.TextBox2.Location = New System.Drawing.Point(167, 81)
|
||||
Me.TextBox2.Name = "TextBox2"
|
||||
Me.TextBox2.Size = New System.Drawing.Size(48, 20)
|
||||
Me.TextBox2.TabIndex = 8
|
||||
Me.TextBox2.Text = "335"
|
||||
'
|
||||
'TextBox1
|
||||
'
|
||||
Me.TextBox1.Location = New System.Drawing.Point(167, 37)
|
||||
Me.TextBox1.Name = "TextBox1"
|
||||
Me.TextBox1.Size = New System.Drawing.Size(48, 20)
|
||||
Me.TextBox1.TabIndex = 7
|
||||
Me.TextBox1.Text = "335"
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(11, 40)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(140, 13)
|
||||
Me.Label4.TabIndex = 6
|
||||
Me.Label4.Text = "Number of Pokemon to add:"
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(11, 84)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(148, 13)
|
||||
Me.Label3.TabIndex = 5
|
||||
Me.Label3.Text = "Number of Dex entries to add:"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(11, 62)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(154, 13)
|
||||
Me.Label2.TabIndex = 4
|
||||
Me.Label2.Text = "Number of Dex entries in ROM:"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
|
|
@ -124,99 +214,11 @@ Partial Class PokemonAdder
|
|||
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(294, 201)
|
||||
Me.TabPage2.Size = New System.Drawing.Size(294, 355)
|
||||
Me.TabPage2.TabIndex = 1
|
||||
Me.TabPage2.Text = "Emerald"
|
||||
Me.TabPage2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(11, 62)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(154, 13)
|
||||
Me.Label2.TabIndex = 4
|
||||
Me.Label2.Text = "Number of Dex entries in ROM:"
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(11, 84)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(148, 13)
|
||||
Me.Label3.TabIndex = 5
|
||||
Me.Label3.Text = "Number of Dex entries to add:"
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(11, 40)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(140, 13)
|
||||
Me.Label4.TabIndex = 6
|
||||
Me.Label4.Text = "Number of Pokemon to add:"
|
||||
'
|
||||
'TextBox1
|
||||
'
|
||||
Me.TextBox1.Location = New System.Drawing.Point(167, 37)
|
||||
Me.TextBox1.Name = "TextBox1"
|
||||
Me.TextBox1.Size = New System.Drawing.Size(48, 20)
|
||||
Me.TextBox1.TabIndex = 7
|
||||
Me.TextBox1.Text = "100"
|
||||
'
|
||||
'TextBox2
|
||||
'
|
||||
Me.TextBox2.Location = New System.Drawing.Point(167, 81)
|
||||
Me.TextBox2.Name = "TextBox2"
|
||||
Me.TextBox2.Size = New System.Drawing.Size(48, 20)
|
||||
Me.TextBox2.TabIndex = 8
|
||||
Me.TextBox2.Text = "100"
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(11, 166)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(135, 13)
|
||||
Me.Label5.TabIndex = 9
|
||||
Me.Label5.Text = "Base offset to use for flags:"
|
||||
'
|
||||
'TextBox3
|
||||
'
|
||||
Me.TextBox3.Location = New System.Drawing.Point(167, 163)
|
||||
Me.TextBox3.Name = "TextBox3"
|
||||
Me.TextBox3.Size = New System.Drawing.Size(67, 20)
|
||||
Me.TextBox3.TabIndex = 10
|
||||
Me.TextBox3.Text = "0203C0C8"
|
||||
'
|
||||
'Label6
|
||||
'
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Location = New System.Drawing.Point(11, 192)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(103, 13)
|
||||
Me.Label6.TabIndex = 11
|
||||
Me.Label6.Text = "Seen flags location: "
|
||||
'
|
||||
'Label7
|
||||
'
|
||||
Me.Label7.AutoSize = True
|
||||
Me.Label7.Location = New System.Drawing.Point(11, 217)
|
||||
Me.Label7.Name = "Label7"
|
||||
Me.Label7.Size = New System.Drawing.Size(109, 13)
|
||||
Me.Label7.TabIndex = 12
|
||||
Me.Label7.Text = "Caught flags location:"
|
||||
'
|
||||
'CheckBox2
|
||||
'
|
||||
Me.CheckBox2.AutoSize = True
|
||||
Me.CheckBox2.Location = New System.Drawing.Point(14, 109)
|
||||
Me.CheckBox2.Name = "CheckBox2"
|
||||
Me.CheckBox2.Size = New System.Drawing.Size(100, 17)
|
||||
Me.CheckBox2.TabIndex = 13
|
||||
Me.CheckBox2.Text = "Delete Old data"
|
||||
Me.CheckBox2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'PokemonAdder
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
|
|
|
|||
1382
GBAPokemonGameEditor/Pokemonedit.Designer.vb
generated
|
|
@ -127,7 +127,7 @@
|
|||
<value>405, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>25</value>
|
||||
<value>48</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
|
|
|
|||
2
GBAPokemonGameEditor/SplashScreen1.Designer.vb
generated
|
|
@ -35,6 +35,7 @@ Partial Class SplashScreen1
|
|||
Me.PictureBox1.Size = New System.Drawing.Size(800, 300)
|
||||
Me.PictureBox1.TabIndex = 0
|
||||
Me.PictureBox1.TabStop = False
|
||||
Me.PictureBox1.WaitOnLoad = True
|
||||
'
|
||||
'SplashScreen1
|
||||
'
|
||||
|
|
@ -53,6 +54,5 @@ Partial Class SplashScreen1
|
|||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents PictureBox1 As PictureBox
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
|
||||
My.Application.MinimumSplashScreenDisplayTime = 12000
|
||||
|
||||
|
||||
My.Application.MinimumSplashScreenDisplayTime = 10000
|
||||
|
||||
' 'Set up the dialog text at runtime according to the application's assembly information.
|
||||
|
||||
|
|
@ -35,4 +37,5 @@
|
|||
' Copyright.Text = My.Application.Info.Copyright
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
|
|
|||
1
GBAPokemonGameEditor/TMHMEditor.Designer.vb
generated
|
|
@ -58,7 +58,6 @@ Partial Class TMHMEditor
|
|||
'
|
||||
'AttackList
|
||||
'
|
||||
Me.AttackList.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.AttackList.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.AttackList.FormattingEnabled = True
|
||||
Me.AttackList.Location = New System.Drawing.Point(59, 221)
|
||||
|
|
|
|||
393
GBAPokemonGameEditor/WichuRomFunctions.vb
Normal file
|
|
@ -0,0 +1,393 @@
|
|||
Imports Microsoft.VisualBasic
|
||||
Imports Microsoft.VisualBasic.CompilerServices
|
||||
Imports System
|
||||
Imports System.IO
|
||||
Imports System.Runtime.CompilerServices
|
||||
Imports System.Text
|
||||
|
||||
'The following functions were extracted from A-series. All credit goes to it's programmer Wichu!
|
||||
|
||||
Module WichuRomFunctions
|
||||
Public Function CompressLz77(ByRef data As Byte()) As Collection
|
||||
Dim position As Integer = 0
|
||||
Dim length As Integer = data.Length
|
||||
Dim collection3 As New Collection
|
||||
Dim collection As New Collection
|
||||
collection.Add(&H10, Nothing, Nothing, Nothing)
|
||||
collection.Add((length And &HFF), Nothing, Nothing, Nothing)
|
||||
collection.Add(((length >> 8) And &HFF), Nothing, Nothing, Nothing)
|
||||
collection.Add(((length >> &H10) And &HFF), Nothing, Nothing, Nothing)
|
||||
Do While (position < length)
|
||||
Dim item As Byte = 0
|
||||
collection3.Clear()
|
||||
Dim num4 As Integer = 0
|
||||
Do
|
||||
Dim numArray As Integer() = Lz77Search(data, position)
|
||||
If (numArray(0) > 2) Then
|
||||
collection3.Add(((((numArray(0) - 3) And 15) << 4) Or (((numArray(1) - 1) >> 8) And 15)), Nothing, Nothing, Nothing)
|
||||
collection3.Add(((numArray(1) - 1) And &HFF), Nothing, Nothing, Nothing)
|
||||
position = (position + numArray(0))
|
||||
item = CByte((item Or (CInt(1) << (7 - num4))))
|
||||
Else
|
||||
If (numArray(0) < 0) Then
|
||||
Exit Do
|
||||
End If
|
||||
collection3.Add(data(position), Nothing, Nothing, Nothing)
|
||||
position += 1
|
||||
End If
|
||||
num4 += 1
|
||||
Loop While (num4 <= 7)
|
||||
collection.Add(item, Nothing, Nothing, Nothing)
|
||||
Dim count As Integer = collection3.Count
|
||||
Dim i As Integer = 1
|
||||
Do While (i <= count)
|
||||
collection.Add(RuntimeHelpers.GetObjectValue(collection3.Item(i)), Nothing, Nothing, Nothing)
|
||||
i += 1
|
||||
Loop
|
||||
Loop
|
||||
Return collection
|
||||
End Function
|
||||
|
||||
Public Function CompressLz77String(ByRef srcString As String) As String
|
||||
Dim length As Integer = 1
|
||||
Dim num3 As UInt32 = Len(CStr(srcString))
|
||||
Dim str2 As String = (ChrW(16) & Conversions.ToString(Strings.Chr(CInt((num3 And &HFF)))) & Conversions.ToString(Strings.Chr(CInt(((num3 >> 8) And &HFF)))) & Conversions.ToString(Strings.Chr(CInt(((num3 >> &H10) And &HFF)))))
|
||||
Do While (length <= num3)
|
||||
Dim charCode As Byte = 0
|
||||
Dim str3 As String = ""
|
||||
Dim num5 As Integer = 0
|
||||
Do
|
||||
If (length > num3) Then
|
||||
Exit Do
|
||||
End If
|
||||
Dim num6 As Integer = &H12
|
||||
Dim num4 As Integer = Strings.InStr(1, Strings.Left(srcString, length), Strings.Mid(srcString, length, num6), CompareMethod.Binary)
|
||||
If ((num4 > 0) And ((length + num6) <= num3)) Then
|
||||
num4 = (length - num4)
|
||||
str3 = (str3 & Conversions.ToString(Strings.Chr(((((num6 - 3) And 15) << 4) + (((num4 - 1) >> 8) And 15)))) & Conversions.ToString(Strings.Chr(((num4 - 1) And &HFF))))
|
||||
length = (length + num6)
|
||||
charCode = CByte((charCode Or (CInt(1) << (7 - num5))))
|
||||
Else
|
||||
str3 = (str3 & Strings.Mid(srcString, length, 1))
|
||||
length += 1
|
||||
End If
|
||||
num5 += 1
|
||||
Loop While (num5 <= 7)
|
||||
str2 = (str2 & Conversions.ToString(Strings.Chr(charCode)) & str3)
|
||||
Loop
|
||||
Do While ((str2.Length Mod 4) > 0)
|
||||
str2 = (str2 & ChrW(0))
|
||||
Loop
|
||||
Return str2
|
||||
End Function
|
||||
|
||||
Public Function ConvertByteArrayToString(ByRef ary As Byte()) As String
|
||||
Dim str2 As String = ""
|
||||
Dim num2 As Integer = (ary.Length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num2)
|
||||
str2 = (str2 & Conversions.ToString(Strings.Chr(ary(i))))
|
||||
i += 1
|
||||
Loop
|
||||
Return str2
|
||||
End Function
|
||||
|
||||
Public Function ConvertCollectionToByteArray(ByRef col As Collection) As Byte()
|
||||
Dim buffer2 As Byte() = New Byte(((col.Count - 1) + 1) - 1) {}
|
||||
Dim count As Integer = col.Count
|
||||
Dim i As Integer = 1
|
||||
Do While (i <= count)
|
||||
buffer2((i - 1)) = Conversions.ToByte(col.Item(i))
|
||||
i += 1
|
||||
Loop
|
||||
Return buffer2
|
||||
End Function
|
||||
|
||||
Public Function ConvertStringToByteArray(ByRef str As String) As Byte()
|
||||
Dim buffer2 As Byte() = New Byte(((str.Length - 1) + 1) - 1) {}
|
||||
Dim num2 As Integer = (str.Length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num2)
|
||||
buffer2(i) = CByte(Strings.Asc(Strings.Mid(str, (i + 1), 1)))
|
||||
i += 1
|
||||
Loop
|
||||
Return buffer2
|
||||
End Function
|
||||
|
||||
Public Function FindNextFreeSpace(ByRef Stream As FileStream, ByVal length As Integer) As Integer
|
||||
Do While (Stream.Position < Stream.Length)
|
||||
Dim num As Byte = CByte(Stream.ReadByte)
|
||||
If ((num = 0) Or (num = &HFF)) Then
|
||||
Dim num3 As Integer = 1
|
||||
Dim num4 As Integer = CInt((Stream.Position - 1))
|
||||
Do While ((num3 < length) And (Stream.Position < Stream.Length))
|
||||
num = CByte(Stream.ReadByte)
|
||||
If ((num <> &HFF) And (num <> 0)) Then
|
||||
Exit Do
|
||||
End If
|
||||
num3 += 1
|
||||
Loop
|
||||
If (num3 = length) Then
|
||||
Return num4
|
||||
End If
|
||||
End If
|
||||
Do While ((Stream.Position Mod 4) > 0)
|
||||
Stream.ReadByte()
|
||||
Loop
|
||||
Loop
|
||||
Return -1
|
||||
End Function
|
||||
|
||||
Public Function FromRSChar(ByVal ch As Byte) As Object
|
||||
Dim array As Byte() = New Byte() {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &HFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &HAB, 0, 0, &HB7, &H5B, 0, 180, &H5C, &H5D, &HB9, &H2E, &HB8, &HAE, &HAD, &HBA, &HA1, &HA2, &HA3, &HA4, &HA5, &HA6, &HA7, &HA8, &HA9, 170, 240, &H36, 0, &H35, 0, &HAC, 0, &HBB, &HBC, &HBD, 190, &HBF, &HC0, &HC1, &HC2, &HC3, &HC4, &HC5, &HC6, &HC7, 200, &HC9, &HCA, &HCB, &HCC, &HCD, &HCE, &HCF, &HD0, &HD1, 210, &HD3, &HD4, 0, 0, 0, 0, 0, &HB3, &HD5, &HD6, &HD7, &HD8, &HD9, &HDA, &HDB, 220, &HDD, &HDE, &HDF, &HE0, &HE1, &HE2, &HE3, &HE4, &HE5, 230, &HE7, &HE8, &HE9, &HEA, &HEB, &HEC, &HED, &HEE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &H52, 0, 0, 0, 0, 0, 0, 0, 0, &H2B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &H2A, 0, 0, 0, 0, &H51, 1, 2, 0, 0, &HF1, 0, 0, 4, 5, 6, 7, 8, 9, 90, 11, 12, 0, 20, 13, 14, 15, 0, &HF2, 0, 0, &H11, &H12, &H13, &HF3, 0, 0, &H15, &H16, &H17, &H68, 0, &HF4, 0, 0, &H19, &H1A, &H1B, &H1C, &H1D, 30, &H6F, &H20, &H21, 0, &H29, &H22, &H23, &H24, 0, &HF5, 0, 0, &H26, &H27, 40, &HF6, 0, 0, 0, 0}
|
||||
'Dim index As Integer = array.IndexOf(Of Byte)(array, ch)
|
||||
Dim index As Integer = array.IndexOf(array, ch)
|
||||
If (index = -1) Then
|
||||
index = 0
|
||||
End If
|
||||
Return Strings.Chr(index)
|
||||
End Function
|
||||
|
||||
Public Function GetDoublePointerTable(ByRef Stream As FileStream, ByVal length As Integer) As UInt32()
|
||||
Dim numArray2 As UInt32() = New UInt32(((length - 1) + 1) - 1) {}
|
||||
Dim num3 As Integer = (length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num3)
|
||||
Dim streamvar As Stream = Stream
|
||||
streamvar = DirectCast(streamvar, FileStream)
|
||||
Dim num As UInt32 = Conversions.ToUInteger(GetDWord(streamvar))
|
||||
If (num > &H8000000) Then
|
||||
numArray2(i) = (num - &H8000000)
|
||||
streamvar.Seek(4, SeekOrigin.Current)
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
Return numArray2
|
||||
End Function
|
||||
|
||||
Public Function GetDWord(ByRef streaminput As Stream) As Object
|
||||
Dim num As UInt32 = streaminput.ReadByte
|
||||
num = (num Or (Convert.ToUInt32(streaminput.ReadByte) << 8))
|
||||
num = (num Or (Convert.ToUInt32(streaminput.ReadByte) << &H10))
|
||||
Return (num Or (Convert.ToUInt32(streaminput.ReadByte) << &H18))
|
||||
End Function
|
||||
|
||||
Public Function GetGameCode(ByRef filename As String) As String
|
||||
Dim stream As New FileStream(filename, FileMode.Open)
|
||||
Dim reader As New StreamReader(stream, Encoding.ASCII)
|
||||
Dim str As String = ""
|
||||
stream.Seek(&HAC, SeekOrigin.Begin)
|
||||
Dim num As Integer = 0
|
||||
Do
|
||||
str = (str & Conversions.ToString(Strings.Chr(reader.Read)))
|
||||
num += 1
|
||||
Loop While (num <= 3)
|
||||
reader.Close()
|
||||
stream.Close()
|
||||
Return str
|
||||
End Function
|
||||
|
||||
Public Function GetLz77UncompressedLength(ByRef stream As FileStream) As Integer
|
||||
Dim num2 As Integer = 0
|
||||
If (stream.ReadByte <> &H10) Then
|
||||
Interaction.MsgBox("Data is not LZ77 compressed!", MsgBoxStyle.ApplicationModal, Nothing)
|
||||
Return 0
|
||||
End If
|
||||
num2 = (stream.ReadByte + (stream.ReadByte << 8))
|
||||
Return (num2 + (stream.ReadByte << &H10))
|
||||
End Function
|
||||
|
||||
Public Function GetSinglePointerTable(ByRef streaminput As FileStream, ByVal length As Integer) As UInt32()
|
||||
Dim numArray2 As UInt32() = New UInt32(((length - 1) + 1) - 1) {}
|
||||
Dim num3 As Integer = (length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num3)
|
||||
Dim stream As Stream = streaminput
|
||||
stream = DirectCast(stream, FileStream)
|
||||
Dim num As UInt32 = Conversions.ToUInteger(GetDWord(stream))
|
||||
If (num > &H8000000) Then
|
||||
numArray2(i) = (num - (&H8000000))
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
Return numArray2
|
||||
End Function
|
||||
|
||||
Public Function GetWord(ByRef stream As Stream) As Object
|
||||
Dim num As UInt16 = CUShort(stream.ReadByte)
|
||||
Return CUShort((num Or CUShort((Convert.ToUInt16(stream.ReadByte) << 8))))
|
||||
End Function
|
||||
|
||||
Public Function LoadString(ByRef Stream As FileStream, ByVal length As Integer) As Object
|
||||
Dim chArray As Char() = New Char(((length - 1) + 1) - 1) {}
|
||||
Dim flag As Boolean = False
|
||||
Dim num3 As Integer = (length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num3)
|
||||
Dim ch As Byte = CByte(Stream.ReadByte)
|
||||
If Not flag Then
|
||||
Select Case ch
|
||||
Case &HFF
|
||||
flag = True
|
||||
Continue Do
|
||||
Case 0
|
||||
chArray(i) = "?"c
|
||||
Continue Do
|
||||
End Select
|
||||
chArray(i) = Conversions.ToChar(FromRSChar(ch))
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
Return Convert.ToString(New String(chArray))
|
||||
End Function
|
||||
|
||||
Public Function Lz77Search(ByRef data As Byte(), ByVal position As Integer) As Integer()
|
||||
Dim length As Integer = data.Length
|
||||
Dim numArray2 As Integer() = New Integer(2 - 1) {}
|
||||
Dim collection As New Collection
|
||||
If ((position < 3) Or ((length - position) < 3)) Then
|
||||
numArray2(0) = 0
|
||||
numArray2(1) = 0
|
||||
Return numArray2
|
||||
End If
|
||||
If (position >= length) Then
|
||||
numArray2(0) = -1
|
||||
numArray2(1) = 0
|
||||
Return numArray2
|
||||
End If
|
||||
Dim num4 As Integer = &H1000
|
||||
If (num4 > position) Then
|
||||
num4 = position
|
||||
End If
|
||||
Dim num6 As Integer = (num4 - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num6)
|
||||
If (data(((position - i) - 1)) = data(position)) Then
|
||||
collection.Add((i + 1), Nothing, Nothing, Nothing)
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
If (collection.Count = 0) Then
|
||||
numArray2(0) = 0
|
||||
numArray2(1) = 0
|
||||
Return numArray2
|
||||
End If
|
||||
Dim left As Byte = 0
|
||||
Dim flag As Boolean = False
|
||||
Do While (left < &H12)
|
||||
left = CByte((left + 1))
|
||||
Dim j As Integer
|
||||
For j = 0 To collection.Count - 1
|
||||
If ((position + left) >= data.Length) Then
|
||||
flag = True
|
||||
ElseIf (data((position + left)) <> data(Conversions.ToInteger(Operators.AddObject(Operators.SubtractObject(position, collection.Item((j + 1))), Operators.ModObject(left, collection.Item((j + 1))))))) Then
|
||||
If (collection.Count > 1) Then
|
||||
collection.Remove(CInt((j + 1)))
|
||||
j -= 1
|
||||
Else
|
||||
flag = True
|
||||
End If
|
||||
End If
|
||||
If flag Then
|
||||
Exit For
|
||||
End If
|
||||
Next j
|
||||
If flag Then
|
||||
Exit Do
|
||||
End If
|
||||
Loop
|
||||
numArray2(0) = left
|
||||
numArray2(1) = Conversions.ToInteger(collection.Item(1))
|
||||
Return numArray2
|
||||
End Function
|
||||
|
||||
Public Sub SetDWord(ByRef stream As Stream, ByVal dword As UInt32)
|
||||
stream.WriteByte(CByte((dword And &HFF)))
|
||||
stream.WriteByte(CByte(((dword >> 8) And &HFF)))
|
||||
stream.WriteByte(CByte(((dword >> &H10) And &HFF)))
|
||||
stream.WriteByte(CByte(((dword >> 0) And &HFF)))
|
||||
End Sub
|
||||
|
||||
Public Sub SetOffset(ByRef stream As Stream, ByVal offset As UInt32)
|
||||
stream.WriteByte(CByte((offset And &HFF)))
|
||||
stream.WriteByte(CByte(((offset >> 8) And &HFF)))
|
||||
stream.WriteByte(CByte(((offset >> &H10) And &HFF)))
|
||||
stream.WriteByte(8)
|
||||
End Sub
|
||||
|
||||
Public Sub SetWord(ByRef stream As Stream, ByVal word As UInt16)
|
||||
stream.WriteByte(CByte((word And &HFF)))
|
||||
stream.WriteByte(CByte((CUShort((word >> 8)) And &HFF)))
|
||||
End Sub
|
||||
|
||||
Public Sub ToNextValidOffset(ByRef Stream As FileStream)
|
||||
Do While ((Stream.Position Mod 4) > 0)
|
||||
Stream.ReadByte()
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Function ToRSChar(ByVal [chr] As Char) As Object
|
||||
Dim buffer As Byte() = New Byte() {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &HFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &HAB, 0, 0, &HB7, &H5B, 0, 180, &H5C, &H5D, &HB9, &H2E, &HB8, &HAE, &HAD, &HBA, &HA1, &HA2, &HA3, &HA4, &HA5, &HA6, &HA7, &HA8, &HA9, 170, 240, &H36, 0, &H35, 0, &HAC, 0, &HBB, &HBC, &HBD, 190, &HBF, &HC0, &HC1, &HC2, &HC3, &HC4, &HC5, &HC6, &HC7, 200, &HC9, &HCA, &HCB, &HCC, &HCD, &HCE, &HCF, &HD0, &HD1, 210, &HD3, &HD4, 0, 0, 0, 0, 0, &HB3, &HD5, &HD6, &HD7, &HD8, &HD9, &HDA, &HDB, 220, &HDD, &HDE, &HDF, &HE0, &HE1, &HE2, &HE3, &HE4, &HE5, 230, &HE7, &HE8, &HE9, &HEA, &HEB, &HEC, &HED, &HEE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &H52, 0, 0, 0, 0, 0, 0, 0, 0, &H2B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &H2A, 0, 0, 0, 0, &H51, 1, 2, 0, 0, &HF1, 0, 0, 4, 5, 6, 7, 8, 9, 90, 11, 12, 0, 20, 13, 14, 15, 0, &HF2, 0, 0, &H11, &H12, &H13, &HF3, 0, 0, &H15, &H16, &H17, &H68, 0, &HF4, 0, 0, &H19, &H1A, &H1B, &H1C, &H1D, 30, &H6F, &H20, &H21, 0, &H29, &H22, &H23, &H24, 0, &HF5, 0, 0, &H26, &H27, 40, &HF6, 0, 0, 0, 0}
|
||||
Return buffer(Strings.Asc([chr]))
|
||||
End Function
|
||||
|
||||
Public Function UncompressLZ77(ByRef Stream As FileStream) As Byte()
|
||||
Return UncompressLZ77(Stream, True)
|
||||
End Function
|
||||
|
||||
Public Function UncompressLZ77(ByRef Stream As FileStream, ByVal message As Boolean) As Byte()
|
||||
Dim num7 As UInt32
|
||||
Dim array As Byte() = New Byte(0 - 1) {}
|
||||
If (Stream.ReadByte <> &H10) Then
|
||||
If message Then
|
||||
Interaction.MsgBox("Data is not LZ77 compressed!", MsgBoxStyle.ApplicationModal, Nothing)
|
||||
End If
|
||||
Return array
|
||||
End If
|
||||
Dim num6 As UInt32 = Stream.ReadByte
|
||||
num6 = (num6 + (Stream.ReadByte << 8))
|
||||
num6 = (num6 + (Stream.ReadByte << &H10))
|
||||
If (num6 > &H2404) Then
|
||||
If message Then
|
||||
Interaction.MsgBox("Invalid LZ77 offset", MsgBoxStyle.ApplicationModal, Nothing)
|
||||
End If
|
||||
Return array
|
||||
End If
|
||||
array.Resize(Of Byte)(array, CInt(num6))
|
||||
Do While (num7 < num6)
|
||||
Dim num3 As Byte = CByte(Stream.ReadByte)
|
||||
Dim num8 As Integer = 0
|
||||
Do
|
||||
If ((num3 And &H80) > 0) Then
|
||||
Dim num2 As UInt32 = Stream.ReadByte
|
||||
Dim num5 As UInt32 = Stream.ReadByte
|
||||
Dim num4 As UInt32 = ((((num2 << 8) + num5) And &HFFF) + CULng(1))
|
||||
Dim num As UInt32 = (CULng(3) + ((num2 >> 4) And 15))
|
||||
If (num4 > num7) Then
|
||||
Return array
|
||||
End If
|
||||
Dim num10 As Long = (num - 1)
|
||||
Dim i As Long = 0
|
||||
Do While (i <= num10)
|
||||
If ((num7 + i) >= num6) Then
|
||||
Exit Do
|
||||
End If
|
||||
array(CInt((num7 + i))) = array(CInt(((num7 - num4) + (i Mod CULng(num4)))))
|
||||
i = (i + 1)
|
||||
Loop
|
||||
num7 = (num7 + num)
|
||||
Else
|
||||
array(num7) = CByte(Stream.ReadByte)
|
||||
|
||||
num7 = (num7 + 1)
|
||||
End If
|
||||
If (num7 >= num6) Then
|
||||
Return array
|
||||
End If
|
||||
num3 = CByte((num3 << 1))
|
||||
num8 += 1
|
||||
Loop While (num8 <= 7)
|
||||
Loop
|
||||
Return array
|
||||
End Function
|
||||
End Module
|
||||
468
GBAPokemonGameEditor/WichuSpriteFunctions.vb
Normal file
|
|
@ -0,0 +1,468 @@
|
|||
Imports Microsoft.VisualBasic
|
||||
Imports Microsoft.VisualBasic.CompilerServices
|
||||
Imports System
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports System.Linq
|
||||
|
||||
'The following functions were extracted from A-series. All credit goes to it's programmer Wichu!
|
||||
|
||||
Module WichuSpriteFunctions
|
||||
|
||||
Public Sub BitmapBLT(ByRef srcBitmap As Bitmap, ByRef destBitmap As Bitmap, ByVal destX As Integer, ByVal destY As Integer, ByVal srcX As Integer, ByVal srcY As Integer, ByVal width As Integer, ByVal height As Integer)
|
||||
Dim num As Integer = 0
|
||||
Dim i As Integer = 0
|
||||
Do While (num < width)
|
||||
Do While (i < height)
|
||||
If ((((((((((srcX + num) >= 0) And ((srcY + i) >= 0)) And ((destX + num) >= 0)) And ((destY + i) >= 0)) And ((srcX + num) < srcBitmap.Width)) And ((srcY + i) < srcBitmap.Height)) And ((destX + num) < destBitmap.Width)) And ((destY + i) < destBitmap.Height)) AndAlso (srcBitmap.GetPixel((srcX + num), (srcY + i)).A >= &H80)) Then
|
||||
destBitmap.SetPixel((destX + num), (destY + i), srcBitmap.GetPixel((srcX + num), (srcY + i)))
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
num += 1
|
||||
i = 0
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Sub BitmapBLT(ByRef srcBitmap As Bitmap, ByRef destBitmap As Bitmap, ByVal destX As Integer, ByVal destY As Integer, ByVal srcX As Integer, ByVal srcY As Integer, ByVal width As Integer, ByVal height As Integer, ByRef bgcolor As Color)
|
||||
Dim num As Integer = 0
|
||||
Dim i As Integer = 0
|
||||
Do While (num < width)
|
||||
Do While (i < height)
|
||||
If (((((((((srcX + num) >= 0) And ((srcY + i) >= 0)) And ((destX + num) >= 0)) And ((destY + i) >= 0)) And ((srcX + num) < srcBitmap.Width)) And ((srcY + i) < srcBitmap.Height)) And ((destX + num) < destBitmap.Width)) And ((destY + i) < destBitmap.Height)) Then
|
||||
If (srcBitmap.GetPixel((srcX + num), (srcY + i)).A >= &H80) Then
|
||||
destBitmap.SetPixel((destX + num), (destY + i), srcBitmap.GetPixel((srcX + num), (srcY + i)))
|
||||
Else
|
||||
destBitmap.SetPixel((destX + num), (destY + i), bgcolor)
|
||||
End If
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
num += 1
|
||||
i = 0
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Sub ClearBitmap(ByRef bitmap As Bitmap)
|
||||
FillBitmap(bitmap, Color.Transparent)
|
||||
End Sub
|
||||
|
||||
Public Function ColorToRGB16(ByRef ARGBColor As Color) As UInt16
|
||||
Dim num4 As UInt16 = CByte((ARGBColor.R >> 3))
|
||||
Dim num3 As UInt16 = CByte((ARGBColor.G >> 3))
|
||||
Dim num As UInt16 = CByte((ARGBColor.B >> 3))
|
||||
Return CUShort((CUShort((num4 + CUShort((num3 << 5)))) + CUShort((num << 10))))
|
||||
End Function
|
||||
|
||||
Public Sub ConvertBitmapToPalette(ByRef sprite As Bitmap, ByRef palette As Color(), ByVal AutoTransparency As Boolean)
|
||||
Dim pixel As Color
|
||||
Dim destinationArray As Color() = New Color(((palette.Length - 2) + 1) - 1) {}
|
||||
If AutoTransparency Then
|
||||
Array.Copy(palette, 1, destinationArray, 0, (palette.Length - 1))
|
||||
pixel = sprite.GetPixel(0, 0)
|
||||
End If
|
||||
Dim num3 As Integer = (sprite.Width - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num3)
|
||||
Dim num4 As Integer = (sprite.Height - 1)
|
||||
Dim j As Integer = 0
|
||||
Do While (j <= num4)
|
||||
Dim col As Color = sprite.GetPixel(i, j)
|
||||
If AutoTransparency Then
|
||||
If (col = pixel) Then
|
||||
sprite.SetPixel(i, j, palette(0))
|
||||
Else
|
||||
sprite.SetPixel(i, j, destinationArray(GetClosestColorFromPalette(col, destinationArray)))
|
||||
End If
|
||||
Else
|
||||
sprite.SetPixel(i, j, palette(GetClosestColorFromPalette(col, palette)))
|
||||
End If
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Function ConvertPaletteToByteArray(ByRef palette As Color()) As Byte()
|
||||
Dim buffer2 As Byte() = New Byte(&H20 - 1) {}
|
||||
Dim index As Integer = 0
|
||||
Do
|
||||
Dim num As Integer = ColorToRGB16(palette(index))
|
||||
buffer2((index * 2)) = CByte((num And &HFF))
|
||||
buffer2(((index * 2) + 1)) = CByte(((num >> 8) And &HFF))
|
||||
index += 1
|
||||
Loop While (index <= 15)
|
||||
Return buffer2
|
||||
End Function
|
||||
|
||||
Public Function ConvertPaletteToString(ByRef palette As Color()) As String
|
||||
Dim str2 As String = ""
|
||||
Dim index As Integer = 0
|
||||
Do
|
||||
Dim num As UInt16 = ColorToRGB16(palette(index))
|
||||
str2 = (str2 & Conversions.ToString(Strings.Chr((num And &HFF))) & Conversions.ToString(Strings.Chr((CUShort((num >> 8)) And &HFF))))
|
||||
index += 1
|
||||
Loop While (index <= 15)
|
||||
Return str2
|
||||
End Function
|
||||
|
||||
Public Sub CopyBitmap(ByRef srcBitmap As Bitmap, ByRef destBitmap As Bitmap)
|
||||
Dim x As Integer = 0
|
||||
Dim i As Integer = 0
|
||||
Do While (x < destBitmap.Width)
|
||||
Do While (i < destBitmap.Height)
|
||||
Dim pixel As Color = srcBitmap.GetPixel(x, i)
|
||||
If (pixel.A > &H7F) Then
|
||||
destBitmap.SetPixel(x, i, pixel)
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
x += 1
|
||||
i = 0
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Sub FillBitmap(ByRef bitmap As Bitmap, ByRef color As Color)
|
||||
Dim x As Integer = 0
|
||||
Dim i As Integer = 0
|
||||
Do While (x < bitmap.Width)
|
||||
Do While (i < bitmap.Height)
|
||||
bitmap.SetPixel(x, i, color)
|
||||
i += 1
|
||||
Loop
|
||||
x += 1
|
||||
i = 0
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Sub FillRect(ByRef bitmap As Bitmap, ByRef color As Color, ByVal ox As Integer, ByVal oy As Integer, ByVal width As Integer, ByVal height As Integer)
|
||||
Dim num As Integer = 0
|
||||
Dim num2 As Integer = 0
|
||||
If (width > (bitmap.Width - ox)) Then
|
||||
width = (bitmap.Width - ox)
|
||||
End If
|
||||
If (height > (bitmap.Width - oy)) Then
|
||||
height = (bitmap.Width - oy)
|
||||
End If
|
||||
Do While (num < width)
|
||||
Do While (num2 < height)
|
||||
bitmap.SetPixel((num + ox), (num2 + oy), color)
|
||||
num2 += 1
|
||||
Loop
|
||||
num += 1
|
||||
num2 = 0
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Function GetBitmapPalette(ByRef sprite As Bitmap) As Color()
|
||||
Dim source As Color() = New Color(&H10 - 1) {}
|
||||
Dim index As Byte = 0
|
||||
Dim num4 As Integer = (sprite.Width - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num4)
|
||||
Dim num5 As Integer = (sprite.Height - 1)
|
||||
Dim j As Integer = 0
|
||||
Do While (j <= num5)
|
||||
Dim pixel As Color = sprite.GetPixel(i, j)
|
||||
If Not Enumerable.Contains(Of Color)(source, pixel) Then
|
||||
source(index) = pixel
|
||||
index = CByte((index + 1))
|
||||
End If
|
||||
If (index > 15) Then
|
||||
Return source
|
||||
End If
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
Return source
|
||||
End Function
|
||||
|
||||
Public Function GetBottom(ByRef bitmap As Bitmap) As Integer
|
||||
Dim num As Integer
|
||||
Dim height As Integer = bitmap.Height
|
||||
Dim i As Integer = 1
|
||||
Do While (i <= height)
|
||||
Dim num5 As Integer = (bitmap.Height - 1)
|
||||
Dim j As Integer = 0
|
||||
Do While (j <= num5)
|
||||
If (bitmap.GetPixel(j, (bitmap.Height - i)).A > 0) Then
|
||||
Return (bitmap.Height - i)
|
||||
End If
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
Return num
|
||||
End Function
|
||||
|
||||
Public Function GetClosestColorFromPalette(ByRef col As Color, ByRef palette As Color()) As Byte
|
||||
Dim num2 As Integer
|
||||
Dim num As Integer = &H2FD
|
||||
col = QuantizeColor(col)
|
||||
Dim num6 As Integer = (palette.Length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num6)
|
||||
Dim colorDifference As Integer = GetColorDifference(col, palette(i))
|
||||
If (colorDifference < num) Then
|
||||
num = colorDifference
|
||||
num2 = i
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
Return CByte(num2)
|
||||
End Function
|
||||
|
||||
Public Function GetClosestIndexedPixel(ByRef sprite As Bitmap, ByRef palette As Color(), ByVal x As UInt32, ByVal y As UInt32) As Byte
|
||||
Dim num As Byte
|
||||
Return num
|
||||
End Function
|
||||
|
||||
Public Function GetClosestPalette(ByRef sprite As Bitmap, ByRef palettes As Color()()) As Byte
|
||||
Dim num2 As Byte
|
||||
Dim bitmapPalette As Color() = GetBitmapPalette(sprite)
|
||||
Dim num As Integer = -1
|
||||
Dim num7 As Integer = (palettes.Length - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num7)
|
||||
Dim num4 As Integer = 0
|
||||
Dim num8 As Integer = (bitmapPalette.Length - 1)
|
||||
Dim j As Integer = 0
|
||||
Do While (j <= num8)
|
||||
num4 = (num4 + GetColorDifference(bitmapPalette(j), palettes(i)(GetClosestColorFromPalette(bitmapPalette(j), palettes(i)))))
|
||||
j += 1
|
||||
Loop
|
||||
If ((num4 < num) Or (num < 0)) Then
|
||||
num = num4
|
||||
num2 = CByte(i)
|
||||
End If
|
||||
i += 1
|
||||
Loop
|
||||
Return num2
|
||||
End Function
|
||||
|
||||
Public Function GetColorDifference(ByRef color1 As Color, ByRef color2 As Color) As Integer
|
||||
Dim r As Integer = color1.R
|
||||
Dim g As Integer = color1.G
|
||||
Dim b As Integer = color1.B
|
||||
r = (r - color2.R)
|
||||
g = (g - color2.G)
|
||||
b = (b - color2.B)
|
||||
Return (((r * r) + (g * g)) + (b * b))
|
||||
End Function
|
||||
|
||||
Public Function GetIndexedPixel(ByRef sprite As Bitmap, ByRef palette As Color(), ByVal x As UInt32, ByVal y As UInt32) As Byte
|
||||
Dim num As Byte
|
||||
Return num
|
||||
End Function
|
||||
|
||||
Public Function GetNumColors(ByRef sprite As Bitmap) As Byte
|
||||
Dim source As Color() = New Color(&H10 - 1) {}
|
||||
Dim index As Byte = 0
|
||||
Dim num5 As Integer = (sprite.Width - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num5)
|
||||
Dim num6 As Integer = (sprite.Height - 1)
|
||||
Dim j As Integer = 0
|
||||
Do While (j <= num6)
|
||||
Dim pixel As Color = sprite.GetPixel(i, j)
|
||||
If Not Enumerable.Contains(Of Color)(source, pixel) Then
|
||||
source(index) = pixel
|
||||
index = CByte((index + 1))
|
||||
End If
|
||||
If (index > 15) Then
|
||||
Return &H10
|
||||
End If
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
Return index
|
||||
End Function
|
||||
|
||||
Public Function GetQuantizedPixel(ByRef sprite As Bitmap, ByVal x As UInt32, ByVal y As UInt32) As Color
|
||||
Return QuantizeColor(sprite.GetPixel(CInt(x), CInt(y)))
|
||||
End Function
|
||||
|
||||
Public Function GetTop(ByRef bitmap As Bitmap) As Integer
|
||||
Dim num As Integer
|
||||
Dim num4 As Integer = (bitmap.Height - 1)
|
||||
Dim i As Integer = 0
|
||||
Do While (i <= num4)
|
||||
Dim num5 As Integer = (bitmap.Height - 1)
|
||||
Dim j As Integer = 0
|
||||
Do While (j <= num5)
|
||||
If (bitmap.GetPixel(j, i).A > 0) Then
|
||||
Return i
|
||||
End If
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
Return num
|
||||
End Function
|
||||
|
||||
Public Sub LoadBitmapFromArray(ByRef ary As Byte(), ByRef palette As Color(), ByRef bitmap As Bitmap, ByVal width As Integer, ByVal height As Integer)
|
||||
Dim num7 As Double = ((CDbl(bitmap.Height) / 8) - 1)
|
||||
Dim i As Double = 0
|
||||
Do While (i <= num7)
|
||||
Dim num8 As Double = ((CDbl(bitmap.Width) / 8) - 1)
|
||||
Dim j As Double = 0
|
||||
Do While (j <= num8)
|
||||
Dim num5 As Integer = 0
|
||||
Do
|
||||
Dim num6 As Integer = 0
|
||||
Do
|
||||
If ((((i * 8) + num5) < height) And ((((j * 8) + (num6 * 2)) + 1) < width)) Then
|
||||
Dim num2 As Integer
|
||||
Dim num As Byte = ary(num2)
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl((((j * 8) + (num6 * 2)) + 1)))), CInt(Math.Round(CDbl(((i * 8) + num5)))), palette(CByte((num >> 4))))
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl(((j * 8) + (num6 * 2))))), CInt(Math.Round(CDbl(((i * 8) + num5)))), palette((num And 15)))
|
||||
num2 += 1
|
||||
Else
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl((((j * 8) + (num6 * 2)) + 1)))), CInt(Math.Round(CDbl(((i * 8) + num5)))), Color.Transparent)
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl(((j * 8) + (num6 * 2))))), CInt(Math.Round(CDbl(((i * 8) + num5)))), Color.Transparent)
|
||||
End If
|
||||
num6 += 1
|
||||
Loop While (num6 <= 3)
|
||||
num5 += 1
|
||||
Loop While (num5 <= 7)
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Public Sub LoadBitmapFromArray(ByRef ary As Byte(), ByVal offset As UInt32, ByRef palette As Color(), ByRef bitmap As Bitmap, ByVal width As Integer, ByVal height As Integer)
|
||||
Dim index As Integer = CInt(offset)
|
||||
Dim num7 As Double = ((CDbl(bitmap.Height) / 8) - 1)
|
||||
Dim i As Double = 0
|
||||
Do While (i <= num7)
|
||||
Dim num8 As Double = ((CDbl(bitmap.Width) / 8) - 1)
|
||||
Dim j As Double = 0
|
||||
Do While (j <= num8)
|
||||
Dim num5 As Integer = 0
|
||||
Do
|
||||
Dim num6 As Integer = 0
|
||||
Do
|
||||
If ((((i * 8) + num5) < height) And ((((j * 8) + (num6 * 2)) + 1) < width)) Then
|
||||
Dim num As Byte = ary(index)
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl((((j * 8) + (num6 * 2)) + 1)))), CInt(Math.Round(CDbl(((i * 8) + num5)))), palette(CByte((num >> 4))))
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl(((j * 8) + (num6 * 2))))), CInt(Math.Round(CDbl(((i * 8) + num5)))), palette((num And 15)))
|
||||
index += 1
|
||||
Else
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl((((j * 8) + (num6 * 2)) + 1)))), CInt(Math.Round(CDbl(((i * 8) + num5)))), Color.Transparent)
|
||||
bitmap.SetPixel(CInt(Math.Round(CDbl(((j * 8) + (num6 * 2))))), CInt(Math.Round(CDbl(((i * 8) + num5)))), Color.Transparent)
|
||||
End If
|
||||
num6 += 1
|
||||
Loop While (num6 <= 3)
|
||||
num5 += 1
|
||||
Loop While (num5 <= 7)
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
'Public Function LoadLz77CompressedPalette(ByRef Stream As FileStream, ByVal message As Boolean) As Color()
|
||||
' Dim colorArray2 As Color() = New Color(&H10 - 1) {}
|
||||
' Dim buffer As Byte() = RomFunctions.UncompressLZ77(Stream, message)
|
||||
' If (buffer.Length <> 0) Then
|
||||
' Dim index As Integer = 0
|
||||
' Do
|
||||
' Dim num As Integer = buffer(((index * 2) + 1))
|
||||
' num = (num << 8)
|
||||
' num = (num Or buffer((index * 2)))
|
||||
' colorArray2(index) = .RGB16ToColor(num)
|
||||
' index += 1
|
||||
' Loop While (index <= 15)
|
||||
' End If
|
||||
' Return colorArray2
|
||||
'End Function
|
||||
|
||||
'Public Sub LoadLz77CompressedSprite(ByRef Stream As FileStream, ByVal offset As Integer, ByVal palette As Color(), ByRef bitmap As Bitmap)
|
||||
' Dim ary As Byte() = RomFunctions.UncompressLZ77(Stream)
|
||||
' LoadBitmapFromArray(ary, palette, bitmap, &H40, CInt(Math.Round(CDbl((CDbl(ary.Length) / 32)))))
|
||||
'End Sub
|
||||
|
||||
Public Function LoadPaletteFromROM(ByRef streaminput As FileStream) As Color()
|
||||
Dim colorArray2 As Color() = New Color(&H10 - 1) {}
|
||||
Dim index As Integer = 0
|
||||
Do
|
||||
Dim streamvar As Stream = streaminput
|
||||
streamvar = DirectCast(streamvar, FileStream)
|
||||
colorArray2(index) = RGB16ToColor(Conversions.ToInteger(GetWord(streamvar)))
|
||||
index += 1
|
||||
Loop While (index <= 15)
|
||||
Return colorArray2
|
||||
End Function
|
||||
|
||||
Public Function QuantizeColor(ByRef col As Color) As Color
|
||||
If (col.A < &H80) Then
|
||||
Return Color.FromArgb(&HFF, &H70, &HC0, 160)
|
||||
End If
|
||||
Dim r As Byte = col.R
|
||||
Dim g As Byte = col.G
|
||||
Dim b As Byte = col.B
|
||||
r = CByte((r >> 3))
|
||||
g = CByte((g >> 3))
|
||||
b = CByte((b >> 3))
|
||||
r = CByte((r << 3))
|
||||
g = CByte((g << 3))
|
||||
b = CByte((b << 3))
|
||||
Return Color.FromArgb(&HFF, r, g, b)
|
||||
End Function
|
||||
|
||||
Public Function RGB16ToColor(ByVal RGB16 As Integer) As Color
|
||||
Dim red As Byte = CByte(((RGB16 And &H1F) << 3))
|
||||
Dim green As Byte = CByte((((RGB16 >> 5) And &H1F) << 3))
|
||||
Dim blue As Byte = CByte((((RGB16 >> 10) And &H1F) << 3))
|
||||
Return Color.FromArgb(&HFF, red, green, blue)
|
||||
End Function
|
||||
|
||||
Public Function SaveBitmapToArray(ByRef bitmap As Bitmap, ByRef palette As Color()) As Object
|
||||
Dim buffer As Byte() = New Byte((CInt(Math.Round(CDbl(((CDbl((bitmap.Height * bitmap.Width)) / 2) - 1)))) + 1) - 1) {}
|
||||
Dim num8 As Double = ((CDbl(bitmap.Height) / 8) - 1)
|
||||
Dim i As Double = 0
|
||||
Do While (i <= num8)
|
||||
Dim num9 As Double = ((CDbl(bitmap.Width) / 8) - 1)
|
||||
Dim j As Double = 0
|
||||
Do While (j <= num9)
|
||||
Dim num6 As Integer = 0
|
||||
Do
|
||||
Dim num7 As Integer = 0
|
||||
Do
|
||||
Dim num3 As Integer
|
||||
Dim index As Byte = CByte(Array.IndexOf(Of Color)(palette, bitmap.GetPixel(CInt(Math.Round(CDbl(((j * 8) + (num7 * 2))))), CInt(Math.Round(CDbl(((i * 8) + num6)))))))
|
||||
Dim num2 As Byte = CByte(Array.IndexOf(Of Color)(palette, bitmap.GetPixel(CInt(Math.Round(CDbl((((j * 8) + (num7 * 2)) + 1)))), CInt(Math.Round(CDbl(((i * 8) + num6)))))))
|
||||
buffer(num3) = CByte((CByte((num2 << 4)) Or index))
|
||||
num3 += 1
|
||||
num7 += 1
|
||||
Loop While (num7 <= 3)
|
||||
num6 += 1
|
||||
Loop While (num6 <= 7)
|
||||
j += 1
|
||||
Loop
|
||||
i += 1
|
||||
Loop
|
||||
Return buffer
|
||||
End Function
|
||||
|
||||
Public Sub TransparentBitmap(ByRef bitmap As Bitmap)
|
||||
Dim x As Integer = 0
|
||||
Dim y As Integer = 0
|
||||
Dim pixel As Color = bitmap.GetPixel(0, 0)
|
||||
Do While (x < bitmap.Width)
|
||||
Do While (y < bitmap.Height)
|
||||
If (bitmap.GetPixel(x, y) = pixel) Then
|
||||
bitmap.SetPixel(x, y, Color.Transparent)
|
||||
End If
|
||||
y += 1
|
||||
Loop
|
||||
x += 1
|
||||
y = 0
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
|
||||
End Module
|
||||
|
|
@ -1,4 +1,2 @@
|
|||
[Settings]
|
||||
TransparentImages=0
|
||||
DisablePKMImages=0
|
||||
OSisLinux=0
|
||||
|
|
|
|||
|
|
@ -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>yFNEdLpoCUPrbyZX9cLW/pXiof4=</dsig:DigestValue>
|
||||
<dsig:DigestValue>9fQ2fr0Xdrw2YLT3NjMXLm0MeAM=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -43,14 +43,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1738752">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1849344">
|
||||
<assemblyIdentity name="PokemonGameEditor" version="3.5.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>54OEZEIZ//2KSSXrnehGCur8qH8=</dsig:DigestValue>
|
||||
<dsig:DigestValue>GeVPPY2F7TqRoDSZyhxE3TkcPS4=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -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>yFNEdLpoCUPrbyZX9cLW/pXiof4=</dsig:DigestValue>
|
||||
<dsig:DigestValue>9fQ2fr0Xdrw2YLT3NjMXLm0MeAM=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -43,14 +43,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1738752">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1849344">
|
||||
<assemblyIdentity name="PokemonGameEditor" version="3.5.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>54OEZEIZ//2KSSXrnehGCur8qH8=</dsig:DigestValue>
|
||||
<dsig:DigestValue>GeVPPY2F7TqRoDSZyhxE3TkcPS4=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
BIN
GBAPokemonGameEditor/bin/Debug/img/BattlePreviewBackground.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
GBAPokemonGameEditor/bin/Debug/img/BattlePreviewShadow.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
GBAPokemonGameEditor/bin/Debug/img/EMPokedexSize.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
GBAPokemonGameEditor/bin/Debug/img/FRPokedexSize.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
|
@ -94,6 +94,7 @@ PokemonShinyPal=1EB374
|
|||
IconPointerTable=3BBD20
|
||||
IconPalTable=3BC400
|
||||
CryTable=452590
|
||||
CryTable2=4537C0
|
||||
FootPrintTable=3B4EE4
|
||||
PokemonAttackTable=207BC8
|
||||
PokemonEvolutions=203B68
|
||||
|
|
@ -203,12 +204,20 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
MoveTutorAttacks=0
|
||||
CryConversionTable=1FDE6A
|
||||
MoveTutorCompatibility=0
|
||||
EggMoveTable=0
|
||||
EggMoveTableLimiter=41BB8
|
||||
TrainerTable=1F0524
|
||||
NumberOfTrainers=693
|
||||
TrainerClasses=1F0208
|
||||
NumberOfTrainerClasses=58
|
||||
TrainerImageTable=1EC53C
|
||||
NumberOfTrainerImages=82
|
||||
TrainerPaletteTable=1EC7D4
|
||||
DexSizeTrainerSprite=0
|
||||
|
||||
[AXPE]
|
||||
ROMName=Pokémon Sapphire (English)
|
||||
|
|
@ -361,9 +370,16 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
MoveTutorAttacks=0
|
||||
EggMoveTable=0
|
||||
TrainerTable=1F04B4
|
||||
NumberOfTrainers=693
|
||||
TrainerClasses=1F0198
|
||||
NumberOfTrainerClasses=58
|
||||
TrainerImageTable=1EC4CC
|
||||
NumberOfTrainerImages=82
|
||||
TrainerPaletteTable=1EC764
|
||||
|
||||
[BPRE]
|
||||
ROMName=Pokémon Fire Red (English)
|
||||
|
|
@ -482,6 +498,8 @@ PokemonShinyPal=2380CC
|
|||
IconPointerTable=3D37A0
|
||||
IconPalTable=3D3E80
|
||||
CryTable=48C914
|
||||
CryTable2=48DB44
|
||||
CryConversionTable=2539D4
|
||||
FootPrintTable=43FAB0
|
||||
PokemonAttackTable=25D7B4
|
||||
PokemonEvolutions=259754
|
||||
|
|
@ -499,7 +517,6 @@ IconPals=3D3740
|
|||
JamboLearnableMovesTerm=0000FF
|
||||
StartSearchingForSpaceOffset=71A240
|
||||
FreeSpaceSearchInterval=100
|
||||
CryConversionTable=2539D4
|
||||
NumberOfEvolutionsPerPokemon=5
|
||||
NumberOfEvolutionTypes=15
|
||||
EvolutionName0=None
|
||||
|
|
@ -533,11 +550,20 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
EggMoveTable=25EF0C
|
||||
EggMoveTableLimiter=45CC4
|
||||
HabitatTable=452C4C
|
||||
ItemAnimationTable=45FD50
|
||||
ItemAnimationTable=45FD54
|
||||
TrainerTable=23EAF0
|
||||
NumberOfTrainers=742
|
||||
TrainerClasses=23E558
|
||||
NumberOfTrainerClasses=6B
|
||||
TrainerImageTable=23957C
|
||||
NumberOfTrainerImages=147
|
||||
TrainerPaletteTable=239A1C
|
||||
TrainerClassMoney=24F220
|
||||
DexSizeTrainerSprite=135
|
||||
|
||||
[BPGE]
|
||||
ROMName=Pokémon Leaf Green (English)
|
||||
|
|
@ -705,9 +731,17 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
EggMoveTable=0
|
||||
HabitatTable=0
|
||||
TrainerTable=23EACC
|
||||
NumberOfTrainers=742
|
||||
TrainerClasses=23E534
|
||||
NumberOfTrainerClasses=6B
|
||||
TrainerImageTable=239558
|
||||
NumberOfTrainerImages=147
|
||||
TrainerPaletteTable=2399F8
|
||||
TrainerClassMoney=24F1FC
|
||||
|
||||
[BPEE]
|
||||
ROMName=Pokémon Emerald (English)
|
||||
|
|
@ -809,6 +843,8 @@ PokemonAnimations=30A18C
|
|||
IconPointerTable=57BCA8
|
||||
IconPalTable=57C388
|
||||
CryTable=69DCF4
|
||||
CryTable2=69EF24
|
||||
CryConversionTable=31F61C
|
||||
FootPrintTable=56E694
|
||||
PokemonAttackTable=32937C
|
||||
PokemonEvolutions=32531C
|
||||
|
|
@ -836,8 +872,6 @@ NumberOfBattleFrontierTrainers=300
|
|||
NumberOfSlateportBattleTentTrainers=30
|
||||
NumberOfVerdanturfBattleTentTrainers=30
|
||||
NumberOfFallarborBattleTentTrainers=30
|
||||
TrainerClasses=30FCD4
|
||||
NumberOfTrainerClasses=65
|
||||
BattleFrontierPokemon=5D97BC
|
||||
SlateportBattleTentPokemon=5DE02C
|
||||
VerdanturfBattleTentPokemon=5DEC28
|
||||
|
|
@ -922,7 +956,6 @@ NumberOfTilesInTilset3DFDCC=10C
|
|||
NumberOfTilesInTilset3DFDE4=42
|
||||
NumberOfTilesInTilset3DFDFC=30
|
||||
IconPals=DDE1F8
|
||||
CryConversionTable=31F61C
|
||||
ShadowFronts=1000000
|
||||
ShadowPals=1002660
|
||||
ShadowBacks=1007320
|
||||
|
|
@ -962,9 +995,17 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
EggMoveTable=32ADD8
|
||||
EggMoveTableLimiter=70464
|
||||
TrainerTable=310058
|
||||
NumberOfTrainers=854
|
||||
TrainerClasses=30FCD4
|
||||
NumberOfTrainerClasses=66
|
||||
TrainerImageTable=305654
|
||||
NumberOfTrainerImages=92
|
||||
TrainerPaletteTable=30593C
|
||||
DexSizeTrainerSprite=71
|
||||
|
||||
[AXVF]
|
||||
ROMName=Pokémon Rubis (Français)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ Module mMain
|
|||
'These are arrays that keep track of which tiles go where.
|
||||
'There are two because I am using two picture boxes.
|
||||
'I do not know how to draw two images and over lay them to the same picturebox.
|
||||
'I figured it would be easier to just overlay to pictureboxes.
|
||||
'I figured it would be easier to just overlay two pictureboxes.
|
||||
'I just noticed that pictureboxes have a background image... Hmm...
|
||||
Public TilesetBottomLayer As Integer(,)
|
||||
Public TilesetTopLayer As Integer(,)
|
||||
|
|
@ -99,5 +99,104 @@ Module mMain
|
|||
MakeFreeSpaceString = OutBuffThing
|
||||
End Function
|
||||
|
||||
Public Function DecapString(input As String) As String
|
||||
|
||||
Dim LoopVar As Integer
|
||||
Dim outputstring As String = ""
|
||||
Dim capflag As Boolean = True
|
||||
|
||||
LoopVar = 0
|
||||
|
||||
While LoopVar < Len(input)
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
If GetChar(input, LoopVar) = " " Then
|
||||
outputstring = outputstring & " "
|
||||
capflag = True
|
||||
Else
|
||||
If capflag = True Then
|
||||
|
||||
outputstring = outputstring & UCase(GetChar(input, LoopVar))
|
||||
capflag = False
|
||||
|
||||
ElseIf capflag = False
|
||||
|
||||
outputstring = outputstring & LCase(GetChar(input, LoopVar))
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End While
|
||||
|
||||
DecapString = outputstring
|
||||
End Function
|
||||
|
||||
Public Sub OutPutError(message As String)
|
||||
|
||||
Dim errorfile As String = AppPath & "errors.txt"
|
||||
|
||||
System.IO.File.AppendAllText(errorfile, message & vbCrLf)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function ByteToSignedInt(InputByte As Byte) As Integer
|
||||
Dim ReturnVar As Integer
|
||||
|
||||
|
||||
If InputByte > &H7F Then
|
||||
Dim BinaryVar As String = (Convert.ToString(InputByte, 2))
|
||||
ReturnVar = ((Convert.ToInt32(Mid(BinaryVar, 2, 7), 2)) - 128)
|
||||
Else
|
||||
ReturnVar = InputByte
|
||||
End If
|
||||
|
||||
ByteToSignedInt = ReturnVar
|
||||
|
||||
End Function
|
||||
|
||||
Public Function SignedIntToHex(InputInt As Integer) As String
|
||||
|
||||
Dim ReturnVar As String
|
||||
|
||||
|
||||
If InputInt < 0 Then
|
||||
|
||||
Dim BinaryVar As String = (Convert.ToString(InputInt + 128, 2))
|
||||
BinaryVar = "1" & BinaryVar
|
||||
ReturnVar = Hex((Convert.ToInt32(BinaryVar, 2)))
|
||||
|
||||
Else
|
||||
ReturnVar = Hex(InputInt)
|
||||
End If
|
||||
|
||||
SignedIntToHex = ReturnVar
|
||||
|
||||
End Function
|
||||
|
||||
Public Function ByteArrayToHexString(inputarray As Byte()) As String
|
||||
|
||||
Dim HexString As String = ""
|
||||
|
||||
For Each b As Byte In inputarray
|
||||
HexString = HexString & MakeProperByte(b)
|
||||
Next
|
||||
|
||||
ByteArrayToHexString = HexString
|
||||
End Function
|
||||
|
||||
Public Function MakeProperByte(DaByte As Byte) As String
|
||||
Dim OutputByte As String
|
||||
|
||||
|
||||
If Len(Hex(DaByte)) = 1 Then
|
||||
OutputByte = "0" & Hex(DaByte)
|
||||
Else
|
||||
OutputByte = Hex(DaByte)
|
||||
End If
|
||||
|
||||
MakeProperByte = OutputByte
|
||||
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
|
|
|||
1
GBAPokemonGameEditor/movetutor2.Designer.vb
generated
|
|
@ -39,7 +39,6 @@ Partial Class movetutor2
|
|||
'
|
||||
'Combo1
|
||||
'
|
||||
Me.Combo1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
|
||||
Me.Combo1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
|
||||
Me.Combo1.FormattingEnabled = True
|
||||
Me.Combo1.Location = New System.Drawing.Point(54, 152)
|
||||
|
|
|
|||
|
|
@ -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>yFNEdLpoCUPrbyZX9cLW/pXiof4=</dsig:DigestValue>
|
||||
<dsig:DigestValue>9fQ2fr0Xdrw2YLT3NjMXLm0MeAM=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -43,14 +43,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1738752">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1849344">
|
||||
<assemblyIdentity name="PokemonGameEditor" version="3.5.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>54OEZEIZ//2KSSXrnehGCur8qH8=</dsig:DigestValue>
|
||||
<dsig:DigestValue>GeVPPY2F7TqRoDSZyhxE3TkcPS4=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
This is the license agreement for the program Pokemon Game Editor. By using the program or viewing it's code in anyway you agree to the terms described below. This license is written in a such a maner that hopefully most people will understand it.
|
||||
|
||||
1. Re-uploading of this program is not allowed without permission. Websites or individuals that are allowed to do so must link back to the Pokemon Game Editor Github. Any website doing so should also make sure that they are distributing the latest version of the program and keep the download up to date. This permission can be taken away if the license is not followed.
|
||||
1. Re-uploading of this program is not allowed without written permission. Websites or individuals that are allowed to do so must link back to the Pokemon Game Editor Github. Any website doing so should also make sure that they are distributing the latest version of the program and keep the download up to date. This permission can be taken away if the license is not followed.
|
||||
|
||||
2. This program has undergone testing and it is in a working condition but you alone are responsible for what this program does to your computer, files, and anything that results from the program's use.
|
||||
|
||||
|
|
|
|||
55
README.md
|
|
@ -1,6 +1,6 @@
|
|||

|
||||
|
||||
Pokemon Game Editor, commonly know as PGE, is an all in one tool started in 2010 by Gamer2020 for hacking the Game Boy Advanced Pokemon games. The program continues to evolve over the years and has had 60,000+ downloads. The program is currently developed in VB.Net with Visual Studio 2015.
|
||||
Pokemon Game Editor, commonly know as PGE, is an all in one tool started in 2010 by Gamer2020 for hacking the Game Boy Advanced Pokemon games. The program continues to evolve over the years and has had 60,000+ downloads. It has even inspired several copycat programs hence the slogan "Accept no Imitations!" was adopted. The program is currently developed in VB.Net with Visual Studio 2015.
|
||||
|
||||
Screenshots
|
||||
=================
|
||||
|
|
@ -19,19 +19,28 @@ Screenshots
|
|||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Features
|
||||
=================
|
||||
|
||||
Editable INI that contains all the offsets. Each ROM can have it's own INI.
|
||||
|
||||
Pokemon Editor.
|
||||
Pokemon Editor. Data can be imported/exported.
|
||||
|
||||
Attack Editor.
|
||||
Attack Editor. Data can be imported/exported.
|
||||
|
||||
RSE Starter Editor.
|
||||
|
||||
Pokedex Order Editor.
|
||||
|
||||
Ability Editor.
|
||||
Ability Editor. Data can be imported/exported.
|
||||
|
||||
Move Tutor Editor.
|
||||
|
||||
|
|
@ -59,14 +68,32 @@ Habitat editor.
|
|||
|
||||
ROM expander.
|
||||
|
||||
Ability adder.
|
||||
Ability Adder.
|
||||
|
||||
Planned Features
|
||||
=================
|
||||
Pokemon Adder.
|
||||
|
||||
Ability to add more Pokemon.
|
||||
A-series Pokemon sprite sheet Importing/Exporting.
|
||||
|
||||
Improved Pokemon data importing and exporting.
|
||||
Pokemon Icon Importing/Exporting.
|
||||
|
||||
Pokemon Footprint Importing/Exporting.
|
||||
|
||||
Planned Features A.K.A TODO List
|
||||
=========================
|
||||
|
||||
Trade Editor
|
||||
|
||||
Trainer Editor
|
||||
|
||||
Pokemon Cry Importing/Exporting
|
||||
|
||||
OW Editor
|
||||
|
||||
Finish the Battle Frontier Editor
|
||||
|
||||
Improved Item Editor
|
||||
|
||||
Item Adder
|
||||
|
||||
Program Requirements
|
||||
====================
|
||||
|
|
@ -86,16 +113,20 @@ This is a list of recommended programs that should be used with PGE for the best
|
|||
|
||||
MEH - https://github.com/shinyquagsire23/MEH
|
||||
|
||||
SEA - https://github.com/shinyquagsire23/SEA
|
||||
Unofficial_XSE - https://github.com/Gamer2020/Unofficial_XSE/releases
|
||||
|
||||
FSF - https://code.google.com/p/toolsfactory/downloads/detail?name=FreeSpaceFinder-2.0.1.0.zip&can=2&q=
|
||||
|
||||
Unoffical-A-ptch - https://github.com/Gamer2020/Unofficial-A-ptch/releases
|
||||
|
||||
BattleScriptPro - https://github.com/Jambo51/Battle_Script_Pro
|
||||
|
||||
Trainer Editor - https://github.com/Jambo51/Trainer_Editor
|
||||
|
||||
No$GBA - http://problemkaputt.de/gba.htm
|
||||
|
||||
GBA Intro Manager - https://github.com/diegoisawesome/GBAIntroManager/releases
|
||||
|
||||
Developers
|
||||
=================
|
||||
Gamer2020
|
||||
|
|
@ -129,7 +160,7 @@ Jambo51
|
|||
|
||||
JPAN
|
||||
|
||||
Kawa
|
||||
Kawa and the Elite Map team.
|
||||
|
||||
Bulbapedia
|
||||
|
||||
|
|
@ -147,6 +178,8 @@ Downloads
|
|||
================================
|
||||
https://github.com/Gamer2020/PokemonGameEditor/releases
|
||||
|
||||
Please be aware that if you download the program from any other place that it may not be safe and it could possibly contain malware. Downloads from https://github.com/Gamer2020/PokemonGameEditor/releases are official and safe.
|
||||
|
||||
Beta builds
|
||||
================================
|
||||
These are builds that are not recommended for regular use because they contain features that are still in development. These builds are sort of previews of what is currently being worked on.
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
BIN
Screenshots/10.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
Screenshots/11.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 69 KiB |
BIN
Screenshots/8.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
Screenshots/9.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 186 KiB |
61
roms.ini
|
|
@ -94,6 +94,7 @@ PokemonShinyPal=1EB374
|
|||
IconPointerTable=3BBD20
|
||||
IconPalTable=3BC400
|
||||
CryTable=452590
|
||||
CryTable2=4537C0
|
||||
FootPrintTable=3B4EE4
|
||||
PokemonAttackTable=207BC8
|
||||
PokemonEvolutions=203B68
|
||||
|
|
@ -203,12 +204,20 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
MoveTutorAttacks=0
|
||||
CryConversionTable=1FDE6A
|
||||
MoveTutorCompatibility=0
|
||||
EggMoveTable=0
|
||||
EggMoveTableLimiter=41BB8
|
||||
TrainerTable=1F0524
|
||||
NumberOfTrainers=693
|
||||
TrainerClasses=1F0208
|
||||
NumberOfTrainerClasses=58
|
||||
TrainerImageTable=1EC53C
|
||||
NumberOfTrainerImages=82
|
||||
TrainerPaletteTable=1EC7D4
|
||||
DexSizeTrainerSprite=0
|
||||
|
||||
[AXPE]
|
||||
ROMName=Pokémon Sapphire (English)
|
||||
|
|
@ -361,9 +370,16 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
MoveTutorAttacks=0
|
||||
EggMoveTable=0
|
||||
TrainerTable=1F04B4
|
||||
NumberOfTrainers=693
|
||||
TrainerClasses=1F0198
|
||||
NumberOfTrainerClasses=58
|
||||
TrainerImageTable=1EC4CC
|
||||
NumberOfTrainerImages=82
|
||||
TrainerPaletteTable=1EC764
|
||||
|
||||
[BPRE]
|
||||
ROMName=Pokémon Fire Red (English)
|
||||
|
|
@ -482,6 +498,8 @@ PokemonShinyPal=2380CC
|
|||
IconPointerTable=3D37A0
|
||||
IconPalTable=3D3E80
|
||||
CryTable=48C914
|
||||
CryTable2=48DB44
|
||||
CryConversionTable=2539D4
|
||||
FootPrintTable=43FAB0
|
||||
PokemonAttackTable=25D7B4
|
||||
PokemonEvolutions=259754
|
||||
|
|
@ -499,7 +517,6 @@ IconPals=3D3740
|
|||
JamboLearnableMovesTerm=0000FF
|
||||
StartSearchingForSpaceOffset=71A240
|
||||
FreeSpaceSearchInterval=100
|
||||
CryConversionTable=2539D4
|
||||
NumberOfEvolutionsPerPokemon=5
|
||||
NumberOfEvolutionTypes=15
|
||||
EvolutionName0=None
|
||||
|
|
@ -533,11 +550,20 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
EggMoveTable=25EF0C
|
||||
EggMoveTableLimiter=45CC4
|
||||
HabitatTable=452C4C
|
||||
ItemAnimationTable=45FD50
|
||||
ItemAnimationTable=45FD54
|
||||
TrainerTable=23EAF0
|
||||
NumberOfTrainers=742
|
||||
TrainerClasses=23E558
|
||||
NumberOfTrainerClasses=6B
|
||||
TrainerImageTable=23957C
|
||||
NumberOfTrainerImages=147
|
||||
TrainerPaletteTable=239A1C
|
||||
TrainerClassMoney=24F220
|
||||
DexSizeTrainerSprite=135
|
||||
|
||||
[BPGE]
|
||||
ROMName=Pokémon Leaf Green (English)
|
||||
|
|
@ -705,9 +731,17 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
EggMoveTable=0
|
||||
HabitatTable=0
|
||||
TrainerTable=23EACC
|
||||
NumberOfTrainers=742
|
||||
TrainerClasses=23E534
|
||||
NumberOfTrainerClasses=6B
|
||||
TrainerImageTable=239558
|
||||
NumberOfTrainerImages=147
|
||||
TrainerPaletteTable=2399F8
|
||||
TrainerClassMoney=24F1FC
|
||||
|
||||
[BPEE]
|
||||
ROMName=Pokémon Emerald (English)
|
||||
|
|
@ -809,6 +843,8 @@ PokemonAnimations=30A18C
|
|||
IconPointerTable=57BCA8
|
||||
IconPalTable=57C388
|
||||
CryTable=69DCF4
|
||||
CryTable2=69EF24
|
||||
CryConversionTable=31F61C
|
||||
FootPrintTable=56E694
|
||||
PokemonAttackTable=32937C
|
||||
PokemonEvolutions=32531C
|
||||
|
|
@ -836,8 +872,6 @@ NumberOfBattleFrontierTrainers=300
|
|||
NumberOfSlateportBattleTentTrainers=30
|
||||
NumberOfVerdanturfBattleTentTrainers=30
|
||||
NumberOfFallarborBattleTentTrainers=30
|
||||
TrainerClasses=30FCD4
|
||||
NumberOfTrainerClasses=65
|
||||
BattleFrontierPokemon=5D97BC
|
||||
SlateportBattleTentPokemon=5DE02C
|
||||
VerdanturfBattleTentPokemon=5DEC28
|
||||
|
|
@ -922,7 +956,6 @@ NumberOfTilesInTilset3DFDCC=10C
|
|||
NumberOfTilesInTilset3DFDE4=42
|
||||
NumberOfTilesInTilset3DFDFC=30
|
||||
IconPals=DDE1F8
|
||||
CryConversionTable=31F61C
|
||||
ShadowFronts=1000000
|
||||
ShadowPals=1002660
|
||||
ShadowBacks=1007320
|
||||
|
|
@ -962,9 +995,17 @@ Evolution11Param=level
|
|||
Evolution12Param=level
|
||||
Evolution13Param=evolvesbutnoparms
|
||||
Evolution14Param=level
|
||||
Evolution15Param=evolvesbutnoparms
|
||||
Evolution15Param=evolvesbasedonvalue
|
||||
EggMoveTable=32ADD8
|
||||
EggMoveTableLimiter=70464
|
||||
TrainerTable=310058
|
||||
NumberOfTrainers=854
|
||||
TrainerClasses=30FCD4
|
||||
NumberOfTrainerClasses=66
|
||||
TrainerImageTable=305654
|
||||
NumberOfTrainerImages=92
|
||||
TrainerPaletteTable=30593C
|
||||
DexSizeTrainerSprite=71
|
||||
|
||||
[AXVF]
|
||||
ROMName=Pokémon Rubis (Français)
|
||||
|
|
|
|||