Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error getting variable in PUAE core running CD32. #17

Open
JSensebe opened this issue Sep 14, 2024 · 1 comment
Open

Error getting variable in PUAE core running CD32. #17

JSensebe opened this issue Sep 14, 2024 · 1 comment

Comments

@JSensebe
Copy link
Contributor

Using the puae_libretro core, when attempting to build a session which loads a CD32 game, the following error is issued:

Exception ignored on calling ctypes callback function: <bound method DictEnvironmentDriver.environment of <libretro.drivers.environment.composite.CompositeEnvironmentDriver object at 0x0000025A936C6CF0>>
Traceback (most recent call last):
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\dict.py", line 44, in environment
    return self._envcalls[envcall](data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\default.py", line 97, in <lambda>
    EnvironmentCall.GET_VARIABLE: lambda data: self._get_variable(
                                               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\composite.py", line 527, in _get_variable
    result = self._options.get_variable(string_at(var.key) if var.key else None)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\options\dict.py", line 75, in get_variable
    value = string_at(self._options_us[key].default_value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\ctypes\__init__.py", line 525, in string_at
    return _string_at(ptr, size)
           ^^^^^^^^^^^^^^^^^^^^^
OSError: exception: access violation reading 0x0000000000000000

The system appears to run fine after the error.

The variable (key) is b'puae_cart_file'. It is in self._options_us but not in self._variables.
self._options_us[key].default_value is set to None, which means it's essentially trying to get string_at(None). There probably should be a check for this case, but I don't know off-hand what a reasonable return value would be (b'', None, or even b'None'?).

@JSensebe
Copy link
Contributor Author

The 3DO core opera_libretro has the same issue when getting b'opera_bios' and b'opera_font'. It could be preventing the core from finding a default BIOS file. As such, this core might be better for testing a potential fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant