mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-27 10:36:59 +00:00
Merge pull request #64 from Sinan-Karakaya/build/macos/arm
Build & Run support for MacOS ARM
This commit is contained in:
commit
4e090f9c89
2 changed files with 14 additions and 0 deletions
|
|
@ -48,11 +48,19 @@ void JIT::translate_and_run(CPU& cpu) {
|
|||
|
||||
JitFunc fn = reinterpret_cast<JitFunc>(code);
|
||||
u64 result;
|
||||
#if defined(__x86_64__)
|
||||
asm volatile("call *%1\n"
|
||||
"mov %%rax, %0\n"
|
||||
: "=r"(result)
|
||||
: "r"(fn)
|
||||
: "%rax");
|
||||
#elif defined(__aarch64__)
|
||||
asm volatile("blr %1\n"
|
||||
"mov %0, x0\n"
|
||||
: "=r"(result)
|
||||
: "r"(fn)
|
||||
: "x0");
|
||||
#endif
|
||||
|
||||
cpu.regs[0] = result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,13 @@ bool gui::init_imgui(gui::window_t* main_window)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__ && (__aarch64__)
|
||||
ret = ::ImGui_ImplOpenGL3_Init("#version 120");
|
||||
#elif __APPLE__ && (__x86_64__)
|
||||
ret = ::ImGui_ImplOpenGL3_Init("#version 150");
|
||||
#else
|
||||
ret = ::ImGui_ImplOpenGL3_Init("#version 330");
|
||||
#endif
|
||||
if (false == ret)
|
||||
{
|
||||
LOG_ERROR(Render, "Failed to init OpenGL3: {}", SDL_GetError());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue