Compare commits

..

368 Commits

Author SHA1 Message Date
bunnei
89204de7be android: jni: Fix missing camera includes. 2020-09-12 00:24:01 -07:00
zhupengfei
a859199e96 android: Add a warning when saving state
Display a warning when a user saves a state, until they explicitly choose to not see it anymore.
2020-09-12 00:09:24 -07:00
zhupengfei
ad81589ab1 android: Use DialogFragment for the core error dialog
Fixes a bug when changing orientation while the dialog is shown.
2020-09-12 00:09:24 -07:00
zhupengfei
bf6c23cc6d fixup! android: Add savestates UI 2020-09-12 00:09:24 -07:00
zhupengfei
b81b3bf85b android: Handle core errors
The errors are handled in a similar manner to the Qt frontend: an AlertDialog
will pop up, prompting the user to select 'Abort' or 'Continue'.

Error messages are translatable as string values.
2020-09-12 00:09:24 -07:00
zhupengfei
df7242cc58 android: Add savestates UI
A simple menu with savestates info.
2020-09-12 00:09:24 -07:00
zhupengfei
b211ac4bed core, video_core: Fixes to make savestates work
1. Acquire the context before initializing renderer when using async gpu

2. Do not try present when renderer is nullptr
  This has some potential race condition but is also what we do in qt

3. Synchronize before serializing video core (WaitForProcessing)
  For this, the GPU thread is changed to pop commands *after* processing.

4. Avoid waiting on future fences
  Such events can exist in core timing queue when deserializing.
