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

Have access to set_cores as the library #801

Open
kenzlegouge opened this issue Jun 17, 2024 · 3 comments
Open

Have access to set_cores as the library #801

kenzlegouge opened this issue Jun 17, 2024 · 3 comments

Comments

@kenzlegouge
Copy link

State your operating system:

Windows

DesMuME version

0.9.13

Issue

I would like to open DesMuMe using the dll, and set the number of cores. Although options exist for command-lines, they are not visible when you skip this.

Would it be possibe to add it ? Here is an example of how I would see this. From [desmume/src/frontend/windows/main.cpp]

EXPORTED void desmume_set_cores(int num_cores)
{
    CommonSettings.num_cores = _num_cores
}
@zeromus
Copy link
Contributor

zeromus commented Jun 17, 2024

This one option is a drop in the bucket. instead, you should add a method that boots up a desmume library using the provded commandline so that it can parse all options. alternatively, we should have patterns you can use to add an ini option for num_cores which would get read before the commandline, I think

@kenzlegouge
Copy link
Author

Thank you very much for your help.

I can maybe set myself more clear. I want to launch multiple instances of DesMuMe and feed it to a learner. For this, I am using py-desmume to interact with DesMuMe (https://github.com/SkyTemple/py-desmume).

Using this minimal code, you can reproduce the error yourself.

import desmume
from desmume.emulator import DeSmuME
emu = DeSmuME()
emu2 = DeSmuME()

Traceback (most recent call last):

Cell In[4], line 1
emu2 = DeSmuME()

File ~\anaconda3\envs\mkds\lib\site-packages\desmume\emulator.py:981 in init
if self.lib.desmume_init() < 0:

OSError: exception: access violation writing 0x0000000000000000

I can launch two emu instances using the .exe file and cmd lines, however not with this method. I suspect there is some clash with cores and memory attribution but I am not sure. Would you have any idea what could cause this ?

I am using windows 11 and Python 3.10.14, if it matters.

Best

@zeromus
Copy link
Contributor

zeromus commented Jun 17, 2024

Desmume doesn't support running more than one instance per process. This is engineered into it from the ground up. Your plan will never work. You must use separate processes.

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

2 participants