mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 14:55:11 +00:00
Use documentation for endianness
This commit is contained in:
@@ -32,8 +32,8 @@ namespace SabreTools.Data.Models.Atari7800
|
||||
/// Endianness possibly varies by version?
|
||||
/// Version 1 - Big-endian
|
||||
/// Version 2 - ?????
|
||||
/// Version 3 - ?????
|
||||
/// Version 4 - ?????
|
||||
/// Version 3 - Documented as little-endian (unconfirmed)
|
||||
/// Version 4 - Documented as little-endian (unconfirmed)
|
||||
/// </remarks>
|
||||
public uint RomSizeWithoutHeader { get; set; }
|
||||
|
||||
|
||||
@@ -66,7 +66,11 @@ namespace SabreTools.Serialization.Readers
|
||||
obj.HeaderVersion = data.ReadByteValue();
|
||||
obj.MagicText = data.ReadBytes(16);
|
||||
obj.CartTitle = data.ReadBytes(32);
|
||||
obj.RomSizeWithoutHeader = data.ReadUInt32BigEndian();
|
||||
if (obj.HeaderVersion == 1)
|
||||
obj.RomSizeWithoutHeader = data.ReadUInt32BigEndian();
|
||||
else
|
||||
obj.RomSizeWithoutHeader = data.ReadUInt32LittleEndian();
|
||||
|
||||
obj.CartType = (CartType)data.ReadUInt16LittleEndian();
|
||||
obj.Controller1Type = (ControllerType)data.ReadByteValue();
|
||||
obj.Controller2Type = (ControllerType)data.ReadByteValue();
|
||||
|
||||
Reference in New Issue
Block a user