2020-09-12 00:09:24 -07:00
bunnei
5a7defc635 android: config: Fix setting for use_frame_limit. 2020-09-12 00:09:24 -07:00
bunnei
a3dfde7645 Update strings.xml 2020-09-12 00:09:24 -07:00
Nathan Lepori
95347a10bd Implemented switch for sliding finger across dpad + fixed sensitivity 2020-09-12 00:09:24 -07:00
SachinVin
5aef24fed0 video_core/CMakeLists.txt: Use toolchain cmake in shader header generator 2020-09-12 00:09:24 -07:00
SachinVin
7d7f3b243b gl_state.cpp: Fix typo in texture buffer LUT 2020-09-12 00:09:24 -07:00
SachinVin
27c0bf8c6f android : EmulationActivity: Don't show rationale if the permission was denied indefinitely 2020-09-12 00:09:24 -07:00
SachinVin
ecac063292 fix formatting 2020-09-12 00:09:24 -07:00
SachinVin
1cfdb67eaf android: Disable sensors when emulation is paused 2020-09-12 00:09:24 -07:00
SachinVin
4664c99d60 android : refactor button_manager{.cpp, .h} to input_manager
Now that it also handles sensors
2020-09-12 00:09:24 -07:00
SutandoTsukai181
edb5bc91e3 Update framebuffer layout when closing the settings
Fixes an issue where the default layout gets applied when closing the settings, which is noticable if you swap screens before changing the layout.
2020-09-12 00:09:24 -07:00
SutandoTsukai181
fd23b7f60f Add Cardboard VR
Based on hrydgard/ppsspp/pull/12449
2020-09-12 00:09:24 -07:00
SutandoTsukai181
457444bf70 Add Stereoscopy settings UI 2020-09-12 00:09:24 -07:00
SachinVin
810c7f3b8b Run clang-format 2020-09-12 00:09:24 -07:00
SutandoTsukai181
4c383e6b46 Remove unnecessary conditional 2020-09-12 00:09:23 -07:00
SutandoTsukai181
7448fc72b0 Wait on present_queue instead of free_queue 2020-09-12 00:09:23 -07:00
SutandoTsukai181
cd54d6fc18 Remove reference to "has_custom_button_text" 2020-09-12 00:09:23 -07:00
SutandoTsukai181
f32331ba95 Properly handle button_text for android 2020-09-12 00:09:23 -07:00
SutandoTsukai181
1fb4464b39 Port "applets/swkbd: Properly handle button_text"
from citra-emu/citra/pull/5381
2020-09-12 00:09:23 -07:00
Tobias
6e9e1506da AndroidManifest: Remove the maximum aspect ratio entirely 2020-09-12 00:09:23 -07:00
Tobias
aa764c69c5 AndroidManifest: Increase the maximum aspect ratio
This should help display the app on the whole screen on 21:9 devices like the Experia Z5.
2020-09-12 00:09:23 -07:00
bunnei
983554286f gl_shader_decompiler: Improve performance of accurate_mul on Android. 2020-09-12 00:09:23 -07:00
weihuoya
854d1af3d0 presenting in the ui thread 2020-09-12 00:09:23 -07:00
weihuoya
35d79e5df6 presenting if need 2020-09-12 00:09:23 -07:00
weihuoya
a2b58a2114 use separate texture buffer for light and fog 2020-09-12 00:09:23 -07:00
zhang wei
d0b6aedd73 Minor fixes to the UX (#126) 2020-09-12 00:09:23 -07:00
SachinVin
96b9039d21 Update: dynarmic
Rebase on MerryMage/dynarmic@659d78c
2020-09-12 00:09:23 -07:00
bunnei
d9950621dd android: CheckBoxSetting: Fix a ClassCastException exception with isChecked. 2020-09-12 00:09:23 -07:00
bunnei
18eef6d586 android: MainActivity: Fix a nullptr exception with onSaveInstanceState. 2020-09-12 00:09:23 -07:00
bunnei
bd9445bddf android: SettingsFragmentPresenter: Fix a nullptr exception with loadSettingsList. 2020-09-12 00:09:23 -07:00
bunnei
b31861e466 Revert "Presenting in ui thread (#92)"
This reverts commit d1c2e8fb88873bf8642d07ca7e386cc1bac19692.
2020-09-12 00:09:23 -07:00
bunnei
dbee75a3ca android: native: Reload game specific settings when in game. 2020-09-12 00:09:23 -07:00
zhang wei
7b852fdeb0 Presenting in ui thread (#92)
* present in ui thread

* rm test file

* use gradle 3.6.3

* fx present issue
2020-09-12 00:09:23 -07:00
xperia64
a4c55f4b8e Disable deptch stencil shader in texture_downloader_es for now 2020-09-12 00:09:23 -07:00
SachinVin
5922a0d6fe android : Fix touchscreen for reals
Adds proper multitouch tracking for touchscreen
2020-09-12 00:09:23 -07:00
SachinVin
44f97cf8f3 core/frontend/emu_window: return true when TouchPressed is consumed 2020-09-12 00:09:23 -07:00
xperia64
bdf6889327 Clamp the circle pad more correctly 2020-09-12 00:09:23 -07:00
xperia64
72be97b1f5 Fix the N3DS controls 2020-09-12 00:09:23 -07:00
xperia64
4a2afeb492 Shield TV driver bug workaround 2020-09-12 00:09:23 -07:00
SachinVin
f92adbd02a android : InputOverlayDrawableDpad.java: Initialize mTrackId to -1 2020-09-12 00:09:22 -07:00
SachinVin
a0d2462905 android: Bring back git hash version name 2020-09-12 00:09:22 -07:00
bunnei
894fdd06a3 android: game_settings: Mario & Luigi games require accurate mul. 2020-09-12 00:09:22 -07:00
BreadFish64
aab8c0247a video_core/GLES: fix issues cause by missing glTextureBarrier
create a duplicate for sampling instead
2020-09-12 00:09:22 -07:00
BreadFish64
e9049552e6 actually add icons 2020-09-12 00:09:22 -07:00
BreadFish64
ff01745845 add icon to CIA install menu item 2020-09-12 00:09:22 -07:00
BreadFish64
25c0b47ff9 refresh game list after installing CIA 2020-09-12 00:09:22 -07:00
BreadFish64
7366ebd481 android: Add initial CIA installation 2020-09-12 00:09:22 -07:00
bunnei
564d2da926 android: game_settings: Further cleanups. 2020-09-12 00:09:22 -07:00
bunnei
54602c1769 android: native: Set game specific settings before initializing core.
- Allows some other settings to be overridden.
2020-09-12 00:09:22 -07:00
bunnei
5eeee3370b android: game_settings: Disable asynch GPU with DQ7.
- This was causing some issues.
2020-09-12 00:09:22 -07:00
Nathan Lepori
7bca6a9e63 Implemented joystick-style directional pad overlay 2020-09-12 00:09:22 -07:00
SutandoTsukai181
22378138a1 android: frontend: Start a service to keep the persistent notification 2020-09-12 00:09:22 -07:00
meteoorkip
5c6cbd6fa4 Make touch joystick re-centering configurable 2020-09-12 00:09:22 -07:00
SachinVin
bc153f8c0c gl_shader_gen.cpp:fix implicit type conversion error for gles 2020-09-12 00:09:22 -07:00
SachinVin
4d128a9014 android:InputOverlay: Bit mask touch action so they are aevaluated properly
event.getAction() returns the action only in the lower byte, this works fine when the pointer index is zero and any additional indexes are not captured
2020-09-12 00:09:22 -07:00
SutandoTsukai181
05839ddf6e Use fixed indices for button order
Apps always return 3 strings, even if there is no custom text, so the index should be constant for each button.

The "OK" button is always at index 2.
2020-09-12 00:09:22 -07:00
bunnei
5e90a14d94 android: game_settings: Make SM3DL's GPU timing synchronous.
- Fixes reported white screen bug.
2020-09-12 00:09:22 -07:00
bunnei
f813f3fede android: BillingManager: Purchases must be acknowledged. 2020-09-12 00:09:22 -07:00
FearlessTobi
0d2d260ca8 android: Update app translations
Adds Korean and some minor fixes to other languages.
2020-09-12 00:09:22 -07:00
bunnei
0611a761c1 androuid: game_settings: Tighten asynch GPU timing.
- Fixes framerate issues in ZALBW.
2020-09-12 00:09:22 -07:00
SachinVin
dacc2452b9 android: AndroidManifest.xml: bump up gles requirement to 3.2 2020-09-12 00:09:22 -07:00
SachinVin
c8c2801bee android: disable support for split screen 2020-09-12 00:09:22 -07:00
Pengfei Zhu
c6e363532b audio_core/cubeb_input: Set default value for latency_frames
On Android OpenSL, cubeb could not find the minimum latency. Therefore, this variable was left uninitialized and caused problems when opening the stream.
2020-09-12 00:09:22 -07:00
bunnei
ecc9737531 android: BillingManager: Use real managed product for premium. 2020-09-12 00:09:22 -07:00
bunnei
4155085d34 android: submodules: Use github for dynarmic. 2020-09-12 00:09:22 -07:00
bunnei
b882958602 android: audio: Audio stretching is only useful with lower framerates, disable it when fullspeed. 2020-09-12 00:09:21 -07:00
bunnei
d0da65ef73 android: video_core: Add experimental asynchronous GPU option. 2020-09-12 00:09:21 -07:00
bunnei
063edc587a Revert "android: audio: Disable audio stretching by default."
This reverts commit 9ccbba07c824e0eca168fa2563509072b6b6793d.

# Conflicts:
#	src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.java
2020-09-12 00:09:21 -07:00
SachinVin
3b4e8b9fbc common/logging: Create a new backed for android's logcat 2020-09-12 00:09:21 -07:00
zhupengfei
5e52853078 android: Microphone support
Based on Tobi's work. Created a new 'real Mic factory' which creates mic interfaces for real devices. There's a default factory set (cubeb/null, depending on whether cubeb exists) in order to avoid changing code of other frontends.

Created a factory for the Android frontend which requests mic permission and creates a CubebInput (or null). The permission requesting code is basically the same as camera's. If the user denied the permission, an alert dialog will be shown informing them of the reason.

For easier usage, by default the Audio Input Device is set to 'Real Device'.

Co-authored-by: FearlessTobi <thm.frey@gmail.com>
2020-09-12 00:09:21 -07:00
bunnei
370318aba4 android: audio: Disable audio stretching by default. 2020-09-12 00:09:21 -07:00
bunnei
cf8da5978d android: MainActivity: Fix crash when game directory button is not present. 2020-09-12 00:09:21 -07:00
BreadFish64
04152c3a1f android: allow navigating to external storage 2020-09-12 00:09:21 -07:00
bunnei
49e968deee android: BillingManager: Hide premium actionbar button when premium is active. 2020-09-12 00:09:21 -07:00
bunnei
59f89adbaa android: main: res: Add premium icon and fix folder size. 2020-09-12 00:09:21 -07:00
BreadFish64
7dfa26b416 android: more theme changes
fix file picker dialog colors
make Citra text orange in dark mode
2020-09-12 00:09:21 -07:00
BreadFish64
49a4154594 android: inherit file-picker toolbar theme from DayNight 2020-09-12 00:09:21 -07:00
BreadFish64
322d8f7159 android: fix toolbar theme 2020-09-12 00:09:21 -07:00
BreadFish64
46447ab8ce android: fix garbled names in the game list 2020-09-12 00:09:21 -07:00
SachinVin
3b20de131e android:game_info.cpp: correct grammar in comment 2020-09-12 00:09:21 -07:00
zhupengfei
7d93f46a03 android/ndk_camera: Fix rotation
`width` and `height` are not necessarily swapped at this point
2020-09-12 00:09:21 -07:00
FearlessTobi
8a7dacb9c7 android: Make toolbar text black 2020-09-12 00:09:21 -07:00
SachinVin
db8bec4af2 android:game_info.cpp: cleanup spammy log 2020-09-12 00:09:20 -07:00
zhupengfei
daa19eafc6 still_image_camera: Fix incorrect JNI usage
As `jstring`s are also object references, if we would like to use them across native methods/threads, we would have to make a global reference.

We will need to delete this global reference explicitly. Since this string is shared across multiple Interfaces and also in Factory, I used shared_ptr to manage deletion. Added a fancy SharedGlobalRef to id_cache.h.

Also removed global reference creation for java/lang/String classes. Turns out that local references are guaranteed valid for the duration of the method, and I was just being too cautious.
2020-09-12 00:09:20 -07:00
FearlessTobi
3d194c200a android: Add dark theme icons 2020-09-12 00:09:20 -07:00
FearlessTobi
49ecd2f65c android: Run final format 2020-09-12 00:09:20 -07:00
FearlessTobi
b1bc4c213d android: Run clang-format 2020-09-12 00:09:20 -07:00
FearlessTobi
f8d7a025b3 android: Format code
Finally makes us have consistent code format in the codebase.
2020-09-12 00:09:20 -07:00
zhupengfei
3a61f85684 android/ndk_camera: A few fixes
1. Remove unused code
2. Avoid crashes when camera wasn't opened
3. Avoid potential data race
2020-09-12 00:09:20 -07:00
zhupengfei
6542e8338b android: Fix camera settings
1. Fix settings crash when it gets treated as IntSetting
2. Properly report camera facing
2020-09-12 00:09:20 -07:00
bunnei
4be9e52f81 android: GameDatabase: Fix typo in rebase. 2020-09-12 00:09:20 -07:00
SachinVin
36c915e57b android: GameDatabase: dont add misc extensions from sub folders. 2020-09-12 00:09:20 -07:00
SachinVin
45ae85f0b8 android: Recursive dir
# Conflicts:
#	src/android/app/src/main/java/org/citra/citra_emu/model/GameDatabase.java
#	src/android/app/src/main/jni/native.cpp

# Conflicts:
#	src/android/app/src/main/java/org/citra/citra_emu/model/GameDatabase.java
#	src/android/app/src/main/jni/native.cpp
2020-09-12 00:09:20 -07:00
FearlessTobi
5aceb9580e android: Add finished translations from Transifex
This adds all languages that have at least translated 50% of the Android source file.
I hope we can automate this process in the future.
2020-09-12 00:09:20 -07:00
SachinVin
e801417bde android/CustomFilePickerFragment: fixup call super.goUp() instead 2020-09-12 00:09:20 -07:00
BreadFish64
45b4f33d0c android/GameList: Scan for installed titles 2020-09-12 00:09:20 -07:00
SachinVin
775bce41fd android/CustomFilePickerFragment: don't go up beyond the External Storage Directory ...
/storage/emulated/0/
2020-09-12 00:09:20 -07:00
bunnei
945e765bb0 android: overlay: Tighten portrait A/B/X/Y buttons. 2020-09-12 00:09:20 -07:00
bunnei
68ebd303c9 android: overlay: Tighten portrait input a bit, this feels more natural. 2020-09-12 00:09:20 -07:00
bunnei
98f9ae8359 android: InputOverlayDrawableJoystick: Fix off by 1 error with inner joystick. 2020-09-12 00:09:20 -07:00
bunnei
e825fd1438 android: BillingManager: Add a useful comment to onQuerySkuDetailsFinished. 2020-09-12 00:09:20 -07:00
bunnei
ce8c1bf96c android: EmulationActivity: Fix a crash when controller is disconnected. 2020-09-12 00:09:20 -07:00
bunnei
e9d4e8c03d android: BillingManager: Fix issue with onQuerySkuDetailsFinished null param.
- Happens when not associated with a Google account.
2020-09-12 00:09:20 -07:00
FearlessTobi
ce363ca113 android: Minor changes to theming 2020-09-12 00:09:20 -07:00
FearlessTobi
22f8c9e405 android/Settings: Set mStackCount to 0 when starting the Activity
Fixes a bug where you would have to click multiple times to get out of the settings after turning the screen off and on again.
2020-09-12 00:09:20 -07:00
SachinVin
21eb5fe246 Android: directory picker: Add archive extensions for consistency 2020-09-12 00:09:20 -07:00
FearlessTobi
47feff4c4f android: Change theme colors and modify icons 2020-09-12 00:09:20 -07:00
FearlessTobi
7c09fe9fb4 android/MainPresenter: Add double click prevention for the buttons 2020-09-12 00:09:19 -07:00
bunnei
affc973a02 android: settings: Fix config issue with texture_filter_name for premium. 2020-09-12 00:09:19 -07:00
bunnei
5de54bc93a android: native: Fix crash on multiple ZIP boots. 2020-09-12 00:09:19 -07:00
bunnei
1fc2aa6679 android: strings: Update for asynchronous GPU. 2020-09-12 00:09:19 -07:00
bunnei
b6750641ee android: settings: Make texture filtering a premium setting. 2020-09-12 00:09:19 -07:00
bunnei
d00f1f8ac3 settings: PremiumSingleChoiceSetting: Fix bug in getting/setting value. 2020-09-12 00:09:19 -07:00
bunnei
8e4faa97a1 android: EmulationActivity: Fix merge issue with onActivityResult. 2020-09-12 00:09:19 -07:00
bunnei
cbadf433fc Merge branch 'mii-selector' into 'master'
android/applets: Implement Mii Selector

See merge request CitraInternal/citra-android!33
2020-09-12 00:09:19 -07:00
bunnei
a6b03f68ac Merge branch 'amiibo' into 'master'
android: Add Amiibo file support

See merge request CitraInternal/citra-android!34
2020-09-12 00:09:19 -07:00
bunnei
467cf70873 android: native: Ensure shutdown on exit. 2020-09-12 00:09:19 -07:00
bunnei
5374bab531 android: EmulationActivity: Fix gamepad triggers. 2020-09-12 00:09:19 -07:00
bunnei
3ce657d214 android: settings: Use more explicit ARG_MENU_TAG. 2020-09-12 00:09:19 -07:00
bunnei
1c6a42f336 android: PremiumSingleChoiceSetting: Add null check to avoid a crash. 2020-09-12 00:09:19 -07:00
bunnei
71dd559b91 android: settings: Disable 'System Default' theme for pre-Android 10.
- It's not officially supported.
2020-09-12 00:09:19 -07:00
bunnei
721a23c066 android: settings: Store theme setting in shared preferences.
- Fixes some jankieness.
2020-09-12 00:09:19 -07:00
bunnei
7bf84a260e Revert "Merge branch 'rt-android' into 'master'"
This reverts commit df9f831a915524e87bf6d63ce86d76589a3fcd6c, reversing
changes made to 1e11e0aecbfdc5ddb7ad835fe673366d68788bc6.
2020-09-12 00:09:19 -07:00
SachinVin
fe8fec0852 android: create SingletonInstance for Picasso and add a place holder icon 2020-09-12 00:09:19 -07:00
FearlessTobi
6f4fd98d2c android: Also disable realtime audio in the settings presenter 2020-09-12 00:09:19 -07:00
SachinVin
eae42948e2 Update dynarmic 2020-09-12 00:09:19 -07:00
zhupengfei
5b53214f66 Address review 2020-09-12 00:09:19 -07:00
zhupengfei
3dc6c7a1aa ndk_camera: Fixes
Removed debug logs and unused code
Turned CaptureSession struct for simplicity
Added support for camera reload
Fixed ANativeWindow not released
2020-09-12 00:09:19 -07:00
zhupengfei
93499e5543 android/camera: UX enhancements
1. Only request camera permissions once
2. Set the default settings to NDK camera
3. When camera device is not found, fall back to still image
4. Add 'Camera Device' configuration when one is found
5. Added a message when camera permissions are denied

For 4, I had to remove the use of the `config` field in StillImage camera.
2020-09-12 00:09:19 -07:00
zhupengfei
74d406db72 android: Add simple UI for camera configuration
The UI is subject to be changed. At least need to add a camera device selection. I also think we should make Device Camera the default
2020-09-12 00:09:19 -07:00
zhupengfei
e1e6974ac3 fixes to the NDK camera implementation 2020-09-12 00:09:19 -07:00
zhupengfei
e6e78c2159 android/camera: Implement image flipping
We use libyuv's Mirror function to handle horizontal flip. Regarding the vertical flip, libyuv doc states that 'just set a negative height'
2020-09-12 00:09:19 -07:00
zhupengfei
9d6394db2c android: Add NDK camera implementation
Not tested yet as my device doesn't support camera2...
2020-09-12 00:09:19 -07:00
zhupengfei
2aec53ee39 android: Add a still image camera
Similar to what is in the Qt frontend, this camera takes a URI to a
picture file. When the config is empty, it will open up the gallery and
ask the user to pick a picture.

The image is then read and cropped from the Java side by the Picasso library,
and sent to the native code with android NDK Bitmap API (jnigraphics).
The native code handles the format conversion with libyuv.

Image flipping is yet to be implemented.
2020-09-12 00:09:19 -07:00
zhupengfei
4a4ff6dd79 externals: Add libyuv and jnigraphics 2020-09-12 00:09:18 -07:00
bunnei
bd2ff3d75b android: audio: Disable realtime audio by default. 2020-09-12 00:09:18 -07:00
bunnei
45e645cb4c android: Apply correct theme at boot. 2020-09-12 00:09:18 -07:00
bunnei
36772fa7f2 android: Implement billing for Premium. 2020-09-12 00:09:18 -07:00
zhupengfei
f8d162ea00 Fix a typo in swkbd
That made the application crash when an @ is typed and the game prohibited it
2020-09-12 00:09:18 -07:00
BreadFish64
304eec9ffd memory: fix memory leak related to un-freed shared memory 2020-09-12 00:09:18 -07:00
BreadFish64
a5e047f9d6 Revert "android: log: TrimSourcePath: Cannot be constexpr."
This reverts commit 21a75c52
2020-09-12 00:09:18 -07:00
FearlessTobi
85247452d1 GameDatabase: Don't rescan when upgraded
This otherwise causes a crash because the Database gets closed too early.
2020-09-12 00:09:18 -07:00
FearlessTobi
0a664c4dcf GameDatabase: Increase DB_VERSION
I forgot to do this in a previous PR.
2020-09-12 00:09:18 -07:00
bunnei
25e95aa774 android: MainActivity: Move theme setup to after settings initialization.
- Fixes a crash.
2020-09-12 00:09:18 -07:00
FearlessTobi
d488620fb5 android: Add premium section and Dark Theme setting 2020-09-12 00:09:18 -07:00
FearlessTobi
623984dc06 android/GameAdapter: Fix the getColor calls using the wrong context 2020-09-12 00:09:18 -07:00
FearlessTobi
8c3883ecb4 android/build: Update exifinterface to version 1.2.0 2020-09-12 00:09:18 -07:00
FearlessTobi
6c3b9ec099 android: Make adjustScale reflect changes without closing the dialog 2020-09-12 00:09:18 -07:00
FearlessTobi
09247f3d57 android: Clarify the warning in the Debug tab 2020-09-12 00:09:18 -07:00
FearlessTobi
d3b92417c7 android: Enable audio stretching by default
It helps eliminate stutter and won't have a huge perf penalty, hopefully.
2020-09-12 00:09:18 -07:00
zhupengfei
481a4542aa gl_shader_util: Specify default precision for uimage2D
Otherwise, this causes the application to crash when compiling any shader, on both devices I tested.
2020-09-12 00:09:18 -07:00
FearlessTobi
8cde6cc5b3 android: Add game region to the GameDatabase 2020-09-12 00:09:18 -07:00
FearlessTobi
ef3e0dd8bd android: Remove unused JNI functions and use better names for game icon variables 2020-09-12 00:09:18 -07:00
FearlessTobi
46c529f849 android/settings: Make background color match the rest of the app 2020-09-12 00:09:18 -07:00
FearlessTobi
36c96561b3 styles: Use Appcompat instead of MaterialComponents in order to avoid various issues
Fixes the AppBar being black in settings and emulation when using the dark theme.
(Dolphin does the same.)

Also cleans up our styles a bit.
2020-09-12 00:09:18 -07:00
FearlessTobi
dd08a3e0e0 android: Fix the frame limiter
It was erroneously using the wrong config section and variable type.
2020-09-12 00:09:18 -07:00
BreadFish64
d069fd7a29 video_core: disable depth/stencil texture download on OpenGL ES 2020-09-12 00:09:18 -07:00
BreadFish64
aa56bbfeb6 android: disallow split screen 2020-09-12 00:09:18 -07:00
FearlessTobi
d6fea7396a android/settings: Move VSync option to debug
Dolphin does the same and there's no real reason the users should mess with it.
2020-09-12 00:09:18 -07:00
FearlessTobi
f6352ab45d android/NativeLibrary: Use Html.FROM_HTML_MODE_LEGACY
Fixes a deprecation warning.
2020-09-12 00:09:18 -07:00
FearlessTobi
c8601ba975 android: Make more Strings translatable 2020-09-12 00:09:17 -07:00
FearlessTobi
b5cafc8fd1 android: Fix the menu animations
Turns out those unused methods were actually used for something.
2020-09-12 00:09:17 -07:00
FearlessTobi
eee0f42381 AndroidManifest: Workaround the crash when changing Theme while in settings
Essentially extends upon https://github.com/dolphin-emu/dolphin/pull/8288.

Original description:
"The "correct way" would be to fully save and restore data on onSaveInstanceState and restore it back on onCreate. I tried to do that first.
As there is various conflicts with doing this without some form of refactor due to how the lifecycle diverges and is baked-in to the application, ignoring Activity recreation on orientation change should work well enough and we don't draw anything different in settings on landscape mode or ui mode anyway."
2020-09-12 00:09:17 -07:00
FearlessTobi
1577ca5082 android: Show a hint when the gamelist is empty 2020-09-12 00:09:17 -07:00
FearlessTobi
cf45e97b94 Make the gamelist look nicer and indicate files with a wrong extension visually 2020-09-12 00:09:17 -07:00
FearlessTobi
b9375da143 android: Change plus icon to folder icon because we don't support multiple directories 2020-09-12 00:09:17 -07:00
FearlessTobi
22158d0e0e android: Add realtime audio setting 2020-09-12 00:09:17 -07:00
FearlessTobi
8771cde5fc audio_core: Add realtime audio 2020-09-12 00:09:17 -07:00
BreadFish64
cbfe2718be video_core: bump swap chain size for GLES to reduce bottleneck 2020-09-12 00:09:17 -07:00
BreadFish64
a644f6fde1 video_core: implement optimized D24S8->RGBA8 reinterpreters 2020-09-12 00:09:17 -07:00
James Rowe
25fa439ca9 Use immutable storage when available 2020-09-12 00:09:17 -07:00
BreadFish64
a4180f1aef android: disable OpenGL debug message again 2020-09-12 00:09:17 -07:00
BreadFish64
2e67d85915 android: fix opening settings menu in-game 2020-09-12 00:09:17 -07:00
SachinVin
8f031d10f2 android: SettingsFragmentPresenter.java: correct the section used in debug tab
Fixes setting always showing the default value.
2020-09-12 00:09:17 -07:00
BreadFish64
434f545f05 video_core: implement GLES depth/stencil downloads 2020-09-12 00:09:17 -07:00
FearlessTobi
b4c92de212 android: Add debug tab 2020-09-12 00:09:17 -07:00
FearlessTobi
8e71778137 Optimize imports 2020-09-12 00:09:17 -07:00
FearlessTobi
f0309a28cb android: Complete the removal of ATV and address minor Linter warnings 2020-09-12 00:09:17 -07:00
FearlessTobi
220a30ebb6 android: Remove obsolete AndroidTV mode and its resources 2020-09-12 00:09:17 -07:00
BreadFish64
016718ab28 android: add texture filter setting 2020-09-12 00:09:17 -07:00
BreadFish64
ce4db4de92 android: Add StringSingleChoiceSetting 2020-09-12 00:09:17 -07:00
BreadFish64
8caa46c37a video_core: fix texture filters in GLES 2020-09-12 00:09:17 -07:00
zhupengfei
79bef4a9dc android/swkbd: Properly set uncancelable
When using a DialogFragment you have to set this property on the DialogFragment itself.
2020-09-12 00:09:17 -07:00
FearlessTobi
742dd691f3 Android: Disable automatic backup
Since we don't have proper confuguration file of what to include/exclude
in the backup, this better be disabled because it will lead to unexpected
state. This will solve any issue that was keep hapenning even after fresh
install of the emulator until you manually clear the app data.

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:16 -07:00
FearlessTobi
e6bbe0a18c build: Fix abiFilter 2020-09-12 00:09:16 -07:00
FearlessTobi
ed2932e996 jni/config: Set is_new_3ds to true by default 2020-09-12 00:09:16 -07:00
zhupengfei
274c8fd4a5 res: Add Chinese (zh) translation 2020-09-12 00:09:16 -07:00
FearlessTobi
5b2ff17df6 android/strings: Add German translation 2020-09-12 00:09:16 -07:00
FearlessTobi
a9463d81a9 Android: Reflect the settings that is being used by the emulator on the UI
Per-Game settings now load the settings in this order
1. Emulator Settings
2. Default Settings of the Game that we ship with Dolphin
3. Custom game settings the user have

where the later always overides the former in case of collision, then
we show that on the UI to make it clear to the user which settings being
used.

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:16 -07:00
FearlessTobi
c4f104a4d3 strings: Add the performance warning to the translatable strings 2020-09-12 00:09:16 -07:00
FearlessTobi
0a394aac53 Android: Fix custom game settings
Apparently there was a different section names used by the custom game
settings that caused Android to have those settings broken for
some sections like the graphics one. This adds the map between the generic
settings <> custom settings.

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:16 -07:00
FearlessTobi
3a7a8d9c2c Android: Refactor the settings managemnt
1. Create Settings class the encaupslate the loading/saving of all settings
2. Decouple the logic of saving the settings into 3 different config files
from the UI code.
2020-09-12 00:09:16 -07:00
FearlessTobi
99bcf21a8a Android: Start structure the project around features instead of data types
This only moves the settings feature, the rest will be moved slowely later.

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:16 -07:00
zhupengfei
e59f616866 android/swkbd: Fix rotation crash
Create a new DialogFragment to manage the dialog's state.
Also replaced AlertDialog with the androidx one which arguably looks better.
2020-09-12 00:09:16 -07:00
FearlessTobi
f6b05a645d Clean up unused resources and resolve linter warnings 2020-09-12 00:09:16 -07:00
BreadFish64
e3b5846231 android/config: initialize cpu_clock_frequency
leaving it uninitialized broke some games for obvious reasons
2020-09-12 00:09:16 -07:00
BreadFish64
d0b84c78cc android: don't use ScopeAcquireContext in RunCitra
The context will be released when window is destroyed
2020-09-12 00:09:16 -07:00
zhupengfei
cd9d01c837 Fix incorrect import due to library change 2020-09-12 00:09:16 -07:00
zhupengfei
8f16824fbb android: SoftwareKeyboard implementation 2020-09-12 00:09:16 -07:00
BreadFish64
cd23001e5a android/ndk_motion: remove ALooper_release from ndk_motion destructor
We didn't acquire the looper from another thread so this is not correct
2020-09-12 00:09:16 -07:00
BreadFish64
657480e7ba android: jni cleanup 2020-09-12 00:09:16 -07:00
FearlessTobi
274b16f667 Remove unused code 2020-09-12 00:09:16 -07:00
FearlessTobi
2dfc0c2243 Fix a bunch of issues found by the Linter and rename Dolphin functions to Citra 2020-09-12 00:09:16 -07:00
FearlessTobi
65b6068e9a Android: Set up Day/Night mode for system-compatible optional dark theme
Original commit by TheRealPSV for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
03a8b81a07 Android: Fix displaying checkbox settings with no description
bugs.dolphin-emu.org/issues/11904.

Original commit by JosJuice for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
3fe88ecb79 Moves AlertDialogs imports to AndroidX and fix tabs background color
Original commit by rafaeltoledo for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
64d9e6304d Bumps compile API to 29 (Q) removes unecessary casts and deprecated calls
This will help the Android client to evolve with the latest libraries (as the legacy support libs will not be shipped anymore with the com.android.support package).

This PR also makes the app compliant with the new API requirements to start later this year:
android-developers.googleblog.com/2019/02/expanding-target-api-level-requirements.html.

Original commit by rafaeltoledo for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
b808196faa Migrate to AndroidX
Support Libraries are outdated and AndroidX is recommended instead. Read more here: developer.android.com/jetpack/androidx.

Original commit by Simonx22 for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
8236432f44 Android: Show files in the directory picker
People in the Google Play reviews still seem to be confused about
games not showing up in the directory picker, so let's show them
even though they can't be selected. (Either that or they haven't
realized that they need to extract their pirated games.)

Original commit by JosJuice for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
1fef8faecc Android: Expand the comment for NVidiaShieldWorkaroundView
This text has been taken from the message of the commit that added
the class. (I don't have an Nvidia Shield to reproduce the bug with.)

Original commit by JosJuice for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
49a51b8863 Remove unused code
Original commit by weihuoya for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
76fada5016 Fix for crash when switching to landscape mode
bugs.dolphin-emu.org/issues/10815

Original commit by allanxp4 for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
64de97b6b5 Android: Bunch of cleanups & Updates
1. Update Picasso to latest version
2. Remove some unused code

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
d3bd1e77c1 Android: fix/ignore L2/R2 buttons
L2/R2 will trigger a key press and an axis event if the trigger is pressed fully down
Was incorrectly ignoring L1/R1 key presses.

Original commit by zackhow for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
a56ccfa03b Android: don't try to pause emulation when not running
Forcing landscape at emulation start revealed a bug where if the activity was
recreated before emulation started then it would get stuck in a paused state.

Original commit by zackhow for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
9db0103990 Android: Remove the cancel button from the file browser
Fix the regresion from dolphin-emu/dolphin#7520, also it applies the change
to the directory picker only.

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
1a2d0a4c27 Android: Change the file browser dialog ok button title
I hope this will make it more clear to users that they are suppose to
select the dircetory that has the games.

Original commit by mahdihijazi for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
b02995ffb8 android: remove enter and exit transition
Originally done by weihuoya for Dolphin-emu.
2020-09-12 00:09:15 -07:00
FearlessTobi
365e9cd37f Android: Run Directory Initialization as a thread instead of service
Two reasons for this change. First, it appears that some android launchers do some sort of call into
the application when long pressing the app icon, which in turn calls the DirectoryInit service. This
was ok to do prior to Oreo but will cause crashes with the new restrictions on services running
in the background. Which leads to the second reason that DirectoryInit doesn't need to be a service
at all since these actions are required for dolphin to function and shouldn't be a scheduled action.
So we instead just kick this off in a new thread and send the broadcast when done.

Original commit by zackhow for Dolphin-emu
2020-09-12 00:09:15 -07:00
Marshall Mohror
1dca51b477 android: implement motion controls via device sensors 2020-09-12 00:09:15 -07:00
SachinVin
ec192c5ca4 android: jni: Remove unused ndk_helper after EGL migration + cleanup jni/CMakeLists.txt 2020-09-12 00:09:15 -07:00
BreadFish64
9d9cc9154a android: allow changing settings while game is running 2020-09-12 00:09:15 -07:00
BreadFish64
c303562494 video_core: move buffer resize before GLES check
preventing the assert in FlushGLBuffer
2020-09-12 00:09:15 -07:00
bunnei
c0b3dd3aa7 android: frontend: Limit game list to a single directory. 2020-09-12 00:09:14 -07:00
bunnei
8121783c33 android: frontend: MainActivity: Fix issues with declining app permissions. 2020-09-12 00:09:14 -07:00
bunnei
0f058098ac android: build.gradle: Bump minimum version to 26. 2020-09-12 00:09:14 -07:00
bunnei
011e982b3c android: Rename app package from citra_android to citra_emu.
- There is already a conflicting name on the Play Store.
2020-09-12 00:09:14 -07:00
bunnei
4d62a7ebdd android: emu_window: Fix surface width/height.
- Fixes a bug when resuming the app.
2020-09-12 00:09:14 -07:00
bunnei
915ebbc7eb android: AndroidManifest: Use singleTop mode, not singleInstance.
- Fixes launching the app without restarting the emulation activity.
2020-09-12 00:09:14 -07:00
bunnei
d438821c6d android: frontend: game_list: Move add directory button to top bar. 2020-09-12 00:09:14 -07:00
bunnei
289e419dc3 android: frontend: game_list: Tweak game cards. 2020-09-12 00:09:14 -07:00
bunnei
1bf244c859 android: frontend: game_list: Rounded icons and other UX improvements. 2020-09-12 00:09:14 -07:00
bunnei
0dcd531110 android: frontend: Add vsync to the settings now that it is supported. 2020-09-12 00:09:14 -07:00
bunnei
7c96dc1fc5 android: emu_window: Adapt for use with split presenter thread. 2020-09-12 00:09:14 -07:00
bunnei
8a64b4c249 android: Update .gitignore for CXX compile cache. 2020-09-12 00:09:14 -07:00
bunnei
15ff77dbb9 android: renderer_opengl: Various fixes for GLES. 2020-09-12 00:09:14 -07:00
bunnei
ad0c69c150 android: gradle: Update. 2020-09-12 00:09:14 -07:00
bunnei
c84e30749c android: log: TrimSourcePath: Cannot be constexpr. 2020-09-12 00:09:14 -07:00
SachinVin
08a31941a9 Android: frontend: use android.R.string.ok instead of literal 2020-09-12 00:09:14 -07:00
SachinVin
4491a2a4ad Android: Settings: Center the setting title when no setting description is provided. 2020-09-12 00:09:14 -07:00
bunnei
d76f82dd16 android: dsp_dsp: Move a noisy log statement to trace. 2020-09-12 00:09:14 -07:00
bunnei
f3ff3743fc android: video_core: Enable HW shadows and texture barrier on GLES. 2020-09-12 00:09:14 -07:00
bunnei
f0a520755f video_core: gl_shader_manager: Only set shader samplers on fragment shader.
- Avoids unnecessary uniform errors.
2020-09-12 00:09:14 -07:00
bunnei
91d85e62c7 android: video_core: Require GLES 3.2 in shaders. 2020-09-12 00:09:13 -07:00
bunnei
35fcff95ba android: native: Change order of EmuWindow teardown.
- This needs to happen after system shutdown for asynchronous GPU.
2020-09-12 00:09:13 -07:00
bunnei
3e484db1c5 android: video_core: gl_rasterizer_cache: Make cache access thread safe. 2020-09-12 00:09:13 -07:00
bunnei
e43f3a2732 android: audio_core: Remove noisy log. 2020-09-12 00:09:13 -07:00
bunnei
f6b2ab207a android: core: frontend: Port yuzu's code for scope acquire window context. 2020-09-12 00:09:13 -07:00
bunnei
44e8947ebc android: res: Update the launcher icon. 2020-09-12 00:09:13 -07:00
bunnei
8f6e36656f android: frontend: FPS overlay: Add some minor margin. 2020-09-12 00:09:13 -07:00
bunnei
d642d73b20 android: jni: Migrate EmuWindow_Android class to EGL.
- This enables us to use shared contexts more easily.
2020-09-12 00:09:13 -07:00
bunnei
bca9002c7c android: frontend: Add errors for unsupported ROM formats. 2020-09-12 00:09:13 -07:00
bunnei
0a9b677a14 android: renderer_opengl: Partially implement glLogicOp on GLES. 2020-09-12 00:09:13 -07:00
SachinVin
74d8c3301e android/GameDatabase.java: remove duplicate ".3ds" from allowedExtensions 2020-09-12 00:09:13 -07:00
bunnei
d30641963e android: renderer_opengl: Optimize GetTexImageOES and fix bugs. 2020-09-12 00:09:13 -07:00
bunnei
ed05605237 android: settings: Add system language setting. 2020-09-12 00:09:13 -07:00
bunnei
9f9bdbbb7e android: settings: Fix bug where changing speed limiter will slow game down. 2020-09-12 00:09:13 -07:00
bunnei
ecfb9a0de2 android: frontend: Support 18.5:9 aspect ratio. 2020-09-12 00:09:13 -07:00
bunnei
102e8ff8cf android: frontend: Further simplify show FPS overlay text. 2020-09-12 00:09:13 -07:00
bunnei
a5633c97ce android: frontend: Fix several issues with running notification.
- Priority should be low without sound/vibration.
- Notification should restore app.
2020-09-12 00:09:13 -07:00
bunnei
1cdb851098 android: frontend: Use color white for FPS overlay. 2020-09-12 00:09:13 -07:00
bunnei
cf8234ed86 android: frontend: settings: Temporarily disable V-Sync. 2020-09-12 00:09:13 -07:00
bunnei
d091f4b4a0 android: frontend: Rename settings hint to "Settings". 2020-09-12 00:09:13 -07:00
bunnei
9b591cf321 android: frontend: New and improved launcher icon. 2020-09-12 00:09:13 -07:00
bunnei
19b1cd2bfd android: frontend: startup: Improve startup and permissions handling.
- Fixes a first boot crash.
2020-09-12 00:09:13 -07:00
bunnei
fa4386dfd4 android: frontend: settings: Disable audio stretching by default. 2020-09-12 00:09:13 -07:00
bunnei
75436edada android: frontend: settings: Accurate shader multiplication should be disabled. 2020-09-12 00:09:13 -07:00
bunnei
00e0cd1827 android: frontend: settings: Simplify sliders. 2020-09-12 00:09:12 -07:00
bunnei
2b2aed15a5 android: frontend: menu: Improve in game options, make check boxes. 2020-09-12 00:09:12 -07:00
bunnei
2b3962a86e android: frontend: Implement persistent notification while emulator is running. 2020-09-12 00:09:12 -07:00
bunnei
bd75e7d840 android: Rename main entry class to CitraApplication. 2020-09-12 00:09:12 -07:00
bunnei
a10290e6f8 android: frontend: Implement basic software keyboard applet. 2020-09-12 00:09:12 -07:00
bunnei
d4a950d29b android: frontend: Use android builtin ok/yes/no/cancel strings where possible. 2020-09-12 00:09:12 -07:00
bunnei
cf0ac0c998 android: frontend: Add "Cancel" and "Default" buttons to reset overlay. 2020-09-12 00:09:12 -07:00
bunnei
230ca50639 android: frontend: Fix bug with reset overlay scale. 2020-09-12 00:09:12 -07:00
bunnei
27f9f5b56d android: frontend: Cleanup perf stats. 2020-09-12 00:09:12 -07:00
bunnei
2a1f66ed45 android: frontend: card_game: Tighten padding a little bit. 2020-09-12 00:09:12 -07:00
bunnei
bb8b58a638 android: frontend: gamelist: Save PlatformGamesFragment state.
- Fixes weird duplication of game list on rotation.
2020-09-12 00:09:12 -07:00
bunnei
f58018eb90 android: frontend: gamelist: Fix weird scroll behavior with action bar. 2020-09-12 00:09:12 -07:00
bunnei
6afd32aecc android: jni: Improve management of core emulation state.
- Furthermore fixes bug where audio crackling could bleed out of the app.
2020-09-12 00:09:12 -07:00
bunnei
54b0d3ac7e android: frontend: settings: Add a back button to the navigation bar. 2020-09-12 00:09:12 -07:00
bunnei
9ed543a2ca android: frontend: gamelist: Add swipe to refresh gesture. 2020-09-12 00:09:12 -07:00
bunnei
dc47b8a034 android: frontend: settings: Disable configuring D-pad as buttons. 2020-09-12 00:09:12 -07:00
bunnei
cbe0b74694 android: frontend: settings: Rename "controller" section to "gamepad". 2020-09-12 00:09:12 -07:00
bunnei
0ad9e0ebbe android: frontend: menu_settings: Remove save button. 2020-09-12 00:09:12 -07:00
bunnei
4da1d3541a android: frontend: fragment_settings: Remove margins. 2020-09-12 00:09:12 -07:00
bunnei
8fccc896f3 android: frontend: settings: Simply save toast. 2020-09-12 00:09:12 -07:00
bunnei
644048c3e5 android: frontend: EmulationActivity: Remove citra icon from game prompt. 2020-09-12 00:09:12 -07:00
bunnei
0d4fb44ba4 gl_rasterizer_cache: Remove redundant GLES check. 2020-09-12 00:09:12 -07:00
bunnei
695ee7c45f android: gl_rasterizer_cache: Skip costly shutdown procedure. 2020-09-12 00:09:12 -07:00
bunnei
04aa0243df android: jni: Fix how we handle orientation changes.
- This previously broke Jave to C++ bindings.
2020-09-12 00:09:12 -07:00
bunnei
3df9329965 core: Reset cpu_core after kernel.
- Fixes a crash on Android.
2020-09-12 00:09:12 -07:00
bunnei
3d151821de android: jni: config: Disable shaders_accurate_mul by default (it's too slow). 2020-09-12 00:09:12 -07:00
bunnei
3a0f6eeb69 android: jni: Add IDCache to cache Java methods. 2020-09-12 00:09:12 -07:00
bunnei
4a8935b267 android: Picasso: Use newer version and some minor cleanup. 2020-09-12 00:09:11 -07:00
bunnei
1713b707e8 android: AndroidManifest.xml: Require GLES 3.1 and AEP. 2020-09-12 00:09:11 -07:00
bunnei
6b07055672 android: native: Reset old EmuWindow before constructing a new one.
- Enforces that touch is unregistered at the right time, ensuring it works for subsequent runs.
2020-09-12 00:09:11 -07:00
bunnei
6d17c46a2a android: native: Use actual array length for banner copy. 2020-09-12 00:09:11 -07:00
bunnei
6cf5976cc5 android: frontend: Add config option for linear filtering. 2020-09-12 00:09:11 -07:00
bunnei
524480433a android: settings: Add/update missing config options from latest master. 2020-09-12 00:09:11 -07:00
bunnei
47af9510a8 android: settings: Remove shaders_accurate_gs and toggle_3d.
- shaders_accurate_gs no longer exists.
- toggle_3d was renamed, but is not used on Android.
2020-09-12 00:09:11 -07:00
bunnei
ba317b3761 android: input: Add support for gamepads. 2020-09-12 00:09:11 -07:00
bunnei
2b4a4088da android: frontend: SettingsFragmentPresenter: Add config options for joypad controls. 2020-09-12 00:09:11 -07:00
bunnei
99b0af93e4 android: frontend: MotionAlertDialog: Merge latest Dolphin code. 2020-09-12 00:09:11 -07:00
Weiyi Wang
b0aea27156 Add reset button to slider setting 2020-09-12 00:09:11 -07:00
Weiyi Wang
ffe85bb5bc move speed limiter to general 2020-09-12 00:09:11 -07:00
bunnei
fb5aaae771 android: frontend: SettingsFile: Add button strings. 2020-09-12 00:09:11 -07:00
bunnei
9f238df8c1 android: frontend: strings: Cleanup for controller input. 2020-09-12 00:09:11 -07:00
bunnei
6505b6dafd android: app: Add method to get global context. 2020-09-12 00:09:11 -07:00
bunnei
2cf5eddf4e android: jni: Remove unnecessary code. 2020-09-12 00:09:11 -07:00
Weiyi Wang
9f992cfe95 remove redundant code 2020-09-12 00:09:11 -07:00
Weiyi Wang
00a8bffb89 Also fix default value for speed limiter & audio stretcher 2020-09-12 00:09:11 -07:00
Weiyi Wang
db39e15982 Accurate GS is default to true in config 2020-09-12 00:09:11 -07:00
Weiyi Wang
8611ed2aa8 fix system clock default value 2020-09-12 00:09:11 -07:00
Weiyi Wang
3675587528 fix time picker not saving/loading time 2020-09-12 00:09:11 -07:00
Weiyi Wang
4d8d28bcb9 Fix TimePicker style 2020-09-12 00:09:11 -07:00
Weiyi Wang
a75935fafc move "select game folder" string to resource 2020-09-12 00:09:11 -07:00
Weiyi Wang
be4868de28 Add title to file picker 2020-09-12 00:09:11 -07:00
bunnei
791dfe6451 android: config: Enable accurate multiplication by default. 2020-09-12 00:09:11 -07:00
bunnei
9fabee9c66 android: frontend: Update circle pad icon resources. 2020-09-12 00:09:11 -07:00
bunnei
f656bff46f android: frontend: Swap select and start buttons to match 3DS. 2020-09-12 00:09:10 -07:00
bunnei
99f3db3d69 android: frontend: settings: String cleanup & minor improvements. 2020-09-12 00:09:10 -07:00
bunnei
f48d28bb92 android: native: Ensure game config is re-loaded before starting. 2020-09-12 00:09:10 -07:00
bunnei
7024fa2296 android: frontend: Remove Home button for now, as it does not do anything. 2020-09-12 00:09:10 -07:00
bunnei
cf72f266a9 android: frontend: Add a confirmation dialog on game exit. 2020-09-12 00:09:10 -07:00
bunnei
34553e385b android: frontend: Update controls overlay placement for new icon resources. 2020-09-12 00:09:10 -07:00
bunnei
cba96af5a3 android: frontend: Update to new icon resources. 2020-09-12 00:09:10 -07:00
bunnei
d4003193bc android: frontend: settings: Add performance warnings for relevant settings. 2020-09-12 00:09:10 -07:00
bunnei
71eb3898b6 android: frontend: Remove "Toggle All" option from toggle controls.
- This was broken, and is not terribly useful as-is.
2020-09-12 00:09:10 -07:00
bunnei
c54b1fa0e1 android: frontend: Decrease spacing between game cards. 2020-09-12 00:09:10 -07:00
bunnei
91990cf09d android: jni: Fix management of core emulation state and various cleanups.
- Fixes a shutdown crash.
2020-09-12 00:09:10 -07:00
bunnei
7b77c35edf android: frontend: Fix bug where games could be double-clicked. 2020-09-12 00:09:10 -07:00
bunnei
d3d9aa637d android: jni: Sanitize analog stick inputs.
- Fixes bug where joystick sometimes is unresponsive.
2020-09-12 00:09:10 -07:00
bunnei
f91e8e1cf0 android: frontend: Fix default state for toggle controls, enable D-pad by default. 2020-09-12 00:09:10 -07:00
bunnei
7db684f1cd android: frontend: Add persistent changeable layout option for landscape mode. 2020-09-12 00:09:10 -07:00
bunnei
2952363549 android: frontend: Track screen layout separately for orientation. 2020-09-12 00:09:10 -07:00
bunnei
eb094e377f android: frontend: Add MobileLandscape layout profile for mobile devices. 2020-09-12 00:09:10 -07:00
James Rowe
18d08a9d0d Adds in missing changes to gradle file and updates dynarmic 2020-09-12 00:09:09 -07:00
bunnei
359bfe8b55 android: jni: button_manager: Fix circle pad on subsequent game launch.
- We were missing an UnregisterFactory call for AnalogDevice.
2020-09-12 00:09:09 -07:00
bunnei
6a3fa8423a android: frontend: MainPresenter: Refresh game directory on app boot. 2020-09-12 00:09:09 -07:00
bunnei
74e9708afb android: jni: game_info: Fix crash on banner load for missing title. 2020-09-12 00:09:09 -07:00
bunnei
8703051be0 android: jni: config: Fix bug preventing creation of config.ini. 2020-09-12 00:09:09 -07:00
bunnei
2afd0c62db android: frontend: StartupHandler: Add an intro sequence to pick game dir. 2020-09-12 00:09:09 -07:00
bunnei
54a60a581e android: frontend: SettingsFragmentPresenter: Default resolution scale to 1X.
- Because android phones aren't very fast.
2020-09-12 00:09:09 -07:00
bunnei
722d35ed1a android: core: Prepare for ARM64 dynarmic support. 2020-09-12 00:09:09 -07:00
bunnei
c8f4941c0f android: frontend: Settings: Section categories must match INI settings. 2020-09-12 00:09:09 -07:00
bunnei
fd76432869 android: frontend: Settings: Various updates and preserve single choice text in UI. 2020-09-12 00:09:09 -07:00
bunnei
d2ced94670 android: frontend: SettingsFragmentPresenter: Move speed limit to Graphics, give proper strings. 2020-09-12 00:09:09 -07:00
bunnei
81a060f802 android: frontend: Enlarge icon for launcher. 2020-09-12 00:09:09 -07:00
bunnei
c7c41586ca android: frontend: SettingsFragmentPresenter: Organize settings into logical categories. 2020-09-12 00:09:09 -07:00
bunnei
68cabace70 android: frontend: SettingsFragmentPresenter: Remove unnecessary settings, add JIT setting. 2020-09-12 00:09:09 -07:00
bunnei
d68d0aa8e0 android: frontend: InputOverlay: Fix setting save for portrait mode. 2020-09-12 00:09:09 -07:00
bunnei
fa48f28aff android: frontend: Fix settings slider cancel button. 2020-09-12 00:09:09 -07:00
bunnei
c0a9ca70db android: frontend: auto-reformat all code for consistent style. 2020-09-12 00:09:09 -07:00
bunnei
133f9251dc android: dynarmic: Use internal dynarmic submodule. 2020-09-12 00:09:09 -07:00
James Rowe
f277d60bf5 Perf: Remove more breakpoint checking in the interpreter. Move filtering earlier in the logging chain 2020-09-12 00:09:09 -07:00
bunnei
180aabe2db (jroweboy) Remove existing code in src/android
Move src/citra_android to src/android/app/src/main/jni
Disable gdbstub breakpoints on android (could be done better)
Disable LOD_BIAS for GLES (not support on gles)
2020-09-12 00:09:09 -07:00
bunnei
fd7b0a6e11 android: frontend: Implement MobilePortrait layout, which makes more sense for mobile. 2020-09-12 00:09:08 -07:00
bunnei
8484c160a9 android: native: Remove several unused hooks. 2020-09-12 00:09:08 -07:00
bunnei
60a5c0968c android: native: Add hooks for SwitchScreenLayout and SwapScreens. 2020-09-12 00:09:08 -07:00
bunnei
9bda3eedaf android: config: Update to reflect latest settings. 2020-09-12 00:09:08 -07:00
bunnei
a4c16e2e25 android: frontend: Add base project. 2020-09-12 00:09:08 -07:00
262 changed files with 17782 additions and 22216 deletions

View File

@ -0,0 +1,39 @@
# Set-up Visual Studio Command Prompt environment for PowerShell
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
cmd /c "VsDevCmd.bat -arch=x64 & set" | foreach {
if ($_ -match "=") {
$v = $_.split("="); Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])"
}
}
popd
function Which ($search_path, $name) {
($search_path).Split(";") | Get-ChildItem -Filter $name | Select -First 1 -Exp FullName
}
function GetDeps ($search_path, $binary) {
((dumpbin /dependents $binary).Where({ $_ -match "dependencies:"}, "SkipUntil") | Select-String "[^ ]*\.dll").Matches | foreach {
Which $search_path $_.Value
}
}
function RecursivelyGetDeps ($search_path, $binary) {
$final_deps = @()
$deps_to_process = GetDeps $search_path $binary
while ($deps_to_process.Count -gt 0) {
$current, $deps_to_process = $deps_to_process
if ($final_deps -contains $current) { continue }
# Is this a system dll file?
# We use the same algorithm that cmake uses to determine this.
if ($current -match "$([regex]::Escape($env:SystemRoot))\\sys") { continue }
if ($current -match "$([regex]::Escape($env:WinDir))\\sys") { continue }
if ($current -match "\\msvc[^\\]+dll") { continue }
if ($current -match "\\api-ms-win-[^\\]+dll") { continue }
$final_deps += $current
$new_deps = GetDeps $search_path $current
$deps_to_process += ($new_deps | ?{-not ($final_deps -contains $_)})
}
return $final_deps
}

39
.appveyor/ProcessPdb.ps1 Normal file
View File

@ -0,0 +1,39 @@
# Generate pdb files for mingw
if ($env:BUILD_TYPE -eq 'mingw') {
Invoke-WebRequest -Uri https://raw.githubusercontent.com/citra-emu/ext-windows-bin/master/cv2pdb/cv2pdb.exe -OutFile cv2pdb.exe
foreach ($exe in Get-ChildItem "$RELEASE_DIST" -Recurse -Filter "citra*.exe") {
.\cv2pdb $exe.FullName
}
}
# Specify source locations in pdb via srcsrv.ini
$srcsrv = "SRCSRV: ini ------------------------------------------------`r`n"
$srcsrv += "VERSION=2`r`n"
$srcsrv += "VERCTRL=http`r`n"
$srcsrv += "SRCSRV: variables ------------------------------------------`r`n"
$srcsrv += "SRCSRVTRG=https://raw.githubusercontent.com/%var2%/%var3%/%var4%`r`n"
$srcsrv += "SRCSRV: source files ---------------------------------------`r`n"
foreach ($repo in @{
"citra-emu/citra" = ""
"citra-emu/ext-boost" = "externals/boost"
"citra-emu/ext-soundtouch" = "externals/soundtouch"
"fmtlib/fmt" = "externals/fmt"
"herumi/xbyak" = "externals/xbyak"
"lsalzman/enet" = "externals/enet"
"MerryMage/dynarmic" = "externals/dynarmic"
"neobrain/nihstro" = "externals/nihstro"
}.GetEnumerator()) {
pushd
cd $repo.Value
$rev = git rev-parse HEAD
$files = git ls-tree --name-only --full-tree -r HEAD
foreach ($file in $files) {
$srcsrv += "$(pwd)\$($file -replace '/','\')*$($repo.Name)*$rev*$file`r`n"
}
popd
}
$srcsrv += "SRCSRV: end ------------------------------------------------`r`n"
Set-Content -Path srcsrv.ini -Value $srcsrv
foreach ($pdb in Get-ChildItem "$RELEASE_DIST" -Recurse -Filter "*.pdb") {
& "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv\pdbstr.exe" -w -i:srcsrv.ini -p:$pdb.FullName -s:srcsrv
}

View File

@ -1,4 +0,0 @@
#!/bin/bash -ex
# Run clang-format
./.ci/linux-clang-format/script.sh

View File

@ -1,24 +0,0 @@
#!/bin/bash -ex
set -o pipefail
export Qt5_DIR=$(brew --prefix)/opt/qt5
export PATH="/usr/local/opt/ccache/libexec:/usr/local/opt/llvm/bin:$PATH"
# ccache configurations
export CCACHE_CPP2=yes
export CCACHE_SLOPPINESS=time_macros
export CC="ccache clang"
export CXX="ccache clang++"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
ccache -s
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_FFMPEG_AUDIO_DECODER=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON -GNinja
ninja
ccache -s
ctest -VV -C Release

View File

@ -1,7 +0,0 @@
#!/bin/sh -ex
brew update
brew unlink python@2 || true
rm '/usr/local/bin/2to3' || true
brew install qt5 sdl2 p7zip ccache ffmpeg llvm ninja || true
pip3 install macpack

View File

@ -1,10 +0,0 @@
#!/bin/sh -ex
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON
ninja
# show the caching efficiency
buildcache -s
ctest -VV -C Release || echo "::error ::Test error occurred on Windows MSVC build"

View File

@ -1,10 +0,0 @@
#!/bin/sh -ex
BUILDCACHE_VERSION="0.22.3"
choco install wget ninja
# Install buildcache
wget "https://github.com/mbitsnbites/buildcache/releases/download/v${BUILDCACHE_VERSION}/buildcache-win-mingw.zip"
7z x 'buildcache-win-mingw.zip'
mv ./buildcache/bin/buildcache.exe "/c/ProgramData/chocolatey/bin"
rm -rf ./buildcache/

View File

@ -1,134 +0,0 @@
name: citra-ci
on:
push:
branches: [ "*" ]
tags: [ "*" ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image: ["linux-clang-format", "linux-fresh", "linux-frozen", "linux-mingw"]
container: citraemu/build-environments:${{ matrix.image }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.image }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.image }}-
- name: Query tag name
uses: little-core-labs/get-git-tag@v3.0.2
id: tagName
- name: Build
run: ./.ci/${{ matrix.image }}/docker.sh
env:
ENABLE_COMPATIBILITY_REPORTING: "ON"
- name: Pack
run: ./.ci/${{ matrix.image }}/upload.sh
if: ${{ matrix.image != 'linux-frozen' && matrix.image != 'linux-clang-format' }}
env:
NAME: ${{ matrix.image }}
- name: Upload
uses: actions/upload-artifact@v2
if: ${{ matrix.image != 'linux-frozen' && matrix.image != 'linux-clang-format' }}
with:
name: ${{ matrix.image }}
path: artifacts/
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/Library/Caches/ccache
key: ${{ runner.os }}-macos-${{ github.sha }}
restore-keys: |
${{ runner.os }}-macos-
- name: Query tag name
uses: little-core-labs/get-git-tag@v3.0.2
id: tagName
- name: Install dependencies
run: ./.ci/macos/deps.sh
- name: Build
run: ./.ci/macos/build.sh
env:
MACOSX_DEPLOYMENT_TARGET: "10.13"
ENABLE_COMPATIBILITY_REPORTING: "ON"
- name: Pack
run: ./.ci/macos/upload.sh
- name: Upload
uses: actions/upload-artifact@v2
with:
name: macos
path: artifacts/
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.buildcache
key: ${{ runner.os }}-win-${{ github.sha }}
restore-keys: |
${{ runner.os }}-win-
- name: Install dependencies
run: ./.ci/windows-msvc/deps.sh
shell: bash
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: ./.ci/windows-msvc/build.sh
shell: bash
env:
ENABLE_COMPATIBILITY_REPORTING: "ON"
transifex:
runs-on: ubuntu-latest
container: citraemu/build-environments:linux-transifex
if: ${{ github.repository == 'citra-emu/citra' && !github.head_ref }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Update Translation
run: ./.ci/transifex/docker.sh
env:
TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
release:
runs-on: ubuntu-latest
needs: [build, macos]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/download-artifact@v2
- name: Query tag name
uses: little-core-labs/get-git-tag@v3.0.2
id: tagName
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tagName.outputs.tag }}
release_name: ${{ steps.tagName.outputs.tag }}
draft: false
prerelease: false
- name: Upload artifacts
uses: alexellis/upload-assets@0.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./**/*.tar.*","./**/*.7z","./**/*.zip"]'

