Exemplo n.º 1
0
        public PPI8255(X8086 cpu, InterruptRequest irq)
        {
            task = new TaskSC(this);

            for (int i = 0x60; i <= 0x6F; i++)
            {
                ValidPortAddress.Add((uint)i);
            }

            //PPISystemControl = x8086.WordToBitsArray(&HA5, PPISystemControl.Length)
            //PPI = x8086.WordToBitsArray(&HA, PPISystemControl.Length)
            //PPICommandModeRegister = &H99

            this.cpu   = cpu;
            this.sched = cpu.Sched;
            this.irq   = irq;
            if (cpu.PIT != null)
            {
                timer = cpu.PIT;
                timer.SetCh2Gate((ppiB & 1) != 0);
            }

            keyBuf          = "";
            keyShiftPending = false;
            keyMap          = new KeyMap();
        }
Exemplo n.º 2
0
        public override void Out(uint port, ushort value)
        {
            if ((port & 3) == ((uint)1))
            {
                // Write to port 0x61 (system control port)
                // bit 0: gate signal for timer channel 2
                // bit 1: speaker control: 0=disconnect, 1=connect to timer 2
                // bit 3: read low(0) or high(1) nibble of S2 switches
                // bit 4: NMI RAM parity check disable
                // bit 5: NMI I/O check disable
                // bit 6: enable(1) or disable(0) keyboard clock ?
                // bit 7: pulse 1 to reset keyboard and IRQ1
                uint oldv = ppiB;
                ppiB = (uint)(value);
                if ((timer != null) && ((oldv ^ value) & 1) != 0)
                {
                    timer.SetCh2Gate((ppiB & 1) != 0);
#if Win32
                    if (timer.Speaker != null)
                    {
                        timer.Speaker.Enabled = (value & 1) == 1;
                    }
#endif
                }
            }
        }