Add proof-of-concept MS-DOS wrapper

This commit is contained in:
Matt Nadareski
2022-12-02 15:29:10 -08:00
parent c4bf3931e2
commit f24004c949

View File

@@ -6,13 +6,58 @@ namespace BurnOutSharp.Wrappers
{
#region Pass-Through Properties
// TODO: Determine what properties can be passed through
#region Header
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.Magic"/>
public byte[] Magic => _executable.Header.Magic;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.LastPageBytes"/>
public ushort LastPageBytes => _executable.Header.LastPageBytes;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.Pages"/>
public ushort Pages => _executable.Header.Pages;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.RelocationItems"/>
public ushort RelocationItems => _executable.Header.RelocationItems;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.HeaderParagraphSize"/>
public ushort HeaderParagraphSize => _executable.Header.HeaderParagraphSize;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.MinimumExtraParagraphs"/>
public ushort MinimumExtraParagraphs => _executable.Header.MinimumExtraParagraphs;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.MaximumExtraParagraphs"/>
public ushort MaximumExtraParagraphs => _executable.Header.MaximumExtraParagraphs;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.InitialSSValue"/>
public ushort InitialSSValue => _executable.Header.InitialSSValue;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.InitialSPValue"/>
public ushort InitialSPValue => _executable.Header.InitialSPValue;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.Checksum"/>
public ushort Checksum => _executable.Header.Checksum;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.InitialIPValue"/>
public ushort InitialIPValue => _executable.Header.InitialIPValue;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.InitialCSValue"/>
public ushort InitialCSValue => _executable.Header.InitialCSValue;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.RelocationTableAddr"/>
public ushort RelocationTableAddr => _executable.Header.RelocationTableAddr;
/// <inheritdoc cref="Models.MSDOS.ExecutableHeader.OverlayNumber"/>
public ushort OverlayNumber => _executable.Header.OverlayNumber;
#endregion
#region Extension Properties
#region Relocation Table
// TODO: Determine what extension properties are needed
/// <inheritdoc cref="Models.MSDOS.Executable.RelocationTable"/>
public Models.MSDOS.RelocationEntry[] RelocationTable => _executable.RelocationTable;
#endregion
#endregion
@@ -21,7 +66,7 @@ namespace BurnOutSharp.Wrappers
/// <summary>
/// Internal representation of the executable
/// </summary>
private BurnOutSharp.Models.MSDOS.Executable _executable;
private Models.MSDOS.Executable _executable;
#endregion
@@ -38,7 +83,7 @@ namespace BurnOutSharp.Wrappers
/// <returns>An MS-DOS executable wrapper on success, null on failure</returns>
public static MSDOS Create(byte[] data, int offset)
{
var executable = BurnOutSharp.Builder.MSDOS.ParseExecutable(data, offset);
var executable = Builder.MSDOS.ParseExecutable(data, offset);
if (executable == null)
return null;
@@ -53,7 +98,7 @@ namespace BurnOutSharp.Wrappers
/// <returns>An MS-DOS executable wrapper on success, null on failure</returns>
public static MSDOS Create(Stream data)
{
var executable = BurnOutSharp.Builder.MSDOS.ParseExecutable(data);
var executable = Builder.MSDOS.ParseExecutable(data);
if (executable == null)
return null;