Amjad50 / plastic

NES emulator in rust with egui and TUI
MIT License
299 stars 12 forks source link

Rewrite how the emulator works, and all UIs #6

Closed Amjad50 closed 4 days ago

Amjad50 commented 5 days ago

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

codecov[bot] commented 4 days ago

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 :warning:
plastic_core/src/nes.rs 70.09% 32 Missing :warning:
plastic_core/src/controller/mod.rs 14.28% 12 Missing :warning:
plastic_core/src/apu2a03/mod.rs 0.00% 3 Missing :warning:
plastic_core/src/display/tv.rs 80.00% 3 Missing :warning:
plastic_core/src/apu2a03/tone_source.rs 0.00% 2 Missing :warning:
plastic_core/src/common/save_state.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.