2
.gitmodules vendored
View File

@ -12,7 +12,7 @@
url = https://github.com/philsquared/Catch.git url = https://github.com/philsquared/Catch.git
[submodule "dynarmic"] [submodule "dynarmic"]
path = externals/dynarmic path = externals/dynarmic
url = https://github.com/citra-emu/dynarmic.git url = https://github.com/citra-emu/dynarmic-android
[submodule "xbyak"] [submodule "xbyak"]
path = externals/xbyak path = externals/xbyak
url = https://github.com/herumi/xbyak.git url = https://github.com/herumi/xbyak.git

87
.travis.yml Normal file
View File

@ -0,0 +1,87 @@
language: cpp
matrix:
include:
- os: linux
env: NAME="clang-format"
sudo: required
dist: trusty
services: docker
install: "./.travis/clang-format/deps.sh"
script: "./.travis/clang-format/build.sh"
- os: linux
env: NAME="linux build"
sudo: required
dist: trusty
services: docker
addons:
apt:
packages:
- p7zip-full
install: "./.travis/linux/deps.sh"
script: "./.travis/linux/build.sh"
after_success: "./.travis/linux/upload.sh"
cache: ccache
- if: repo = citra-emu/citra AND branch = master AND type = push
os: linux
env: NAME="transifex push"
sudo: required
dist: trusty
services: docker
install: "./.travis/transifex/deps.sh"
script: "./.travis/transifex/build.sh"
- os: osx
env: NAME="macos build"
sudo: false
osx_image: xcode10
install: "./.travis/macos/deps.sh"
script: "./.travis/macos/build.sh"
after_success: "./.travis/macos/upload.sh"
cache: ccache
- os: linux
env: NAME="linux build (debug, frozen versions of dependencies, no additional CMake flags)"
sudo: required
dist: trusty
services: docker
cache: ccache
install: "./.travis/linux-frozen/deps.sh"
script: "./.travis/linux-frozen/build.sh"
- os: linux
env: NAME="MinGW build"
sudo: required
dist: trusty
services: docker
addons:
apt:
packages:
- p7zip-full
install: "./.travis/linux-mingw/deps.sh"
script: "./.travis/linux-mingw/build.sh"
after_success: "./.travis/linux-mingw/upload.sh"
cache: ccache
- if: repo =~ ^.*\/(citra-canary|citra-nightly)$ AND tag IS present
git:
depth: false
os: linux
env: NAME="flatpak build"
sudo: required
dist: trusty
services: docker
cache: ccache
install: "./.travis/linux-flatpak/deps.sh"
script: "./.travis/linux-flatpak/build.sh"
after_script: "./.travis/linux-flatpak/finish.sh"
deploy:
provider: releases
api_key:
secure: Mck15DIWaJdxDiS3aYVlM9N3G6y8VKUI1rnwII7/iolfm1s94U+tgvbheZDmT7SSbFyaGaYO/E8HrV/uZR9Vvs7ev20sHsTN1u60OTWfDIIyHs9SqjhcGbtq95m9/dMFschOYqTOR+gAs5BsxjuoeAotHdhpQEwvkO2oo5oR0zhGy45gjFnVvtcxT/IfpZBIpVgcK3aLb9zT6ekcJbSiPmEB15iLq3xXd0nFUNtEZdX3D6Veye4n5jB6n72qN8JVoKvPZAwaC2K0pZxpcGJaXDchLsw1q+4eCvdz6UJfUemeQ/uMAmjfeQ3wrzYGXe3nCM3WmX5wosCsB0mw4zYatzl3si6CZ1W+0GkV4Rwlx03dfp7v3EeFhTsXYCaXqhwuLZnWOLUik8t9vaSoFUx4nUIRwfO9kAMUJQSpLuHNO2nT01s3GxvqxzczuLQ9he5nGSi0RRodUzDwek1qUp6I4uV3gRHKz4B07YIc1i2fK88NLXjyQ0uLVZ+7Oq1+kgDp6+N7vvXXZ5qZ17tdaysSbKEE0Y8zsoXw7Rk1tPN19vrCS+TSpomNMyQyne1k+I5iZ/qkxPTLAS5qI6Utc2dL3GJdxWRAEfGNO9AIX3GV/jmmKfdcvwGsCYP8hxqs5vLYfgacw3D8NLf1941lQUwavC17jm9EV9g5G3Pn1Cp516E=
file_glob: true
file: "artifacts/*"
skip_cleanup: true
on:
tags: true
notifications:
webhooks:
urls:
- https://api.citra-emu.org/code/travis/notify

3
.travis/clang-format/deps.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh -ex
docker pull citraemu/build-environments:linux-clang-format

