diff --git a/BurnOutSharp.Models/LinearExecutable/Enums.cs b/BurnOutSharp.Models/LinearExecutable/Enums.cs index f4d4cf69..c6cb1fd7 100644 --- a/BurnOutSharp.Models/LinearExecutable/Enums.cs +++ b/BurnOutSharp.Models/LinearExecutable/Enums.cs @@ -2,7 +2,7 @@ namespace BurnOutSharp.Models.LinearExecutable { - // TODO: Should this be a flag? + [Flags] public enum BundleType : byte { /// @@ -161,6 +161,157 @@ namespace BurnOutSharp.Models.LinearExecutable // they do not overlap previously defined directive numbers. } + [Flags] + public enum FixupRecordSourceType : byte + { + /// + /// Source mask. + /// + SourceMask = 0x0F, + + /// + /// Byte fixup (8-bits). + /// + ByteFixup = 0x00, + + /// + /// (undefined). + /// + Undefined1 = 0x01, + + /// + /// 16-bit Selector fixup (16-bits). + /// + SixteenBitSelectorFixup = 0x02, + + /// + /// 16:16 Pointer fixup (32-bits). + /// + SixteenSixteenPointerFixup = 0x03, + + /// + /// (undefined). + /// + Undefined4 = 0x04, + + /// + /// 16-bit Offset fixup (16-bits). + /// + SixteenBitOffsetFixup = 0x05, + + /// + /// 16:32 Pointer fixup (48-bits). + /// + SixteenThirtyTwoPointerFixup = 0x06, + + /// + /// 32-bit Offset fixup (32-bits). + /// + ThirtyTwoBitOffsetFixup = 0x07, + + /// + /// 32-bit Self-relative offset fixup (32-bits). + /// + ThirtyTwoBitSelfRelativeOffsetFixup = 0x08, + + /// + /// Fixup to Alias Flag. + /// + /// + /// When the 'Fixup to Alias' Flag is set, the source fixup refers to + /// the 16:16 alias for the object. This is only valid for source types + /// of 2, 3, and 6. For fixups such as this, the linker and loader will + /// be required to perform additional checks such as ensuring that the + /// target offset for this fixup is less than 64K. + /// + FixupToAliasFlag = 0x10, + + /// + /// Source List Flag. + /// + /// + /// When the 'Source List' Flag is set, the SRCOFF field is compressed + /// to a byte and contains the number of source offsets, and a list of source + /// offsets follows the end of fixup record (after the optional additive value). + /// + SourceListFlag = 0x20, + } + + [Flags] + public enum FixupRecordTargetFlags : byte + { + /// + /// Fixup target type mask. + /// + FixupTargetTypeMask = 0x03, + + /// + /// Internal reference. + /// + InternalReference = 0x00, + + /// + /// Imported reference by ordinal. + /// + ImportedReferenceByOrdinal = 0x01, + + /// + /// Imported reference by name. + /// + ImportedReferenceByName = 0x02, + + /// + /// Internal reference via entry table. + /// + InternalReferenceViaEntryTable = 0x03, + + /// + /// Additive Fixup Flag. + /// + /// + /// When set, an additive value trails the fixup record (before the optional + /// source offset list). + /// + AdditiveFixupFlag = 0x04, + + /// + /// Reserved. Must be zero. + /// + Reserved = 0x08, + + /// + /// 32-bit Target Offset Flag. + /// + /// + /// When set, the target offset is 32-bits, otherwise it is 16-bits. + /// + ThirtyTwoBitTargetOffsetFlag = 0x10, + + /// + /// 32-bit Additive Fixup Flag. + /// + /// When set, the additive value is 32-bits, otherwise it is 16-bits. + /// + ThirtyTwoBitAdditiveFixupFlag = 0x20, + + /// + /// 16-bit Object Number/Module Ordinal Flag. + /// + /// + /// When set, the object number or module ordinal number is 16-bits, + /// otherwise it is 8-bits. + /// + SixteenBitObjectNumberModuleOrdinalFlag = 0x40, + + /// + /// 8-bit Ordinal Flag. + /// + /// + /// When set, the ordinal number is 8-bits, otherwise it is 16-bits. + /// + EightBitOrdinalFlag = 0x80, + } + [Flags] public enum ModuleFlags : uint {