Compare commits

...

624 Commits

Author SHA1 Message Date
SachinVin
6f6f9a0910
Merge pull request #182 from JosJuice/settings-lifecycle
Fix SettingsActivity back stack behavior after stop+start
2021-09-11 13:15:54 +05:30
JosJuice
1ba43c726d Android: Fix SettingsActivity back stack behavior after stop+start
Fixes the behavior where the settings activity would go back to
the top-level menu after switching to a different app and back.
2021-06-08 09:00:20 +02:00
SachinVin
bed6a4f12f
Merge pull request #221 from SachinVin/disk-shader
Disk Shader cache follow-ups
2021-05-05 22:29:30 +05:30
SachinVin
9415de2372 gl_rasterizer_cache.cpp: remove depth/stencil check (fixup merge conflict)
ref 4a2d1b5edb (diff-84fa6454a9a35c9d9ce4d87fdf502ff3aba28c3e23ef8f6d17eabdb23c78cf07L895-L902)
2021-04-30 00:21:26 +05:30
SachinVin
bbe7221e1a gl_rasterizer.cpp: don't check for GL_ARB_copy_image when using GLES 2021-04-29 23:54:37 +05:30
SachinVin
9669dd647a id_cache.cpp: use unordered_map for s_java_load_callback_stages 2021-04-29 23:54:37 +05:30
SachinVin
455cd56343 id_cache.cpp: emplace instead of inserting into s_java_load_callback_stages 2021-04-29 23:53:47 +05:30
SachinVin
68301c05a9 id_cache.cpp: use key-object pairs to DeleteGlobalRef of s_java_load_callback_stages
Co-authored-by: Pengfei Zhu <21307832+zhaowenlan1779@users.noreply.github.com>
2021-04-29 23:53:46 +05:30
SachinVin
1a24521046 id_cache: Move LoadCallbackStage map to ID Cache 2021-04-25 12:07:08 +05:30
SachinVin
0b32c2792e DiskShaderCacheProgress.java: Use runOnUiThread instead of a Handler. 2021-04-23 22:38:35 -07:00
SachinVin
3e171e2d65 DiskShaderCacheProgress.java: Add copyright notice 2021-04-23 22:38:35 -07:00
SachinVin
14154d8e78 native.cpp; create cpu_context only when async gpu enabled and reset it after use 2021-04-23 22:38:35 -07:00
SachinVin
6d9e652eb0 native.cpp: remove const for jclass,
because it is apparently a typedef'd pointer
2021-04-23 22:38:35 -07:00
SachinVin
fceb98a310 Android: native.cpp: use switch to map LoadCallbackStages 2021-04-23 22:38:35 -07:00
SachinVin
164006d8ba DiskShaderCacheProgress.java: Add log for when EmulationActivity is not present 2021-04-23 22:38:35 -07:00
SachinVin
8b7055f33e android: native.cpp: rename is_running to stop_run and invert uses 2021-04-23 22:38:35 -07:00
SachinVin
f8dbaa2044 clang-format
x

y
2021-04-23 22:38:35 -07:00
SachinVin
7a044d9586 android: disk_shader: add UI
# Conflicts:
#	src/android/app/src/main/res/values/strings.xml

