Skip to content

ctypes getting core variables/settings does not always work #69

Open
@zach-morris

Description

@zach-morris

Full disclosure, I'm trying to troubleshoot my own code utilizing kodi-game-scripting, but I think this would likely effect kodi-game-scripting's ability to generate the official addons as well.

The issue I've found with this code is that it doesn't consistently pull core settings from the binary. Here's an example:

from lib.kodi_game_scripting.libretro_ctypes import LibretroWrapper
library_data = LibretroWrapper('ecwolf_libretro.dylib')
library_data.variables
Out[4]: []

library_data = LibretroWrapper('4do_libretro.dylib')
library_data.variables
Out[8]: 
[Variable(id='4do_bios', description='BIOS (rom1)', values=['disabled'], default='disabled'),
 Variable(id='4do_font', description='Font (rom2)', values=['disabled'], default='disabled'),
 Variable(id='4do_cpu_overclock', description='CPU Overclock', values=['1.0x (12.50Mhz)', '1.1x (13.75Mhz)', '1.2x (15.00Mhz)', '1.5x (18.75Mhz)', '1.6x (20.00Mhz)', '1.8x (22.50Mhz)', '2.0x (25.00Mhz)'], default='1.0x (12.50Mhz)'),
 Variable(id='4do_region', description='Mode', values=['ntsc', 'pal1', 'pal2'], default='ntsc'),
 Variable(id='4do_vdlp_pixel_format', description='VDLP Pixel Format', values=['XRGB8888', '0RGB1555', 'RGB565'], default='XRGB8888'),
 Variable(id='4do_vdlp_bypass_clut', description='VDLP Bypass CLUT', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_high_resolution', description='HiRes CEL Rendering', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_madam_matrix_engine', description='MADAM Matrix Engine', values=['hardware', 'software'], default='hardware'),
 Variable(id='4do_swi_hle', description='OperaOS SWI HLE', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_nvram_storage', description='NVRAM Storage', values=['per game', 'shared'], default='per game'),
 Variable(id='4do_active_devices', description='Active Input Devices', values=['1', '0', '2', '3', '4', '5', '6', '7', '8'], default='1'),
 Variable(id='4do_hack_timing_1', description="Timing Hack 1 (Crash 'n Burn)", values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_hack_timing_3', description='Timing Hack 3 (Dinopark Tycoon)', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_hack_timing_5', description='Timing Hack 5 (Microcosm)', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_hack_timing_6', description='Timing Hack 6 (Alone in the Dark)', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_hack_graphics_step_y', description='Graphics Step Y Hack (Samurai Showdown)', values=['disabled', 'enabled'], default='disabled'),
 Variable(id='4do_kprint', description='Debug Output', values=['disabled', 'enabled'], default='disabled')]

From Retroarch directly, I can see the first binary should have the following variables:

ecwolf-adlib-volume = "20"
ecwolf-alwaysrun = "enabled"
ecwolf-am-drawtexturedfloors = "enabled"
ecwolf-am-drawtexturedwalls = "enabled"
ecwolf-am-overlay = "on"
ecwolf-am-pause = "enabled"
ecwolf-am-rotate = "off"
ecwolf-am-showratios = "enabled"
ecwolf-am-texturedoverlay = "enabled"
ecwolf-analog-move-sensitivity = "20"
ecwolf-analog-turn-sensitivity = "20"
ecwolf-aspect = "auto"
ecwolf-digi-volume = "20"
ecwolf-dynamic-fps = "disabled"
ecwolf-effects-priority = "digi-adlib-speaker"
ecwolf-fps = "60"
ecwolf-invulnerability = "disabled"
ecwolf-music-volume = "20"
ecwolf-resolution = "1280x800"
ecwolf-speaker-volume = "20"
ecwolf-viewsize = "20"

The problem seems to be here, where the correct RETRO_ENVIRONMENT_SET_VARIABLES cb_type is never called to pull the variables for the first binary. Based on the code, I can't figure out why however.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions