Skip to content

Minimal working example of using libretro cores from python

Notifications You must be signed in to change notification settings

malciin/nanoarch.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Minimal working example of using libretro cores from python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages