-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: DISASM view segmented addressing mode
Signed-off-by: Maximilien Noal <noal.maximilien@gmail.com>
- Loading branch information
1 parent
3e58dd8
commit 4013630
Showing
4 changed files
with
122 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace Spice86.ViewModels; | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
|
||
using Spice86.Core.Emulator.VM; | ||
using Spice86.Core.Emulator.VM.Breakpoint; | ||
|
||
using System.Collections.ObjectModel; | ||
|
||
public partial class BreakpintsViewModel : ViewModelBase { | ||
private readonly EmulatorBreakpointsManager _emulatorBreakpointsManager; | ||
|
||
public BreakpintsViewModel(EmulatorBreakpointsManager emulatorBreakpointsManager) { | ||
_emulatorBreakpointsManager = emulatorBreakpointsManager; | ||
} | ||
|
||
[ObservableProperty] | ||
private ObservableCollection<BreakpointViewModel> _breakpointsViewModels = new(); | ||
|
||
[ObservableProperty] | ||
private BreakpointViewModel? _currentBreakpointViewModel; | ||
|
||
[RelayCommand] | ||
private void AddAddressBreakpoint(AddressBreakPoint addressBreakPoint) { | ||
var breakpointViewModel = new BreakpointViewModel(_emulatorBreakpointsManager, addressBreakPoint); | ||
BreakpointsViewModels.Add(breakpointViewModel); | ||
CurrentBreakpointViewModel = BreakpointsViewModels.Last(); | ||
} | ||
|
||
[RelayCommand] | ||
private void RemoveBreakpoint() { | ||
if (CurrentBreakpointViewModel is not null) { | ||
BreakpointsViewModels.Remove(CurrentBreakpointViewModel); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Spice86.ViewModels; | ||
using CommunityToolkit.Mvvm.Input; | ||
|
||
using Spice86.Core.Emulator.VM; | ||
using Spice86.Core.Emulator.VM.Breakpoint; | ||
|
||
public partial class BreakpointViewModel : ViewModelBase { | ||
private readonly BreakPoint _breakPoint; | ||
private readonly EmulatorBreakpointsManager _emulatorBreakpointsManager; | ||
|
||
public BreakpointViewModel(EmulatorBreakpointsManager emulatorBreakpointsManager, BreakPoint breakPoint) { | ||
_breakPoint = breakPoint; | ||
_emulatorBreakpointsManager = emulatorBreakpointsManager; | ||
} | ||
|
||
[RelayCommand] | ||
private void Enable() => _emulatorBreakpointsManager.ToggleBreakPoint(_breakPoint, on: true); | ||
|
||
[RelayCommand] | ||
private void Disable() => _emulatorBreakpointsManager.ToggleBreakPoint(_breakPoint, on: false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters