Skip to content

Commit

Permalink
Rewrite C++ parts and UI update
Browse files Browse the repository at this point in the history
This update took way way too long to create. However, it was worthwhile. :)
  • Loading branch information
PixelyIon committed Jul 24, 2019
1 parent fd2bf8e commit 696ebde
Show file tree
Hide file tree
Showing 83 changed files with 1,917 additions and 808 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "app/libraries/tinyxml2"]
path = app/libraries/tinyxml2
url = https://github.com/leethomason/tinyxml2
[submodule "app/libraries/fmt"]
path = app/libraries/fmt
url = https://github.com/fmtlib/fmt
34 changes: 34 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 19 additions & 11 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
cmake_minimum_required (VERSION 3.2)
cmake_minimum_required(VERSION 3.8)
project(Lightswitch VERSION 1 LANGUAGES CXX)
set_property(GLOBAL PROPERTY CMAKE_CXX_STANDARD 17 PROPERTY CMAKE_CXX_STANDARD_REQUIRED TRUE)

set(BUILD_TESTS FALSE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
add_subdirectory("libraries/tinyxml2")
add_subdirectory("libraries/fmt")

set(source_DIR ${CMAKE_SOURCE_DIR}/src/main/cpp)

include_directories(${source_DIR}/include)
include_directories(libraries/unicorn/include)
include_directories(${source_DIR})

add_library(lightswitch SHARED
${source_DIR}/lightswitch.cpp
${source_DIR}/core/arm/cpu.cpp
${source_DIR}/core/arm/memory.cpp

${source_DIR}/core/hos/kernel/ipc.cpp
${source_DIR}/core/hos/kernel/kernel.cpp
${source_DIR}/core/hos/kernel/svc.cpp
${source_DIR}/core/hos/loaders/nro.cpp
)
target_link_libraries(lightswitch ${source_DIR}/lib/${ANDROID_ABI}/libunicorn.a)
${source_DIR}/switch/os/os.cpp
${source_DIR}/switch/os/ipc.cpp
${source_DIR}/switch/os/kernel.cpp
${source_DIR}/switch/os/svc.cpp
${source_DIR}/switch/hw/cpu.cpp
${source_DIR}/switch/hw/memory.cpp
${source_DIR}/switch/common.cpp
${source_DIR}/switch/loader/nro.cpp
)
target_link_libraries(lightswitch ${CMAKE_SOURCE_DIR}/libraries/unicorn/libunicorn.a fmt tinyxml2)
target_compile_options(lightswitch PRIVATE -Wno-c++17-extensions)
17 changes: 9 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "gq.cyuubi.lightswitch"
applicationId "emu.lightswitch.lightswitch"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
externalNativeBuild {
cmake {
cppFlags ""
}
}
ndk {
abiFilters "arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled true
useProguard false
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
useProguard false
}
}
externalNativeBuild {
cmake {
version "3.8.0+"
path "CMakeLists.txt"
}
}
Expand All @@ -40,6 +40,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.preference:preference:1.1.0-beta01'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'com.google.android.material:material:1.0.0'
implementation 'me.xdrop:fuzzywuzzy:1.2.0'
}
1 change: 1 addition & 0 deletions app/libraries/fmt
Submodule fmt added at 6a497e
1 change: 1 addition & 0 deletions app/libraries/tinyxml2
Submodule tinyxml2 added at 61a4c7
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 25 additions & 16 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gq.cyuubi.lightswitch">
xmlns:tools="http://schemas.android.com/tools"
package="emu.lightswitch.lightswitch">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".LogActivity"
android:label="@string/log"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="emu.lightswitch.lightswitch.MainActivity"/>
</activity>
<activity
android:name=".SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".MainActivity">
android:name=".SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="gq.cyuubi.lightswitch.MainActivity" />
android:name="android.support.PARENT_ACTIVITY"
android:value="emu.lightswitch.lightswitch.MainActivity"/>
</activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Expand Down
89 changes: 0 additions & 89 deletions app/src/main/cpp/core/arm/cpu.cpp

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/cpp/core/arm/cpu.h

This file was deleted.

Loading

0 comments on commit 696ebde

Please sign in to comment.