5
.travis/clang-format/docker.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -ex
# Run clang-format
cd /citra
./.travis/clang-format/script.sh

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \ if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* dist/*.desktop \
dist/*.svg dist/*.xml; then dist/*.svg dist/*.xml; then
echo Trailing whitespace found, aborting echo Trailing whitespace found, aborting
exit 1 exit 1

View File

@ -10,11 +10,11 @@ cp -r dist/scripting "$REV_NAME"
tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME" tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME"
# Find out what release we are building # Find out what release we are building
if [ -z $GIT_TAG_NAME ]; then if [ -z $TRAVIS_TAG ]; then
RELEASE_NAME=head RELEASE_NAME=head
else else
RELEASE_NAME=$(echo $GIT_TAG_NAME | cut -d- -f1) RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1)
if [ "$NAME" = "linux-mingw" ]; then if [ "$NAME" = "MinGW build" ]; then
RELEASE_NAME="${RELEASE_NAME}-mingw" RELEASE_NAME="${RELEASE_NAME}-mingw"
fi fi
fi fi

4
.travis/linux-flatpak/deps.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh -ex
# Download the docker image that contains flatpak build dependencies
docker pull citraemu/build-environments:linux-flatpak

View File

@ -87,8 +87,7 @@ cat > /tmp/org.citra.$REPO_NAME.json <<EOF
"-DENABLE_QT_TRANSLATION=ON", "-DENABLE_QT_TRANSLATION=ON",
"-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON", "-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON",
"-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON", "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON",
"-DENABLE_FFMPEG_VIDEO_DUMPER=ON", "-DENABLE_FFMPEG_VIDEO_DUMPER=ON"
"-DENABLE_FDK=ON"
], ],
"cleanup": [ "cleanup": [
"/bin/citra", "/bin/citra",

5
.travis/linux-frozen/deps.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh -ex
sudo apt-get -y install binutils-gold
docker pull citraemu/build-environments:linux-frozen

View File

@ -7,6 +7,7 @@ chmod a+x ~/bin/gold/ld
export CFLAGS="-B$HOME/bin/gold $CFLAGS" export CFLAGS="-B$HOME/bin/gold $CFLAGS"
export CXXFLAGS="-B$HOME/bin/gold $CXXFLAGS" export CXXFLAGS="-B$HOME/bin/gold $CXXFLAGS"
cd /citra
mkdir build && cd build mkdir build && cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++

3
.travis/linux-mingw/deps.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh -ex
docker pull citraemu/build-environments:linux-mingw

View File

@ -1,7 +1,7 @@
#!/bin/bash -ex #!/bin/bash -ex
# override CI ccache size cd /citra
mkdir -p "$HOME/.ccache/" # override Travis CI unreasonable ccache size
echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf" echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf"
mkdir build && cd build mkdir build && cd build
@ -27,4 +27,4 @@ cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/ cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
rm -f package/mediaservice/*d.dll rm -f package/mediaservice/*d.dll
python3 .ci/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/" python3 .travis/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/"

View File

@ -1,7 +1,4 @@
try: import pefile
import lief
except ImportError:
import pefile
import sys import sys
import re import re
import os import os
@ -22,20 +19,7 @@ DLL_PATH = [
missing = [] missing = []
def parse_imports_lief(filename):
results = []
pe = lief.parse(filename)
for entry in pe.imports:
name = entry.name
if name.upper() not in KNOWN_SYS_DLLS and not re.match(string=name, pattern=r'.*32\.DLL'):
results.append(name)
return results
def parse_imports(file_name): def parse_imports(file_name):
if globals().get('lief'):
return parse_imports_lief(file_name)
results = [] results = []
pe = pefile.PE(file_name, fast_load=True) pe = pefile.PE(file_name, fast_load=True)
pe.parse_data_directories() pe.parse_data_directories()

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
. .ci/common/pre-upload.sh . .travis/common/pre-upload.sh
REV_NAME="citra-windows-mingw-${GITDATE}-${GITREV}" REV_NAME="citra-windows-mingw-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.gz" ARCHIVE_NAME="${REV_NAME}.tar.gz"
@ -10,4 +10,4 @@ mkdir "$REV_NAME"
# get around the permission issues # get around the permission issues
cp -r package/* "$REV_NAME" cp -r package/* "$REV_NAME"
. .ci/common/post-upload.sh . .travis/common/post-upload.sh

3
.travis/linux/deps.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh -ex
docker pull citraemu/build-environments:linux-fresh

View File

@ -1,5 +1,7 @@
#!/bin/bash -ex #!/bin/bash -ex
cd /citra
mkdir build && cd build mkdir build && cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON
ninja ninja

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
. .ci/common/pre-upload.sh . .travis/common/pre-upload.sh
REV_NAME="citra-linux-${GITDATE}-${GITREV}" REV_NAME="citra-linux-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.xz" ARCHIVE_NAME="${REV_NAME}.tar.xz"
@ -16,4 +16,4 @@ cp build/bin/Release/citra-qt "$REV_NAME"
mkdir "$REV_NAME/dist" mkdir "$REV_NAME/dist"
cp dist/icon.png "$REV_NAME/dist/citra.png" cp dist/icon.png "$REV_NAME/dist/citra.png"
. .ci/common/post-upload.sh . .travis/common/post-upload.sh

24
.travis/macos/build.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash -ex
set -o pipefail
export MACOSX_DEPLOYMENT_TARGET=10.13
export Qt5_DIR=$(brew --prefix)/opt/qt5
export PATH="/usr/local/opt/ccache/libexec:/usr/local/opt/llvm/bin:$PATH"
export CC="clang"
export CXX="clang++"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_FFMPEG_AUDIO_DECODER=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON
# make -j4 takes more than 50 minutes when there is no ccache available on Travis CI
# and when Travis CI timeouts a job after 50 minutes it won't store any ccache get so far.
# To avoid to be stuck forever with failing build, gtimeout will stop make command before
# Travis CI timeouts, and this will allow Travis CI to successfully store any ccache get so far,
# and iterating this process, the ccache will build up till the make command will succeed.
# 50 minutes == 3000 seconds; ~1000 seconds are needed by deps.sh; hence:
gtimeout 1500 make -j4
ctest -VV -C Release

6
.travis/macos/deps.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh -ex
brew update
brew unlink python@2
brew install qt5 sdl2 p7zip ccache ffmpeg llvm
pip3 install macpack

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
. .ci/common/pre-upload.sh . .travis/common/pre-upload.sh
REV_NAME="citra-osx-${GITDATE}-${GITREV}" REV_NAME="citra-osx-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.gz" ARCHIVE_NAME="${REV_NAME}.tar.gz"
@ -20,14 +20,10 @@ $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/citra-qt.app" -executable=
# move libs into folder for deployment # move libs into folder for deployment
macpack "${REV_NAME}/citra" -d "libs" macpack "${REV_NAME}/citra" -d "libs"
# workaround for libc++
install_name_tool -change @loader_path/../Frameworks/libc++.1.0.dylib /usr/lib/libc++.1.dylib "${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt"
install_name_tool -change @loader_path/libs/libc++.1.0.dylib /usr/lib/libc++.1.dylib "${REV_NAME}/citra"
# Make the launching script executable # Make the launching script executable
chmod +x ${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt chmod +x ${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt
# Verify loader instructions # Verify loader instructions
find "$REV_NAME" -type f -exec otool -L {} \; find "$REV_NAME" -exec otool -L {} \;
. .ci/common/post-upload.sh . .travis/common/post-upload.sh

3
.travis/transifex/deps.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash -ex
docker pull citraemu/build-environments:linux-transifex

View File

@ -30,6 +30,7 @@ cmake --version
gcc -v gcc -v
tx --version tx --version
cd /citra
mkdir build && cd build mkdir build && cd build
cmake .. -DENABLE_QT_TRANSLATION=ON -DGENERATE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF cmake .. -DENABLE_QT_TRANSLATION=ON -DGENERATE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF
make translation make translation

View File

@ -21,9 +21,9 @@ get_timestamp(BUILD_DATE)
set(REPO_NAME "") set(REPO_NAME "")
set(BUILD_VERSION "0") set(BUILD_VERSION "0")
if (DEFINED ENV{CI}) if (DEFINED ENV{CI})
if (DEFINED ENV{GITHUB_ACTIONS}) if (DEFINED ENV{TRAVIS})
set(BUILD_REPOSITORY $ENV{GITHUB_REPOSITORY}) set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG})
set(BUILD_TAG $ENV{GIT_TAG_NAME}) set(BUILD_TAG $ENV{TRAVIS_TAG})
elseif(DEFINED ENV{APPVEYOR}) elseif(DEFINED ENV{APPVEYOR})
set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME})
set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME})

View File

@ -1,12 +0,0 @@
# buildcache wrapper
OPTION(USE_CCACHE "Use buildcache for compilation" OFF)
IF(USE_CCACHE)
FIND_PROGRAM(CCACHE buildcache)
IF (CCACHE)
MESSAGE(STATUS "Using buildcache found in PATH")
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
ELSE(CCACHE)
MESSAGE(WARNING "USE_CCACHE enabled, but no buildcache executable found")
ENDIF(CCACHE)
ENDIF(USE_CCACHE)

View File

@ -47,7 +47,7 @@ IF(NOT DEFINED ENV{MINGW_DEBUG_INFO})
MESSAGE("* WINDRES : ${WINDRES}") MESSAGE("* WINDRES : ${WINDRES}")
MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}") MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}")
MESSAGE("* STRIP : ${STRIP}") MESSAGE("* STRIP : ${STRIP}")
MESSAGE("* USE_CCACHE : ${USE_CCACHE}") MESSAGE("* USE_CCACHE : ${USE_CCACHE}")
MESSAGE("") MESSAGE("")
# So that the debug info only appears once # So that the debug info only appears once
SET(ENV{MINGW_DEBUG_INFO} SHOWN) SET(ENV{MINGW_DEBUG_INFO} SHOWN)

View File

@ -2,7 +2,8 @@
Citra Citra
============== ==============
[![GitHub Actions Build Status](https://github.com/citra-emu/citra/workflows/citra-ci/badge.svg)](https://github.com/citra-emu/citra/actions) [![Travis CI Build Status](https://travis-ci.com/citra-emu/citra.svg?branch=master)](https://travis-ci.com/citra-emu/citra)
[![AppVeyor CI Build Status](https://ci.appveyor.com/api/projects/status/sdf1o4kh3g1e68m9?svg=true)](https://ci.appveyor.com/project/bunnei/citra)
[![Bitrise CI Build Status](https://app.bitrise.io/app/4ccd8e5720f0d13b/status.svg?token=H32TmbCwxb3OQ-M66KbAyw&branch=master)](https://app.bitrise.io/app/4ccd8e5720f0d13b) [![Bitrise CI Build Status](https://app.bitrise.io/app/4ccd8e5720f0d13b/status.svg?token=H32TmbCwxb3OQ-M66KbAyw&branch=master)](https://app.bitrise.io/app/4ccd8e5720f0d13b)
[![Discord](https://img.shields.io/discord/220740965957107713?color=%237289DA&label=Citra&logo=discord&logoColor=white)](https://discord.gg/FAXfZV9) [![Discord](https://img.shields.io/discord/220740965957107713?color=%237289DA&label=Citra&logo=discord&logoColor=white)](https://discord.gg/FAXfZV9)

173
appveyor.yml Normal file
View File

@ -0,0 +1,173 @@
# shallow clone
clone_depth: 10
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
os: Visual Studio 2017
environment:
# Tell msys2 to add mingw64 to the path
MSYSTEM: MINGW64
# Tell msys2 to inherit the current directory when starting the shell
CHERE_INVOKING: 1
matrix:
- BUILD_TYPE: mingw
- BUILD_TYPE: msvc
platform:
- x64
configuration:
- Release
install:
- git submodule update --init --recursive
- ps: |
if ($env:BUILD_TYPE -eq 'mingw') {
$dependencies = "mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-qt5 mingw64/mingw-w64-x86_64-ffmpeg"
C:\msys64\usr\bin\bash -lc "pacman --noconfirm -U http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-SDL2-2.0.12-1-any.pkg.tar.xz"
C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S $dependencies"
# (HACK) ignore errors
0
}
before_build:
- mkdir %BUILD_TYPE%_build
- cd %BUILD_TYPE%_build
- ps: |
$COMPAT = if ($env:ENABLE_COMPATIBILITY_REPORTING -eq $null) {0} else {$env:ENABLE_COMPATIBILITY_REPORTING}
if ($env:BUILD_TYPE -eq 'msvc') {
# redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning
cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON .. 2>&1 && exit 0'
} else {
C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON .. 2>&1"
}
- cd ..
build_script:
- ps: |
if ($env:BUILD_TYPE -eq 'msvc') {
# https://www.appveyor.com/docs/build-phase
msbuild msvc_build/citra.sln /maxcpucount /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
} else {
C:\msys64\usr\bin\bash.exe -lc 'mingw32-make -j4 -C mingw_build/ 2>&1'
}
after_build:
- ps: |
$GITDATE = $(git show -s --date=short --format='%ad') -replace "-",""
$GITREV = $(git show -s --format='%h')
# Find out which kind of release we are producing by tag name
if ($env:APPVEYOR_REPO_TAG_NAME) {
$RELEASE_DIST, $RELEASE_VERSION = $env:APPVEYOR_REPO_TAG_NAME.split('-')
} else {
# There is no repo tag - make assumptions
$RELEASE_DIST = "head"
}
if ($env:BUILD_TYPE -eq 'msvc') {
# Where are these spaces coming from? Regardless, let's remove them
$MSVC_BUILD_ZIP = "citra-windows-msvc-$GITDATE-$GITREV.zip" -replace " ", ""
$MSVC_BUILD_PDB = "citra-windows-msvc-$GITDATE-$GITREV-debugsymbols.zip" -replace " ", ""
$MSVC_SEVENZIP = "citra-windows-msvc-$GITDATE-$GITREV.7z" -replace " ", ""
# set the build names as env vars so the artifacts can upload them
$env:BUILD_ZIP = $MSVC_BUILD_ZIP
$env:BUILD_SYMBOLS = $MSVC_BUILD_PDB
$env:BUILD_UPDATE = $MSVC_SEVENZIP
mkdir $RELEASE_DIST
Copy-Item .\msvc_build\bin\release\* -Destination $RELEASE_DIST -Recurse
Copy-Item .\license.txt -Destination $RELEASE_DIST
Copy-Item .\README.md -Destination $RELEASE_DIST
# process PDBs
. "./.appveyor/ProcessPdb.ps1"
7z a -tzip $MSVC_BUILD_PDB $RELEASE_DIST\*.pdb
rm $RELEASE_DIST\*.pdb
7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
7z a $MSVC_SEVENZIP $RELEASE_DIST
} else {
$MINGW_BUILD_ZIP = "citra-windows-mingw-$GITDATE-$GITREV.zip" -replace " ", ""
$MINGW_BUILD_PDB = "citra-windows-mingw-$GITDATE-$GITREV-debugsymbols.zip" -replace " ", ""
$MINGW_SEVENZIP = "citra-windows-mingw-$GITDATE-$GITREV.7z" -replace " ", ""
# store the build information in env vars so we can use them as artifacts
$env:BUILD_ZIP = $MINGW_BUILD_ZIP
$env:BUILD_SYMBOLS = $MINGW_BUILD_PDB
$env:BUILD_UPDATE = $MINGW_SEVENZIP
$CMAKE_SOURCE_DIR = "$env:APPVEYOR_BUILD_FOLDER"
$CMAKE_BINARY_DIR = "$CMAKE_SOURCE_DIR/mingw_build"
$RELEASE_DIST = $RELEASE_DIST + "-mingw"
mkdir $RELEASE_DIST
mkdir $RELEASE_DIST/platforms
mkdir $RELEASE_DIST/mediaservice
mkdir $RELEASE_DIST/styles
mkdir $RELEASE_DIST/imageformats
# copy the compiled binaries and other release files to the release folder
Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "citra*.exe" | Copy-Item -destination $RELEASE_DIST
Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
# copy the qt windows plugin dll to platforms
Copy-Item -path "C:/msys64/mingw64/share/qt5/plugins/platforms/qwindows.dll" -force -destination "$RELEASE_DIST/platforms"
# copy the qt mediaservice plugin dll
Copy-Item -path "C:/msys64/mingw64/share/qt5/plugins/mediaservice/dsengine.dll" -force -destination "$RELEASE_DIST/mediaservice"
# copy the qt windows vista style dll to platforms
Copy-Item -path "C:/msys64/mingw64/share/qt5/plugins/styles/qwindowsvistastyle.dll" -force -destination "$RELEASE_DIST/styles"
# copy the qt imageformats plugin dlls to imageformats
Get-ChildItem "C:/msys64/mingw64/share/qt5/plugins/imageformats" -Exclude "*d.dll" | Copy-Item -force -destination "$RELEASE_DIST/imageformats"
# copy all the dll dependencies to the release folder
. "./.appveyor/FindDependencies.ps1"
$DLLSearchPath = "C:\msys64\mingw64\bin;$env:PATH"
$MingwDLLs = RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\citra.exe"
$MingwDLLs += RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\citra-qt.exe"
$MingwDLLs += RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\imageformats\qjpeg.dll"
Write-Host "Detected the following dependencies:"
Write-Host $MingwDLLs
foreach ($file in $MingwDLLs) {
Copy-Item -path "$file" -force -destination "$RELEASE_DIST"
}
# process PDBs
. "./.appveyor/ProcessPdb.ps1"
7z a -tzip $MINGW_BUILD_PDB $RELEASE_DIST\*.pdb
rm $RELEASE_DIST\*.pdb
7z a -tzip $MINGW_BUILD_ZIP $RELEASE_DIST\*
7z a $MINGW_SEVENZIP $RELEASE_DIST
}
test_script:
- cd %BUILD_TYPE%_build
- ps: |
if ($env:BUILD_TYPE -eq 'msvc') {
ctest -VV -C Release
} else {
C:\msys64\usr\bin\bash.exe -lc "ctest -VV -C Release"
}
- cd ..
artifacts:
- path: $(BUILD_ZIP)
name: build
type: zip
- path: $(BUILD_SYMBOLS)
name: debugsymbols
- path: $(BUILD_UPDATE)
name: update
notifications:
- provider: Webhook
url: https://api.citra-emu.org/code/appveyor/notify

View File

@ -42,8 +42,8 @@ workflows:
The next change in your repository that matches any of your trigger map event will start **deploy** workflow. The next change in your repository that matches any of your trigger map event will start **deploy** workflow.
steps: steps:
- cache-pull@2.4.0: {} - cache-pull@2.0.1: {}
- script@1.1.6: - script@1.1.5:
title: Install newer cmake title: Install newer cmake
inputs: inputs:
- content: |- - content: |-
@ -52,7 +52,7 @@ workflows:
sudo apt remove cmake -y sudo apt remove cmake -y
sudo apt purge --auto-remove cmake -y sudo apt purge --auto-remove cmake -y
sudo apt install ninja-build -y sudo apt install ninja-build -y
version=3.19 version=3.10
build=2 build=2
mkdir ~/temp mkdir ~/temp
cd ~/temp cd ~/temp
@ -60,13 +60,13 @@ workflows:
sudo mkdir /opt/cmake sudo mkdir /opt/cmake
sudo sh cmake-$version.$build-Linux-x86_64.sh --prefix=/opt/cmake --skip-license --exclude-subdir sudo sh cmake-$version.$build-Linux-x86_64.sh --prefix=/opt/cmake --skip-license --exclude-subdir
envman add --key PATH --value "/opt/cmake/bin:$PATH" envman add --key PATH --value "/opt/cmake/bin:$PATH"
- install-missing-android-tools@2.3.8: - install-missing-android-tools@2.3.3:
inputs: inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew" - gradlew_path: "$PROJECT_LOCATION/gradlew"
- change-android-versioncode-and-versionname@1.1.1: - change-android-versioncode-and-versionname@1.1.1:
inputs: inputs:
- build_gradle_path: "$PROJECT_LOCATION/$MODULE/build.gradle" - build_gradle_path: "$PROJECT_LOCATION/$MODULE/build.gradle"
- android-lint@0.9.8: - android-lint@0.9.5:
inputs: inputs:
- project_location: "$PROJECT_LOCATION" - project_location: "$PROJECT_LOCATION"
- module: "$MODULE" - module: "$MODULE"
@ -76,19 +76,19 @@ workflows:
- project_location: "$PROJECT_LOCATION" - project_location: "$PROJECT_LOCATION"
- module: "$MODULE" - module: "$MODULE"
- variant: "$TEST_VARIANT" - variant: "$TEST_VARIANT"
- android-build@0.10.3: - android-build@0.9.5:
inputs: inputs:
- project_location: "$PROJECT_LOCATION" - project_location: "$PROJECT_LOCATION"
- module: "$MODULE" - module: "$MODULE"
- variant: "$BUILD_VARIANT" - variant: "$BUILD_VARIANT"
- sign-apk@1.2.3: - sign-apk@1.2.3:
run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}' run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}'
- deploy-to-bitrise-io@1.11.1: {} - deploy-to-bitrise-io@1.3.18: {}
- cache-push@2.4.1: {} - cache-push@2.0.5: {}
primary: primary:
steps: steps:
- cache-pull@2.4.0: {} - cache-pull@2.0.1: {}
- script@1.1.6: - script@1.1.5:
title: Install newer cmake title: Install newer cmake
inputs: inputs:
- content: |- - content: |-
@ -97,7 +97,7 @@ workflows:
sudo apt remove cmake -y sudo apt remove cmake -y
sudo apt purge --auto-remove cmake -y sudo apt purge --auto-remove cmake -y
sudo apt install ninja-build -y sudo apt install ninja-build -y
version=3.19 version=3.10
build=2 build=2
mkdir ~/temp mkdir ~/temp
cd ~/temp cd ~/temp
@ -105,20 +105,20 @@ workflows:
sudo mkdir /opt/cmake sudo mkdir /opt/cmake
sudo sh cmake-$version.$build-Linux-x86_64.sh --prefix=/opt/cmake --skip-license --exclude-subdir sudo sh cmake-$version.$build-Linux-x86_64.sh --prefix=/opt/cmake --skip-license --exclude-subdir
envman add --key PATH --value "/opt/cmake/bin:$PATH" envman add --key PATH --value "/opt/cmake/bin:$PATH"
- install-missing-android-tools@2.3.8: - install-missing-android-tools@2.3.3:
inputs: inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew" - gradlew_path: "$PROJECT_LOCATION/gradlew"
- android-lint@0.9.8: - android-lint@0.9.5:
inputs: inputs:
- project_location: "$PROJECT_LOCATION" - project_location: "$PROJECT_LOCATION"
- module: "$MODULE" - module: "$MODULE"
- variant: "$TEST_VARIANT" - variant: "$TEST_VARIANT"
- android-build@0.10.3: - android-build@0.9.5:
inputs: inputs:
- variant: Debug - variant: Debug
- project_location: "$PROJECT_LOCATION" - project_location: "$PROJECT_LOCATION"
- deploy-to-bitrise-io@1.11.1: {} - deploy-to-bitrise-io@1.3.18: {}
- cache-push@2.4.1: {} - cache-push@2.0.5: {}
app: app:
envs: envs:
- opts: - opts:

File diff suppressed because it is too large Load Diff

506
dist/languages/de.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

550
dist/languages/fi.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

506
dist/languages/fr.ts vendored

File diff suppressed because it is too large Load Diff

5549
dist/languages/hu_HU.ts vendored Normal file

File diff suppressed because it is too large Load Diff

518
dist/languages/id.ts vendored

File diff suppressed because it is too large Load Diff

506
dist/languages/it.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

506
dist/languages/nb.ts vendored

File diff suppressed because it is too large Load Diff

506
dist/languages/nl.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -30,20 +30,13 @@ target_include_directories(catch-single-include INTERFACE catch/single_include)
# Crypto++ # Crypto++
add_subdirectory(cryptopp) add_subdirectory(cryptopp)
# Xbyak
if (ARCHITECTURE_x86_64)
add_library(xbyak INTERFACE)
target_include_directories(xbyak SYSTEM INTERFACE ./xbyak/xbyak)
target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
endif()
# Dynarmic # Dynarmic
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_ARM64) # Dynarmic will skip defining xbyak if it's already defined, we then define it below
set(DYNARMIC_TESTS OFF) add_library(xbyak INTERFACE)
set(DYNARMIC_NO_BUNDLED_FMT ON) option(DYNARMIC_TESTS OFF)
set(DYNARMIC_FRONTENDS "A32") set(DYNARMIC_NO_BUNDLED_FMT ON)
add_subdirectory(dynarmic) set(DYNARMIC_FRONTENDS "A32")
endif() add_subdirectory(dynarmic)
# libfmt # libfmt
add_subdirectory(fmt) add_subdirectory(fmt)
@ -79,9 +72,17 @@ target_include_directories(SoundTouch INTERFACE ./soundtouch/include)
# Teakra # Teakra
add_subdirectory(teakra EXCLUDE_FROM_ALL) add_subdirectory(teakra EXCLUDE_FROM_ALL)
# Xbyak
if (ARCHITECTURE_x86_64)
# Defined before "dynarmic" above
# add_library(xbyak INTERFACE)
target_include_directories(xbyak INTERFACE ./xbyak/xbyak)
target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
endif()
# Zstandard # Zstandard
add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL) add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL)
target_include_directories(libzstd_static INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/externals/zstd/lib>) target_include_directories(libzstd_static INTERFACE ./zstd/lib)
# ENet # ENet
add_subdirectory(enet) add_subdirectory(enet)

2
externals/catch vendored

@ -1 +1 @@
Subproject commit de6fe184a9ac1a06895cdd1c9b437f0a0bdf14ad Subproject commit 15cf3caaceb21172ea42a24e595a2eb58c3ec960

2
externals/cubeb vendored

@ -1 +1 @@
Subproject commit 1d66483ad2b93f0e00e175f9480c771af90003a7 Subproject commit 616d773441b5355800ce64197a699e6cd6b36172

2
externals/dynarmic vendored

@ -1 +1 @@
Subproject commit 358cf6f0357baae3e3bb5788431acf1068f897b5 Subproject commit adeb4940dd3ca92677bd3c3b0ce1ec6174493b00

2
externals/fmt vendored

@ -1 +1 @@
Subproject commit cc09f1a6798c085c325569ef466bcdcffdc266d4 Subproject commit cd4af11efc9c622896a3e4cb599fa28668ca3d05

2
externals/inih/inih vendored

@ -1 +1 @@
Subproject commit 1e80a47dffbda813604f0913e2ad68c7054c14e4 Subproject commit 2023872dfffb38b6a98f2c45a0eb25652aaea91f

View File

@ -1,9 +1,9 @@
JSON for Modern C++ JSON for Modern C++
=================== ===================
v3.9.0 v3.1.2
This is a mirror providing the single required header file. This is a mirror providing the single required header file.
The original repository can be found at: The original repository can be found at:
https://github.com/nlohmann/json/commit/d34771cafc87b358ba421faca28facc7f8080174 https://github.com/nlohmann/json/commit/d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe

18467
externals/json/json.hpp vendored

File diff suppressed because it is too large Load Diff

View File

@ -152,11 +152,9 @@ typedef uint16_t MicroProfileGroupId;
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <algorithm>
#include <array>
#include <atomic>
#include <mutex>
#include <thread> #include <thread>
#include <mutex>
#include <atomic>
#ifndef MICROPROFILE_API #ifndef MICROPROFILE_API
#define MICROPROFILE_API #define MICROPROFILE_API
@ -607,45 +605,28 @@ struct MicroProfileFrameState
struct MicroProfileThreadLog struct MicroProfileThreadLog
{ {
std::array<MicroProfileLogEntry, MICROPROFILE_BUFFER_SIZE> Log{}; MicroProfileLogEntry Log[MICROPROFILE_BUFFER_SIZE];
std::atomic<uint32_t> nPut{0}; std::atomic<uint32_t> nPut;
std::atomic<uint32_t> nGet{0}; std::atomic<uint32_t> nGet;
uint32_t nActive = 0; uint32_t nActive;
uint32_t nGpu = 0; uint32_t nGpu;
ThreadIdType nThreadId{}; ThreadIdType nThreadId;
std::array<uint32_t, MICROPROFILE_STACK_MAX> nStack{}; uint32_t nStack[MICROPROFILE_STACK_MAX];
std::array<int64_t, MICROPROFILE_STACK_MAX> nChildTickStack{}; int64_t nChildTickStack[MICROPROFILE_STACK_MAX];
uint32_t nStackPos = 0; uint32_t nStackPos;
std::array<uint8_t, MICROPROFILE_MAX_GROUPS> nGroupStackPos{}; uint8_t nGroupStackPos[MICROPROFILE_MAX_GROUPS];
std::array<int64_t, MICROPROFILE_MAX_GROUPS> nGroupTicks{}; int64_t nGroupTicks[MICROPROFILE_MAX_GROUPS];
std::array<int64_t, MICROPROFILE_MAX_GROUPS> nAggregateGroupTicks{}; int64_t nAggregateGroupTicks[MICROPROFILE_MAX_GROUPS];
enum enum
{ {
THREAD_MAX_LEN = 64, THREAD_MAX_LEN = 64,
}; };
char ThreadName[64]{}; char ThreadName[64];
int nFreeListNext = 0; int nFreeListNext;
void Reset() {
Log.fill({});
nPut = 0;
nGet = 0;
nActive = 0;
nGpu = 0;
nThreadId = {};
nStack.fill(0);
nChildTickStack.fill(0);
nStackPos = 0;
nGroupStackPos.fill(0);
nGroupTicks.fill(0);
nAggregateGroupTicks.fill(0);
std::fill(std::begin(ThreadName), std::end(ThreadName), '\0');
nFreeListNext = 0;
}
}; };
#if MICROPROFILE_GPU_TIMERS_D3D11 #if MICROPROFILE_GPU_TIMERS_D3D11
@ -946,11 +927,7 @@ typedef HANDLE MicroProfileThread;
DWORD _stdcall ThreadTrampoline(void* pFunc) DWORD _stdcall ThreadTrampoline(void* pFunc)
{ {
MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc; MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc;
return (uint32_t)F(0);
// The return value of F will always return a void*, however, this is for
// compatibility with pthreads. The underlying "address" of the pointer
// is always a 32-bit value, so this cast is safe to perform.
return static_cast<DWORD>(reinterpret_cast<uint64_t>(F(0)));
} }
void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func)
@ -1041,7 +1018,7 @@ static void MicroProfileCreateThreadLogKey()
#else #else
MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0; MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0;
#endif #endif
static std::atomic<bool> g_bUseLock{false}; /// This is used because windows does not support using mutexes under dll init(which is where global initialization is handled) static bool g_bUseLock = false; /// This is used because windows does not support using mutexes under dll init(which is where global initialization is handled)
MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee); MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee);
@ -1174,7 +1151,6 @@ MicroProfileThreadLog* MicroProfileCreateThreadLog(const char* pName)
MP_ASSERT(pLog->nPut.load() == 0); MP_ASSERT(pLog->nPut.load() == 0);
MP_ASSERT(pLog->nGet.load() == 0); MP_ASSERT(pLog->nGet.load() == 0);
S.nFreeListHead = S.Pool[S.nFreeListHead]->nFreeListNext; S.nFreeListHead = S.Pool[S.nFreeListHead]->nFreeListNext;
pLog->Reset();
} }
else else
{ {
@ -1182,6 +1158,7 @@ MicroProfileThreadLog* MicroProfileCreateThreadLog(const char* pName)
S.nMemUsage += sizeof(MicroProfileThreadLog); S.nMemUsage += sizeof(MicroProfileThreadLog);
S.Pool[S.nNumLogs++] = pLog; S.Pool[S.nNumLogs++] = pLog;
} }
memset(pLog, 0, sizeof(*pLog));
int len = (int)strlen(pName); int len = (int)strlen(pName);
int maxlen = sizeof(pLog->ThreadName)-1; int maxlen = sizeof(pLog->ThreadName)-1;
len = len < maxlen ? len : maxlen; len = len < maxlen ? len : maxlen;
@ -1229,8 +1206,8 @@ void MicroProfileOnThreadExit()
{ {
S.Frames[i].nLogStart[nLogIndex] = 0; S.Frames[i].nLogStart[nLogIndex] = 0;
} }
pLog->nGroupStackPos.fill(0); memset(pLog->nGroupStackPos, 0, sizeof(pLog->nGroupStackPos));
pLog->nGroupTicks.fill(0); memset(pLog->nGroupTicks, 0, sizeof(pLog->nGroupTicks));
} }
} }

View File

@ -169,13 +169,14 @@ MICROPROFILEUI_API void MicroProfileCustomGroup(const char* pCustomName, uint32_
MICROPROFILEUI_API void MicroProfileCustomGroupAddTimer(const char* pCustomName, const char* pGroup, const char* pTimer); MICROPROFILEUI_API void MicroProfileCustomGroupAddTimer(const char* pCustomName, const char* pGroup, const char* pTimer);
#ifdef MICROPROFILEUI_IMPL #ifdef MICROPROFILEUI_IMPL
#include <inttypes.h> #ifdef _WIN32
#define snprintf _snprintf
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <math.h> #include <math.h>
#include <algorithm> #include <algorithm>
#include <array>
MICROPROFILE_DEFINE(g_MicroProfileDetailed, "MicroProfile", "Detailed View", 0x8888000); MICROPROFILE_DEFINE(g_MicroProfileDetailed, "MicroProfile", "Detailed View", 0x8888000);
MICROPROFILE_DEFINE(g_MicroProfileDrawGraph, "MicroProfile", "Draw Graph", 0xff44ee00); MICROPROFILE_DEFINE(g_MicroProfileDrawGraph, "MicroProfile", "Draw Graph", 0xff44ee00);
@ -226,10 +227,10 @@ struct SOptionDesc
uint8_t nIndex; uint8_t nIndex;
bool bSelected; bool bSelected;
}; };
static const std::array<uint32_t, 6> g_MicroProfileAggregatePresets{0, 10, 20, 30, 60, 120}; static uint32_t g_MicroProfileAggregatePresets[] = {0, 10, 20, 30, 60, 120};
static const std::array<float, 10> g_MicroProfileReferenceTimePresets{5.f, 10.f, 15.f,20.f, 33.33f, 66.66f, 100.f, 250.f, 500.f, 1000.f}; static float g_MicroProfileReferenceTimePresets[] = {5.f, 10.f, 15.f,20.f, 33.33f, 66.66f, 100.f, 250.f, 500.f, 1000.f};
static const std::array<uint32_t, 4> g_MicroProfileOpacityPresets{0x40, 0x80, 0xc0, 0xff}; static uint32_t g_MicroProfileOpacityPresets[] = {0x40, 0x80, 0xc0, 0xff};
static const std::array<const char*, 7> g_MicroProfilePresetNames static const char* g_MicroProfilePresetNames[] =
{ {
MICROPROFILE_DEFAULT_PRESET, MICROPROFILE_DEFAULT_PRESET,
"Render", "Render",
@ -242,8 +243,8 @@ static const std::array<const char*, 7> g_MicroProfilePresetNames
enum enum
{ {
MICROPROFILE_NUM_REFERENCE_PRESETS = g_MicroProfileReferenceTimePresets.size(), MICROPROFILE_NUM_REFERENCE_PRESETS = sizeof(g_MicroProfileReferenceTimePresets)/sizeof(g_MicroProfileReferenceTimePresets[0]),
MICROPROFILE_NUM_OPACITY_PRESETS = g_MicroProfileOpacityPresets.size(), MICROPROFILE_NUM_OPACITY_PRESETS = sizeof(g_MicroProfileOpacityPresets)/sizeof(g_MicroProfileOpacityPresets[0]),
#if MICROPROFILE_CONTEXT_SWITCH_TRACE #if MICROPROFILE_CONTEXT_SWITCH_TRACE
MICROPROFILE_OPTION_SIZE = MICROPROFILE_NUM_REFERENCE_PRESETS + MICROPROFILE_NUM_OPACITY_PRESETS * 2 + 2 + 7, MICROPROFILE_OPTION_SIZE = MICROPROFILE_NUM_REFERENCE_PRESETS + MICROPROFILE_NUM_OPACITY_PRESETS * 2 + 2 + 7,
#else #else
@ -325,9 +326,9 @@ struct MicroProfileUI
MicroProfileUI g_MicroProfileUI; MicroProfileUI g_MicroProfileUI;
#define UI g_MicroProfileUI #define UI g_MicroProfileUI
static const std::array<uint32_t, 2> g_nMicroProfileBackColors{ 0x474747, 0x313131 }; static uint32_t g_nMicroProfileBackColors[2] = { 0x474747, 0x313131 };
#define MICROPROFILE_NUM_CONTEXT_SWITCH_COLORS 16 #define MICROPROFILE_NUM_CONTEXT_SWITCH_COLORS 16
static const std::array<uint32_t, MICROPROFILE_NUM_CONTEXT_SWITCH_COLORS> g_nMicroProfileContextSwitchThreadColors //palette generated by http://tools.medialab.sciences-po.fr/iwanthue/index.php static uint32_t g_nMicroProfileContextSwitchThreadColors[MICROPROFILE_NUM_CONTEXT_SWITCH_COLORS] = //palette generated by http://tools.medialab.sciences-po.fr/iwanthue/index.php
{ {
0x63607B, 0x63607B,
0x755E2B, 0x755E2B,
@ -355,7 +356,7 @@ void MicroProfileInitUI()
{ {
bInitialized = true; bInitialized = true;
memset(&g_MicroProfileUI, 0, sizeof(g_MicroProfileUI)); memset(&g_MicroProfileUI, 0, sizeof(g_MicroProfileUI));
UI.nActiveMenu = UINT32_MAX; UI.nActiveMenu = (uint32_t)-1;
UI.fDetailedOffsetTarget = UI.fDetailedOffset = 0.f; UI.fDetailedOffsetTarget = UI.fDetailedOffset = 0.f;
UI.fDetailedRangeTarget = UI.fDetailedRange = 50.f; UI.fDetailedRangeTarget = UI.fDetailedRange = 50.f;
@ -367,7 +368,7 @@ void MicroProfileInitUI()
UI.nWidth = 100; UI.nWidth = 100;
UI.nHeight = 100; UI.nHeight = 100;
UI.nCustomActive = UINT32_MAX; UI.nCustomActive = (uint32_t)-1;
UI.nCustomTimerCount = 0; UI.nCustomTimerCount = 0;
UI.nCustomCount = 0; UI.nCustomCount = 0;
@ -497,8 +498,8 @@ void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppString
{ {
MicroProfileDrawBox(nX-MICROPROFILE_TEXT_WIDTH, nY, nX, nY + MICROPROFILE_TEXT_WIDTH, pColors[i]|0xff000000); MicroProfileDrawBox(nX-MICROPROFILE_TEXT_WIDTH, nY, nX, nY + MICROPROFILE_TEXT_WIDTH, pColors[i]|0xff000000);
} }
MicroProfileDrawText(nX + 1, nY + 1, UINT32_MAX, ppStrings[i0], (uint32_t)strlen(ppStrings[i0])); MicroProfileDrawText(nX + 1, nY + 1, (uint32_t)-1, ppStrings[i0], (uint32_t)strlen(ppStrings[i0]));
MicroProfileDrawText(nX + nWidth - nStringLengths[i0+1] * (MICROPROFILE_TEXT_WIDTH+1), nY + 1, UINT32_MAX, ppStrings[i0+1], (uint32_t)strlen(ppStrings[i0+1])); MicroProfileDrawText(nX + nWidth - nStringLengths[i0+1] * (MICROPROFILE_TEXT_WIDTH+1), nY + 1, (uint32_t)-1, ppStrings[i0+1], (uint32_t)strlen(ppStrings[i0+1]));
nY += (MICROPROFILE_TEXT_HEIGHT+1); nY += (MICROPROFILE_TEXT_HEIGHT+1);
} }
} }
@ -521,7 +522,7 @@ void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, u
MicroProfileDrawBox(nX, nY, nX + nWidth, nY + nHeight, 0xff000000); MicroProfileDrawBox(nX, nY, nX + nWidth, nY + nHeight, 0xff000000);
for(uint32_t i = 0; i < nNumStrings; ++i) for(uint32_t i = 0; i < nNumStrings; ++i)
{ {
MicroProfileDrawText(nX + 1, nY + 1, UINT32_MAX, ppStrings[i], (uint32_t)strlen(ppStrings[i])); MicroProfileDrawText(nX + 1, nY + 1, (uint32_t)-1, ppStrings[i], (uint32_t)strlen(ppStrings[i]));
nY += (MICROPROFILE_TEXT_HEIGHT+1); nY += (MICROPROFILE_TEXT_HEIGHT+1);
} }
} }
@ -780,7 +781,7 @@ void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId,
{ {
MicroProfile& S = *MicroProfileGet(); MicroProfile& S = *MicroProfileGet();
int64_t nTickIn = -1; int64_t nTickIn = -1;
uint32_t nThreadBefore = UINT32_MAX; uint32_t nThreadBefore = -1;
float fToMs = MicroProfileTickToMsMultiplier(MicroProfileTicksPerSecondCpu()); float fToMs = MicroProfileTickToMsMultiplier(MicroProfileTicksPerSecondCpu());
float fMsToScreen = UI.nWidth / UI.fDetailedRange; float fMsToScreen = UI.nWidth / UI.fDetailedRange;
float fMouseX = (float)UI.nMouseX; float fMouseX = (float)UI.nMouseX;
@ -948,10 +949,10 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
uint32_t nContextSwitchHoverThreadAfter = S.nContextSwitchHoverThreadAfter; uint32_t nContextSwitchHoverThreadAfter = S.nContextSwitchHoverThreadAfter;
uint32_t nContextSwitchHoverThreadBefore = S.nContextSwitchHoverThreadBefore; uint32_t nContextSwitchHoverThreadBefore = S.nContextSwitchHoverThreadBefore;
S.nContextSwitchHoverThread = S.nContextSwitchHoverThreadAfter = S.nContextSwitchHoverThreadBefore = UINT32_MAX; S.nContextSwitchHoverThread = S.nContextSwitchHoverThreadAfter = S.nContextSwitchHoverThreadBefore = -1;
uint32_t nContextSwitchStart = UINT32_MAX; uint32_t nContextSwitchStart = -1;
uint32_t nContextSwitchEnd = UINT32_MAX; uint32_t nContextSwitchEnd = -1;
S.nContextSwitchHoverCpuNext = 0xff; S.nContextSwitchHoverCpuNext = 0xff;
S.nContextSwitchHoverTickIn = -1; S.nContextSwitchHoverTickIn = -1;
S.nContextSwitchHoverTickOut = -1; S.nContextSwitchHoverTickOut = -1;
@ -1004,10 +1005,9 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
}while(pFrameLogFirst != pFrameFirst); }while(pFrameLogFirst != pFrameFirst);
if (nGet == UINT32_MAX) { if(nGet == (uint32_t)-1)
continue; continue;
} MP_ASSERT(nGet != (uint32_t)-1);
MP_ASSERT(nGet != UINT32_MAX);
nPut = pFrameLogLast->nLogStart[i]; nPut = pFrameLogLast->nLogStart[i];
@ -1023,9 +1023,9 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
int64_t nBaseTicks = bGpu ? nBaseTicksGpu : nBaseTicksCpu; int64_t nBaseTicks = bGpu ? nBaseTicksGpu : nBaseTicksCpu;
char ThreadName[MicroProfileThreadLog::THREAD_MAX_LEN + 16]; char ThreadName[MicroProfileThreadLog::THREAD_MAX_LEN + 16];
uint64_t nThreadId = pLog->nThreadId; uint64_t nThreadId = pLog->nThreadId;
snprintf(ThreadName, sizeof(ThreadName)-1, "%04" PRIx64 ": %s", nThreadId, &pLog->ThreadName[0] ); snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx: %s", nThreadId, &pLog->ThreadName[0] );
nY += 3; nY += 3;
uint32_t nThreadColor = UINT32_MAX; uint32_t nThreadColor = -1;
if(pLog->nThreadId == nContextSwitchHoverThreadAfter || pLog->nThreadId == nContextSwitchHoverThreadBefore) if(pLog->nThreadId == nContextSwitchHoverThreadAfter || pLog->nThreadId == nContextSwitchHoverThreadBefore)
nThreadColor = UI.nHoverColorShared|0x906060; nThreadColor = UI.nHoverColorShared|0x906060;
MicroProfileDrawText(0, nY, nThreadColor, &ThreadName[0], (uint32_t)strlen(&ThreadName[0])); MicroProfileDrawText(0, nY, nThreadColor, &ThreadName[0], (uint32_t)strlen(&ThreadName[0]));
@ -1048,7 +1048,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
uint32_t nEnd = nRange[j][1]; uint32_t nEnd = nRange[j][1];
for(uint32_t k = nStart; k < nEnd; ++k) for(uint32_t k = nStart; k < nEnd; ++k)
{ {
MicroProfileLogEntry* pEntry = &pLog->Log[k]; MicroProfileLogEntry* pEntry = pLog->Log + k;
int nType = MicroProfileLogType(*pEntry); int nType = MicroProfileLogType(*pEntry);
if(MP_LOG_ENTER == nType) if(MP_LOG_ENTER == nType)
{ {
@ -1066,7 +1066,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
continue; continue;
} }
MicroProfileLogEntry* pEntryEnter = &pLog->Log[nStack[nStackPos-1]]; MicroProfileLogEntry* pEntryEnter = pLog->Log + nStack[nStackPos-1];
if(MicroProfileLogTimerIndex(*pEntryEnter) != MicroProfileLogTimerIndex(*pEntry)) if(MicroProfileLogTimerIndex(*pEntryEnter) != MicroProfileLogTimerIndex(*pEntry))
{ {
//uprintf("mismatch %llx %llx\n", pEntryEnter->nToken, pEntry->nToken); //uprintf("mismatch %llx %llx\n", pEntryEnter->nToken, pEntry->nToken);
@ -1126,7 +1126,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
uint32_t nIntegerWidth = (uint32_t)(fXEnd - fXStart); uint32_t nIntegerWidth = (uint32_t)(fXEnd - fXStart);
if(nIntegerWidth) if(nIntegerWidth)
{ {
if(bHover && UI.nActiveMenu == UINT32_MAX) if(bHover && UI.nActiveMenu == -1)
{ {
nHoverToken = MicroProfileLogTimerIndex(*pEntry); nHoverToken = MicroProfileLogTimerIndex(*pEntry);
#if MICROPROFILE_DEBUG #if MICROPROFILE_DEBUG
@ -1146,7 +1146,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
int nCharacters = (nTextWidth - 2*MICROPROFILE_TEXT_WIDTH) / MICROPROFILE_TEXT_WIDTH; int nCharacters = (nTextWidth - 2*MICROPROFILE_TEXT_WIDTH) / MICROPROFILE_TEXT_WIDTH;
if(nCharacters>0) if(nCharacters>0)
{ {
MicroProfileDrawText(fXStartText + 1, fYStart + 1, UINT32_MAX, S.TimerInfo[nTimerIndex].pName, MicroProfileMin<uint32_t>(S.TimerInfo[nTimerIndex].nNameLen, nCharacters)); MicroProfileDrawText(fXStartText+1, fYStart+1, -1, S.TimerInfo[nTimerIndex].pName, MicroProfileMin<uint32_t>(S.TimerInfo[nTimerIndex].nNameLen, nCharacters));
} }
} }
#endif #endif
@ -1158,7 +1158,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
int nLineX = (int)floor(fXAvg+0.5f); int nLineX = (int)floor(fXAvg+0.5f);
if(nLineX != (int)nLinesDrawn[nStackPos]) if(nLineX != (int)nLinesDrawn[nStackPos])
{ {
if(bHover && UI.nActiveMenu == UINT32_MAX) if(bHover && UI.nActiveMenu == -1)
{ {
nHoverToken = (uint32_t)MicroProfileLogTimerIndex(*pEntry); nHoverToken = (uint32_t)MicroProfileLogTimerIndex(*pEntry);
nHoverTime = MicroProfileLogTickDifference(nTickStart, nTickEnd); nHoverTime = MicroProfileLogTickDifference(nTickStart, nTickEnd);
@ -1235,9 +1235,9 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
// nThreadId is 32-bit on Windows // nThreadId is 32-bit on Windows
int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04x: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04x: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) );
#else #else
int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04" PRIx64 ": %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) );
#endif #endif
uint32_t nThreadColor = UINT32_MAX; uint32_t nThreadColor = -1;
if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore) if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore)
nThreadColor = UI.nHoverColorShared|0x906060; nThreadColor = UI.nHoverColorShared|0x906060;
MicroProfileDrawDetailedContextSwitchBars(nY+2, nThreadId, nContextSwitchStart, nContextSwitchEnd, nBaseTicksCpu, nBaseY); MicroProfileDrawDetailedContextSwitchBars(nY+2, nThreadId, nContextSwitchStart, nContextSwitchEnd, nBaseTicksCpu, nBaseY);
@ -1249,6 +1249,9 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
S.nContextSwitchHoverCpu = S.nContextSwitchHoverCpuNext; S.nContextSwitchHoverCpu = S.nContextSwitchHoverCpuNext;
UI.pDisplayMouseOver = pMouseOverNext; UI.pDisplayMouseOver = pMouseOverNext;
if(!S.nRunning) if(!S.nRunning)
@ -1283,10 +1286,10 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
float fStartTextWidth = (float)((1+MICROPROFILE_TEXT_WIDTH) * nLenStart); float fStartTextWidth = (float)((1+MICROPROFILE_TEXT_WIDTH) * nLenStart);
float fStartTextX = fXStart - fStartTextWidth - 2; float fStartTextX = fXStart - fStartTextWidth - 2;
MicroProfileDrawBox(fStartTextX, nBaseY, fStartTextX + fStartTextWidth + 2, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawBox(fStartTextX, nBaseY, fStartTextX + fStartTextWidth + 2, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat);
MicroProfileDrawText(fStartTextX+1, nBaseY, UINT32_MAX, sBuffer, nLenStart); MicroProfileDrawText(fStartTextX+1, nBaseY, (uint32_t)-1, sBuffer, nLenStart);
uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd); uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd);
MicroProfileDrawBox(fXEnd+1, nBaseY, fXEnd+1+(1+MICROPROFILE_TEXT_WIDTH) * nLenEnd + 3, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawBox(fXEnd+1, nBaseY, fXEnd+1+(1+MICROPROFILE_TEXT_WIDTH) * nLenEnd + 3, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat);
MicroProfileDrawText(fXEnd+2, nBaseY+1, UINT32_MAX, sBuffer, nLenEnd); MicroProfileDrawText(fXEnd+2, nBaseY+1, (uint32_t)-1, sBuffer, nLenEnd);
if(UI.nMouseRight) if(UI.nMouseRight)
{ {
@ -1313,10 +1316,10 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
float fStartTextWidth = (float)((1+MICROPROFILE_TEXT_WIDTH) * nLenStart); float fStartTextWidth = (float)((1+MICROPROFILE_TEXT_WIDTH) * nLenStart);
float fStartTextX = fXStart - fStartTextWidth - 2; float fStartTextX = fXStart - fStartTextWidth - 2;
MicroProfileDrawBox(fStartTextX, nBaseY, fStartTextX + fStartTextWidth + 2, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawBox(fStartTextX, nBaseY, fStartTextX + fStartTextWidth + 2, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat);
MicroProfileDrawText(fStartTextX+1, nBaseY, UINT32_MAX, sBuffer, nLenStart); MicroProfileDrawText(fStartTextX+1, nBaseY, (uint32_t)-1, sBuffer, nLenStart);
uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd); uint32_t nLenEnd = snprintf(sBuffer, sizeof(sBuffer)-1, "%.2fms", fMsEnd);
MicroProfileDrawBox(fXEnd+1, nBaseY, fXEnd+1+(1+MICROPROFILE_TEXT_WIDTH) * nLenEnd + 3, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat); MicroProfileDrawBox(fXEnd+1, nBaseY, fXEnd+1+(1+MICROPROFILE_TEXT_WIDTH) * nLenEnd + 3, MICROPROFILE_TEXT_HEIGHT + 2 + nBaseY, 0x33000000, MicroProfileBoxTypeFlat);
MicroProfileDrawText(fXEnd+2, nBaseY+1, UINT32_MAX, sBuffer, nLenEnd); MicroProfileDrawText(fXEnd+2, nBaseY+1, (uint32_t)-1, sBuffer, nLenEnd);
} }
} }
} }
@ -1362,7 +1365,7 @@ void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uin
fBaseX = fXStart; fBaseX = fXStart;
uint32_t nColor = MICROPROFILE_FRAME_HISTORY_COLOR_CPU; uint32_t nColor = MICROPROFILE_FRAME_HISTORY_COLOR_CPU;
if(nIndex == nSelectedFrame) if(nIndex == nSelectedFrame)
nColor = UINT32_MAX; nColor = (uint32_t)-1;
MicroProfileDrawBox(fXStart, nBaseY + fScale * nBarHeight, fXEnd, nBaseY+MICROPROFILE_FRAME_HISTORY_HEIGHT, nColor, MicroProfileBoxTypeBar); MicroProfileDrawBox(fXStart, nBaseY + fScale * nBarHeight, fXEnd, nBaseY+MICROPROFILE_FRAME_HISTORY_HEIGHT, nColor, MicroProfileBoxTypeBar);
if(pNext->nFrameStartCpu > nCpuStart) if(pNext->nFrameStartCpu > nCpuStart)
{ {
@ -1384,7 +1387,7 @@ void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight)
uint32_t nBaseY = MICROPROFILE_TEXT_HEIGHT + 1; uint32_t nBaseY = MICROPROFILE_TEXT_HEIGHT + 1;
int nSelectedFrame = -1; int nSelectedFrame = -1;
if(UI.nMouseY > nBaseY && UI.nMouseY <= nBaseY + MICROPROFILE_FRAME_HISTORY_HEIGHT && UI.nActiveMenu == UINT32_MAX) if(UI.nMouseY > nBaseY && UI.nMouseY <= nBaseY + MICROPROFILE_FRAME_HISTORY_HEIGHT && UI.nActiveMenu == -1)
{ {
nSelectedFrame = ((MICROPROFILE_NUM_FRAMES) * (UI.nWidth-UI.nMouseX) / UI.nWidth); nSelectedFrame = ((MICROPROFILE_NUM_FRAMES) * (UI.nWidth-UI.nMouseX) / UI.nWidth);
@ -1422,7 +1425,7 @@ void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName)
if(pName) if(pName)
{ {
MicroProfileDrawBox(nX-8, MICROPROFILE_TEXT_HEIGHT + 2, nX + nWidth+5, MICROPROFILE_TEXT_HEIGHT + 2 + (MICROPROFILE_TEXT_HEIGHT+1), 0xff000000|g_nMicroProfileBackColors[1]); MicroProfileDrawBox(nX-8, MICROPROFILE_TEXT_HEIGHT + 2, nX + nWidth+5, MICROPROFILE_TEXT_HEIGHT + 2 + (MICROPROFILE_TEXT_HEIGHT+1), 0xff000000|g_nMicroProfileBackColors[1]);
MicroProfileDrawText(nX, MICROPROFILE_TEXT_HEIGHT + 2, UINT32_MAX, pName, (uint32_t)strlen(pName)); MicroProfileDrawText(nX, MICROPROFILE_TEXT_HEIGHT + 2, (uint32_t)-1, pName, (uint32_t)strlen(pName));
} }
} }
@ -1437,7 +1440,7 @@ void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName,
uint32_t nCount = 0; uint32_t nCount = 0;
for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j) for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j)
{ {
uint64_t nMask = 1ULL << j; uint64_t nMask = 1ll << j;
if(nMask & nGroup) if(nMask & nGroup)
{ {
nY += MICROPROFILE_TEXT_HEIGHT + 1; nY += MICROPROFILE_TEXT_HEIGHT + 1;
@ -1518,7 +1521,7 @@ void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float*
} }
} }
} }
nMask <<= 1; nMask <<= 1ll;
} }
} }
@ -1540,7 +1543,7 @@ void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t n
snprintf(sBuffer, SBUF_MAX-1, "%5.2f", pTimers[nIdx]); snprintf(sBuffer, SBUF_MAX-1, "%5.2f", pTimers[nIdx]);
if (!pTimers2) if (!pTimers2)
MicroProfileDrawBox(nX + nTextWidth, nY, nX + nTextWidth + fWidth * pTimers[nIdx+1], nY + nHeight, UI.nOpacityForeground|S.TimerInfo[nTimer].nColor, MicroProfileBoxTypeBar); MicroProfileDrawBox(nX + nTextWidth, nY, nX + nTextWidth + fWidth * pTimers[nIdx+1], nY + nHeight, UI.nOpacityForeground|S.TimerInfo[nTimer].nColor, MicroProfileBoxTypeBar);
MicroProfileDrawText(nX, nY, UINT32_MAX, sBuffer, (uint32_t)strlen(sBuffer)); MicroProfileDrawText(nX, nY, (uint32_t)-1, sBuffer, (uint32_t)strlen(sBuffer));
} }
@ -1561,7 +1564,7 @@ void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64
MicroProfile& S = *MicroProfileGet(); MicroProfile& S = *MicroProfileGet();
char sBuffer[SBUF_MAX]; char sBuffer[SBUF_MAX];
int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5d", S.Frame[nTimer].nCount);//fix int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5d", S.Frame[nTimer].nCount);//fix
MicroProfileDrawText(nX, nY, UINT32_MAX, sBuffer, nLen); MicroProfileDrawText(nX, nY, (uint32_t)-1, sBuffer, nLen);
} }
uint32_t MicroProfileDrawBarCallCount(int32_t nX, int32_t nY, const char* pName) uint32_t MicroProfileDrawBarCallCount(int32_t nX, int32_t nY, const char* pName)
@ -1585,7 +1588,7 @@ void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint
float fRcpFrames = pArgs->fRcpFrames; float fRcpFrames = pArgs->fRcpFrames;
char sBuffer[SBUF_MAX]; char sBuffer[SBUF_MAX];
int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5.2f", pCounters[nTimer] * fRcpFrames); int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5.2f", pCounters[nTimer] * fRcpFrames);
MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, UINT32_MAX, sBuffer, nLen); MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen);
} }
uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight)
@ -1606,8 +1609,8 @@ void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64
{ {
uint64_t* pCounters = (uint64_t*)pExtra; uint64_t* pCounters = (uint64_t*)pExtra;
char sBuffer[SBUF_MAX]; char sBuffer[SBUF_MAX];
int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5" PRIu64, pCounters[nTimer]); int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5llu", pCounters[nTimer]);
MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, UINT32_MAX, sBuffer, nLen); MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen);
} }
uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight)
@ -1664,7 +1667,7 @@ bool MicroProfileDrawGraph(uint32_t nScreenWidth, uint32_t nScreenHeight)
if(bMouseOver) if(bMouseOver)
{ {
float fXAvg = fMouseXPrc * MICROPROFILE_GRAPH_WIDTH + nX; float fXAvg = fMouseXPrc * MICROPROFILE_GRAPH_WIDTH + nX;
MicroProfileDrawLineVertical(fXAvg, nY, nY + MICROPROFILE_GRAPH_HEIGHT, UINT32_MAX); MicroProfileDrawLineVertical(fXAvg, nY, nY + MICROPROFILE_GRAPH_HEIGHT, (uint32_t)-1);
} }
@ -1703,7 +1706,7 @@ bool MicroProfileDrawGraph(uint32_t nScreenWidth, uint32_t nScreenHeight)
char buf[32]; char buf[32];
int nLen = snprintf(buf, sizeof(buf)-1, "%5.2fms", S.fReferenceTime); int nLen = snprintf(buf, sizeof(buf)-1, "%5.2fms", S.fReferenceTime);
MicroProfileDrawText(nX+1, fY1 - (2+MICROPROFILE_TEXT_HEIGHT), UINT32_MAX, buf, nLen); MicroProfileDrawText(nX+1, fY1 - (2+MICROPROFILE_TEXT_HEIGHT), (uint32_t)-1, buf, nLen);
} }
@ -1779,7 +1782,7 @@ void MicroProfileDumpTimers()
for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j) for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j)
{ {
uint64_t nMask = 1ULL << j; uint64_t nMask = 1ll << j;
if(nMask & nActiveGroup) if(nMask & nActiveGroup)
{ {
MICROPROFILE_PRINTF("%s\n", S.GroupInfo[j].pName); MICROPROFILE_PRINTF("%s\n", S.GroupInfo[j].pName);
@ -1820,7 +1823,7 @@ void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight)
uint32_t nNumGroups = 0; uint32_t nNumGroups = 0;
for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j) for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j)
{ {
if(nActiveGroup & (1ULL << j)) if(nActiveGroup & (1ll << j))
{ {
nNumTimers += S.GroupInfo[j].nNumTimers; nNumTimers += S.GroupInfo[j].nNumTimers;
nNumGroups += 1; nNumGroups += 1;
@ -1875,7 +1878,7 @@ void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight)
for(uint32_t i = 0; i < nNumTimers+nNumGroups+1; ++i) for(uint32_t i = 0; i < nNumTimers+nNumGroups+1; ++i)
{ {
uint32_t nY0 = nY + i * (nHeight + 1); uint32_t nY0 = nY + i * (nHeight + 1);
bool bInside = (UI.nActiveMenu == UINT32_MAX) && ((UI.nMouseY >= nY0) && (UI.nMouseY < (nY0 + nHeight + 1))); bool bInside = (UI.nActiveMenu == -1) && ((UI.nMouseY >= nY0) && (UI.nMouseY < (nY0 + nHeight + 1)));
MicroProfileDrawBox(nX, nY0, nWidth+nX, nY0 + (nHeight+1)+1, UI.nOpacityBackground | (g_nMicroProfileBackColors[nColorIndex++ & 1] + ((bInside) ? 0x002c2c2c : 0))); MicroProfileDrawBox(nX, nY0, nWidth+nX, nY0 + (nHeight+1)+1, UI.nOpacityBackground | (g_nMicroProfileBackColors[nColorIndex++ & 1] + ((bInside) ? 0x002c2c2c : 0)));
} }
nX += 10; nX += 10;
@ -1924,22 +1927,22 @@ void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight)
nY = nHeight + 3 - UI.nOffsetY; nY = nHeight + 3 - UI.nOffsetY;
for(uint32_t i = 0; i < nNumTimers+nNumGroups+1; ++i) for(uint32_t i = 0; i < nNumTimers+nNumGroups+1; ++i)
{ {
const uint32_t nY0 = nY + i * (nHeight + 1); uint32_t nY0 = nY + i * (nHeight + 1);
const bool bInside = (UI.nActiveMenu == UINT32_MAX) && ((UI.nMouseY >= nY0) && (UI.nMouseY < (nY0 + nHeight + 1))); bool bInside = (UI.nActiveMenu == -1) && ((UI.nMouseY >= nY0) && (UI.nMouseY < (nY0 + nHeight + 1)));
MicroProfileDrawBox(nX, nY0, nTimerWidth, nY0 + (nHeight+1)+1, 0xff0000000 | (g_nMicroProfileBackColors[nColorIndex++ & 1] + ((bInside) ? 0x002c2c2c : 0))); MicroProfileDrawBox(nX, nY0, nTimerWidth, nY0 + (nHeight+1)+1, 0xff0000000 | (g_nMicroProfileBackColors[nColorIndex++ & 1] + ((bInside) ? 0x002c2c2c : 0)));
} }
nX += MicroProfileDrawBarLegend(nX, nY, nTotalHeight, nTimerWidth-5) + 1; nX += MicroProfileDrawBarLegend(nX, nY, nTotalHeight, nTimerWidth-5) + 1;
for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j) for(uint32_t j = 0; j < MICROPROFILE_MAX_GROUPS; ++j)
{ {
if(nActiveGroup & (1ULL << j)) if(nActiveGroup & (1ll << j))
{ {
MicroProfileDrawText(nX, nY + (1+nHeight) * nLegendOffset, UINT32_MAX, S.GroupInfo[j].pName, S.GroupInfo[j].nNameLen); MicroProfileDrawText(nX, nY + (1+nHeight) * nLegendOffset, (uint32_t)-1, S.GroupInfo[j].pName, S.GroupInfo[j].nNameLen);
nLegendOffset += S.GroupInfo[j].nNumTimers+1; nLegendOffset += S.GroupInfo[j].nNumTimers+1;
} }
} }
MicroProfileDrawHeader(nX, nTimerWidth-5, "Group"); MicroProfileDrawHeader(nX, nTimerWidth-5, "Group");
MicroProfileDrawTextRight(nTimerWidth-3, MICROPROFILE_TEXT_HEIGHT + 2, UINT32_MAX, "Timer", 5); MicroProfileDrawTextRight(nTimerWidth-3, MICROPROFILE_TEXT_HEIGHT + 2, (uint32_t)-1, "Timer", 5);
MicroProfileDrawLineVertical(nTimerWidth, 0, nTotalHeight+nY, UI.nOpacityBackground|g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]); MicroProfileDrawLineVertical(nTimerWidth, 0, nTotalHeight+nY, UI.nOpacityBackground|g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]);
MicroProfileDrawLineHorizontal(0, nWidth, 2*MICROPROFILE_TEXT_HEIGHT + 3, UI.nOpacityBackground|g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]); MicroProfileDrawLineHorizontal(0, nWidth, 2*MICROPROFILE_TEXT_HEIGHT + 3, UI.nOpacityBackground|g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]);
} }
@ -2000,7 +2003,7 @@ const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected)
} }
else else
{ {
*bSelected = 0 != (S.nActiveGroupWanted & (1ULL << Item.nIndex)); *bSelected = 0 != (S.nActiveGroupWanted & (1ll << Item.nIndex));
snprintf(buffer, sizeof(buffer)-1, " %s", Item.pName); snprintf(buffer, sizeof(buffer)-1, " %s", Item.pName);
} }
return buffer; return buffer;
@ -2012,18 +2015,16 @@ const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected)
const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected) const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected)
{ {
MicroProfile& S = *MicroProfileGet(); MicroProfile& S = *MicroProfileGet();
if(static_cast<uint32_t>(nIndex) < g_MicroProfileAggregatePresets.size()) if(nIndex < sizeof(g_MicroProfileAggregatePresets)/sizeof(g_MicroProfileAggregatePresets[0]))
{ {
uint32_t val = g_MicroProfileAggregatePresets[nIndex]; int val = g_MicroProfileAggregatePresets[nIndex];
*bSelected = S.nAggregateFlip == val; *bSelected = (int)S.nAggregateFlip == val;
if (0 == val) if(0 == val)
{
return "Infinite"; return "Infinite";
}
else else
{ {
static char buf[128]; static char buf[128];
snprintf(buf, sizeof(buf)-1, "%7u", val); snprintf(buf, sizeof(buf)-1, "%7d", val);
return buf; return buf;
} }
} }
@ -2097,13 +2098,11 @@ const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected)
{ {
static char buf[128]; static char buf[128];
*bSelected = false; *bSelected = false;
int nNumPresets = static_cast<int>(g_MicroProfilePresetNames.size()); int nNumPresets = sizeof(g_MicroProfilePresetNames) / sizeof(g_MicroProfilePresetNames[0]);
int nIndexSave = nIndex - nNumPresets - 1; int nIndexSave = nIndex - nNumPresets - 1;
if (nIndex == nNumPresets) if(nIndex == nNumPresets)
{
return "--"; return "--";
} else if(nIndexSave >=0 && nIndexSave <nNumPresets)
else if(nIndexSave >=0 && nIndexSave < nNumPresets)
{ {
snprintf(buf, sizeof(buf)-1, "Save '%s'", g_MicroProfilePresetNames[nIndexSave]); snprintf(buf, sizeof(buf)-1, "Save '%s'", g_MicroProfilePresetNames[nIndexSave]);
return buf; return buf;
@ -2121,13 +2120,13 @@ const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected)
const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected) const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected)
{ {
if(UINT32_MAX == UI.nCustomActive) if((uint32_t)-1 == UI.nCustomActive)
{ {
*bSelected = nIndex == 0; *bSelected = nIndex == 0;
} }
else else
{ {
*bSelected = nIndex-2 == static_cast<int>(UI.nCustomActive); *bSelected = nIndex-2 == UI.nCustomActive;
} }
switch(nIndex) switch(nIndex)
{ {
@ -2203,7 +2202,7 @@ void MicroProfileUIClickGroups(int nIndex)
else else
{ {
MP_ASSERT(Item.nIndex < S.nGroupCount); MP_ASSERT(Item.nIndex < S.nGroupCount);
S.nActiveGroupWanted ^= (1ULL << Item.nIndex); S.nActiveGroupWanted ^= (1ll << Item.nIndex);
} }
} }
} }
@ -2274,7 +2273,7 @@ void MicroProfileUIClickOptions(int nIndex)
void MicroProfileUIClickPreset(int nIndex) void MicroProfileUIClickPreset(int nIndex)
{ {
int nNumPresets = static_cast<int>(g_MicroProfilePresetNames.size()); int nNumPresets = sizeof(g_MicroProfilePresetNames) / sizeof(g_MicroProfilePresetNames[0]);
int nIndexSave = nIndex - nNumPresets - 1; int nIndexSave = nIndex - nNumPresets - 1;
if(nIndexSave >= 0 && nIndexSave < nNumPresets) if(nIndexSave >= 0 && nIndexSave < nNumPresets)
{ {
@ -2311,7 +2310,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
uint32_t nX = 0; uint32_t nX = 0;
uint32_t nY = 0; uint32_t nY = 0;
bool bMouseOver = UI.nMouseY < MICROPROFILE_TEXT_HEIGHT + 1;
#define SBUF_SIZE 256 #define SBUF_SIZE 256
char buffer[256]; char buffer[256];
MicroProfileDrawBox(nX, nY, nX + nWidth, nY + (MICROPROFILE_TEXT_HEIGHT+1)+1, 0xff000000|g_nMicroProfileBackColors[1]); MicroProfileDrawBox(nX, nY, nX + nWidth, nY + (MICROPROFILE_TEXT_HEIGHT+1)+1, 0xff000000|g_nMicroProfileBackColors[1]);
@ -2322,7 +2321,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
uint32_t nNumMenuItems = 0; uint32_t nNumMenuItems = 0;
int nLen = snprintf(buffer, 127, "MicroProfile"); int nLen = snprintf(buffer, 127, "MicroProfile");
MicroProfileDrawText(nX, nY, UINT32_MAX, buffer, nLen); MicroProfileDrawText(nX, nY, (uint32_t)-1, buffer, nLen);
nX += (sizeof("MicroProfile")+2) * (MICROPROFILE_TEXT_WIDTH+1); nX += (sizeof("MicroProfile")+2) * (MICROPROFILE_TEXT_WIDTH+1);
pMenuText[nNumMenuItems++] = "Mode"; pMenuText[nNumMenuItems++] = "Mode";
pMenuText[nNumMenuItems++] = "Groups"; pMenuText[nNumMenuItems++] = "Groups";
@ -2410,7 +2409,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
}; };
uint32_t nSelectMenu = UINT32_MAX; uint32_t nSelectMenu = (uint32_t)-1;
for(uint32_t i = 0; i < nNumMenuItems; ++i) for(uint32_t i = 0; i < nNumMenuItems; ++i)
{ {
nMenuX[i] = nX; nMenuX[i] = nX;
@ -2420,17 +2419,17 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
{ {
MicroProfileDrawBox(nX-1, nY, nX + nLen * (MICROPROFILE_TEXT_WIDTH+1), nY +(MICROPROFILE_TEXT_HEIGHT+1)+1, 0xff888888); MicroProfileDrawBox(nX-1, nY, nX + nLen * (MICROPROFILE_TEXT_WIDTH+1), nY +(MICROPROFILE_TEXT_HEIGHT+1)+1, 0xff888888);
nSelectMenu = i; nSelectMenu = i;
if((UI.nMouseLeft || UI.nMouseRight) && i == (uint32_t)nPauseIndex) if((UI.nMouseLeft || UI.nMouseRight) && i == (int)nPauseIndex)
{ {
S.nToggleRunning = 1; S.nToggleRunning = 1;
} }
} }
MicroProfileDrawText(nX, nY, UINT32_MAX, pMenuText[i], (uint32_t)strlen(pMenuText[i])); MicroProfileDrawText(nX, nY, (uint32_t)-1, pMenuText[i], (uint32_t)strlen(pMenuText[i]));
nX += (nLen+1) * (MICROPROFILE_TEXT_WIDTH+1); nX += (nLen+1) * (MICROPROFILE_TEXT_WIDTH+1);
} }
uint32_t nMenu = nSelectMenu != UINT32_MAX ? nSelectMenu : UI.nActiveMenu; uint32_t nMenu = nSelectMenu != (uint32_t)-1 ? nSelectMenu : UI.nActiveMenu;
UI.nActiveMenu = nMenu; UI.nActiveMenu = nMenu;
if(UINT32_MAX != nMenu) if((uint32_t)-1 != nMenu)
{ {
nX = nMenuX[nMenu]; nX = nMenuX[nMenu];
nY += MICROPROFILE_TEXT_HEIGHT+1; nY += MICROPROFILE_TEXT_HEIGHT+1;
@ -2451,9 +2450,9 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
{ {
UI.nActiveMenu = nMenu; UI.nActiveMenu = nMenu;
} }
else if(nSelectMenu == UINT32_MAX) else if(nSelectMenu == (uint32_t)-1)
{ {
UI.nActiveMenu = UINT32_MAX; UI.nActiveMenu = (uint32_t)-1;
} }
MicroProfileDrawBox(nX, nY, nX + nWidth, nY + nHeight, 0xff000000|g_nMicroProfileBackColors[1]); MicroProfileDrawBox(nX, nY, nX + nWidth, nY + nHeight, 0xff000000|g_nMicroProfileBackColors[1]);
for(int i = 0; i < nNumLines; ++i) for(int i = 0; i < nNumLines; ++i)
@ -2462,6 +2461,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
const char* pString = CB(i, &bSelected); const char* pString = CB(i, &bSelected);
if(UI.nMouseY >= nY && UI.nMouseY < nY + MICROPROFILE_TEXT_HEIGHT + 1) if(UI.nMouseY >= nY && UI.nMouseY < nY + MICROPROFILE_TEXT_HEIGHT + 1)
{ {
bMouseOver = true;
if(UI.nMouseLeft || UI.nMouseRight) if(UI.nMouseLeft || UI.nMouseRight)
{ {
CBClick[nMenu](i); CBClick[nMenu](i);
@ -2469,7 +2469,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
MicroProfileDrawBox(nX, nY, nX + nWidth, nY + MICROPROFILE_TEXT_HEIGHT + 1, 0xff888888); MicroProfileDrawBox(nX, nY, nX + nWidth, nY + MICROPROFILE_TEXT_HEIGHT + 1, 0xff888888);
} }
int nLen = snprintf(buffer, SBUF_SIZE-1, "%c %s", bSelected ? '*' : ' ' ,pString); int nLen = snprintf(buffer, SBUF_SIZE-1, "%c %s", bSelected ? '*' : ' ' ,pString);
MicroProfileDrawText(nX, nY, UINT32_MAX, buffer, nLen); MicroProfileDrawText(nX, nY, (uint32_t)-1, buffer, nLen);
nY += MICROPROFILE_TEXT_HEIGHT+1; nY += MICROPROFILE_TEXT_HEIGHT+1;
} }
} }
@ -2484,7 +2484,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight)
float fMaxMs = fToMs * S.nFlipMaxDisplay; float fMaxMs = fToMs * S.nFlipMaxDisplay;
int nLen = snprintf(FrameTimeMessage, sizeof(FrameTimeMessage)-1, "Time[%6.2f] Avg[%6.2f] Max[%6.2f]", fMs, fAverageMs, fMaxMs); int nLen = snprintf(FrameTimeMessage, sizeof(FrameTimeMessage)-1, "Time[%6.2f] Avg[%6.2f] Max[%6.2f]", fMs, fAverageMs, fMaxMs);
pMenuText[nNumMenuItems++] = &FrameTimeMessage[0]; pMenuText[nNumMenuItems++] = &FrameTimeMessage[0];
MicroProfileDrawText(nWidth - nLen * (MICROPROFILE_TEXT_WIDTH+1), 0, UINT32_MAX, FrameTimeMessage, nLen); MicroProfileDrawText(nWidth - nLen * (MICROPROFILE_TEXT_WIDTH+1), 0, -1, FrameTimeMessage, nLen);
} }
} }
@ -2538,7 +2538,7 @@ void MicroProfileMoveGraph()
void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight) void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
{ {
if(UINT32_MAX != UI.nCustomActive) if((uint32_t)-1 != UI.nCustomActive)
{ {
MicroProfile& S = *MicroProfileGet(); MicroProfile& S = *MicroProfileGet();
MP_ASSERT(UI.nCustomActive < MICROPROFILE_CUSTOM_MAX); MP_ASSERT(UI.nCustomActive < MICROPROFILE_CUSTOM_MAX);
@ -2571,8 +2571,8 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
pColors[i] = S.TimerInfo[nTimerIndex].nColor; pColors[i] = S.TimerInfo[nTimerIndex].nColor;
} }
MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING + 3*MICROPROFILE_TEXT_WIDTH, nOffsetY, UINT32_MAX, "Avg", sizeof("Avg")-1); MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING + 3*MICROPROFILE_TEXT_WIDTH, nOffsetY, (uint32_t)-1, "Avg", sizeof("Avg")-1);
MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING + 13*MICROPROFILE_TEXT_WIDTH, nOffsetY, UINT32_MAX, "Max", sizeof("Max")-1); MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING + 13*MICROPROFILE_TEXT_WIDTH, nOffsetY, (uint32_t)-1, "Max", sizeof("Max")-1);
for(uint32_t i = 0; i < nCount; ++i) for(uint32_t i = 0; i < nCount; ++i)
{ {
nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT); nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT);
@ -2582,10 +2582,10 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
int nSize; int nSize;
uint32_t nOffsetX = MICROPROFILE_CUSTOM_PADDING; uint32_t nOffsetX = MICROPROFILE_CUSTOM_PADDING;
nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2f", pTimeAvg[i]); nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2f", pTimeAvg[i]);
MicroProfileDrawText(nOffsetX, nOffsetY, UINT32_MAX, Buffer, nSize); MicroProfileDrawText(nOffsetX, nOffsetY, (uint32_t)-1, Buffer, nSize);
nOffsetX += (nSize+2) * (MICROPROFILE_TEXT_WIDTH+1); nOffsetX += (nSize+2) * (MICROPROFILE_TEXT_WIDTH+1);
nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2f", pTimeMax[i]); nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2f", pTimeMax[i]);
MicroProfileDrawText(nOffsetX, nOffsetY, UINT32_MAX, Buffer, nSize); MicroProfileDrawText(nOffsetX, nOffsetY, (uint32_t)-1, Buffer, nSize);
nOffsetX += (nSize+2) * (MICROPROFILE_TEXT_WIDTH+1); nOffsetX += (nSize+2) * (MICROPROFILE_TEXT_WIDTH+1);
nSize = snprintf(Buffer, sizeof(Buffer)-1, "%s:%s", S.GroupInfo[nGroupIndex].pName, pTimerInfo->pName); nSize = snprintf(Buffer, sizeof(Buffer)-1, "%s:%s", S.GroupInfo[nGroupIndex].pName, pTimerInfo->pName);
MicroProfileDrawText(nOffsetX, nOffsetY, pTimerInfo->nColor, Buffer, nSize); MicroProfileDrawText(nOffsetX, nOffsetY, pTimerInfo->nColor, Buffer, nSize);
@ -2599,9 +2599,9 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
nOffsetY = nOffsetYBase; nOffsetY = nOffsetYBase;
float* pMs = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? pTimeMax : pTimeAvg; float* pMs = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? pTimeMax : pTimeAvg;
const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? "Max" : "Avg"; const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? "Max" : "Avg";
MicroProfileDrawText(nMaxOffsetX, nOffsetY, UINT32_MAX, pString, static_cast<uint32_t>(strlen(pString))); MicroProfileDrawText(nMaxOffsetX, nOffsetY, (uint32_t)-1, pString, strlen(pString));
int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference); int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference);
MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, UINT32_MAX, Buffer, nSize); MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, (uint32_t)-1, Buffer, nSize);
for(uint32_t i = 0; i < nCount; ++i) for(uint32_t i = 0; i < nCount; ++i)
{ {
nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT); nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT);
@ -2613,9 +2613,9 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
{ {
nOffsetY += 2*(1+MICROPROFILE_TEXT_HEIGHT); nOffsetY += 2*(1+MICROPROFILE_TEXT_HEIGHT);
const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_STACK_SOURCE_MAX ? "Max" : "Avg"; const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_STACK_SOURCE_MAX ? "Max" : "Avg";
MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING, nOffsetY, UINT32_MAX, pString, static_cast<uint32_t>(strlen(pString))); MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING, nOffsetY, (uint32_t)-1, pString, strlen(pString));
int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference); int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference);
MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, UINT32_MAX, Buffer, nSize); MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, (uint32_t)-1, Buffer, nSize);
nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT); nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT);
float fPosX = MICROPROFILE_CUSTOM_PADDING; float fPosX = MICROPROFILE_CUSTOM_PADDING;
float* pMs = pCustom->nFlags & MICROPROFILE_CUSTOM_STACK_SOURCE_MAX ? pTimeMax : pTimeAvg; float* pMs = pCustom->nFlags & MICROPROFILE_CUSTOM_STACK_SOURCE_MAX ? pTimeMax : pTimeAvg;
@ -2668,7 +2668,7 @@ void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight)
UI.nHoverTime = 0; UI.nHoverTime = 0;
UI.nHoverFrame = -1; UI.nHoverFrame = -1;
if(S.nDisplay != MP_DRAW_DETAILED) if(S.nDisplay != MP_DRAW_DETAILED)
S.nContextSwitchHoverThread = S.nContextSwitchHoverThreadAfter = S.nContextSwitchHoverThreadBefore = UINT32_MAX; S.nContextSwitchHoverThread = S.nContextSwitchHoverThreadAfter = S.nContextSwitchHoverThreadBefore = -1;
MicroProfileMoveGraph(); MicroProfileMoveGraph();
@ -2798,13 +2798,13 @@ void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight)
if(UI.nActiveMenu == UINT32_MAX && !bMouseOverGraph) if(UI.nActiveMenu == -1 && !bMouseOverGraph)
{ {
if(UI.nHoverToken != MICROPROFILE_INVALID_TOKEN) if(UI.nHoverToken != MICROPROFILE_INVALID_TOKEN)
{ {
MicroProfileDrawFloatTooltip(UI.nMouseX, UI.nMouseY, UI.nHoverToken, UI.nHoverTime); MicroProfileDrawFloatTooltip(UI.nMouseX, UI.nMouseY, UI.nHoverToken, UI.nHoverTime);
} }
else if(S.nContextSwitchHoverThreadAfter != UINT32_MAX && S.nContextSwitchHoverThreadBefore != UINT32_MAX) else if(S.nContextSwitchHoverThreadAfter != -1 && S.nContextSwitchHoverThreadBefore != -1)
{ {
float fToMs = MicroProfileTickToMsMultiplier(MicroProfileTicksPerSecondCpu()); float fToMs = MicroProfileTickToMsMultiplier(MicroProfileTicksPerSecondCpu());
MicroProfileStringArray ToolTip; MicroProfileStringArray ToolTip;
@ -2820,7 +2820,7 @@ void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight)
MicroProfileStringArrayFormat(&ToolTip, "%6.2fms", fToMs * nDifference ); MicroProfileStringArrayFormat(&ToolTip, "%6.2fms", fToMs * nDifference );
MicroProfileStringArrayAddLiteral(&ToolTip, "CPU"); MicroProfileStringArrayAddLiteral(&ToolTip, "CPU");
MicroProfileStringArrayFormat(&ToolTip, "%d", S.nContextSwitchHoverCpu); MicroProfileStringArrayFormat(&ToolTip, "%d", S.nContextSwitchHoverCpu);
MicroProfileDrawFloatWindow(UI.nMouseX, UI.nMouseY+20, &ToolTip.ppStrings[0], ToolTip.nNumStrings, UINT32_MAX); MicroProfileDrawFloatWindow(UI.nMouseX, UI.nMouseY+20, &ToolTip.ppStrings[0], ToolTip.nNumStrings, -1);
} }
@ -2858,7 +2858,7 @@ void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight)
} }
} }
#endif #endif
MicroProfileDrawFloatWindow(UI.nMouseX, UI.nMouseY+20, &ToolTip.ppStrings[0], ToolTip.nNumStrings, UINT32_MAX); MicroProfileDrawFloatWindow(UI.nMouseX, UI.nMouseY+20, &ToolTip.ppStrings[0], ToolTip.nNumStrings, -1);
} }
if(UI.nMouseLeft) if(UI.nMouseLeft)
{ {
@ -2883,7 +2883,7 @@ void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight)
#endif #endif
m.unlock(); m.unlock();
} }
else if(UI.nCustomActive != UINT32_MAX) else if(UI.nCustomActive != (uint32_t)-1)
{ {
std::recursive_mutex& m = MicroProfileGetMutex(); std::recursive_mutex& m = MicroProfileGetMutex();
m.lock(); m.lock();
@ -3179,7 +3179,7 @@ void MicroProfileLoadPreset(const char* pSuffix)
{ {
if(0 == MP_STRCASECMP(pGroupName, S.GroupInfo[j].pName)) if(0 == MP_STRCASECMP(pGroupName, S.GroupInfo[j].pName))
{ {
S.nActiveGroupWanted |= (1ULL << j); S.nActiveGroupWanted |= (1ll << j);
} }
} }
} }
@ -3212,7 +3212,7 @@ void MicroProfileLoadPreset(const char* pSuffix)
uint64_t nGroupIndex = S.TimerInfo[j].nGroupIndex; uint64_t nGroupIndex = S.TimerInfo[j].nGroupIndex;
if(0 == MP_STRCASECMP(pGraphName, S.TimerInfo[j].pName) && 0 == MP_STRCASECMP(pGraphGroupName, S.GroupInfo[nGroupIndex].pName)) if(0 == MP_STRCASECMP(pGraphName, S.TimerInfo[j].pName) && 0 == MP_STRCASECMP(pGraphGroupName, S.GroupInfo[nGroupIndex].pName))
{ {
MicroProfileToken nToken = MicroProfileMakeToken(1ULL << nGroupIndex, (uint16_t)j); MicroProfileToken nToken = MicroProfileMakeToken(1ll << nGroupIndex, (uint16_t)j);
S.Graph[i].nToken = nToken; // note: group index is stored here but is checked without in MicroProfileToggleGraph()! S.Graph[i].nToken = nToken; // note: group index is stored here but is checked without in MicroProfileToggleGraph()!
S.TimerInfo[j].bGraph = true; S.TimerInfo[j].bGraph = true;
if(nToken != nPrevToken) if(nToken != nPrevToken)
@ -3235,7 +3235,7 @@ uint32_t MicroProfileCustomGroupFind(const char* pCustomName)
return i; return i;
} }
} }
return UINT32_MAX; return (uint32_t)-1;
} }
uint32_t MicroProfileCustomGroup(const char* pCustomName) uint32_t MicroProfileCustomGroup(const char* pCustomName)
@ -3251,7 +3251,7 @@ uint32_t MicroProfileCustomGroup(const char* pCustomName)
uint32_t nIndex = UI.nCustomCount; uint32_t nIndex = UI.nCustomCount;
UI.nCustomCount++; UI.nCustomCount++;
memset(&UI.Custom[nIndex], 0, sizeof(UI.Custom[nIndex])); memset(&UI.Custom[nIndex], 0, sizeof(UI.Custom[nIndex]));
size_t nLen = strlen(pCustomName); uint32_t nLen = (uint32_t)strlen(pCustomName);
if(nLen > MICROPROFILE_NAME_MAX_LEN-1) if(nLen > MICROPROFILE_NAME_MAX_LEN-1)
nLen = MICROPROFILE_NAME_MAX_LEN-1; nLen = MICROPROFILE_NAME_MAX_LEN-1;
memcpy(&UI.Custom[nIndex].pName[0], pCustomName, nLen); memcpy(&UI.Custom[nIndex].pName[0], pCustomName, nLen);
@ -3309,7 +3309,7 @@ void MicroProfileCustomGroupEnable(uint32_t nIndex)
void MicroProfileCustomGroupToggle(const char* pCustomName) void MicroProfileCustomGroupToggle(const char* pCustomName)
{ {
uint32_t nIndex = MicroProfileCustomGroupFind(pCustomName); uint32_t nIndex = MicroProfileCustomGroupFind(pCustomName);
if(nIndex == UINT32_MAX || nIndex == UI.nCustomActive) if(nIndex == (uint32_t)-1 || nIndex == UI.nCustomActive)
{ {
MicroProfileCustomGroupDisable(); MicroProfileCustomGroupDisable();
} }
@ -3328,13 +3328,13 @@ void MicroProfileCustomGroupDisable()
{ {
MicroProfile& S = *MicroProfileGet(); MicroProfile& S = *MicroProfileGet();
S.nForceGroupUI = 0; S.nForceGroupUI = 0;
UI.nCustomActive = UINT32_MAX; UI.nCustomActive = (uint32_t)-1;
} }
void MicroProfileCustomGroupAddTimer(const char* pCustomName, const char* pGroup, const char* pTimer) void MicroProfileCustomGroupAddTimer(const char* pCustomName, const char* pGroup, const char* pTimer)
{ {
uint32_t nIndex = MicroProfileCustomGroupFind(pCustomName); uint32_t nIndex = MicroProfileCustomGroupFind(pCustomName);
if(UINT32_MAX == nIndex) if((uint32_t)-1 == nIndex)
{ {
return; return;
} }
@ -3344,7 +3344,7 @@ void MicroProfileCustomGroupAddTimer(const char* pCustomName, const char* pGroup
MP_ASSERT(nToken != MICROPROFILE_INVALID_TOKEN); //Timer must be registered first. MP_ASSERT(nToken != MICROPROFILE_INVALID_TOKEN); //Timer must be registered first.
UI.Custom[nIndex].pTimers[nTimerIndex] = nToken; UI.Custom[nIndex].pTimers[nTimerIndex] = nToken;
uint16_t nGroup = MicroProfileGetGroupIndex(nToken); uint16_t nGroup = MicroProfileGetGroupIndex(nToken);
UI.Custom[nIndex].nGroupMask |= (1ULL << nGroup); UI.Custom[nIndex].nGroupMask |= (1ll << nGroup);
UI.Custom[nIndex].nNumTimers++; UI.Custom[nIndex].nNumTimers++;
} }

2
externals/xbyak vendored

@ -1 +1 @@
Subproject commit c306b8e5786eeeb87b8925a8af5c3bf057ff5a90 Subproject commit 18c9caaa0a3ed5706c39f5aa86cce0db6e65b174

2
externals/zstd vendored

@ -1 +1 @@
Subproject commit 97a3da1df009d4dc67251de0c4b1c9d7fe286fc1 Subproject commit 10f0e6993f9d2f682da6d04aa2385b7d53cbb4ee

View File

@ -35,6 +35,8 @@ if (MSVC)
add_compile_options( add_compile_options(
/W3 /W3
/MP /MP
/Zi
/Zo
/permissive- /permissive-
/EHsc /EHsc
/volatile:iso /volatile:iso
@ -47,15 +49,6 @@ if (MSVC)
/external:W0 /external:W0
) )
# Since MSVC's debugging information is not very deterministic, so we have to disable it
# when using ccache or other caching tools
if (NOT USE_CCACHE)
add_compile_options(
/Zi
/Zo
)
endif()
# /GS- - No stack buffer overflow checks # /GS- - No stack buffer overflow checks
add_compile_options("$<$<CONFIG:Release>:/GS->") add_compile_options("$<$<CONFIG:Release>:/GS->")

View File

@ -31,7 +31,7 @@ android {
// TODO If this is ever modified, change application_id in strings.xml // TODO If this is ever modified, change application_id in strings.xml
applicationId "org.citra.citra_emu" applicationId "org.citra.citra_emu"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 29 targetSdkVersion 28
versionCode autoVersion versionCode autoVersion
versionName getVersion() versionName getVersion()
ndk.abiFilters abiFilter ndk.abiFilters abiFilter
@ -121,7 +121,7 @@ dependencies {
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
implementation 'com.android.billingclient:billing:2.0.3' implementation 'com.android.billingclient:billing:2.2.0'
} }
def getVersion() { def getVersion() {

View File

@ -28,8 +28,7 @@
android:allowBackup="false" android:allowBackup="false"
android:supportsRtl="true" android:supportsRtl="true"
android:isGame="true" android:isGame="true"
android:banner="@mipmap/ic_launcher" android:banner="@mipmap/ic_launcher">
android:requestLegacyExternalStorage="true">
<activity <activity
android:name="org.citra.citra_emu.ui.main.MainActivity" android:name="org.citra.citra_emu.ui.main.MainActivity"

View File

@ -229,9 +229,9 @@ public final class EmulationActivity extends AppCompatActivity {
finish(); finish();
}) })
.setNegativeButton(android.R.string.cancel, (dialogInterface, i) -> .setNegativeButton(android.R.string.cancel, (dialogInterface, i) ->
NativeLibrary.UnPauseEmulation()) {
.setOnCancelListener(dialogInterface -> }).setOnDismissListener(dialogInterface ->
NativeLibrary.UnPauseEmulation()) NativeLibrary.UnPauseEmulation())
.create() .create()
.show(); .show();
} }

View File

@ -1,139 +0,0 @@
// Copyright 2021 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
package org.citra.citra_emu.disk_shader_cache;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import org.citra.citra_emu.NativeLibrary;
import org.citra.citra_emu.R;
import org.citra.citra_emu.activities.EmulationActivity;
import org.citra.citra_emu.utils.Log;
import java.util.Objects;
public class DiskShaderCacheProgress {
// Equivalent to VideoCore::LoadCallbackStage
public enum LoadCallbackStage {
Prepare,
Decompile,
Build,
Complete,
}
private static final Object finishLock = new Object();
private static ProgressDialogFragment fragment;
public static class ProgressDialogFragment extends DialogFragment {
ProgressBar progressBar;
TextView progressText;
AlertDialog dialog;
static ProgressDialogFragment newInstance(String title, String message) {
ProgressDialogFragment frag = new ProgressDialogFragment();
Bundle args = new Bundle();
args.putString("title", title);
args.putString("message", message);
frag.setArguments(args);
return frag;
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Activity emulationActivity = Objects.requireNonNull(getActivity());
final String title = Objects.requireNonNull(Objects.requireNonNull(getArguments()).getString("title"));
final String message = Objects.requireNonNull(Objects.requireNonNull(getArguments()).getString("message"));
LayoutInflater inflater = LayoutInflater.from(emulationActivity);
View view = inflater.inflate(R.layout.dialog_progress_bar, null);
progressBar = view.findViewById(R.id.progress_bar);
progressText = view.findViewById(R.id.progress_text);
progressText.setText("");
setCancelable(false);
setRetainInstance(true);
AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity);
builder.setTitle(title);
builder.setMessage(message);
builder.setView(view);
builder.setNegativeButton(android.R.string.cancel, null);
dialog = builder.create();
dialog.create();
dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setOnClickListener((v) -> emulationActivity.onBackPressed());
synchronized (finishLock) {
finishLock.notifyAll();
}
return dialog;
}
private void onUpdateProgress(String msg, int progress, int max) {
Objects.requireNonNull(getActivity()).runOnUiThread(() -> {
progressBar.setProgress(progress);
progressBar.setMax(max);
progressText.setText(String.format("%d/%d", progress, max));
dialog.setMessage(msg);
});
}
}
private static void prepareDialog() {
NativeLibrary.sEmulationActivity.get().runOnUiThread(() -> {
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
fragment = ProgressDialogFragment.newInstance(emulationActivity.getString(R.string.loading), emulationActivity.getString(R.string.preparing_shaders));
fragment.show(emulationActivity.getSupportFragmentManager(), "diskShaders");
});
synchronized (finishLock) {
try {
finishLock.wait();
} catch (Exception ignored) {
}
}
}
public static void loadProgress(LoadCallbackStage stage, int progress, int max) {
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
if (emulationActivity == null) {
Log.error("[DiskShaderCacheProgress] EmulationActivity not present");
return;
}
switch (stage) {
case Prepare:
prepareDialog();
break;
case Decompile:
fragment.onUpdateProgress(emulationActivity.getString(R.string.preparing_shaders), progress, max);
break;
case Build:
fragment.onUpdateProgress(emulationActivity.getString(R.string.building_shaders), progress, max);
break;
case Complete:
// Workaround for when dialog is dismissed when the app is in the background
fragment.dismissAllowingStateLoss();
break;
}
}
}

View File

@ -97,11 +97,13 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
} }
@Override @Override
public void showSettingsFragment(String menuTag, boolean addToStack, String gameID) { public void onBackPressed() {
if (!addToStack && getFragment() != null) { mPresenter.onBackPressed();
return; }
}
@Override
public void showSettingsFragment(String menuTag, boolean addToStack, String gameID) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (addToStack) { if (addToStack) {
@ -114,6 +116,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
} }
transaction.addToBackStack(null); transaction.addToBackStack(null);
mPresenter.addToStack();
} }
transaction.replace(R.id.frame_content, SettingsFragment.newInstance(menuTag, gameID), FRAGMENT_TAG); transaction.replace(R.id.frame_content, SettingsFragment.newInstance(menuTag, gameID), FRAGMENT_TAG);
@ -204,6 +207,11 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
Toast.makeText(this, message, is_long ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show(); Toast.makeText(this, message, is_long ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();
} }
@Override
public void popBackStack() {
getSupportFragmentManager().popBackStackImmediate();
}
@Override @Override
public void onSettingChanged() { public void onSettingChanged() {
mPresenter.onSettingChanged(); mPresenter.onSettingChanged();

View File

@ -22,6 +22,8 @@ public final class SettingsActivityPresenter {
private Settings mSettings = new Settings(); private Settings mSettings = new Settings();
private int mStackCount;
private boolean mShouldSave; private boolean mShouldSave;
private DirectoryStateReceiver directoryStateReceiver; private DirectoryStateReceiver directoryStateReceiver;
@ -43,6 +45,7 @@ public final class SettingsActivityPresenter {
} }
public void onStart() { public void onStart() {
this.mStackCount = 0;
prepareCitraDirectoriesIfNeeded(); prepareCitraDirectoriesIfNeeded();
} }
@ -114,6 +117,19 @@ public final class SettingsActivityPresenter {
NativeLibrary.ReloadSettings(); NativeLibrary.ReloadSettings();
} }
public void addToStack() {
mStackCount++;
}
public void onBackPressed() {
if (mStackCount > 0) {
mView.popBackStack();
mStackCount--;
} else {
mView.finish();
}
}
public void onSettingChanged() { public void onSettingChanged() {
mShouldSave = true; mShouldSave = true;
} }

View File

@ -55,6 +55,11 @@ public interface SettingsActivityView {
*/ */
void showToastMessage(String message, boolean is_long); void showToastMessage(String message, boolean is_long);
/**
* Show the previous fragment.
*/
void popBackStack();
/** /**
* End the activity. * End the activity.
*/ */

