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

[Windows/ARM] JIT ARM32 (MSVC) support #633

Open
basharast opened this issue Feb 12, 2023 · 1 comment
Open

[Windows/ARM] JIT ARM32 (MSVC) support #633

basharast opened this issue Feb 12, 2023 · 1 comment

Comments

@basharast
Copy link

Hi, I was compiling your emulator as libretro core (base code from this repo)
I need it in this way because it's the only solution to port DS emulation for legacy windows arm devices.
I made the required changes on memory functions and seems fine as the app didn't crash,

Issue

all I got is white screen with no sound also, seems it's waiting for something because JIT instructions are working (as per the log below),

I'm not sure if I compile it in the right way because I included only utils/arm_jit/arm_jit_arm.cpp which will include arm_emit & emit_core (+ HAVE_JIT defined while compiling the whole code)

Debug log

Here log file including JIT debug log
retroarch__2023_02_13__01_48_27.log

is there anything has to be changed to fix this issue?

Environment details

System: Windows ARM32
Platform: UWP
CPU: Qualcomm Snapdragon (8994)

it's pretty desperate situation when working on ARM32/UWP but any help will be appreciated as I'm looking forward to get DS emulation in better performance.

Side note

because of UWP security problem, memory cannot be protected as write+execute at once
as workaround (partially for testing) during the code I swap the protection,
I doubt I had issue with this because usually it will throw memory exception if anything went wrong.
but to confirm the only place I had to do this swap is JittedFunc createFunc at emit_core.cpp

while (curr_bytes) {
        if (curr_bytes->next) {
	    MakeWritable(fn_ptr, CHUNK_SIZE); //enable write
            memcpy(fn_ptr, curr_bytes->data, CHUNK_SIZE);
            fn_ptr += CHUNK_SIZE;
            tot_bytes_acum += CHUNK_SIZE;
	    MakeExecutable(fn_ptr, CHUNK_SIZE); //back to execute
        }
        else {
	    size_t sz = g_TOTALBYTES - tot_bytes_acum;
	    MakeWritable(fn_ptr, sz); //enable write
            memcpy(fn_ptr, curr_bytes->data, sz);
	    MakeExecutable(fn_ptr, sz);  //back to execute
            break;
        }
        curr_bytes = curr_bytes->next;
    }

Many thanks.

@zeromus
Copy link
Contributor

zeromus commented Feb 13, 2023

Make instruction trace from your version and windows desktop desmume and check to make sure they are the same. Look to see if sound registers/video registers are being written (breakpoints in c++).

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