private void Mov4(GameEngine engine, EvaluatedVectorizedOp a, EvaluatedVectorizedOp b) { var newStatements = a.IsImmediate ? b.Statements.Select((stm, i) => stm.SetB(a.Value[i])).ToArray() : a.Statements; for (int i = 0; i < 4; i++) { engine.WriteToMemory(b.Addr[i], newStatements[i]); } }
private void Sub4(GameEngine engine, EvaluatedVectorizedOp a, EvaluatedVectorizedOp b) { var statementsB = b.Statements; if (a.IsImmediate) { for (int i = 0; i < 4; i++) { engine.WriteToMemory(b.Addr[i], statementsB[i].SetB(statementsB[i].FieldB.Calculate() - a.Value[i])); } } else { var statementsA = a.Statements; for (int i = 0; i < 4; i++) { engine.WriteToMemory(b.Addr[i], statementsB[i] .SetA(statementsB[i].FieldA.Calculate() - statementsA[i].FieldA.Calculate()) .SetB(statementsB[i].FieldB.Calculate() - statementsA[i].FieldB.Calculate())); } } }