diff --git a/src/Spice86/ViewModels/DebugWindowViewModel.cs b/src/Spice86/ViewModels/DebugWindowViewModel.cs
index 2f579117e..bd9c5a4a4 100644
--- a/src/Spice86/ViewModels/DebugWindowViewModel.cs
+++ b/src/Spice86/ViewModels/DebugWindowViewModel.cs
@@ -91,10 +91,26 @@ public DebugWindowViewModel(State cpuState, Stack stack, IMemory memory, Midi ex
VideoCardViewModel = new(vgaRenderer, videoState);
CpuViewModel = new(cpuState, memory, pauseHandler, uiDispatcher);
MidiViewModel = new(externalMidiDevice);
- MemoryViewModels.Add(new(memory, BreakpointsViewModel, pauseHandler, messenger, uiDispatcher, textClipboard, storageProvider, structureViewModelFactory));
+ MemoryViewModel mainMemoryViewModel = new(memory,
+ BreakpointsViewModel, pauseHandler, messenger,
+ uiDispatcher, textClipboard, storageProvider, structureViewModelFactory);
+ MemoryViewModel stackMemoryViewModel = new(memory,
+ BreakpointsViewModel, pauseHandler, messenger,
+ uiDispatcher, textClipboard, storageProvider, structureViewModelFactory,
+ canCloseTab: false, startAddress: stack.PhysicalAddress) {
+ Title = "Stack Memory"
+ };
+ pauseHandler.Pausing += () => UpdateStackMemoryViewModel(stackMemoryViewModel, stack);
+ MemoryViewModels.Add(mainMemoryViewModel);
+ MemoryViewModels.Add(stackMemoryViewModel);
CfgCpuViewModel = new(executionContextManager, pauseHandler, new PerformanceMeasurer());
}
+ private void UpdateStackMemoryViewModel(MemoryViewModel stackMemoryViewModel, Stack stack) {
+ stackMemoryViewModel.StartAddress = stack.PhysicalAddress;
+ stackMemoryViewModel.EndAddress = A20Gate.EndOfHighMemoryArea;
+ }
+
[RelayCommand]
private void Pause() => _pauseHandler.RequestPause("Pause button pressed in debug window");
diff --git a/src/Spice86/ViewModels/MemoryViewModel.cs b/src/Spice86/ViewModels/MemoryViewModel.cs
index e8ac36b21..2437f6b5e 100644
--- a/src/Spice86/ViewModels/MemoryViewModel.cs
+++ b/src/Spice86/ViewModels/MemoryViewModel.cs
@@ -50,6 +50,9 @@ public MemoryViewModel(IMemory memory, BreakpointsViewModel breakpointsViewModel
TryUpdateHeaderAndMemoryDocument();
}
+ [ObservableProperty]
+ private string? _title;
+
public enum MemorySearchDataType {
Binary,
Ascii,
diff --git a/src/Spice86/Views/MemoryView.axaml b/src/Spice86/Views/MemoryView.axaml
index c788d2748..3f9f8cb79 100644
--- a/src/Spice86/Views/MemoryView.axaml
+++ b/src/Spice86/Views/MemoryView.axaml
@@ -53,9 +53,12 @@
-
+
+
+
+