Stuff
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@ namespace MCEmuCore.GBMonolith
|
||||
enum Register { A, B, C, D, E, H, L };
|
||||
private readonly byte[] Registers = new byte[7];
|
||||
public readonly FlagRegister Flags = new FlagRegister();
|
||||
public ushort SP, PC;
|
||||
|
||||
#region Register Accessors
|
||||
public byte A
|
||||
@@ -159,9 +160,6 @@ namespace MCEmuCore.GBMonolith
|
||||
}
|
||||
#endregion
|
||||
|
||||
public ushort SP { get; set; }
|
||||
public ushort PC { get; set; }
|
||||
|
||||
#region Constructors
|
||||
public CpuRegisters()
|
||||
{
|
||||
@@ -266,9 +264,9 @@ namespace MCEmuCore.GBMonolith
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
Value |= 0b1000_0000;
|
||||
register |= 0b1000_0000;
|
||||
else
|
||||
Value &= 0b0111_1111;
|
||||
register &= 0b0111_0000;
|
||||
}
|
||||
}
|
||||
public bool Subtract
|
||||
@@ -277,9 +275,9 @@ namespace MCEmuCore.GBMonolith
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
Value |= 0b0100_0000;
|
||||
register |= 0b0100_0000;
|
||||
else
|
||||
Value &= 0b1011_1111;
|
||||
register &= 0b1011_0000;
|
||||
}
|
||||
}
|
||||
public bool HalfCarry
|
||||
@@ -288,9 +286,9 @@ namespace MCEmuCore.GBMonolith
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
Value |= 0b0010_0000;
|
||||
register |= 0b0010_0000;
|
||||
else
|
||||
Value &= 0b1101_1111;
|
||||
register &= 0b1101_0000;
|
||||
}
|
||||
}
|
||||
public bool Carry
|
||||
@@ -299,9 +297,9 @@ namespace MCEmuCore.GBMonolith
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
Value |= 0b0001_0000;
|
||||
register |= 0b0001_0000;
|
||||
else
|
||||
Value &= 0b1110_1111;
|
||||
register &= 0b1110_0000;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace MCEmuCore.GBMonolith
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var cpu = new Cpu();
|
||||
TestRegisters();
|
||||
}
|
||||
|
||||
@@ -54,7 +55,6 @@ namespace MCEmuCore.GBMonolith
|
||||
cpuRegisters.Flags.HalfCarry = true;
|
||||
cpuRegisters.Flags.Carry = false;
|
||||
cpuRegisters.PrintFlags();
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user