Skip to content

Commit

Permalink
[3.1.0] Features and bugfixes
Browse files Browse the repository at this point in the history
* FEATURE: Pressing Ctrl+A on a serial port also opens the file send dialog.
* BUGFIX: Switches are on when they're up, not down. This has changed since the REX boards.
* BUGFIX: Coloured interrupt indicators only colour if they are unmasked in $cctrl.
  • Loading branch information
danoost committed Feb 8, 2019
1 parent b28ca1b commit 423e144
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Change History for rexsim

## r21
## 3.1.0

* Pressing Ctrl+A on serial port forms now opens the send file dialog to make following WRAMPmon's instructions not useless.
* Switches are on when they're up, not down. This has changed since the REX boards.
* Coloured interrupt indicators only appear if they are unmasked in $cctrl.

## r21 - 3.0.0

* Various changes to reflect the Basys implementation of WRAMP. This includes visuals and the specifications of the board: clock rate, amount of RAM, new parallel controls, etc.
* Bump version to 3.0.0
* Bump version to 3.0.0 and begin using semantic versioning scheme
* Update WRAMPmon to version 0.7
* Fix the warnings that were generated by xbuild
* Annotations including Address Bus, Program Counter, and Interrupts have been moved underneath the picture of the board. The new board does not have physical lights for interrupts.
Expand Down
4 changes: 2 additions & 2 deletions RexSimulator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,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.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: AssemblyVersion("3.1.0")]
[assembly: AssemblyFileVersion("3.1.0")]
13 changes: 7 additions & 6 deletions RexSimulatorGui/Controls/RexWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@ private void DrawIRQs(Graphics g)
// these magic numbers give approximately 40px of space
// between each label.
DrawIRQ(g, "Interrupts:", mBoard.mIrqs.Value != 0, 5, 550);
DrawIRQ(g, "Button", mBoard.mIrqs.GetBit(1), 150, 550);
DrawIRQ(g, "Timer", mBoard.mIrqs.GetBit(2), 250, 550);
DrawIRQ(g, "Parallel", mBoard.mIrqs.GetBit(3), 340, 550);
DrawIRQ(g, "Serial 1", mBoard.mIrqs.GetBit(4), 460, 550);
DrawIRQ(g, "Serial 2", mBoard.mIrqs.GetBit(5), 580, 550);

DrawIRQ(g, "Button", mBoard.mIrqs.GetBit(1) && (mBoard.CPU.mSpRegisters[RexSimulator.Hardware.Wramp.RegisterFile.SpRegister.cctrl] & (1 << 5)) != 0, 150, 550);
DrawIRQ(g, "Timer", mBoard.mIrqs.GetBit(2) && (mBoard.CPU.mSpRegisters[RexSimulator.Hardware.Wramp.RegisterFile.SpRegister.cctrl] & (1 << 6)) != 0, 250, 550);
DrawIRQ(g, "Parallel", mBoard.mIrqs.GetBit(3) && (mBoard.CPU.mSpRegisters[RexSimulator.Hardware.Wramp.RegisterFile.SpRegister.cctrl] & (1 << 7)) != 0, 340, 550);
DrawIRQ(g, "Serial 1", mBoard.mIrqs.GetBit(4) && (mBoard.CPU.mSpRegisters[RexSimulator.Hardware.Wramp.RegisterFile.SpRegister.cctrl] & (1 << 8)) != 0, 460, 550);
DrawIRQ(g, "Serial 2", mBoard.mIrqs.GetBit(5) && (mBoard.CPU.mSpRegisters[RexSimulator.Hardware.Wramp.RegisterFile.SpRegister.cctrl] & (1 << 9)) != 0, 580, 550);
}

private void DrawLeds(Graphics g)
Expand Down Expand Up @@ -352,7 +353,7 @@ private void DrawSwitch(Graphics g, Point p, Brush b, int switchNo)
g.FillRectangle(b, p.X - mSwitchBorderSize.Width / 2, p.Y - mSwitchBorderSize.Height / 2, mSwitchBorderSize.Width, mSwitchBorderSize.Height);

bool on = ((mBoard.Parallel.Switches & (1 << switchNo)) != 0);
int y = on ? mSwitchSize.Height : -mSwitchSize.Height;
int y = on ? -mSwitchSize.Height : mSwitchSize.Height;
y += p.Y;
g.FillRectangle(b, p.X - mSwitchBorderSize.Width / 2, p.Y - mSwitchBorderSize.Height / 2, mSwitchBorderSize.Width, mSwitchBorderSize.Height);

Expand Down
26 changes: 19 additions & 7 deletions RexSimulatorGui/Forms/BasicSerialPortForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,7 @@ private void SerialPortForm_FormClosing(object sender, FormClosingEventArgs e)
this.Hide();
}

/// <summary>
/// Upload a file.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void sendFileToolStripMenuItem_Click(object sender, EventArgs e)
private void UploadFileDialog()
{
if (mUploadFileWorker != null && mUploadFileWorker.ThreadState == System.Threading.ThreadState.Running)
mUploadFileWorker.Abort();
Expand All @@ -177,6 +172,16 @@ private void sendFileToolStripMenuItem_Click(object sender, EventArgs e)
}
}

/// <summary>
/// Upload a file.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void sendFileToolStripMenuItem_Click(object sender, EventArgs e)
{
UploadFileDialog();
}

/// <summary>
/// Transmit a keypress to the board.
/// </summary>
Expand All @@ -185,7 +190,14 @@ private void sendFileToolStripMenuItem_Click(object sender, EventArgs e)
private void serialTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
mSerialPort.SendAsync(e.KeyChar);
if (Control.ModifierKeys == Keys.Control)
{
UploadFileDialog();
}
else
{
mSerialPort.SendAsync(e.KeyChar);
}
}

/// <summary>
Expand Down

0 comments on commit 423e144

Please sign in to comment.