Exemple #1
0
        public override void BusInit(IBusManager bmgr)
        {
            base.BusInit(bmgr); // should be first because Accelerator depends on it

            _ulaSprinter  = bmgr.FindDevice <SprinterULA>();
            _sprinterBdi  = bmgr.FindDevice <SprinterFdd>();
            _covoxBlaster = bmgr.FindDevice <CovoxBlaster>();
            if (_ulaSprinter != null)
            {
                _ulaSprinter.VRAM = _vramPages;
            }

            bmgr.Events.SubscribeWrIo(0x0000, 0x0000, this.WriteIoDcp);    //write to DCP Port
            bmgr.Events.SubscribeRdIo(0x0000, 0x0000, this.ReadIoDcp);     //read from DCP port
            bmgr.Events.SubscribeWrIo(0x00ff, 0x0082, this.WritePort82);   //write PAGE0
            bmgr.Events.SubscribeRdIo(0x00ff, 0x0082, this.ReadPort82);    //read PAGE0
            bmgr.Events.SubscribeWrIo(0x00ff, 0x00A2, this.WritePortA2);   //write PAGE1
            bmgr.Events.SubscribeRdIo(0x00ff, 0x00A2, this.ReadPortA2);    //read PAGE1
            bmgr.Events.SubscribeWrIo(0x00ff, 0x00C2, this.WritePortC2);   //write PAGE2
            bmgr.Events.SubscribeRdIo(0x00ff, 0x00C2, this.ReadPortC2);    //read PAGE2
            bmgr.Events.SubscribeWrIo(0x00ff, 0x00E2, this.WritePortE2);   //write PAGE3
            bmgr.Events.SubscribeRdIo(0x00ff, 0x00E2, this.ReadPortE2);    //read PAGE3
            bmgr.Events.SubscribeWrIo(0xd027, 0x5025, this.WritePort7FFD); //write 7FFDh
            bmgr.Events.SubscribeWrIo(0xd027, 0x1025, this.WritePort1FFD); //write 1FFDh
            bmgr.Events.SubscribeRdIo(0x00ff, 0x00fb, this.ReadPortFB);    //read FBh  Open Cash
            bmgr.Events.SubscribeRdIo(0x00ff, 0x007b, this.ReadPort7B);    //read 7Bh  Close Cash
            bmgr.Events.SubscribeWrIo(0x00BD, 0x003c, this.WritePort7C);   //write 7Ch
            bmgr.Events.SubscribeWrIo(0x00FF, 0x0089, this.WritePort89);   //write PORTY
            bmgr.Events.SubscribeWrIo(0x00FF, 0x00C9, this.WritePortC9);   //write C9h
            bmgr.Events.SubscribeWrIo(0x00FF, 0x00E9, this.WritePortE9);   //write E9h
            bmgr.Events.SubscribeRdIo(0x00ff, 0x0089, this.ReadPort89);    //read PORTY
            bmgr.Events.SubscribeRdIo(0x00ff, 0x00E9, this.ReadPortE9);    //read E9h
            bmgr.Events.SubscribeRdIo(0x00ff, 0x00C9, this.ReadPortC9);    //read C9h

            // fix call overhead (methods marked with new)
            bmgr.Events.SubscribeWrMem(0xC000, 0x0000, this.WriteMem0000); //write
            bmgr.Events.SubscribeWrMem(0xC000, 0x4000, this.WriteMem4000); //write
            bmgr.Events.SubscribeWrMem(0xC000, 0x8000, this.WriteMem8000); //write
            bmgr.Events.SubscribeWrMem(0xC000, 0xC000, this.WriteMemC000); //write
            bmgr.Events.SubscribeRdMem(0xC000, 0x0000, this.ReadMem0000);  //read
            bmgr.Events.SubscribeRdMem(0xC000, 0x8000, this.ReadMem8000);  //read
            bmgr.Events.SubscribeRdMem(0xC000, 0xC000, this.ReadMemC000);  //read
            bmgr.Events.SubscribeRdMem(0xC000, 0x4000, this.ReadMem4000);  //read

            bmgr.Events.SubscribeRdIo(0xFFFF, 0, this.ReadPort00);         //read 0
            bmgr.Events.SubscribeRdMemM1(0x0000, 0x0000, this.Accelerator);
            bmgr.Events.SubscribeRdMem(0x0000, 0x0000, this.AccelRead);
            bmgr.Events.SubscribeWrMem(0x0000, 0x0000, this.AccelWrite);

#if Debug
            bmgr.Events.SubscribeRdMemM1(0x0000, 0x0000, this.readRamM1);  //read operator from memory
#endif
            bmgr.Events.SubscribeReset(ResetBus);
        }
