Fix interpretation of the Apple boot block.

This commit is contained in:
2020-02-19 00:42:34 +00:00
parent 7ac5e40965
commit 3e15b3dce1
2 changed files with 39 additions and 31 deletions

View File

@@ -53,20 +53,29 @@ namespace DiscImageChef.Filesystems
var sb = new StringBuilder();
sb.AppendLine("Boot Block:");
if((bb.bbPageFlags & 0x40) == 0x40)
if((bb.bbVersion & 0x8000) > 0)
{
sb.AppendLine("Boot block is in new format.");
if((bb.bbVersion & 0x4000) > 0)
{
sb.AppendLine("Boot block should be executed.");
if((bb.bbVersion & 0x2000) > 0)
sb.
AppendFormat("System heap will be extended by {0} bytes and a {1} fraction of the available RAM",
bb.bbSysHeapExtra, bb.bbSysHeapFract).AppendLine();
}
}
else if((bb.bbVersion & 0xFF) == 0x0D)
sb.AppendLine("Boot block should be executed.");
if((bb.bbPageFlags & 0x80) == 0x80)
sb.AppendLine("Boot block is in new unknown format.");
else
{
if(bb.bbPageFlags > 0)
sb.AppendLine("Allocate secondary sound buffer at boot.");
else if(bb.bbPageFlags < 0)
sb.AppendLine("Allocate secondary sound and video buffers at boot.");
sb.AppendFormat("System filename: {0}", StringHandlers.PascalToString(bb.bbSysName, Encoding)).
AppendLine();
sb.AppendFormat("System filename: {0}", StringHandlers.PascalToString(bb.bbSysName, Encoding)).AppendLine();
sb.AppendFormat("Finder filename: {0}", StringHandlers.PascalToString(bb.bbShellName, Encoding)).
AppendLine();
@@ -77,8 +86,8 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("Disassembler filename: {0}", StringHandlers.PascalToString(bb.bbDbg2Name, Encoding)).
AppendLine();
sb.AppendFormat("Startup screen filename: {0}",
StringHandlers.PascalToString(bb.bbScreenName, Encoding)).AppendLine();
sb.AppendFormat("Startup screen filename: {0}", StringHandlers.PascalToString(bb.bbScreenName, Encoding)).
AppendLine();
sb.AppendFormat("First program to execute at boot: {0}",
StringHandlers.PascalToString(bb.bbHelloName, Encoding)).AppendLine();
@@ -91,7 +100,6 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("Heap size with 128KiB of RAM: {0} bytes", bb.bb128KSHeap).AppendLine();
sb.AppendFormat("Heap size with 256KiB of RAM: {0} bytes", bb.bb256KSHeap).AppendLine();
sb.AppendFormat("Heap size with 512KiB of RAM or more: {0} bytes", bb.bbSysHeapSize).AppendLine();
}
return sb.ToString();
}

View File

@@ -46,9 +46,9 @@ namespace DiscImageChef.Filesystems
public readonly ushort bbID;
/// <summary>0x002, Branch</summary>
public readonly uint bbEntry;
/// <summary>0x007, Boot block version</summary>
/// <summary>0x007, Boot block version and flags</summary>
public readonly ushort bbVersion;
/// <summary>0x006, Boot block flags</summary>
/// <summary>0x006, Boot block page flags</summary>
public readonly short bbPageFlags;
/// <summary>0x00A, System file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]