/// <summary> /// Writes to a header extension table entry. /// </summary> /// <param name="entry"> /// The header extension table entry. /// </param> /// <param name="value"> /// The value to write. /// </param> protected void WriteHeaderExtensionTableEntry(HeaderExtension entry, ushort value) { var extensionTableAddress = this.HeaderExtensionTableAddress; if (extensionTableAddress > 0) { var entryCount = this.Memory.ReadWord(extensionTableAddress); var entryNumber = (ushort)entry; if (entryNumber <= entryCount) { this.Memory.WriteWord(extensionTableAddress + (entryNumber * 2), value); } } }
/// <summary> /// Reads from a header extension table entry. /// </summary> /// <param name="entry"> /// The header extension table entry. /// </param> /// <returns> /// The value read. /// </returns> protected ushort ReadHeaderExtensionTableEntry(HeaderExtension entry) { // todo: Is this needed in V6 or make this private? var extensionTableAddress = this.HeaderExtensionTableAddress; if (extensionTableAddress > 0) { var entryCount = this.Memory.ReadWord(extensionTableAddress); var entryNumber = (ushort)entry; if (entryNumber <= entryCount) { return this.Memory.ReadWord(extensionTableAddress + (entryNumber * 2)); } } return 0; }