arm64: fix crash with HLE bios. Set nav bar to tranparent (android 10)

arm64 dynarec main loop and handlers were generated twice
Fix nav bar background leftover on android 10
This commit is contained in:
Flyinghead 2021-03-14 17:54:57 +01:00
parent a60ed281a1
commit 5e619a70d4
4 changed files with 18 additions and 7 deletions

View File

@ -234,7 +234,6 @@ void bm_vmem_pagefill(void** ptr, u32 size_bytes)
void bm_Reset() void bm_Reset()
{ {
bm_ResetCache();
bm_CleanupDeletedBlocks(); bm_CleanupDeletedBlocks();
protected_blocks = 0; protected_blocks = 0;
unprotected_blocks = 0; unprotected_blocks = 0;

View File

@ -405,7 +405,6 @@ static void recSh4_Reset(bool hard)
{ {
Sh4_int_Reset(hard); Sh4_int_Reset(hard);
recSh4_ClearCache(); recSh4_ClearCache();
bm_Reset();
} }
static void recSh4_Init() static void recSh4_Init()

View File

@ -1257,9 +1257,7 @@ public:
if (!mmu_enabled()) if (!mmu_enabled())
{ {
// TODO Call no_update instead (and check CpuRunning less frequently?) // TODO Call no_update instead (and check CpuRunning less frequently?)
Mov(x2, sizeof(Sh4RCB)); Sub(x2, x28, offsetof(Sh4RCB, cntx));
Sub(x2, x28, x2);
Add(x2, x2, sizeof(Sh4Context)); // x2 now points to FPCB
#if RAM_SIZE_MAX == 33554432 #if RAM_SIZE_MAX == 33554432
Ubfx(w1, w29, 1, 24); Ubfx(w1, w29, 1, 24);
#else #else
@ -1347,6 +1345,7 @@ public:
// int intc_sched() // int intc_sched()
arm64_intc_sched = GetCursorAddress<DynaCode *>(); arm64_intc_sched = GetCursorAddress<DynaCode *>();
verify((void *)arm64_intc_sched == (void *)CodeCache);
B(&intc_sched); B(&intc_sched);
// void no_update() // void no_update()
@ -2239,14 +2238,14 @@ bool ngen_Rewrite(host_context_t &context, void *faultAddress)
static void generate_mainloop() static void generate_mainloop()
{ {
if (mainloop != NULL) if (mainloop != nullptr)
return; return;
compiler = new Arm64Assembler(); compiler = new Arm64Assembler();
compiler->GenMainloop(); compiler->GenMainloop();
delete compiler; delete compiler;
compiler = NULL; compiler = nullptr;
} }
RuntimeBlockInfo* ngen_AllocateBlock() RuntimeBlockInfo* ngen_AllocateBlock()

View File

@ -22,6 +22,7 @@ import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewConfiguration; import android.view.ViewConfiguration;
import android.view.Window;
import com.reicast.emulator.config.Config; import com.reicast.emulator.config.Config;
import com.reicast.emulator.debug.GenerateLogs; import com.reicast.emulator.debug.GenerateLogs;
@ -37,6 +38,10 @@ import java.util.List;
import tv.ouya.console.api.OuyaController; 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 { public abstract class BaseGLActivity extends Activity implements ActivityCompat.OnRequestPermissionsResultCallback {
private static final int STORAGE_PERM_REQUEST = 1001; private static final int STORAGE_PERM_REQUEST = 1001;
private static final int AUDIO_PERM_REQUEST = 1002; private static final int AUDIO_PERM_REQUEST = 1002;
@ -57,6 +62,15 @@ public abstract class BaseGLActivity extends Activity implements ActivityCompat.
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(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()) { if (!getFilesDir().exists()) {
getFilesDir().mkdir(); getFilesDir().mkdir();
} }