Added a few lines for cry importing.

Added a few lines. Syncing so I don't lose my work.
This commit is contained in:
Gamer2020 2016-10-02 14:12:05 -04:00
parent b14d5d6429
commit af200e8a02
15 changed files with 52 additions and 42 deletions

Binary file not shown.

View File

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

View File

@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>PzuW1Yf69rOcJ8z24bF+KeDYYN5TABZB5T+gZFSQI9c=</dsig:DigestValue>
<dsig:DigestValue>tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1984512">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1986560">
<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>2NV2tTtUMAljCKQqMTC3tvFKfh/Gz/cJFgmv/+s3Kz0=</dsig:DigestValue>
<dsig:DigestValue>IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>PzuW1Yf69rOcJ8z24bF+KeDYYN5TABZB5T+gZFSQI9c=</dsig:DigestValue>
<dsig:DigestValue>tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1984512">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1986560">
<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>2NV2tTtUMAljCKQqMTC3tvFKfh/Gz/cJFgmv/+s3Kz0=</dsig:DigestValue>
<dsig:DigestValue>IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>PzuW1Yf69rOcJ8z24bF+KeDYYN5TABZB5T+gZFSQI9c=</dsig:DigestValue>
<dsig:DigestValue>tDu5LpY+dmIhMHbSR+lkoM/qzfx1yuosJ/hxST2klN0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1984512">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="1986560">
<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>2NV2tTtUMAljCKQqMTC3tvFKfh/Gz/cJFgmv/+s3Kz0=</dsig:DigestValue>
<dsig:DigestValue>IYGcSk+w8m60V7xbRTj4cQ836mvY5mAH8nVzaC8aupM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>