kodi-game / game.libretro

Libretro compatibility layer for the Kodi Game API
GNU General Public License v2.0
37 stars 26 forks source link

Add stubbed callback for LED state #81

Closed garbear closed 2 years ago

garbear commented 2 years ago

Description

This PR introduces a stubbed callback to handle LED commands. It's not hooked up to anything other than the log, but P-UAE doesn't check the return value of the RETRO_ENVIRONMENT_GET_LED_INTERFACE environment command, and crashes when it tries to use the invalid function pointer.

Needed to prevent P-UAE from segfaulting on the first frame.

How has this been tested?

From kodi.log:

DEBUG <general>: AddOnLog: game.libretro.uae: LED: 0, state: 1
DEBUG <general>: AddOnLog: game.libretro.uae: LED: 0, state: 0
DEBUG <general>: AddOnLog: game.libretro.uae: LED: 0, state: 1
DEBUG <general>: AddOnLog: game.libretro.uae: LED: 2, state: 1
DEBUG <general>: AddOnLog: game.libretro.uae: LED: 2, state: 0
DEBUG <general>: AddOnLog: game.libretro.uae: LED: 2, state: 1

With this patch, P-UAE successfully enters the game loop:

Screenshot from 2021-11-10 17-25-31