diff --git a/.vs/GBAPokemonGameEditor/v14/.suo b/.vs/GBAPokemonGameEditor/v14/.suo
index 3e82bc6..1a9b9d9 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 12e32de..c225504 100644
--- a/GBAPokemonGameEditor/CryFunctions.vb
+++ b/GBAPokemonGameEditor/CryFunctions.vb
@@ -2,6 +2,7 @@
Imports System.IO
Imports System.Text
Imports System.Media
+Imports VB = Microsoft.VisualBasic
'These functions are based off the ones found in this project: https://github.com/doom-desire/Cry-Editor
'Credit goes to doom-desire for these functions.
@@ -440,28 +441,34 @@ Module CryFunctions
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
- '' 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
+ WriteHEX(LoadedROM, crytosave.Offset, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Compressed, 1, 0)), 4)))
+ WriteHEX(LoadedROM, crytosave.Offset + 2, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Looped, &H4000, 0)), 4)))
+ WriteHEX(LoadedROM, crytosave.Offset + 4, ReverseHEX(VB.Right("00000000" & (crytosave.SampleRate << 10), 8)))
+
+
+ '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
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
index 42770d5..30561b6 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application
@@ -16,7 +16,7 @@
- tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=
+ Izv0zXWPp1tqdp3oXwU3tQbslihM2iE6MjFNGQm/2oE=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe
index 4c6c8f8..405df0b 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 70eefcb..cc654b4 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest
@@ -43,14 +43,14 @@
-
+
- IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=
+ fGhjD86B3cOpBpAg6ac2Qrho9Oy8pU3yWepRTqLC4dQ=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb
index b5a2fde..12c9bc3 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 42770d5..30561b6 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application
@@ -16,7 +16,7 @@
- tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=
+ Izv0zXWPp1tqdp3oXwU3tQbslihM2iE6MjFNGQm/2oE=
diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
index 70eefcb..cc654b4 100644
--- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
+++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest
@@ -43,14 +43,14 @@
-
+
- IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=
+ fGhjD86B3cOpBpAg6ac2Qrho9Oy8pU3yWepRTqLC4dQ=
diff --git a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe
index 4c6c8f8..405df0b 100644
Binary files a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe differ
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache
index 136dcdf..56fe81d 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 42770d5..30561b6 100644
--- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
+++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application
@@ -16,7 +16,7 @@
- tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=
+ Izv0zXWPp1tqdp3oXwU3tQbslihM2iE6MjFNGQm/2oE=
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe
index 4c6c8f8..405df0b 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 70eefcb..cc654b4 100644
--- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
+++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest
@@ -43,14 +43,14 @@
-
+
- IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=
+ fGhjD86B3cOpBpAg6ac2Qrho9Oy8pU3yWepRTqLC4dQ=
diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb
index b5a2fde..12c9bc3 100644
Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb differ