-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Machine is a God class #393
Conversation
src/Spice86.Core/Emulator/Devices/Timer/InvalidCounterIndexException.cs
Outdated
Show resolved
Hide resolved
|
||
public VideoState VideoState => Machine.VgaRegisters; | ||
|
||
public ArgbPalette ArgbPalette => Machine.VgaRegisters.DacRegisters.ArgbPalette; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of these public properties? They do not seem to be related to the concept of a programexecutor.
Is this the ProgramExecuter taking over some of the "servicecontainer" functionality of the Machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary fix so I could remove all references that where left in the MainWindowViewModel to the Machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Nice cleanup.
963db0b
to
28e70d1
Compare
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
…efs to Machine Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
…o refs to Machine Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
28e70d1
to
31ef815
Compare
Signed-off-by: Maximilien Noal <[email protected]>
Signed-off-by: Maximilien Noal <[email protected]>
Description of Changes
Removes all the references to the Machine in the Emulator core, reverse engineeering classes, GDB namespace, exceptions, and the UI.
Moves the DMA loop and DMA thread to the DMA Controller class.
Moves the emulation loop and the emulation thread to a new EmulationLoop class.
All in all, removes all TrainWrecks (aka Law of Demeter violations) related to the Machine.
The Machine is now close to being removed entirely. It's only a dumb service container.
It is only created and used by the Program Executor and unit tests.
But removing it entirely would need the usage of Pure.DI (already used on the UI side), which requires interfaces.
There are also no cyclic dependencies between:
Rationale behind Changes
Makes the code more SOLID, more testable, and way easier to work with.
All classes or nearly all of them only access their toys and their friends, they do not overreach.
Fixes #338
Suggested Testing Steps
Already manually tested:
To be tested against master very soon (by me) - but should still be working: