Skip to content
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

Rewrite how the emulator works, and all UIs #6

Merged
merged 18 commits into from
Oct 19, 2024
Merged

Rewrite how the emulator works, and all UIs #6

merged 18 commits into from
Oct 19, 2024

Conversation

Amjad50
Copy link
Owner

@Amjad50 Amjad50 commented Oct 18, 2024

Very big PR here.

This does several things.

  1. Changes how the emulator operates, before this, the emulator struct NES was holding everything, and even managing rendering through UiProvider trait. I didn't like this design.
    So I adopted the new design that I also used in my other emulators mizu and trapezoid.
    This new design is that the emulator is in a crate plastic_core this makes it much easier for others to just import this and handle emulation without needing to implement UiProvider.
    You can think of this new design in that the emulator is now a service provider providing you with pixels and audio and you just provide input and clock it.
  2. Removed SFML, GTK, windows native UI, and replaced all of these with egui. one UI is just better, and non of the above 3 is good for all platforms, tbh not sure if egui is good with other platforms but it seems simple so I think it should work with all platforms easily.
  3. Updated tui ui to work with the new design of the emulator and updated its deps (ratatui)
  4. Updated the tests to use the new design, and its much easier to work with now
  5. Added tests for save/load state
  6. Updated github actions to work with the new rewrite

We want the `core` to never do anything platform specific, this includes
UI and audio handling.

Planning to remove almost all the UIs except for the new one `egui`

Signed-off-by: Amjad Alsharafi <[email protected]>
Forwarded the buffer from the backend apu to the frontend ui

Signed-off-by: Amjad Alsharafi <[email protected]>
Dropped_files doesn't work on wayland `winit` at the time of writing,
but works on X11, so we can use that for now.

Signed-off-by: Amjad Alsharafi <[email protected]>
Signed-off-by: Amjad Alsharafi <[email protected]>
Signed-off-by: Amjad Alsharafi <[email protected]>
Signed-off-by: Amjad Alsharafi <[email protected]>
TUI doesn't work yet with the new API, but should soon.

Signed-off-by: Amjad Alsharafi <[email protected]>
Signed-off-by: Amjad Alsharafi <[email protected]>
Signed-off-by: Amjad Alsharafi <[email protected]>
@Amjad50 Amjad50 force-pushed the rewrite branch 3 times, most recently from c2a2d16 to cd5c690 Compare October 19, 2024 02:56
I think I was testing something and left it there by mistake

Signed-off-by: Amjad Alsharafi <[email protected]>
@Amjad50 Amjad50 force-pushed the rewrite branch 10 times, most recently from 5210809 to af3bdc2 Compare October 19, 2024 03:41
Signed-off-by: Amjad Alsharafi <[email protected]>
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 44.74886% with 121 lines in your changes missing coverage. Please review.

Project coverage is 81.83%. Comparing base (74a3ffc) to head (8f976a2).
Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
plastic_core/src/misc.rs 0.00% 68 Missing ⚠️
plastic_core/src/nes.rs 70.09% 32 Missing ⚠️
plastic_core/src/controller/mod.rs 14.28% 12 Missing ⚠️
plastic_core/src/apu2a03/mod.rs 0.00% 3 Missing ⚠️
plastic_core/src/display/tv.rs 80.00% 3 Missing ⚠️
plastic_core/src/apu2a03/tone_source.rs 0.00% 2 Missing ⚠️
plastic_core/src/common/save_state.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master       #6       +/-   ##
===========================================
+ Coverage   43.80%   81.83%   +38.03%     
===========================================
  Files          34       37        +3     
  Lines        2744     5351     +2607     
===========================================
+ Hits         1202     4379     +3177     
+ Misses       1542      972      -570     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Amjad50 Amjad50 merged commit 034efbb into master Oct 19, 2024
4 checks passed
@Amjad50 Amjad50 deleted the rewrite branch October 19, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant