Skip to content

Commit

Permalink
arm64: fix crash with HLE bios. Set nav bar to tranparent (android 10)
Browse files Browse the repository at this point in the history
arm64 dynarec main loop and handlers were generated twice
Fix nav bar background leftover on android 10
  • Loading branch information
flyinghead committed Mar 14, 2021
1 parent a60ed28 commit 5e619a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 0 additions & 1 deletion core/hw/sh4/dyna/blockmanager.cpp
Expand Up @@ -234,7 +234,6 @@ void bm_vmem_pagefill(void** ptr, u32 size_bytes)

void bm_Reset()
{
bm_ResetCache();
bm_CleanupDeletedBlocks();
protected_blocks = 0;
unprotected_blocks = 0;
Expand Down
1 change: 0 additions & 1 deletion core/hw/sh4/dyna/driver.cpp
Expand Up @@ -405,7 +405,6 @@ static void recSh4_Reset(bool hard)
{
Sh4_int_Reset(hard);
recSh4_ClearCache();
bm_Reset();
}

static void recSh4_Init()
Expand Down
9 changes: 4 additions & 5 deletions core/rec-ARM64/rec_arm64.cpp
Expand Up @@ -1257,9 +1257,7 @@ class Arm64Assembler : public MacroAssembler
if (!mmu_enabled())
{
// TODO Call no_update instead (and check CpuRunning less frequently?)
Mov(x2, sizeof(Sh4RCB));
Sub(x2, x28, x2);
Add(x2, x2, sizeof(Sh4Context)); // x2 now points to FPCB
Sub(x2, x28, offsetof(Sh4RCB, cntx));
#if RAM_SIZE_MAX == 33554432
Ubfx(w1, w29, 1, 24);
#else
Expand Down Expand Up @@ -1347,6 +1345,7 @@ class Arm64Assembler : public MacroAssembler

// int intc_sched()
arm64_intc_sched = GetCursorAddress<DynaCode *>();
verify((void *)arm64_intc_sched == (void *)CodeCache);
B(&intc_sched);

// void no_update()
Expand Down Expand Up @@ -2239,14 +2238,14 @@ bool ngen_Rewrite(host_context_t &context, void *faultAddress)

static void generate_mainloop()
{
if (mainloop != NULL)
if (mainloop != nullptr)
return;
compiler = new Arm64Assembler();

compiler->GenMainloop();

delete compiler;
compiler = NULL;
compiler = nullptr;
}

RuntimeBlockInfo* ngen_AllocateBlock()
Expand Down
Expand Up @@ -22,6 +22,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.Window;

import com.reicast.emulator.config.Config;
import com.reicast.emulator.debug.GenerateLogs;
Expand All @@ -37,6 +38,10 @@

import tv.ouya.console.api.OuyaController;

import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;

public abstract class BaseGLActivity extends Activity implements ActivityCompat.OnRequestPermissionsResultCallback {
private static final int STORAGE_PERM_REQUEST = 1001;
private static final int AUDIO_PERM_REQUEST = 1002;
Expand All @@ -57,6 +62,15 @@ public abstract class BaseGLActivity extends Activity implements ActivityCompat.
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Set the navigation bar color to 0 to avoid left over when it fades out on Android 10
Window window = getWindow();
window.addFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(FLAG_TRANSLUCENT_STATUS);
window.setNavigationBarColor(0);
window.getDecorView().setSystemUiVisibility(SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}

if (!getFilesDir().exists()) {
getFilesDir().mkdir();
}
Expand Down

0 comments on commit 5e619a7

Please sign in to comment.