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