kodi-game / game.libretro

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

[Game API] Add libretro Frame Time Callback #49

Closed RobLoach closed 5 years ago

RobLoach commented 5 years ago

Here's another attempt at moving over to Chrono. I've had issues compiling this on my Linux machine. I'll continue reading through the docs and see if I can come up with anything.

/* Notifies a libretro core of time spent since last invocation
 * of retro_run() in microseconds.
 *
 * It will be called right before retro_run() every frame.
 * The frontend can tamper with timing to support cases like
 * fast-forward, slow-motion and framestepping.
 *
 * In those scenarios the reference frame time value will be used. */
garbear commented 5 years ago

Code looks OK. What is needed to handle FF and slow motion?

RobLoach commented 5 years ago

What is needed to handle FF and slow motion?

After some investigation, I found that's handled elsewhere. This just simply returns the microsecond delta.

garbear commented 5 years ago

How about https://github.com/RobLoach/game.libretro/pull/1?

RobLoach commented 5 years ago

Nice work! That's a clean solution.

RobLoach commented 5 years ago

@garbear Any clue why it's failing on xcode? https://travis-ci.org/kodi-game/game.libretro/jobs/473235450#L475-L487

Undefined symbols for architecture x86_64:
  "LIBRETRO::Timer::microseconds()", referenced from:
      _RunFrame in client.cpp.o
garbear commented 5 years ago

You need to add the new files to CMakeLists.txt

garbear commented 5 years ago

LGTM. Can you squash?

RobLoach commented 5 years ago

Squashed.

garbear commented 5 years ago

A good follow-up to this would be exposing FF/RW through Kodi's Game API so we can adjust the frame time reported to the libretro core.