From c85a190d02833322a9a02b6187902997b4fc85c9 Mon Sep 17 00:00:00 2001 From: TwistedUmbrella Date: Tue, 23 Jun 2015 02:48:29 -0400 Subject: [PATCH 1/4] Relocate os_DebugBreak definition to origin --- core/linux/common.cpp | 6 +++++- core/types.h | 9 ++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/linux/common.cpp b/core/linux/common.cpp index 422689aa4..a4330ef8a 100644 --- a/core/linux/common.cpp +++ b/core/linux/common.cpp @@ -234,7 +234,11 @@ double os_GetSeconds() return a.tv_sec-tvs_base+a.tv_usec/1000000.0; } -#if HOST_OS != OS_LINUX +#if HOST_OS == OS_DARWIN +void os_DebugBreak() { + __asm__("trap"); +} +#elif HOST_OS != OS_LINUX void os_DebugBreak() { __builtin_trap(); diff --git a/core/types.h b/core/types.h index d74fa10fb..37070742a 100644 --- a/core/types.h +++ b/core/types.h @@ -507,13 +507,8 @@ using namespace std; #define VER_FULLNAME VER_EMUNAME " rel0" _X_x_X_MMU_VER_STR " (built " __DATE__ "@" __TIME__ ")" #define VER_SHORTNAME VER_EMUNAME " rel0" _X_x_X_MMU_VER_STR -#if HOST_OS == OS_DARWIN - void os_DebugBreak() { - raise(SIGTRAP); - } -#else - void os_DebugBreak(); -#endif + +void os_DebugBreak(); #define dbgbreak os_DebugBreak() #if COMPILER_VC==BUILD_COMPILER From e3744446f5ae12f956b3c84d1321795f8b1413af Mon Sep 17 00:00:00 2001 From: TwistedUmbrella Date: Sun, 28 Jun 2015 11:29:04 -0400 Subject: [PATCH 2/4] Support return to external launcher, Prep for linux This adds the ability to simply close the emulator when launched externally and prevents changes designed for linux from generating conflicting controller configurations on Android (and may be needed for iOS as well). --- core/hw/maple/maple_cfg.cpp | 10 ++++++++++ core/hw/maple/maple_cfg.h | 4 ++++ core/nullDC.cpp | 4 ++++ .../android/src/com/reicast/emulator/MainActivity.java | 1 + .../src/com/reicast/emulator/config/Config.java | 2 ++ .../src/com/reicast/emulator/emu/OnScreenMenu.java | 10 +++++++--- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/core/hw/maple/maple_cfg.cpp b/core/hw/maple/maple_cfg.cpp index 16e5a63fe..1e83d9d43 100644 --- a/core/hw/maple/maple_cfg.cpp +++ b/core/hw/maple/maple_cfg.cpp @@ -66,6 +66,7 @@ void mcfg_Create(MapleDeviceType type,u32 bus,u32 port) MapleDevices[bus][port]=dev; } +#ifndef _ANDROID void mcfg_CreateDevices() { mcfg_Create(MDT_SegaController,0,5); @@ -75,6 +76,15 @@ void mcfg_CreateDevices() mcfg_Create(MDT_SegaVMU,0,1); #endif } +#else +void mcfg_CreateDevices() +{ + mcfg_Create(MDT_SegaController,0,5); + + mcfg_Create(MDT_SegaVMU,0,0); + mcfg_Create(MDT_SegaVMU,0,1); +} +#endif void mcfg_DestroyDevices() { diff --git a/core/hw/maple/maple_cfg.h b/core/hw/maple/maple_cfg.h index 1c511974a..de724a0f8 100644 --- a/core/hw/maple/maple_cfg.h +++ b/core/hw/maple/maple_cfg.h @@ -62,5 +62,9 @@ struct IMapleConfigMap virtual ~IMapleConfigMap() {} }; +#ifndef _ANDROID void mcfg_CreateDevices(); +#else +void mcfg_CreateDevices(); +#endif void mcfg_DestroyDevices(); \ No newline at end of file diff --git a/core/nullDC.cpp b/core/nullDC.cpp index 953d1b6fd..c41a3c63f 100755 --- a/core/nullDC.cpp +++ b/core/nullDC.cpp @@ -206,7 +206,11 @@ int dc_init(int argc,wchar* argv[]) mem_map_default(); +#ifndef _ANDROID mcfg_CreateDevices(); +#else + mcfg_CreateDevices(); +#endif plugins_Reset(false); mem_Reset(false); diff --git a/shell/android/src/com/reicast/emulator/MainActivity.java b/shell/android/src/com/reicast/emulator/MainActivity.java index 2f830ae4e..771162d5c 100644 --- a/shell/android/src/com/reicast/emulator/MainActivity.java +++ b/shell/android/src/com/reicast/emulator/MainActivity.java @@ -132,6 +132,7 @@ public class MainActivity extends SlidingFragmentActivity implements // Flush the intent to prevent multiple calls getIntent().setData(null); setIntent(null); + Config.externalIntent = true; } } diff --git a/shell/android/src/com/reicast/emulator/config/Config.java b/shell/android/src/com/reicast/emulator/config/Config.java index d69fbfb55..af6932a64 100644 --- a/shell/android/src/com/reicast/emulator/config/Config.java +++ b/shell/android/src/com/reicast/emulator/config/Config.java @@ -65,6 +65,8 @@ public class Config { public static String git_issues = "https://github.com/reicast/reicast-emulator/issues/"; public static String log_url = "http://loungekatt.no-ip.biz:3194/ReicastBot/report/submit.php"; public static String report_url = "http://loungekatt.no-ip.biz:3194/ReicastBot/report/logs/"; + + public static boolean externalIntent = false; private SharedPreferences mPrefs; diff --git a/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java b/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java index da73fa3d9..b5f0a15be 100644 --- a/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java +++ b/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java @@ -550,9 +550,13 @@ public class OnScreenMenu { OnClickListener clickExit = new OnClickListener() { public void onClick(View v) { - Intent inte = new Intent(mContext, MainActivity.class); - mContext.startActivity(inte); - ((Activity) mContext).finish(); + if (Config.externalIntent) { + ((Activity) mContext).finish(); + } else { + Intent inte = new Intent(mContext, MainActivity.class); + mContext.startActivity(inte); + ((Activity) mContext).finish(); + } } }; Button buttonExit = (Button) hlay.findViewById(R.id.buttonExit); From 6a3f691c2357a7d11a7cb28e2ceadbc8a2cfef37 Mon Sep 17 00:00:00 2001 From: TwistedUmbrella Date: Sun, 5 Jul 2015 00:04:40 -0400 Subject: [PATCH 3/4] Fix a typo to prevent VMU and FPS popup focus --- shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java b/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java index b5f0a15be..2f6437643 100644 --- a/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java +++ b/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java @@ -94,6 +94,7 @@ public class OnScreenMenu { fpsText.setGravity(Gravity.CENTER); fpsText.setText("XX"); setContentView(fpsText); + setFocusable(false); } public void setText(int frames) { @@ -452,7 +453,7 @@ public class OnScreenMenu { vlay = new LinearLayout(mContext); vlay.setOrientation(LinearLayout.HORIZONTAL); setContentView(vlay); - setFocusable(true); + setFocusable(false); } public void showVmu() { From 20193681f0379942f64f1cf1d8b24fb804fe7331 Mon Sep 17 00:00:00 2001 From: TwistedUmbrella Date: Sun, 5 Jul 2015 00:15:11 -0400 Subject: [PATCH 4/4] Support all available landscape orientations --- shell/android/AndroidManifest.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/android/AndroidManifest.xml b/shell/android/AndroidManifest.xml index 90e755c21..eefa9637c 100644 --- a/shell/android/AndroidManifest.xml +++ b/shell/android/AndroidManifest.xml @@ -103,7 +103,7 @@