Skip to content

Releases: JesseTG/libretro.py

v0.7.1

13 Apr 01:20

Choose a tag to compare

Changed

  • BREAKING: SessionBuilder.with_mic no longer accepts
    a generator function that yields microphone samples.
    Since the method accepts a Callable that returns a MicrophoneDriver,
    this complicated handling arguments.
    Use with_mic(GeneratorMicrophoneDriver(your_function)) instead.

Fixed

  • Change libretro.api._utils.memoryview_at's type hints to match
    those of Python 3.14's memoryview_at,
    and fix behavior to be similarly forgiving with its input.
  • Fix exceptions raised in the initializers for
    retro_hw_render_callback and retro_microphone_interface.
  • Fix GeneratorMicrophone.read on Python 3.12,
    as array.clear wasn't added until Python 3.13.

v0.7.0

10 Apr 15:46

Choose a tag to compare

I'm still here! I've had many "I'll-get-around-to-it-someday" tasks
on my to-do list for libretro.py. Well, someday has come.
This release primarily addresses stability and API consistency;
the most notable change is full type coverage.

Added

  • Type annotations to all public-facing types and functions in libretro.py.
    Too many to list here, but the library has 100% coverage.
  • Type checking with Pyright to the CI pipeline.
    All future pull requests must pass type-checking.
  • Additional symbols to libretro.api to match [libretro.h][libretro.h]
  • The libretro.ctypes module for type declarations
    that describe the behavior documented by [ctypes][ctypes]
  • Added PathDriver.file_browser_start_dir,
    and implement it in ExplicitPathDriver and TempDirPathDriver.
  • Added libretro.typing, which contains types that enforce ctypes's
    documented rules statically while falling back to it at runtme.
  • Added linting pipelines to GitHub Actions for Python 3.12, 3.13, and 3.14.
    All future pull requests must pass linting checks for these versions.
  • Added types for each VFS operation in libretro.drivers.vfs.history.
  • Fields to retro_vfs_file_handle and retro_vfs_dir_handle
    that are helpful for FileSystemDriver implementations.
  • Add SessionBuilder.with_rumble.
  • Add AnySession as a type alias of Session with
    just the base driver protocols as its type parameters.

Fixed

  • Fix a compatibility issue with Python 3.14 due to FieldsFromTypeHints
    relying on behavior that was changed since Python 3.12.

