diff --git a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs index 1281562d84..b0178e64f2 100644 --- a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs +++ b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs @@ -57,10 +57,12 @@ namespace BizHawk.Emulation.Cores.Components.M6502 return val; } + public bool AtStart { get { return opcode == VOP_Fetch1 || Microcode[opcode][mi] >= Uop.End; } } + public string TraceState() { // only disassemble when we're at the beginning of an opcode - return State(opcode == VOP_Fetch1 || Microcode[opcode][mi] >= Uop.End); + return State(AtStart); } public const ushort NMIVector = 0xFFFA; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs index b3e09f8dd3..ffe8ff710e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs @@ -90,12 +90,10 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private void StepInto() { - var size = opsize[Cpu.PeekMemory(Cpu.PC)]; - - for (int i = 0; i < size; i++) + do { CycleAdvance(); - } + } while (!Cpu.AtStart); } //the opsize table is used to quickly grab the instruction sizes (in bytes)