View File

@ -357,7 +357,6 @@ public final class SettingsFragmentPresenter {
Setting shadersAccurateMul = rendererSection.getSetting(SettingsFile.KEY_SHADERS_ACCURATE_MUL); Setting shadersAccurateMul = rendererSection.getSetting(SettingsFile.KEY_SHADERS_ACCURATE_MUL);
Setting render3dMode = rendererSection.getSetting(SettingsFile.KEY_RENDER_3D); Setting render3dMode = rendererSection.getSetting(SettingsFile.KEY_RENDER_3D);
Setting factor3d = rendererSection.getSetting(SettingsFile.KEY_FACTOR_3D); Setting factor3d = rendererSection.getSetting(SettingsFile.KEY_FACTOR_3D);
Setting useDiskShaderCache = rendererSection.getSetting(SettingsFile.KEY_USE_DISK_SHADER_CACHE);
SettingSection layoutSection = mSettings.getSection(Settings.SECTION_LAYOUT); SettingSection layoutSection = mSettings.getSection(Settings.SECTION_LAYOUT);
Setting cardboardScreenSize = layoutSection.getSetting(SettingsFile.KEY_CARDBOARD_SCREEN_SIZE); Setting cardboardScreenSize = layoutSection.getSetting(SettingsFile.KEY_CARDBOARD_SCREEN_SIZE);
@ -369,7 +368,6 @@ public final class SettingsFragmentPresenter {
sl.add(new CheckBoxSetting(SettingsFile.KEY_FILTER_MODE, Settings.SECTION_RENDERER, R.string.linear_filtering, R.string.linear_filtering_description, true, filterMode)); sl.add(new CheckBoxSetting(SettingsFile.KEY_FILTER_MODE, Settings.SECTION_RENDERER, R.string.linear_filtering, R.string.linear_filtering_description, true, filterMode));
sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_ASYNCHRONOUS_GPU_EMULATION, Settings.SECTION_RENDERER, R.string.asynchronous_gpu, R.string.asynchronous_gpu_description, true, useAsynchronousGpuEmulation)); sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_ASYNCHRONOUS_GPU_EMULATION, Settings.SECTION_RENDERER, R.string.asynchronous_gpu, R.string.asynchronous_gpu_description, true, useAsynchronousGpuEmulation));
sl.add(new CheckBoxSetting(SettingsFile.KEY_SHADERS_ACCURATE_MUL, Settings.SECTION_RENDERER, R.string.shaders_accurate_mul, R.string.shaders_accurate_mul_description, false, shadersAccurateMul)); sl.add(new CheckBoxSetting(SettingsFile.KEY_SHADERS_ACCURATE_MUL, Settings.SECTION_RENDERER, R.string.shaders_accurate_mul, R.string.shaders_accurate_mul_description, false, shadersAccurateMul));
sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_DISK_SHADER_CACHE, Settings.SECTION_RENDERER, R.string.use_disk_shader_cache, R.string.use_disk_shader_cache_description, true, useDiskShaderCache));
sl.add(new HeaderSetting(null, null, R.string.stereoscopy, 0)); sl.add(new HeaderSetting(null, null, R.string.stereoscopy, 0));
sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDER_3D, Settings.SECTION_RENDERER, R.string.render3d, 0, R.array.render3dModes, R.array.render3dValues, 0, render3dMode)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDER_3D, Settings.SECTION_RENDERER, R.string.render3d, 0, R.array.render3dModes, R.array.render3dValues, 0, render3dMode));

