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

Allow loading binary translation DLLs on Windows #136

Closed
fwsGonzo opened this issue Jun 1, 2024 · 2 comments
Closed

Allow loading binary translation DLLs on Windows #136

fwsGonzo opened this issue Jun 1, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@fwsGonzo
Copy link
Owner

fwsGonzo commented Jun 1, 2024

Even though most people don't have compilers on Windows, games are packaged, and the script is already precompiled. So, why not just create a MinGW .dll as part of that process, and then allow loading it on Windows?

Binary translated libriscv is stupidly fast. It's going to be worth it.

$ wine64 rvlinux.exe ../../binaries/measure_mips/fib
0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
005c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
005c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00bc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00bc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
>>> Program exited, exit code = 3819729467 (0xE3AC723B)
Instructions executed: 1280000008  Runtime: 70.346ms  Insn/s: 18196mi/s
Pages in use: 4 (16 kB virtual memory, total 38 kB)

Preliminary results show that it works just fine.

$ strings rvbintr-E3BDE914.dll | grep -i '\.dll$'
KERNEL32.dll
msvcrt.dll

Minimal dependencies.

@fwsGonzo
Copy link
Owner Author

fwsGonzo commented Jun 2, 2024

The latest PR #138 fixes a few things, now making it possible to run binary translated libriscv on Windows. In order to close this issue though, this feature should also work on Windows builds of my game. In order to test, I should create a mingw .dll on the server, place it in the Windows build folder and monitor that it gets loaded on the Windows client. If the client runs normally, I will consider it solved.

@fwsGonzo
Copy link
Owner Author

fwsGonzo commented Jun 2, 2024

Can conform that it's working on a highly complex game and game server, where one client is running Windows with ~10-12 binary translated libriscv programs running in various threads. The first time I tried it my desktop froze and I had to reboot, but it hasn't happened since. I tried putting a mutex on the emulated dlopen() stuff - but I can only wait and see if it happens again.

For now, I consider this first attempt as a success. My game runs in Steam, wine + wine64 and several other programs run on the terminal using wine.

@fwsGonzo fwsGonzo closed this as completed Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant