Ejemplo n.º 1
0
        protected override void Run()
        {
            /*
             * Charles needs to fix FAT for this to work, but basically what it does
             * is it takes input from the user, and if it is 'ls', it lists all
             * files in 0:\\, and if not, it interprets the input as a file path
             * and creates a new zConsole.ZConsoleScreen() instance, which
             * loads the file, and interprets it as a Z-Machine game.
             * If something bad happens, the exception is written to the
             * console and the user is told to specify a path again.
             */

            Console.WriteLine("Specify game path:");
            string fName = null;

            try
            {
                fName = Console.ReadLine();
                if (fName == "ls")
                {
                    foreach (var dir in Directory.GetFiles("0:\\"))
                    {
                        Console.WriteLine($"0:\\{dir}");
                    }
                }
                else
                {
                    var screen = new ZConsoleScreen(fName, GameData);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 2
0
        public ZMachine(byte[] aData)
        {
            Memory = new ZMemory(aData);
            Story  = new ZStory(Memory);

            Screen = new ZConsoleScreen(this);
            Input  = new ZInput(Story, Screen, Memory);
            Output = new ZOutput(Screen);
        }