Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.
/ advanced Public archive

It's an experimental and learning propose libRetro front-end to mGBA.

License

Notifications You must be signed in to change notification settings

henrybarreto/advanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced

              _                               _ 
     /\      | |                             | |
    /  \   __| |_   ____ _ _ __   ___ ___  __| |
   / /\ \ / _` \ \ / / _` | '_ \ / __/ _ \/ _` |
  / ____ \ (_| |\ V / (_| | | | | (_|  __/ (_| |
 /_/    \_\__,_| \_/ \__,_|_| |_|\___\___|\__,_|

It's an experimental and learning propose libRetro front-end to mGBA.

The primary goal of this experiment was to learn the fundamentals of Rust and C integration through shared libraries, while also delving into the world of game emulation.

Results

The experiment successfully integrated the mGBA emulator with the libRetro frontend in Rust, enabling the running of Game Boy Advance (GBA) games through the libRetro API. The project demonstrated the capability to:

  • Load and run GBA ROMs using retro_load_game.
  • Capture and refresh video frames in the correct format for rendering.
  • Support user input through.
  • Save and load emulator states to/from disk, allowing for game state persistence.

The main challenge involved handling the different pixel formats between the mGBA core and libRetro, which was resolved by implementing a pixel format converter to transform RGB565 into XRGB8888. Additionally, managing safe access to shared state data (such as button presses and video/audio frames) using Rust's Cell and Unsafe blocks ensured a performant and functional emulator frontend.

Overall, the project met its objectives in both understanding Rust and C integration and creating a working libRetro frontend for the mGBA emulator.

How to run it?

If you'd like to run it, you'll need:

  • libretro.so in ./lib on the repository
  • libretro.so into some LD directory
  • A GBA ROM into the current directory with the name test.gba

About

It's an experimental and learning propose libRetro front-end to mGBA.

Topics

Resources

License

Stars

Watchers

Forks