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

32X emulation - emscripten #233

Open
ethanaobrien opened this issue Aug 13, 2024 · 3 comments
Open

32X emulation - emscripten #233

ethanaobrien opened this issue Aug 13, 2024 · 3 comments

Comments

@ethanaobrien
Copy link

ethanaobrien commented Aug 13, 2024

Hello all,

I've been working on trying to get 32X emulation working in the browser, however it appears to just load to a black screen (specifically 32x emulation). I've traced this back to a core issue, and after hours of digging through the program, I've came here for help.

The portion of the logs that caught my eye was particularly this section:
image

As this doesnt appear to occur on a native copy of RetroArch I've compiled.

Changes I've made so far:
Told libretro to not use mmap, since mmap location hints are not supported in emscripten.
My current emscripten target options are:

        TARGET := $(TARGET_NAME)_libretro_$(platform).bc
        ARCH = unknown

        STATIC_LINKING = 1
        STATIC_LINKING_LINK = 1

Any information leading to where I can get more logs, and what I can do to fix the issue would be appreciated.
Thank you

Edit: as a note, this is somehow possible, as there are several closed source versions of picodrive with working emscripten support (emulatorjs.com). Through some code injection I have managed to get the RetroArch/picodrive logs, and no ptr is not aliqned errors were present

@irixxxx
Copy link
Collaborator

irixxxx commented Aug 13, 2024

I think the alignment for code pointers isn't working correctly. The Makefile sets -falign-functions=2 since the lowest bit of every code pointer must be 0. That bit is used to discriminate code pointers from memory pointers in a fast way.
Check that the -falign-functions option is set during compilation, or check for warnings from the compiler that it is ignored.

@ethanaobrien
Copy link
Author

Got it, I've fixed that now.

New issue, I get a null function or function signature mismatch after running for a seconds which I traced to here

#include "cz80_op.c"

How should I debug this?

@irixxxx
Copy link
Collaborator

irixxxx commented Aug 25, 2024

The easiest I can think of is to replace the include line with the whole content of the referenced file. That should give you a proper line number in the crash.

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