Example #1
0
        public const ushort PspSeg       = ImageLoadSeg - 16; // 0x192

        public RawProgramMain(
            Processor.x86.CSharpExecutor.Cpu implementation,
            ConfigurationDto configuration,
            MethodInfoCollection methodInfoCollection,
            DefinitionCollection definitionCollection,
            IServiceProvider serviceProvider)
            : base(implementation)
        {
            MethodInfoCollection = methodInfoCollection;
            Configuration        = configuration;
            Implementation       = implementation;
            DefinitionCollection = definitionCollection;
            ServiceProvider      = serviceProvider;

            DosMemory    = new DosMemory(implementation, this);
            DosInterrupt = new DosInterrupt(implementation, this);
            DosTimer     = new DosTimer(implementation, this);
            DosPort      = new DosPort(implementation, this);
            DosDma       = new DosDma(implementation, this);
            DosPic       = new DosPic(implementation, this);

            Implementation.MethodInfoCollection     = MethodInfoCollection;
            implementation.CompiledMethodCollection = this;
            implementation.runIrqs += (sender, args) => DosPic.RunIrqs();
            DosPort.SubscribeToCpuPortEvents();
        }
Example #2
0
 /** @param num first or second DMA controller */
 public DmaController(int num, Processor.x86.CSharpExecutor.Cpu cpu)
 {
     _ctrlnum = num;
     for (var i = 0; i < 4; i++)
     {
         _dmaChannels[i] = new DmaChannel(num * 4 + i, num == 1, cpu);
     }
 }
Example #3
0
        public DmaChannel(int num, bool dma16, Processor.x86.CSharpExecutor.Cpu cpu)
        {
            if (num == 4)
            {
                return;
            }

            ChanNum   = num;
            _cpu      = cpu;
            Dma16     = dma16 ? 0x1 : 0x0;
            Increment = true;
        }
Example #4
0
        public DosPic(Processor.x86.CSharpExecutor.Cpu implementation, RawProgramMain rawProgramMain)
            : base(implementation)
        {
            Implementation = implementation;
            RawProgramMain = rawProgramMain;

            /* Setup pic0 and pic1 with initial values like DOS has normally */

            for (var i = 0; i < 2; i++)
            {
                pics[i].masked             = 0xff;
                pics[i].auto_eoi           = false;
                pics[i].rotate_on_auto_eoi = false;
                pics[i].request_issr       = false;
                pics[i].special            = false;
                pics[i].single             = false;
                pics[i].icw_index          = 0;
                pics[i].icw_words          = 0;
            }

            for (var i = 0; i <= 7; i++)
            {
                irqs[i].active    = false;
                irqs[i].masked    = true;
                irqs[i].inservice = false;

                irqs[i + 8].active    = false;
                irqs[i + 8].masked    = true;
                irqs[i + 8].inservice = false;

                irqs[i].InterruptVector     = 0x8 + i;
                irqs[i + 8].InterruptVector = 0x70 + i;
            }

            irqs[0].masked = false;    /* Enable system timer */
            irqs[1].masked = false;    /* Enable Keyboard IRQ */
            irqs[2].masked = false;    /* Enable second pic */
            irqs[8].masked = false;    /* Enable RTC IRQ */

            //        if (machine == MCH_PCJR)
            //        {
            //            /* Enable IRQ6 (replacement for the NMI for PCJr) */
            //            irqs[6].masked = false;
            //        }
        }