Fixed logical operation handling so that the logic-op function is updated...
The logic-op function state was only being set correctly at the moment when logic-ops are enabled. This meant that changes to the logic-op while logic-ops remained enabled would be ignored. This fix ensures that the hardware's logic-op function state is always updated when needed.