Skip to content

Commit

Permalink
Remove memory visualiser.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehjohn committed Nov 22, 2023
1 parent b9b2c8f commit c5cb409
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 113 deletions.
71 changes: 0 additions & 71 deletions src/Zen.Desktop.Host/Features/MemoryVisualiser.cs

This file was deleted.

38 changes: 2 additions & 36 deletions src/Zen.Desktop.Host/Infrastructure/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ public class Host : Game

private CountersVisualiser _countersVisualiser;

private MemoryVisualiser _memoryVisualiser;

public Host()
{
var width = Constants.ScreenWidthPixels * _scaleFactor;
var height = Constants.ScreenHeightPixels * _scaleFactor;

if (AppSettings.Instance.Visualisation == Visualisation.Waveforms || AppSettings.Instance.Visualisation == Visualisation.Memory)
if (AppSettings.Instance.Visualisation == Visualisation.Waveforms)
{
width += Constants.VisualisationPanelWidth * _scaleFactor;
}
Expand Down Expand Up @@ -148,11 +146,6 @@ protected override void LoadContent()
_motherboard.AyAudio.BeeperSignalHook = _waveVisualiser.ReceiveSignal;
}

if (AppSettings.Instance.Visualisation == Visualisation.Memory)
{
_memoryVisualiser = new MemoryVisualiser(_graphicsDeviceManager, _scaleFactor, _motherboard.Ram);
}

_vRamAdapter = new VideoRenderer(_motherboard.VideoAdapter.ScreenFrame, _graphicsDeviceManager);
}

Expand Down Expand Up @@ -260,8 +253,6 @@ private void MenuFinished(MenuResult result, object arguments)
_motherboard.AyAudio.AySignalHook = null;
_motherboard.AyAudio.BeeperSignalHook = null;

_memoryVisualiser = null;

ChangeScale(_scaleFactor);

break;
Expand All @@ -278,16 +269,6 @@ private void MenuFinished(MenuResult result, object arguments)

break;

case MenuResult.VisualisationMemory:
AppSettings.Instance.Visualisation = Visualisation.Memory;
AppSettings.Instance.Save();

_memoryVisualiser = new MemoryVisualiser(_graphicsDeviceManager, _scaleFactor, _motherboard.Ram);

ChangeScale(_scaleFactor);

break;

case MenuResult.CountersOn:
AppSettings.Instance.ViewCounters = true;
AppSettings.Instance.Save();
Expand Down Expand Up @@ -324,7 +305,7 @@ private void ChangeScale(int scale)
var width = Constants.ScreenWidthPixels * _scaleFactor;
var height = Constants.ScreenHeightPixels * _scaleFactor;

if (AppSettings.Instance.Visualisation == Visualisation.Waveforms || AppSettings.Instance.Visualisation == Visualisation.Memory)
if (AppSettings.Instance.Visualisation == Visualisation.Waveforms)
{
width += Constants.VisualisationPanelWidth * _scaleFactor;
}
Expand All @@ -339,11 +320,6 @@ private void ChangeScale(int scale)

_graphicsDeviceManager.ApplyChanges();

if (_memoryVisualiser != null)
{
_memoryVisualiser.ScaleFactor = scale;
}

AppSettings.Instance.ScaleFactor = _scaleFactor;
AppSettings.Instance.Save();
}
Expand Down Expand Up @@ -461,16 +437,6 @@ protected override void Draw(GameTime gameTime)
new Rectangle(0, 0, Constants.ScreenWidthPixels, Constants.CountersPanelHeight), Color.White);
}

if (_memoryVisualiser != null)
{
_memoryVisualiser.Render();

_spriteBatch.Draw(_memoryVisualiser.View,
new Rectangle(Constants.ScreenWidthPixels * _scaleFactor, 0, Constants.VisualisationPanelWidth * _scaleFactor, Constants.ScreenHeightPixels * _scaleFactor),
new Rectangle(0, 0, Constants.VisualisationPanelWidth, Constants.ScreenHeightPixels), Color.White);

}

_spriteBatch.End();

base.Draw(gameTime);
Expand Down
1 change: 0 additions & 1 deletion src/Zen.Desktop.Host/Infrastructure/Menu/MenuResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public enum MenuResult
SoundOff,
VisualisationOff,
VisualisationWaveform,
VisualisationMemory,
CountersOn,
CountersOff
}
3 changes: 0 additions & 3 deletions src/Zen.Desktop.Host/Infrastructure/Menu/VisualisationMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public override (MenuResult Result, MenuBase NewMenu, object Arguments) ItemSele
case 2:
return (MenuResult.VisualisationWaveform, null, null);

case 3:
return (MenuResult.VisualisationMemory, null, null);

default:
return (MenuResult.NewMenu, new MainMenu(), null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
public enum Visualisation
{
Off,
Waveforms,
Memory
Waveforms
}

0 comments on commit c5cb409

Please sign in to comment.