Use new little endian marshaller on decoders.

This commit is contained in:
2019-02-28 00:04:13 +00:00
parent 0fe8e3c11f
commit 691b51aa1b
5 changed files with 13 additions and 20 deletions

View File

@@ -36,6 +36,7 @@ using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using DiscImageChef.Console;
using Marshal = DiscImageChef.Helpers.Marshal;
namespace DiscImageChef.Decoders.Sega
{
@@ -134,10 +135,7 @@ namespace DiscImageChef.Decoders.Sega
if(ipbin_sector.Length < 512) return null;
IntPtr ptr = Marshal.AllocHGlobal(512);
Marshal.Copy(ipbin_sector, 0, ptr, 512);
IPBin ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
Marshal.FreeHGlobal(ptr);
IPBin ipbin = Marshal.ByteArrayToStructureLittleEndian<IPBin>(ipbin_sector);
DicConsole.DebugWriteLine("SegaCD IP.BIN Decoder", "segacd_ipbin.volume_name = \"{0}\"",
Encoding.ASCII.GetString(ipbin.volume_name));