-- ImageFormat.mesa  Modified by: Sandman, August 12, 1980  10:40 AM
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  AltoDefs USING [PageCount, PageNumber, PageSize],
  AltoFileDefs USING [vDA],
  TimeStamp USING [Stamp],
  ControlDefs USING [StateVector],
  DiskDefs USING [DA];

ImageFormat: DEFINITIONS SHARES DiskDefs =
  BEGIN

  FirstImageDataPage: AltoDefs.PageNumber = 2;
  HeaderPages: CARDINAL = 1;

  MapItem: TYPE = MACHINE DEPENDENT RECORD [
    page: [0..255],
    count: [0..127],
    body:
      SELECT tag: * FROM
	normal => NULL,
	change => [da: DiskDefs.DA, base: CARDINAL],
	ENDCASE];

  VersionID: CARDINAL = 01040; -- must match in Mesa.bcpl

  ImagePrefix: TYPE = MACHINE DEPENDENT RECORD [
    versionident: CARDINAL,
    version, creator: TimeStamp.Stamp,
    options: WORD,
    diskAddresses: POINTER,
    leaderDA: AltoFileDefs.vDA,
    state: ControlDefs.StateVector,
    loadStateBase, initialLoadStateBase: CARDINAL,
    type: ImageType,
    fill: [0..1B],
    loadStatePages: AltoDefs.PageCount];

  ImageType: TYPE = {bootmesa, makeimage, checkfile, other};

  ImageHeader: TYPE = MACHINE DEPENDENT RECORD [
    prefix: ImagePrefix, map: ARRAY [0..0) OF MapItem];

  MapSpace: CARDINAL = AltoDefs.PageSize - SIZE[ImagePrefix] - 1;

  END..