An open API service indexing awesome lists of open source software.

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

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