View File

@ -43,7 +43,6 @@ public final class SettingsFile {
public static final String KEY_HW_SHADER = "use_hw_shader"; public static final String KEY_HW_SHADER = "use_hw_shader";
public static final String KEY_SHADERS_ACCURATE_MUL = "shaders_accurate_mul"; public static final String KEY_SHADERS_ACCURATE_MUL = "shaders_accurate_mul";
public static final String KEY_USE_SHADER_JIT = "use_shader_jit"; public static final String KEY_USE_SHADER_JIT = "use_shader_jit";
public static final String KEY_USE_DISK_SHADER_CACHE = "use_disk_shader_cache";
public static final String KEY_USE_VSYNC = "use_vsync_new"; public static final String KEY_USE_VSYNC = "use_vsync_new";
public static final String KEY_RESOLUTION_FACTOR = "resolution_factor"; public static final String KEY_RESOLUTION_FACTOR = "resolution_factor";
public static final String KEY_FRAME_LIMIT_ENABLED = "use_frame_limit"; public static final String KEY_FRAME_LIMIT_ENABLED = "use_frame_limit";

View File

@ -123,14 +123,12 @@ void Config::ReadValues() {
Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true);
Settings::values.resolution_factor = Settings::values.resolution_factor =
static_cast<u16>(sdl2_config->GetInteger("Renderer", "resolution_factor", 1)); static_cast<u16>(sdl2_config->GetInteger("Renderer", "resolution_factor", 1));
Settings::values.use_disk_shader_cache =
sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", true);
Settings::values.use_vsync_new = sdl2_config->GetBoolean("Renderer", "use_vsync_new", true); Settings::values.use_vsync_new = sdl2_config->GetBoolean("Renderer", "use_vsync_new", true);
// Work around to map Android setting for enabling the frame limiter to the format Citra expects // Work around to map Android setting for enabling the frame limiter to the format Citra expects
if (sdl2_config->GetBoolean("Renderer", "use_frame_limit", true)) { if (sdl2_config->GetBoolean("Renderer", "use_frame_limit", true)) {
Settings::values.frame_limit = Settings::values.frame_limit =
static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100));
} else { } else {
Settings::values.frame_limit = 0; Settings::values.frame_limit = 0;
} }
@ -145,7 +143,7 @@ void Config::ReadValues() {
else if (Settings::values.render_3d == Settings::StereoRenderOption::Interlaced) else if (Settings::values.render_3d == Settings::StereoRenderOption::Interlaced)
default_shader = "horizontal (builtin)"; default_shader = "horizontal (builtin)";
Settings::values.pp_shader_name = Settings::values.pp_shader_name =
sdl2_config->GetString("Renderer", "pp_shader_name", default_shader); sdl2_config->GetString("Renderer", "pp_shader_name", default_shader);
Settings::values.filter_mode = sdl2_config->GetBoolean("Renderer", "filter_mode", true); Settings::values.filter_mode = sdl2_config->GetBoolean("Renderer", "filter_mode", true);
Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0));
@ -174,11 +172,11 @@ void Config::ReadValues() {
Settings::values.custom_bottom_bottom = Settings::values.custom_bottom_bottom =
static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_bottom", 480)); static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_bottom", 480));
Settings::values.cardboard_screen_size = Settings::values.cardboard_screen_size =
static_cast<int>(sdl2_config->GetInteger("Layout", "cardboard_screen_size", 85)); static_cast<int>(sdl2_config->GetInteger("Layout", "cardboard_screen_size", 85));
Settings::values.cardboard_x_shift = Settings::values.cardboard_x_shift =
static_cast<int>(sdl2_config->GetInteger("Layout", "cardboard_x_shift", 0)); static_cast<int>(sdl2_config->GetInteger("Layout", "cardboard_x_shift", 0));
Settings::values.cardboard_y_shift = Settings::values.cardboard_y_shift =
static_cast<int>(sdl2_config->GetInteger("Layout", "cardboard_y_shift", 0)); static_cast<int>(sdl2_config->GetInteger("Layout", "cardboard_y_shift", 0));
// Audio // Audio
Settings::values.enable_dsp_lle = sdl2_config->GetBoolean("Audio", "enable_dsp_lle", false); Settings::values.enable_dsp_lle = sdl2_config->GetBoolean("Audio", "enable_dsp_lle", false);

