mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-04-22 04:16:47 +00:00
Couple of small refactorings, based on repeated bit patterns
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
+3
-3
@@ -347,9 +347,9 @@ namespace EightBit
|
||||
|
||||
private static byte AdjustOverflowSub(byte input, byte before, byte value, byte calculation) => AdjustOverflowSub(input, before & (byte)StatusBits.SF, value & (byte)StatusBits.SF, calculation & (byte)StatusBits.SF);
|
||||
|
||||
private static byte RES(int n, byte operand) => (byte)(operand & ~(1 << n));
|
||||
private static byte RES(int n, byte operand) => ClearBit(operand, Bit(n));
|
||||
|
||||
private static byte SET(int n, byte operand) => (byte)(operand | (1 << n));
|
||||
private static byte SET(int n, byte operand) => SetBit(operand, Bit(n));
|
||||
|
||||
private void DisableInterrupts() => this.IFF1 = this.IFF2 = false;
|
||||
|
||||
@@ -1724,7 +1724,7 @@ namespace EightBit
|
||||
{
|
||||
this.F = SetBit(this.F, StatusBits.HC);
|
||||
this.F = ClearBit(this.F, StatusBits.NF);
|
||||
var discarded = (byte)(operand & (1 << n));
|
||||
var discarded = (byte)(operand & Bit(n));
|
||||
this.F = AdjustSZ(this.F, discarded);
|
||||
this.F = ClearBit(this.F, StatusBits.PF, discarded);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user