Esempio n. 1
0
        private FileSystemPlugin(PluginContext context, IDictionary <string, object> pluginConfig)
        {
            var defaultConfig = new Dictionary <string, object>
            {
                { "integratedDirectory", "$MyDocuments$/NestorMSX/FileSystem" },
                { "volumeLabel", "NestorMSX" }
            };

            defaultConfig.MergeInto(pluginConfig);

            basePath = pluginConfig.GetValue <string>("integratedDirectory")
                       .Replace("/", "\\")
                       .AsAbsolutePath();
            volumeLabel        = pluginConfig.GetValue <string>("volumeLabel");
            currentFullDir     = basePath;
            currentRelativeDir = "";

            this.cpu                    = context.Cpu;
            this.regs                   = cpu.Registers;
            this.slotsSystem            = context.SlotsSystem;
            this.mem                    = this.slotsSystem;
            cpu.BeforeInstructionFetch += CpuOnBeforeInstructionFetch;

            hookedMethods = new Dictionary <int, Action>
            {
                { 0x4020, ALLOC },
                { 0x4023, FFIRST },
                { 0x4026, FNEXT },
                { 0x4029, CHDIR },
                { 0x402C, GETCD },
                { 0x402F, GETVOL }
            };
        }
Esempio n. 2
0
        public DosFunctionCallExecutor(IZ80Registers regs, IMemory memory, string filesystemBaseLocation)
        {
            this.regs   = regs;
            this.memory = memory;

            filesystemBase = filesystemBaseLocation;
            if (!Directory.Exists(filesystemBase))
            {
                try {
                    Directory.CreateDirectory(filesystemBase);
                }
                catch (Exception ex) {
                    throw new InvalidOperationException(
                              "Error when trying to create the base directory for DiskBASIC:\r\n{0}\r\n\r\nDirectory location as specified in config file:\r\n{1}"
                              .FormatWith(ex.Message, filesystemBase));
                }
            }
        }
Esempio n. 3
0
        public int Execute(byte firstOpcodeByte)
        {
            Registers = ProcessorAgent.Registers;

            switch (firstOpcodeByte)
            {
            case 0xCB:
                return(Execute_CB_Instruction());

            case 0xDD:
                return(Execute_DD_Instruction());

            case 0xED:
                return(Execute_ED_Instruction());

            case 0xFD:
                return(Execute_FD_Instruction());

            default:
                return(Execute_SingleByte_Instruction(firstOpcodeByte));
            }
        }