Esempio n. 1
0
        private void MakeTrace(IntPtr data)
        {
            int[] s = new int[7];
            Marshal.Copy(data, s, 0, 7);

            byte   a  = (byte)s[0];
            byte   x  = (byte)s[1];
            byte   y  = (byte)s[2];
            ushort sp = (ushort)s[3];
            ushort pc = (ushort)s[4];
            byte   p  = (byte)s[5];

            byte opcode = (byte)s[6];

            int    notused   = 0;
            string opcodeStr = MOS6502X.Disassemble(pc, out notused, (address) => _memoryDomains.SystemBus.PeekByte(address));

            Tracer.Put(new TraceInfo
            {
                Disassembly  = $"{pc:X4}:  {opcodeStr}".PadRight(26),
                RegisterInfo = string.Join(" ",
                                           $"A:{a:X2}",
                                           $"X:{x:X2}",
                                           $"Y:{y:X2}",
                                           $"P:{p:X2}",
                                           $"SP:{sp:X2}")
            });
        }
Esempio n. 2
0
        private void MakeTrace(IntPtr data)
        {
            int[] s = new int[7];
            Marshal.Copy(data, s, 0, 7);

            byte   a  = (byte)s[0];
            byte   x  = (byte)s[1];
            byte   y  = (byte)s[2];
            ushort sp = (ushort)s[3];
            ushort pc = (ushort)s[4];
            byte   p  = (byte)s[5];

            byte opcode = (byte)s[6];

            int    notused   = 0;
            string opcodeStr = MOS6502X.Disassemble(pc, out notused, (address) => _memoryDomains.SystemBus.PeekByte(address));

            Tracer.Put(new TraceInfo
            {
                Disassembly  = string.Format("{0:X4} {1}", pc, opcodeStr).PadRight(26),
                RegisterInfo = string.Format(
                    "SP:{0:X2} A:{1:X2} P:{2:X2} X:{3:X2} Y:{4:X2}",
                    sp,
                    a,
                    p,
                    x,
                    y)
            });
        }
 public string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     return(MOS6502X.Disassemble((ushort)addr, out length, (a) => m.PeekByte(a)));
 }
 public string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     return(MOS6502X.Disassemble((ushort)addr, out length, a => unchecked ((byte)Peek(a))));
 }
 public string Disassemble(MemoryDomain m, uint addr, out int length)
 {
     return(MOS6502X.Disassemble((ushort)addr, out length, CpuPeek));
 }