libretro / libretro-cap32

caprice32 4.2.0 libretro
21 stars 36 forks source link

[core] database feature v1 #114

Closed DSkywalk closed 2 years ago

DSkywalk commented 2 years ago

Objective

To facilitate the use of the emulator for new users by using a clean database.

Tasks

If the game exists, configure the keys (and loader) to the user automatically.

example RMP => DB: imagen

TODO v2:

Add input descriptors, thx to @jdgleaver for his help :+1:

e.g. so if you do something like:

   struct retro_input_descriptor desc[] = {
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT,   "Left" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP,     "Up" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN,   "Down" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT,  "Right" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B,      "Fire" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A,      "Jump" },
      { 0 },
   };

Then RetroPad X, Y, etc. will be unbound in the frontend, but the user can still manually bind them to Fire, Jump, etc. if they want to move things around (and only those named inputs will be available when remapping a button)