master
Nabile Rahmani 2017-11-04 12:14:51 +01:00
parent 59fd18ce2c
commit 35932316c4
7 changed files with 25 additions and 19 deletions

View File

@ -24,13 +24,6 @@ namespace DotN64.CPU
protected abstract RegisterIndex Index { get; }
#endregion
#region Constructors
protected Register(SystemControlUnit cp0)
{
this.cp0 = cp0;
}
#endregion
#region Indexers
protected int this[BitVector32.Section section]
{
@ -54,6 +47,13 @@ namespace DotN64.CPU
}
}
#endregion
#region Constructors
protected Register(SystemControlUnit cp0)
{
this.cp0 = cp0;
}
#endregion
}
}
}

View File

@ -31,7 +31,10 @@ namespace DotN64.CPU
#endregion
#region Methods
public void PowerOnReset()
/// <summary>
/// Cold reset.
/// </summary>
public void Reset()
{
Config.EP = ConfigRegister.TransferDataPattern.D;
Config.BE = ConfigRegister.Endianness.BigEndian;

View File

@ -128,11 +128,14 @@ namespace DotN64.CPU
#endregion
#region Methods
public void PowerOnReset()
/// <summary>
/// Cold reset.
/// </summary>
public void Reset()
{
PC = 0xFFFFFFFFBFC00000;
CP0.PowerOnReset();
CP0.Reset();
}
public void Run(Instruction instruction)

View File

@ -13,9 +13,9 @@ namespace DotN64.MI
public static readonly BitVector32.Section InitLengthSection = BitVector32.CreateSection((1 << 7) - 1),
ClearInitModeSection = BitVector32.CreateSection(1, InitLengthSection),
SetInitModeSection = BitVector32.CreateSection(1, ClearInitModeSection),
ClearEbusTestModeSection = BitVector32.CreateSection(1, SetInitModeSection),
SetEbusTestModeSection = BitVector32.CreateSection(1, ClearEbusTestModeSection),
ClearDPInterruptSection = BitVector32.CreateSection(1, SetEbusTestModeSection),
ClearEBusTestModeSection = BitVector32.CreateSection(1, SetInitModeSection),
SetEBusTestModeSection = BitVector32.CreateSection(1, ClearEBusTestModeSection),
ClearDPInterruptSection = BitVector32.CreateSection(1, SetEBusTestModeSection),
ClearRDRAMRegSection = BitVector32.CreateSection(1, ClearDPInterruptSection),
SetRDRAMRegModeSection = BitVector32.CreateSection(1, ClearRDRAMRegSection);
private static readonly BitVector32.Section initModeSection = BitVector32.CreateSection(1, InitLengthSection),

View File

@ -33,8 +33,8 @@ namespace DotN64.MI
mode.InitMode &= bits[InitModeRegister.ClearInitModeSection] == 0;
mode.InitMode |= bits[InitModeRegister.SetInitModeSection] != 0;
mode.EBusTestMode &= bits[InitModeRegister.ClearEbusTestModeSection] == 0;
mode.EBusTestMode |= bits[InitModeRegister.SetEbusTestModeSection] != 0;
mode.EBusTestMode &= bits[InitModeRegister.ClearEBusTestModeSection] == 0;
mode.EBusTestMode |= bits[InitModeRegister.SetEBusTestModeSection] != 0;
if (bits[InitModeRegister.ClearDPInterruptSection] != 0)
throw new NotImplementedException("Clear DP interrupt.");

View File

@ -9,15 +9,15 @@ namespace DotN64
public ulong EndAddress { get; set; }
public bool OffsetAddress { get; set; }
public Func<ulong, uint> Read { get; set; }
public Action<ulong, uint> Write { get; set; }
public bool OffsetAddress { get; set; }
#endregion
#region Constructors
public MappingEntry(uint startAddress, uint endAddress, bool offsetAddress = true)
public MappingEntry(ulong startAddress, ulong endAddress, bool offsetAddress = true)
: this()
{
StartAddress = startAddress;

View File

@ -168,7 +168,7 @@ namespace DotN64
public void PowerOn()
{
CPU.PowerOnReset();
CPU.Reset();
if (PI.BootROM == null)
RunPIF();