public override void run(Machine machine) { Memory.StringAndReadLength str = machine.memory.getZSCII(machine.pc, 0); Console.Write(str.str); machine.pc += (uint)str.bytesRead; machine.popRoutineData(1); }
public override void run(Machine machine) { // Debug.WriteLine("Getting string at " + machine.pc); Memory.StringAndReadLength str = machine.memory.getZSCII(machine.pc, 0); Console.Write(str.str); machine.pc += (uint)str.bytesRead; // Debug.WriteLine("New pc location: " + machine.pc); }
public override void run(Machine machine, List <ushort> operands) { if (operands[0] != 0) { if (operands[0] < 0) { // deselect output stream } else if (operands[0] == 3) { Memory.StringAndReadLength str = machine.memory.getZSCII((uint)operands[1] + 2, machine.memory.getWord((uint)operands[1])); } else { // select output stream } } }
public String objectName(int objectId) { String name; if (objectId == 0) { return("Unable to find Object"); } Memory.StringAndReadLength str = new Memory.StringAndReadLength(); tp = getPropertyTableAddress(objectId); // An object's name is stored in the header of its property table, and is given in the text-length. int textLength = tp_getByte(); // The first byte is the text-length number of words in the short name if (textLength == 0) { return("Name not found"); } name = memory.getZSCII((uint)tp, (uint)textLength * 2).str; return(name); }
public void buildDict() { // build the dictionary into class variable uint separatorLength = memory.getByte(dictionaryAddress); // Number of separators uint entryLength = memory.getByte(dictionaryAddress + separatorLength + 1); // Size of each entry (default 7 bytes) uint dictionaryLength = memory.getWord(dictionaryAddress + separatorLength + 2); // Number of 2-byte entries uint entryAddress = dictionaryAddress + separatorLength + 4; // Start of dictionary entries for (uint i = entryAddress; i < dictionaryAddress + separatorLength; i++) { separators.Add(memory.getByte(i + 1)); // Find 'n' different word separators and add to list } for (uint i = entryAddress; i < entryAddress + dictionaryLength * entryLength; i += entryLength) { dictionaryIndex.Add(i); // Record dictionary entry address Memory.StringAndReadLength dictEntry = memory.getZSCII(i, 0); // Debug.WriteLine(dictEntry.str); dictionary.Add(dictEntry.str); // Find 'n' different dictionary entries and add words to list } }