Ejemplo n.º 1
0
        // Constructor
        internal Timer8254LegacyPC(PnpConfig config, Pic pic)
        {
#if VERBOSE
            Tracing.Log(Tracing.Debug, "Timer8254: create");
#endif

            // /pnp/08/02/01/PNP0100 0003 cfg dis : ISA 8254 Timer : AT Timer
            // IRQ mask=0001 type=47
            // I/O Port inf=01 min=0040 max=0040 aln=01 len=04 0040..0043
            this.config = config;
            this.pic    = pic;
            this.irq    = ((IoIrqRange)config.DynamicRanges[1]).Irq;
            IoPortRange ioPorts = (IoPortRange)config.DynamicRanges[0];
            C0Port = ioPorts.PortAtOffset(i8254_C0, 1, Access.ReadWrite);
            C2Port = ioPorts.PortAtOffset(i8254_C2, 1, Access.ReadWrite);
            CWPort = ioPorts.PortAtOffset(i8254_CW, 1, Access.ReadWrite);

            // Enable Timer2
            // Lower 2 bits of port 61 are described in:
            // The Indispensable PC Hardware Book (3rd Edition) p.724
            ioPorts = (IoPortRange)config.FixedRanges[0];
            IoPort p = ioPorts.PortAtOffset(0, 1, Access.ReadWrite);

            //
            // Also clear the NMI RAM parity error to enable the PCI card
            // to generate NMI if the button is depressed
            //

            p.Write8((byte)((p.Read8() & 0xf8) | 0x01));
        }
Ejemplo n.º 2
0
            public OperationRegionAccessor()
            {
                IoPortRange pciConfigPorts = new IoPortRange(PciAddressPort, 8, Access.ReadWrite);

                pciConfigAddressPort = pciConfigPorts.PortAtOffset(0, 4, Access.Write);
                pciConfigDataPort    = pciConfigPorts.PortAtOffset(4, 4, Access.ReadWrite);
            }
Ejemplo n.º 3
0
        // Constructor
        internal Timer8254Apic(PnpConfig config)
        {
            // /pnp/08/02/01/PNP0100 0003 cfg dis : ISA 8254 Timer : AT Timer
            // IRQ mask=0001 type=47
            // I/O Port inf=01 min=0040 max=0040 aln=01 len=04 0040..0043
            this.config = config;
            this.irq    = ((IoIrqRange)config.DynamicRanges[1]).Irq;

            IoPortRange ioPorts = (IoPortRange)config.DynamicRanges[0];

            C2Port = ioPorts.PortAtOffset(i8254_C2, 1, Access.ReadWrite);
            CWPort = ioPorts.PortAtOffset(i8254_CW, 1, Access.ReadWrite);

            // Use Timer2 as it's not connected as interrupt source.
            //
            // Lower 2 bits of port 61 are described in:
            // The Indispensable PC Hardware Book (3rd Edition) p.724
            ioPorts = (IoPortRange)config.FixedRanges[0];
            IoPort p = ioPorts.PortAtOffset(0, 1, Access.ReadWrite);

            //
            // Also clear the NMI RAM parity error to enable the PCI card
            // to generate NMI if the button is depressed
            //

            p.Write8((byte)((p.Read8() & 0xf8) | 0x01));
        }
Ejemplo n.º 4
0
        public Vga()
        {
            IoPortRange dev = new IoPortRange(0x3c0, 0x20, Access.ReadWrite);

            atcAddrPort = dev.PortAtOffset(ATC_ADDR_PORT, 2, Access.ReadWrite);
            miscOutputRegWritePort = dev.PortAtOffset(MISC_OUTPUT_REG_WRITE_PORT, 2, Access.ReadWrite);
            seqAddrPort = dev.PortAtOffset(SEQ_ADDR_PORT, 2, Access.Write);
            seqDataPort = dev.PortAtOffset(SEQ_DATA_PORT, 2, Access.ReadWrite);
            dacPixelMaskPort = dev.PortAtOffset(DAC_PIXEL_MASK_PORT, 2, Access.Write);
            dacAddressWritePort = dev.PortAtOffset(DAC_ADDR_WRITE_PORT, 2, Access.Write);
            dacDataRegPort = dev.PortAtOffset(DAC_DATA_REG_PORT, 2, Access.Write);
            graphAddrPort = dev.PortAtOffset(GRAPH_ADDR_PORT, 2, Access.Write);
            graphDataPort = dev.PortAtOffset(GRAPH_DATA_PORT, 2, Access.ReadWrite);
            crtcAddressColorPort = dev.PortAtOffset(CRTC_ADDR_COLOR_PORT, 2, Access.ReadWrite);
            inputStatusColorPort = dev.PortAtOffset(INPUT_STATUS_COLOR_PORT, 2, Access.ReadWrite);

            screenBuffer = IoMemory.AllocateIo(0xa0000, 0x20000, true, true);
            textBuffer = IoMemory.AllocateIo(0xb8000, 0x8000, true, true);
        }