Example #1
0
        public void OnNextOpcode(CPU_6510 _cpu, DecodedInstruction _instr)
        {
            ushort adr = _instr.PC;

            lastTraceIndex++;
            if (lastTraceIndex >= 64)
            {
                lastTraceIndex = 0;
            }

            Trace[lastTraceIndex] = _instr;

            ushort a0 = adr;

            if (adr == 0xBE1D)
            {
            }

            // TraceOPCodes = false;
            if (IsBreakpoint(adr))
            {
                //TraceOPCodes = true;
            }
            // TraceOPCodes = false;

            // AddBreakpoint(0xB91D);

            if (false)
            {
                string func = "";
                if (KernalFunctions.TryGetValue(adr, out func))
                {
                    Console.Out.WriteLine("${0,4:X4}: {1}", adr, func);
                }
            }

            if (TraceOPCodes)
            {
                string func = "";
                if (KernalFunctions.TryGetValue(adr, out func))
                {
                    Console.Out.WriteLine("${0,4:X4}: {1}", adr, func);
                }

                Console.Out.WriteLine(_instr.ToString());
            }
        }