Changed

  • BREAKING: Raise minimum required Python version to 3.12.
  • BREAKING: Separate RumbleDriver from InputDriver.
  • BREAKING: Make Session a subclass of CompositeEnvironmentDriver.
  • BREAKING: Move all libretro callback struct creation
    into CompositeEnvironmentDriver.
  • BREAKING: Move compatibility shims into libretro.compat.
  • BREAKING: Move memory-related constants (e.g. RETRO_MEMORY_SAVE_RAM)
    into libretro.api.memory.
  • BREAKING: Change the values of some names in SensorType.
  • BREAKING: Rename MessageInterface to MessageDriver.
  • BREAKING: Rename LoggerMessageInterface to LoggerMessageDriver.
  • BREAKING: Move ConstantPowerDriver into libretro.drivers.power.constant.
  • BREAKING: Remove validation logic from SensorDriver.
  • BREAKING: Rename FileSystemInterface to FileSystemDriver.
  • BREAKING: Rename StandardFileSystemInterface to DefaultFileSystemDriver.
  • BREAKING: Rename HistoryFileSystemInterface to HistoryFileSystemDriver.
  • Refactor FileSystemInterface to primarily expose its VFS methods on itself,
    rather than through FileHandle or DirectoryHandle
    (although they're still available).
  • Make justfile recipes operate in the current environment
    instead of forcibly creating a virtual environment.
  • Add type parameters to CompositeEnvironmentDriver for each driver
    so that test script authors don't have to check classes
    before accessing installed drivers.
  • Catch exceptions raised in EnvironmentDriver's callbacks
    (including those returned to the core),
    and allow subclasses to handle those exceptions
    once control returns from the core.
  • Session re-raises exceptions that occur during callbacks
    once control returns from the core.
  • Change all uses of c_void_p to c_void_ptr,
    to avoid implicit conversions to int.
  • Allow TempDirPathDriver to ignore exceptions that are raised
    while deleting the temporary directories.
  • Update required moderngl-window version for the opengl extra to 3.*.
  • Redefine all function pointer types to use TypedFunctionPointer,
    and their arguments to use various helper types like CIntArg.
  • PointerState.pointers is now a tuple instead of a Sequence.
  • Allow CoreInterface and Core's set_... methods to accept
    Python Callables as well as corresponding function pointers.

Deprecated

  • Deprecate SessionBuilder in favor of creating Session directly.

Removed

  • BREAKING: Remove GeneratorLocationDriver.
  • BREAKING: Remove retro_log_callback.__call__.
    It served no purpose as a helper method,
    since the callback is meant for cores.
  • Removed flake8 from the repo's linters.
  • Removed the _type_ field from all IntEnum subclasses.

v0.6.0

28 Jan 01:12

Choose a tag to compare

Added

  • Added MicrophoneDriver.microphones to list all allocated Microphones.
  • Added Session.mic.

Changed

  • BREAKING: Rename GeneratorCameraDriver to IterableCameraDriver.

v0.5.0

30 Nov 23:25

Choose a tag to compare

Thanks to @JSensebe for his contributions!

Changed

  • BREAKING: Rename SensorInterface to SensorDriver.
  • BREAKING: Rename GeneratorSensorInterface to IterableSensorDriver
    and some accompanying type aliases.
  • BREAKING: Decouple SensorDriver and InputDriver so that
    the former is no longer part of the latter.
  • Use InputDriver.max_users to filter sensor input
    regardless of the underlying sensor driver.

Added

  • Add SensorDriver.poll.
  • Add SessionBuilder.with_sensor.
  • Add Session.set_controller_port_device.

Fixed

  • Improved documentation for IterableSensorDriver.
  • Fix a GET_VARIABLE dereference error.

v0.4.0

24 Oct 00:08

Choose a tag to compare

Changed

  • BREAKING: Rename RumbleInterface to RumbleDriver.
  • BREAKING: Rename DefaultRumbleDriver to DictRumbleDriver.
  • BREAKING: Rename GeneratorInputDriver to IterableInputDriver.

Fixed

  • Fix the rumble driver raising an exception when setting the rumble state.

v0.3.1

17 Oct 16:03

Choose a tag to compare

Changed

  • Updated moderngl to 5.12.

Fixed

  • Prevented unhandled OpenGL errors in cores from
    cascading into the frontend as exceptions
    raised from moderngl or PyOpenGL.

v0.3.0

25 Sep 18:27

Choose a tag to compare

Added

  • Add TempDirPathDriver.
  • Added various runnable scripts for test purposes.
  • Add a new guide for taking a capture with RenderDoc.
  • Add labels to OpenGL objects created by ModernGlVideoDriver.
  • Add debug groups to important methods within ModernGlVideoDriver.

Changed

  • BREAKING: Rename DefaultPathDriver to ExplicitPathDriver.
  • Make TempDirPathDriver the default path driver used by SessionBuilder.

Fixed

  • Improved documentation for parts of SessionBuilder and VideoDriver
  • Removed a glClear call in ModernGlVideoDriver that was left in by accident.
  • Clear the glGetError queue at various places in ModernGlVideoDriver
    to prevent PyOpenGL from misreporting errors that came from moderngl or the loaded core.

Removed

  • BREAKING: Remove VideoDriverInitArgs.

v0.2.0

12 Sep 16:21

Choose a tag to compare

Thanks to @JSensebe for his contributions!

Added

  • Add Language.GALICIAN and Language.NORWEGIAN
    to correspond with additions to libretro.h.
  • Add a live documentation website here.
    (#11)
  • Allow ArrayVideoDriver.screenshot() to rotate the returned frame
    (#3)
  • Add 16-bit pixel format support to ArrayVideoDriver.screenshot().
    (#5)

Changed

  • BREAKING: Rename KeyboardState.return_ to KeyboardState.return_key
  • BREAKING: Rename KeyboardState.break_ to KeyboardState.break_key

Fixed

  • Fix Core.unserialize being unable to accept bytes objects.
    (#4)
  • Fix an exception when a core sets its geometry before its initial AV info is fetched.
    (#6)
  • Fix a crash when a core uses retro_led_interface.
    (#7)
  • Fix an exception when passing a frame pitch inconsistent with the configured video format.
    (#8)

v0.1.11

10 Jun 18:57

Choose a tag to compare

Changed

  • Raise a warning when the core's requested maximum framebuffer size
    is larger than what the OpenGL implementation can provide.

v0.1.10

07 Jun 21:26

Choose a tag to compare

Fixed

  • Fix ModernGlVideoDriver.geometry having an incorrect return type.
  • Fix ModernGlVideoDriver failing to import in Python 3.11.