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

Deliver an integrated program to illustrate SDL-oriented system calls #101

Closed
jserv opened this issue Dec 25, 2022 · 3 comments
Closed

Deliver an integrated program to illustrate SDL-oriented system calls #101

jserv opened this issue Dec 25, 2022 · 3 comments
Assignees

Comments

@jserv
Copy link
Contributor

jserv commented Dec 25, 2022

In order to illustrate how to use SDL-oriented system calls, we can deliver an integrated program which utilizes SDL window system and input events. smolnes is ideal for its small footprint and powerful features -- a NES emulator less than 500 lines of code (deobfuscated.c). We can redistribute the open source NES ROM files such as falling-nes.

Expected output:

  1. Replace SDL functions in smolnes with rv32emu specific SDL oriented system calls.
  2. Verify the functionality of NES emulation with falling-nes and some NES games.
  3. By default, the emulator looks for rom.nes and fallbacks to use falling.nes if the former is not found.
  4. Add some preliminary documentation on the usage of SDL-oriented system calls in the source code of modified smolnes.

Later, we might initiate the binary translator which converts 6502 opcode into RV32 or specific IR when we proceed #81, meaning that the NES emulation can be quite efficient.

@jserv jserv changed the title Delivering an integrated program to illustrate SDL-oriented system calls Deliver an integrated program to illustrate SDL-oriented system calls Dec 27, 2022
@jserv
Copy link
Contributor Author

jserv commented Feb 26, 2023

Besides a functioned NES emulator, we can still provide a standalone renderer (or tiny game engine) to present the ability of SDL oriented system call. @alanjian85, do you have something in mind?

@alanjian85
Copy link
Collaborator

Besides a functioned NES emulator, we can still provide a standalone renderer (or tiny game engine) to present the ability of SDL oriented system call. @alanjian85, do you have something in mind?

I have previously satisfied all the four requirements listed above. However, I'm hesitating whether to create a static binary translator that converts a 6502 ROM file to a RISC-V executable file, eliminating the necessity of using smolnes; or a JIT compiler in smolnes; or even optimize rv32emu itself. Furthermore, the lack of memory mapping and translation in rv32emu places limitations on optimization techniques, making some of them infeasible.

@jserv jserv closed this as completed in d5e3068 Dec 25, 2023
jserv added a commit that referenced this issue Dec 25, 2023
To demonstrate the use of SDL-oriented system calls, we can provide
an integrated program that leverages the SDL window system and input
events. Smolnes [1] is an ideal choice due to its minimal footprint
and robust features – it is a Nintendo NES emulator with less than
500 lines of code. Furthermore, we have the option to redistribute
open-source NES ROM files, such as falling-nes [2].

[1] https://github.com/binji/smolnes
[2] https://github.com/xram64/falling-nes

Close #101
@jserv
Copy link
Contributor Author

jserv commented Dec 25, 2023

Thank @alanjian85 again for the great work!

Later, we might consider enhancing smolnes using the cached interpreter technique, which would avoid unnecessary instruction decoding efforts and reduce instruction dispatch overhead.

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

No branches or pull requests

2 participants