Exemple #1
0
 public LD(FullAddress to, IByteRegister from, string opcodeStr, int cycles, Action customLogic = null)
 {
     _executor = () =>
     {
         Bus.MMU.SetByte(to.Value, from.Get());
         customLogic?.Invoke();
         Bus.CPU.Registers.PC.Increment((ushort)(to.Source == AddressSource.Register ? 1 : 3));
         opcodeStr = opcodeStr.Replace("a16", $"0x{to.Value:X}");
         return(new ExecutedOpcode(cycles, opcodeStr, OpcodeType.LD));
     };
 }
Exemple #2
0
 public RegisterPair(RegisterId id, IByteRegister hi, IByteRegister lo)
 {
     Id  = id;
     _hi = hi;
     _lo = lo;
 }