View File

@ -91,12 +91,6 @@ udp_pad_index=
# 0: Interpreter (slow), 1 (default): JIT (fast) # 0: Interpreter (slow), 1 (default): JIT (fast)
use_cpu_jit = use_cpu_jit =
# Change the Clock Frequency of the emulated 3DS CPU.
# Underclocking can increase the performance of the game at the risk of freezing.
# Overclocking may fix lag that happens on console, but also comes with the risk of freezing.
# Range is any positive integer (but we suspect 25 - 400 is a good idea) Default is 100
cpu_clock_percentage =
[Renderer] [Renderer]
# Whether to render using GLES or OpenGL # Whether to render using GLES or OpenGL
# 0: OpenGL, 1 (default): GLES # 0: OpenGL, 1 (default): GLES
@ -110,10 +104,6 @@ use_hw_renderer =
# 0: Software, 1 (default): Hardware # 0: Software, 1 (default): Hardware
use_hw_shader = use_hw_shader =
# Whether to use separable shaders to emulate 3DS shaders (macOS only)
# 0: Off (Default), 1 : On
separable_shader =
# Whether to use accurate multiplication in hardware shaders # Whether to use accurate multiplication in hardware shaders
# 0: Off (Default. Faster, but causes issues in some games) 1: On (Slower, but correct) # 0: Off (Default. Faster, but causes issues in some games) 1: On (Slower, but correct)
shaders_accurate_mul = shaders_accurate_mul =
@ -126,15 +116,6 @@ use_asynchronous_gpu_emulation =
# 0: Interpreter (slow), 1 (default): JIT (fast) # 0: Interpreter (slow), 1 (default): JIT (fast)
use_shader_jit = use_shader_jit =
# Forces VSync on the display thread. Usually doesn't impact performance, but on some drivers it can
# so only turn this off if you notice a speed difference.
# 0: Off, 1 (default): On
use_vsync_new =
# Reduce stuttering by storing and loading generated shaders to disk
# 0: Off, 1 (default. On)
use_disk_shader_cache =
# Resolution scale factor # Resolution scale factor
# 0: Auto (scales resolution to window size), 1: Native 3DS screen resolution, Otherwise a scale # 0: Auto (scales resolution to window size), 1: Native 3DS screen resolution, Otherwise a scale
# factor for the 3DS resolution # factor for the 3DS resolution
@ -159,7 +140,7 @@ bg_blue =
bg_green = bg_green =
# Whether and how Stereoscopic 3D should be rendered # Whether and how Stereoscopic 3D should be rendered
# 0 (default): Off, 1: Side by Side, 2: Anaglyph, 3: Interlaced, 4: Reverse Interlaced, 5: Cardboard VR # 0 (default): Off, 1: Side by Side, 2: Anaglyph, 3: Interlaced, 4: Cardboard VR
render_3d = render_3d =
# Change 3D Intensity # Change 3D Intensity