Exemple #2
0
        public override void BusInit(IBusManager bmgr)
        {
            base.BusInit(bmgr);
            this.m_cpu = bmgr.CPU;

            this.m_ulaSprinter = bmgr.FindDevice<SprinterULA>();
            if (this.m_ulaSprinter != null)
            {
                this.m_ulaSprinter.VRAM = m_vramPages;
            }
            else
            {
                throw new ApplicationException("SprinterULA not found");
            }
            this.m_SprinterBDI = bmgr.FindDevice<SprinterBDI>();
            if (this.m_SprinterBDI == null)
            {
                throw new ApplicationException("SprinterBDI not found");
            }
            bmgr.SubscribeWRIO(0x0000, 0x0000, new BusWriteIoProc(this.WRDCP));  //write to DCP Port
            bmgr.SubscribeRDIO(0x0000, 0x0000, new BusReadIoProc(this.RDDCP));    //read from DCP port
            bmgr.SubscribeWRIO(0x00ff, 0x0082, new BusWriteIoProc(this.writePort82h));  //write PAGE0
            bmgr.SubscribeRDIO(0x00ff, 0x0082, new BusReadIoProc(this.readPort82h));    //read PAGE0
            bmgr.SubscribeWRIO(0x00ff, 0x00A2, new BusWriteIoProc(this.writePortA2h));  //write PAGE1
            bmgr.SubscribeRDIO(0x00ff, 0x00A2, new BusReadIoProc(this.readPortA2h));    //read PAGE1
            bmgr.SubscribeWRIO(0x00ff, 0x00C2, new BusWriteIoProc(this.writePortC2h));  //write PAGE2
            bmgr.SubscribeRDIO(0x00ff, 0x00C2, new BusReadIoProc(this.readPortC2h));    //read PAGE2
            bmgr.SubscribeWRIO(0x00ff, 0x00E2, new BusWriteIoProc(this.writePortE2h));  //write PAGE3
            bmgr.SubscribeRDIO(0x00ff, 0x00E2, new BusReadIoProc(this.readPortE2h));    //read PAGE3
            bmgr.SubscribeWRIO(0xd027, 0x5025, new BusWriteIoProc(this.writePort7FFDh));    //write 7FFDh
            bmgr.SubscribeWRIO(0xd027, 0x1025, new BusWriteIoProc(this.writePort1FFDh));  //write 1FFDh
            bmgr.SubscribeRDIO(0x00ff, 0x00fb, new BusReadIoProc(this.readPortFBh));  //read FBh  Open Cash
            bmgr.SubscribeRDIO(0x00ff, 0x007b, new BusReadIoProc(this.readPort7Bh));  //read 7Bh  Close Cash
            bmgr.SubscribeWRIO(0x00BD, 0x003c, new BusWriteIoProc(this.writePort7Ch));  //write 7Ch
            bmgr.SubscribeWRIO(0x00FF, 0x0089, new BusWriteIoProc(this.writePort89h));  //write PORTY
            bmgr.SubscribeWRIO(0x00FF, 0x00C9, new BusWriteIoProc(this.writePortC9h));  //write C9h
            bmgr.SubscribeWRIO(0x00FF, 0x00E9, new BusWriteIoProc(this.writePortE9h));  //write E9h
            bmgr.SubscribeRDIO(0x00ff, 0x0089, new BusReadIoProc(this.readPort89h));  //read PORTY
            bmgr.SubscribeRDIO(0x00ff, 0x00E9, new BusReadIoProc(this.readPortE9h));  //read E9h
            bmgr.SubscribeRDIO(0x00ff, 0x00C9, new BusReadIoProc(this.readPortC9h));  //read C9h
            bmgr.SubscribeWRMEM(0xC000, 0x0000, new BusWriteProc(this.WriteMem0000));  //write
            bmgr.SubscribeWRMEM(0xC000,0x4000, new BusWriteProc(this.WriteMem4000));  //write
            bmgr.SubscribeWRMEM(0xC000, 0x8000, new BusWriteProc(this.WriteMem8000));  //write
            bmgr.SubscribeWRMEM(0xC000, 0xC000, new BusWriteProc(this.WriteMemC000));  //write
            bmgr.SubscribeRDMEM(0xC000, 0x0000, new BusReadProc(this.ReadMem0000));  //read
            bmgr.SubscribeRDMEM(0xC000, 0x8000, new BusReadProc(this.ReadMem8000));  //read
            bmgr.SubscribeRDMEM(0xC000, 0xC000, new BusReadProc(this.ReadMemC000));  //read
            bmgr.SubscribeRDMEM(0xC000, 0x4000, new BusReadProc(this.ReadMem4000));  //read
            bmgr.SubscribeRDIO(0xFFFF, 0, new BusReadIoProc(this.readPort00h));  //read 0
            bmgr.SubscribeRDMEM_M1(0x0000, 0x0000, new BusReadProc(this.Accelerator));
            bmgr.SubscribeRDMEM(0x0000, 0x0000, new BusReadProc(this.AccelRead));
            bmgr.SubscribeWRMEM(0x0000, 0x0000, new BusWriteProc(this.AccelWrite));

            #if Debug
            bmgr.SubscribeRDMEM_M1(0x0000, 0x0000, new BusReadProc(this.readRamM1));  //read operator from memory
            #endif
            bmgr.SubscribeRESET(new BusSignalProc(this.busReset));
        }