ui pt3
2021-04-23 22:38:35 -07:00
SachinVin
39c002f6cd android: use string resources for disk shader progress
# Conflicts:
#	src/android/app/src/main/res/values/strings.xml
2021-04-23 22:38:35 -07:00
SachinVin
c5dd439e53 android: progress bar for disk shaders 2021-04-23 22:38:35 -07:00
SachinVin
1acc0884db andoid: update default_ini.h 2021-04-23 22:38:35 -07:00
SachinVin
9ed737b609 disk_shader:update directory structure 2021-04-23 22:38:35 -07:00
SachinVin
84cf87c40d disk_shader: Port multi thread shader compile from yuzu
video_core: store emu_window for creating shared context
2021-04-23 22:38:35 -07:00
SachinVin
f627440bb3 disk_shader : non separable 2021-04-23 22:38:35 -07:00
bunnei
7928c4b152 Revert com.android.billingclient:billing to 2.0.3
- This is soon deprecated, but likely the last open source version of the building library.
2021-04-23 22:38:35 -07:00
xperia64
5ea0430669 Update gradle 2021-04-23 22:38:35 -07:00
bunnei
9f143505da android: Update mainfiest and build.grade for target SDK version 29. 2021-04-23 22:38:35 -07:00
xperia64
5f79f9ed6d Partial revert of Choreographer implementation; it doesn't seem *that* much worse... 2021-04-23 22:38:35 -07:00
xperia64
0184e1af53 Fix crash related to unpause being called after stop 2021-04-23 22:38:35 -07:00
bunnei
ce6b480bee android: jni: Fix missing camera includes. 2021-04-23 22:38:35 -07:00
zhupengfei
c029c9fe6c 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.
2021-04-23 22:38:35 -07:00
zhupengfei
b38ff54af6 android: Use DialogFragment for the core error dialog
Fixes a bug when changing orientation while the dialog is shown.
2021-04-23 22:38:35 -07:00
zhupengfei
a56eba77fb fixup! android: Add savestates UI 2021-04-23 22:38:35 -07:00
zhupengfei
c0942a59c8 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.
2021-04-23 22:38:35 -07:00
zhupengfei
cf84342e35 android: Add savestates UI
A simple menu with savestates info.
2021-04-23 22:38:35 -07:00
zhupengfei
8a31ffaf22 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.
2021-04-23 22:38:35 -07:00
bunnei
77c8cb23a0 android: config: Fix setting for use_frame_limit. 2021-04-23 22:38:35 -07:00
bunnei
a748c2cc7e Update strings.xml 2021-04-23 22:38:34 -07:00
Nathan Lepori
ab285bb6bb Implemented switch for sliding finger across dpad + fixed sensitivity 2021-04-23 22:38:34 -07:00
SachinVin
0507234077 video_core/CMakeLists.txt: Use toolchain cmake in shader header generator 2021-04-23 22:38:34 -07:00
SachinVin
a09d30298e gl_state.cpp: Fix typo in texture buffer LUT 2021-04-23 22:38:34 -07:00
SachinVin
08432346f7 android : EmulationActivity: Don't show rationale if the permission was denied indefinitely 2021-04-23 22:38:34 -07:00
SachinVin
d5e765fa53 fix formatting 2021-04-23 22:38:34 -07:00
SachinVin
428b0910ef android: Disable sensors when emulation is paused 2021-04-23 22:38:34 -07:00
SachinVin
337da335d6 android : refactor button_manager{.cpp, .h} to input_manager
Now that it also handles sensors
2021-04-23 22:38:34 -07:00
SutandoTsukai181
6aa9b1c9dc 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.
2021-04-23 22:38:34 -07:00
SutandoTsukai181
bf02579927 Add Cardboard VR
Based on hrydgard/ppsspp/pull/12449
2021-04-23 22:38:34 -07:00
SutandoTsukai181
8027b7cfe7 Add Stereoscopy settings UI 2021-04-23 22:38:34 -07:00
SachinVin
98205a3324 Run clang-format 2021-04-23 22:38:34 -07:00
SutandoTsukai181
e2689ee93c Remove unnecessary conditional 2021-04-23 22:38:34 -07:00
SutandoTsukai181
b55da9bef3 Wait on present_queue instead of free_queue 2021-04-23 22:38:34 -07:00
SutandoTsukai181
a6a4eb7a7a Remove reference to "has_custom_button_text" 2021-04-23 22:38:34 -07:00
SutandoTsukai181
7fc4de5330 Properly handle button_text for android 2021-04-23 22:38:34 -07:00
Tobias
3c40cbf6fb AndroidManifest: Remove the maximum aspect ratio entirely 2021-04-23 22:38:34 -07:00
Tobias
c8345b2cb4 AndroidManifest: Increase the maximum aspect ratio
This should help display the app on the whole screen on 21:9 devices like the Experia Z5.
2021-04-23 22:38:34 -07:00
bunnei
3bc5c81c7f gl_shader_decompiler: Improve performance of accurate_mul on Android. 2021-04-23 22:38:34 -07:00
weihuoya
84d295a06d presenting in the ui thread 2021-04-23 22:38:34 -07:00
weihuoya
ac686b1be4 presenting if need 2021-04-23 22:38:34 -07:00
weihuoya
8dfd31510b use separate texture buffer for light and fog 2021-04-23 22:38:34 -07:00
zhang wei
7f9f84f9ea Minor fixes to the UX (#126) 2021-04-23 22:38:34 -07:00
bunnei
1e34cde400 android: CheckBoxSetting: Fix a ClassCastException exception with isChecked. 2021-04-23 22:38:34 -07:00
bunnei
355312170c android: MainActivity: Fix a nullptr exception with onSaveInstanceState. 2021-04-23 22:38:34 -07:00
bunnei
b605845090 android: SettingsFragmentPresenter: Fix a nullptr exception with loadSettingsList. 2021-04-23 22:38:34 -07:00
bunnei
31fb157ae6 Revert "Presenting in ui thread (#92)"
This reverts commit d1c2e8fb88873bf8642d07ca7e386cc1bac19692.
2021-04-23 22:38:34 -07:00
bunnei
813b6008a2 android: native: Reload game specific settings when in game. 2021-04-23 22:38:34 -07:00
zhang wei
c4f7e2dc95 Presenting in ui thread (#92)
* present in ui thread

* rm test file

* use gradle 3.6.3

* fx present issue
2021-04-23 22:38:34 -07:00
xperia64
a0fd0deab6 Disable deptch stencil shader in texture_downloader_es for now 2021-04-23 22:38:34 -07:00
SachinVin
9a438c4339 android : Fix touchscreen for reals
Adds proper multitouch tracking for touchscreen
2021-04-23 22:38:33 -07:00
SachinVin
fa3b832998 core/frontend/emu_window: return true when TouchPressed is consumed 2021-04-23 22:38:33 -07:00
xperia64
6b5c730d6f Clamp the circle pad more correctly 2021-04-23 22:38:33 -07:00
xperia64
7682c469d4 Fix the N3DS controls 2021-04-23 22:38:33 -07:00
xperia64
384c577fee Shield TV driver bug workaround 2021-04-23 22:38:33 -07:00
SachinVin
30c9d79a27 android : InputOverlayDrawableDpad.java: Initialize mTrackId to -1 2021-04-23 22:38:33 -07:00
SachinVin
0111746fa2 android: Bring back git hash version name 2021-04-23 22:38:33 -07:00
bunnei
dadd9fcc6f android: game_settings: Mario & Luigi games require accurate mul. 2021-04-23 22:38:33 -07:00
BreadFish64
d6ff4b0cf9 actually add icons 2021-04-23 22:38:33 -07:00
BreadFish64
b7db81d227 add icon to CIA install menu item 2021-04-23 22:38:33 -07:00
BreadFish64
36548d1dd4 refresh game list after installing CIA 2021-04-23 22:38:33 -07:00
BreadFish64
07c4e5fc2e android: Add initial CIA installation 2021-04-23 22:38:33 -07:00
bunnei
082a263cd2 android: game_settings: Further cleanups. 2021-04-23 22:38:33 -07:00
bunnei
1c450ed5ba android: native: Set game specific settings before initializing core.
- Allows some other settings to be overridden.
2021-04-23 22:38:33 -07:00
bunnei
f46ee115de android: game_settings: Disable asynch GPU with DQ7.
- This was causing some issues.
2021-04-23 22:38:33 -07:00
Nathan Lepori
e47f713efc Implemented joystick-style directional pad overlay 2021-04-23 22:38:33 -07:00
SutandoTsukai181
730a722308 android: frontend: Start a service to keep the persistent notification 2021-04-23 22:38:33 -07:00
meteoorkip
f013919f28 Make touch joystick re-centering configurable 2021-04-23 22:38:33 -07:00
SachinVin
53d2b678a3 gl_shader_gen.cpp:fix implicit type conversion error for gles 2021-04-23 22:38:33 -07:00
SachinVin
3121e9cebc 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
2021-04-23 22:38:33 -07:00
SutandoTsukai181
7f59b74089 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.
2021-04-23 22:38:33 -07:00
bunnei
995cd31ae6 android: game_settings: Make SM3DL's GPU timing synchronous.
- Fixes reported white screen bug.
2021-04-23 22:38:33 -07:00
bunnei
5a4392f0c5 android: BillingManager: Purchases must be acknowledged. 2021-04-23 22:38:33 -07:00
FearlessTobi
7504974a6a android: Update app translations
Adds Korean and some minor fixes to other languages.
2021-04-23 22:38:33 -07:00
bunnei
1a6cad6cac androuid: game_settings: Tighten asynch GPU timing.
- Fixes framerate issues in ZALBW.
2021-04-23 22:38:33 -07:00
SachinVin
1e3c9e74dc android: AndroidManifest.xml: bump up gles requirement to 3.2 2021-04-23 22:38:33 -07:00
SachinVin
fe1c0f89c5 android: disable support for split screen 2021-04-23 22:38:33 -07:00
bunnei
ba3ca5057f android: BillingManager: Use real managed product for premium. 2021-04-23 22:38:33 -07:00
bunnei
f143ed8fc5 android: audio: Audio stretching is only useful with lower framerates, disable it when fullspeed. 2021-04-23 22:38:32 -07:00
bunnei
bc4629e1f1 android: video_core: Add experimental asynchronous GPU option. 2021-04-23 22:38:32 -07:00
bunnei
19f245cdbc 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
2021-04-23 22:38:32 -07:00
SachinVin
b9f863b231 common/logging: Create a new backed for android's logcat 2021-04-23 22:38:32 -07:00
zhupengfei
3a6923aa61 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>
2021-04-23 22:38:32 -07:00
bunnei
780bf21134 android: audio: Disable audio stretching by default. 2021-04-23 22:38:32 -07:00
bunnei
6317c58897 android: MainActivity: Fix crash when game directory button is not present. 2021-04-23 22:38:32 -07:00
BreadFish64
b6c91905cc android: allow navigating to external storage 2021-04-23 22:38:32 -07:00
bunnei
2b85a8277d android: BillingManager: Hide premium actionbar button when premium is active. 2021-04-23 22:38:32 -07:00
bunnei
d203ffa6ef android: main: res: Add premium icon and fix folder size. 2021-04-23 22:38:32 -07:00
BreadFish64
ccc9f26338 android: more theme changes
fix file picker dialog colors
make Citra text orange in dark mode
2021-04-23 22:38:32 -07:00
BreadFish64
caa66c1eff android: inherit file-picker toolbar theme from DayNight 2021-04-23 22:38:32 -07:00
BreadFish64
be2b64c324 android: fix toolbar theme 2021-04-23 22:38:32 -07:00
BreadFish64
f53f0ff316 android: fix garbled names in the game list 2021-04-23 22:38:32 -07:00
SachinVin
b1d0fa6749 android:game_info.cpp: correct grammar in comment 2021-04-23 22:38:32 -07:00
zhupengfei
55f72465ea android/ndk_camera: Fix rotation
`width` and `height` are not necessarily swapped at this point
2021-04-23 22:38:32 -07:00
FearlessTobi
70b82efc42 android: Make toolbar text black 2021-04-23 22:38:32 -07:00
SachinVin
30d4f8014d android:game_info.cpp: cleanup spammy log 2021-04-23 22:38:32 -07:00
zhupengfei
8055a423fa 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.
2021-04-23 22:38:32 -07:00
FearlessTobi
089a665b1e android: Add dark theme icons 2021-04-23 22:38:32 -07:00
FearlessTobi
0cc0e9e746 android: Run final format 2021-04-23 22:38:32 -07:00
FearlessTobi
baa12c851b android: Run clang-format 2021-04-23 22:38:32 -07:00
FearlessTobi
5f898fb2d2 android: Format code
Finally makes us have consistent code format in the codebase.
2021-04-23 22:38:32 -07:00
zhupengfei
2db8e2ed37 android/ndk_camera: A few fixes
1. Remove unused code
2. Avoid crashes when camera wasn't opened
3. Avoid potential data race
2021-04-23 22:38:32 -07:00
zhupengfei
d06f7b826b android: Fix camera settings
1. Fix settings crash when it gets treated as IntSetting
2. Properly report camera facing
2021-04-23 22:38:32 -07:00
bunnei
9b60a92ebe android: GameDatabase: Fix typo in rebase. 2021-04-23 22:38:32 -07:00
SachinVin
36433590df android: GameDatabase: dont add misc extensions from sub folders. 2021-04-23 22:38:32 -07:00
SachinVin
6c1b948805 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
2021-04-23 22:38:32 -07:00
FearlessTobi
7b12acdcd1 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.
2021-04-23 22:38:32 -07:00
SachinVin
0e0e12702a android/CustomFilePickerFragment: fixup call super.goUp() instead 2021-04-23 22:38:31 -07:00
BreadFish64
3f7ed24686 android/GameList: Scan for installed titles 2021-04-23 22:38:31 -07:00
SachinVin
39a49aa78c android/CustomFilePickerFragment: don't go up beyond the External Storage Directory ...
/storage/emulated/0/
2021-04-23 22:38:31 -07:00
bunnei
3edf1f8f18 android: overlay: Tighten portrait A/B/X/Y buttons. 2021-04-23 22:38:31 -07:00
bunnei
f6c51f80a3 android: overlay: Tighten portrait input a bit, this feels more natural. 2021-04-23 22:38:31 -07:00
bunnei
e7c4046aca android: InputOverlayDrawableJoystick: Fix off by 1 error with inner joystick. 2021-04-23 22:38:31 -07:00
bunnei
8cf4a70a68 android: BillingManager: Add a useful comment to onQuerySkuDetailsFinished. 2021-04-23 22:38:31 -07:00
bunnei
0ae7ae8ced android: EmulationActivity: Fix a crash when controller is disconnected. 2021-04-23 22:38:31 -07:00
bunnei
e5041e011a android: BillingManager: Fix issue with onQuerySkuDetailsFinished null param.
- Happens when not associated with a Google account.
2021-04-23 22:38:31 -07:00
FearlessTobi
04baf9abd6 android: Minor changes to theming 2021-04-23 22:38:31 -07:00
FearlessTobi
3a700afe5c 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.
2021-04-23 22:38:31 -07:00
SachinVin
48af8cba34 Android: directory picker: Add archive extensions for consistency 2021-04-23 22:38:31 -07:00
FearlessTobi
55f1300d59 android: Change theme colors and modify icons 2021-04-23 22:38:31 -07:00
FearlessTobi
ba87e97761 android/MainPresenter: Add double click prevention for the buttons 2021-04-23 22:38:31 -07:00
bunnei
645076a715 android: settings: Fix config issue with texture_filter_name for premium. 2021-04-23 22:38:31 -07:00
bunnei
603845d460 android: native: Fix crash on multiple ZIP boots. 2021-04-23 22:38:31 -07:00
bunnei
6c973067ac android: strings: Update for asynchronous GPU. 2021-04-23 22:38:31 -07:00
bunnei
e42469acf8 android: settings: Make texture filtering a premium setting. 2021-04-23 22:38:31 -07:00
bunnei
01a74a9fc5 settings: PremiumSingleChoiceSetting: Fix bug in getting/setting value. 2021-04-23 22:38:31 -07:00
bunnei
380f5bc77f android: EmulationActivity: Fix merge issue with onActivityResult. 2021-04-23 22:38:31 -07:00
bunnei
fb60eeccf1 Merge branch 'mii-selector' into 'master'
android/applets: Implement Mii Selector

See merge request CitraInternal/citra-android!33
2021-04-23 22:38:31 -07:00
bunnei
ea7cfc4483 Merge branch 'amiibo' into 'master'
android: Add Amiibo file support

See merge request CitraInternal/citra-android!34
2021-04-23 22:38:31 -07:00
bunnei
af3276176e android: native: Ensure shutdown on exit. 2021-04-23 22:38:31 -07:00
bunnei
d984ce421a android: EmulationActivity: Fix gamepad triggers. 2021-04-23 22:38:31 -07:00
bunnei
2831a4ab37 android: settings: Use more explicit ARG_MENU_TAG. 2021-04-23 22:38:31 -07:00
bunnei
e2162c6168 android: PremiumSingleChoiceSetting: Add null check to avoid a crash. 2021-04-23 22:38:31 -07:00
bunnei
26122505c4 android: settings: Disable 'System Default' theme for pre-Android 10.
- It's not officially supported.
2021-04-23 22:38:31 -07:00
bunnei
9429e2a854 android: settings: Store theme setting in shared preferences.
- Fixes some jankieness.
2021-04-23 22:38:31 -07:00
bunnei
2868ba6998 Revert "Merge branch 'rt-android' into 'master'"
This reverts commit df9f831a915524e87bf6d63ce86d76589a3fcd6c, reversing
changes made to 1e11e0aecbfdc5ddb7ad835fe673366d68788bc6.
2021-04-23 22:38:31 -07:00
SachinVin
d93eb52a1e android: create SingletonInstance for Picasso and add a place holder icon 2021-04-23 22:38:31 -07:00
FearlessTobi
77ab3ef290 android: Also disable realtime audio in the settings presenter 2021-04-23 22:38:30 -07:00
zhupengfei
5cfc37470e Address review 2021-04-23 22:38:30 -07:00
zhupengfei
1a659ae4b6 ndk_camera: Fixes
Removed debug logs and unused code
Turned CaptureSession struct for simplicity
Added support for camera reload
Fixed ANativeWindow not released
2021-04-23 22:38:30 -07:00
zhupengfei
be539cb115 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.
2021-04-23 22:38:30 -07:00
zhupengfei
eaacd20bd9 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
2021-04-23 22:38:30 -07:00
zhupengfei
2c4c83533b fixes to the NDK camera implementation 2021-04-23 22:38:30 -07:00
zhupengfei
9f147be995 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'
2021-04-23 22:38:30 -07:00
zhupengfei
0d5c0ff075 android: Add NDK camera implementation
Not tested yet as my device doesn't support camera2...
2021-04-23 22:38:30 -07:00
zhupengfei
2c95987fbf 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.
2021-04-23 22:38:30 -07:00
zhupengfei
da71226961 externals: Add libyuv and jnigraphics 2021-04-23 22:38:30 -07:00
bunnei
e2142b7461 android: audio: Disable realtime audio by default. 2021-04-23 22:38:30 -07:00
bunnei
293c037386 android: Apply correct theme at boot. 2021-04-23 22:38:30 -07:00
bunnei
67baf8e4b6 android: Implement billing for Premium. 2021-04-23 22:38:30 -07:00
zhupengfei
ce86ae9c9c Fix a typo in swkbd
That made the application crash when an @ is typed and the game prohibited it
2021-04-23 22:38:30 -07:00
BreadFish64
751c3a22b7 memory: fix memory leak related to un-freed shared memory 2021-04-23 22:38:30 -07:00
BreadFish64
fa8fd3c9d5 Revert "android: log: TrimSourcePath: Cannot be constexpr."
This reverts commit 21a75c52
2021-04-23 22:38:30 -07:00
FearlessTobi
9857801675 GameDatabase: Don't rescan when upgraded
This otherwise causes a crash because the Database gets closed too early.
2021-04-23 22:38:30 -07:00
FearlessTobi
6f22277c2f GameDatabase: Increase DB_VERSION
I forgot to do this in a previous PR.
2021-04-23 22:38:30 -07:00
bunnei
12bc8cab14 android: MainActivity: Move theme setup to after settings initialization.
- Fixes a crash.
2021-04-23 22:38:30 -07:00
FearlessTobi
f20aa01e70 android: Add premium section and Dark Theme setting 2021-04-23 22:38:30 -07:00
FearlessTobi
93518fbe7d android/GameAdapter: Fix the getColor calls using the wrong context 2021-04-23 22:38:30 -07:00
FearlessTobi
6d8fe91686 android/build: Update exifinterface to version 1.2.0 2021-04-23 22:38:30 -07:00
FearlessTobi
7bd24c73f5 android: Make adjustScale reflect changes without closing the dialog 2021-04-23 22:38:29 -07:00
FearlessTobi
242e3022d1 android: Clarify the warning in the Debug tab 2021-04-23 22:38:29 -07:00
FearlessTobi
fed4c804fe android: Enable audio stretching by default
It helps eliminate stutter and won't have a huge perf penalty, hopefully.
2021-04-23 22:38:29 -07:00
zhupengfei
2f0914c392 gl_shader_util: Specify default precision for uimage2D
Otherwise, this causes the application to crash when compiling any shader, on both devices I tested.
2021-04-23 22:38:29 -07:00
FearlessTobi
e932eb4dc2 android: Add game region to the GameDatabase 2021-04-23 22:38:29 -07:00
FearlessTobi
1e9d18d024 android: Remove unused JNI functions and use better names for game icon variables 2021-04-23 22:38:29 -07:00
FearlessTobi
db09b31479 android/settings: Make background color match the rest of the app 2021-04-23 22:38:29 -07:00
FearlessTobi
296fd21b6a 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.
2021-04-23 22:38:29 -07:00
FearlessTobi
844e609f87 android: Fix the frame limiter
It was erroneously using the wrong config section and variable type.
2021-04-23 22:38:29 -07:00
BreadFish64
93f0757b25 video_core: disable depth/stencil texture download on OpenGL ES 2021-04-23 22:38:29 -07:00
BreadFish64
a726715a93 android: disallow split screen 2021-04-23 22:38:29 -07:00
FearlessTobi
e6d5591eef android/settings: Move VSync option to debug
Dolphin does the same and there's no real reason the users should mess with it.
2021-04-23 22:38:29 -07:00
FearlessTobi
d2f0aae455 android/NativeLibrary: Use Html.FROM_HTML_MODE_LEGACY
Fixes a deprecation warning.
2021-04-23 22:38:29 -07:00
FearlessTobi
7179268c6a android: Make more Strings translatable 2021-04-23 22:38:29 -07:00
FearlessTobi
acfb45f091 android: Fix the menu animations
Turns out those unused methods were actually used for something.
2021-04-23 22:38:29 -07:00
FearlessTobi
4707d92831 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."
2021-04-23 22:38:29 -07:00
FearlessTobi
43b03ff53d android: Show a hint when the gamelist is empty 2021-04-23 22:38:29 -07:00
FearlessTobi
3f8c1febfc Make the gamelist look nicer and indicate files with a wrong extension visually 2021-04-23 22:38:29 -07:00
FearlessTobi
988e4dac67 android: Change plus icon to folder icon because we don't support multiple directories 2021-04-23 22:38:29 -07:00
FearlessTobi
783b9b0a7f android: Add realtime audio setting 2021-04-23 22:38:29 -07:00
FearlessTobi
1d9272fe99 audio_core: Add realtime audio 2021-04-23 22:38:29 -07:00
BreadFish64
c343263997 video_core: bump swap chain size for GLES to reduce bottleneck 2021-04-23 22:38:29 -07:00
BreadFish64
b6529e2759 video_core: implement optimized D24S8->RGBA8 reinterpreters 2021-04-23 22:38:29 -07:00
James Rowe
2f763bb77c Use immutable storage when available 2021-04-23 22:38:29 -07:00
BreadFish64
5eec390e6f android: disable OpenGL debug message again 2021-04-23 22:38:29 -07:00
BreadFish64
e19ce5ac73 android: fix opening settings menu in-game 2021-04-23 22:38:29 -07:00
SachinVin
63b3e8757c android: SettingsFragmentPresenter.java: correct the section used in debug tab
Fixes setting always showing the default value.
2021-04-23 22:38:29 -07:00
BreadFish64
5b1c4fe125 video_core: implement GLES depth/stencil downloads 2021-04-23 22:38:29 -07:00
FearlessTobi
f6312a22e4 android: Add debug tab 2021-04-23 22:38:29 -07:00
FearlessTobi
c95c064ae4 Optimize imports 2021-04-23 22:38:29 -07:00
FearlessTobi
433c741bb8 android: Complete the removal of ATV and address minor Linter warnings 2021-04-23 22:38:28 -07:00
FearlessTobi
68e390941e android: Remove obsolete AndroidTV mode and its resources 2021-04-23 22:38:28 -07:00
BreadFish64
b1bedc6a8b android: add texture filter setting 2021-04-23 22:38:28 -07:00
BreadFish64
9bd0f6ae56 android: Add StringSingleChoiceSetting 2021-04-23 22:38:28 -07:00
BreadFish64
f054b4de23 video_core: fix texture filters in GLES 2021-04-23 22:38:28 -07:00
zhupengfei
e9d69d1ac9 android/swkbd: Properly set uncancelable
When using a DialogFragment you have to set this property on the DialogFragment itself.
2021-04-23 22:38:28 -07:00
FearlessTobi
6c2a6d7e05 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.
2021-04-23 22:38:28 -07:00
FearlessTobi
7968deb7b7 build: Fix abiFilter 2021-04-23 22:38:28 -07:00
FearlessTobi
b63e84f70b jni/config: Set is_new_3ds to true by default 2021-04-23 22:38:28 -07:00
zhupengfei
b0a6bab618 res: Add Chinese (zh) translation 2021-04-23 22:38:28 -07:00
FearlessTobi
be1b9da7ee android/strings: Add German translation 2021-04-23 22:38:28 -07:00
FearlessTobi
d1065d066f 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.
2021-04-23 22:38:28 -07:00
FearlessTobi
24733e45d1 strings: Add the performance warning to the translatable strings 2021-04-23 22:38:28 -07:00
FearlessTobi
ccfd60ea91 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.
2021-04-23 22:38:28 -07:00
FearlessTobi
37728bb9ab 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.
2021-04-23 22:38:28 -07:00
FearlessTobi
f6d77090b5 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.
2021-04-23 22:38:28 -07:00
zhupengfei
0ff5fdcda1 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.
2021-04-23 22:38:28 -07:00
FearlessTobi
42c5729f5c Clean up unused resources and resolve linter warnings 2021-04-23 22:38:28 -07:00
BreadFish64
b1e78a2f4e android/config: initialize cpu_clock_frequency
leaving it uninitialized broke some games for obvious reasons
2021-04-23 22:38:28 -07:00
BreadFish64
9442b74961 android: don't use ScopeAcquireContext in RunCitra
The context will be released when window is destroyed
2021-04-23 22:38:28 -07:00
zhupengfei
24087ad937 Fix incorrect import due to library change 2021-04-23 22:38:28 -07:00
zhupengfei
0282c5ff18 android: SoftwareKeyboard implementation 2021-04-23 22:38:28 -07:00
BreadFish64
e4571be98b android/ndk_motion: remove ALooper_release from ndk_motion destructor
We didn't acquire the looper from another thread so this is not correct
2021-04-23 22:38:28 -07:00
BreadFish64
562d7a5170 android: jni cleanup 2021-04-23 22:38:28 -07:00
FearlessTobi
5b3e5de381 Remove unused code 2021-04-23 22:38:28 -07:00
FearlessTobi
e4c31b27bd Fix a bunch of issues found by the Linter and rename Dolphin functions to Citra 2021-04-23 22:38:28 -07:00
FearlessTobi
dbf4b070aa Android: Set up Day/Night mode for system-compatible optional dark theme
Original commit by TheRealPSV for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
d6e25e86b7 Android: Fix displaying checkbox settings with no description
bugs.dolphin-emu.org/issues/11904.

Original commit by JosJuice for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
523c909fde Moves AlertDialogs imports to AndroidX and fix tabs background color
Original commit by rafaeltoledo for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
37787added 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
d2dc0910c6 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
691f19b806 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
b5bd173b6a 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
376fc0e9b9 Remove unused code
Original commit by weihuoya for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
953087d19c Fix for crash when switching to landscape mode
bugs.dolphin-emu.org/issues/10815

Original commit by allanxp4 for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
6750f929db Android: Bunch of cleanups & Updates
1. Update Picasso to latest version
2. Remove some unused code

Original commit by mahdihijazi for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
e266309d01 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
d51c68b089 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
e0e91d45ac 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
f64f11f595 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.
2021-04-23 22:38:27 -07:00
FearlessTobi
a0c7666afa android: remove enter and exit transition
Originally done by weihuoya for Dolphin-emu.
2021-04-23 22:38:27 -07:00
FearlessTobi
68eb56d83b 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
2021-04-23 22:38:27 -07:00
Marshall Mohror
b5550c3c6c android: implement motion controls via device sensors 2021-04-23 22:38:27 -07:00
SachinVin
6b6bbba169 android: jni: Remove unused ndk_helper after EGL migration + cleanup jni/CMakeLists.txt 2021-04-23 22:38:27 -07:00
BreadFish64
d7f67e3b33 android: allow changing settings while game is running 2021-04-23 22:38:27 -07:00
bunnei
b2b2a007be android: frontend: Limit game list to a single directory. 2021-04-23 22:38:27 -07:00
bunnei
a0455900ba android: frontend: MainActivity: Fix issues with declining app permissions. 2021-04-23 22:38:27 -07:00
bunnei
089faaf26c android: build.gradle: Bump minimum version to 26. 2021-04-23 22:38:27 -07:00
bunnei
3b4ddcf2a3 android: Rename app package from citra_android to citra_emu.
- There is already a conflicting name on the Play Store.
2021-04-23 22:38:27 -07:00
bunnei
90e5a6e34e android: emu_window: Fix surface width/height.
- Fixes a bug when resuming the app.
2021-04-23 22:38:26 -07:00
bunnei
3fb7defe07 android: AndroidManifest: Use singleTop mode, not singleInstance.
- Fixes launching the app without restarting the emulation activity.
2021-04-23 22:38:26 -07:00
bunnei
f3db8d2aee android: frontend: game_list: Move add directory button to top bar. 2021-04-23 22:38:26 -07:00
bunnei
8b2d9a4ee8 android: frontend: game_list: Tweak game cards. 2021-04-23 22:38:26 -07:00
bunnei
185332cb27 android: frontend: game_list: Rounded icons and other UX improvements. 2021-04-23 22:38:26 -07:00
bunnei
35b11971a6 android: frontend: Add vsync to the settings now that it is supported. 2021-04-23 22:38:26 -07:00
bunnei
7466fa270d android: emu_window: Adapt for use with split presenter thread. 2021-04-23 22:38:26 -07:00
bunnei
27e6acac96 android: Update .gitignore for CXX compile cache. 2021-04-23 22:38:26 -07:00
bunnei
9ebe7c318b android: renderer_opengl: Various fixes for GLES. 2021-04-23 22:38:26 -07:00
bunnei
eb3270e8d6 android: log: TrimSourcePath: Cannot be constexpr. 2021-04-23 22:38:26 -07:00
SachinVin
5b67c9c17c Android: frontend: use android.R.string.ok instead of literal 2021-04-23 22:38:26 -07:00
SachinVin
a6509d465c Android: Settings: Center the setting title when no setting description is provided. 2021-04-23 22:38:26 -07:00
bunnei
3e96783918 android: video_core: Enable HW shadows and texture barrier on GLES. 2021-04-23 22:38:26 -07:00
bunnei
4acacc74cf video_core: gl_shader_manager: Only set shader samplers on fragment shader.
- Avoids unnecessary uniform errors.
2021-04-23 22:38:26 -07:00
bunnei
dff524aca8 android: video_core: Require GLES 3.2 in shaders. 2021-04-23 22:38:26 -07:00
bunnei
075585c6f8 android: native: Change order of EmuWindow teardown.
- This needs to happen after system shutdown for asynchronous GPU.
2021-04-23 22:38:26 -07:00
bunnei
c64a90f015 android: video_core: gl_rasterizer_cache: Make cache access thread safe. 2021-04-23 22:38:26 -07:00
bunnei
1ba77cd276 android: audio_core: Remove noisy log. 2021-04-23 22:38:26 -07:00
bunnei
fc24a8bb94 android: core: frontend: Port yuzu's code for scope acquire window context. 2021-04-23 22:38:26 -07:00
bunnei
8ecd73bb5b android: res: Update the launcher icon. 2021-04-23 22:38:26 -07:00
bunnei
9d5dafe811 android: frontend: FPS overlay: Add some minor margin. 2021-04-23 22:38:26 -07:00
bunnei
4a7d733f90 android: jni: Migrate EmuWindow_Android class to EGL.
- This enables us to use shared contexts more easily.
2021-04-23 22:38:26 -07:00
bunnei
2a690a3064 android: frontend: Add errors for unsupported ROM formats. 2021-04-23 22:38:26 -07:00
bunnei
efeed943d8 android: renderer_opengl: Partially implement glLogicOp on GLES. 2021-04-23 22:38:26 -07:00
SachinVin
f4fa4e8d15 android/GameDatabase.java: remove duplicate ".3ds" from allowedExtensions 2021-04-23 22:38:26 -07:00
bunnei
ac97f0aeb8 android: renderer_opengl: Optimize GetTexImageOES and fix bugs. 2021-04-23 22:38:26 -07:00
bunnei
aa42eedc41 android: settings: Add system language setting. 2021-04-23 22:38:26 -07:00
bunnei
3659fe923c android: settings: Fix bug where changing speed limiter will slow game down. 2021-04-23 22:38:26 -07:00
bunnei
4af54e1e0c android: frontend: Support 18.5:9 aspect ratio. 2021-04-23 22:38:26 -07:00
bunnei
2fdfa12d45 android: frontend: Further simplify show FPS overlay text. 2021-04-23 22:38:26 -07:00
bunnei
eff3b033fc android: frontend: Fix several issues with running notification.
- Priority should be low without sound/vibration.
- Notification should restore app.
2021-04-23 22:38:25 -07:00
bunnei
67d0ccfc0d android: frontend: Use color white for FPS overlay. 2021-04-23 22:38:25 -07:00
bunnei
329bc311a5 android: frontend: settings: Temporarily disable V-Sync. 2021-04-23 22:38:25 -07:00
bunnei
e01f2ee73d android: frontend: Rename settings hint to "Settings". 2021-04-23 22:38:25 -07:00
bunnei
83c7a97dee android: frontend: New and improved launcher icon. 2021-04-23 22:38:25 -07:00
bunnei
3628fdd735 android: frontend: startup: Improve startup and permissions handling.
- Fixes a first boot crash.
2021-04-23 22:38:25 -07:00
bunnei
241b4a2eb7 android: frontend: settings: Disable audio stretching by default. 2021-04-23 22:38:25 -07:00
bunnei
e2c2d28290 android: frontend: settings: Accurate shader multiplication should be disabled. 2021-04-23 22:38:25 -07:00
bunnei
5ce7aae1f7 android: frontend: settings: Simplify sliders. 2021-04-23 22:38:25 -07:00
bunnei
ded451bc9d android: frontend: menu: Improve in game options, make check boxes. 2021-04-23 22:38:25 -07:00
bunnei
6857bc32a8 android: frontend: Implement persistent notification while emulator is running. 2021-04-23 22:38:25 -07:00
bunnei
8cc2f340e5 android: Rename main entry class to CitraApplication. 2021-04-23 22:38:25 -07:00
bunnei
01b78f9d8d android: frontend: Implement basic software keyboard applet. 2021-04-23 22:38:25 -07:00
bunnei
04ee044418 android: frontend: Use android builtin ok/yes/no/cancel strings where possible. 2021-04-23 22:38:25 -07:00
bunnei
32dba15d34 android: frontend: Add "Cancel" and "Default" buttons to reset overlay. 2021-04-23 22:38:25 -07:00
bunnei
1a28e90a72 android: frontend: Fix bug with reset overlay scale. 2021-04-23 22:38:25 -07:00
bunnei
8295234ab7 android: frontend: Cleanup perf stats. 2021-04-23 22:38:25 -07:00
bunnei
d7e037ff2e android: frontend: card_game: Tighten padding a little bit. 2021-04-23 22:38:25 -07:00
bunnei
6b92be6df5 android: frontend: gamelist: Save PlatformGamesFragment state.
- Fixes weird duplication of game list on rotation.
2021-04-23 22:38:25 -07:00
bunnei
0584931a28 android: frontend: gamelist: Fix weird scroll behavior with action bar. 2021-04-23 22:38:25 -07:00
bunnei
17e6080e1b android: jni: Improve management of core emulation state.
- Furthermore fixes bug where audio crackling could bleed out of the app.
2021-04-23 22:38:25 -07:00
bunnei
1c12ed99fc android: frontend: settings: Add a back button to the navigation bar. 2021-04-23 22:38:25 -07:00
bunnei
60e8f9a574 android: frontend: gamelist: Add swipe to refresh gesture. 2021-04-23 22:38:25 -07:00
bunnei
7fe84b8447 android: frontend: settings: Disable configuring D-pad as buttons. 2021-04-23 22:38:25 -07:00
bunnei
4fb8d4a882 android: frontend: settings: Rename "controller" section to "gamepad". 2021-04-23 22:38:24 -07:00
bunnei
ead2d23473 android: frontend: menu_settings: Remove save button. 2021-04-23 22:38:24 -07:00
bunnei
47ee116db4 android: frontend: fragment_settings: Remove margins. 2021-04-23 22:38:24 -07:00
bunnei
38ef3bb184 android: frontend: settings: Simply save toast. 2021-04-23 22:38:24 -07:00
bunnei
b70b16b65d android: frontend: EmulationActivity: Remove citra icon from game prompt. 2021-04-23 22:38:24 -07:00
bunnei
643b8ab2c5 gl_rasterizer_cache: Remove redundant GLES check. 2021-04-23 22:38:24 -07:00
bunnei
e24022bb07 android: gl_rasterizer_cache: Skip costly shutdown procedure. 2021-04-23 22:38:24 -07:00
bunnei
6eb247fb96 android: jni: Fix how we handle orientation changes.
- This previously broke Jave to C++ bindings.
2021-04-23 22:38:24 -07:00
bunnei
2471198523 core: Reset cpu_core after kernel.
- Fixes a crash on Android.
2021-04-23 22:38:24 -07:00
bunnei
b5825fe96e android: jni: config: Disable shaders_accurate_mul by default (it's too slow). 2021-04-23 22:38:24 -07:00
bunnei
8525cd0198 android: jni: Add IDCache to cache Java methods. 2021-04-23 22:38:24 -07:00
bunnei
1dd78cd1e9 android: Picasso: Use newer version and some minor cleanup. 2021-04-23 22:38:24 -07:00
bunnei
2503527ccc android: AndroidManifest.xml: Require GLES 3.1 and AEP. 2021-04-23 22:38:24 -07:00
bunnei
eed922c5a6 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.
2021-04-23 22:38:24 -07:00
bunnei
1766e239d0 android: native: Use actual array length for banner copy. 2021-04-23 22:38:24 -07:00
bunnei
690e2ec2e5 android: frontend: Add config option for linear filtering. 2021-04-23 22:38:24 -07:00
bunnei
431799ab8f android: settings: Add/update missing config options from latest master. 2021-04-23 22:38:24 -07:00
bunnei
dbd494d62b 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.
2021-04-23 22:38:24 -07:00
bunnei
27b89a6083 android: input: Add support for gamepads. 2021-04-23 22:38:24 -07:00
bunnei
b68153fe28 android: frontend: SettingsFragmentPresenter: Add config options for joypad controls. 2021-04-23 22:38:24 -07:00
bunnei
822c5b1ab5 android: frontend: MotionAlertDialog: Merge latest Dolphin code. 2021-04-23 22:38:24 -07:00
Weiyi Wang
1bd3f19807 Add reset button to slider setting 2021-04-23 22:38:24 -07:00
Weiyi Wang
231517d3b6 move speed limiter to general 2021-04-23 22:38:24 -07:00
bunnei
cd5e760d98 android: frontend: SettingsFile: Add button strings. 2021-04-23 22:38:24 -07:00
bunnei
5c723b19a1 android: frontend: strings: Cleanup for controller input. 2021-04-23 22:38:24 -07:00
bunnei
9d2ac5f5a8 android: app: Add method to get global context. 2021-04-23 22:38:24 -07:00
bunnei
8ea56b4c1d android: jni: Remove unnecessary code. 2021-04-23 22:38:24 -07:00
Weiyi Wang
c034844da4 remove redundant code 2021-04-23 22:38:24 -07:00
Weiyi Wang
76ba97c552 Also fix default value for speed limiter & audio stretcher 2021-04-23 22:38:24 -07:00
Weiyi Wang
1500e566c6 Accurate GS is default to true in config 2021-04-23 22:38:24 -07:00
Weiyi Wang
9ad53436e8 fix system clock default value 2021-04-23 22:38:24 -07:00
Weiyi Wang
8dabd94c02 fix time picker not saving/loading time 2021-04-23 22:38:24 -07:00
Weiyi Wang
0377f77973 Fix TimePicker style 2021-04-23 22:38:24 -07:00
Weiyi Wang
1122821d9c move "select game folder" string to resource 2021-04-23 22:38:24 -07:00
Weiyi Wang
57b332151f Add title to file picker 2021-04-23 22:38:24 -07:00
bunnei
1c795b70fd android: config: Enable accurate multiplication by default. 2021-04-23 22:38:24 -07:00
bunnei
a745f61bfe android: frontend: Update circle pad icon resources. 2021-04-23 22:38:23 -07:00
bunnei
b617d60f1e android: frontend: Swap select and start buttons to match 3DS. 2021-04-23 22:38:23 -07:00
bunnei
b7df79a3e0 android: frontend: settings: String cleanup & minor improvements. 2021-04-23 22:38:23 -07:00
bunnei
e30d9034a5 android: native: Ensure game config is re-loaded before starting. 2021-04-23 22:38:23 -07:00
bunnei
af47702d0c android: frontend: Remove Home button for now, as it does not do anything. 2021-04-23 22:38:23 -07:00
bunnei
634b6e1156 android: frontend: Add a confirmation dialog on game exit. 2021-04-23 22:38:23 -07:00
bunnei
95e47fc144 android: frontend: Update controls overlay placement for new icon resources. 2021-04-23 22:38:23 -07:00
bunnei
6f02d2d160 android: frontend: Update to new icon resources. 2021-04-23 22:38:23 -07:00
bunnei
a04d5b7b9c android: frontend: settings: Add performance warnings for relevant settings. 2021-04-23 22:38:23 -07:00
bunnei
fc49a1bad6 android: frontend: Remove "Toggle All" option from toggle controls.
- This was broken, and is not terribly useful as-is.
2021-04-23 22:38:23 -07:00
bunnei
6ad8a5ca32 android: frontend: Decrease spacing between game cards. 2021-04-23 22:38:23 -07:00
bunnei
114cd5d1b6 android: jni: Fix management of core emulation state and various cleanups.
- Fixes a shutdown crash.
2021-04-23 22:38:23 -07:00
bunnei
7ea3800d94 android: frontend: Fix bug where games could be double-clicked. 2021-04-23 22:38:23 -07:00
bunnei
946922c522 android: jni: Sanitize analog stick inputs.
- Fixes bug where joystick sometimes is unresponsive.
2021-04-23 22:38:23 -07:00
bunnei
fb220b9198 android: frontend: Fix default state for toggle controls, enable D-pad by default. 2021-04-23 22:38:23 -07:00
bunnei
367d5457af android: frontend: Add persistent changeable layout option for landscape mode. 2021-04-23 22:38:23 -07:00
bunnei
8053bd3a01 android: frontend: Track screen layout separately for orientation. 2021-04-23 22:38:23 -07:00
bunnei
e0d05c32ab android: frontend: Add MobileLandscape layout profile for mobile devices. 2021-04-23 22:38:23 -07:00
James Rowe
85f7ad6240 Adds in missing changes to gradle file and updates dynarmic 2021-04-23 22:38:23 -07:00
bunnei
37d7152a7e android: jni: button_manager: Fix circle pad on subsequent game launch.
- We were missing an UnregisterFactory call for AnalogDevice.
2021-04-23 22:38:23 -07:00
bunnei
2dafa2fd4d android: frontend: MainPresenter: Refresh game directory on app boot. 2021-04-23 22:38:23 -07:00
bunnei
949fc9f5fc android: jni: game_info: Fix crash on banner load for missing title. 2021-04-23 22:38:23 -07:00
bunnei
f5c450cc39 android: jni: config: Fix bug preventing creation of config.ini. 2021-04-23 22:38:23 -07:00
bunnei
1f1db90303 android: frontend: StartupHandler: Add an intro sequence to pick game dir. 2021-04-23 22:38:23 -07:00
bunnei
e1c0dc276c android: frontend: SettingsFragmentPresenter: Default resolution scale to 1X.
- Because android phones aren't very fast.
2021-04-23 22:38:23 -07:00
bunnei
34a7b96de9 android: frontend: Settings: Section categories must match INI settings. 2021-04-23 22:38:22 -07:00
bunnei
01f23fdef9 android: frontend: Settings: Various updates and preserve single choice text in UI. 2021-04-23 22:38:22 -07:00
bunnei
c38345faf2 android: frontend: SettingsFragmentPresenter: Move speed limit to Graphics, give proper strings. 2021-04-23 22:38:22 -07:00
bunnei
6422a7ae49 android: frontend: Enlarge icon for launcher. 2021-04-23 22:38:22 -07:00
bunnei
2bd02dda98 android: frontend: SettingsFragmentPresenter: Organize settings into logical categories. 2021-04-23 22:38:22 -07:00
bunnei
bb2a9e63b0 android: frontend: SettingsFragmentPresenter: Remove unnecessary settings, add JIT setting. 2021-04-23 22:38:22 -07:00
bunnei
50aafb78c2 android: frontend: InputOverlay: Fix setting save for portrait mode. 2021-04-23 22:38:22 -07:00
bunnei
850b18f048 android: frontend: Fix settings slider cancel button. 2021-04-23 22:38:22 -07:00
bunnei
0b3e71a32c android: frontend: auto-reformat all code for consistent style. 2021-04-23 22:38:22 -07:00
James Rowe
95cd4417b0 Perf: Remove more breakpoint checking in the interpreter. Move filtering earlier in the logging chain 2021-04-23 22:38:22 -07:00
bunnei
14f55ac742 (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)
2021-04-23 22:38:22 -07:00
bunnei
03929d8cff android: frontend: Implement MobilePortrait layout, which makes more sense for mobile. 2021-04-23 22:38:22 -07:00
bunnei
7d49c5ca05 android: native: Remove several unused hooks. 2021-04-23 22:38:22 -07:00
bunnei
af2e78520f android: native: Add hooks for SwitchScreenLayout and SwapScreens. 2021-04-23 22:38:21 -07:00
bunnei
84e0372b36 android: config: Update to reflect latest settings. 2021-04-23 22:38:21 -07:00
bunnei
ff04924c5d android: frontend: Add base project. 2021-04-23 22:38:21 -07:00
bunnei
78b8dfc808
Merge pull request #5759 from nieldm/fix-3818-allow-custom-save
Allow custom folder for SDMC and NAND Directories
2021-04-23 22:35:10 -07:00
bunnei
71b8ddb8a9
Merge pull request #5756 from vitor-k/gl_extensions
Check for OpenGL extensions
2021-04-23 22:33:21 -07:00
bunnei
33e5d16c89
Merge pull request #5748 from vitor-k/update-dynarmic
Update dynarmic
2021-04-23 22:32:48 -07:00
bunnei
b9d7181a63
Merge pull request #5745 from vitor-k/catch
externals: Update catch to v2.13.4
2021-04-23 22:32:16 -07:00
Daniel Mendez
8981ca983f
Update src/citra_qt/configuration/configure_storage.cpp
Co-authored-by: Ben <bene_thomas@web.de>
2021-04-18 12:57:20 +02:00
Daniel Mendez
b72e60a47f
Update src/citra_qt/configuration/configure_storage.h
Co-authored-by: Ben <bene_thomas@web.de>
2021-04-18 12:57:14 +02:00
Daniel Méndez
95529a8b1d citra-qt: Added configure storage to handle NAND and SDMC dir location 2021-04-18 00:13:21 +02:00
Daniel Mendez
d21b8fb1b1 config: better variable naming
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2021-04-17 23:49:18 +02:00
Daniel Méndez
7f20d8bb88 config: Added nand_directory and sdmc_directory to Settings
Added settings to the ini
2021-04-17 23:49:02 +02:00
Daniel Méndez
3be52f818a file_util: Add a function to update the user path
Added a default value when sdmc and nand are empty
2021-04-17 23:48:30 +02:00
Daniel Méndez
49c0766b73 settings: Save and load NAND/SD dirs from config 2021-04-08 00:20:52 +02:00
Vitor Kiguchi
b660adea0f update catch 2021-04-06 19:56:28 -03:00
Vitor Kiguchi
a2f9fef97e Update dynarmic
fixes dynarmic compilation when targeting MacOS on ARM
2021-04-06 19:54:39 -03:00
Vitor Kiguchi
3fb1988b5b gl_rasterizer: check for GL_ARB_copy_image 2021-04-06 00:20:00 -03:00
Vitor Kiguchi
981ffb5090 shader_disk_cache: warn the user when ARB_get_program_binary is not supported. 2021-04-06 00:19:59 -03:00
Marshall Mohror
b3cab3c450
Merge pull request #5747 from JohelEGP/conditional_resize
fix(net): prevent gibberish padding on linux
2021-04-03 00:05:38 -05:00
Johel Ernesto Guerrero Peña
f8eb4b7edc fix(net): prevent gibberish padding on linux 2021-03-30 08:55:58 -04:00
Pengfei Zhu
8e3c7674d8
Merge pull request #5644 from liushuyu/master
bootmanager: fix memory leaks when loading save states
2021-03-06 16:23:24 +08:00
xperia64
c2d36cde9f
Fix destructor order in rasterizer cache (#5725) 2021-02-21 18:05:27 -05:00
Marshall Mohror
e6c479f497
Merge pull request #5710 from BreadFish64/bonk_textures
gl_rasterizer_cache: Remove all fully invalid surfaces from the cache
2021-02-11 19:06:03 -06:00
Marshall Mohror
5c58620618
Merge pull request #5717 from FearlessTobi/port-5895
Port yuzu-emu/yuzu#5895: "string_util: Remove MSVC workaround for converting between UTF8/UTF16"
2021-02-10 23:04:35 -06:00
Morph
7806206e90 string_util: Remove MSVC workaround for converting between UTF8/UTF16
This has been fixed as of Visual Studio 2019 Version 16.2
2021-02-11 00:16:33 +01:00
xperia64
2ddecf35d2
Avoid leaking fences during re-presentation (#5713)
* Avoid leaking fences during re-presentation
2021-02-09 11:32:48 -05:00
Marshall Mohror
5776bdda82
Merge pull request #5546 from FearlessTobi/port-5524
Port yuzu-emu/yuzu#4086 and yuzu-emu/yuzu#4611: Xbyak cleanups
2021-02-08 16:00:18 -06:00
BreadFish64
ff56fdf37d fix recycling custom textures 2021-02-08 15:53:06 -06:00
Pengfei Zhu
e770fd6e95
Merge pull request #5707 from vitor-k/mod-scale
configure_input: fix modifier scale saving
2021-02-08 13:14:19 +08:00
liushuyu
8290423d16
bootmanager: fix memory leaks when loading save states 2021-02-07 15:18:57 -07:00
Vitor K
2e3834f880
Fix macos build (#5703)
* Update deps.sh

GitHub's virtual environment provides 7zip and llvm by default, so brew may fail to install them as another version is already installed

* Use || true to ignore brew installation errors
2021-02-07 03:40:10 -05:00
Marshall Mohror
00c798991c
remove semicolon 2021-02-05 08:25:02 -06:00
Vitor Kiguchi
611b186a97 configure_input: set modifier_scale undonditionally when restoring default 2021-02-04 14:19:41 -03:00
Marshall Mohror
6b2e7b77cc
Merge pull request #5657 from FearlessTobi/port-5158
Port yuzu-emu/yuzu#5158: "video_core: Remove unnecessary enum class casting in logging messages"
2021-02-04 10:51:29 -06:00
Marshall Mohror
e2adb51494
Merge pull request #5693 from FearlessTobi/port-5342
Port yuzu-emu/yuzu#5342: "yuzu: Migrate off of setMargin() to setContentsMargins()"
2021-02-04 10:50:32 -06:00
Marshall Mohror
a1d6396a90
Merge pull request #5695 from FearlessTobi/port-4942
Port yuzu-emu/yuzu#4942: "core: Make use of [[nodiscard]] with the System class"
2021-02-04 10:50:00 -06:00
BreadFish64
a131f9eb74 gl_rasterizer_cache: don't place null textures in the recycler 2021-02-03 13:29:03 -06:00
Marshall Mohror
2461f67a98
Merge pull request #5671 from FearlessTobi/port-5217
Port yuzu-emu/yuzu#5217: "citra_qt/main: Save settings when starting guest"
2021-02-03 10:22:38 -06:00
Marshall Mohror
fa67789dcd
Merge pull request #5667 from zhaobot/tx-update-20210101011718
Update translations (2021-01-01)
2021-02-03 10:20:36 -06:00
Marshall Mohror
2539215f18
Merge pull request #5660 from FearlessTobi/port-5166
Port yuzu-emu/yuzu#5166: "core: Remove unnecessary enum casts in log calls"
2021-02-03 10:19:38 -06:00
BreadFish64
85e9ba897d gl_rasterizer_cache: Recycle host textures
Allocating new textures has fairly high driver overhead.
We can avoid some of this by reusing the textures from destroyed surfaces since the game will probably create more textures with the same dimensions and format.
2021-02-02 20:46:25 -06:00
BreadFish64
935e88a580 gl_rasterizer_cache: Remove all fully invalid surfaces from the cache
Some games (e.g. Pilotwings Resort) create many surfaces that are invalidated quickly but were never removed.
This occasionally lead to large lag spikes due to high lookup times and other data structure management overhead.
2021-02-02 20:43:41 -06:00
Vitor Kiguchi
75f9c2cc13 configure_input: fix modifier scale saving 2021-01-31 00:15:00 -03:00
xperia64
8df502a688
Implement APT command 0x0103 (#5478)
* WIP implement apt 0x0103

* Update src/core/hle/service/apt/apt.cpp

Co-authored-by: Pengfei Zhu <zhupf321@gmail.com>

* Names

Co-authored-by: Pengfei Zhu <zhupf321@gmail.com>
2021-01-26 15:27:52 -05:00
FearlessTobi
8d2e28cf76 core: Make use of [[nodiscard]] with the System class
Given this is a central class, we should flag cases where the return
value of some functions not being used is likely a bug.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2021-01-17 19:05:43 +01:00
FearlessTobi
aeba818634 citra_qt: Migrate off of setMargin() to setContentsMargins()
setMargin() has been deprecated since Qt 5, and replaced with
setContentsMargins(). We can move over to setContentsMargins() to stay
forward-compatible with Qt 6.0.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2021-01-17 02:48:52 +01:00
Pengfei Zhu
7c6d7905a4
Merge pull request #5670 from FearlessTobi/port-5277
Port yuzu-emu/yuzu#5277: "general: Fix various spelling errors"
2021-01-09 22:10:27 +08:00
xperia64
e33677b021
Add 3D slider value to the HID shared page (#5676)
* Add 3D slider value to the HID shared page; Fixes MSet

* Use f32
2021-01-05 22:01:01 +01:00
Lioncash
9c08409e0e externals: Update Xbyak to 5.96
I made a request on the Xbyak issue tracker to allow some constructors
to be constexpr in order to avoid static constructors from needing to
execute for some of our register constants.

This request was implemented, so this updates Xbyak so that we can make
use of it.
2021-01-04 05:11:18 +01:00
MerryMage
045d20e076 xbyak_abi: Prefer returning a struct to using out parameters in ABI_CalculateFrameSize 2021-01-04 04:07:11 +01:00
MerryMage
a841ce6451 xbyak_abi: Register indexes should be unsigned 2021-01-04 04:07:10 +01:00
Tobias
50eb634583
Merge pull request #5536 from FearlessTobi/port-4440
Port yuzu-emu/yuzu#4440: "CMakeLists: Update several libraries"
2021-01-04 04:03:34 +01:00
FearlessTobi
0e534f7e61 CMakeFiles: Update json to 3.9.0
Keeps the tracked version of the library up to date.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2021-01-04 03:35:56 +01:00
xperia64
c1d7ba4d60
Delete the old log file before rotating (#5675) 2021-01-03 14:53:23 -05:00
FearlessTobi
251b265777 citra_qt/main: Save settings when starting guest
Saves UISettings and Settings when booting a guest. Moves updating
UISettings::values from GMainWindow::closeEvent into its own function,
then reuses it in GMainWindow::BootGame.

Co-Authored-By: lat9nq <22451773+lat9nq@users.noreply.github.com>
2021-01-03 05:28:52 +01:00
xperia64
755393da90
Look at direction of analog axis travel instead of instantaneous sample (#5509)
* Look at direction of analog axis travel instead of instantaneous sample

* Clang-format

* Use map count, use unordered_map

* Improve digital vs. true analog axis heuristics
2021-01-02 21:09:26 -05:00
FearlessTobi
1653ebaa45 general: Fix various spelling errors
Co-Authored-By: Morph <39850852+Morph1984@users.noreply.github.com>
2021-01-03 02:39:41 +01:00
bunnei
9c76120a13
Fix the old log file to work with the log parser. 2021-01-01 03:17:20 -08:00
bunnei
f00c4a4cf5
Merge pull request #5668 from vitor-k/update-zstd
Update zstd to v1.4.8
2021-01-01 03:03:59 -08:00
bunnei
1265c37bab
Merge pull request #5666 from xperia64/log_rotate
Rotate previous log file to "citra_log.txt.old"
2021-01-01 03:03:31 -08:00
Vitor Kiguchi
a6fbc1c9e3 zstd: define include_directories for build interface only 2021-01-01 06:31:20 -03:00
Vitor K
ce16653cc8
Automatic Controller Binding (#5100)
* Implement the basics of controller auto mapping. From testing doesn't currenlty work.
Opening the controller requires the device index, but it is only known and guaranteed
at boot time or when a controller is connected.

* Use the SDL_INIT_GAMECONTROLLER flag to initialize the controller
subsystem. It automatically initializes the joystick subsystem too,
so SDL_INIT_JOYSTICK is not needed.

* Implement the SDLGameController class to handle open game controllers.
Based on the SDLJoystick implementation.

* Address review comments

* Changes SDLJoystick and SDLGameController to use a custom default
constructible destructor, to improve readability. The only deleters
used previously were SDL_JoystickClose and SDL_GameControllerClose,
respectively, plus null lambdas. Given that both SDL functions
accept null pointers with just an early return, this should be
functionally the same.
with just an early return

* warn the user when a controller mapping is not found

* Get axis direction and threshold from SDL_ExtendedGameControllerBind

* Reject analog bind if it's not axis, for the couple of examples present in SDL2.0.10's db.
Also add SDL_CONTROLLER_BINDTYPE_NONE for the button bind switch, with a better log message.

* sdl_impl.cpp: Log the error returned by SDL_GetError upon failure to open joystick

* sdl: only use extended binding on SDL2.0.6 and up

* sdl_impl.cpp: minor changes
2021-01-01 10:01:07 +01:00
Vitor Kiguchi
6876f1aaa4 zstd: set include directory directly 2021-01-01 02:57:15 -03:00
Pengfei Zhu
6f2bbbcced
Merge pull request #5658 from FearlessTobi/cheat-window-flags
citra_qt/cheats: Make window resizable and remove help hint
2021-01-01 10:03:15 +08:00
The Citra Community
c38f7b4fa6 Update translations (2021-01-01) 2021-01-01 01:18:05 +00:00
xperia64
b4a6763484 Rotate previous log file to '.old' if it exists 2020-12-31 16:10:01 -05:00
Vitor Kiguchi
8a67605450 Update zstd to v1.4.8 2020-12-31 14:52:07 -03:00
xperia64
5f1eb7146d
Merge generic part of Android microphone changes (#5624) 2020-12-30 19:21:03 -05:00
Vitor K
e6ef00b41d
Update deps.sh (#5665)
Try fixing macos build.
2to3 from 2.7 is not really used and is interfering with the
installation of Python 3.9, on which one of ffmpeg's dependencies
depends.
2020-12-30 17:10:18 -05:00
Marshall Mohror
820c288236
Merge pull request #5664 from vitor-k/fix-iofile
Revert #5530 "Port yuzu-emu/yuzu#4539"
2020-12-30 12:20:21 -06:00
Marshall Mohror
ab6c605e59
Merge pull request #5609 from gal20/enable-fdk-patch
Enable fdk decoder for flatpak version
2020-12-30 11:59:18 -06:00
Vitor Kiguchi
fb49ce462f Revert #5530 "Port yuzu-emu/yuzu#4539"
There is currently no such warning and the solution proposed
omits the call instead of the warning.
2020-12-30 14:49:40 -03:00
bunnei
987f910a86
Merge pull request #5530 from FearlessTobi/port-4539
Port yuzu-emu/yuzu#4539: "common: Silence two discarded result warnings"
2020-12-30 01:55:33 -08:00
bunnei
39e0644993
Merge pull request #5634 from FearlessTobi/port-4798
Port yuzu-emu/yuzu#4798: "udp/client: Take std::function by const reference with TestCommunication()"
2020-12-30 01:54:40 -08:00
bunnei
3c1211e9fe
Merge pull request #5648 from FearlessTobi/port-5139
Port yuzu-emu/yuzu#5139: "game_list_p: Resolve deprecated usage of QVariant operator<"
2020-12-30 01:53:01 -08:00
Marshall Mohror
26e8b755f0
Merge pull request #5661 from BreadFish64/fix-bitrise
Fix Bitrise build
2020-12-29 22:43:35 -06:00
BreadFish64
b3915c23a0 Update Gradle 2020-12-29 13:29:02 -06:00
BreadFish64
dbd6b8adc3 Update Bitrise build stages 2020-12-29 13:28:53 -06:00
FearlessTobi
da908a9ed1 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-29 06:39:21 +01:00
xperia64
94013c8e00
Merge ARM64 Dynarmic (#5620)
* Point dynarmic to citra fork, update dynarmic to AArch64 merge branch

* Enable dynarmic ARM64 support
2020-12-28 18:39:00 -05:00
xperia64
94d1f695ee
Use alternate-form formatting for floats after fmt 7.1.2 update (#5654)
* Use alternate-form formatting for floats after 7.1.2  update

* Last two floats
2020-12-28 18:32:36 -05:00
FearlessTobi
54a95e9c58 citra_qt/cheats: Make window resizable and remove help hint
Fixes https://github.com/citra-emu/citra/issues/5575.
2020-12-28 17:01:30 +01:00
FearlessTobi
20139141f7 video_core: Remove unnecessary enum class casting in logging messages
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more.

Reduces the line noise in our code a bit.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-28 16:50:23 +01:00
Lioncash
fdf0825369 game_list_p: Resolve deprecated usage of QVariant operator<
This is designated as obsolete in Qt's docs (see:
https://doc.qt.io/qt-5/qvariant-obsolete.html#operator-lt)
2020-12-19 18:48:38 +01:00
Tobias
3f13e1cc24
cubeb_sink: Use static_cast instead of reinterpret_cast in DataCallback() (#5573)
Conversions from void* to the proper data type are well-defined and
supported by static_cast. We don't need to use reinterpret_cast here.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>

Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
2020-12-07 16:06:16 +01:00
Tobias
f0e3637c7a
codec: Make lookup table static constexpr (#5572)
Allows compilers to elide needing to push these values on the stack
every time the function is called.

Co-authored-by: Lioncash <mathew1800@gmail.com>
2020-12-07 16:05:45 +01:00
Tobias
702af87f0d
Port yuzu-emu/yuzu#4700: "game_list: Eliminate redundant argument copies" (#5571)
* game_list: Eliminate redundant argument copies

Several functions can be taken by const reference to avoid copies

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>

* game_list: Make game list function naming consistent

Makes the naming consistent with the rest of the functions that are
present.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>

Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
2020-12-07 16:05:13 +01:00
Tobias
c557b290af
microprofile: Don't memset through std::atomic types (#5528)
Two of the members of the MicroProfileThreadLog contains two std::atomic
instances. Given these aren't trivially-copyable types, we shouldn't be
memsetting the structure, given implementation details can contain other
members within it.

To avoid potential undefined behavior on platforms, we can use aggregate
initialization to zero out the members while still having well-defined
behavior.

While we're at it we can also silence some sign conversion warnings.

Co-authored-by: Lioncash <mathew1800@gmail.com>
2020-12-07 16:04:31 +01:00
Vitor K
4888a14c12
Make UNIMPLEMENTED_MSG consistent with UNIMPLEMENTED (#5631)
The current inconsistency can result in a developer unintentionally
creating a crash when using UNIMPLEMENTED_MSG, if they're only
familiar with UNIMPLEMENTED. The two macros shouldn't have such
wildly different behaviors.
2020-12-06 23:36:04 +01:00
FearlessTobi
c37dc23481 udp/client: Take std::function by const reference with TestCommunication()
Avoids redundant copies.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-05 23:07:08 +01:00
mnml
6f45b402e7
UDS: implement GetApplicationData (#5533) 2020-12-05 22:27:57 +01:00
Tobias
664f5da105
tests: Fix warning about comparison between signed and unsigned (#5632)
Co-authored-by: comex <comexk@gmail.com>
2020-12-05 22:20:50 +01:00
xperia64
36780040a6
Update dynarmic to last compatible version (#5618) 2020-12-05 22:18:07 +01:00
Vitor K
2f5eec3576
Fixes to "hide mouse on inactivity" (#5476)
The feature wasn't working when the "single window mode" was off.
Changed the cursor setting to only affect the render_window and
moved to a signal/slot model to show the mouse.
2020-12-05 22:12:17 +01:00
Pengfei Zhu
7ae0fc7338
Merge pull request #5626 from zhaowenlan1779/deliver-arg-fix
service/apt: Fix deliver arg hmac size
2020-12-05 06:49:53 +08:00
zhupengfei
8f0aebcd4f
service/apt: Fix deliver arg hmac size 2020-11-28 08:52:35 +08:00
xperia64
a13a230511
Update inih (#5615) 2020-11-24 18:25:10 -05:00
Pengfei Zhu
21fb9d63f4
service/apt: Implement Deliver Args (#5611)
* service/apt: Add GetModule and GetAppletManager

These will be used to retrieve and set deliver args across system resets (which are currently implemented as complete restarts)

* applet_manager: Implement DeliverArg

`flags` was added to `ApplicationJumpParameters` as flags 0x2 is handled differently from 0x0.

* service/apt: Add ReceiveDeliverArg, implement GetStartupArgument

Some based on guesses.

* Address review comments
2020-11-24 20:10:31 +01:00
Ben
182ffa4243
APT: implement Set and GetWirelessRebootInfo (#5328)
* APT: implement Set and GetWirelessRebootInfo

* make wireless_reboot_info a member of APT::Module

* Removed stubbed from log message
2020-11-23 15:52:35 +01:00
xperia64
3fa12d43f5
Fix fmt crash from deprecated percent specifier (#5616)
* Fix fmt crash from deprecated percent specifier

* ...clang format
2020-11-22 20:55:45 -05:00
xperia64
4f058c04e8
Fix telemetry-related exit crash from use-after-free (#5617)
* Fix telemetry-related exit crash from use-after-free

* ...clang format
2020-11-22 21:45:14 +08:00
Schplee
2d972f91b2
Merge pull request #5613 from liushuyu/master
CI: fix the tag fetching command
2020-11-20 20:56:10 -08:00
liushuyu
0c9e7735f6
CI: fix the tag fetching command 2020-11-20 21:15:59 -07:00
liushuyu
4efeace8ee
Fix Transifex Synchronization (#5605)
* ci: fix transifex script permissions

* ci: recursively checkout for Transifex action
2020-11-18 09:09:08 +01:00
xperia64
1aaec7938f
Initial implementation of partial_embedded_buffer_dirty handling (#5548)
* Initial implementation of partial_embedded_buffer_dirty handling

* Apply suggestions from code review

Co-authored-by: Marshall Mohror <mohror64@gmail.com>

* Serialize physical address, fix LOG_TRACE

* Add bracket

* Avoid crash in partial update behavior

Co-authored-by: Marshall Mohror <mohror64@gmail.com>
2020-11-17 17:31:05 -05:00
Marshall Mohror
02d6032afb
Merge pull request #5566 from zhaowenlan1779/layered-fs-fix
layered_fs: Make LoadFile and LoadDirectory less recursive
2020-11-17 09:31:25 -06:00
Marshall Mohror
3115529be7
Merge pull request #5603 from FearlessTobi/port-4887
Port yuzu-emu/yuzu#4887: "microprofile: Silence warning in headers"
2020-11-17 09:29:06 -06:00
Marshall Mohror
6772e46153
Merge pull request #5593 from FearlessTobi/port-4831
Port yuzu-emu/yuzu#4831: "externals: Update fmt to 7.1.0"
2020-11-17 09:27:45 -06:00
Marshall Mohror
7a8d576164
Merge pull request #5577 from vitor-k/cubeb-volume
Update cubeb to latest and request a persistent stream session
2020-11-16 16:54:10 -06:00
Marshall Mohror
a89261d397
Merge pull request #5580 from oneup03/master
Implement Reverse Interlaced 3D
2020-11-16 16:53:05 -06:00
gal20
eca33d2de8
Revert ENABLE_FDK to dependent option 2020-11-16 08:37:34 +02:00
Marshall Mohror
23b67849d5
Merge pull request #5608 from gal20/fix-flatpak-crash
Fix flatpak crash when hardware shader is enabled
2020-11-15 11:23:08 -06:00
Pengfei Zhu
de3d7cf49f
kernel/thread: Change owner_process to std::weak_ptr (#5325)
* kernel/thread: Change owner_process to std::weak_ptr

Previously this leaked almost all kernel objects. In short, Threads own Processes which own HandleTables which own maps of Objects which include Threads.

Changing this to weak_ptr at least got the camera interfaces to destruct properly. Did not really check the other objects though, and I think there are probably more leaks.

* hle/kernel: Lock certain objects while deserializing

When deserializing other kernel objects, these objects (`MemoryRegion`s and `VMManager`s) can possibly get modified. To avoid inconsistent state caused by destructor side-effects, we may as well simply lock them until loading is fully completed.

* Fix silly typo

Somehow this didn't break?!
2020-11-15 12:59:45 +01:00
Hamish Milne
80c9f9abbb
Keep keyboard state independent of acquired buttons (#5255)
* Keep keyboard state independent of acquired buttons

* Review changes

* Address review comments

Co-authored-by: zhupengfei <zhupf321@gmail.com>
2020-11-15 12:58:12 +01:00
gal20
8b82a228f0
change result back to std::optional 2020-11-14 21:46:29 +02:00
gal20
5055212063
Update src/video_core/renderer_opengl/gl_shader_manager.cpp
Co-authored-by: Marshall Mohror <mohror64@gmail.com>
2020-11-14 21:45:30 +02:00
gal20
5683f86ed3
Remove pessimistic sanity check
This check creates false positive when using the flatpak runtime library
2020-11-14 20:06:25 +02:00
gal20
d870651df7
Enable fdk decoder in flatpak version 2020-11-14 20:02:36 +02:00
gal20
c4ac36b9b2
change ENABLE_FDK to option 2020-11-14 20:01:04 +02:00
gal20
03c002ee2a
make result not optional
This fixes crash when hardware shader is enabled in the flatpak version
2020-11-14 19:58:12 +02:00
liushuyu
bf03fb83ae
ci: fix mingw folder name (#5607) 2020-11-12 15:57:20 -08:00
Ben
045efe8268
Merge pull request #5596 from zhaobot/tx-update-20201101011705
Update translations (2020-11-01)
2020-11-12 10:03:32 +01:00
liushuyu
0133ebe0bc
Use GitHub Actions as CI service (#5602)
* ci: migrate to GitHub Actions

* ci: linux-mingw: use lief for parsing PE files

* ci: fix left-over issues with clang-format check

* ci: workaround libc++ issue on macOS

* appveyor: remove build scripts

* README: add GitHub Actions badge and ...

remove Travis CI and Appveyor badges
2020-11-12 06:21:35 +01:00
Lioncash
8f7ac4d8cc microprofile: Silence warning in headers
Silences a truncation warning by making the truncation explicit and
documenting the reason for it.
2020-11-11 01:02:10 +01:00
Lioncash
f2ccc8482f externals: Update fmt to 7.1.2
Updates to the latest bugfix release of fmt.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-11-11 00:58:39 +01:00
tywald
2e0ce86c9e
Band-aid solution for 'Disk Shader Cache' (#5188)
* Enable 'Accurate Multiplication' by default.

* Move 'Disk Shader Cache' to the 'Advanced' tab

* Prevent enabling 'Disk Shader Cache' when 'Enable Hardware Shader' or 'Accurate Multiplication' is disabled.

* Do not load 'Disk Shader Cache' when 'Accurate Multiplication' is disabled.

* Add a tooltip for 'Disk Shader Cache'.
2020-11-06 10:07:59 -08:00
The Citra Community
652a87f210 Update translations (2020-11-01) 2020-11-01 01:17:46 +00:00
OneUp03
33d233fffa Add reverse_interlaced uniform flag 2020-10-21 12:27:02 -05:00
Vitor Kiguchi
1efe80bd10 Update cubeb and request a persistent stream session 2020-10-20 11:19:58 -03:00
OneUp03
a4f57e6910 Implement Reverse Interlaced 3D 2020-10-16 11:41:08 -05:00
Pengfei Zhu
1bb20571b1
Merge pull request #5574 from FearlessTobi/port-4733
Port yuzu-emu/yuzu#4733: "qt/game_list: Give GameListSearchField::KeyReleaseEater a parent"
2020-10-14 10:09:45 -05:00
Pengfei Zhu
1c8461fdea
Merge pull request #5570 from FearlessTobi/port-4698
Port yuzu-emu/yuzu#4698: "General: Make use of std::nullopt where applicable"
2020-10-04 06:01:51 -05:00
FearlessTobi
e12ee55faa qt/game_list: Give GameListSearchField::KeyReleaseEater a parent
This fixes a memory leak as KeyReleaseEater's destructor was never
called.

Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2020-10-04 05:14:49 +02:00
FearlessTobi
51d348b087 General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.

This also makes it consistent how we return empty optionals.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-10-03 17:25:54 +02:00
Pengfei Zhu
aced133a3d
Merge pull request #5565 from scarabeusiv/patch-1
Fix compilation with boost 1.74.0
2020-09-30 22:03:01 -05:00
Weiyi Wang
1032b60d9b
Bump kernel version for 3DSX (#5446) 2020-10-01 09:54:42 +08:00
Vitor K
ff9c3b0531
Make sure some things are logged (#5515)
* sdl_impl.cpp: actually log the sdl error

* Log cpu slider and vsync
2020-10-01 09:23:37 +08:00
Vitor K
a26b466ac8
Use unique_ptr on all ui objects from .ui files (#5511)
* Forward declare ui and use unique_ptr

* ConfigureEnhancements: use unique_ptr for ui

* Use make_unique instead of new where applicable

* Move some of the ui includes that already used unique_ptr

* main.cpp: also make use of make_unique on Config

* Address review comments
2020-10-01 09:23:01 +08:00
zhupengfei
faf9162dbd
layered_fs: Make LoadFile and LoadDirectory less recursive
The deep recursion has caused issues in certain games with large numbers of files, especially with MSVC builds.

Previously the recursion depth is about equal to the number of files present. With this the depth should be about equal to the maximum depth of the directory structure of the RomFS.
2020-10-01 00:32:40 +08:00
Tomáš Chvátal
860ccf2a41
Fix compilation with boost 1.74.0
The serialization module was heavily changed and it now this header needs to be included as it is relied in many other parts of citra.
2020-09-30 11:29:06 +02:00
Tobias
a576eb633f
game_list_p: Mark some constants as constexpr (#5550)
Consistency change with how we mark constants in the rest of the
codebase.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>

Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
2020-09-19 18:42:36 +02:00
Tobias
017631e51b
Port yuzu-emu/yuzu#4587 and yuzu-emu/yuzu#4588: Fix data races (#5545)
Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2020-09-19 18:42:21 +02:00
Pengfei Zhu
df9e230d63
Merge pull request #5541 from zhaobot/tx-update-20200901011709
Update translations (2020-09-01)
2020-09-10 22:47:58 +08:00
Pengfei Zhu
df83449d21
Merge pull request #5549 from xperia64/squash_reg_warnings
Silence some noisy switch case warning
2020-09-10 22:26:45 +08:00
FearlessTobi
84c42bf581 game_list_p: Mark some constants as constexpr
Consistency change with how we mark constants in the rest of the
codebase.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-09-09 17:06:15 +02:00
xperia64
1128f5f8ee Silence some noisy switch case warning 2020-09-06 16:22:48 -04:00
Marshall Mohror
e97ecdc2b8
Merge pull request #5544 from FearlessTobi/port-4461
Port yuzu-emu/yuzu#4461: "Fix thread naming on Linux, which limits names to 15 bytes."
2020-09-06 12:48:43 -05:00
Tobias
316a64961c
Port yuzu-emu/yuzu#4605: "bootmanager: Prevent unnecessary copies in TouchUpdateEvent()" (#5539)
The list of points is returned by const reference, so we don't need to
make a copy of every element in the list.

Co-authored-by: Lioncash <mathew1800@gmail.com>
2020-09-05 06:09:31 +02:00
comex
2ba35cab73 Fix thread naming on Linux, which limits names to 15 bytes.
- In `SetCurrentThreadName`, when on Linux, truncate to 15 bytes, as (at
  least on glibc) `pthread_set_name_np` will otherwise return `ERANGE` and
  do nothing.
- Also, add logging in case `pthread_set_name_np` returns an error
  anyway.  This is Linux-specific, as the Apple and BSD versions of
  `pthread_set_name_np return `void`.
- Change the name for CPU threads in multi-core mode from
  "yuzu:CoreCPUThread_N" (19 bytes) to "yuzu:CPUCore_N" (14 bytes) so it
  fits into the Linux limit.  Some other thread names are also cut off,
  but I didn't bother addressing them as you can guess them from the
  truncated versions.  For a CPU thread, truncation means you can't see
  which core it is!
2020-09-03 03:15:14 +02:00
Pengfei Zhu
6a77547bde
Minor frontend fixes to savestates (#5430) 2020-09-03 00:04:23 +02:00
Tobias
66846836bc
Port yuzu-emu/yuzu#4577: "common/assert: Make use of C++ attribute syntax" (#5529)
Co-authored-by: Lioncash <mathew1800@gmail.com>
2020-09-02 17:25:31 +02:00
Pengfei Zhu
2f01046f77
Merge pull request #5504 from xperia64/savestate_locale_fix
Don't translate save/load state hotkey text for the map
2020-09-01 22:42:17 +08:00
Pengfei Zhu
a39e0ea3b1
Merge pull request #5516 from encounter/qdropevent-fix
Avoid incorrect casts to QDropEvent
2020-09-01 22:27:37 +08:00
The Citra Community
5d4a3a2d46 Update translations (2020-09-01) 2020-09-01 01:17:46 +00:00
Tobias
f4be733355
citra_qt: Backport review comments from the yuzu translation PR (#5465) 2020-08-31 21:13:24 +02:00
Tobias
f6b543886c
Port yuzu-emu/yuzu#4528: "common: Make use of [[nodiscard]] where applicable" (#5535)
Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
2020-08-31 21:06:16 +02:00
Marshall Mohror
e48110bdf4
Merge pull request #5512 from vitor-k/untangle-includes
Forward declare some classes and remove some unnecessary includes
2020-08-29 22:02:25 -05:00
Tobias
4135a12cb5
CMakeLists: Download Clang-Format from the Citra repo instead of yuzus (#5534)
This problem seems to have slipped through the cracks in the original PR. (https://github.com/citra-emu/citra/pull/3410)
2020-08-29 21:58:20 +02:00
Tobias
08e508e846
Port yuzu-emu/yuzu#4472: "perf_stats: Mark GetMeanFrametime() as const" (#5498)
The general pattern is to mark mutexes as mutable when it comes to
matters of constness, given the mutex acts as a transient member of a
data structure.

Co-Authored-By: LC <lioncash@users.noreply.github.com>
2020-08-29 17:29:20 +02:00
Schplee
a5fd11c213
Merge pull request #5500 from FearlessTobi/port-4464-4505
Port yuzu-emu/yuzu#4464 and yuzu-emu/yuzu#4505: Update clang format to version 10.0
2020-08-28 12:13:30 -07:00
Lioncash
1255d82b67 General: Tidy up clang-format warnings 2020-08-28 21:10:42 +02:00
Marshall Mohror
855dc9f0fc
Merge pull request #5518 from tywald/change-log-level
cubeb_sink: Change a log from INFO to DEBUG level
2020-08-28 13:54:36 -05:00
Marshall Mohror
88c0288cb1
Merge pull request #5521 from xperia64/fix_hotkey_ordering
Fix hotkey ordering
2020-08-28 13:53:40 -05:00
Marshall Mohror
550cc859b5
Merge pull request #5524 from FearlessTobi/port-4582
Port yuzu-emu/yuzu#4582: "externals: Update Xbyak to 5.95"
2020-08-28 13:30:44 -05:00
Marshall Mohror
69f4aacccf
Merge pull request #5531 from FearlessTobi/port-4536
Port yuzu-emu/yuzu#4536: "yuzu: Resolve -Wextra-semi warnings"
2020-08-28 13:29:22 -05:00
Marshall Mohror
f2d26eb73b
Merge pull request #5532 from FearlessTobi/port-4531
Port yuzu-emu/yuzu#4531: "yuzu: Make use of qOverload where applicable"
2020-08-28 13:28:48 -05:00
Marshall Mohror
2a676858be
Merge pull request #5527 from FearlessTobi/port-4518
Port yuzu-emu/yuzu#4518: "CMakeLists: Update fmt to 7.0.3"
2020-08-28 13:19:43 -05:00
Lioncash
1e2e9e555a yuzu: Make use of qOverload where applicable
Eliminates a verbose function cast.
2020-08-28 16:55:55 +02:00
Lioncash
8d6927dc4c yuzu: Resolve -Wextra-semi warnings
While we're in the same area, we can ensure GameDir member variables are
always initialized to consistent values.
2020-08-28 16:43:17 +02:00
Lioncash
41f42d8df3 common: Silence two discarded result warnings
These are intentionally discarded internally, since the rest of the
public API allows querying success. We want all non-internal uses of
these functions to be explicitly checked, so we can signify that we
intentionally want to discard the return values here.
2020-08-28 16:32:13 +02:00
FearlessTobi
0ca0aad946 CMakeLists: Update fmt to 7.0.3
Keeps the library up to date and fixes a few bugs

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-08-28 16:00:00 +02:00
FearlessTobi
8164e58eab externals: Update Xbyak to 5.95
5.95 contains a potentially backward-compatibility breaking change, so
we should be updating to this to ensure that our code remains
forward-compatible.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-08-28 03:19:15 +02:00
xperia64
9a6fb16c06 Hotkeys were carelessly added out of alphabetical order, and notably broke in the 'Restore Hotkeys' PR 2020-08-23 15:16:38 -04:00
xperia64
07d2daf2f9 Fix order 2020-08-21 21:47:57 -04:00
tywald
3d9d071262 cubeb_sink.cpp: Change one log from INFO to DEBUG level. 2020-08-20 20:22:50 +02:00
Vitor Kiguchi
08e4614817 interface.h: forward declare resolution 2020-08-20 01:30:13 -03:00
Vitor Kiguchi
683fb833f2 camera_util.cpp: remove unnecessary includes 2020-08-20 01:30:13 -03:00
Vitor Kiguchi
7bcfff4e71 clang format 2020-08-19 01:45:57 -03:00
Vitor Kiguchi
a6efc7c1ee Separate the enums from cam/cam.h
The settings.h file doesn't actually need all of the definitions
on cam.h, only some of the enums. They can, therefore, be separated
into another file, which is included by settings.h instead.
The other changes are fixing files that included settings.h and
depended on indirect includes from includes of includes of cam.h
2020-08-19 01:45:57 -03:00
Luke Street
21d7c4faa8 Avoid incorrect casts to QDropEvent 2020-08-18 23:24:06 -04:00
Vitor Kiguchi
9d99755d4f configure_camera: forward declare CameraInterface 2020-08-17 21:07:38 -03:00
Vitor Kiguchi
9c2986de41 profiler: remove unnecessary includes 2020-08-17 18:31:58 -03:00
Vitor Kiguchi
9394724902 main: forward declare QLabel 2020-08-17 18:17:42 -03:00
xperia64
1d5d278f8d Don't translate hotkey text 2020-08-10 23:06:22 -04:00
FearlessTobi
09ebfebc91 CMakeLists: Update CLANG_FORMAT_POSTFIX to 10.0
This was forgotten to be changed in previous PRs.
2020-08-08 18:56:58 +02:00
FearlessTobi
8f05bb780a ci: Make use of clang-format 10.0
10.0 seems to play nicer with C++ attributes compared to clang-format
6.0.
2020-08-08 18:56:58 +02:00
Pengfei Zhu
f72be7af2d
Merge pull request #5497 from GMaxera/fix-broken-mac-os-travis-build
Use gtimeout on Mac OS job to incrementally build up ccache
2020-08-07 20:30:52 +08:00
Gianluca Massera
52470d5f60 Use gtimeout on Mac OS job to incrementally build up ccache 2020-08-07 12:39:10 +01:00
Valeri
57da84ba63
Add LGTM static analyzer config file (#5495)
* Add LGTM static analyzer config file

* Install clang-format-6.0 as gets installed anyways
2020-08-07 09:34:39 +08:00
Marshall Mohror
b94f21eacd
Merge pull request #5462 from FearlessTobi/port-4376
Port yuzu-emu/yuzu#4376: "frontend: Improve wait tree readability for dark themes"
2020-07-28 12:27:54 -05:00
xperia64
b4ec50ba21
Actually return true if InitMFDLL succeeded (#5470) 2020-07-23 00:46:10 -04:00
Pengfei Zhu
c3673ac9cd
Merge pull request #5468 from citra-emu/zhaowenlan1779-patch-1
Update scan_dll.py
2020-07-22 23:13:00 +08:00
Pengfei Zhu
967f6500cf
Update scan_dll.py
Fix the current crossbuilding issue
2020-07-22 21:55:39 +08:00
Marshall Mohror
a34888804b
Merge pull request #5464 from FearlessTobi/port-4347
Port yuzu-emu/yuzu#4347: "settings: Make use of std::string_view over std::string for logging"
2020-07-21 08:46:18 -05:00
FearlessTobi
08f3fdfaec settings: Make use of std::string_view over std::string for logging
In all usages of LogSetting(), string literals are provided.
std::string_view is better suited here, as we won't churn a bunch of
string allocations every time the settings are logged out.

While we're at it, we can fold LogSetting() into LogSettings(), given
it's only ever used there.

Co-Authored-By: Mat M. <lioncash@users.noreply.github.com>
2020-07-19 15:07:16 +02:00
David Marcec
7c578b0579 frontend: Improve wait tree readability for dark themes 2020-07-19 14:41:50 +02:00
Marshall Mohror
d88d22080d
Merge pull request #5453 from FearlessTobi/port-4221
Port yuzu-emu/yuzu#4221: "cmake: stop linking against QGL"
2020-07-14 09:26:43 -05:00
Marshall Mohror
f6ced5def0
Merge pull request #5452 from FearlessTobi/port-4287
Port yuzu-emu/yuzu#4287: "CMakeLists: Update fmt to 7.0.1"
2020-07-14 09:26:24 -05:00
Ben
1722701c07
[WIP] NCCHContainer: support for partitions if container is NCSD (#5345)
* GetProgramLaunchInfo: improve to for 3ds files

* NCSD: allow to load other partitions

* fix typo

* Update src/core/hle/service/fs/fs_user.cpp

Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>

* Update src/core/hle/service/fs/fs_user.cpp

Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>

Co-authored-by: Marshall Mohror <mohror64@gmail.com>
Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>
2020-07-14 09:14:30 -05:00
Marshall Mohror
897e473da4
Merge pull request #5332 from Dragios/fix-exe-path
Correct output paths for executable binaries in CMakeLists.txt
2020-07-14 09:10:11 -05:00
Marshall Mohror
a83f819160
Merge pull request #5317 from MerryMage/compile-on-10.13
travis: Compile on macOS 10.13 with more up to date compiler
2020-07-14 09:06:03 -05:00
FearlessTobi
88edf9d62c cmake: stop linking against QGL
Co-Authored-By: Jan Beich <jbeich@users.noreply.github.com>
2020-07-11 19:06:31 +02:00
FearlessTobi
97d1430ee5 CMakeLists: Update fmt to 7.0.1
Keeps the package up to date with the latest major release of fmt.

This version brings in quite a bit of improvements, such as code size
reduction, etc.

Co-Authored-By: Mat M. <lioncash@users.noreply.github.com>
2020-07-11 18:52:36 +02:00
Tobias
96fa75fb93
discord_impl: Update the client ID (#5449)
THis should hopefully fix Rich Presence for CItra.
2020-07-08 23:45:54 +02:00
Marshall Mohror
f4e727cc19
Merge pull request #5420 from citra-emu/xglTextureBarrier
videocore: When an image is the current framebuffer and is sampled, make a copy instead of using glTextureBarrier
2020-07-07 16:45:27 -05:00
BreadFish64
60282f35fe fix clang format 2020-07-07 16:43:42 -05:00
Marshall Mohror
bd7ee8c315
Common: remove a mod from AlignUp (#5441)
In cases where the size is not a known constant when inlining, AlignUp<std::size_t> currently generates two 64-bit div instructions.
This generates one div and a cmov which is significantly cheaper.
2020-07-07 16:39:23 -05:00
Pengfei Zhu
835efd321e
Merge pull request #5438 from zhaobot/tx-update-20200701011708
Update translations (2020-07-01)
2020-07-07 20:39:14 +08:00
The Citra Community
add0deb3c5 Update translations (2020-07-01) 2020-07-01 01:17:39 +00:00
Pengfei Zhu
910cc9efc1
Merge pull request #5435 from FearlessTobi/port-4097
Port yuzu-emu/yuzu#4097: "Fix framebuffer size on fractional scaling display."
2020-06-29 21:46:26 +08:00
Kaiwen Xu
265b0aa444 Fix framebuffer size on fractional scaling display. 2020-06-28 20:34:37 +02:00
BreadFish64
662c348b6c fix 2020-06-27 13:23:34 -05:00
BreadFish64
ea2584c54d generic texture allocator 2020-06-27 13:13:37 -05:00
BreadFish64
cae4b7aaf7 Clean up 2020-06-26 15:41:10 -05:00
Marshall Mohror
c4a4b40b2d
Fix using system boost (#5424)
closes #5234
2020-06-23 21:30:35 -05:00
LC
e79de3107e
gl_resource_manager: Make use of noexcept on move constructors and move assignment operators (#5340)
Some of the classes in this file already do this, so we can apply this
to the other ones to be consistent.

Allows these classes to play nicely and not churn copies when used with
standard containers or any other API that makes use of
std::move_if_noexcept.
2020-06-23 11:00:25 -05:00
merry
7444c95132
Merge pull request #5364 from tgsm/issue-template
.github: add a new issue template
2020-06-21 20:46:25 +01:00
Marshall Mohror
372c653ec3
Fix clang-format 2020-06-20 14:03:04 -05:00
SutandoTsukai181
485d64ae73
citra-qt: Add an "Alternative Speed Limit" with its hotkey (#5281)
* Change "Toggle Speed Limit" to toggle between 100% and a custom value

This will change the shortcut for "Toggle Speed Limit" to make it swap between 100% and the value of "Limit Speed Percent" in the config. Old functionality is still there, but renamed to "Unthrottle".

* Complete reimplementation of the function

* Fix something that didn't get saved correctly

* Fix missing indentation

* Rewrite to keep only a single QSpinBox

* Second rewrite

* set Unthrottled to 0 in the Qspinbox

* Hotkey for Unthrottle

* minor improvements to the design

* Apply suggestions from code review

Co-authored-by: Ben <bene_thomas@web.de>

* Default slider values

* clang-format fixes

* Prevent the speed slider from changing size

...when an element in its row has variable width.

* Change "Game Speed" to "Emulation Speed"

* Apply suggestions from code review

`game_speed` to` emulation_speed`

Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>

* Fix for QSliders

* Revert "Prevent the speed slider from changing size"

This reverts commit ddaca2004484f1e024f49d2e6dc99ef5e261f64d.

* clang-format

...doesn't seem to stick to a choice

* Fix 2 for QSliders

Co-authored-by: B3n30 <benediktthomas@gmail.com>
Co-authored-by: Ben <bene_thomas@web.de>
Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>
2020-06-20 13:52:14 -05:00
Dragios
6d65319c85
Update manifest file to include new elements that are introduced with Windows 10 later versions (#5324) 2020-06-20 13:51:46 -05:00
Dragios
3090f840a8
Fix: fatal error CVT1100 when compiling manifest file (#5322) 2020-06-20 13:50:33 -05:00
Marshall Mohror
8a080146c9
Merge pull request #5344 from vitor-k/fix-folder-order
game_list: Fix folder reordering
2020-06-20 13:23:44 -05:00
Ben
cb44e4408d
Improve performance of applying cheats; Set correct interval for applying cheats (#5305) 2020-06-20 13:20:31 -05:00
LC
902cc1eb49
am: Resolve truncation and sign conversion warnings in WriteContentData() (#5397)
We can adjust the API to allow std::size_t indices, which simplifies
operating with standard container types. It also prevents truncation
warnings from occurring in these cases as well.
2020-06-20 13:09:56 -05:00
Marshall Mohror
353780e1c9
Merge pull request #5403 from lioncash/gen2
gl_shader_gen: Minor string cleanups
2020-06-20 13:09:24 -05:00
BreadFish64
b80c6f7534 handle all cases more robustly 2020-06-20 13:01:26 -05:00
BreadFish64
d04071d6b3 video_core/GLES: fix issues cause by missing glTextureBarrier
create a duplicate for sampling instead
2020-06-20 13:01:26 -05:00
tgsm
31cb3d7a44 .github: add a new issue template 2020-06-19 11:37:48 -04:00
LC
8ce81b19be
General: Remove usages of ARRAY_SIZE where applicable. (#5392)
Same behavior, but without our own boilerplate function.
2020-06-19 09:10:45 -05:00
LC
f7aaa37bf2
archive: Make use of std::pair for OpenFileFromArchive (#5399)
* archive: Make use of std::pair for OpenFileFromArchive

The tuple only makes use of two elements, so we can use a pair to
simplify the number of underlying template instantiations that need to
be done, while also simplifying the surrounding code.

* archive: Simplify MakeResult calls

MakeResult can deduce the contained result type based off the type of
the variable being passed to it, so explicitly specifying it is a little
verbose.
2020-06-19 09:02:00 -05:00
xperia64
1504018a56
Avoid deadlock when stopping video dumping (#5407)
* Avoid deadlock when stopping video dumping

* Use static_cast, make quit atomic

* One more atomic load

* Use suggested lock instead of atomic

* Fix locking
2020-06-18 18:20:57 -04:00
Lioncash
2b031e4eaf gl_shader_gen: std::move strings where applicable
Avoids the creation of a copy when returning.
2020-06-08 06:59:05 -04:00
Lioncash
11792682fb gl_shader_gen: Collapse several format calls into one
Same behavior, but performs one formatting pass without altering the
readability of the formatting.
2020-06-08 06:44:03 -04:00
Lioncash
e79e991681 gl_shader_gen: Mark local functions as static where applicable
These aren't used outside of the translation unit.
2020-06-08 06:40:39 -04:00
Lioncash
9645c1e1b2 gl_shader_gen: Eliminate unnecessary std::string construction in AppendProcTexCombineAndMap()
We can make use of a std::string_view here, since only string literals
are used within the switch.
2020-06-08 06:37:41 -04:00
Vitor Kiguchi
01b9302a28 game_list: cleanup and clang format in AddPermDirPopup 2020-05-10 13:45:43 -03:00
Vitor Kiguchi
fbf24e3ca4 game_list: fix folder reordering 2020-05-09 23:44:41 -03:00
Vitor Kiguchi
950c032837 change gameListDir to hold an index instead of a raw pointer 2020-05-09 23:36:40 -03:00
Dragios
841522f59c Try to fix executable path generated in CI 2020-05-04 22:35:20 +08:00
Dragios
bf1166d0ee Correct output paths for executable binaries 2020-05-02 22:24:28 +08:00
MerryMage
1f375f2511 travis: Compile on macOS 10.13 with more up to date compiler 2020-05-02 08:50:42 +01:00
726 changed files with 50444 additions and 23243 deletions

View File

@ -1,39 +0,0 @@
# 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
}

View File

@ -1,39 +0,0 @@
# 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

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

View File

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

View File

@ -1,13 +1,13 @@
#!/bin/bash -ex
if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* dist/*.desktop \
if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
dist/*.svg dist/*.xml; then
echo Trailing whitespace found, aborting
exit 1
fi
# Default clang-format points to default 3.5 version one
CLANG_FORMAT=clang-format-6.0
CLANG_FORMAT=clang-format-10
$CLANG_FORMAT --version
if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then

View File

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

View File

@ -1,7 +1,5 @@
#!/bin/bash -ex
cd /citra
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
ninja

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex
. .travis/common/pre-upload.sh
. .ci/common/pre-upload.sh
REV_NAME="citra-linux-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.xz"
@ -8,12 +8,12 @@ COMPRESSION_FLAGS="-cJvf"
mkdir "$REV_NAME"
cp build/bin/citra "$REV_NAME"
cp build/bin/citra-room "$REV_NAME"
cp build/bin/citra-qt "$REV_NAME"
cp build/bin/Release/citra "$REV_NAME"
cp build/bin/Release/citra-room "$REV_NAME"
cp build/bin/Release/citra-qt "$REV_NAME"
# We need icons on Linux for .desktop entries
mkdir "$REV_NAME/dist"
cp dist/icon.png "$REV_NAME/dist/citra.png"
. .travis/common/post-upload.sh
. .ci/common/post-upload.sh

View File

@ -7,7 +7,6 @@ chmod a+x ~/bin/gold/ld
export CFLAGS="-B$HOME/bin/gold $CFLAGS"
export CXXFLAGS="-B$HOME/bin/gold $CXXFLAGS"
cd /citra
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++

View File

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

View File

@ -1,4 +1,7 @@
import pefile
try:
import lief
except ImportError:
import pefile
import sys
import re
import os
@ -13,13 +16,26 @@ KNOWN_SYS_DLLS = ['WINMM.DLL', 'MSVCRT.DLL', 'VERSION.DLL', 'MPR.DLL',
DLL_PATH = [
'/usr/x86_64-w64-mingw32/bin/',
'/usr/x86_64-w64-mingw32/lib/',
'/usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/'
'/usr/lib/gcc/x86_64-w64-mingw32/9.3-posix/'
]
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):
if globals().get('lief'):
return parse_imports_lief(file_name)
results = []
pe = pefile.PE(file_name, fast_load=True)
pe.parse_data_directories()

View File

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

View File

@ -2,12 +2,23 @@
set -o pipefail
export MACOSX_DEPLOYMENT_TARGET=10.13
export Qt5_DIR=$(brew --prefix)/opt/qt5
export PATH="/usr/local/opt/ccache/libexec:$PATH"
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
make -j4
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

7
.ci/macos/deps.sh Executable file
View File

@ -0,0 +1,7 @@
#!/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,6 +1,6 @@
#!/bin/bash -ex
. .travis/common/pre-upload.sh
. .ci/common/pre-upload.sh
REV_NAME="citra-osx-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.gz"
@ -8,9 +8,9 @@ COMPRESSION_FLAGS="-czvf"
mkdir "$REV_NAME"
cp build/bin/citra "$REV_NAME"
cp -r build/bin/citra-qt.app "$REV_NAME"
cp build/bin/citra-room "$REV_NAME"
cp build/bin/Release/citra "$REV_NAME"
cp -r build/bin/Release/citra-qt.app "$REV_NAME"
cp build/bin/Release/citra-room "$REV_NAME"
# move libs into folder for deployment
macpack "${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt" -d "../Frameworks"
@ -20,10 +20,14 @@ $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/citra-qt.app" -executable=
# move libs into folder for deployment
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
chmod +x ${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt
# Verify loader instructions
find "$REV_NAME" -exec otool -L {} \;
find "$REV_NAME" -type f -exec otool -L {} \;
. .travis/common/post-upload.sh
. .ci/common/post-upload.sh

View File

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

10
.ci/windows-msvc/build.sh Normal file
View File

@ -0,0 +1,10 @@
#!/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"

10
.ci/windows-msvc/deps.sh Normal file
View File

@ -0,0 +1,10 @@
#!/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,3 +1,12 @@
---
name: Bug Report / Feature Request
about: Tech support does not belong here. You should only file an issue here if you think you have experienced an actual bug with Citra or you are requesting a feature you believe would make Citra better.
title: ''
labels: ''
assignees: ''
---
<!---
Please read the FAQ:

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Citra Discord
url: https://citra-emu.org/discord/
about: If you are experiencing an issue with Citra, and you need tech support, or if you have a general question, try asking in the official Citra Discord linked here. Piracy is not allowed.
- name: Community forums
url: https://community.citra-emu.org
about: This is an alternative place for tech support, however helpers there are not as active.
- name: Citra Android
url: https://github.com/citra-emu/citra-android
about: If you need tech support on Citra Android, you should use either of the above two options. If you want to file an issue, you should go to the Android repo linked here.

134
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,134 @@
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"]'

5
.gitmodules vendored
View File

@ -12,7 +12,7 @@
url = https://github.com/philsquared/Catch.git
[submodule "dynarmic"]
path = externals/dynarmic
url = https://github.com/MerryMage/dynarmic.git
url = https://github.com/citra-emu/dynarmic.git
[submodule "xbyak"]
path = externals/xbyak
url = https://github.com/herumi/xbyak.git
@ -49,3 +49,6 @@
[submodule "zstd"]
path = externals/zstd
url = https://github.com/facebook/zstd.git
[submodule "libyuv"]
path = externals/libyuv
url = https://github.com/lemenkov/libyuv.git

13
.lgtm.yml Normal file
View File

@ -0,0 +1,13 @@
path_classifiers:
library: "externals"
extraction:
cpp:
prepare:
packages:
- "libsdl2-dev"
- "qtmultimedia5-dev"
- "clang-format-6.0"
- "libtbb-dev"
- "libjack-jackd2-dev"
- "doxygen"
- "graphviz"

View File

@ -1,87 +0,0 @@
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.2
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -126,7 +126,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set up output paths for executable binaries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/$<CONFIG>)
# System imported libraries
@ -186,7 +186,7 @@ if (ENABLE_QT)
set(QT_PREFIX_HINT)
endif()
find_package(Qt5 REQUIRED COMPONENTS Widgets OpenGL Multimedia ${QT_PREFIX_HINT})
find_package(Qt5 REQUIRED COMPONENTS Widgets Multimedia ${QT_PREFIX_HINT})
if (ENABLE_QT_TRANSLATION)
find_package(Qt5 REQUIRED COMPONENTS LinguistTools ${QT_PREFIX_HINT})
@ -250,7 +250,7 @@ endif()
# against all the src files. This should be used before making a pull request.
# =======================================================================
set(CLANG_FORMAT_POSTFIX "-6.0")
set(CLANG_FORMAT_POSTFIX "-10")
find_program(CLANG_FORMAT
NAMES clang-format${CLANG_FORMAT_POSTFIX}
clang-format
@ -261,7 +261,7 @@ if (NOT CLANG_FORMAT)
message(STATUS "Clang format not found! Downloading...")
set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
file(DOWNLOAD
https://github.com/yuzu-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
https://github.com/citra-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
"${CLANG_FORMAT}" SHOW_PROGRESS
STATUS DOWNLOAD_SUCCESS)
if (NOT DOWNLOAD_SUCCESS EQUAL 0)
@ -344,7 +344,7 @@ add_subdirectory(externals)
# Boost
if (USE_SYSTEM_BOOST)
find_package(Boost 1.70.0 QUIET REQUIRED)
find_package(Boost 1.70.0 COMPONENTS serialization REQUIRED)
else()
add_library(Boost::boost ALIAS boost)
add_library(Boost::serialization ALIAS boost_serialization)

View File

@ -16,7 +16,6 @@ function(copy_citra_Qt5_deps target_dir)
icuuc*.dll
Qt5Core$<$<CONFIG:Debug>:d>.*
Qt5Gui$<$<CONFIG:Debug>:d>.*
Qt5OpenGL$<$<CONFIG:Debug>:d>.*
Qt5Widgets$<$<CONFIG:Debug>:d>.*
Qt5Multimedia$<$<CONFIG:Debug>:d>.*
Qt5Network$<$<CONFIG:Debug>:d>.*

View File

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

12
CMakeModules/MSVCCache.cmake Executable file
View File

@ -0,0 +1,12 @@
# 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("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}")
MESSAGE("* STRIP : ${STRIP}")
MESSAGE("* USE_CCACHE : ${USE_CCACHE}")
MESSAGE("* USE_CCACHE : ${USE_CCACHE}")
MESSAGE("")
# So that the debug info only appears once
SET(ENV{MINGW_DEBUG_INFO} SHOWN)

View File

@ -2,8 +2,7 @@
Citra
==============
[![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)
[![GitHub Actions Build Status](https://github.com/citra-emu/citra/workflows/citra-ci/badge.svg)](https://github.com/citra-emu/citra/actions)
[![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)
@ -25,7 +24,7 @@ Most of the development happens on GitHub. It's also where [our central reposito
If you want to contribute please take a look at the [Contributor's Guide](https://github.com/citra-emu/citra/wiki/Contributing) and [Developer Information](https://github.com/citra-emu/citra/wiki/Developer-Information). You should also contact any of the developers in the forum in order to know about the current state of the emulator because the [TODO list](https://docs.google.com/document/d/1SWIop0uBI9IW8VGg97TAtoT_CHNoP42FzYmvG1F4QDA) isn't maintained anymore.
If you want to contribute to the user interface translation, please checkout [citra project on transifex](https://www.transifex.com/citra/citra). We centralize the translation work there, and periodically upstream translation.
If you want to contribute to the user interface translation, please check out the [citra project on transifex](https://www.transifex.com/citra/citra). We centralize the translation work there, and periodically upstream translations.
### Building

View File

@ -1,173 +0,0 @@
# 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.
steps:
- cache-pull@2.0.1: {}
- script@1.1.5:
- cache-pull@2.4.0: {}
- script@1.1.6:
title: Install newer cmake
inputs:
- content: |-
@ -52,7 +52,7 @@ workflows:
sudo apt remove cmake -y
sudo apt purge --auto-remove cmake -y
sudo apt install ninja-build -y
version=3.10
version=3.19
build=2
mkdir ~/temp
cd ~/temp
@ -60,13 +60,13 @@ workflows:
sudo mkdir /opt/cmake
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"
- install-missing-android-tools@2.3.3:
- install-missing-android-tools@2.3.8:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- change-android-versioncode-and-versionname@1.1.1:
inputs:
- build_gradle_path: "$PROJECT_LOCATION/$MODULE/build.gradle"
- android-lint@0.9.5:
- android-lint@0.9.8:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
@ -76,19 +76,19 @@ workflows:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$TEST_VARIANT"
- android-build@0.9.5:
- android-build@0.10.3:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$BUILD_VARIANT"
- sign-apk@1.2.3:
run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}'
- deploy-to-bitrise-io@1.3.18: {}
- cache-push@2.0.5: {}
- deploy-to-bitrise-io@1.11.1: {}
- cache-push@2.4.1: {}
primary:
steps:
- cache-pull@2.0.1: {}
- script@1.1.5:
- cache-pull@2.4.0: {}
- script@1.1.6:
title: Install newer cmake
inputs:
- content: |-
@ -97,7 +97,7 @@ workflows:
sudo apt remove cmake -y
sudo apt purge --auto-remove cmake -y
sudo apt install ninja-build -y
version=3.10
version=3.19
build=2
mkdir ~/temp
cd ~/temp
@ -105,20 +105,20 @@ workflows:
sudo mkdir /opt/cmake
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"
- install-missing-android-tools@2.3.3:
- install-missing-android-tools@2.3.8:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- android-lint@0.9.5:
- android-lint@0.9.8:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$TEST_VARIANT"
- android-build@0.9.5:
- android-build@0.10.3:
inputs:
- variant: Debug
- project_location: "$PROJECT_LOCATION"
- deploy-to-bitrise-io@1.3.18: {}
- cache-push@2.0.5: {}
- deploy-to-bitrise-io@1.11.1: {}
- cache-push@2.4.1: {}
app:
envs:
- opts:

80
dist/citra.manifest vendored
View File

@ -1,24 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
<assembly manifestVersion="1.0"
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings>
<!-- Windows 7/8/8.1/10 -->
<dpiAware
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
true/pm
</dpiAware>
<!-- Windows 10, version 1607 or later -->
<dpiAwareness
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
PerMonitorV2
</dpiAwareness>
<!-- Windows 10, version 1703 or later -->
<gdiScaling
xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
true
</gdiScaling>
<ws2:longPathAware
xmlns:ws3="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
true
</ws2:longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
<compatibility
xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
<trustInfo
xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<!--
UAC settings:
- app should run at same integrity level as calling process
- app does not need to manipulate windows belonging to
higher-integrity-level processes
-->
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

File diff suppressed because it is too large Load Diff

1177
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

1003
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

1140
dist/languages/fr.ts vendored

File diff suppressed because it is too large Load Diff

5400
dist/languages/hu_HU.ts vendored

File diff suppressed because it is too large Load Diff

939
dist/languages/id.ts vendored

File diff suppressed because it is too large Load Diff

942
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

976
dist/languages/nb.ts vendored

File diff suppressed because it is too large Load Diff

935
dist/languages/nl.ts vendored

File diff suppressed because it is too large Load Diff

1177
dist/languages/pl_PL.ts vendored

File diff suppressed because it is too large Load Diff

1016
dist/languages/pt_BR.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

View File

@ -30,11 +30,16 @@ target_include_directories(catch-single-include INTERFACE catch/single_include)
# Crypto++
add_subdirectory(cryptopp)
# Dynarmic
# Xbyak
if (ARCHITECTURE_x86_64)
# Dynarmic will skip defining xbyak if it's already defined, we then define it below
add_library(xbyak INTERFACE)
option(DYNARMIC_TESTS OFF)
target_include_directories(xbyak SYSTEM INTERFACE ./xbyak/xbyak)
target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
endif()
# Dynarmic
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_ARM64)
set(DYNARMIC_TESTS OFF)
set(DYNARMIC_NO_BUNDLED_FMT ON)
set(DYNARMIC_FRONTENDS "A32")
add_subdirectory(dynarmic)
@ -74,17 +79,9 @@ target_include_directories(SoundTouch INTERFACE ./soundtouch/include)
# Teakra
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
add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL)
target_include_directories(libzstd_static INTERFACE ./zstd/lib)
target_include_directories(libzstd_static INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/externals/zstd/lib>)
# ENet
add_subdirectory(enet)
@ -131,4 +128,8 @@ if (ENABLE_WEB_SERVICE)
endif()
# lodepng
add_subdirectory(lodepng)
add_subdirectory(lodepng)
# libyuv
add_subdirectory(libyuv)
target_include_directories(yuv INTERFACE ./libyuv/include)

2
externals/catch vendored

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

2
externals/cubeb vendored

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

2
externals/dynarmic vendored

@ -1 +1 @@
Subproject commit 8d1699ba2db216e569e998ea318d5cde47720e97
Subproject commit 358cf6f0357baae3e3bb5788431acf1068f897b5

2
externals/fmt vendored

@ -1 +1 @@
Subproject commit 4b8f8fac96a7819f28f4be523ca10a2d5d8aaaf2
Subproject commit cc09f1a6798c085c325569ef466bcdcffdc266d4

2
externals/inih/inih vendored

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

View File

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

18435
externals/json/json.hpp vendored

File diff suppressed because it is too large Load Diff

1
externals/libyuv vendored Submodule

@ -0,0 +1 @@
Subproject commit 45f1f2b201672b699b35da20267a5f2c41318264

View File

@ -152,9 +152,11 @@ typedef uint16_t MicroProfileGroupId;
#include <stdint.h>
#include <string.h>
#include <thread>
#include <mutex>
#include <algorithm>
#include <array>
#include <atomic>
#include <mutex>
#include <thread>
#ifndef MICROPROFILE_API
#define MICROPROFILE_API
@ -605,28 +607,45 @@ struct MicroProfileFrameState
struct MicroProfileThreadLog
{
MicroProfileLogEntry Log[MICROPROFILE_BUFFER_SIZE];
std::array<MicroProfileLogEntry, MICROPROFILE_BUFFER_SIZE> Log{};
std::atomic<uint32_t> nPut;
std::atomic<uint32_t> nGet;
uint32_t nActive;
uint32_t nGpu;
ThreadIdType nThreadId;
std::atomic<uint32_t> nPut{0};
std::atomic<uint32_t> nGet{0};
uint32_t nActive = 0;
uint32_t nGpu = 0;
ThreadIdType nThreadId{};
uint32_t nStack[MICROPROFILE_STACK_MAX];
int64_t nChildTickStack[MICROPROFILE_STACK_MAX];
uint32_t nStackPos;
std::array<uint32_t, MICROPROFILE_STACK_MAX> nStack{};
std::array<int64_t, MICROPROFILE_STACK_MAX> nChildTickStack{};
uint32_t nStackPos = 0;
uint8_t nGroupStackPos[MICROPROFILE_MAX_GROUPS];
int64_t nGroupTicks[MICROPROFILE_MAX_GROUPS];
int64_t nAggregateGroupTicks[MICROPROFILE_MAX_GROUPS];
std::array<uint8_t, MICROPROFILE_MAX_GROUPS> nGroupStackPos{};
std::array<int64_t, MICROPROFILE_MAX_GROUPS> nGroupTicks{};
std::array<int64_t, MICROPROFILE_MAX_GROUPS> nAggregateGroupTicks{};
enum
{
THREAD_MAX_LEN = 64,
};
char ThreadName[64];
int nFreeListNext;
char ThreadName[64]{};
int nFreeListNext = 0;
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
@ -927,7 +946,11 @@ typedef HANDLE MicroProfileThread;
DWORD _stdcall ThreadTrampoline(void* 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)
@ -1018,7 +1041,7 @@ static void MicroProfileCreateThreadLogKey()
#else
MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0;
#endif
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)
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)
MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee);
@ -1151,6 +1174,7 @@ MicroProfileThreadLog* MicroProfileCreateThreadLog(const char* pName)
MP_ASSERT(pLog->nPut.load() == 0);
MP_ASSERT(pLog->nGet.load() == 0);
S.nFreeListHead = S.Pool[S.nFreeListHead]->nFreeListNext;
pLog->Reset();
}
else
{
@ -1158,7 +1182,6 @@ MicroProfileThreadLog* MicroProfileCreateThreadLog(const char* pName)
S.nMemUsage += sizeof(MicroProfileThreadLog);
S.Pool[S.nNumLogs++] = pLog;
}
memset(pLog, 0, sizeof(*pLog));
int len = (int)strlen(pName);
int maxlen = sizeof(pLog->ThreadName)-1;
len = len < maxlen ? len : maxlen;
@ -1206,8 +1229,8 @@ void MicroProfileOnThreadExit()
{
S.Frames[i].nLogStart[nLogIndex] = 0;
}
memset(pLog->nGroupStackPos, 0, sizeof(pLog->nGroupStackPos));
memset(pLog->nGroupTicks, 0, sizeof(pLog->nGroupTicks));
pLog->nGroupStackPos.fill(0);
pLog->nGroupTicks.fill(0);
}
}

View File

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

2
externals/xbyak vendored

@ -1 +1 @@
Subproject commit 1de435ed04c8e74775804da944d176baf0ce56e2
Subproject commit c306b8e5786eeeb87b8925a8af5c3bf057ff5a90

2
externals/zstd vendored

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

View File

@ -35,8 +35,6 @@ if (MSVC)
add_compile_options(
/W3
/MP
/Zi
/Zo
/permissive-
/EHsc
/volatile:iso
@ -49,6 +47,15 @@ if (MSVC)
/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
add_compile_options("$<$<CONFIG:Release>:/GS->")
@ -110,8 +117,10 @@ endif()
if (ENABLE_QT)
add_subdirectory(citra_qt)
endif()
if (ANDROID)
add_subdirectory(android/app/src/main/cpp)
include_directories(android/app/src/main)
add_subdirectory(android/app/src/main/jni)
else()
add_subdirectory(dedicated_room)
endif()

View File

@ -1,10 +1,62 @@
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.gradle
/local.properties
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.idea/
# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# CXX compile cache
app/.cxx
# Google Services (e.g. APIs or Firebase)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

View File

@ -1,8 +1,16 @@
apply plugin: 'com.android.application'
/**
* Use the number of seconds/10 since Jan 1 2016 as the versionCode.
* This lets us upload a new build at most every 10 seconds for the
* next 680 years.
*/
def autoVersion = (int) (((new Date().getTime() / 1000) - 1451606400) / 10)
def buildType
def abiFilter = "arm64-v8a" //, "x86"
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
compileSdkVersion 29
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@ -13,34 +21,54 @@ android {
// This is important as it will run lint but not abort on error
// Lint has some overly obnoxious "errors" that should really be warnings
abortOnError false
//Uncomment disable lines for test builds...
//disable 'MissingTranslation'bin
//disable 'ExtraTranslation'
}
defaultConfig {
applicationId "org.citra_emu"
minSdkVersion 21
targetSdkVersion 26
versionCode(getBuildVersionCode())
versionName "${getVersion()}"
// TODO If this is ever modified, change application_id in strings.xml
applicationId "org.citra.citra_emu"
minSdkVersion 26
targetSdkVersion 29
versionCode autoVersion
versionName getVersion()
ndk.abiFilters abiFilter
}
signingConfigs {
release {
if (project.hasProperty('keystore')) {
storeFile file(project.property('keystore'))
storePassword project.property('storepass')
keyAlias project.property('keyalias')
keyPassword project.property('keypass')
}
}
//release {
// storeFile file('')
// storePassword System.getenv('ANDROID_KEYPASS')
// keyAlias = 'key0'
// keyPassword System.getenv('ANDROID_KEYPASS')
//}
}
applicationVariants.all { variant ->
buildType = variant.buildType.name // sets the current build type
}
// Define build types, which are orthogonal to product flavors.
buildTypes {
// Signed by release key, allowing for upload to Play Store.
release {
signingConfig signingConfigs.release
signingConfig signingConfigs.debug
}
// builds a release build that doesn't need signing
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
relWithDebInfo {
initWith release
applicationIdSuffix ".debug"
versionNameSuffix '-debug'
signingConfig signingConfigs.debug
minifyEnabled false
testCoverageEnabled false
debuggable true
jniDebuggable true
}
// Signed by debug key disallowing distribution on Play Store.
@ -49,13 +77,14 @@ android {
// TODO If this is ever modified, change application_id in debug/strings.xml
applicationIdSuffix ".debug"
versionNameSuffix '-debug'
debuggable true
jniDebuggable true
}
}
externalNativeBuild {
cmake {
version getCmakeVersion()
version "3.10.2"
path "../../../CMakeLists.txt"
}
}
@ -65,76 +94,46 @@ android {
cmake {
arguments "-DENABLE_QT=0", // Don't use QT
"-DENABLE_SDL2=0", // Don't use SDL
"-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work
"-DENABLE_CUBEB=0",
"-DANDROID_STL=c++_shared"
"-DENABLE_WEB_SERVICE=0", // Don't use telemetry
"-DANDROID_ARM_NEON=true" // cryptopp requires Neon to work
abiFilters "arm64-v8a"
targets "citra-android"
abiFilters abiFilter
}
}
}
}
ext {
androidSupportVersion = '26.1.0'
}
dependencies {
implementation "com.android.support:support-v13:$androidSupportVersion"
implementation "com.android.support:cardview-v7:$androidSupportVersion"
implementation "com.android.support:recyclerview-v7:$androidSupportVersion"
implementation "com.android.support:design:$androidSupportVersion"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
// Android TV UI libraries.
implementation "com.android.support:leanback-v17:$androidSupportVersion"
// For loading huge screenshots from the disk.
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
// Allows FRP-style asynchronous operations in Android.
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'com.nononsenseapps:filepicker:4.2.1'
implementation 'org.ini4j:ini4j:0.5.4'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
testImplementation "com.android.support.test:runner:1.0.2"
androidTestImplementation "com.android.support.test:runner:1.0.1"
implementation 'com.android.billingclient:billing:2.0.3'
}
def getVersion() {
def versionNumber = '0.0'
def versionName = '0.0'
try {
versionNumber = 'git describe --always --long'.execute([], project.rootDir).text
versionName = 'git describe --always --long'.execute([], project.rootDir).text
.trim()
.replaceAll(/(-0)?-[^-]+$/, "")
} catch (Exception e) {
logger.error('Cannot find git, defaulting to dummy version number')
}
return versionNumber
}
def getBuildVersionCode() {
try {
def versionNumber = 'git rev-list --first-parent --count HEAD'.execute([], project.rootDir).text
.trim()
return Integer.valueOf(versionNumber)
} catch (Exception e) {
logger.error('Cannot find git, defaulting to dummy version number')
}
return 0
}
def getCmakeVersion() {
try {
// Tokenized form of the output will be - ["cmake", "version", "M.m.p-rcx"], the version number
// will be at index 2
def version_string = 'cmake -version'.execute([], project.rootDir).text
.trim().tokenize()[2]
return version_string
}
catch(Exception e) {
logger.error('Cannot find Cmake, using default Cmake')
}
return null
return versionName
}

View File

@ -1,4 +1,4 @@
package org.citra_emu.citra;
package org.citra.citra_emu;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("org.citra_emu.citra_android", appContext.getPackageName());
assertEquals("org.citra.citra_emu", appContext.getPackageName());
}
}

View File

@ -1,39 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.citra_emu.citra">
package="org.citra.citra_emu">
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
<uses-feature
android:name="android.hardware.gamepad"
android:required="false"/>
<uses-feature android:glEsVersion="0x00030001" />
<uses-feature android:glEsVersion="0x00030002" android:required="true" />
<uses-feature android:name="android.hardware.opengles.aep" android:required="true" />
<uses-feature
android:name="android.hardware.camera.any"
android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:name="org.citra_emu.citra.CitraApplication"
android:label="Citra"
android:icon="@mipmap/ic_citra"
android:allowBackup="true"
android:name="org.citra.citra_emu.CitraApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:supportsRtl="true"
android:isGame="true"
android:banner="@mipmap/ic_citra">
android:banner="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true">
<activity
android:name=".ui.main.MainActivity"
android:theme="@style/CitraBase">
android:name="org.citra.citra_emu.ui.main.MainActivity"
android:theme="@style/CitraBase"
android:resizeableActivity="false">
<!-- This intentfilter marks this Activity as the one that gets launched from Home screen. -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="org.citra.citra_emu.features.settings.ui.SettingsActivity"
android:configChanges="orientation|screenSize|uiMode"
android:theme="@style/CitraSettingsBase"
android:label="@string/preferences_settings"/>
<activity
android:name="org.citra.citra_emu.activities.EmulationActivity"
android:resizeableActivity="false"
android:theme="@style/CitraEmulationBase"
android:launchMode="singleTop"/>
<service android:name="org.citra.citra_emu.utils.ForegroundService"/>
<activity
android:name="org.citra.citra_emu.activities.CustomFilePickerActivity"
android:label="@string/app_name"
android:theme="@style/FilePickerTheme">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service android:name="org.citra.citra_emu.utils.DirectoryInitialization"/>
<provider
android:name="org.citra.citra_emu.model.GameProvider"
android:authorities="${applicationId}.provider"
android:enabled="true"
android:exported="false">
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.filesprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nnf_provider_paths" />
</provider>
</application>
</manifest>

View File

@ -1,16 +0,0 @@
cmake_minimum_required(VERSION 3.8)
add_library(citra-android SHARED
logging/log.cpp
logging/logcat_backend.cpp
logging/logcat_backend.h
native_interface.cpp
native_interface.h
ui/main/main_activity.cpp
)
# find Android's log library
find_library(log-lib log)
target_link_libraries(citra-android ${log-lib} core common inih)
target_include_directories(citra-android PRIVATE "../../../../../" "./")

View File

@ -1,15 +0,0 @@
#include "common/logging/log.h"
#include "native_interface.h"
namespace Log {
extern "C" {
JNICALL void Java_org_citra_1emu_citra_LOG_logEntry(JNIEnv* env, jclass type, jint level,
jstring file_name, jint line_number,
jstring function, jstring msg) {
using CitraJNI::GetJString;
FmtLogMessage(Class::Frontend, static_cast<Level>(level), GetJString(env, file_name).data(),
static_cast<unsigned int>(line_number), GetJString(env, function).data(),
GetJString(env, msg).data());
}
}
} // namespace Log

View File

@ -1,38 +0,0 @@
// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <android/log.h>
#include "common/assert.h"
#include "common/logging/text_formatter.h"
#include "logcat_backend.h"
namespace Log {
void LogcatBackend::Write(const Entry& entry) {
android_LogPriority priority;
switch (entry.log_level) {
case Level::Trace:
priority = ANDROID_LOG_VERBOSE;
break;
case Level::Debug:
priority = ANDROID_LOG_DEBUG;
break;
case Level::Info:
priority = ANDROID_LOG_INFO;
break;
case Level::Warning:
priority = ANDROID_LOG_WARN;
break;
case Level::Error:
priority = ANDROID_LOG_ERROR;
break;
case Level::Critical:
priority = ANDROID_LOG_FATAL;
break;
case Level::Count:
UNREACHABLE();
}
__android_log_print(priority, "citra", "%s\n", FormatLogMessage(entry).c_str());
}
} // namespace Log

View File

@ -1,22 +0,0 @@
// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "common/logging/backend.h"
namespace Log {
class LogcatBackend : public Backend {
public:
static const char* Name() {
return "Logcat";
}
const char* GetName() const override {
return Name();
}
void Write(const Entry& entry) override;
};
} // namespace Log

View File

@ -1,22 +0,0 @@
// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "native_interface.h"
namespace CitraJNI {
jint JNI_OnLoad(JavaVM* vm, void* reserved) {
return JNI_VERSION_1_6;
}
std::string GetJString(JNIEnv* env, jstring jstr) {
std::string result = "";
if (!jstr)
return result;
const char* s = env->GetStringUTFChars(jstr, nullptr);
result = s;
env->ReleaseStringUTFChars(jstr, s);
return result;
}
} // namespace CitraJNI

View File

@ -1,16 +0,0 @@
// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <string>
#include <jni.h>
namespace CitraJNI {
extern "C" {
jint JNI_OnLoad(JavaVM* vm, void* reserved);
}
std::string GetJString(JNIEnv* env, jstring jstr);
} // namespace CitraJNI

View File

@ -1,31 +0,0 @@
// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/common_paths.h"
#include "common/file_util.h"
#include "common/logging/filter.h"
#include "common/logging/log.h"
#include "core/settings.h"
#include "logging/logcat_backend.h"
#include "native_interface.h"
namespace MainActivity {
extern "C" {
JNICALL void Java_org_citra_1emu_citra_ui_main_MainActivity_initUserPath(JNIEnv* env, jclass type,
jstring path) {
FileUtil::SetUserPath(CitraJNI::GetJString(env, path) + '/');
}
JNICALL void Java_org_citra_1emu_citra_ui_main_MainActivity_initLogging(JNIEnv* env, jclass type) {
Log::Filter log_filter(Log::Level::Debug);
log_filter.ParseFilterString(Settings::values.log_filter);
Log::SetGlobalFilter(log_filter);
const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir);
FileUtil::CreateFullPath(log_dir);
Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE));
Log::AddBackend(std::make_unique<Log::LogcatBackend>());
}
};
}; // namespace MainActivity

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