View File

@ -246,8 +246,7 @@ void EmuWindow_Android::TryPresenting() {
} }
} }
eglSwapInterval(egl_display, Settings::values.use_vsync_new ? 1 : 0); eglSwapInterval(egl_display, Settings::values.use_vsync_new ? 1 : 0);
if (VideoCore::g_renderer) { if (VideoCore::g_renderer && VideoCore::g_renderer->TryPresent()) {
VideoCore::g_renderer->TryPresent(0);
eglSwapBuffers(egl_display, egl_surface); eglSwapBuffers(egl_display, egl_surface);
} }
} }

View File

@ -21,8 +21,6 @@ static JavaVM* s_java_vm;
static jclass s_native_library_class; static jclass s_native_library_class;
static jclass s_core_error_class; static jclass s_core_error_class;
static jclass s_savestate_info_class; static jclass s_savestate_info_class;
static jclass s_disk_cache_progress_class;
static jclass s_load_callback_stage_class;
static jmethodID s_on_core_error; static jmethodID s_on_core_error;
static jmethodID s_display_alert_msg; static jmethodID s_display_alert_msg;
static jmethodID s_display_alert_prompt; static jmethodID s_display_alert_prompt;
@ -32,9 +30,6 @@ static jmethodID s_landscape_screen_layout;
static jmethodID s_exit_emulation_activity; static jmethodID s_exit_emulation_activity;
static jmethodID s_request_camera_permission; static jmethodID s_request_camera_permission;
static jmethodID s_request_mic_permission; static jmethodID s_request_mic_permission;
static jmethodID s_disk_cache_load_progress;
static std::unordered_map<VideoCore::LoadCallbackStage, jobject> s_java_load_callback_stages;
namespace IDCache { namespace IDCache {
@ -69,14 +64,6 @@ jclass GetSavestateInfoClass() {
return s_savestate_info_class; return s_savestate_info_class;
} }
jclass GetDiskCacheProgressClass() {
return s_disk_cache_progress_class;
}
jclass GetDiskCacheLoadCallbackStageClass() {
return s_load_callback_stage_class;
}
jmethodID GetOnCoreError() { jmethodID GetOnCoreError() {
return s_on_core_error; return s_on_core_error;
} }
@ -113,17 +100,6 @@ jmethodID GetRequestMicPermission() {
return s_request_mic_permission; return s_request_mic_permission;
} }
jmethodID GetDiskCacheLoadProgress() {
return s_disk_cache_load_progress;
}
jobject GetJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage) {
const auto it = s_java_load_callback_stages.find(stage);
ASSERT_MSG(it != s_java_load_callback_stages.end(), "Invalid LoadCallbackStage: {}", stage);
return it->second;
}
} // namespace IDCache } // namespace IDCache
#ifdef __cplusplus #ifdef __cplusplus
@ -147,19 +123,13 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + LOG_FILE)); FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + LOG_FILE));
LOG_INFO(Frontend, "Logging backend initialised"); LOG_INFO(Frontend, "Logging backend initialised");
// Initialize Java classes // Initialize Java methods
const jclass native_library_class = env->FindClass("org/citra/citra_emu/NativeLibrary"); const jclass native_library_class = env->FindClass("org/citra/citra_emu/NativeLibrary");
s_native_library_class = reinterpret_cast<jclass>(env->NewGlobalRef(native_library_class)); s_native_library_class = reinterpret_cast<jclass>(env->NewGlobalRef(native_library_class));
s_savestate_info_class = reinterpret_cast<jclass>( s_savestate_info_class = reinterpret_cast<jclass>(
env->NewGlobalRef(env->FindClass("org/citra/citra_emu/NativeLibrary$SavestateInfo"))); env->NewGlobalRef(env->FindClass("org/citra/citra_emu/NativeLibrary$SavestateInfo")));
s_core_error_class = reinterpret_cast<jclass>( s_core_error_class = reinterpret_cast<jclass>(
env->NewGlobalRef(env->FindClass("org/citra/citra_emu/NativeLibrary$CoreError"))); env->NewGlobalRef(env->FindClass("org/citra/citra_emu/NativeLibrary$CoreError")));
s_disk_cache_progress_class = reinterpret_cast<jclass>(env->NewGlobalRef(
env->FindClass("org/citra/citra_emu/disk_shader_cache/DiskShaderCacheProgress")));
s_load_callback_stage_class = reinterpret_cast<jclass>(env->NewGlobalRef(env->FindClass(
"org/citra/citra_emu/disk_shader_cache/DiskShaderCacheProgress$LoadCallbackStage")));
// Initialize Java methods
s_on_core_error = env->GetStaticMethodID( s_on_core_error = env->GetStaticMethodID(
s_native_library_class, "OnCoreError", s_native_library_class, "OnCoreError",
"(Lorg/citra/citra_emu/NativeLibrary$CoreError;Ljava/lang/String;)Z"); "(Lorg/citra/citra_emu/NativeLibrary$CoreError;Ljava/lang/String;)Z");
@ -179,28 +149,6 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
env->GetStaticMethodID(s_native_library_class, "RequestCameraPermission", "()Z"); env->GetStaticMethodID(s_native_library_class, "RequestCameraPermission", "()Z");
s_request_mic_permission = s_request_mic_permission =
env->GetStaticMethodID(s_native_library_class, "RequestMicPermission", "()Z"); env->GetStaticMethodID(s_native_library_class, "RequestMicPermission", "()Z");
s_disk_cache_load_progress = env->GetStaticMethodID(
s_disk_cache_progress_class, "loadProgress",
"(Lorg/citra/citra_emu/disk_shader_cache/DiskShaderCacheProgress$LoadCallbackStage;II)V");
// Initialize LoadCallbackStage map
const auto to_java_load_callback_stage = [env](const std::string& stage) {
jclass load_callback_stage_class = IDCache::GetDiskCacheLoadCallbackStageClass();
return env->NewGlobalRef(env->GetStaticObjectField(
load_callback_stage_class,
env->GetStaticFieldID(load_callback_stage_class, stage.c_str(),
"Lorg/citra/citra_emu/disk_shader_cache/"
"DiskShaderCacheProgress$LoadCallbackStage;")));
};
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Prepare,
to_java_load_callback_stage("Prepare"));
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Decompile,
to_java_load_callback_stage("Decompile"));
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Build,
to_java_load_callback_stage("Build"));
s_java_load_callback_stages.emplace(VideoCore::LoadCallbackStage::Complete,
to_java_load_callback_stage("Complete"));
MiiSelector::InitJNI(env); MiiSelector::InitJNI(env);
SoftwareKeyboard::InitJNI(env); SoftwareKeyboard::InitJNI(env);
@ -218,13 +166,6 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) {
env->DeleteGlobalRef(s_native_library_class); env->DeleteGlobalRef(s_native_library_class);
env->DeleteGlobalRef(s_savestate_info_class); env->DeleteGlobalRef(s_savestate_info_class);
env->DeleteGlobalRef(s_core_error_class); env->DeleteGlobalRef(s_core_error_class);
env->DeleteGlobalRef(s_disk_cache_progress_class);
env->DeleteGlobalRef(s_load_callback_stage_class);
for (auto& [key, object] : s_java_load_callback_stages) {
env->DeleteGlobalRef(object);
}
MiiSelector::CleanupJNI(env); MiiSelector::CleanupJNI(env);
SoftwareKeyboard::CleanupJNI(env); SoftwareKeyboard::CleanupJNI(env);
Camera::StillImage::CleanupJNI(env); Camera::StillImage::CleanupJNI(env);

View File

@ -7,7 +7,6 @@
#include <memory> #include <memory>
#include <type_traits> #include <type_traits>
#include <jni.h> #include <jni.h>
#include "video_core/rasterizer_interface.h"
namespace IDCache { namespace IDCache {
@ -15,8 +14,6 @@ JNIEnv* GetEnvForThread();
jclass GetNativeLibraryClass(); jclass GetNativeLibraryClass();
jclass GetCoreErrorClass(); jclass GetCoreErrorClass();
jclass GetSavestateInfoClass(); jclass GetSavestateInfoClass();
jclass GetDiskCacheProgressClass();
jclass GetDiskCacheLoadCallbackStageClass();
jmethodID GetOnCoreError(); jmethodID GetOnCoreError();
jmethodID GetDisplayAlertMsg(); jmethodID GetDisplayAlertMsg();
jmethodID GetDisplayAlertPrompt(); jmethodID GetDisplayAlertPrompt();
@ -26,9 +23,6 @@ jmethodID GetLandscapeScreenLayout();
jmethodID GetExitEmulationActivity(); jmethodID GetExitEmulationActivity();
jmethodID GetRequestCameraPermission(); jmethodID GetRequestCameraPermission();
jmethodID GetRequestMicPermission(); jmethodID GetRequestMicPermission();
jmethodID GetDiskCacheLoadProgress();
jobject GetJavaLoadCallbackStage(VideoCore::LoadCallbackStage stage);
} // namespace IDCache } // namespace IDCache

View File

@ -47,7 +47,7 @@ ANativeWindow* s_surf;
std::unique_ptr<EmuWindow_Android> window; std::unique_ptr<EmuWindow_Android> window;
std::atomic<bool> stop_run{true}; std::atomic<bool> is_running{false};
std::atomic<bool> pause_emulation{false}; std::atomic<bool> pause_emulation{false};
std::mutex paused_mutex; std::mutex paused_mutex;
@ -119,14 +119,6 @@ static bool HandleCoreError(Core::System::ResultStatus result, const std::string
env->NewStringUTF(details.c_str())) != JNI_FALSE; env->NewStringUTF(details.c_str())) != JNI_FALSE;
} }
static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max) {
JNIEnv* env = IDCache::GetEnvForThread();
env->CallStaticVoidMethod(IDCache::GetDiskCacheProgressClass(),
IDCache::GetDiskCacheLoadProgress(),
IDCache::GetJavaLoadCallbackStage(stage), static_cast<jint>(progress),
static_cast<jint>(max));
}
static Camera::NDK::Factory* g_ndk_factory{}; static Camera::NDK::Factory* g_ndk_factory{};
static void TryShutdown() { static void TryShutdown() {
@ -195,26 +187,9 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
auto& telemetry_session = Core::System::GetInstance().TelemetrySession(); auto& telemetry_session = Core::System::GetInstance().TelemetrySession();
telemetry_session.AddField(Telemetry::FieldType::App, "Frontend", "SDL"); telemetry_session.AddField(Telemetry::FieldType::App, "Frontend", "SDL");
stop_run = false; is_running = true;
pause_emulation = false; pause_emulation = false;
LoadDiskCacheProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
std::unique_ptr<Frontend::GraphicsContext> cpu_context;
if (Settings::values.use_asynchronous_gpu_emulation) {
cpu_context = window->CreateSharedContext();
cpu_context->MakeCurrent();
}
system.Renderer().Rasterizer()->LoadDiskResources(stop_run, &LoadDiskCacheProgress);
if (Settings::values.use_asynchronous_gpu_emulation) {
cpu_context->DoneCurrent();
cpu_context.reset();
}
LoadDiskCacheProgress(VideoCore::LoadCallbackStage::Complete, 0, 0);
SCOPE_EXIT({ TryShutdown(); }); SCOPE_EXIT({ TryShutdown(); });
// Audio stretching on Android is only useful with lower framerates, disable it when fullspeed // Audio stretching on Android is only useful with lower framerates, disable it when fullspeed
@ -233,7 +208,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
system.CoreTiming().ScheduleEvent(audio_stretching_ticks, audio_stretching_event); system.CoreTiming().ScheduleEvent(audio_stretching_ticks, audio_stretching_event);
// Start running emulation // Start running emulation
while (!stop_run) { while (is_running) {
if (!pause_emulation) { if (!pause_emulation) {
const auto result = system.RunLoop(); const auto result = system.RunLoop();
if (result == Core::System::ResultStatus::Success) { if (result == Core::System::ResultStatus::Success) {
@ -256,7 +231,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
Settings::values.volume = 0; Settings::values.volume = 0;
std::unique_lock<std::mutex> pause_lock(paused_mutex); std::unique_lock<std::mutex> pause_lock(paused_mutex);
running_cv.wait(pause_lock, [] { return !pause_emulation || stop_run; }); running_cv.wait(pause_lock, [] { return !pause_emulation || !is_running; });
window->PollEvents(); window->PollEvents();
} }
} }
@ -288,7 +263,7 @@ void Java_org_citra_citra_1emu_NativeLibrary_SurfaceDestroyed(JNIEnv* env,
} }
void Java_org_citra_citra_1emu_NativeLibrary_DoFrame(JNIEnv* env, [[maybe_unused]] jclass clazz) { void Java_org_citra_citra_1emu_NativeLibrary_DoFrame(JNIEnv* env, [[maybe_unused]] jclass clazz) {
if (stop_run || pause_emulation) { if (!is_running || pause_emulation) {
return; return;
} }
window->TryPresenting(); window->TryPresenting();
@ -358,7 +333,6 @@ jobjectArray Java_org_citra_citra_1emu_NativeLibrary_GetInstalledGamePaths(
return jgames; return jgames;
} }
// TODO(xperia64): ensure these cannot be called in an invalid state (e.g. after StopEmulation)
void Java_org_citra_citra_1emu_NativeLibrary_UnPauseEmulation(JNIEnv* env, void Java_org_citra_citra_1emu_NativeLibrary_UnPauseEmulation(JNIEnv* env,
[[maybe_unused]] jclass clazz) { [[maybe_unused]] jclass clazz) {
pause_emulation = false; pause_emulation = false;
@ -374,7 +348,7 @@ void Java_org_citra_citra_1emu_NativeLibrary_PauseEmulation(JNIEnv* env,
void Java_org_citra_citra_1emu_NativeLibrary_StopEmulation(JNIEnv* env, void Java_org_citra_citra_1emu_NativeLibrary_StopEmulation(JNIEnv* env,
[[maybe_unused]] jclass clazz) { [[maybe_unused]] jclass clazz) {
stop_run = true; is_running = false;
pause_emulation = false; pause_emulation = false;
window->StopPresenting(); window->StopPresenting();
running_cv.notify_all(); running_cv.notify_all();
@ -382,7 +356,7 @@ void Java_org_citra_citra_1emu_NativeLibrary_StopEmulation(JNIEnv* env,
jboolean Java_org_citra_citra_1emu_NativeLibrary_IsRunning(JNIEnv* env, jboolean Java_org_citra_citra_1emu_NativeLibrary_IsRunning(JNIEnv* env,
[[maybe_unused]] jclass clazz) { [[maybe_unused]] jclass clazz) {
return static_cast<jboolean>(!stop_run); return static_cast<jboolean>(is_running);
} }
jboolean Java_org_citra_citra_1emu_NativeLibrary_onGamePadEvent(JNIEnv* env, jboolean Java_org_citra_citra_1emu_NativeLibrary_onGamePadEvent(JNIEnv* env,
@ -602,8 +576,8 @@ void Java_org_citra_citra_1emu_NativeLibrary_Run__Ljava_lang_String_2(JNIEnv* en
jstring j_path) { jstring j_path) {
const std::string path = GetJString(env, j_path); const std::string path = GetJString(env, j_path);
if (!stop_run) { if (is_running) {
stop_run = true; is_running = false;
running_cv.notify_all(); running_cv.notify_all();
} }

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"
android:layout_alignParentEnd="true"
android:layout_below="@+id/progress_text"
android:layout_alignParentStart="true"/>
<TextView
android:id="@+id/progress_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"
android:gravity="right"
android:text="1/100" />
</LinearLayout>

View File

@ -159,7 +159,6 @@
<item>Side by Side</item> <item>Side by Side</item>
<item>Anaglyph</item> <item>Anaglyph</item>
<item>Interlaced</item> <item>Interlaced</item>
<item>Reverse Interlaced</item>
<item>Cardboard VR</item> <item>Cardboard VR</item>
</string-array> </string-array>
@ -169,6 +168,5 @@
<item>2</item> <item>2</item>
<item>3</item> <item>3</item>
<item>4</item> <item>4</item>
<item>5</item>
</integer-array> </integer-array>
</resources> </resources>

Some files were not shown because too many files have changed in this diff Show More