Skip to content

Commit

Permalink
Merge pull request #10 from danoost/master
Browse files Browse the repository at this point in the history
wsim v3.3.0
  • Loading branch information
gizmoguy authored Apr 15, 2019
2 parents f715272 + 96e7a56 commit 61d37d6
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion RexSimulator/Hardware/Rex/Timer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void Tick()
{
if (tickCount-- == 0)
{
tickCount = 1667; //about 2400 Hz, assuming a 4 MHz system clock
tickCount = 2604; //about 2400 Hz, assuming a 6.25MHz system clock

//Do timer events
if ((Control & 1) != 0) //if enabled
Expand Down
3 changes: 1 addition & 2 deletions RexSimulator/Hardware/RexBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class RexBoard
public readonly Bus mDataBus;
public readonly Bus mAddressBus;
public readonly Bus mIrqs;
public readonly Bus mCs;

public readonly SimpleWrampCpu CPU;

Expand Down Expand Up @@ -76,7 +75,7 @@ public RexBoard()
mIrqs = new Bus();

//Initialise other components
CPU = new SimpleWrampCpu(mAddressBus, mDataBus, mIrqs, mCs);
CPU = new SimpleWrampCpu(mAddressBus, mDataBus, mIrqs);

//Memory and Memory-mapped IO
RAM = new MemoryDevice(0x00000, 0x04000, mAddressBus, mDataBus, "Memory (RAM)");
Expand Down
5 changes: 2 additions & 3 deletions RexSimulator/Hardware/SimpleWrampCpu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace RexSimulator.Hardware
public class SimpleWrampCpu
{
#region WRAMP Interface
private Bus mAddressBus, mDataBus, mIrqs, mCs;
private Bus mAddressBus, mDataBus, mIrqs;
private int mTicksToNextInstruction = -1;
#endregion

Expand Down Expand Up @@ -90,12 +90,11 @@ private enum ExceptionSource { GPF = 0x1000, SYSCALL = 0x2000, BREAK = 0x4000, A
/// <param name="dataBus">The data bus.</param>
/// <param name="irqs">The interrupt request lines (IRQs).</param>
/// <param name="cs">The chip-select lines.</param>
public SimpleWrampCpu(Bus addressBus, Bus dataBus, Bus irqs, Bus cs)
public SimpleWrampCpu(Bus addressBus, Bus dataBus, Bus irqs)
{
mAddressBus = addressBus;
mDataBus = dataBus;
mIrqs = irqs;
mCs = cs;

mGpRegisters = new RegisterFile("General Purpose Registers");
mSpRegisters = new RegisterFile("Special Purpose Registers");
Expand Down
4 changes: 2 additions & 2 deletions RexSimulator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.1")]
[assembly: AssemblyFileVersion("3.1.1")]
[assembly: AssemblyVersion("3.1.2")]
[assembly: AssemblyFileVersion("3.1.2")]
3 changes: 3 additions & 0 deletions RexSimulatorGui/Controls/RexWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ private void RexWidget_Click(object sender, EventArgs e)
switch (mActiveControl)
{
case ControlWithFocus.Reset:
mBoard.Reset();
break;

case ControlWithFocus.SoftReset:
uint switchBk = mBoard.Parallel.Switches;
mBoard.Reset();
Expand Down
7 changes: 4 additions & 3 deletions RexSimulatorGui/Forms/BasicSerialPortForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
using System.IO;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Media;
using RexSimulatorGui.Properties;

namespace RexSimulatorGui.Forms
{
Expand Down Expand Up @@ -254,9 +256,8 @@ private void updateTimer_Tick(object sender, EventArgs e)
switch (c)
{
case (char)0x07:
Action beep = Console.Beep;
beep.BeginInvoke(null, null);
//Console.Beep();
SoundPlayer sp = new SoundPlayer(Resources.duck_quack);
sp.Play();
break;

case '\r':
Expand Down
12 changes: 5 additions & 7 deletions RexSimulatorGui/Forms/MemoryForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ private void RedrawItem(params uint[] addresses)
/// <param name="e"></param>
private void timer1_Tick(object sender, EventArgs e)
{
//listView1.BeginUpdate();
// Stop the ListView from redrawing until we're done throwing new items at it
// Vastly improves performance when a lot of memory has changed.
memoryListView.BeginUpdate();

//Update all changed memory locations
for (uint i = 0; i < mDevice.Size; i++)
{
Expand All @@ -178,8 +181,6 @@ private void timer1_Tick(object sender, EventArgs e)
mIr.Instruction = value;
mShadow[i] = value;

memoryListView.RedrawItems((int)i, (int)i, true);

mVirtualItems[i].SubItems[2].Text = value.ToString("X8");
mVirtualItems[i].SubItems[3].Text = mIr.ToString();
}
Expand Down Expand Up @@ -223,9 +224,6 @@ private void timer1_Tick(object sender, EventArgs e)
SetPointerText(newRbase, "$rbase ", true);
SetPointerText(newPtable, "$ptable ", true);

//Redraw any affected items
RedrawItem(mPc, mSp, mRa, mEvec, mEar, mRbase, mPtable, newPc, newSp, newSp, newRa, newEvec, newEvec, newRbase, newPtable);

mPc = newPc;
mSp = newSp;
mRa = newRa;
Expand All @@ -236,7 +234,7 @@ private void timer1_Tick(object sender, EventArgs e)
mRbase = newRbase;
mPtable = newPtable;
}
//listView1.EndUpdate();
memoryListView.EndUpdate();
}

private void memoryListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions RexSimulatorGui/Forms/RexBoardForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ private void Worker()
{
physPC += mRexBoard.CPU.mSpRegisters[RegisterFile.SpRegister.rbase];
}

if (mRunning && mRamForm.Breakpoints.Contains(physPC)) //stop the CPU if a breakpoint has been hit
//stop the CPU if a breakpoint has been hit and we're not trying to step over it
if (!mStepping && mRunning && mRamForm.Breakpoints.Contains(physPC))
{
this.Invoke(new Action(runButton.PerformClick));
continue;
Expand Down
4 changes: 2 additions & 2 deletions RexSimulatorGui/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.2.1")]
[assembly: AssemblyFileVersion("3.2.1")]
[assembly: AssemblyVersion("3.3.0")]
[assembly: AssemblyFileVersion("3.3.0")]

0 comments on commit 61d37d6

Please sign in to comment.