Since there is no public release for mac in a while i build my own and came to the conclusion that the latest commit wont launch any game it just stays at a black screen no errors nothing even in the terminal it does nothing.
Commit id: 3174bfd
Log from citra when launching pokemon sun/moon demo:
http://hastebin.com/vilerapaxe.log
my specs are 
Issue only appears when CPU JIT is enabled in Release, in Debug CPU JIT enables works
I will try it on windows now to double check.
Can you please add exactly which commit are you using and your specs?
Update: No problem on windows, release, msvc build.
error exists only on mac, release version + CPU JIT enabled. On Debug works ok
Pinging @Subv
@HyperGainZ Can you check in which version it still worked please?
It seems harmless but I believe it is #2215
After doing my self a bisect it gave me the same result as @pippo2931 so i reverted the change and did a rebuild and tested Zelda OoT to see if it launched with CPU JIT enabled and it worked after that i readded the test and added printf("ticks: %u / %D \n", ticks_executed, num_instructions); to see what ticks_executed is returning and this is the result ticks: 3565821930 / 1000
full console log : http://hastebin.com/fezohukidu.log
Code Snippet:
unsigned ticks_executed = jit->Run(static_cast<unsigned>(num_instructions));
//jit->Run(static_cast<unsigned>(num_instructions));
printf("ticks: %u / %d \n", ticks_executed, num_instructions);
AddTicks(ticks_executed);
//AddTicks(num_instructions);
To compare with @NicolaiVdS, with the same log command, running Pokemon Sun / Zelda OoT on Linux it gives
ticks: 1000 / 1000
ticks: 1002 / 1000
ticks: 1002 / 1000
...
(continues with the same number for several lines, then changes. But I think the first three lines is enough)
I am expecting that there is some undefined-behaviour code in Dynarmic and macOS wrongly optimized it.
When debugging in Xcode with a breakpoint on that line, I got 1000 ticks too.
It looks time sensitive.
@pippo2931 if i'm not mistaken when you run citra from xcode directly its running as Debug and not as Release and there is where the problem is when building a debug version CPU JIT works but not in Release
For reference OOT on MSVC
https://gist.github.com/freiro/fafaa9c7166654fcc9a876d8adcd7dd6
https://github.com/MerryMage/dynarmic/blob/master/src/backend_x64/block_of_code.cpp#L39
Could someone replace:
jit_state->cycles_remaining = cycles_to_run;
run_code(jit_state, basic_block);
return cycles_to_run - jit_state->cycles_remaining; // Return number of cycles actually run.
with something like:
jit_state->cycles_remaining = cycles_to_run;
printf("before: %zu %lld\n", cycles_to_run, jit_state->cycles_remaining);
run_code(jit_state, basic_block);
printf("after: %zu %lld\n", cycles_to_run, jit_state->cycles_remaining);
return cycles_to_run - jit_state->cycles_remaining; // Return number of cycles actually run.
and share the output?
Adding the prints, it doesn't get stuck anymore.
A sample:
before: 1000 1000
after: 1000 999
before: 999 999
after: 999 995
before: 995 995
after: 995 993
before: 993 993
after: 993 0
before: 1000 1000
after: 1000 -2
............................
before: 185 185
after: 185 170
before: 170 170
after: 170 159
before: 159 159
after: 159 24
before: 24 24
after: 24 -1
before: 1000 1000
after: 1000 989
before: 989 989
after: 989 974
before: 974 974
after: 974 963
before: 963 963
after: 963 828
before: 828 828
after: 828 792
before: 792 792
after: 792 777
before: 777 777
after: 777 766
before: 766 766
after: 766 631
same result here game just starts fine now
output: https://nvds.be/citra_CPU_JIT_ERROR.log (55,5MB size)
It was an ABI issue.
Emitted code:
JIT prologue
push %rbx
push %rbp
push %r12
push %r13
push %r14
mov %rdi,%r15
stmxcsr 0x34c(%r15)
ldmxcsr 0x348(%r15)
jmpq *%rsi
JIT epilogue
stmxcsr 0x348(%r15)
ldmxcsr 0x34c(%r15)
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
retq
Register %r15 was not being saved, despite being a callee-saved register in the ABI.
Here is where that code is emitted:
And HostLocIsGPR doesn't consider r15 a GPR:
Fixed in MerryMage/dynarmic@5f11b4f5.
@MerryMage Just tested PR #2243 on mac and CPU JIT works again on citra & citra-qt in Release builds