https://github.com/malciin/nanoarch.py
Minimal working example of using libretro cores from python
https://github.com/malciin/nanoarch.py
libretro libretro-frontend python
Last synced: over 1 year ago
JSON representation
Minimal working example of using libretro cores from python
- Host: GitHub
- URL: https://github.com/malciin/nanoarch.py
- Owner: malciin
- Created: 2025-03-14T12:18:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T12:36:10.000Z (over 1 year ago)
- Last Synced: 2025-03-14T13:36:27.930Z (over 1 year ago)
- Topics: libretro, libretro-frontend, python
- Language: Python
- Homepage:
- Size: 475 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nanoarch.py
A minimal working example of using a libretro core in Python based on nanoarch.c.

### How to run
(tested on windows, linux would require slight changes - .dll -> .so etc)
Install requirements from `requirements.txt` (`pip install -r requirements.txt`)
Fetch `sameboy_librertro` core from https://buildbot.libretro.com/nightly/windows/x86_64/latest/sameboy_libretro.dll.zip and extract it inside the same directory as main.py
Run `main.py`
### Whats working
- initializing libretro
- rendering gameboy frames inside SDL2 as a texture
- inputs for gameboy:
| Keyboard | Gameboy |
|----------|---------|
| Left | Dpad Left |
| Right | Dpad Right |
| Up | Dpad Up |
| Down | Dpad Down |
| Z | A |
| X | B |
| ENTER | START |
| BACKSPACE | SELECT |
- inmemory state serialization (`S` key) & deserialization (`D` key).
### Whats not working
- Support for cores other than Game Boy due to hardcoded resolution, pixel format & controls (easy to modify - call `retro_get_system_av_info` and use its information)
- Audio
Leaving it as is to keep code minimal, feel free to implement these in your own projects