当前位置: 首页>>代码示例>>C#>>正文


C# Clock.QueueOps方法代码示例

本文整理汇总了C#中Clock.QueueOps方法的典型用法代码示例。如果您正苦于以下问题:C# Clock.QueueOps方法的具体用法?C# Clock.QueueOps怎么用?C# Clock.QueueOps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Clock的用法示例。


在下文中一共展示了Clock.QueueOps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public virtual void Execute(Clock.Clock clock, byte cycle)
        {
            Clock.ClockEntry first = null;
            Clock.ClockEntry next = null;

            if (_cpu.NMI.Check())
                first = next = new Clock.ClockEntryRep(new InterruptOp(_cpu, 0xfffa), 7);
            else if (_cpu.IRQ.IsRaised && !_cpu.State.P.IrqMask)
                first = next = new Clock.ClockEntryRep(new InterruptOp(_cpu, 0xfffe), 7);
            else
            {
                _cpu.Opcode = _cpu.Memory.Read(_cpu.State.PC.Value);
                _cpu.State.PC.Next();

                DecodingTable.Entry decoded = DecodingTable.Opcodes[_cpu.Opcode];
                DecodeAddressOp addrOp = new DecodeAddressOp(_cpu, decoded._addressing);
                ExecuteOpcodeOp execOp = new ExecuteOpcodeOp(_cpu, decoded._instruction, decoded._timing._prolongOnPageCross);

                byte addrTime = decoded._timing._addressingTime;
                byte execTime = decoded._timing._execTime;

                first = addrTime < 2 ? new Clock.ClockEntry(addrOp, true) : new Clock.ClockEntryRep(addrOp, addrTime);
                first.ComboNext = execTime == 0 || addrTime == 0;

                next = first.Next = execTime < 2 ? new Clock.ClockEntry(execOp) : new Clock.ClockEntryRep(execOp, execTime);

                sbyte writeCycles = decoded._timing._writeTime;
                if (writeCycles >= 0)
                {
                    if (writeCycles < 2)
                    {
                        next.ComboNext = writeCycles == 0;
                        next = next.Next = new Clock.ClockEntry(new WriteResultOp(_cpu));
                    }
                    else
                    {
                        next = next.Next = new Clock.ClockEntryRep(new Clock.StallOp(), (byte)(writeCycles - 1));
                        next = next.Next = new Clock.ClockEntry(new WriteResultOp(_cpu));
                    }
                }
            }

            next.Next = new Clock.ClockEntry(new DecodeOpcodeOp(_cpu));
            clock.QueueOps(first, _cpu.Phase);
        }
开发者ID:RonFields72,项目名称:C64Emulator,代码行数:45,代码来源:6502.cs


注:本文中的Clock.QueueOps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。