diff --git a/.vs/GBAPokemonGameEditor/v14/.suo b/.vs/GBAPokemonGameEditor/v14/.suo
index c6603cc..3e82bc6 100644
Binary files a/.vs/GBAPokemonGameEditor/v14/.suo and b/.vs/GBAPokemonGameEditor/v14/.suo differ
diff --git a/GBAPokemonGameEditor/CryFunctions.vb b/GBAPokemonGameEditor/CryFunctions.vb
index 7cd6759..12e32de 100644
--- a/GBAPokemonGameEditor/CryFunctions.vb
+++ b/GBAPokemonGameEditor/CryFunctions.vb
@@ -412,46 +412,56 @@ Module CryFunctions
' 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
+ Dim result As DialogResult = MessageBox.Show("The Cry will be written to free space and the pointer will be repointed. Would you like to do that?",
+ "Repoint?",
+ MessageBoxButtons.YesNo)
- ' set new cry offset
- crytosave.Offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (((data.Count) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
+ If (result = DialogResult.Yes) Then
+
+ Dim result2 As DialogResult = MessageBox.Show("Fill the old cry with free space?",
+ "Delete old cry?",
+ MessageBoxButtons.YesNo)
+
+ If (result2 = DialogResult.Yes) Then
+
+ WriteHEX(LoadedROM, crytosave.Offset, MakeFreeSpaceString(crytosave.Size + 16))
+
+ End If
+
+ ' set new cry offset
+ crytosave.Offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, data.Count, "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
+
+ Else
+
+ Return False
+
+ End If
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
+ '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 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
+ '' 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
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
index 8de4bc1..42770d5 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
@@ -16,7 +16,7 @@
- PzuW1Yf69rOcJ8z24bF+KeDYYN5TABZB5T+gZFSQI9c=
+ tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe
index b690174..4c6c8f8 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
index a2eb6f3..70eefcb 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
@@ -43,14 +43,14 @@
-
+
- 2NV2tTtUMAljCKQqMTC3tvFKfh/Gz/cJFgmv/+s3Kz0=
+ IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb
index c3ec8d2..b5a2fde 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb differ
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
index 8de4bc1..42770d5 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
@@ -16,7 +16,7 @@
- PzuW1Yf69rOcJ8z24bF+KeDYYN5TABZB5T+gZFSQI9c=
+ tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
index a2eb6f3..70eefcb 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
@@ -43,14 +43,14 @@
-
+
- 2NV2tTtUMAljCKQqMTC3tvFKfh/Gz/cJFgmv/+s3Kz0=
+ IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=
diff --git a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe
index b690174..4c6c8f8 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
index 967a0d6..949adba 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache and b/GBAPokemonGameEditor/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache
index 8d08bee..136dcdf 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
index 8de4bc1..42770d5 100644
--- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
+++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
@@ -16,7 +16,7 @@
- PzuW1Yf69rOcJ8z24bF+KeDYYN5TABZB5T+gZFSQI9c=
+ tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe
index b690174..4c6c8f8 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
index a2eb6f3..70eefcb 100644
--- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
+++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
@@ -43,14 +43,14 @@
-
+
- 2NV2tTtUMAljCKQqMTC3tvFKfh/Gz/cJFgmv/+s3Kz0=
+ IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb
index c3ec8d2..b5a2fde 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb differ