mirror of
https://github.com/Gamer2020/PokemonGameEditor.git
synced 2026-07-19 08:52:50 -05:00
Started importing cry code
I've started adding code for importing cries.
This commit is contained in:
parent
4c7c0173a7
commit
adad1bbceb
Binary file not shown.
|
|
@ -240,4 +240,218 @@ Module CryFunctions
|
|||
End Using
|
||||
End Sub
|
||||
|
||||
Public Function ImportCry(filename As String, CryToLoad As Cry) As Cry
|
||||
|
||||
'If Cry.Offset = 0 Then
|
||||
' Return
|
||||
'End If
|
||||
|
||||
' load a wave file
|
||||
Using reader = New BinaryReader(File.OpenRead(filename))
|
||||
' read RIFF header
|
||||
If reader.ReadUInt32() <> &H46464952 Then
|
||||
Throw New Exception("This is not a WAVE file!")
|
||||
End If
|
||||
If reader.ReadInt32() + 8 <> reader.BaseStream.Length Then
|
||||
Throw New Exception("Invalid file length!")
|
||||
End If
|
||||
If reader.ReadUInt32() <> &H45564157 Then
|
||||
Throw New Exception("This is not a WAVE file!")
|
||||
End If
|
||||
|
||||
' read fmt chunk
|
||||
If reader.ReadUInt32() <> &H20746D66 Then
|
||||
Throw New Exception("Expected fmt chunk!")
|
||||
End If
|
||||
If reader.ReadInt32() <> 16 Then
|
||||
Throw New Exception("Invalid fmt chunk!")
|
||||
End If
|
||||
If reader.ReadInt16() <> 1 Then
|
||||
' only PCM format allowed
|
||||
Throw New Exception("Cry must be in PCM format!")
|
||||
End If
|
||||
If reader.ReadInt16() <> 1 Then
|
||||
' only 1 channel allowed
|
||||
Throw New Exception("Cry cannot have more than one channel!")
|
||||
End If
|
||||
CryToLoad.SampleRate = reader.ReadInt32()
|
||||
If reader.ReadInt32() <> CryToLoad.SampleRate Then
|
||||
Throw New Exception("Invalid fmt chunk!")
|
||||
End If
|
||||
reader.ReadUInt16()
|
||||
Dim bitsPerSample = reader.ReadUInt16()
|
||||
If bitsPerSample <> 8 Then
|
||||
' for now, only 8 bit PCM data
|
||||
Throw New Exception("Cries must be 8-bit WAVE files! Got {bitsPerSample}-bit instead.")
|
||||
End If
|
||||
|
||||
' data chunk
|
||||
If reader.ReadUInt32() <> &H61746164 Then
|
||||
Throw New Exception("Expected data chunk!!")
|
||||
End If
|
||||
Dim dataSize = reader.ReadInt32()
|
||||
|
||||
CryToLoad.Data = New SByte(dataSize - 1) {}
|
||||
For i As Integer = 0 To dataSize - 1
|
||||
' read 8-bit unsigned PCM and convert to GBA signed form
|
||||
CryToLoad.Data(i) = CSByte(reader.ReadByte() - 128)
|
||||
Next
|
||||
End Using
|
||||
|
||||
' resetting some other properties just in case
|
||||
CryToLoad.Looped = False
|
||||
CryToLoad.LoopStart = 0
|
||||
|
||||
Return CryToLoad
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SaveCry(crytosave As Cry, index As Integer, cryTable As Integer) As Boolean
|
||||
|
||||
If crytosave.Offset = 0 Then
|
||||
Return False
|
||||
End If
|
||||
'var lookup = new byte[] { 0x0, 0x1, 0x4, 0x9, 0x10, 0x19, 0x24, 0x31, 0xC0, 0xCF, 0xDC, 0xE7, 0xF0, 0xF7, 0xFC, 0xFF };
|
||||
Dim lookup = New SByte() {0, 1, 4, 9, 16, 25, _
|
||||
36, 49, -64, -49, -36, -25, _
|
||||
-16, -9, -4, -1}
|
||||
|
||||
' copy cry data to be written
|
||||
Dim data = New List(Of Byte)()
|
||||
If crytosave.Compressed Then
|
||||
' data is compressed in blocks of 1 + 0x20 bytes at a time
|
||||
' first byte is normal signed PCM data
|
||||
' following 0x20 bytes are compressed based on previous value
|
||||
' (for a value not in lookup table, closest value will be chosen instead)
|
||||
'Console.WriteLine("compressed");
|
||||
|
||||
' each block has 0x40 samples
|
||||
Dim blockCount = crytosave.Data.Length / &H40
|
||||
If crytosave.Data.Length Mod &H40 > 0 Then
|
||||
blockCount += 1
|
||||
End If
|
||||
|
||||
' truncates the length of the last block
|
||||
' so we don't waste space
|
||||
Dim lastBlockSize = crytosave.Data.Length - crytosave.Data.Length / &H40 * &H40
|
||||
If lastBlockSize = 0 Then
|
||||
lastBlockSize = &H21
|
||||
Else
|
||||
lastBlockSize = 1 + (lastBlockSize / 2) + (If(lastBlockSize Mod 2 = 0, 0, 1))
|
||||
End If
|
||||
|
||||
Dim blocks = New Byte(blockCount - 1)() {}
|
||||
For n As Integer = 0 To blockCount - 1
|
||||
' create new block
|
||||
If n < blockCount - 1 Then
|
||||
blocks(n) = New Byte(32) {}
|
||||
Else
|
||||
blocks(n) = New Byte(lastBlockSize - 1) {}
|
||||
End If
|
||||
|
||||
Dim i As Integer = n * &H40
|
||||
Dim k As Integer = 0
|
||||
|
||||
' set first value
|
||||
blocks(n)(System.Math.Max(System.Threading.Interlocked.Increment(k), k - 1)) = CByte(crytosave.Data(i))
|
||||
Dim pcm As SByte = crytosave.Data(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1))
|
||||
|
||||
Dim j As Integer = 1
|
||||
While j < &H40 AndAlso i < crytosave.Data.Length
|
||||
' get current sample
|
||||
Dim sample = crytosave.Data(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1))
|
||||
|
||||
' difference between previous sample and this
|
||||
Dim diff = sample - pcm
|
||||
|
||||
' check for a perfect match in lookup table
|
||||
Dim lookupI = -1
|
||||
For x As Integer = 0 To 15
|
||||
If lookup(x) = diff Then
|
||||
lookupI = x
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
' search for the closest match in the table
|
||||
If lookupI = -1 Then
|
||||
Dim bestDiff = 255
|
||||
For x As Integer = 0 To 15
|
||||
If Math.Abs(lookup(x) - diff) < bestDiff Then
|
||||
lookupI = x
|
||||
bestDiff = Math.Abs(lookup(x) - diff)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
' set value in block
|
||||
' on an odd value, increase position in block
|
||||
If j Mod 2 = 0 Then
|
||||
blocks(n)(k) = blocks(n)(k) Or CByte(lookupI << 4)
|
||||
Else
|
||||
blocks(n)(System.Math.Max(System.Threading.Interlocked.Increment(k), k - 1)) = blocks(n)(System.Math.Max(System.Threading.Interlocked.Increment(k), k - 1)) Or CByte(lookupI)
|
||||
End If
|
||||
|
||||
' set previous
|
||||
pcm = sample
|
||||
j += 1
|
||||
End While
|
||||
Next
|
||||
|
||||
For n As Integer = 0 To blockCount - 1
|
||||
data.AddRange(blocks(n))
|
||||
Next
|
||||
Else
|
||||
' uncompressed, copy directly to data
|
||||
'Console.WriteLine("uncompressed");
|
||||
For Each s As SByte In crytosave.Data
|
||||
data.Add(CByte(s))
|
||||
Next
|
||||
End If
|
||||
|
||||
' determine if cry requires repointing
|
||||
If crytosave.Size < data.Count Then
|
||||
' find a new offset for our cry
|
||||
|
||||
' overwrite old cry with FF bytes
|
||||
'rom.Seek(Cry.Offset)
|
||||
'For i As Integer = 0 To 15
|
||||
' ' header
|
||||
' rom.WriteByte(Byte.MaxValue)
|
||||
'Next
|
||||
'For i As Integer = 0 To Cry.Size - 1
|
||||
' ' cry data
|
||||
' rom.WriteByte(Byte.MaxValue)
|
||||
'Next
|
||||
|
||||
' set new cry offset
|
||||
crytosave.Offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (((data.Count) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
|
||||
|
||||
End If
|
||||
|
||||
'' write cry
|
||||
'rom.Seek(Cry.Offset)
|
||||
'rom.WriteUInt16(CUShort(If(Cry.Compressed, 1, 0)))
|
||||
'rom.WriteUInt16(CUShort(If(Cry.Looped, &H4000, 0)))
|
||||
'rom.WriteInt32(Cry.SampleRate << 10)
|
||||
'rom.WriteInt32(Cry.LoopStart)
|
||||
'rom.WriteInt32(Cry.Data.Length - 1)
|
||||
'rom.WriteBytes(data.ToArray())
|
||||
|
||||
'' write cry table entry
|
||||
'rom.Seek(cryTable + Cry.Index * 12)
|
||||
'rom.WriteUInt32(If(Cry.Compressed, &H3C20UI, &H3C00UI))
|
||||
'rom.WritePointer(Cry.Offset)
|
||||
'rom.WriteUInt32(&HFF00FFUI)
|
||||
|
||||
'' write growl table entry
|
||||
'rom.Seek(growlTable + Cry.Index * 12)
|
||||
'rom.WriteUInt32(If(Cry.Compressed, &H3C30UI, &H3C00UI))
|
||||
'' !!! not sure if 00 should be used for uncompressed
|
||||
'rom.WritePointer(Cry.Offset)
|
||||
'rom.WriteUInt32(&HFF00FFUI)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
|
|
|||
|
|
@ -409,6 +409,18 @@
|
|||
<Content Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetName).exe" "\\GAMER2020-PC\Users\Gamer2020\PGE\$(TargetName).exe"
|
||||
copy /Y "$(TargetDir)img\BattlePreviewBackground.png" "\\GAMER2020-PC\Users\Gamer2020\PGE\img\BattlePreviewBackground.png"
|
||||
copy /Y "$(TargetDir)img\BattlePreviewShadow.png" "\\GAMER2020-PC\Users\Gamer2020\PGE\img\BattlePreviewShadow.png"
|
||||
copy /Y "$(TargetDir)img\EMPokedexSize.png" "\\GAMER2020-PC\Users\Gamer2020\PGE\img\EMPokedexSize.png"
|
||||
copy /Y "$(TargetDir)img\FRPokedexSize.png" "\\GAMER2020-PC\Users\Gamer2020\PGE\img\FRPokedexSize.png"
|
||||
copy /Y "$(TargetDir)ini\roms.ini" "\\GAMER2020-PC\Users\Gamer2020\PGE\ini\roms.ini"
|
||||
copy /Y "$(TargetDir)txt\PGEAttackEffects.txt" "\\GAMER2020-PC\Users\Gamer2020\PGE\txt\PGEAttackEffects.txt"
|
||||
copy /Y "$(TargetDir)txt\PGEHabitats.txt" "\\GAMER2020-PC\Users\Gamer2020\PGE\txt\PGEHabitats.txt"
|
||||
copy /Y "$(TargetDir)txt\PGENatures.txt" "\\GAMER2020-PC\Users\Gamer2020\PGE\txt\PGENatures.txt"
|
||||
copy /Y "$(TargetDir)txt\PGETypeList.txt" "\\GAMER2020-PC\Users\Gamer2020\PGE\txt\PGETypeList.txt"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<PublishUrlHistory>publish\|C:\Users\Gamer2020\Desktop\Test\|C:\Users\Gamer2020\Desktop\Pub\|http://gamer2020.0xrh.net/programs/GBAPokemonGameEditor/|C:\Users\Gamer2020\Desktop\</PublishUrlHistory>
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<UpdateUrlHistory>http://gamer2020.0xrh.net/programs/GBAPokemonGameEditor/</UpdateUrlHistory>
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
|
|
|
|||
158
GBAPokemonGameEditor/Pokemonedit.Designer.vb
generated
158
GBAPokemonGameEditor/Pokemonedit.Designer.vb
generated
|
|
@ -218,6 +218,9 @@ Partial Class Pokemonedit
|
|||
Me.Clr1 = New System.Windows.Forms.ComboBox()
|
||||
Me.TabPage5 = New System.Windows.Forms.TabPage()
|
||||
Me.GroupBox35 = New System.Windows.Forms.GroupBox()
|
||||
Me.Button35 = New System.Windows.Forms.Button()
|
||||
Me.Button36 = New System.Windows.Forms.Button()
|
||||
Me.Button37 = New System.Windows.Forms.Button()
|
||||
Me.Panel2 = New System.Windows.Forms.Panel()
|
||||
Me.pSample2 = New System.Windows.Forms.PictureBox()
|
||||
Me.chkCompressed2 = New System.Windows.Forms.CheckBox()
|
||||
|
|
@ -229,6 +232,8 @@ Partial Class Pokemonedit
|
|||
Me.CryComp2 = New System.Windows.Forms.TextBox()
|
||||
Me.CryPointer2 = New System.Windows.Forms.TextBox()
|
||||
Me.GroupBox34 = New System.Windows.Forms.GroupBox()
|
||||
Me.Button34 = New System.Windows.Forms.Button()
|
||||
Me.Button33 = New System.Windows.Forms.Button()
|
||||
Me.Button32 = New System.Windows.Forms.Button()
|
||||
Me.chkCompressed1 = New System.Windows.Forms.CheckBox()
|
||||
Me.panel1 = New System.Windows.Forms.Panel()
|
||||
|
|
@ -267,11 +272,8 @@ Partial Class Pokemonedit
|
|||
Me.Button28 = New System.Windows.Forms.Button()
|
||||
Me.Button29 = New System.Windows.Forms.Button()
|
||||
Me.Button30 = New System.Windows.Forms.Button()
|
||||
Me.Button33 = New System.Windows.Forms.Button()
|
||||
Me.Button34 = New System.Windows.Forms.Button()
|
||||
Me.Button35 = New System.Windows.Forms.Button()
|
||||
Me.Button36 = New System.Windows.Forms.Button()
|
||||
Me.Button37 = New System.Windows.Forms.Button()
|
||||
Me.Button38 = New System.Windows.Forms.Button()
|
||||
Me.Button39 = New System.Windows.Forms.Button()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
Me.TabPage1.SuspendLayout()
|
||||
Me.GroupBox26.SuspendLayout()
|
||||
|
|
@ -2482,6 +2484,33 @@ Partial Class Pokemonedit
|
|||
Me.GroupBox35.TabStop = False
|
||||
Me.GroupBox35.Text = "Growl Cry"
|
||||
'
|
||||
'Button35
|
||||
'
|
||||
Me.Button35.Location = New System.Drawing.Point(380, 212)
|
||||
Me.Button35.Name = "Button35"
|
||||
Me.Button35.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button35.TabIndex = 30
|
||||
Me.Button35.Text = "Export"
|
||||
Me.Button35.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button36
|
||||
'
|
||||
Me.Button36.Location = New System.Drawing.Point(299, 211)
|
||||
Me.Button36.Name = "Button36"
|
||||
Me.Button36.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button36.TabIndex = 29
|
||||
Me.Button36.Text = "Import"
|
||||
Me.Button36.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button37
|
||||
'
|
||||
Me.Button37.Location = New System.Drawing.Point(218, 212)
|
||||
Me.Button37.Name = "Button37"
|
||||
Me.Button37.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button37.TabIndex = 28
|
||||
Me.Button37.Text = "Play"
|
||||
Me.Button37.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Panel2
|
||||
'
|
||||
Me.Panel2.AutoScroll = True
|
||||
|
|
@ -2595,6 +2624,24 @@ Partial Class Pokemonedit
|
|||
Me.GroupBox34.TabStop = False
|
||||
Me.GroupBox34.Text = "Normal Cry"
|
||||
'
|
||||
'Button34
|
||||
'
|
||||
Me.Button34.Location = New System.Drawing.Point(380, 211)
|
||||
Me.Button34.Name = "Button34"
|
||||
Me.Button34.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button34.TabIndex = 27
|
||||
Me.Button34.Text = "Export"
|
||||
Me.Button34.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button33
|
||||
'
|
||||
Me.Button33.Location = New System.Drawing.Point(299, 211)
|
||||
Me.Button33.Name = "Button33"
|
||||
Me.Button33.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button33.TabIndex = 26
|
||||
Me.Button33.Text = "Import"
|
||||
Me.Button33.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button32
|
||||
'
|
||||
Me.Button32.Location = New System.Drawing.Point(218, 211)
|
||||
|
|
@ -2837,20 +2884,20 @@ Partial Class Pokemonedit
|
|||
'
|
||||
'Button7
|
||||
'
|
||||
Me.Button7.Location = New System.Drawing.Point(11, 320)
|
||||
Me.Button7.Location = New System.Drawing.Point(11, 316)
|
||||
Me.Button7.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button7.Name = "Button7"
|
||||
Me.Button7.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button7.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button7.TabIndex = 9
|
||||
Me.Button7.Text = "Import Pokemon"
|
||||
Me.Button7.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button8
|
||||
'
|
||||
Me.Button8.Location = New System.Drawing.Point(11, 378)
|
||||
Me.Button8.Location = New System.Drawing.Point(11, 368)
|
||||
Me.Button8.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button8.Name = "Button8"
|
||||
Me.Button8.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button8.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button8.TabIndex = 10
|
||||
Me.Button8.Text = "Export Pokemon"
|
||||
Me.Button8.UseVisualStyleBackColor = True
|
||||
|
|
@ -2861,10 +2908,10 @@ Partial Class Pokemonedit
|
|||
'
|
||||
'Button9
|
||||
'
|
||||
Me.Button9.Location = New System.Drawing.Point(11, 406)
|
||||
Me.Button9.Location = New System.Drawing.Point(11, 395)
|
||||
Me.Button9.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button9.Name = "Button9"
|
||||
Me.Button9.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button9.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button9.TabIndex = 11
|
||||
Me.Button9.Text = "Export All Pokemon"
|
||||
Me.Button9.UseVisualStyleBackColor = True
|
||||
|
|
@ -2880,124 +2927,101 @@ Partial Class Pokemonedit
|
|||
'
|
||||
'Button14
|
||||
'
|
||||
Me.Button14.Location = New System.Drawing.Point(11, 348)
|
||||
Me.Button14.Location = New System.Drawing.Point(11, 342)
|
||||
Me.Button14.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button14.Name = "Button14"
|
||||
Me.Button14.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button14.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button14.TabIndex = 13
|
||||
Me.Button14.Text = "Import All Pokemon"
|
||||
Me.Button14.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button25
|
||||
'
|
||||
Me.Button25.Location = New System.Drawing.Point(11, 434)
|
||||
Me.Button25.Location = New System.Drawing.Point(11, 422)
|
||||
Me.Button25.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button25.Name = "Button25"
|
||||
Me.Button25.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button25.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button25.TabIndex = 14
|
||||
Me.Button25.Text = "Import All Sprite sheets"
|
||||
Me.Button25.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button26
|
||||
'
|
||||
Me.Button26.Location = New System.Drawing.Point(11, 463)
|
||||
Me.Button26.Location = New System.Drawing.Point(11, 448)
|
||||
Me.Button26.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button26.Name = "Button26"
|
||||
Me.Button26.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button26.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button26.TabIndex = 15
|
||||
Me.Button26.Text = "Export All Sprite sheets"
|
||||
Me.Button26.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button27
|
||||
'
|
||||
Me.Button27.Location = New System.Drawing.Point(11, 522)
|
||||
Me.Button27.Location = New System.Drawing.Point(11, 500)
|
||||
Me.Button27.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button27.Name = "Button27"
|
||||
Me.Button27.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button27.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button27.TabIndex = 17
|
||||
Me.Button27.Text = "Export All Icons"
|
||||
Me.Button27.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button28
|
||||
'
|
||||
Me.Button28.Location = New System.Drawing.Point(11, 492)
|
||||
Me.Button28.Location = New System.Drawing.Point(11, 474)
|
||||
Me.Button28.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button28.Name = "Button28"
|
||||
Me.Button28.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button28.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button28.TabIndex = 16
|
||||
Me.Button28.Text = "Import All Icons"
|
||||
Me.Button28.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button29
|
||||
'
|
||||
Me.Button29.Location = New System.Drawing.Point(11, 580)
|
||||
Me.Button29.Location = New System.Drawing.Point(11, 551)
|
||||
Me.Button29.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button29.Name = "Button29"
|
||||
Me.Button29.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button29.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button29.TabIndex = 19
|
||||
Me.Button29.Text = "Export All Footprints"
|
||||
Me.Button29.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button30
|
||||
'
|
||||
Me.Button30.Location = New System.Drawing.Point(11, 551)
|
||||
Me.Button30.Location = New System.Drawing.Point(11, 525)
|
||||
Me.Button30.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button30.Name = "Button30"
|
||||
Me.Button30.Size = New System.Drawing.Size(173, 25)
|
||||
Me.Button30.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button30.TabIndex = 18
|
||||
Me.Button30.Text = "Import All Footprints"
|
||||
Me.Button30.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button33
|
||||
'Button38
|
||||
'
|
||||
Me.Button33.Location = New System.Drawing.Point(299, 211)
|
||||
Me.Button33.Name = "Button33"
|
||||
Me.Button33.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button33.TabIndex = 26
|
||||
Me.Button33.Text = "Import"
|
||||
Me.Button33.UseVisualStyleBackColor = True
|
||||
Me.Button38.Location = New System.Drawing.Point(11, 602)
|
||||
Me.Button38.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button38.Name = "Button38"
|
||||
Me.Button38.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button38.TabIndex = 21
|
||||
Me.Button38.Text = "Export All Cries"
|
||||
Me.Button38.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button34
|
||||
'Button39
|
||||
'
|
||||
Me.Button34.Location = New System.Drawing.Point(380, 211)
|
||||
Me.Button34.Name = "Button34"
|
||||
Me.Button34.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button34.TabIndex = 27
|
||||
Me.Button34.Text = "Export"
|
||||
Me.Button34.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button35
|
||||
'
|
||||
Me.Button35.Location = New System.Drawing.Point(380, 212)
|
||||
Me.Button35.Name = "Button35"
|
||||
Me.Button35.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button35.TabIndex = 30
|
||||
Me.Button35.Text = "Export"
|
||||
Me.Button35.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button36
|
||||
'
|
||||
Me.Button36.Location = New System.Drawing.Point(299, 211)
|
||||
Me.Button36.Name = "Button36"
|
||||
Me.Button36.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button36.TabIndex = 29
|
||||
Me.Button36.Text = "Import"
|
||||
Me.Button36.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button37
|
||||
'
|
||||
Me.Button37.Location = New System.Drawing.Point(218, 212)
|
||||
Me.Button37.Name = "Button37"
|
||||
Me.Button37.Size = New System.Drawing.Size(75, 33)
|
||||
Me.Button37.TabIndex = 28
|
||||
Me.Button37.Text = "Play"
|
||||
Me.Button37.UseVisualStyleBackColor = True
|
||||
Me.Button39.Location = New System.Drawing.Point(11, 576)
|
||||
Me.Button39.Margin = New System.Windows.Forms.Padding(4)
|
||||
Me.Button39.Name = "Button39"
|
||||
Me.Button39.Size = New System.Drawing.Size(173, 23)
|
||||
Me.Button39.TabIndex = 20
|
||||
Me.Button39.Text = "Import All Cries"
|
||||
Me.Button39.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Pokemonedit
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(1043, 690)
|
||||
Me.Controls.Add(Me.Button38)
|
||||
Me.Controls.Add(Me.Button39)
|
||||
Me.Controls.Add(Me.Button29)
|
||||
Me.Controls.Add(Me.Button30)
|
||||
Me.Controls.Add(Me.Button27)
|
||||
|
|
@ -3365,4 +3389,6 @@ Partial Class Pokemonedit
|
|||
Friend WithEvents Button37 As System.Windows.Forms.Button
|
||||
Friend WithEvents Button34 As System.Windows.Forms.Button
|
||||
Friend WithEvents Button33 As System.Windows.Forms.Button
|
||||
Friend WithEvents Button38 As System.Windows.Forms.Button
|
||||
Friend WithEvents Button39 As System.Windows.Forms.Button
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -716,8 +716,8 @@ Public Class Pokemonedit
|
|||
chkCompressed1.Checked = False
|
||||
chkCompressed2.Checked = False
|
||||
|
||||
pSample.Image.Dispose()
|
||||
pSample2.Image.Dispose()
|
||||
'pSample.Image.Dispose()
|
||||
'pSample2.Image.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
|
|
@ -3828,4 +3828,110 @@ Public Class Pokemonedit
|
|||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button33_Click(sender As Object, e As EventArgs) Handles Button33.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 = "wav"
|
||||
|
||||
' 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 =
|
||||
"(*.wav)|*.wav*"
|
||||
|
||||
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 Cry to import"
|
||||
|
||||
' Only accept valid Win32 file names?
|
||||
fileOpenDialog.ValidateNames = True
|
||||
|
||||
|
||||
If fileOpenDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
|
||||
Me.Text = "Please wait..."
|
||||
Me.Enabled = False
|
||||
|
||||
crynorm = ImportCry(fileOpenDialog.FileName, crynorm)
|
||||
|
||||
'ImportPokemonFootPrint(fileOpenDialog.FileName, PKMNames.SelectedIndex + 1)
|
||||
|
||||
'GetAndDrawPokemonFootPrint(PictureBox1, PKMNames.SelectedIndex + 1)
|
||||
|
||||
Me.Text = "Pokemon Editor"
|
||||
Me.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button38_Click(sender As Object, e As EventArgs) Handles Button38.Click
|
||||
FolderBrowserDialog.Description = "Select folder to export all Cries 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 & "\Cries") = False Then
|
||||
CreateDirectory(FolderBrowserDialog.SelectedPath & "\Cries")
|
||||
End If
|
||||
|
||||
Dim LoopVar As Integer
|
||||
|
||||
LoopVar = 0
|
||||
Me.Enabled = False
|
||||
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfPokemon", "")) - 1 = True
|
||||
PKMNames.SelectedIndex = LoopVar
|
||||
|
||||
LoopVar = LoopVar + 1
|
||||
|
||||
ExportCry(FolderBrowserDialog.SelectedPath & "\Cries\" & LoopVar & ".wav", crynorm)
|
||||
|
||||
ProgressBar.Value = (LoopVar / (GetString(GetINIFileLocation(), header, "NumberOfPokemon", ""))) * 100
|
||||
Me.Refresh()
|
||||
End While
|
||||
|
||||
Me.Text = "Pokemon Editor"
|
||||
Me.UseWaitCursor = False
|
||||
Me.Enabled = True
|
||||
ProgressBar.Visible = False
|
||||
Me.BringToFront()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button36_Click(sender As Object, e As EventArgs) Handles Button36.Click
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub chkCompressed1_CheckedChanged(sender As Object, e As EventArgs) Handles chkCompressed1.CheckedChanged
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
|
@ -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#sha256" />
|
||||
<dsig:DigestValue>SBrRbZ8u/DVQqIBKdscjmLSX83CHGmDm8MT7Nzknq/4=</dsig:DigestValue>
|
||||
<dsig:DigestValue>Yl/TSKg/G5+JnMnfoHwoYd7IRcDKJUyNJdMrtZKRSmk=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -43,14 +43,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2022400">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2026496">
|
||||
<assemblyIdentity name="PokemonGameEditor" version="3.7.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#sha256" />
|
||||
<dsig:DigestValue>ytlUc7etDRo6JcZECVTvZje22CeYY2nX3QpMB/xaPZY=</dsig:DigestValue>
|
||||
<dsig:DigestValue>SgtvSUVRnm3JFoeP2ND79oI8uLUWRc7MQo+2mwipSts=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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#sha256" />
|
||||
<dsig:DigestValue>SBrRbZ8u/DVQqIBKdscjmLSX83CHGmDm8MT7Nzknq/4=</dsig:DigestValue>
|
||||
<dsig:DigestValue>Yl/TSKg/G5+JnMnfoHwoYd7IRcDKJUyNJdMrtZKRSmk=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -43,14 +43,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2022400">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2026496">
|
||||
<assemblyIdentity name="PokemonGameEditor" version="3.7.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#sha256" />
|
||||
<dsig:DigestValue>ytlUc7etDRo6JcZECVTvZje22CeYY2nX3QpMB/xaPZY=</dsig:DigestValue>
|
||||
<dsig:DigestValue>SgtvSUVRnm3JFoeP2ND79oI8uLUWRc7MQo+2mwipSts=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -184,15 +184,11 @@ C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x
|
|||
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TradeEditor.resources
|
||||
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexListEditor.resources
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe.config
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.exe
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.xml
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.pdb
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe.manifest
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.application
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.pdb
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.xml
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbprojResolveAssemblyReference.cache
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AbilityAdder.resources
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AbilityEdit.resources
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AboutBox1.resources
|
||||
|
|
@ -221,3 +217,6 @@ D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEdi
|
|||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TrustInfo.xml
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.exe.manifest
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.application
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.exe
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.xml
|
||||
D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.pdb
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -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#sha256" />
|
||||
<dsig:DigestValue>SBrRbZ8u/DVQqIBKdscjmLSX83CHGmDm8MT7Nzknq/4=</dsig:DigestValue>
|
||||
<dsig:DigestValue>Yl/TSKg/G5+JnMnfoHwoYd7IRcDKJUyNJdMrtZKRSmk=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -43,14 +43,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2022400">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2026496">
|
||||
<assemblyIdentity name="PokemonGameEditor" version="3.7.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#sha256" />
|
||||
<dsig:DigestValue>ytlUc7etDRo6JcZECVTvZje22CeYY2nX3QpMB/xaPZY=</dsig:DigestValue>
|
||||
<dsig:DigestValue>SgtvSUVRnm3JFoeP2ND79oI8uLUWRc7MQo+2mwipSts=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue
Block a user