mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-04-02 11:01:52 -04:00
Compare commits
442 commits
Author | SHA1 | Date | |
---|---|---|---|
|
57ff99ce53 | ||
|
8b5cafa98e | ||
|
186e92221a | ||
|
31d2db6f78 | ||
|
ebb5ab53e2 | ||
|
a6fb0a48eb | ||
|
ec2d7c086a | ||
|
c714e8cb6b | ||
|
e834515f43 | ||
|
4f9eea07e0 | ||
|
372c314f06 | ||
|
5bd253a1f8 | ||
|
4ac65159ef | ||
|
eab1b24320 | ||
|
07cd402531 | ||
|
0a59085021 | ||
|
8dd809d725 | ||
|
1923b7a7c4 | ||
|
f61539a262 | ||
|
92021db230 | ||
|
4b792aa4d2 | ||
|
1e30d72658 | ||
|
2b0cbf7f6b | ||
|
3738ccd2e6 | ||
|
b53b223ba9 | ||
|
6aaad1eb83 | ||
|
adab729f43 | ||
|
dd0af0a56f | ||
|
934cb54605 | ||
|
356cf0e5e0 | ||
|
e2d0871ca3 | ||
|
40d9664d1c | ||
|
eca7374567 | ||
|
80a6057512 | ||
|
0735237686 | ||
|
90eb2e01f4 | ||
|
409f12b13a | ||
|
7b513f1744 | ||
|
c3e29fb619 | ||
|
2065ac5f63 | ||
|
269d5b9aab | ||
|
6f9f3d52ea | ||
|
719c631f13 | ||
|
66658351c1 | ||
|
a5717e1b11 | ||
|
ca2e0a7c31 | ||
|
2e829479d9 | ||
|
4ac1ab162a | ||
|
813f9148b1 | ||
|
9941e00b54 | ||
|
1c49a8a1ba | ||
|
47001ad233 | ||
|
459fd5d9bb | ||
|
63e1289bb5 | ||
|
f9a4b2dbb1 | ||
|
d6575455ee | ||
|
3acd0c4f2c | ||
|
6dc73f5d79 | ||
|
8508c62540 | ||
|
adffd53dbd | ||
|
a05bdb172d | ||
|
1a4d9660e7 | ||
|
ba54d1540c | ||
|
0d8fd7c0dc | ||
|
b06990607d | ||
|
9a53b19403 | ||
|
03484d2146 | ||
|
1234e2c118 | ||
|
d7f39aab05 | ||
|
dc9d99b03b | ||
|
573c98b2f8 | ||
|
9e53c1ce27 | ||
|
958137a301 | ||
|
294a6de779 | ||
|
2843da4479 | ||
|
b0bab273e2 | ||
|
c49296acdc | ||
|
a6d8c0fb9f | ||
|
e551f8f524 | ||
|
f52970c822 | ||
|
e02cc42d67 | ||
|
9812a47cb1 | ||
|
7fd532436d | ||
|
598298cb3d | ||
|
54e695a6e8 | ||
|
bf2208145b | ||
|
b52b676413 | ||
|
2129644781 | ||
|
d81eb952a4 | ||
|
1575866eca | ||
|
517e68fe57 | ||
|
593da5ed79 | ||
|
c73fa3761c | ||
|
5328e9eb10 | ||
|
47f1dcf996 | ||
|
252429933f | ||
|
026d547dcc | ||
|
f1685eab66 | ||
|
4b9c7c0d30 | ||
|
e65abf4898 | ||
|
a1c1a608d7 | ||
|
64232ffdbd | ||
|
7522c8470e | ||
|
9d366937cd | ||
|
5209677f2f | ||
|
64b0b85ed5 | ||
|
aefbb918be | ||
|
93b58ae6f7 | ||
|
f3d20832c1 | ||
|
d4c2c3d209 | ||
|
1672f969bb | ||
|
6772b1993f | ||
|
16070458ed | ||
|
5f825a1fa8 | ||
|
d33337d539 | ||
|
f576269ed0 | ||
|
da8fd5b7c7 | ||
|
1ee9d5c78c | ||
|
aadd2f4a1a | ||
|
149fe10a4e | ||
|
917ea2ef23 | ||
|
b048a1fd9e | ||
|
a059338890 | ||
|
523a1652df | ||
|
c913a59c7a | ||
|
964d2acb44 | ||
|
a115921b43 | ||
|
eb1983daa6 | ||
|
8fe69cd0fb | ||
|
41fe598e33 | ||
|
8e8431113a | ||
|
1c6b209692 | ||
|
84e78088fb | ||
|
13b90874f9 | ||
|
cf41c3b136 | ||
|
97d8cf4ba3 | ||
|
b2a6cccc89 | ||
|
10d553e1c9 | ||
|
3f8722f0a6 | ||
|
065fb7eb58 | ||
|
7d6d417354 | ||
|
bd13d4bdc3 | ||
|
bf37a8281e | ||
|
dd3ed56509 | ||
|
70afe3a033 | ||
|
dc480ac00b | ||
|
f28043e0e9 | ||
|
a744670486 | ||
|
48d2a8371b | ||
|
91a010fbdd | ||
|
a16c37f0c5 | ||
|
041f29a914 | ||
|
1b5c885621 | ||
|
c11d83e9d8 | ||
|
379950d185 | ||
|
e7c6862e19 | ||
|
1c73dc9e1b | ||
|
c038e758ae | ||
|
b2be3c13df | ||
|
fdf239929f | ||
|
5be98da0ac | ||
|
efbbb817fe | ||
|
989e2b8c8c | ||
|
e2f9725719 | ||
|
ee36992bd6 | ||
|
10c78eccce | ||
|
6ea42d958c | ||
|
9c28a728e4 | ||
|
d5a8530246 | ||
|
84cad8b280 | ||
|
391533dbe5 | ||
|
bac1ac3b49 | ||
|
d45c2fa6d1 | ||
|
12eda10387 | ||
|
33a74c2035 | ||
|
7b635e7eb8 | ||
|
9b30be0258 | ||
|
efbf712305 | ||
|
74e8d205b0 | ||
|
fde7230191 | ||
|
075eac626b | ||
|
85141f17f9 | ||
|
5c0d5a54ac | ||
|
51072b510c | ||
|
3e467e220e | ||
|
fa8bab2f39 | ||
|
60adc38205 | ||
|
b0b2c25762 | ||
|
5230fcab37 | ||
|
4f3d4624f5 | ||
|
111e383d1b | ||
|
fa4ad9b8c1 | ||
|
4b7d2f88ae | ||
|
4d148b3696 | ||
|
241915e1a6 | ||
|
17060752b6 | ||
|
4d609f06b8 | ||
|
42d14eec96 | ||
|
eaa82817dd | ||
|
731713de3a | ||
|
193767e6cc | ||
|
bc04662525 | ||
|
8bc444bb97 | ||
|
6fa77feba3 | ||
|
224866c3d2 | ||
|
a50e25300d | ||
|
1f9b89116f | ||
|
40d1eaeb72 | ||
|
dd7cb74cd2 | ||
|
0993658c82 | ||
|
3d0d987d89 | ||
|
bb88b5c36d | ||
|
ccabd93159 | ||
|
788da3cdf7 | ||
|
e1435066ee | ||
|
a2d74972d4 | ||
|
f69fddc6e5 | ||
|
d9e8ca2c83 | ||
|
b390023bc5 | ||
|
ea68f787eb | ||
|
9f9bc9865f | ||
|
b8d81283e8 | ||
|
8f1cd4f925 | ||
|
49c55a3f56 | ||
|
8b37e316d0 | ||
|
a63678c1f4 | ||
|
72ce4838ea | ||
|
96bbd3bd25 | ||
|
3a02490a1f | ||
|
8d7fc98275 | ||
|
ed01eaf5f9 | ||
|
9bbb7c8b97 | ||
|
6a08d04af9 | ||
|
81acd80a97 | ||
|
ca01e923bf | ||
|
4e4ac0de51 | ||
|
18679af4ec | ||
|
72aacbdcec | ||
|
e53c63b828 | ||
|
f899ab7c34 | ||
|
7e778042ee | ||
|
f58b260cbd | ||
|
f39a5e757b | ||
|
9b0a1d53dc | ||
|
223833cac4 | ||
|
4405116324 | ||
|
bab1616565 | ||
|
d2ba4e65c5 | ||
|
2167143c17 | ||
|
df282ab230 | ||
|
646835346c | ||
|
dee764473d | ||
|
e7fa8ec0c6 | ||
|
bffeb818d1 | ||
|
67f7ce815c | ||
|
9398c0ca6b | ||
|
f6bb666abf | ||
|
b6aaf66330 | ||
|
1849083073 | ||
|
09409a5108 | ||
|
5047c4d083 | ||
|
f3c95f72e7 | ||
|
b0a7fd4e07 | ||
|
9bb409314d | ||
|
9ec50b865d | ||
|
63861bf812 | ||
|
66711529be | ||
|
c440ecdf36 | ||
|
2959802ae2 | ||
|
0d71885c88 | ||
|
13a50a915e | ||
|
d4a2a8e8de | ||
|
db44a2d130 | ||
|
db53f3b980 | ||
|
29c823fa1f | ||
|
757d458161 | ||
|
ff9d180154 | ||
|
9523993a24 | ||
|
5b27d32cb7 | ||
|
43976ca7eb | ||
|
ce34b95b82 | ||
|
8bb7ce098c | ||
|
8a4abb8bbb | ||
|
6217276681 | ||
|
21c1f84a87 | ||
|
abce406ee8 | ||
|
f6c3c96d94 | ||
|
5ad57bb0c9 | ||
|
f9f6206929 | ||
|
3e925b7707 | ||
|
4d6b72b353 | ||
|
65e5e20afc | ||
|
638c4014a1 | ||
|
b4aa10bee4 | ||
|
1d398551e2 | ||
|
90c56b7731 | ||
|
323bdfa183 | ||
|
98b5a8758a | ||
|
2a735f1fb7 | ||
|
14dd7a72a7 | ||
|
92ab87b049 | ||
|
b902aa2048 | ||
|
fda5ec2697 | ||
|
f04c7575d7 | ||
|
c168cf536a | ||
|
62889adfde | ||
|
524188bb7a | ||
|
96800c6f97 | ||
|
c66ab0c51a | ||
|
c16e258c93 | ||
|
4d1864c8a1 | ||
|
d7f0d67904 | ||
|
2abf1c2059 | ||
|
5e84862e28 | ||
|
d8b9a74d86 | ||
|
85aa4f095b | ||
|
892ae13680 | ||
|
890df997cb | ||
|
22bf6420d2 | ||
|
a17111e6b0 | ||
|
911573e0dd | ||
|
0f469eb2b9 | ||
|
6268a24a4b | ||
|
0d96255bae | ||
|
67819a68d9 | ||
|
651e5336b4 | ||
|
1d1e1e781b | ||
|
7111cbb103 | ||
|
34ff9da097 | ||
|
2200cc0ddf | ||
|
bfbeeae6f6 | ||
|
f1c200a016 | ||
|
ea86c77088 | ||
|
b0ae008a89 | ||
|
9499870cc9 | ||
|
45072fccb2 | ||
|
4a04fab9c4 | ||
|
a8d157d310 | ||
|
1beec40445 | ||
|
cd3fe0685f | ||
|
a533c485d9 | ||
|
fd3b5b7f27 | ||
|
950e9564e6 | ||
|
f0ef8f3cc2 | ||
|
f6a1cc598e | ||
|
633e5c0e05 | ||
|
808d1bb424 | ||
|
7886b594a2 | ||
|
0bead50065 | ||
|
f1ebfa9941 | ||
|
ae4cb45cf3 | ||
|
6073ab3ec6 | ||
|
4ae5b4f8b8 | ||
|
d903b2cf12 | ||
|
b8dec03cb5 | ||
|
eda4cf4b24 | ||
|
dba724c4a0 | ||
|
5530e5c613 | ||
|
5c1c05adde | ||
|
1bcdb35e42 | ||
|
b74ae21953 | ||
|
d56bc807cf | ||
|
1f16e999c5 | ||
|
e58a84629f | ||
|
caa57a3cfd | ||
|
f48ad6a1ca | ||
|
c209feeaaa | ||
|
e3e167b8ba | ||
|
41f2c27229 | ||
|
80953fe603 | ||
|
27a5671056 | ||
|
a519b01b58 | ||
|
9c6e3fb144 | ||
|
a6e9481b64 | ||
|
ecb7b77326 | ||
|
a640bd079c | ||
|
486e228f72 | ||
|
a8b30cf96b | ||
|
fe2855168d | ||
|
d27935a1bd | ||
|
916e9099ac | ||
|
4be57f4896 | ||
|
072c18a6e3 | ||
|
3428e4dae6 | ||
|
59f6fe6e2f | ||
|
55e1551cc7 | ||
|
27f7b4d550 | ||
|
82783d0f53 | ||
|
cb9570e229 | ||
|
b3180bc4a6 | ||
|
be1e77186e | ||
|
715d2247a9 | ||
|
aa63a6a36e | ||
|
02ec40b7ba | ||
|
9a75e8df53 | ||
|
3ff3b732c8 | ||
|
a7f6043205 | ||
|
18a266155f | ||
|
823386cc09 | ||
|
9049ad91f9 | ||
|
eaf006d606 | ||
|
e803c6be47 | ||
|
9fb8f4cb6b | ||
|
504e0488a8 | ||
|
040cc27a40 | ||
|
8ce3f834c4 | ||
|
3acdd47eaf | ||
|
a2c518354f | ||
|
466ad8d35e | ||
|
f8ea594447 | ||
|
4a564e2447 | ||
|
43c9a4eccd | ||
|
b87465fd8a | ||
|
44c16e1c64 | ||
|
4c697d3755 | ||
|
80b1c50b50 | ||
|
9d25b88368 | ||
|
05e0f349e0 | ||
|
6d75776b28 | ||
|
05d82b09e9 | ||
|
cbb79fd34c | ||
|
daf3ef060a | ||
|
f3ff919be2 | ||
|
ca79a6aa0d | ||
|
8651c4bae7 | ||
|
9a4f945f33 | ||
|
404af95a2c | ||
|
859dc78e90 | ||
|
387b712959 | ||
|
9bbfd33842 | ||
|
43b5ad2f1c | ||
|
4b5014c16a | ||
|
f2671f417f | ||
|
9d55f46eb1 | ||
|
4014de622b | ||
|
1cf72265cd | ||
|
1e946f76be | ||
|
33bd10b4e0 | ||
|
1b660e0c16 | ||
|
0c6f18ab97 | ||
|
058d11b49b | ||
|
fcab8f8f1a |
645 changed files with 45780 additions and 20622 deletions
66
.clang-format
Normal file
66
.clang-format
Normal file
|
@ -0,0 +1,66 @@
|
|||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: Always
|
||||
AfterEnum: true
|
||||
AfterExternBlock: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeElse: true
|
||||
BeforeWhile: true
|
||||
SplitEmptyFunction: false
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeTernaryOperators: true
|
||||
ColumnLimit: 0
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
ObjCSpaceAfterProperty: false
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Latest
|
||||
TabWidth: 4
|
||||
UseTab: Always
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
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 Cemu or you are requesting a feature you believe would make Cemu better.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!---
|
||||
Please keep in mind Cemu is EXPERIMENTAL SOFTWARE.
|
||||
|
||||
Please read the FAQ:
|
||||
https://cemu.info/faq.html/
|
||||
|
||||
THIS IS NOT A SUPPORT FORUM, FOR SUPPORT GO TO:
|
||||
https://discord.com/invite/5psYsup/
|
||||
|
||||
If the FAQ does not answer your question, please go to:
|
||||
https://discord.com/invite/5psYsup/
|
||||
|
||||
When submitting an issue, please check the following:
|
||||
|
||||
- You have read the above.
|
||||
- You have provided the version (commit hash) of Cemu you are using.
|
||||
- You have provided sufficient detail for the issue to be reproduced.
|
||||
- You have provided system specs (if relevant).
|
||||
- Please also provide:
|
||||
- For any issues, a log file
|
||||
- For crashes, a backtrace.
|
||||
- For graphical issues, comparison screenshots with real hardware.
|
||||
- For emulation inaccuracies, a test-case (if able).
|
||||
|
||||
-->
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -2,4 +2,4 @@ blank_issues_enabled: false
|
|||
contact_links:
|
||||
- name: Cemu Discord
|
||||
url: https://discord.com/invite/5psYsup
|
||||
about: If you are experiencing an issue with Cemu, and you need tech support, or if you have a general question, try asking in the official Cemu Discord linked here. Piracy is not allowed.
|
||||
about: If you need technical support with Cemu or have other questions the best place to ask is on the official Cemu Discord linked here
|
||||
|
|
69
.github/ISSUE_TEMPLATE/emulation_bug_report.yaml
vendored
Normal file
69
.github/ISSUE_TEMPLATE/emulation_bug_report.yaml
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
# Docs - https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Bug Report
|
||||
description: Report an issue with Cemu emulator
|
||||
title: "Enter a title for the bug report here"
|
||||
labels: bug
|
||||
body:
|
||||
- type: markdown
|
||||
id: md_readme
|
||||
attributes:
|
||||
value: |
|
||||
## Important: Read First
|
||||
|
||||
If you discovered a bug you can report it here. Please make sure of the following first:
|
||||
- That you are using the latest version of Cemu
|
||||
- Only report something if you are sure it's a bug and not any technical issue on your end. For troubleshooting help see the [links page](https://github.com/cemu-project/Cemu#links)
|
||||
- Problems specific to a single game should be reported on the [compatibility wiki](https://wiki.cemu.info/wiki/Main_Page) instead
|
||||
- Verify that your problem isn't already mentioned on the [issue tracker](https://github.com/cemu-project/Cemu/issues)
|
||||
|
||||
Additionally, be aware that graphic packs can also causes issues. There is a separate issue tracker for graphic pack bugs over at the [graphic pack repository](https://github.com/cemu-project/cemu_graphic_packs)
|
||||
- type: textarea
|
||||
id: current_behavior
|
||||
attributes:
|
||||
label: Current Behavior
|
||||
description: "What the bug is, in a brief description"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: "What did you expect to happen?"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps_to_reproduce
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: "How to reproduce the issue"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: sys_info
|
||||
attributes:
|
||||
label: System Info (Optional)
|
||||
description: "Your PC specifications. Usually only the operating system and graphics card is important. But feel free to add more info."
|
||||
placeholder: |
|
||||
Info
|
||||
OS: Windows 10
|
||||
GPU: NVIDIA GeForce RTX 4090
|
||||
value: |
|
||||
OS:
|
||||
GPU:
|
||||
- type: textarea
|
||||
id: emulation_settings
|
||||
attributes:
|
||||
label: Emulation Settings (Optional)
|
||||
description: |
|
||||
Any non-default settings. You can leave this empty if you didn't change anything other than input settings.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: logs_files
|
||||
attributes:
|
||||
label: "Logs (Optional)"
|
||||
description: |
|
||||
"Attach `log.txt` from your Cemu folder (*File > Open Cemu folder*)".
|
||||
validations:
|
||||
required: false
|
28
.github/ISSUE_TEMPLATE/feature_report.yaml
vendored
Normal file
28
.github/ISSUE_TEMPLATE/feature_report.yaml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Docs - https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Feature suggestion
|
||||
description: Suggest a new feature
|
||||
title: "Enter a title for the suggestion here"
|
||||
labels: feature request
|
||||
body:
|
||||
- type: markdown
|
||||
id: md_readme
|
||||
attributes:
|
||||
value: |
|
||||
## Important: Read First
|
||||
|
||||
While we appreciate suggestions, it is important to note that we are a very small team and there are already many more ideas than we could ever implement in the near future. Therefore, please only suggest something if you believe it is a great addition and the idea is reasonably unique.
|
||||
|
||||
*Avoid* to create suggestions for:
|
||||
- Overly obvious features ("Game xyz does not work and should be fixed", "Wiimote support should be improved", "You should add an Android port", "Copy feature xyz from another emulator", "A button to pause/stop emulation")
|
||||
- Niche features which are only interesting to a tiny percentage of users
|
||||
- Large scale features ("Add a Metal backend for MacOS", "Add ARM support", "Add savestates")
|
||||
|
||||
Note that this doesn't mean we aren't interested in these ideas, but rather we likely have them planned anyway and it's mostly up to finding the time to implement them.
|
||||
If you believe your idea is worthwhile even if it doesn't meet all the criteria above, you can still try suggesting it but we might close it.
|
||||
- type: textarea
|
||||
id: idea_suggestion
|
||||
attributes:
|
||||
label: Your suggestion
|
||||
description: "Describe what your suggestion is in as much detail as possible"
|
||||
validations:
|
||||
required: true
|
9
.github/getversion.cpp
vendored
9
.github/getversion.cpp
vendored
|
@ -1,9 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include "./../src/Common/version.h"
|
||||
|
||||
// output current Cemu version for CI workflow. Do not modify
|
||||
int main()
|
||||
{
|
||||
printf("%d.%d", EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR);
|
||||
return 0;
|
||||
}
|
136
.github/workflows/build.yml
vendored
136
.github/workflows/build.yml
vendored
|
@ -3,10 +3,10 @@ name: Build Cemu
|
|||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
deploymode:
|
||||
next_version_major:
|
||||
required: false
|
||||
type: string
|
||||
experimentalversion:
|
||||
next_version_minor:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
|
@ -16,37 +16,35 @@ env:
|
|||
|
||||
jobs:
|
||||
build-ubuntu:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: "Checkout repo"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "recursive"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup release mode parameters (for deploy)
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
- name: Setup release mode parameters
|
||||
run: |
|
||||
echo "BUILD_MODE=release" >> $GITHUB_ENV
|
||||
echo "BUILD_FLAGS=" >> $GITHUB_ENV
|
||||
echo "Build mode is release"
|
||||
|
||||
- name: Setup debug mode parameters (for continous build)
|
||||
if: ${{ inputs.deploymode != 'release' }}
|
||||
- name: Setup build flags for version
|
||||
if: ${{ inputs.next_version_major != '' }}
|
||||
run: |
|
||||
echo "BUILD_MODE=debug" >> $GITHUB_ENV
|
||||
echo "BUILD_FLAGS=" >> $GITHUB_ENV
|
||||
echo "Build mode is debug"
|
||||
|
||||
- name: Setup version for experimental
|
||||
if: ${{ inputs.experimentalversion != '' }}
|
||||
run: |
|
||||
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
|
||||
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV
|
||||
echo "[INFO] Version ${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}"
|
||||
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEMULATOR_VERSION_MAJOR=${{ inputs.next_version_major }} -DEMULATOR_VERSION_MINOR=${{ inputs.next_version_minor }}" >> $GITHUB_ENV
|
||||
|
||||
- name: "Install system dependencies"
|
||||
run: |
|
||||
sudo apt update -qq
|
||||
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build
|
||||
sudo apt install -y clang-15 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libudev-dev nasm ninja-build libbluetooth-dev
|
||||
|
||||
- name: "Setup cmake"
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.29.0'
|
||||
|
||||
- name: "Bootstrap vcpkg"
|
||||
run: |
|
||||
|
@ -68,31 +66,29 @@ jobs:
|
|||
|
||||
- name: "cmake"
|
||||
run: |
|
||||
cmake -S . -B build ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DPORTABLE=OFF -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja
|
||||
cmake -S . -B build ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja
|
||||
|
||||
- name: "Build Cemu"
|
||||
run: |
|
||||
cmake --build build
|
||||
|
||||
- name: Prepare artifact
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
run: mv bin/Cemu_release bin/Cemu
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-linux-x64
|
||||
path: ./bin/Cemu
|
||||
|
||||
build-appimage:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build-ubuntu
|
||||
steps:
|
||||
- name: Checkout Upstream Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-linux-x64
|
||||
path: bin
|
||||
|
@ -100,13 +96,16 @@ jobs:
|
|||
- name: "Install system dependencies"
|
||||
run: |
|
||||
sudo apt update -qq
|
||||
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build appstream
|
||||
sudo apt install -y clang-15 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build appstream libbluetooth-dev
|
||||
|
||||
- name: "Build AppImage"
|
||||
run: dist/linux/appimage.sh
|
||||
run: |
|
||||
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
|
||||
export DEPLOY_GTK_VERSION=3
|
||||
dist/linux/appimage.sh
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cemu-appimage-x64
|
||||
path: artifacts
|
||||
|
@ -115,28 +114,26 @@ jobs:
|
|||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: "Checkout repo"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: Setup release mode parameters (for deploy)
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
- name: Setup release mode parameters
|
||||
run: |
|
||||
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "Build mode is release"
|
||||
|
||||
- name: Setup debug mode parameters (for continous build)
|
||||
if: ${{ inputs.deploymode != 'release' }}
|
||||
- name: Setup build flags for version
|
||||
if: ${{ inputs.next_version_major != '' }}
|
||||
run: |
|
||||
echo "BUILD_MODE=debug" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "Build mode is debug"
|
||||
- name: Setup version for experimental
|
||||
if: ${{ inputs.experimentalversion != '' }}
|
||||
run: |
|
||||
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
|
||||
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "[INFO] Version ${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}"
|
||||
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEMULATOR_VERSION_MAJOR=${{ inputs.next_version_major }} -DEMULATOR_VERSION_MINOR=${{ inputs.next_version_minor }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: "Setup cmake"
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.29.0'
|
||||
|
||||
- name: "Bootstrap vcpkg"
|
||||
run: |
|
||||
|
@ -167,49 +164,54 @@ jobs:
|
|||
- name: "Build Cemu"
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --config ${{ env.BUILD_MODE }} -j 2
|
||||
cmake --build . --config ${{ env.BUILD_MODE }}
|
||||
|
||||
- name: Prepare artifact
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
run: Rename-Item bin/Cemu_release.exe Cemu.exe
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-windows-x64
|
||||
path: ./bin/Cemu.exe
|
||||
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-12
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- name: "Checkout repo"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "recursive"
|
||||
- name: Setup release mode parameters (for deploy)
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
|
||||
- name: Setup release mode parameters
|
||||
run: |
|
||||
echo "BUILD_MODE=release" >> $GITHUB_ENV
|
||||
echo "BUILD_FLAGS=" >> $GITHUB_ENV
|
||||
echo "Build mode is release"
|
||||
- name: Setup debug mode parameters (for continous build)
|
||||
if: ${{ inputs.deploymode != 'release' }}
|
||||
run: |
|
||||
echo "BUILD_MODE=debug" >> $GITHUB_ENV
|
||||
echo "BUILD_FLAGS=" >> $GITHUB_ENV
|
||||
echo "Build mode is debug"
|
||||
|
||||
- name: Setup version for experimental
|
||||
if: ${{ inputs.experimentalversion != '' }}
|
||||
- name: Setup build flags for version
|
||||
if: ${{ inputs.next_version_major != '' }}
|
||||
run: |
|
||||
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
|
||||
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV
|
||||
echo "[INFO] Version ${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}"
|
||||
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEMULATOR_VERSION_MAJOR=${{ inputs.next_version_major }} -DEMULATOR_VERSION_MINOR=${{ inputs.next_version_minor }}" >> $GITHUB_ENV
|
||||
|
||||
- name: "Install system dependencies"
|
||||
run: |
|
||||
brew install llvm@14 ninja nasm molten-vk
|
||||
brew update
|
||||
brew install ninja nasm automake libtool
|
||||
|
||||
- name: "Install molten-vk"
|
||||
run: |
|
||||
curl -L -O https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.9/MoltenVK-macos.tar
|
||||
tar xf MoltenVK-macos.tar
|
||||
sudo mkdir -p /usr/local/lib
|
||||
sudo cp MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib /usr/local/lib
|
||||
|
||||
- name: "Setup cmake"
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.29.0'
|
||||
|
||||
- name: "Bootstrap vcpkg"
|
||||
run: |
|
||||
bash ./dependencies/vcpkg/bootstrap-vcpkg.sh
|
||||
|
@ -232,28 +234,30 @@ jobs:
|
|||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DPORTABLE=OFF -DMACOS_BUNDLE=ON -DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++ -G Ninja
|
||||
cmake .. ${{ env.BUILD_FLAGS }} \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} \
|
||||
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||
-DMACOS_BUNDLE=ON \
|
||||
-G Ninja
|
||||
|
||||
- name: "Build Cemu"
|
||||
run: |
|
||||
cmake --build build
|
||||
|
||||
- name: Prepare artifact
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
run: |
|
||||
mkdir bin/Cemu_app
|
||||
mv bin/Cemu_release.app bin/Cemu_app/Cemu.app
|
||||
mv bin/Cemu_app/Cemu.app/Contents/MacOS/Cemu_release bin/Cemu_app/Cemu.app/Contents/MacOS/Cemu
|
||||
sed -i '' 's/Cemu_release/Cemu/g' bin/Cemu_app/Cemu.app/Contents/Info.plist
|
||||
chmod a+x bin/Cemu_app/Cemu.app/Contents/MacOS/Cemu
|
||||
chmod a+x bin/Cemu_app/Cemu.app/Contents/MacOS/{Cemu,update.sh}
|
||||
ln -s /Applications bin/Cemu_app/Applications
|
||||
hdiutil create ./bin/tmp.dmg -ov -volname "Cemu" -fs HFS+ -srcfolder "./bin/Cemu_app"
|
||||
hdiutil convert ./bin/tmp.dmg -format UDZO -o bin/Cemu.dmg
|
||||
rm bin/tmp.dmg
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ inputs.deploymode == 'release' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-macos-x64
|
||||
path: ./bin/Cemu.dmg
|
||||
|
|
3
.github/workflows/build_check.yml
vendored
3
.github/workflows/build_check.yml
vendored
|
@ -16,6 +16,3 @@ on:
|
|||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
deploymode: release
|
||||
experimentalversion: 999999
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
name: Deploy experimental release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call-release-build:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
deploymode: release
|
||||
experimentalversion: ${{ github.run_number }}
|
||||
deploy:
|
||||
name: Deploy experimental release
|
||||
runs-on: ubuntu-20.04
|
||||
needs: call-release-build
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-bin-linux-x64
|
||||
path: cemu-bin-linux-x64
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-appimage-x64
|
||||
path: cemu-appimage-x64
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-bin-windows-x64
|
||||
path: cemu-bin-windows-x64
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-bin-macos-x64
|
||||
path: cemu-bin-macos-x64
|
||||
|
||||
- name: Initialize
|
||||
run: |
|
||||
mkdir upload
|
||||
sudo apt install zip
|
||||
|
||||
- name: Get version
|
||||
run: |
|
||||
echo "Experimental version: ${{ github.run_number }}"
|
||||
ls
|
||||
gcc -o getversion .github/getversion.cpp
|
||||
./getversion
|
||||
echo "Cemu CI version: $(./getversion)"
|
||||
echo "CEMU_FOLDER_NAME=Cemu_$(./getversion)-${{ github.run_number }}" >> $GITHUB_ENV
|
||||
echo "CEMU_VERSION=$(./getversion)-${{ github.run_number }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Create release from windows-bin
|
||||
run: |
|
||||
ls ./
|
||||
ls ./bin/
|
||||
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
|
||||
mv cemu-bin-windows-x64/Cemu.exe ./${{ env.CEMU_FOLDER_NAME }}/Cemu.exe
|
||||
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-windows-x64.zip ${{ env.CEMU_FOLDER_NAME }}
|
||||
rm -r ./${{ env.CEMU_FOLDER_NAME }}
|
||||
|
||||
- name: Create appimage
|
||||
run: |
|
||||
VERSION=${{ env.CEMU_VERSION }}
|
||||
echo "Cemu Version is $VERSION"
|
||||
ls cemu-appimage-x64
|
||||
mv cemu-appimage-x64/Cemu-*-x86_64.AppImage upload/Cemu-$VERSION-x86_64.AppImage
|
||||
|
||||
- name: Create release from linux-bin
|
||||
run: |
|
||||
ls ./
|
||||
ls ./bin/
|
||||
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
|
||||
mv cemu-bin-linux-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu
|
||||
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-ubuntu-20.04-x64.zip ${{ env.CEMU_FOLDER_NAME }}
|
||||
rm -r ./${{ env.CEMU_FOLDER_NAME }}
|
||||
|
||||
- name: Create release from macos-bin
|
||||
run: cp cemu-bin-macos-x64/Cemu.dmg upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.dmg
|
||||
|
||||
- name: Create release
|
||||
run: |
|
||||
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz
|
||||
tar xvzf ghr.tar.gz; rm ghr.tar.gz
|
||||
echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}"
|
||||
ghr_v0.15.0_linux_amd64/ghr -prerelease -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }} (Experimental)" -b "Cemu experimental release" "v${{ env.CEMU_VERSION }}" ./upload
|
151
.github/workflows/deploy_release.yml
vendored
Normal file
151
.github/workflows/deploy_release.yml
vendored
Normal file
|
@ -0,0 +1,151 @@
|
|||
name: Deploy release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
changelog0:
|
||||
description: 'Enter the changelog lines for this release. Each line is a feature / bullet point. Do not use dash.'
|
||||
required: true
|
||||
type: string
|
||||
changelog1:
|
||||
description: 'Feature 2'
|
||||
required: false
|
||||
type: string
|
||||
changelog2:
|
||||
description: 'Feature 3'
|
||||
required: false
|
||||
type: string
|
||||
changelog3:
|
||||
description: 'Feature 4'
|
||||
required: false
|
||||
type: string
|
||||
changelog4:
|
||||
description: 'Feature 5'
|
||||
required: false
|
||||
type: string
|
||||
changelog5:
|
||||
description: 'Feature 6'
|
||||
required: false
|
||||
type: string
|
||||
changelog6:
|
||||
description: 'Feature 7'
|
||||
required: false
|
||||
type: string
|
||||
changelog7:
|
||||
description: 'Feature 8'
|
||||
required: false
|
||||
type: string
|
||||
changelog8:
|
||||
description: 'Feature 9'
|
||||
required: false
|
||||
type: string
|
||||
changelog9:
|
||||
description: 'Feature 10'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
calculate-version:
|
||||
name: Calculate Version
|
||||
uses: ./.github/workflows/determine_release_version.yml
|
||||
call-release-build:
|
||||
uses: ./.github/workflows/build.yml
|
||||
needs: calculate-version
|
||||
with:
|
||||
next_version_major: ${{ needs.calculate-version.outputs.next_version_major }}
|
||||
next_version_minor: ${{ needs.calculate-version.outputs.next_version_minor }}
|
||||
deploy:
|
||||
name: Deploy release
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [call-release-build, calculate-version]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate changelog
|
||||
id: generate_changelog
|
||||
run: |
|
||||
CHANGELOG=""
|
||||
if [ -n "${{ github.event.inputs.changelog0 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog0 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog1 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog1 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog2 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog2 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog3 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog3 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog4 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog4 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog5 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog5 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog6 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog6 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog7 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog7 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog8 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog8 }}\n"; fi
|
||||
if [ -n "${{ github.event.inputs.changelog9 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog9 }}\n"; fi
|
||||
echo -e "$CHANGELOG"
|
||||
echo "RELEASE_BODY=$CHANGELOG" >> $GITHUB_ENV
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-linux-x64
|
||||
path: cemu-bin-linux-x64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cemu-appimage-x64
|
||||
path: cemu-appimage-x64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-windows-x64
|
||||
path: cemu-bin-windows-x64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cemu-bin-macos-x64
|
||||
path: cemu-bin-macos-x64
|
||||
|
||||
- name: Initialize
|
||||
run: |
|
||||
mkdir upload
|
||||
sudo apt install zip
|
||||
|
||||
- name: Set version dependent vars
|
||||
run: |
|
||||
echo "Version: ${{ needs.calculate-version.outputs.next_version }}"
|
||||
echo "CEMU_FOLDER_NAME=Cemu_${{ needs.calculate-version.outputs.next_version }}"
|
||||
echo "CEMU_VERSION=${{ needs.calculate-version.outputs.next_version }}"
|
||||
echo "CEMU_FOLDER_NAME=Cemu_${{ needs.calculate-version.outputs.next_version }}" >> $GITHUB_ENV
|
||||
echo "CEMU_VERSION=${{ needs.calculate-version.outputs.next_version }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Create release from windows-bin
|
||||
run: |
|
||||
ls ./
|
||||
ls ./bin/
|
||||
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
|
||||
mv cemu-bin-windows-x64/Cemu.exe ./${{ env.CEMU_FOLDER_NAME }}/Cemu.exe
|
||||
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-windows-x64.zip ${{ env.CEMU_FOLDER_NAME }}
|
||||
rm -r ./${{ env.CEMU_FOLDER_NAME }}
|
||||
|
||||
- name: Create appimage
|
||||
run: |
|
||||
VERSION=${{ env.CEMU_VERSION }}
|
||||
echo "Cemu Version is $VERSION"
|
||||
ls cemu-appimage-x64
|
||||
mv cemu-appimage-x64/Cemu-*-x86_64.AppImage upload/Cemu-$VERSION-x86_64.AppImage
|
||||
|
||||
- name: Create release from linux-bin
|
||||
run: |
|
||||
ls ./
|
||||
ls ./bin/
|
||||
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
|
||||
mv cemu-bin-linux-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu
|
||||
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-ubuntu-22.04-x64.zip ${{ env.CEMU_FOLDER_NAME }}
|
||||
rm -r ./${{ env.CEMU_FOLDER_NAME }}
|
||||
|
||||
- name: Create release from macos-bin
|
||||
run: cp cemu-bin-macos-x64/Cemu.dmg upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.dmg
|
||||
|
||||
- name: Create release
|
||||
run: |
|
||||
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz
|
||||
tar xvzf ghr.tar.gz; rm ghr.tar.gz
|
||||
echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}"
|
||||
CHANGELOG_UNESCAPED=$(printf "%s\n" "${{ env.RELEASE_BODY }}" | sed 's/\\n/\n/g')
|
||||
RELEASE_BODY=$(printf "%s\n%s" \
|
||||
"**Changelog:**" \
|
||||
"$CHANGELOG_UNESCAPED")
|
||||
ghr_v0.15.0_linux_amd64/ghr -draft -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }}" -b "$RELEASE_BODY" "v${{ env.CEMU_VERSION }}" ./upload
|
85
.github/workflows/deploy_stable_release.yml
vendored
85
.github/workflows/deploy_stable_release.yml
vendored
|
@ -1,85 +0,0 @@
|
|||
name: Create new release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
PlaceholderInput:
|
||||
description: PlaceholderInput
|
||||
required: false
|
||||
jobs:
|
||||
call-release-build:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
deploymode: release
|
||||
deploy:
|
||||
name: Deploy release
|
||||
runs-on: ubuntu-20.04
|
||||
needs: call-release-build
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-bin-linux-x64
|
||||
path: cemu-bin-linux-x64
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-appimage-x64
|
||||
path: cemu-appimage-x64
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-bin-windows-x64
|
||||
path: cemu-bin-windows-x64
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cemu-bin-macos-x64
|
||||
path: cemu-bin-macos-x64
|
||||
|
||||
- name: Initialize
|
||||
run: |
|
||||
mkdir upload
|
||||
sudo apt update -qq
|
||||
sudo apt install -y zip
|
||||
|
||||
- name: Get Cemu release version
|
||||
run: |
|
||||
gcc -o getversion .github/getversion.cpp
|
||||
echo "Cemu CI version: $(./getversion)"
|
||||
echo "CEMU_FOLDER_NAME=Cemu_$(./getversion)" >> $GITHUB_ENV
|
||||
echo "CEMU_VERSION=$(./getversion)" >> $GITHUB_ENV
|
||||
|
||||
- name: Create release from windows-bin
|
||||
run: |
|
||||
ls ./
|
||||
ls ./bin/
|
||||
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
|
||||
mv cemu-bin-windows-x64/Cemu.exe ./${{ env.CEMU_FOLDER_NAME }}/Cemu.exe
|
||||
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-windows-x64.zip ${{ env.CEMU_FOLDER_NAME }}
|
||||
rm -r ./${{ env.CEMU_FOLDER_NAME }}
|
||||
|
||||
- name: Create appimage
|
||||
run: |
|
||||
VERSION=${{ env.CEMU_VERSION }}
|
||||
echo "Cemu Version is $VERSION"
|
||||
ls cemu-appimage-x64
|
||||
mv cemu-appimage-x64/Cemu-*-x86_64.AppImage upload/Cemu-$VERSION-x86_64.AppImage
|
||||
|
||||
- name: Create release from ubuntu-bin
|
||||
run: |
|
||||
ls ./
|
||||
ls ./bin/
|
||||
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
|
||||
mv cemu-bin-linux-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu
|
||||
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-ubuntu-20.04-x64.zip ${{ env.CEMU_FOLDER_NAME }}
|
||||
rm -r ./${{ env.CEMU_FOLDER_NAME }}
|
||||
|
||||
- name: Create release from macos-bin
|
||||
run: cp cemu-bin-macos-x64/Cemu.dmg upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.dmg
|
||||
|
||||
- name: Create release
|
||||
run: |
|
||||
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz
|
||||
tar xvzf ghr.tar.gz; rm ghr.tar.gz
|
||||
ghr_v0.15.0_linux_amd64/ghr -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }}" -b "Changelog:" v${{ env.CEMU_VERSION }} ./upload
|
74
.github/workflows/determine_release_version.yml
vendored
Normal file
74
.github/workflows/determine_release_version.yml
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
name: Calculate Next Version from release history
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
outputs:
|
||||
next_version:
|
||||
description: "The next semantic version"
|
||||
value: ${{ jobs.calculate-version.outputs.next_version }}
|
||||
next_version_major:
|
||||
description: "The next semantic version (major)"
|
||||
value: ${{ jobs.calculate-version.outputs.next_version_major }}
|
||||
next_version_minor:
|
||||
description: "The next semantic version (minor)"
|
||||
value: ${{ jobs.calculate-version.outputs.next_version_minor }}
|
||||
|
||||
jobs:
|
||||
calculate-version:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
next_version: ${{ steps.calculate_next_version.outputs.next_version }}
|
||||
next_version_major: ${{ steps.calculate_next_version.outputs.next_version_major }}
|
||||
next_version_minor: ${{ steps.calculate_next_version.outputs.next_version_minor }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get all releases
|
||||
id: get_all_releases
|
||||
run: |
|
||||
# Fetch all releases and check for API errors
|
||||
RESPONSE=$(curl -s -o response.json -w "%{http_code}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=100")
|
||||
if [ "$RESPONSE" -ne 200 ]; then
|
||||
echo "Failed to fetch releases. HTTP status: $RESPONSE"
|
||||
cat response.json
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract and sort tags
|
||||
ALL_TAGS=$(jq -r '.[].tag_name' response.json | grep -E '^v[0-9]+\.[0-9]+(-[0-9]+)?$' | sed 's/-.*//' | sort -V | tail -n 1)
|
||||
|
||||
# Exit if no tags were found
|
||||
if [ -z "$ALL_TAGS" ]; then
|
||||
echo "No valid tags found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "::set-output name=tag::$ALL_TAGS"
|
||||
# echo "tag=$ALL_TAGS" >> $GITHUB_STATE
|
||||
|
||||
- name: Calculate next semver minor
|
||||
id: calculate_next_version
|
||||
run: |
|
||||
LATEST_VERSION=${{ steps.get_all_releases.outputs.tag }}
|
||||
|
||||
# strip 'v' prefix and split into major.minor
|
||||
LATEST_VERSION=${LATEST_VERSION//v/}
|
||||
IFS='.' read -r -a VERSION_PARTS <<< "$LATEST_VERSION"
|
||||
|
||||
MAJOR=${VERSION_PARTS[0]}
|
||||
MINOR=${VERSION_PARTS[1]}
|
||||
|
||||
# increment the minor version
|
||||
MINOR=$((MINOR + 1))
|
||||
|
||||
NEXT_VERSION="${MAJOR}.${MINOR}"
|
||||
|
||||
echo "Major: $MAJOR"
|
||||
echo "Minor: $MINOR"
|
||||
|
||||
echo "Next version: $NEXT_VERSION"
|
||||
echo "::set-output name=next_version::$NEXT_VERSION"
|
||||
echo "::set-output name=next_version_major::$MAJOR"
|
||||
echo "::set-output name=next_version_minor::$MINOR"
|
6
.github/workflows/generate_pot.yml
vendored
6
.github/workflows/generate_pot.yml
vendored
|
@ -29,13 +29,13 @@ jobs:
|
|||
- name: "Generate POT file using xgettext"
|
||||
run: >
|
||||
find src -name *.cpp -o -name *.hpp -o -name *.h |
|
||||
xargs xgettext --from-code=utf-8
|
||||
-k_ -kwxTRANSLATE -w 100
|
||||
xargs xgettext --from-code=utf-8 -w 100
|
||||
--keyword="_" --keyword="wxTRANSLATE" --keyword="wxPLURAL:1,2"
|
||||
--check=space-ellipsis --omit-header
|
||||
-o cemu.pot
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: POT file
|
||||
path: ./cemu.pot
|
||||
|
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -17,6 +17,7 @@
|
|||
.idea/
|
||||
|
||||
build/
|
||||
cmake-build-*/
|
||||
out/
|
||||
.cache/
|
||||
bin/Cemu_*
|
||||
|
@ -36,6 +37,10 @@ bin/title_list_cache.xml
|
|||
bin/debugger/*
|
||||
bin/sdcard/*
|
||||
bin/screenshots/*
|
||||
bin/dump/*
|
||||
bin/cafeLibs/*
|
||||
bin/portable/*
|
||||
bin/keys.txt
|
||||
|
||||
!bin/shaderCache/info.txt
|
||||
bin/shaderCache/*
|
||||
|
@ -46,3 +51,6 @@ bin/controllerProfiles/*
|
|||
bin/gameProfiles/*
|
||||
|
||||
bin/graphicPacks/*
|
||||
|
||||
# Ignore Finder view option files created by OS X
|
||||
.DS_Store
|
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -9,10 +9,12 @@
|
|||
[submodule "dependencies/vcpkg"]
|
||||
path = dependencies/vcpkg
|
||||
url = https://github.com/microsoft/vcpkg
|
||||
shallow = true
|
||||
shallow = false
|
||||
[submodule "dependencies/Vulkan-Headers"]
|
||||
path = dependencies/Vulkan-Headers
|
||||
url = https://github.com/KhronosGroup/Vulkan-Headers
|
||||
shallow = true
|
||||
[submodule "dependencies/imgui"]
|
||||
path = dependencies/imgui
|
||||
url = https://github.com/ocornut/imgui
|
||||
shallow = true
|
||||
|
|
245
BUILD.md
245
BUILD.md
|
@ -1,94 +1,184 @@
|
|||
# Build instructions
|
||||
# Build Instructions
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Windows](#windows)
|
||||
- [Linux](#linux)
|
||||
- [Dependencies](#dependencies)
|
||||
- [For Arch and derivatives:](#for-arch-and-derivatives)
|
||||
- [For Debian, Ubuntu and derivatives](#for-debian-ubuntu-and-derivatives)
|
||||
- [For Fedora and derivatives:](#for-fedora-and-derivatives)
|
||||
- [Build Cemu](#build-cemu)
|
||||
- [CMake and Clang](#cmake-and-clang)
|
||||
- [GCC](#gcc)
|
||||
- [Debug Build](#debug-build)
|
||||
- [Troubleshooting Steps](#troubleshooting-steps)
|
||||
- [Compiling Errors](#compiling-errors)
|
||||
- [Building Errors](#building-errors)
|
||||
- [macOS](#macos)
|
||||
- [Installing brew](#installing-brew)
|
||||
- [Installing Tool Dependencies](#installing-tool-dependencies)
|
||||
- [Installing Library Dependencies](#installing-library-dependencies)
|
||||
- [Build Cemu using CMake](#build-cemu-using-cmake)
|
||||
- [Updating Cemu and source code](#updating-cemu-and-source-code)
|
||||
|
||||
## Windows
|
||||
|
||||
Prerequisites:
|
||||
- A recent version of Visual Studio 2022 (recommended but not required) with the following additional components:
|
||||
- git
|
||||
- A recent version of Visual Studio 2022 with the following additional components:
|
||||
- C++ CMake tools for Windows
|
||||
- Windows 10/11 SDK
|
||||
- git
|
||||
|
||||
Instructions:
|
||||
Instructions for Visual Studio 2022:
|
||||
|
||||
1. Run `git clone --recursive https://github.com/cemu-project/Cemu`
|
||||
2. Launch `Cemu/generate_vs_solution.bat`.
|
||||
- If you installed VS to a custom location or use VS 2019, you may need to manually change the path inside the .bat file.
|
||||
3. Wait until it's done, then open `Cemu/build/Cemu.sln` in Visual Studio.
|
||||
4. Then build the solution and once finished you can run and debug it, or build it and check the /bin folder for the final Cemu_release.exe.
|
||||
2. Open the newly created Cemu directory in Visual Studio using the "Open a local folder" option
|
||||
3. In the menu select Project -> Configure CMake. Wait until it is done, this may take a long time
|
||||
4. You can now build, run and debug Cemu
|
||||
|
||||
You can also skip steps 3-5 and open the root folder of the cloned repo directly in Visual Studio (as a folder) and use the built-in CMake support but be warned that cmake support in VS can be a bit finicky.
|
||||
Any other IDE should also work as long as it has CMake and MSVC support. CLion and Visual Studio Code have been confirmed to work.
|
||||
|
||||
## Linux
|
||||
|
||||
To compile Cemu, a recent enough compiler and STL with C++20 support is required! clang-12 or higher is what we recommend.
|
||||
To compile Cemu, a recent enough compiler and STL with C++20 support is required! Clang-15 or higher is what we recommend.
|
||||
|
||||
### Installing dependencies
|
||||
|
||||
#### For Ubuntu and derivatives:
|
||||
`sudo apt install -y cmake curl freeglut3-dev git libgcrypt20-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build`
|
||||
|
||||
*Additionally, for Ubuntu 22.04 only:*
|
||||
- `sudo apt install -y clang-12`
|
||||
- At step 3 while building, use
|
||||
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
|
||||
### Dependencies
|
||||
|
||||
#### For Arch and derivatives:
|
||||
`sudo pacman -S --needed base-devel clang cmake freeglut git gtk3 libgcrypt libpulse libsecret linux-headers llvm nasm ninja systemd unzip zip`
|
||||
`sudo pacman -S --needed base-devel bluez-libs clang cmake freeglut git glm gtk3 libgcrypt libpulse libsecret linux-headers llvm nasm ninja systemd unzip zip`
|
||||
|
||||
#### For Debian, Ubuntu and derivatives:
|
||||
`sudo apt install -y cmake curl clang-15 freeglut3-dev git libbluetooth-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libtool nasm ninja-build`
|
||||
|
||||
You may also need to install `libusb-1.0-0-dev` as a workaround for an issue with the vcpkg hidapi package.
|
||||
|
||||
At Step 3 in [Build Cemu using cmake and clang](#build-cemu-using-cmake-and-clang), use the following command instead:
|
||||
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-15 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
|
||||
|
||||
#### For Fedora and derivatives:
|
||||
`sudo dnf install clang cmake cubeb-devel freeglut-devel git gtk3-devel kernel-headers libgcrypt-devel libsecret-devel nasm ninja-build perl-core systemd-devel zlib-devel`
|
||||
`sudo dnf install bluez-libs-devel clang cmake cubeb-devel freeglut-devel git glm-devel gtk3-devel kernel-headers libgcrypt-devel libsecret-devel libtool libusb1-devel llvm nasm ninja-build perl-core systemd-devel wayland-protocols-devel zlib-devel zlib-static`
|
||||
|
||||
### Build Cemu using cmake and clang
|
||||
1. `git clone --recursive https://github.com/cemu-project/Cemu`
|
||||
2. `cd Cemu`
|
||||
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja`
|
||||
4. `cmake --build build`
|
||||
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
|
||||
### Build Cemu
|
||||
|
||||
#### Using GCC
|
||||
While we use and test Cemu using clang, using GCC might work better with your distro (they should be fairly similar performance/issues wise and should only be considered if compilation is the issue).
|
||||
You can use it by replacing the step 3 with the following:
|
||||
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja`
|
||||
#### CMake and Clang
|
||||
|
||||
#### Troubleshooting steps
|
||||
- If step 3 gives you an error about not being able to find ninja, try appending `-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` to the command and running it again.
|
||||
- If step 3 fails while compiling the boost-build dependency, it means you don't have a working/good standard library installation. Check the integrity of your system headers and making sure that C++ related packages are installed and intact.
|
||||
- If step 3 gives a random error, read the `[package-name-and-platform]-out.log` and `[package-name-and-platform]-err.log` for the actual reason to see if you might be lacking the headers from a dependency.
|
||||
- If step 3 is still failing or if you're not able to find the cause, please make an issue on our Github about it!
|
||||
- If step 4 gives you an error that contains something like `main.cpp.o: in function 'std::__cxx11::basic_string...`, you likely are experiencing a clang-14 issue. This can only be fixed by either lowering the clang version or using GCC, see below.
|
||||
- If step 4 gives you a different error, you could report it to this repo or try using GCC. Just make sure your standard library and compilers are updated since Cemu uses a lot of modern features!
|
||||
- If step 4 gives you undefined libdecor_xx, you are likely experiencing an issue with sdl2 package that comes with vcpkg. Delete sdl2 from vcpkg.json in source file and recompile.
|
||||
- If step 3 fails during rebuild after `git pull` with an error that mentions RPATH, add this to the end of step 3: `-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON`
|
||||
```
|
||||
git clone --recursive https://github.com/cemu-project/Cemu
|
||||
cd Cemu
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
#### GCC
|
||||
|
||||
If you are building using GCC, make sure you have g++ installed:
|
||||
- Installation for Arch and derivatives: `sudo pacman -S gcc`
|
||||
- Installation for Debian, Ubuntu and derivatives: `sudo apt install g++`
|
||||
- Installation for Fedora and derivatives: `sudo dnf install gcc-c++`
|
||||
|
||||
```
|
||||
git clone --recursive https://github.com/cemu-project/Cemu
|
||||
cd Cemu
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
#### Debug Build
|
||||
|
||||
```
|
||||
git clone --recursive https://github.com/cemu-project/Cemu
|
||||
cd Cemu
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
If you are using GCC, replace `cmake -S . -B build -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja` with `cmake -S . -B build -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja`
|
||||
|
||||
#### Troubleshooting Steps
|
||||
|
||||
##### Compiling Errors
|
||||
|
||||
This section refers to running `cmake -S...` (truncated).
|
||||
|
||||
* `vcpkg install failed`
|
||||
* Run the following in the root directory and try running the command again (don't forget to change directories afterwards):
|
||||
* `cd dependencies/vcpkg && git fetch --unshallow`
|
||||
* `Please ensure you're using the latest port files with git pull and vcpkg update.`
|
||||
* Either:
|
||||
* Update vcpkg by running by the following command:
|
||||
* `git submodule update --remote dependencies/vcpkg`
|
||||
* If you are sure vcpkg is up to date, check the following logs:
|
||||
* `Cemu/dependencies/vcpkg/buildtrees/wxwidgets/config-x64-linux-out.log`
|
||||
* `Cemu/dependencies/vcpkg/buildtrees/libsystemd/config-x64-linux-dbg-meson-log.txt.log`
|
||||
* `Cemu/dependencies/vcpkg/buildtrees/libsystemd/config-x64-linux-dbg-out.log`
|
||||
* Not able to find Ninja.
|
||||
* Add the following and try running the command again:
|
||||
* `-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
|
||||
* Compiling failed during the boost-build dependency.
|
||||
* It means you don't have a working/good standard library installation. Check the integrity of your system headers and making sure that C++ related packages are installed and intact.
|
||||
* Compiling failed during rebuild after `git pull` with an error that mentions RPATH
|
||||
* Add the following and try running the command again:
|
||||
* `-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON`
|
||||
* Environment variable `VCPKG_FORCE_SYSTEM_BINARIES` must be set.
|
||||
* Execute the folowing and then try running the command again:
|
||||
* `export VCPKG_FORCE_SYSTEM_BINARIES=1`
|
||||
* If you are getting a random error, read the [package-name-and-platform]-out.log and [package-name-and-platform]-err.log for the actual reason to see if you might be lacking the headers from a dependency.
|
||||
|
||||
|
||||
If you are getting a different error than any of the errors listed above, you may either open an issue in this repo or try using [GCC](#gcc). Make sure your standard library and compilers are updated since Cemu uses a lot of modern features!
|
||||
|
||||
|
||||
##### Building Errors
|
||||
|
||||
This section refers to running `cmake --build build`.
|
||||
|
||||
* `main.cpp.o: in function 'std::__cxx11::basic_string...`
|
||||
* You likely are experiencing a clang-14 issue. This can only be fixed by either lowering the clang version or using GCC, see [GCC](#gcc).
|
||||
* `fatal error: 'span' file not found`
|
||||
* You're either missing `libstdc++` or are using a version that's too old. Install at least v10 with your package manager, eg `sudo apt install libstdc++-10-dev`. See [#644](https://github.com/cemu-project/Cemu/issues/644).
|
||||
* `undefined libdecor_xx`
|
||||
* You are likely experiencing an issue with sdl2 package that comes with vcpkg. Delete sdl2 from vcpkg.json in source file and recompile.
|
||||
|
||||
If you are getting a different error than any of the errors listed above, you may either open an issue in this repo or try using [GCC](#gcc). Make sure your standard library and compilers are updated since Cemu uses a lot of modern features!
|
||||
|
||||
## macOS
|
||||
|
||||
To compile Cemu, a recent enough compiler and STL with C++20 support is required! LLVM 13 and
|
||||
below, built in LLVM, and Xcode LLVM don't support the C++20 feature set required. Currently,
|
||||
LLVM 15 isn't supported due to compatibility issues with Boost dependency. The OpenGL graphics
|
||||
API isn't support on macOS, Vulkan must be used. Additionally Vulkan must be used through the
|
||||
Molten-VK compatibility layer
|
||||
|
||||
### On Apple Silicon Macs, Rosetta 2 and the x86_64 version of Homebrew must be used
|
||||
|
||||
You can skip this section if you have an Intel Mac. Every time you compile, you need to perform steps 2.
|
||||
|
||||
1. `softwareupdate --install-rosetta` # Install Rosetta 2 if you don't have it. This only has to be done once
|
||||
2. `arch -x86_64 zsh` # run an x64 shell
|
||||
To compile Cemu, a recent enough compiler and STL with C++20 support is required! LLVM 13 and below
|
||||
don't support the C++20 feature set required, so either install LLVM from Homebrew or make sure that
|
||||
you have a recent enough version of Xcode. Xcode 15 is known to work. The OpenGL graphics API isn't
|
||||
supported on macOS, so Vulkan must be used through the Molten-VK compatibility layer.
|
||||
|
||||
### Installing brew
|
||||
|
||||
1. `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
||||
2. `eval "$(/usr/local/Homebrew/bin/brew shellenv)"` # set x86_64 brew env
|
||||
2. Set up the Homebrew shell environment:
|
||||
1. **On an Intel Mac:** `eval "$(/usr/local/Homebrew/bin/brew shellenv)"`
|
||||
2. **On an Apple Silicon Mac:** eval `"$(/opt/homebrew/bin/brew shellenv)"`
|
||||
|
||||
### Installing dependencies
|
||||
### Installing Tool Dependencies
|
||||
|
||||
`brew install boost git cmake llvm@14 ninja nasm molten-vk`
|
||||
The native versions of these can be used regardless of what type of Mac you have.
|
||||
|
||||
`brew install git cmake ninja nasm automake libtool`
|
||||
|
||||
### Installing Library Dependencies
|
||||
|
||||
**On Apple Silicon Macs, Rosetta 2 and the x86_64 version of Homebrew must be used to install these dependencies:**
|
||||
1. `softwareupdate --install-rosetta` # Install Rosetta 2 if you don't have it. This only has to be done once
|
||||
2. `arch -x86_64 zsh` # run an x64 shell
|
||||
3. `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
||||
4. `eval "$(/usr/local/Homebrew/bin/brew shellenv)"`
|
||||
|
||||
Then install the dependencies:
|
||||
|
||||
`brew install boost molten-vk`
|
||||
|
||||
### Build Cemu using CMake
|
||||
|
||||
### Build Cemu using cmake and clang
|
||||
1. `git clone --recursive https://github.com/cemu-project/Cemu`
|
||||
2. `cd Cemu`
|
||||
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release
|
||||
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++ -G Ninja`
|
||||
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_OSX_ARCHITECTURES=x86_64 -G Ninja`
|
||||
4. `cmake --build build`
|
||||
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
|
||||
|
||||
|
@ -101,3 +191,42 @@ You can skip this section if you have an Intel Mac. Every time you compile, you
|
|||
2. Then, you can rebuild Cemu using the steps listed above, according to whether you use Linux or Windows.
|
||||
|
||||
If CMake complains about Cemu already being compiled or another similar error, try deleting the `CMakeCache.txt` file inside the `build` folder and retry building.
|
||||
|
||||
## CMake configure flags
|
||||
Some flags can be passed during CMake configure to customise which features are enabled on build.
|
||||
|
||||
Example usage: `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DENABLE_SDL=ON -DENABLE_VULKAN=OFF`
|
||||
|
||||
### All platforms
|
||||
| Flag | | Description | Default | Note |
|
||||
|--------------------|:--|-----------------------------------------------------------------------------|---------|--------------------|
|
||||
| ALLOW_PORTABLE | | Allow Cemu to use the `portable` directory to store configs and data | ON | |
|
||||
| CEMU_CXX_FLAGS | | Flags passed straight to the compiler, e.g. `-march=native`, `-Wall`, `/W3` | "" | |
|
||||
| ENABLE_CUBEB | | Enable cubeb audio backend | ON | |
|
||||
| ENABLE_DISCORD_RPC | | Enable Discord Rich presence support | ON | |
|
||||
| ENABLE_OPENGL | | Enable OpenGL graphics backend | ON | Currently required |
|
||||
| ENABLE_HIDAPI | | Enable HIDAPI (used for Wiimote controller API) | ON | |
|
||||
| ENABLE_SDL | | Enable SDLController controller API | ON | Currently required |
|
||||
| ENABLE_VCPKG | | Use VCPKG package manager to obtain dependencies | ON | |
|
||||
| ENABLE_VULKAN | | Enable the Vulkan graphics backend | ON | |
|
||||
| ENABLE_WXWIDGETS | | Enable wxWidgets UI | ON | Currently required |
|
||||
|
||||
### Windows
|
||||
| Flag | Description | Default | Note |
|
||||
|--------------------|-----------------------------------|---------|--------------------|
|
||||
| ENABLE_DIRECTAUDIO | Enable DirectAudio audio backend | ON | Currently required |
|
||||
| ENABLE_DIRECTINPUT | Enable DirectInput controller API | ON | Currently required |
|
||||
| ENABLE_XAUDIO | Enable XAudio audio backend | ON | |
|
||||
| ENABLE_XINPUT | Enable XInput controller API | ON | |
|
||||
|
||||
### Linux
|
||||
| Flag | Description | Default |
|
||||
|-----------------------|----------------------------------------------------|---------|
|
||||
| ENABLE_BLUEZ | Build with Bluez (used for Wiimote controller API) | ON |
|
||||
| ENABLE_FERAL_GAMEMODE | Enable Feral Interactive GameMode support | ON |
|
||||
| ENABLE_WAYLAND | Enable Wayland support | ON |
|
||||
|
||||
### macOS
|
||||
| Flag | Description | Default |
|
||||
|--------------|------------------------------------------------|---------|
|
||||
| MACOS_BUNDLE | MacOS executable will be an application bundle | OFF |
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
cmake_minimum_required(VERSION 3.21.1)
|
||||
|
||||
option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
|
||||
option(PORTABLE "All data created and maintained by Cemu will be in the directory where the executable file is located" ON)
|
||||
option(MACOS_BUNDLE "The executable when built on macOS will be created as an application bundle" OFF)
|
||||
set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version
|
||||
option(ALLOW_PORTABLE "Allow Cemu to be run in portable mode" ON)
|
||||
|
||||
# used by CI script to set version:
|
||||
set(EMULATOR_VERSION_MAJOR "0" CACHE STRING "")
|
||||
set(EMULATOR_VERSION_MINOR "0" CACHE STRING "")
|
||||
set(EMULATOR_VERSION_PATCH "0" CACHE STRING "")
|
||||
|
||||
if (EXPERIMENTAL_VERSION)
|
||||
add_definitions(-DEMULATOR_VERSION_MINOR=${EXPERIMENTAL_VERSION})
|
||||
execute_process(
|
||||
COMMAND git log --format=%h -1
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
|
@ -14,10 +16,33 @@ if (EXPERIMENTAL_VERSION)
|
|||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions(-DEMULATOR_HASH=${GIT_HASH})
|
||||
endif()
|
||||
|
||||
if (ENABLE_VCPKG)
|
||||
# check if vcpkg is shallow and unshallow it if necessary
|
||||
execute_process(
|
||||
COMMAND git rev-parse --is-shallow-repository
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dependencies/vcpkg
|
||||
OUTPUT_VARIABLE is_vcpkg_shallow
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(is_vcpkg_shallow STREQUAL "true")
|
||||
message(STATUS "vcpkg is shallow. Unshallowing it now...")
|
||||
execute_process(
|
||||
COMMAND git fetch --unshallow
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/dependencies/vcpkg"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_linux")
|
||||
elseif(APPLE)
|
||||
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_mac")
|
||||
else()
|
||||
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports")
|
||||
endif()
|
||||
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
CACHE STRING "Vcpkg toolchain file")
|
||||
# Set this so that all the various find_package() calls don't need an explicit
|
||||
|
@ -39,9 +64,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||
|
||||
add_compile_definitions($<$<CONFIG:Debug>:CEMU_DEBUG_ASSERT>) # if build type is debug, set CEMU_DEBUG_ASSERT
|
||||
|
||||
if(PORTABLE)
|
||||
add_compile_definitions(PORTABLE)
|
||||
endif()
|
||||
add_definitions(-DEMULATOR_VERSION_MAJOR=${EMULATOR_VERSION_MAJOR})
|
||||
add_definitions(-DEMULATOR_VERSION_MINOR=${EMULATOR_VERSION_MINOR})
|
||||
add_definitions(-DEMULATOR_VERSION_PATCH=${EMULATOR_VERSION_PATCH})
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
|
@ -68,18 +93,28 @@ endif()
|
|||
|
||||
if (APPLE)
|
||||
enable_language(OBJC OBJCXX)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
option(ENABLE_WAYLAND "Build with Wayland support" ON)
|
||||
option(ENABLE_FERAL_GAMEMODE "Enables Feral Interactive GameMode Support" ON)
|
||||
option(ENABLE_BLUEZ "Build with Bluez support" ON)
|
||||
endif()
|
||||
|
||||
option(ENABLE_OPENGL "Enables the OpenGL backend" ON)
|
||||
option(ENABLE_VULKAN "Enables the Vulkan backend" ON)
|
||||
option(ENABLE_DISCORD_RPC "Enables the Discord Rich Presence feature" ON)
|
||||
|
||||
|
||||
# input backends
|
||||
if (WIN32)
|
||||
option(ENABLE_XINPUT "Enables the usage of XInput" ON)
|
||||
option(ENABLE_DIRECTINPUT "Enables the usage of DirectInput" ON)
|
||||
add_compile_definitions(HAS_DIRECTINPUT)
|
||||
endif()
|
||||
|
||||
option(ENABLE_HIDAPI "Build with HIDAPI" ON)
|
||||
option(ENABLE_SDL "Enables the SDLController backend" ON)
|
||||
|
||||
# audio backends
|
||||
|
@ -104,7 +139,7 @@ find_package(ZLIB REQUIRED)
|
|||
find_package(zstd MODULE REQUIRED) # MODULE so that zstd::zstd is available
|
||||
find_package(OpenSSL COMPONENTS Crypto SSL REQUIRED)
|
||||
find_package(glm REQUIRED)
|
||||
find_package(fmt 9.1.0 REQUIRED)
|
||||
find_package(fmt 9 REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
|
||||
# glslang versions older than 11.11.0 define targets without a namespace
|
||||
|
@ -114,7 +149,27 @@ endif()
|
|||
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(X11 REQUIRED)
|
||||
if (ENABLE_WAYLAND)
|
||||
find_package(Wayland REQUIRED Client)
|
||||
find_package(WaylandScanner REQUIRED)
|
||||
find_package(WaylandProtocols 1.15 REQUIRED)
|
||||
|
||||
ecm_add_wayland_client_protocol(WAYLAND_PROTOCOL_SRCS
|
||||
PROTOCOL "${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml"
|
||||
BASENAME viewporter)
|
||||
add_library(CemuWaylandProtocols STATIC ${WAYLAND_PROTOCOL_SRCS})
|
||||
target_include_directories(CemuWaylandProtocols PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
add_compile_definitions(HAS_WAYLAND)
|
||||
endif()
|
||||
find_package(GTK3 REQUIRED)
|
||||
|
||||
if(ENABLE_BLUEZ)
|
||||
find_package(bluez REQUIRED)
|
||||
set(ENABLE_WIIMOTE ON)
|
||||
add_compile_definitions(HAS_BLUEZ)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (ENABLE_VULKAN)
|
||||
|
@ -131,18 +186,34 @@ if (ENABLE_DISCORD_RPC)
|
|||
target_include_directories(discord-rpc INTERFACE ./dependencies/discord-rpc/include)
|
||||
endif()
|
||||
|
||||
if (ENABLE_HIDAPI)
|
||||
find_package(hidapi REQUIRED)
|
||||
set(ENABLE_WIIMOTE ON)
|
||||
add_compile_definitions(HAS_HIDAPI)
|
||||
endif ()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(ENABLE_FERAL_GAMEMODE)
|
||||
add_compile_definitions(ENABLE_FERAL_GAMEMODE)
|
||||
add_subdirectory(dependencies/gamemode EXCLUDE_FROM_ALL)
|
||||
target_include_directories(gamemode INTERFACE ./dependencies/gamemode/lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_WXWIDGETS)
|
||||
find_package(wxWidgets 3.2 REQUIRED COMPONENTS base core gl propgrid xrc)
|
||||
endif()
|
||||
|
||||
if (ENABLE_CUBEB)
|
||||
if (NOT ENABLE_VCPKG)
|
||||
find_package(cubeb)
|
||||
endif()
|
||||
if (NOT cubeb_FOUND)
|
||||
option(BUILD_TESTS "" OFF)
|
||||
option(BUILD_TOOLS "" OFF)
|
||||
option(BUNDLE_SPEEX "" OFF)
|
||||
set(USE_WINMM OFF CACHE BOOL "")
|
||||
add_subdirectory("dependencies/cubeb" EXCLUDE_FROM_ALL)
|
||||
add_subdirectory("dependencies/cubeb" EXCLUDE_FROM_ALL SYSTEM)
|
||||
set_property(TARGET cubeb PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
add_library(cubeb::cubeb ALIAS cubeb)
|
||||
endif()
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"generator": "Ninja",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}"
|
||||
},
|
||||
{
|
||||
"name": "Debug",
|
||||
|
|
99
CODING_STYLE.md
Normal file
99
CODING_STYLE.md
Normal file
|
@ -0,0 +1,99 @@
|
|||
|
||||
# Coding style guidelines for Cemu
|
||||
|
||||
This document describes the latest version of our coding-style guidelines. Since we did not use this style from the beginning, older code may not adhere to these guidelines. Nevertheless, use these rules even if the surrounding code does not match.
|
||||
|
||||
Cemu comes with a `.clang-format` file which is supported by most IDEs for formatting. Avoid auto-reformatting whole files, PRs with a lot of formatting changes are difficult to review.
|
||||
|
||||
## Names for variables, functions and classes
|
||||
|
||||
- Always prefix class member variables with `m_`
|
||||
- Always prefix static class variables with `s_`
|
||||
- For variable names: Camel case, starting with a lower case letter after the prefix. Examples: `m_option`, `s_audioVolume`
|
||||
- For functions/class names: Use camel case starting with a capital letter. Examples: `MyClass`, `SetActive`
|
||||
- Avoid underscores in variable names after the prefix. Use `m_myVariable` instead of `m_my_variable`
|
||||
|
||||
## About types
|
||||
|
||||
Cemu provides its own set of basic fixed-width types. They are:
|
||||
`uint8`, `sint8`, `uint16`, `sint16`, `uint32`, `sint32`, `uint64`, `sint64`. Always use these types over something like `uint32_t`. Using `size_t` is also acceptable where suitable. Avoid C types like `int` or `long`. The only exception is when interacting with external libraries which expect these types as parameters.
|
||||
|
||||
## When and where to put brackets
|
||||
|
||||
Always put curly-brackets (`{ }`) on their own line. Example:
|
||||
|
||||
```
|
||||
void FooBar()
|
||||
{
|
||||
if (m_hasFoo)
|
||||
{
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
As an exception, you can put short lambdas onto the same line:
|
||||
```
|
||||
SomeFunc([]() { .... });
|
||||
```
|
||||
You can skip brackets for single-statement `if`. Example:
|
||||
```
|
||||
if (cond)
|
||||
action();
|
||||
```
|
||||
|
||||
## Printing
|
||||
|
||||
Avoid sprintf and similar C-style formatting API. Use `fmt::format()`.
|
||||
In UI related code you can use `formatWxString`, but be aware that number formatting with this function will be locale dependent!
|
||||
|
||||
## Strings and encoding
|
||||
|
||||
We use UTF-8 encoded `std::string` where possible. Some conversions need special handling and we have helper functions for those:
|
||||
```cpp
|
||||
// std::filesystem::path <-> std::string (in precompiled.h)
|
||||
std::string _pathToUtf8(const fs::path& path);
|
||||
fs::path _utf8ToPath(std::string_view input);
|
||||
|
||||
// wxString <-> std::string
|
||||
wxString wxString::FromUTF8(const std::string& s)
|
||||
wxString to_wxString(std::string_view str); // in gui/helpers.h
|
||||
std::string wxString::utf8_string();
|
||||
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
If you want to write to log.txt use `cemuLog_log()`. The log type parameter should be mostly self-explanatory. Use `LogType::Force` if you always want to log something. For example:
|
||||
`cemuLog_log(LogType::Force, "The value is {}", 123);`
|
||||
|
||||
## HLE and endianness
|
||||
|
||||
A pretty large part of Cemu's code base are re-implementations of various Cafe OS modules (e.g. `coreinit.rpl`, `gx2.rpl`...). These generally run in the context of the emulated process, thus special care has to be taken to use types with the correct size and endianness when interacting with memory.
|
||||
|
||||
Keep in mind that the emulated Espresso CPU is 32bit big-endian, while the host architectures targeted by Cemu are 64bit little-endian!
|
||||
|
||||
To keep code simple and remove the need for manual endian-swapping, Cemu has templates and aliases of the basic types with explicit endian-ness.
|
||||
For big-endian types add the suffix `be`. Example: `uint32be`
|
||||
|
||||
When you need to store a pointer in the guest's memory. Use `MEMPTR<T>`. It will automatically store any pointer as 32bit big-endian. The pointer you store must point to memory that is within the guest address space.
|
||||
|
||||
## HLE interfaces
|
||||
|
||||
The implementation for each HLE module is inside a namespace with a matching name. E.g. `coreinit.rpl` functions go into `coreinit` namespace.
|
||||
|
||||
To expose a new function as callable from within the emulated machine, use `cafeExportRegister` or `cafeExportRegisterFunc`. Here is a short example:
|
||||
```cpp
|
||||
namespace coreinit
|
||||
{
|
||||
uint32 OSGetCoreCount()
|
||||
{
|
||||
return Espresso::CORE_COUNT;
|
||||
}
|
||||
|
||||
void Init()
|
||||
{
|
||||
cafeExportRegister("coreinit", OSGetCoreCount, LogType::CoreinitThread);
|
||||
}
|
||||
}
|
||||
```
|
||||
You may also see some code which uses `osLib_addFunction` directly. This is a deprecated way of registering functions.
|
21
README.md
21
README.md
|
@ -5,36 +5,36 @@
|
|||
[](https://matrix.to/#/#cemu:cemu.info)
|
||||
|
||||
This is the code repository of Cemu, a Wii U emulator that is able to run most Wii U games and homebrew in a playable state.
|
||||
It's written in C/C++ and is being actively developed with new features and fixes to increase compatibility, convenience and usability.
|
||||
It's written in C/C++ and is being actively developed with new features and fixes.
|
||||
|
||||
Cemu is currently only available for 64-bit Windows and Linux devices.
|
||||
Cemu is currently only available for 64-bit Windows, Linux & macOS devices.
|
||||
|
||||
### Links:
|
||||
- [Original 2.0 announcement post](https://www.reddit.com/r/cemu/comments/wwa22c/cemu_20_announcement_linux_builds_opensource_and/)
|
||||
- [Open Source Announcement](https://www.reddit.com/r/cemu/comments/wwa22c/cemu_20_announcement_linux_builds_opensource_and/)
|
||||
- [Official Website](https://cemu.info)
|
||||
- [Compatibility List/Wiki](https://wiki.cemu.info/wiki/Main_Page)
|
||||
- [Official Subreddit](https://reddit.com/r/Cemu)
|
||||
- [Official Discord](https://discord.gg/5psYsup)
|
||||
- [Official Matrix Server](https://matrix.to/#/#cemu:cemu.info)
|
||||
- [Unofficial Setup Guide](https://cemu.cfw.guide)
|
||||
- [Setup Guide](https://cemu.cfw.guide)
|
||||
|
||||
#### Other relevant repositories:
|
||||
- [Cemu-Language](https://github.com/cemu-project/Cemu-Language)
|
||||
- [Cemu's Community Graphic Packs](https://github.com/ActualMandM/cemu_graphic_packs)
|
||||
- [Cemu's Community Graphic Packs](https://github.com/cemu-project/cemu_graphic_packs)
|
||||
|
||||
## Download
|
||||
|
||||
You can download the latest Cemu releases from the [GitHub Releases](https://github.com/cemu-project/Cemu/releases/) or from [Cemu's website](https://cemu.info).
|
||||
You can download the latest Cemu releases for Windows, Linux and Mac from the [GitHub Releases](https://github.com/cemu-project/Cemu/releases/). For Linux you can also find Cemu on [flathub](https://flathub.org/apps/info.cemu.Cemu).
|
||||
|
||||
Cemu is currently only available in a portable format so no installation is required besides extracting it in a safe place.
|
||||
On Windows Cemu is currently only available in a portable format so no installation is required besides extracting it in a safe place.
|
||||
|
||||
The native Linux build is currently a work-in-progress. See [Current State Of Linux builds](https://github.com/cemu-project/Cemu/issues/107) for more information about the things to be aware of.
|
||||
The native macOS build is currently purely experimental and should not be considered stable or ready for issue-free gameplay. There are also known issues with degraded performance due to the use of MoltenVK and Rosetta for ARM Macs. We appreciate your patience while we improve Cemu for macOS.
|
||||
|
||||
Pre-2.0 releases can be found on Cemu's [changelog page](https://cemu.info/changelog.html).
|
||||
|
||||
## Build Instructions
|
||||
|
||||
To compile Cemu yourself on Windows or Linux, view the [BUILD.md file](/BUILD.md).
|
||||
To compile Cemu yourself on Windows, Linux or macOS, view [BUILD.md](/BUILD.md).
|
||||
|
||||
## Issues
|
||||
|
||||
|
@ -44,10 +44,11 @@ The old bug tracker can be found at [bugs.cemu.info](https://bugs.cemu.info) and
|
|||
## Contributing
|
||||
|
||||
Pull requests are very welcome. For easier coordination you can visit the developer discussion channel on [Discord](https://discord.gg/5psYsup) or alternatively the [Matrix Server](https://matrix.to/#/#cemu:cemu.info).
|
||||
Before submitting a pull request, please read and follow our code style guidelines listed in [CODING_STYLE.md](/CODING_STYLE.md).
|
||||
|
||||
If coding isn't your thing, testing games and making detailed bug reports or updating the (usually outdated) compatibility wiki is also appreciated!
|
||||
|
||||
Questions about Cemu's software architecture can also be answered on Discord (through the Matrix bridge).
|
||||
Questions about Cemu's software architecture can also be answered on Discord (or through the Matrix bridge).
|
||||
|
||||
## License
|
||||
Cemu is licensed under [Mozilla Public License 2.0](/LICENSE.txt). Exempt from this are all files in the dependencies directory for which the licenses of the original code apply as well as some individual files in the src folder, as specified in those file headers respectively.
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
# Mario Kart 8 (JPN)
|
||||
|
||||
[CPU]
|
||||
cpuMode = Singlecore-Recompiler
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
# Mario Kart 8 (USA)
|
||||
|
||||
[CPU]
|
||||
cpuMode = Singlecore-Recompiler
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
# Mario Kart 8 (EUR)
|
||||
|
||||
[CPU]
|
||||
cpuMode = Singlecore-Recompiler
|
||||
|
|
BIN
bin/resources/ar/cemu.mo
Normal file
BIN
bin/resources/ar/cemu.mo
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/resources/he/cemu.mo
Normal file
BIN
bin/resources/he/cemu.mo
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/resources/uk/cemu.mo
Normal file
BIN
bin/resources/uk/cemu.mo
Normal file
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
If you plan to transfer the shader cache to a different PC or Cemu installation you only need to copy the 'transferable' directory.
|
279
cmake/ECMFindModuleHelpers.cmake
Normal file
279
cmake/ECMFindModuleHelpers.cmake
Normal file
|
@ -0,0 +1,279 @@
|
|||
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
ECMFindModuleHelpers
|
||||
--------------------
|
||||
|
||||
Helper macros for find modules: ``ecm_find_package_version_check()``,
|
||||
``ecm_find_package_parse_components()`` and
|
||||
``ecm_find_package_handle_library_components()``.
|
||||
|
||||
::
|
||||
|
||||
ecm_find_package_version_check(<name>)
|
||||
|
||||
Prints warnings if the CMake version or the project's required CMake version
|
||||
is older than that required by extra-cmake-modules.
|
||||
|
||||
::
|
||||
|
||||
ecm_find_package_parse_components(<name>
|
||||
RESULT_VAR <variable>
|
||||
KNOWN_COMPONENTS <component1> [<component2> [...]]
|
||||
[SKIP_DEPENDENCY_HANDLING])
|
||||
|
||||
This macro will populate <variable> with a list of components found in
|
||||
<name>_FIND_COMPONENTS, after checking that all those components are in the
|
||||
list of ``KNOWN_COMPONENTS``; if there are any unknown components, it will print
|
||||
an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
|
||||
``return()``.
|
||||
|
||||
The order of components in <variable> is guaranteed to match the order they
|
||||
are listed in the ``KNOWN_COMPONENTS`` argument.
|
||||
|
||||
If ``SKIP_DEPENDENCY_HANDLING`` is not set, for each component the variable
|
||||
<name>_<component>_component_deps will be checked for dependent components.
|
||||
If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
|
||||
dependencies will also be added to <variable>.
|
||||
|
||||
::
|
||||
|
||||
ecm_find_package_handle_library_components(<name>
|
||||
COMPONENTS <component> [<component> [...]]
|
||||
[SKIP_DEPENDENCY_HANDLING])
|
||||
[SKIP_PKG_CONFIG])
|
||||
|
||||
Creates an imported library target for each component. The operation of this
|
||||
macro depends on the presence of a number of CMake variables.
|
||||
|
||||
The <name>_<component>_lib variable should contain the name of this library,
|
||||
and <name>_<component>_header variable should contain the name of a header
|
||||
file associated with it (whatever relative path is normally passed to
|
||||
'#include'). <name>_<component>_header_subdir variable can be used to specify
|
||||
which subdirectory of the include path the headers will be found in.
|
||||
``ecm_find_package_components()`` will then search for the library
|
||||
and include directory (creating appropriate cache variables) and create an
|
||||
imported library target named <name>::<component>.
|
||||
|
||||
Additional variables can be used to provide additional information:
|
||||
|
||||
If ``SKIP_PKG_CONFIG``, the <name>_<component>_pkg_config variable is set, and
|
||||
pkg-config is found, the pkg-config module given by
|
||||
<name>_<component>_pkg_config will be searched for and used to help locate the
|
||||
library and header file. It will also be used to set
|
||||
<name>_<component>_VERSION.
|
||||
|
||||
Note that if version information is found via pkg-config,
|
||||
<name>_<component>_FIND_VERSION can be set to require a particular version
|
||||
for each component.
|
||||
|
||||
If ``SKIP_DEPENDENCY_HANDLING`` is not set, the ``INTERFACE_LINK_LIBRARIES`` property
|
||||
of the imported target for <component> will be set to contain the imported
|
||||
targets for the components listed in <name>_<component>_component_deps.
|
||||
<component>_FOUND will also be set to ``FALSE`` if any of the components in
|
||||
<name>_<component>_component_deps are not found. This requires the components
|
||||
in <name>_<component>_component_deps to be listed before <component> in the
|
||||
``COMPONENTS`` argument.
|
||||
|
||||
The following variables will be set:
|
||||
|
||||
``<name>_TARGETS``
|
||||
the imported targets
|
||||
``<name>_LIBRARIES``
|
||||
the found libraries
|
||||
``<name>_INCLUDE_DIRS``
|
||||
the combined required include directories for the components
|
||||
``<name>_DEFINITIONS``
|
||||
the "other" CFLAGS provided by pkg-config, if any
|
||||
``<name>_VERSION``
|
||||
the value of ``<name>_<component>_VERSION`` for the first component that
|
||||
has this variable set (note that components are searched for in the order
|
||||
they are passed to the macro), although if it is already set, it will not
|
||||
be altered
|
||||
|
||||
.. note::
|
||||
These variables are never cleared, so if
|
||||
``ecm_find_package_handle_library_components()`` is called multiple times with
|
||||
different components (typically because of multiple ``find_package()`` calls) then
|
||||
``<name>_TARGETS``, for example, will contain all the targets found in any
|
||||
call (although no duplicates).
|
||||
|
||||
Since pre-1.0.0.
|
||||
#]=======================================================================]
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
macro(ecm_find_package_version_check module_name)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.16.0)
|
||||
message(FATAL_ERROR "CMake 3.16.0 is required by Find${module_name}.cmake")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.16.0)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 3.16.0 to use Find${module_name}.cmake")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_parse_components module_name)
|
||||
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fppc_oneValueArgs RESULT_VAR)
|
||||
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPPC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_RESULT_VAR)
|
||||
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
|
||||
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
endif()
|
||||
|
||||
if(${module_name}_FIND_COMPONENTS)
|
||||
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
|
||||
|
||||
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
|
||||
# Make sure deps are included
|
||||
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
|
||||
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
|
||||
if("${ecm_fppc_index}" STREQUAL "-1")
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
|
||||
endif()
|
||||
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS "Skipping dependency handling for ${module_name}")
|
||||
endif()
|
||||
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
|
||||
|
||||
# This makes sure components are listed in the same order as
|
||||
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
|
||||
set(${ECM_FPPC_RESULT_VAR})
|
||||
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
|
||||
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
|
||||
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
|
||||
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
|
||||
endif()
|
||||
endforeach()
|
||||
# if there are any left, they are unknown components
|
||||
if(ecm_fppc_requestedComps)
|
||||
set(ecm_fppc_msgType STATUS)
|
||||
if(${module_name}_FIND_REQUIRED)
|
||||
set(ecm_fppc_msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_handle_library_components module_name)
|
||||
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fpwc_oneValueArgs)
|
||||
set(ecm_fpwc_multiValueArgs COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPWC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPWC_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package(PkgConfig QUIET)
|
||||
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
|
||||
set(ecm_fpwc_dep_vars)
|
||||
set(ecm_fpwc_dep_targets)
|
||||
if(NOT SKIP_DEPENDENCY_HANDLING)
|
||||
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
|
||||
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
|
||||
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
|
||||
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
|
||||
${${module_name}_${ecm_fpwc_comp}_pkg_config})
|
||||
endif()
|
||||
|
||||
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
|
||||
)
|
||||
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
|
||||
if(NOT ${module_name}_VERSION)
|
||||
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
|
||||
endif()
|
||||
|
||||
set(FPHSA_NAME_MISMATCHED 1)
|
||||
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
|
||||
FOUND_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_FOUND
|
||||
REQUIRED_VARS
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
${ecm_fpwc_dep_vars}
|
||||
VERSION_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_VERSION
|
||||
)
|
||||
unset(FPHSA_NAME_MISMATCHED)
|
||||
|
||||
mark_as_advanced(
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(${module_name}_${ecm_fpwc_comp}_FOUND)
|
||||
list(APPEND ${module_name}_LIBRARIES
|
||||
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
|
||||
list(APPEND ${module_name}_INCLUDE_DIRS
|
||||
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
|
||||
set(${module_name}_DEFINITIONS
|
||||
${${module_name}_DEFINITIONS}
|
||||
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
|
||||
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
|
||||
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
|
||||
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
|
||||
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${module_name}_TARGETS
|
||||
"${module_name}::${ecm_fpwc_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(${module_name}_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
|
||||
endif()
|
||||
if(${module_name}_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
|
||||
endif()
|
||||
if(${module_name}_DEFINITIONS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
|
||||
endif()
|
||||
if(${module_name}_TARGETS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
|
||||
endif()
|
||||
endmacro()
|
1
cmake/ECMFindModuleHelpersStub.cmake
Normal file
1
cmake/ECMFindModuleHelpersStub.cmake
Normal file
|
@ -0,0 +1 @@
|
|||
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
|
137
cmake/FindWayland.cmake
Normal file
137
cmake/FindWayland.cmake
Normal file
|
@ -0,0 +1,137 @@
|
|||
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
|
||||
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindWayland
|
||||
-----------
|
||||
|
||||
Try to find Wayland.
|
||||
|
||||
This is a component-based find module, which makes use of the COMPONENTS
|
||||
and OPTIONAL_COMPONENTS arguments to find_module. The following components
|
||||
are available::
|
||||
|
||||
Client Server Cursor Egl
|
||||
|
||||
If no components are specified, this module will act as though all components
|
||||
were passed to OPTIONAL_COMPONENTS.
|
||||
|
||||
This module will define the following variables, independently of the
|
||||
components searched for or found:
|
||||
|
||||
``Wayland_FOUND``
|
||||
TRUE if (the requested version of) Wayland is available
|
||||
``Wayland_VERSION``
|
||||
Found Wayland version
|
||||
``Wayland_TARGETS``
|
||||
A list of all targets imported by this module (note that there may be more
|
||||
than the components that were requested)
|
||||
``Wayland_LIBRARIES``
|
||||
This can be passed to target_link_libraries() instead of the imported
|
||||
targets
|
||||
``Wayland_INCLUDE_DIRS``
|
||||
This should be passed to target_include_directories() if the targets are
|
||||
not used for linking
|
||||
``Wayland_DEFINITIONS``
|
||||
This should be passed to target_compile_options() if the targets are not
|
||||
used for linking
|
||||
``Wayland_DATADIR``
|
||||
The core wayland protocols data directory
|
||||
Since 5.73.0
|
||||
|
||||
For each searched-for components, ``Wayland_<component>_FOUND`` will be set to
|
||||
TRUE if the corresponding Wayland library was found, and FALSE otherwise. If
|
||||
``Wayland_<component>_FOUND`` is TRUE, the imported target
|
||||
``Wayland::<component>`` will be defined. This module will also attempt to
|
||||
determine ``Wayland_*_VERSION`` variables for each imported target, although
|
||||
``Wayland_VERSION`` should normally be sufficient.
|
||||
|
||||
In general we recommend using the imported targets, as they are easier to use
|
||||
and provide more control. Bear in mind, however, that if any target is in the
|
||||
link interface of an exported library, it must be made available by the
|
||||
package config file.
|
||||
|
||||
Since pre-1.0.0.
|
||||
#]=======================================================================]
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
|
||||
|
||||
ecm_find_package_version_check(Wayland)
|
||||
|
||||
set(Wayland_known_components
|
||||
Client
|
||||
Server
|
||||
Cursor
|
||||
Egl
|
||||
)
|
||||
foreach(_comp ${Wayland_known_components})
|
||||
string(TOLOWER "${_comp}" _lc_comp)
|
||||
set(Wayland_${_comp}_component_deps)
|
||||
set(Wayland_${_comp}_pkg_config "wayland-${_lc_comp}")
|
||||
set(Wayland_${_comp}_lib "wayland-${_lc_comp}")
|
||||
set(Wayland_${_comp}_header "wayland-${_lc_comp}.h")
|
||||
endforeach()
|
||||
set(Wayland_Egl_component_deps Client)
|
||||
|
||||
ecm_find_package_parse_components(Wayland
|
||||
RESULT_VAR Wayland_components
|
||||
KNOWN_COMPONENTS ${Wayland_known_components}
|
||||
)
|
||||
ecm_find_package_handle_library_components(Wayland
|
||||
COMPONENTS ${Wayland_components}
|
||||
)
|
||||
|
||||
# If pkg-config didn't provide us with version information,
|
||||
# try to extract it from wayland-version.h
|
||||
# (Note that the version from wayland-egl.pc will probably be
|
||||
# the Mesa version, rather than the Wayland version, but that
|
||||
# version will be ignored as we always find wayland-client.pc
|
||||
# first).
|
||||
if(NOT Wayland_VERSION)
|
||||
find_file(Wayland_VERSION_HEADER
|
||||
NAMES wayland-version.h
|
||||
HINTS ${Wayland_INCLUDE_DIRS}
|
||||
)
|
||||
mark_as_advanced(Wayland_VERSION_HEADER)
|
||||
if(Wayland_VERSION_HEADER)
|
||||
file(READ ${Wayland_VERSION_HEADER} _wayland_version_header_contents)
|
||||
string(REGEX REPLACE
|
||||
"^.*[ \t]+WAYLAND_VERSION[ \t]+\"([0-9.]*)\".*$"
|
||||
"\\1"
|
||||
Wayland_VERSION
|
||||
"${_wayland_version_header_contents}"
|
||||
)
|
||||
unset(_wayland_version_header_contents)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(Wayland
|
||||
FOUND_VAR
|
||||
Wayland_FOUND
|
||||
REQUIRED_VARS
|
||||
Wayland_LIBRARIES
|
||||
VERSION_VAR
|
||||
Wayland_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
pkg_get_variable(Wayland_DATADIR wayland-scanner pkgdatadir)
|
||||
if (CMAKE_CROSSCOMPILING AND (NOT EXISTS "${Wayland_DATADIR}/wayland.xml"))
|
||||
# PKG_CONFIG_SYSROOT_DIR only applies to -I and -L flags, so pkg-config
|
||||
# does not prepend CMAKE_SYSROOT when cross-compiling unless you pass
|
||||
# --define-prefix explicitly. Therefore we have to manually do prepend
|
||||
# it here when cross-compiling.
|
||||
# See https://gitlab.kitware.com/cmake/cmake/-/issues/16647#note_844761
|
||||
set(Wayland_DATADIR ${CMAKE_SYSROOT}${Wayland_DATADIR})
|
||||
endif()
|
||||
if (NOT EXISTS "${Wayland_DATADIR}/wayland.xml")
|
||||
message(WARNING "Could not find wayland.xml in ${Wayland_DATADIR}")
|
||||
endif()
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(Wayland PROPERTIES
|
||||
URL "https://wayland.freedesktop.org/"
|
||||
DESCRIPTION "C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients"
|
||||
)
|
38
cmake/FindWaylandProtocols.cmake
Normal file
38
cmake/FindWaylandProtocols.cmake
Normal file
|
@ -0,0 +1,38 @@
|
|||
# SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindWaylandProtocols
|
||||
--------------------
|
||||
|
||||
Try to find wayland-protocols on a Unix system.
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``WaylandProtocols_FOUND``
|
||||
True if (the requested version of) wayland-protocols is available
|
||||
``WaylandProtocols_VERSION``
|
||||
The version of wayland-protocols
|
||||
``WaylandProtocols_DATADIR``
|
||||
The wayland protocols data directory
|
||||
#]=======================================================================]
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PKG_wayland_protocols QUIET wayland-protocols)
|
||||
|
||||
set(WaylandProtocols_VERSION ${PKG_wayland_protocols_VERSION})
|
||||
pkg_get_variable(WaylandProtocols_DATADIR wayland-protocols pkgdatadir)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(WaylandProtocols
|
||||
FOUND_VAR WaylandProtocols_FOUND
|
||||
REQUIRED_VARS WaylandProtocols_DATADIR
|
||||
VERSION_VAR WaylandProtocols_VERSION
|
||||
)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(WaylandProtocols PROPERTIES
|
||||
DESCRIPTION "Specifications of extended Wayland protocols"
|
||||
URL "https://wayland.freedesktop.org/"
|
||||
)
|
162
cmake/FindWaylandScanner.cmake
Normal file
162
cmake/FindWaylandScanner.cmake
Normal file
|
@ -0,0 +1,162 @@
|
|||
# SPDX-FileCopyrightText: 2012-2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindWaylandScanner
|
||||
------------------
|
||||
|
||||
Try to find wayland-scanner.
|
||||
|
||||
If the wayland-scanner executable is not in your PATH, you can provide
|
||||
an alternative name or full path location with the ``WaylandScanner_EXECUTABLE``
|
||||
variable.
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``WaylandScanner_FOUND``
|
||||
True if wayland-scanner is available.
|
||||
|
||||
``WaylandScanner_EXECUTABLE``
|
||||
The wayland-scanner executable.
|
||||
|
||||
If ``WaylandScanner_FOUND`` is TRUE, it will also define the following imported
|
||||
target:
|
||||
|
||||
``Wayland::Scanner``
|
||||
The wayland-scanner executable.
|
||||
|
||||
This module provides the following functions to generate C protocol
|
||||
implementations:
|
||||
|
||||
- ``ecm_add_wayland_client_protocol``
|
||||
- ``ecm_add_wayland_server_protocol``
|
||||
|
||||
::
|
||||
|
||||
ecm_add_wayland_client_protocol(<target>
|
||||
PROTOCOL <xmlfile>
|
||||
BASENAME <basename>)
|
||||
|
||||
ecm_add_wayland_client_protocol(<source_files_var>
|
||||
PROTOCOL <xmlfile>
|
||||
BASENAME <basename>)
|
||||
|
||||
Generate Wayland client protocol files from ``<xmlfile>`` XML
|
||||
definition for the ``<basename>`` interface and append those files
|
||||
to ``<source_files_var>`` or ``<target>``.
|
||||
|
||||
::
|
||||
|
||||
ecm_add_wayland_server_protocol(<target>
|
||||
PROTOCOL <xmlfile>
|
||||
BASENAME <basename>)
|
||||
|
||||
ecm_add_wayland_server_protocol(<source_files_var>
|
||||
PROTOCOL <xmlfile>
|
||||
BASENAME <basename>)
|
||||
|
||||
Generate Wayland server protocol files from ``<xmlfile>`` XML
|
||||
definition for the ``<basename>`` interface and append those files
|
||||
to ``<source_files_var>`` or ``<target>``.
|
||||
|
||||
Since 1.4.0.
|
||||
#]=======================================================================]
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
|
||||
|
||||
ecm_find_package_version_check(WaylandScanner)
|
||||
|
||||
# Find wayland-scanner
|
||||
find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(WaylandScanner
|
||||
FOUND_VAR
|
||||
WaylandScanner_FOUND
|
||||
REQUIRED_VARS
|
||||
WaylandScanner_EXECUTABLE
|
||||
)
|
||||
|
||||
mark_as_advanced(WaylandScanner_EXECUTABLE)
|
||||
|
||||
if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND)
|
||||
add_executable(Wayland::Scanner IMPORTED)
|
||||
set_target_properties(Wayland::Scanner PROPERTIES
|
||||
IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(WaylandScanner PROPERTIES
|
||||
URL "https://wayland.freedesktop.org/"
|
||||
DESCRIPTION "Executable that converts XML protocol files to C code"
|
||||
)
|
||||
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
function(ecm_add_wayland_client_protocol target_or_sources_var)
|
||||
# Parse arguments
|
||||
set(oneValueArgs PROTOCOL BASENAME)
|
||||
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
|
||||
|
||||
if(ARGS_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
|
||||
set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h")
|
||||
set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c")
|
||||
|
||||
set_source_files_properties(${_client_header} GENERATED)
|
||||
set_source_files_properties(${_code} GENERATED)
|
||||
set_property(SOURCE ${_client_header} ${_code} PROPERTY SKIP_AUTOMOC ON)
|
||||
|
||||
add_custom_command(OUTPUT "${_client_header}"
|
||||
COMMAND ${WaylandScanner_EXECUTABLE} client-header ${_infile} ${_client_header}
|
||||
DEPENDS ${_infile} VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT "${_code}"
|
||||
COMMAND ${WaylandScanner_EXECUTABLE} public-code ${_infile} ${_code}
|
||||
DEPENDS ${_infile} ${_client_header} VERBATIM)
|
||||
|
||||
if (TARGET ${target_or_sources_var})
|
||||
target_sources(${target_or_sources_var} PRIVATE "${_client_header}" "${_code}")
|
||||
else()
|
||||
list(APPEND ${target_or_sources_var} "${_client_header}" "${_code}")
|
||||
set(${target_or_sources_var} ${${target_or_sources_var}} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(ecm_add_wayland_server_protocol target_or_sources_var)
|
||||
# Parse arguments
|
||||
set(oneValueArgs PROTOCOL BASENAME)
|
||||
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
|
||||
|
||||
if(ARGS_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
ecm_add_wayland_client_protocol(${target_or_sources_var}
|
||||
PROTOCOL ${ARGS_PROTOCOL}
|
||||
BASENAME ${ARGS_BASENAME})
|
||||
|
||||
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
|
||||
set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h")
|
||||
set(_server_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c")
|
||||
set_property(SOURCE ${_server_header} ${_server_code} PROPERTY SKIP_AUTOMOC ON)
|
||||
set_source_files_properties(${_server_header} GENERATED)
|
||||
|
||||
add_custom_command(OUTPUT "${_server_header}"
|
||||
COMMAND ${WaylandScanner_EXECUTABLE} server-header ${_infile} ${_server_header}
|
||||
DEPENDS ${_infile} VERBATIM)
|
||||
|
||||
if (TARGET ${target_or_sources_var})
|
||||
target_sources(${target_or_sources_var} PRIVATE "${_server_header}")
|
||||
else()
|
||||
list(APPEND ${target_or_sources_var} "${_server_header}")
|
||||
set(${target_or_sources_var} ${${target_or_sources_var}} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
20
cmake/Findbluez.cmake
Normal file
20
cmake/Findbluez.cmake
Normal file
|
@ -0,0 +1,20 @@
|
|||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it>
|
||||
# SPDX-License-Identifier: ISC
|
||||
|
||||
find_package(bluez CONFIG)
|
||||
if (NOT bluez_FOUND)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(bluez IMPORTED_TARGET GLOBAL bluez-1.0 bluez)
|
||||
if (bluez_FOUND)
|
||||
add_library(bluez::bluez ALIAS PkgConfig::bluez)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
find_package_handle_standard_args(bluez
|
||||
REQUIRED_VARS
|
||||
bluez_LINK_LIBRARIES
|
||||
bluez_FOUND
|
||||
VERSION_VAR bluez_VERSION
|
||||
)
|
20
cmake/Findlibusb.cmake
Normal file
20
cmake/Findlibusb.cmake
Normal file
|
@ -0,0 +1,20 @@
|
|||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it>
|
||||
# SPDX-License-Identifier: ISC
|
||||
|
||||
find_package(libusb CONFIG)
|
||||
if (NOT libusb_FOUND)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(libusb IMPORTED_TARGET GLOBAL libusb-1.0 libusb)
|
||||
if (libusb_FOUND)
|
||||
add_library(libusb::libusb ALIAS PkgConfig::libusb)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
find_package_handle_standard_args(libusb
|
||||
REQUIRED_VARS
|
||||
libusb_LINK_LIBRARIES
|
||||
libusb_FOUND
|
||||
VERSION_VAR libusb_VERSION
|
||||
)
|
2
dependencies/Vulkan-Headers
vendored
2
dependencies/Vulkan-Headers
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 715673702f5b18ffb8e5832e67cf731468d32ac6
|
||||
Subproject commit 9b9fd871b08110cd8f0b74e721b03213d9cc3081
|
2
dependencies/cubeb
vendored
2
dependencies/cubeb
vendored
|
@ -1 +1 @@
|
|||
Subproject commit dc511c6b3597b6384d28949285b9289e009830ea
|
||||
Subproject commit 2071354a69aca7ed6df3b4222e305746c2113f60
|
4
dependencies/gamemode/CMakeLists.txt
vendored
Normal file
4
dependencies/gamemode/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
project( gamemode LANGUAGES C )
|
||||
add_library (gamemode
|
||||
"lib/gamemode_client.h"
|
||||
"lib/client_loader.c")
|
35
dependencies/gamemode/lib/client_loader.c
vendored
Normal file
35
dependencies/gamemode/lib/client_loader.c
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
|
||||
Copyright (c) 2017-2019, Feral Interactive
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Feral Interactive nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Simply include the header with GAMEMODE_AUTO set
|
||||
// This will ensure it calls the functions when it's loaded
|
||||
#define GAMEMODE_AUTO
|
||||
#include "gamemode_client.h"
|
376
dependencies/gamemode/lib/gamemode_client.h
vendored
Normal file
376
dependencies/gamemode/lib/gamemode_client.h
vendored
Normal file
|
@ -0,0 +1,376 @@
|
|||
/*
|
||||
|
||||
Copyright (c) 2017-2019, Feral Interactive
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Feral Interactive nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
#ifndef CLIENT_GAMEMODE_H
|
||||
#define CLIENT_GAMEMODE_H
|
||||
/*
|
||||
* GameMode supports the following client functions
|
||||
* Requests are refcounted in the daemon
|
||||
*
|
||||
* int gamemode_request_start() - Request gamemode starts
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
*
|
||||
* int gamemode_request_end() - Request gamemode ends
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
*
|
||||
* GAMEMODE_AUTO can be defined to make the above two functions apply during static init and
|
||||
* destruction, as appropriate. In this configuration, errors will be printed to stderr
|
||||
*
|
||||
* int gamemode_query_status() - Query the current status of gamemode
|
||||
* 0 if gamemode is inactive
|
||||
* 1 if gamemode is active
|
||||
* 2 if gamemode is active and this client is registered
|
||||
* -1 if the query failed
|
||||
*
|
||||
* int gamemode_request_start_for(pid_t pid) - Request gamemode starts for another process
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
* -2 if the request was rejected
|
||||
*
|
||||
* int gamemode_request_end_for(pid_t pid) - Request gamemode ends for another process
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
* -2 if the request was rejected
|
||||
*
|
||||
* int gamemode_query_status_for(pid_t pid) - Query status of gamemode for another process
|
||||
* 0 if gamemode is inactive
|
||||
* 1 if gamemode is active
|
||||
* 2 if gamemode is active and this client is registered
|
||||
* -1 if the query failed
|
||||
*
|
||||
* const char* gamemode_error_string() - Get an error string
|
||||
* returns a string describing any of the above errors
|
||||
*
|
||||
* Note: All the above requests can be blocking - dbus requests can and will block while the daemon
|
||||
* handles the request. It is not recommended to make these calls in performance critical code
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
static char internal_gamemode_client_error_string[512] = { 0 };
|
||||
|
||||
/**
|
||||
* Load libgamemode dynamically to dislodge us from most dependencies.
|
||||
* This allows clients to link and/or use this regardless of runtime.
|
||||
* See SDL2 for an example of the reasoning behind this in terms of
|
||||
* dynamic versioning as well.
|
||||
*/
|
||||
static volatile int internal_libgamemode_loaded = 1;
|
||||
|
||||
/* Typedefs for the functions to load */
|
||||
typedef int (*api_call_return_int)(void);
|
||||
typedef const char *(*api_call_return_cstring)(void);
|
||||
typedef int (*api_call_pid_return_int)(pid_t);
|
||||
|
||||
/* Storage for functors */
|
||||
static api_call_return_int REAL_internal_gamemode_request_start = NULL;
|
||||
static api_call_return_int REAL_internal_gamemode_request_end = NULL;
|
||||
static api_call_return_int REAL_internal_gamemode_query_status = NULL;
|
||||
static api_call_return_cstring REAL_internal_gamemode_error_string = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_request_start_for = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_request_end_for = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_query_status_for = NULL;
|
||||
|
||||
/**
|
||||
* Internal helper to perform the symbol binding safely.
|
||||
*
|
||||
* Returns 0 on success and -1 on failure
|
||||
*/
|
||||
__attribute__((always_inline)) static inline int internal_bind_libgamemode_symbol(
|
||||
void *handle, const char *name, void **out_func, size_t func_size, bool required)
|
||||
{
|
||||
void *symbol_lookup = NULL;
|
||||
char *dl_error = NULL;
|
||||
|
||||
/* Safely look up the symbol */
|
||||
symbol_lookup = dlsym(handle, name);
|
||||
dl_error = dlerror();
|
||||
if (required && (dl_error || !symbol_lookup)) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"dlsym failed - %s",
|
||||
dl_error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Have the symbol correctly, copy it to make it usable */
|
||||
memcpy(out_func, &symbol_lookup, func_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads libgamemode and needed functions
|
||||
*
|
||||
* Returns 0 on success and -1 on failure
|
||||
*/
|
||||
__attribute__((always_inline)) static inline int internal_load_libgamemode(void)
|
||||
{
|
||||
/* We start at 1, 0 is a success and -1 is a fail */
|
||||
if (internal_libgamemode_loaded != 1) {
|
||||
return internal_libgamemode_loaded;
|
||||
}
|
||||
|
||||
/* Anonymous struct type to define our bindings */
|
||||
struct binding {
|
||||
const char *name;
|
||||
void **functor;
|
||||
size_t func_size;
|
||||
bool required;
|
||||
} bindings[] = {
|
||||
{ "real_gamemode_request_start",
|
||||
(void **)&REAL_internal_gamemode_request_start,
|
||||
sizeof(REAL_internal_gamemode_request_start),
|
||||
true },
|
||||
{ "real_gamemode_request_end",
|
||||
(void **)&REAL_internal_gamemode_request_end,
|
||||
sizeof(REAL_internal_gamemode_request_end),
|
||||
true },
|
||||
{ "real_gamemode_query_status",
|
||||
(void **)&REAL_internal_gamemode_query_status,
|
||||
sizeof(REAL_internal_gamemode_query_status),
|
||||
false },
|
||||
{ "real_gamemode_error_string",
|
||||
(void **)&REAL_internal_gamemode_error_string,
|
||||
sizeof(REAL_internal_gamemode_error_string),
|
||||
true },
|
||||
{ "real_gamemode_request_start_for",
|
||||
(void **)&REAL_internal_gamemode_request_start_for,
|
||||
sizeof(REAL_internal_gamemode_request_start_for),
|
||||
false },
|
||||
{ "real_gamemode_request_end_for",
|
||||
(void **)&REAL_internal_gamemode_request_end_for,
|
||||
sizeof(REAL_internal_gamemode_request_end_for),
|
||||
false },
|
||||
{ "real_gamemode_query_status_for",
|
||||
(void **)&REAL_internal_gamemode_query_status_for,
|
||||
sizeof(REAL_internal_gamemode_query_status_for),
|
||||
false },
|
||||
};
|
||||
|
||||
void *libgamemode = NULL;
|
||||
|
||||
/* Try and load libgamemode */
|
||||
libgamemode = dlopen("libgamemode.so.0", RTLD_NOW);
|
||||
if (!libgamemode) {
|
||||
/* Attempt to load unversioned library for compatibility with older
|
||||
* versions (as of writing, there are no ABI changes between the two -
|
||||
* this may need to change if ever ABI-breaking changes are made) */
|
||||
libgamemode = dlopen("libgamemode.so", RTLD_NOW);
|
||||
if (!libgamemode) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"dlopen failed - %s",
|
||||
dlerror());
|
||||
internal_libgamemode_loaded = -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Attempt to bind all symbols */
|
||||
for (size_t i = 0; i < sizeof(bindings) / sizeof(bindings[0]); i++) {
|
||||
struct binding *binder = &bindings[i];
|
||||
|
||||
if (internal_bind_libgamemode_symbol(libgamemode,
|
||||
binder->name,
|
||||
binder->functor,
|
||||
binder->func_size,
|
||||
binder->required)) {
|
||||
internal_libgamemode_loaded = -1;
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
/* Success */
|
||||
internal_libgamemode_loaded = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the real libgamemode
|
||||
*/
|
||||
__attribute__((always_inline)) static inline const char *gamemode_error_string(void)
|
||||
{
|
||||
/* If we fail to load the system gamemode, or we have an error string already, return our error
|
||||
* string instead of diverting to the system version */
|
||||
if (internal_load_libgamemode() < 0 || internal_gamemode_client_error_string[0] != '\0') {
|
||||
return internal_gamemode_client_error_string;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_error_string != NULL);
|
||||
|
||||
return REAL_internal_gamemode_error_string();
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the real libgamemode
|
||||
* Allow automatically requesting game mode
|
||||
* Also prints errors as they happen.
|
||||
*/
|
||||
#ifdef GAMEMODE_AUTO
|
||||
__attribute__((constructor))
|
||||
#else
|
||||
__attribute__((always_inline)) static inline
|
||||
#endif
|
||||
int gamemode_request_start(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_request_start != NULL);
|
||||
|
||||
if (REAL_internal_gamemode_request_start() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
#ifdef GAMEMODE_AUTO
|
||||
__attribute__((destructor))
|
||||
#else
|
||||
__attribute__((always_inline)) static inline
|
||||
#endif
|
||||
int gamemode_request_end(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_request_end != NULL);
|
||||
|
||||
if (REAL_internal_gamemode_request_end() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_query_status(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_query_status == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_query_status missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_query_status();
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_request_start_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_request_start_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_request_start_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_request_start_for(pid);
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_request_end_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_request_end_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_request_end_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_request_end_for(pid);
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_query_status_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_query_status_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_query_status_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_query_status_for(pid);
|
||||
}
|
||||
|
||||
#endif // CLIENT_GAMEMODE_H
|
18
dependencies/ih264d/CMakeLists.txt
vendored
18
dependencies/ih264d/CMakeLists.txt
vendored
|
@ -117,7 +117,13 @@ add_library (ih264d
|
|||
"decoder/ivd.h"
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||
if (CMAKE_OSX_ARCHITECTURES)
|
||||
set(IH264D_ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES})
|
||||
else()
|
||||
set(IH264D_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
|
||||
if (IH264D_ARCHITECTURE STREQUAL "x86_64" OR IH264D_ARCHITECTURE STREQUAL "amd64" OR IH264D_ARCHITECTURE STREQUAL "AMD64")
|
||||
set(LIBAVCDEC_X86_INCLUDES "common/x86" "decoder/x86")
|
||||
include_directories("common/" "decoder/" ${LIBAVCDEC_X86_INCLUDES})
|
||||
target_sources(ih264d PRIVATE
|
||||
|
@ -140,7 +146,7 @@ target_sources(ih264d PRIVATE
|
|||
"decoder/x86/ih264d_function_selector_sse42.c"
|
||||
"decoder/x86/ih264d_function_selector_ssse3.c"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||
elseif(IH264D_ARCHITECTURE STREQUAL "aarch64" OR IH264D_ARCHITECTURE STREQUAL "arm64")
|
||||
enable_language( C CXX ASM )
|
||||
set(LIBAVCDEC_ARM_INCLUDES "common/armv8" "decoder/arm")
|
||||
include_directories("common/" "decoder/" ${LIBAVCDEC_ARM_INCLUDES})
|
||||
|
@ -178,9 +184,15 @@ target_sources(ih264d PRIVATE
|
|||
)
|
||||
target_compile_options(ih264d PRIVATE -DARMV8)
|
||||
else()
|
||||
message(FATAL_ERROR "ih264d unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(FATAL_ERROR "ih264d unknown architecture: ${IH264D_ARCHITECTURE}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set_property(TARGET ih264d PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
# tune settings for slightly better performance
|
||||
target_compile_options(ih264d PRIVATE $<$<CONFIG:Release,RelWithDebInfo>:/Oi>) # enable intrinsic functions
|
||||
target_compile_options(ih264d PRIVATE $<$<CONFIG:Release,RelWithDebInfo>:/Ot>) # favor speed
|
||||
target_compile_options(ih264d PRIVATE "/GS-") # disable runtime checks
|
||||
|
||||
endif()
|
||||
|
|
48
dependencies/ih264d/common/ithread.c
vendored
48
dependencies/ih264d/common/ithread.c
vendored
|
@ -85,28 +85,59 @@ UWORD32 ithread_get_mutex_lock_size(void)
|
|||
return sizeof(CRITICAL_SECTION);
|
||||
}
|
||||
|
||||
struct _ithread_launch_param
|
||||
{
|
||||
void (*startFunc)(void* argument);
|
||||
void* argument;
|
||||
};
|
||||
|
||||
DWORD WINAPI _ithread_WinThreadStartRoutine(LPVOID lpThreadParameter)
|
||||
{
|
||||
struct _ithread_launch_param* param = (struct _ithread_launch_param*)lpThreadParameter;
|
||||
typedef void *(*ThreadStartRoutineType)(void *);
|
||||
ThreadStartRoutineType pfnThreadRoutine = (ThreadStartRoutineType)param->startFunc;
|
||||
void* arg = param->argument;
|
||||
free(param);
|
||||
pfnThreadRoutine(arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
WORD32 ithread_create(void* thread_handle, void* attribute, void* strt, void* argument)
|
||||
{
|
||||
//UNUSED(attribute);
|
||||
//return pthread_create((pthread_t*)thread_handle, NULL, (void* (*)(void*)) strt, argument);
|
||||
__debugbreak();
|
||||
UNUSED(attribute);
|
||||
struct _ithread_launch_param* param = malloc(sizeof(struct _ithread_launch_param));
|
||||
param->startFunc = (void (*)(void*))strt;
|
||||
param->argument = argument;
|
||||
HANDLE *handle = (HANDLE*)thread_handle;
|
||||
*handle = CreateThread(NULL, 0, _ithread_WinThreadStartRoutine, param, 0, NULL);
|
||||
if(*handle == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
WORD32 ithread_join(void* thread_handle, void** val_ptr)
|
||||
{
|
||||
//UNUSED(val_ptr);
|
||||
//pthread_t* pthread_handle = (pthread_t*)thread_handle;
|
||||
//return pthread_join(*pthread_handle, NULL);
|
||||
|
||||
__debugbreak();
|
||||
HANDLE *handle = (HANDLE*)thread_handle;
|
||||
DWORD result = WaitForSingleObject(*handle, INFINITE);
|
||||
if(result == WAIT_OBJECT_0)
|
||||
{
|
||||
CloseHandle(*handle);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
WORD32 ithread_get_mutex_struct_size(void)
|
||||
{
|
||||
return sizeof(CRITICAL_SECTION);
|
||||
}
|
||||
|
||||
WORD32 ithread_mutex_init(void* mutex)
|
||||
{
|
||||
InitializeCriticalSection((LPCRITICAL_SECTION)mutex);
|
||||
|
@ -153,7 +184,6 @@ UWORD32 ithread_get_sem_struct_size(void)
|
|||
//return(sizeof(sem_t));
|
||||
}
|
||||
|
||||
|
||||
WORD32 ithread_sem_init(void* sem, WORD32 pshared, UWORD32 value)
|
||||
{
|
||||
__debugbreak();
|
||||
|
@ -168,7 +198,6 @@ WORD32 ithread_sem_post(void* sem)
|
|||
//return sem_post((sem_t*)sem);
|
||||
}
|
||||
|
||||
|
||||
WORD32 ithread_sem_wait(void* sem)
|
||||
{
|
||||
__debugbreak();
|
||||
|
@ -176,7 +205,6 @@ WORD32 ithread_sem_wait(void* sem)
|
|||
//return sem_wait((sem_t*)sem);
|
||||
}
|
||||
|
||||
|
||||
WORD32 ithread_sem_destroy(void* sem)
|
||||
{
|
||||
__debugbreak();
|
||||
|
|
|
@ -79,10 +79,8 @@
|
|||
static inline int __builtin_clz(unsigned x)
|
||||
{
|
||||
unsigned long n;
|
||||
if (x == 0)
|
||||
return 32;
|
||||
_BitScanReverse(&n, x);
|
||||
return 31 - n;
|
||||
return n ^ 31;
|
||||
}
|
||||
|
||||
static inline int __builtin_ctz(unsigned x) {
|
||||
|
|
2
dependencies/imgui
vendored
2
dependencies/imgui
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 8a44c31c95c8e0217f6e1fc814cbbbcca4981f14
|
||||
Subproject commit f65bcf481ab34cd07d3909aab1479f409fa79f2f
|
2
dependencies/vcpkg
vendored
2
dependencies/vcpkg
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 1b0252ca70ca2244a711535462c7f981eb439e83
|
||||
Subproject commit a4275b7eee79fb24ec2e135481ef5fce8b41c339
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/include/fmt/format.h b/include/fmt/format.h
|
||||
index 4e96539..0f1d179 100644
|
||||
--- a/include/fmt/format.h
|
||||
+++ b/include/fmt/format.h
|
||||
@@ -33,6 +33,7 @@
|
||||
#ifndef FMT_FORMAT_H_
|
||||
#define FMT_FORMAT_H_
|
||||
|
||||
+#pragma warning(disable:4189)
|
||||
#include <algorithm>
|
||||
#include <cerrno>
|
||||
#include <cmath>
|
|
@ -1,65 +0,0 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO fmtlib/fmt
|
||||
REF a33701196adfad74917046096bf5a2aa0ab0bb50 # v9.1.0
|
||||
SHA512 0faf00e99b332fcb3d9fc50cc9649ddc004ca9035f3652c1a001facee725dab09f67b65a9dfcce0aedb47e76c74c45a9262a1fd6e250a9e9a27c7d021c8ee6b8
|
||||
HEAD_REF master
|
||||
# PATCHES fix-warning4189.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
DISABLE_PARALLEL_CONFIGURE # with MSBuild (on UWP), fmt writes into the source directory
|
||||
OPTIONS
|
||||
-DFMT_CMAKE_DIR=share/fmt
|
||||
-DFMT_TEST=OFF
|
||||
-DFMT_DOC=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll")
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/fmt.dll")
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h
|
||||
"defined(FMT_SHARED)"
|
||||
"1"
|
||||
)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
vcpkg_cmake_config_fixup()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake
|
||||
"lib/fmtd.dll"
|
||||
"bin/fmtd.dll"
|
||||
)
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake
|
||||
"lib/fmt.dll"
|
||||
"bin/fmt.dll"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
# Handle post-build CMake instructions
|
||||
vcpkg_copy_pdbs()
|
||||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
7
dependencies/vcpkg_overlay_ports/fmt/usage
vendored
7
dependencies/vcpkg_overlay_ports/fmt/usage
vendored
|
@ -1,7 +0,0 @@
|
|||
The package fmt provides CMake targets:
|
||||
|
||||
find_package(fmt CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE fmt::fmt)
|
||||
|
||||
# Or use the header-only version
|
||||
target_link_libraries(main PRIVATE fmt::fmt-header-only)
|
17
dependencies/vcpkg_overlay_ports/fmt/vcpkg.json
vendored
17
dependencies/vcpkg_overlay_ports/fmt/vcpkg.json
vendored
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"name": "fmt",
|
||||
"version": "7.1.3",
|
||||
"port-version": 2,
|
||||
"description": "Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams.",
|
||||
"homepage": "https://github.com/fmtlib/fmt",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.7)
|
||||
|
||||
project(wxwidgets-example)
|
||||
|
||||
add_executable(main WIN32 popup.cpp)
|
||||
|
||||
find_package(wxWidgets REQUIRED)
|
||||
target_compile_definitions(main PRIVATE ${wxWidgets_DEFINITIONS} "$<$<CONFIG:DEBUG>:${wxWidgets_DEFINITIONS_DEBUG}>")
|
||||
target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS})
|
||||
target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})
|
||||
|
||||
add_executable(main2 WIN32 popup.cpp)
|
||||
|
||||
find_package(wxWidgets CONFIG REQUIRED)
|
||||
target_link_libraries(main2 PRIVATE wx::core wx::base)
|
||||
|
||||
option(USE_WXRC "Use the wxrc resource compiler" ON)
|
||||
if(USE_WXRC)
|
||||
execute_process(
|
||||
COMMAND "${wxWidgets_wxrc_EXECUTABLE}" --help
|
||||
RESULTS_VARIABLE error_result
|
||||
)
|
||||
if(error_result)
|
||||
message(FATAL_ERROR "Failed to run wxWidgets_wxrc_EXECUTABLE (${wxWidgets_wxrc_EXECUTABLE})")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(PRINT_VARS "" CACHE STRING "Variables to print at the end of configuration")
|
||||
foreach(var IN LISTS PRINT_VARS)
|
||||
message(STATUS "${var}:=${${var}}")
|
||||
endforeach()
|
|
@ -1,21 +0,0 @@
|
|||
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
|
||||
index 52ae69d3f6..f261d5d262 100644
|
||||
--- a/build/cmake/config.cmake
|
||||
+++ b/build/cmake/config.cmake
|
||||
@@ -39,8 +39,14 @@ macro(wx_get_dependencies var lib)
|
||||
else()
|
||||
# For the value like $<$<CONFIG:DEBUG>:LIB_PATH>
|
||||
# Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH>
|
||||
- string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_name ${dep})
|
||||
- if (NOT dep_name)
|
||||
+ if(dep MATCHES "^(.+>):(.+)>$")
|
||||
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_MATCH_1 STREQUAL [[$<$<NOT:$<CONFIG:DEBUG>>]])
|
||||
+ continue()
|
||||
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_MATCH_1 STREQUAL [[$<$<CONFIG:DEBUG>]])
|
||||
+ continue()
|
||||
+ endif()
|
||||
+ set(dep_name "${CMAKE_MATCH_2}")
|
||||
+ else()
|
||||
set(dep_name ${dep})
|
||||
endif()
|
||||
endif()
|
|
@ -1,23 +0,0 @@
|
|||
diff --git a/build/cmake/modules/FindPCRE2.cmake b/build/cmake/modules/FindPCRE2.cmake
|
||||
index a27693a..455675a 100644
|
||||
--- a/build/cmake/modules/FindPCRE2.cmake
|
||||
+++ b/build/cmake/modules/FindPCRE2.cmake
|
||||
@@ -24,7 +24,10 @@ set(PCRE2_CODE_UNIT_WIDTH_USED "${PCRE2_CODE_UNIT_WIDTH}" CACHE INTERNAL "")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_PCRE2 QUIET libpcre2-${PCRE2_CODE_UNIT_WIDTH})
|
||||
+set(PCRE2_LIBRARIES ${PC_PCRE2_LINK_LIBRARIES})
|
||||
+set(PCRE2_INCLUDE_DIRS ${PC_PCRE2_INCLUDE_DIRS})
|
||||
|
||||
+if (0)
|
||||
find_path(PCRE2_INCLUDE_DIRS
|
||||
NAMES pcre2.h
|
||||
HINTS ${PC_PCRE2_INCLUDEDIR}
|
||||
@@ -36,6 +39,7 @@ find_library(PCRE2_LIBRARIES
|
||||
HINTS ${PC_PCRE2_LIBDIR}
|
||||
${PC_PCRE2_LIBRARY_DIRS}
|
||||
)
|
||||
+endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 REQUIRED_VARS PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS VERSION_VAR PC_PCRE2_VERSION)
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/build/cmake/modules/FindGTK3.cmake b/build/cmake/modules/FindGTK3.cmake
|
||||
index d2939a1..daf33fe 100644
|
||||
--- a/build/cmake/modules/FindGTK3.cmake
|
||||
+++ b/build/cmake/modules/FindGTK3.cmake
|
||||
@@ -47,6 +47,7 @@ include(CheckSymbolExists)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${GTK3_INCLUDE_DIRS})
|
||||
check_symbol_exists(GDK_WINDOWING_WAYLAND "gdk/gdk.h" wxHAVE_GDK_WAYLAND)
|
||||
check_symbol_exists(GDK_WINDOWING_X11 "gdk/gdk.h" wxHAVE_GDK_X11)
|
||||
+set(GTK3_LIBRARIES "${GTK3_LINK_LIBRARIES}" CACHE INTERNAL "")
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_INCLUDE_DIRS GTK3_LIBRARIES VERSION_OK)
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake
|
||||
index 32bd959..74f31ed 100644
|
||||
--- a/build/cmake/functions.cmake
|
||||
+++ b/build/cmake/functions.cmake
|
||||
@@ -418,7 +418,7 @@ macro(wx_add_library name)
|
||||
set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short})
|
||||
|
||||
# Setup install
|
||||
- set(runtime_dir "lib")
|
||||
+ set(runtime_dir "bin")
|
||||
if(WIN32 AND NOT WIN32_MSVC_NAMING)
|
||||
# configure puts the .dll in the bin directory
|
||||
set(runtime_dir "bin")
|
||||
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
|
||||
index 3ff14ab..7bd00d3 100644
|
||||
--- a/build/cmake/init.cmake
|
||||
+++ b/build/cmake/init.cmake
|
||||
@@ -146,7 +146,7 @@ if(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-if(WIN32_MSVC_NAMING)
|
||||
+if(0)
|
||||
if(wxBUILD_SHARED)
|
||||
set(lib_suffix "_dll")
|
||||
else()
|
||||
diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake
|
||||
index 84cb9f5..e2f460a 100644
|
||||
--- a/build/cmake/install.cmake
|
||||
+++ b/build/cmake/install.cmake
|
||||
@@ -48,7 +48,7 @@ else()
|
||||
|
||||
install(DIRECTORY DESTINATION "bin")
|
||||
install(CODE "execute_process( \
|
||||
- COMMAND ${CMAKE_COMMAND} -E create_symlink \
|
||||
+ COMMAND ${CMAKE_COMMAND} -E copy \
|
||||
${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID} \
|
||||
${CMAKE_INSTALL_PREFIX}/bin/wx-config \
|
||||
)"
|
||||
diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt
|
||||
index d6b3465..870897b 100644
|
||||
--- a/build/cmake/utils/CMakeLists.txt
|
||||
+++ b/build/cmake/utils/CMakeLists.txt
|
||||
@@ -38,7 +38,7 @@ if(wxUSE_XRC)
|
||||
endif()
|
||||
|
||||
wx_install(CODE "execute_process( \
|
||||
- COMMAND ${CMAKE_COMMAND} -E create_symlink \
|
||||
+ COMMAND ${CMAKE_COMMAND} -E copy \
|
||||
${CMAKE_INSTALL_PREFIX}/bin/${wxrc_output_name}${EXE_SUFFIX} \
|
||||
${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
|
||||
)"
|
|
@ -1,42 +0,0 @@
|
|||
diff --git a/build/cmake/lib/nanosvg.cmake b/build/cmake/lib/nanosvg.cmake
|
||||
index 401bf48..b9e4b57 100644
|
||||
--- a/build/cmake/lib/nanosvg.cmake
|
||||
+++ b/build/cmake/lib/nanosvg.cmake
|
||||
@@ -16,9 +16,9 @@ elseif(wxUSE_NANOSVG)
|
||||
set(NANOSVG_INCLUDE_DIRS )
|
||||
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL TRUE)
|
||||
|
||||
- find_package(NanoSVG REQUIRED)
|
||||
+ find_package(unofficial-nanosvg CONFIG REQUIRED)
|
||||
|
||||
- foreach(TARGETNAME NanoSVG::nanosvg NanoSVG::nanosvgrast unofficial::nanosvg)
|
||||
+ foreach(TARGETNAME unofficial::nanosvg::nanosvg)
|
||||
if(NOT TARGET ${TARGETNAME})
|
||||
continue()
|
||||
endif()
|
||||
diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake
|
||||
index 49c536a..5630526 100644
|
||||
--- a/build/cmake/options.cmake
|
||||
+++ b/build/cmake/options.cmake
|
||||
@@ -114,7 +114,7 @@ wx_add_thirdparty_library(wxUSE_EXPAT EXPAT "use expat for XML parsing" DEFAULT_
|
||||
wx_add_thirdparty_library(wxUSE_LIBJPEG JPEG "use libjpeg (JPEG file format)")
|
||||
wx_add_thirdparty_library(wxUSE_LIBPNG PNG "use libpng (PNG image format)")
|
||||
wx_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)")
|
||||
-wx_add_thirdparty_library(wxUSE_NANOSVG NanoSVG "use NanoSVG for rasterizing SVG")
|
||||
+wx_add_thirdparty_library(wxUSE_NANOSVG unofficial-nanosvg "use NanoSVG for rasterizing SVG")
|
||||
|
||||
wx_option(wxUSE_LIBLZMA "use LZMA compression" OFF)
|
||||
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzma for LZMA compression")
|
||||
diff --git a/build/cmake/wxWidgetsConfig.cmake.in b/build/cmake/wxWidgetsConfig.cmake.in
|
||||
index 6ef5a6e..248a701 100644
|
||||
--- a/build/cmake/wxWidgetsConfig.cmake.in
|
||||
+++ b/build/cmake/wxWidgetsConfig.cmake.in
|
||||
@@ -1,5 +1,8 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+find_dependency(unofficial-nanosvg CONFIG)
|
||||
+
|
||||
# determine target from compiler, platform and library type
|
||||
if(WIN32 AND NOT CYGWIN AND NOT MSYS)
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
|
@ -1,236 +0,0 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO wxWidgets/wxWidgets
|
||||
REF v3.2.0
|
||||
SHA512 0bb40ccab51f5e83a38feeaf462c9d1852f821d19592328327f829890d89a3abb2a991c43cdbac55da8f5ee40aab8bd5fea6abcd052198302770292f92f9f9ad
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
install-layout.patch
|
||||
relocatable-wx-config.patch
|
||||
fix-libs-export.patch
|
||||
fix-pcre2.patch
|
||||
gtk3-link-libraries.patch
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_LINUX)
|
||||
message(WARNING [[
|
||||
Port wxwidgets currently requires the following packages from the system package manager:
|
||||
pkg-config
|
||||
GTK 3
|
||||
libsecret
|
||||
libgcrypt
|
||||
libsystemd
|
||||
These development packages can be installed on Ubuntu systems via
|
||||
sudo apt-get install pkg-config libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev
|
||||
]])
|
||||
foreach(conflicting_port IN ITEMS freetype glib)
|
||||
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/${conflicting_port}/copyright")
|
||||
message(FATAL_ERROR "Port ${conflicting_port} must not be installed when building ${PORT}:${TARGET_TRIPLET}.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
sound wxUSE_SOUND
|
||||
fonts wxUSE_PRIVATE_FONTS
|
||||
)
|
||||
|
||||
set(OPTIONS_RELEASE "")
|
||||
if(NOT "debug-support" IN_LIST FEATURES)
|
||||
list(APPEND OPTIONS_RELEASE "-DwxBUILD_DEBUG_LEVEL=0")
|
||||
endif()
|
||||
|
||||
set(OPTIONS "")
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm"))
|
||||
list(APPEND OPTIONS
|
||||
-DwxUSE_OPENGL=OFF
|
||||
-DwxUSE_STACKWALKER=OFF
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_OSX)
|
||||
list(APPEND OPTIONS -DwxUSE_WEBREQUEST_CURL=OFF)
|
||||
else()
|
||||
list(APPEND OPTIONS -DwxUSE_WEBREQUEST_CURL=ON)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{PKG_CONFIG})
|
||||
set(PKGCONFIG "$ENV{PKG_CONFIG}")
|
||||
elseif(VCPKG_TARGET_IS_LINUX AND NOT VCPKG_CROSSCOMPILING)
|
||||
# wxWidgets on Linux currently needs to find the system's `gtk+-3.0.pc`.
|
||||
# vcpkg's port pkgconf would prevent this lookup.
|
||||
find_program(system_pkg_config NAMES pkg-config)
|
||||
if(system_pkg_config)
|
||||
set(PKGCONFIG "${system_pkg_config}")
|
||||
endif()
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
list(APPEND OPTIONS -DPKG_CONFIG_ARGN=--static)
|
||||
endif()
|
||||
endif()
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
|
||||
# This may be set to ON by users in a custom triplet.
|
||||
# The use of 'wxUSE_STL' and 'WXWIDGETS_USE_STD_CONTAINERS' (ON or OFF) are not API compatible
|
||||
# which is why they must be set in a custom triplet rather than a port feature.
|
||||
if(NOT DEFINED WXWIDGETS_USE_STL)
|
||||
#set(WXWIDGETS_USE_STL OFF)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED WXWIDGETS_USE_STD_CONTAINERS)
|
||||
set(WXWIDGETS_USE_STD_CONTAINERS OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DwxUSE_REGEX=sys
|
||||
-DwxUSE_ZLIB=sys
|
||||
-DwxUSE_EXPAT=sys
|
||||
-DwxUSE_LIBJPEG=sys
|
||||
-DwxUSE_LIBPNG=sys
|
||||
-DwxUSE_LIBTIFF=sys
|
||||
-DwxUSE_SECRETSTORE=FALSE
|
||||
-DwxUSE_STL=ON
|
||||
-DwxUSE_STD_CONTAINERS=${WXWIDGETS_USE_STD_CONTAINERS}
|
||||
-DwxBUILD_DISABLE_PLATFORM_LIB_DIR=ON
|
||||
-DwxUSE_LIBLZMA=OFF
|
||||
-DwxUSE_JOYSTICK=OFF
|
||||
-DwxUSE_SOCKETS=OFF
|
||||
-DwxUSE_IPV6=OFF
|
||||
-DwxUSE_FS_ZIP=OFF
|
||||
-DwxUSE_FS_ARCHIVE=OFF
|
||||
-DwxUSE_FS_INET=OFF
|
||||
-DwxUSE_ARCHIVE_STREAMS=OFF
|
||||
-DwxUSE_ZIPSTREAM=OFF
|
||||
-DwxUSE_TARSTREAM=OFF
|
||||
-DwxUSE_PROTOCOL=OFF
|
||||
-DwxUSE_PROTOCOL_FTP=OFF
|
||||
-DwxUSE_PROTOCOL_HTTP=OFF
|
||||
-DwxUSE_URL=OFF
|
||||
-DwxUSE_SOUND=OFF
|
||||
-DwxUSE_WEBVIEW=OFF
|
||||
-DwxUSE_RICHTEXT=OFF
|
||||
-DwxUSE_SVG=OFF
|
||||
-DwxUSE_GIF=OFF
|
||||
-DwxUSE_PNM=OFF
|
||||
-DwxUSE_PCX=OFF
|
||||
-DwxUSE_WEBREQUEST=OFF
|
||||
-DwxUSE_ACTIVEX=OFF
|
||||
-DwxUSE_REGEX=OFF
|
||||
-DwxUSE_NANOSVG=OFF
|
||||
-DwxUSE_NANOSVG_EXTERNAL=OFF
|
||||
${OPTIONS}
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
# The minimum cmake version requirement for Cotire is 2.8.12.
|
||||
# however, we need to declare that the minimum cmake version requirement is at least 3.1 to use CMAKE_PREFIX_PATH as the path to find .pc.
|
||||
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
|
||||
OPTIONS_RELEASE
|
||||
${OPTIONS_RELEASE}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/wxWidgets)
|
||||
|
||||
# The CMake export is not ready for use: It lacks a config file.
|
||||
file(REMOVE_RECURSE
|
||||
${CURRENT_PACKAGES_DIR}/lib/cmake
|
||||
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
|
||||
)
|
||||
|
||||
set(tools wxrc)
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS OR NOT VCPKG_HOST_IS_WINDOWS)
|
||||
list(APPEND tools wxrc-3.2)
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/wx-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wx-config")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/wx-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/wx-config")
|
||||
endif()
|
||||
endif()
|
||||
vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN)
|
||||
|
||||
# do the copy pdbs now after the dlls got moved to the expected /bin folder above
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/msvc")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(GLOB_RECURSE INCLUDES "${CURRENT_PACKAGES_DIR}/include/*.h")
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h")
|
||||
list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h")
|
||||
endif()
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
|
||||
list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
|
||||
endif()
|
||||
foreach(INC IN LISTS INCLUDES)
|
||||
file(READ "${INC}" _contents)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
string(REPLACE "defined(WXUSINGDLL)" "0" _contents "${_contents}")
|
||||
else()
|
||||
string(REPLACE "defined(WXUSINGDLL)" "1" _contents "${_contents}")
|
||||
endif()
|
||||
# Remove install prefix from setup.h to ensure package is relocatable
|
||||
string(REGEX REPLACE "\n#define wxINSTALL_PREFIX [^\n]*" "\n#define wxINSTALL_PREFIX \"\"" _contents "${_contents}")
|
||||
file(WRITE "${INC}" "${_contents}")
|
||||
endforeach()
|
||||
|
||||
if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/include/wx/setup.h")
|
||||
file(GLOB_RECURSE WX_SETUP_H_FILES_DBG "${CURRENT_PACKAGES_DIR}/debug/lib/*.h")
|
||||
file(GLOB_RECURSE WX_SETUP_H_FILES_REL "${CURRENT_PACKAGES_DIR}/lib/*.h")
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
vcpkg_replace_string("${WX_SETUP_H_FILES_REL}" "${CURRENT_PACKAGES_DIR}" "")
|
||||
|
||||
string(REPLACE "${CURRENT_PACKAGES_DIR}/lib/" "" WX_SETUP_H_FILES_REL "${WX_SETUP_H_FILES_REL}")
|
||||
string(REPLACE "/setup.h" "" WX_SETUP_H_REL_RELATIVE "${WX_SETUP_H_FILES_REL}")
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
vcpkg_replace_string("${WX_SETUP_H_FILES_DBG}" "${CURRENT_PACKAGES_DIR}" "")
|
||||
|
||||
string(REPLACE "${CURRENT_PACKAGES_DIR}/debug/lib/" "" WX_SETUP_H_FILES_DBG "${WX_SETUP_H_FILES_DBG}")
|
||||
string(REPLACE "/setup.h" "" WX_SETUP_H_DBG_RELATIVE "${WX_SETUP_H_FILES_DBG}")
|
||||
endif()
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/setup.h.in" "${CURRENT_PACKAGES_DIR}/include/wx/setup.h" @ONLY)
|
||||
endif()
|
||||
|
||||
file(GLOB configs LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/lib/wx/config/*" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wx-config")
|
||||
foreach(config IN LISTS configs)
|
||||
vcpkg_replace_string("${config}" "${CURRENT_INSTALLED_DIR}" [[${prefix}]])
|
||||
endforeach()
|
||||
file(GLOB configs LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/debug/lib/wx/config/*" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/wx-config")
|
||||
foreach(config IN LISTS configs)
|
||||
vcpkg_replace_string("${config}" "${CURRENT_INSTALLED_DIR}/debug" [[${prefix}]])
|
||||
endforeach()
|
||||
|
||||
# For CMake multi-config in connection with wrapper
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
|
||||
file(INSTALL "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/lib/mswud/wx"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT "debug-support" IN_LIST FEATURES)
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_HOST_IS_WINDOWS)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
|
||||
else()
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx-3.2/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("example" IN_LIST FEATURES)
|
||||
file(INSTALL
|
||||
"${CMAKE_CURRENT_LIST_DIR}/example/CMakeLists.txt"
|
||||
"${SOURCE_PATH}/samples/popup/popup.cpp"
|
||||
"${SOURCE_PATH}/samples/sample.xpm"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/example"
|
||||
)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/example/popup.cpp" "../sample.xpm" "sample.xpm")
|
||||
endif()
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/docs/licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
@ -1,49 +0,0 @@
|
|||
diff --git a/wx-config.in b/wx-config.in
|
||||
index 441f88c..b326867 100755
|
||||
--- a/wx-config.in
|
||||
+++ b/wx-config.in
|
||||
@@ -91,7 +91,7 @@ EOF
|
||||
|
||||
|
||||
# Contentious tools determined by configure.
|
||||
-EGREP="@EGREP@"
|
||||
+EGREP="grep -E" # no absolute path from host
|
||||
|
||||
|
||||
# For the people who know what they want, or think they do:
|
||||
@@ -402,8 +402,23 @@ is_cross() { [ "x@cross_compiling@" = "xyes" ]; }
|
||||
|
||||
|
||||
# Determine the base directories we require.
|
||||
-prefix=${input_option_prefix-${this_prefix:-@prefix@}}
|
||||
-exec_prefix=${input_option_exec_prefix-${input_option_prefix-${this_exec_prefix:-@exec_prefix@}}}
|
||||
+vcpkg_prefix=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
+case "$vcpkg_prefix" in
|
||||
+ */lib/wx/config)
|
||||
+ vcpkg_prefix=${vcpkg_prefix%/*/*/*}
|
||||
+ ;;
|
||||
+ */tools/wxwidgets/debug)
|
||||
+ vcpkg_prefix=${vcpkg_prefix%/*/*/*}/debug
|
||||
+ ;;
|
||||
+ */tools/wxwidgets)
|
||||
+ vcpkg_prefix=${vcpkg_prefix%/*/*}
|
||||
+ ;;
|
||||
+esac
|
||||
+if [ -n "@MINGW@" -a -n "@CMAKE_HOST_WIN32@" ]; then
|
||||
+ vcpkg_prefix=$(cygpath -m "$vcpkg_prefix")
|
||||
+fi
|
||||
+prefix=${input_option_prefix-${this_prefix:-$vcpkg_prefix}}
|
||||
+exec_prefix=${input_option_exec_prefix-${input_option_prefix-${this_exec_prefix:-$prefix}}}
|
||||
wxconfdir="@libdir@/wx/config"
|
||||
|
||||
installed_configs=`cd "$wxconfdir" 2> /dev/null && ls | grep -v "^inplace-"`
|
||||
@@ -940,6 +949,9 @@ prefix=${this_prefix-$prefix}
|
||||
exec_prefix=${this_exec_prefix-$exec_prefix}
|
||||
|
||||
includedir="@includedir@"
|
||||
+if [ "@CMAKE_BUILD_TYPE@" = "Debug" ] ; then
|
||||
+ includedir="${includedir%/debug/include}/include"
|
||||
+fi
|
||||
libdir="@libdir@"
|
||||
bindir="@bindir@"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#ifdef _DEBUG
|
||||
#include "../../debug/lib/@WX_SETUP_H_DBG_RELATIVE@/setup.h"
|
||||
#else
|
||||
#include "../../lib/@WX_SETUP_H_REL_RELATIVE@/setup.h"
|
||||
#endif
|
|
@ -1,4 +0,0 @@
|
|||
The package wxwidgets provides CMake targets:
|
||||
|
||||
find_package(wxWidgets CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE wx::core wx::base)
|
|
@ -1,77 +0,0 @@
|
|||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
get_filename_component(_vcpkg_wx_root "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
|
||||
set(wxWidgets_ROOT_DIR "${_vcpkg_wx_root}" CACHE INTERNAL "")
|
||||
set(WX_ROOT_DIR "${_vcpkg_wx_root}" CACHE INTERNAL "")
|
||||
unset(_vcpkg_wx_root)
|
||||
|
||||
if(WIN32 AND CMAKE_HOST_WIN32)
|
||||
# Find all libs with "32" infix which is unknown to FindwxWidgets.cmake
|
||||
function(z_vcpkg_wxwidgets_find_base_library BASENAME)
|
||||
find_library(WX_${BASENAME}d wx${BASENAME}32ud NAMES wx${BASENAME}d PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH)
|
||||
find_library(WX_${BASENAME} wx${BASENAME}32u NAMES wx${BASENAME} PATHS "${wxWidgets_ROOT_DIR}/lib" NO_DEFAULT_PATH REQUIRED)
|
||||
endfunction()
|
||||
function(z_vcpkg_wxwidgets_find_suffix_library BASENAME)
|
||||
foreach(lib IN LISTS ARGN)
|
||||
find_library(WX_${lib}d NAMES wx${BASENAME}32ud_${lib} PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH)
|
||||
find_library(WX_${lib} NAMES wx${BASENAME}32u_${lib} PATHS "${wxWidgets_ROOT_DIR}/lib" NO_DEFAULT_PATH)
|
||||
endforeach()
|
||||
endfunction()
|
||||
z_vcpkg_wxwidgets_find_base_library(base)
|
||||
z_vcpkg_wxwidgets_find_suffix_library(base net odbc xml)
|
||||
z_vcpkg_wxwidgets_find_suffix_library(msw core adv aui html media xrc dbgrid gl qa richtext stc ribbon propgrid webview)
|
||||
if(WX_stc AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
z_vcpkg_wxwidgets_find_base_library(scintilla)
|
||||
endif()
|
||||
# Force FindwxWidgets.cmake win32 mode for all windows targets built on windows
|
||||
set(_vcpkg_wxwidgets_backup_crosscompiling "${CMAKE_CROSSCOMPILING}")
|
||||
set(CMAKE_CROSSCOMPILING 0)
|
||||
set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib" CACHE INTERNAL "")
|
||||
else()
|
||||
# FindwxWidgets.cmake unix mode, single-config
|
||||
if(MINGW)
|
||||
# Force FindwxWidgets.cmake unix mode for mingw cross builds
|
||||
set(_vcpkg_wxwidgets_backup_crosscompiling "${CMAKE_CROSSCOMPILING}")
|
||||
set(CMAKE_CROSSCOMPILING 1)
|
||||
endif()
|
||||
set(_vcpkg_wxconfig "")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR "Debug" IN_LIST MAP_IMPORTED_CONFIG_${CMAKE_BUILD_TYPE})
|
||||
# Debug
|
||||
set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/debug/lib" CACHE INTERNAL "")
|
||||
file(GLOB _vcpkg_wxconfig LIST_DIRECTORIES false "${wxWidgets_LIB_DIR}/wx/config/*")
|
||||
endif()
|
||||
if(NOT _vcpkg_wxconfig)
|
||||
# Release or fallback
|
||||
set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib" CACHE INTERNAL "")
|
||||
file(GLOB _vcpkg_wxconfig LIST_DIRECTORIES false "${wxWidgets_LIB_DIR}/wx/config/*")
|
||||
endif()
|
||||
set(wxWidgets_CONFIG_EXECUTABLE "${_vcpkg_wxconfig}" CACHE INTERNAL "")
|
||||
unset(_vcpkg_wxconfig)
|
||||
endif()
|
||||
set(WX_LIB_DIR "${wxWidgets_LIB_DIR}" CACHE INTERNAL "")
|
||||
|
||||
_find_package(${ARGS})
|
||||
|
||||
if(DEFINED _vcpkg_wxwidgets_backup_crosscompiling)
|
||||
set(CMAKE_CROSSCOMPILING "${_vcpkg_wxwidgets_backup_crosscompiling}")
|
||||
unset(_vcpkg_wxwidgets_backup_crosscompiling)
|
||||
endif()
|
||||
|
||||
if(WIN32 AND CMAKE_HOST_WIN32 AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT "wx::core" IN_LIST wxWidgets_LIBRARIES)
|
||||
find_package(EXPAT QUIET)
|
||||
find_package(JPEG QUIET)
|
||||
find_package(PNG QUIET)
|
||||
find_package(TIFF QUIET)
|
||||
find_package(ZLIB QUIET)
|
||||
list(APPEND wxWidgets_LIBRARIES
|
||||
${EXPAT_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${TIFF_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
cmake_policy(POP)
|
|
@ -1,70 +0,0 @@
|
|||
{
|
||||
"name": "wxwidgets",
|
||||
"version": "3.2.0",
|
||||
"port-version": 1,
|
||||
"description": [
|
||||
"Widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. ",
|
||||
"Set WXWIDGETS_USE_STL in a custom triplet to build with the wxUSE_STL build option.",
|
||||
"Set WXWIDGETS_USE_STD_CONTAINERS in a custom triplet to build with the wxUSE_STD_CONTAINERS build option."
|
||||
],
|
||||
"homepage": "https://github.com/wxWidgets/wxWidgets",
|
||||
"license": "LGPL-2.0-or-later WITH WxWindows-exception-3.1",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"platform": "!windows & !osx"
|
||||
},
|
||||
"expat",
|
||||
{
|
||||
"name": "libpng",
|
||||
"platform": "!linux"
|
||||
},
|
||||
"tiff",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
],
|
||||
"default-features": [
|
||||
"debug-support",
|
||||
"sound"
|
||||
],
|
||||
"features": {
|
||||
"debug-support": {
|
||||
"description": "Enable wxWidgets debugging support hooks even for release builds (wxDEBUG_LEVEL 1)"
|
||||
},
|
||||
"example": {
|
||||
"description": "Example source code and CMake project"
|
||||
},
|
||||
"fonts": {
|
||||
"description": "Enable to use the font functionality of wxWidgets",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "fontconfig",
|
||||
"platform": "!windows & !osx"
|
||||
},
|
||||
{
|
||||
"name": "pango",
|
||||
"platform": "!windows & !osx"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sound": {
|
||||
"description": "Build wxSound support",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "sdl2",
|
||||
"default-features": false,
|
||||
"platform": "!windows & !osx"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
0
dependencies/vcpkg_overlay_ports_linux/.gitkeep
vendored
Normal file
0
dependencies/vcpkg_overlay_ports_linux/.gitkeep
vendored
Normal file
1
dependencies/vcpkg_overlay_ports_linux/cairo/portfile.cmake
vendored
Normal file
1
dependencies/vcpkg_overlay_ports_linux/cairo/portfile.cmake
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
8
dependencies/vcpkg_overlay_ports_linux/cairo/vcpkg.json
vendored
Normal file
8
dependencies/vcpkg_overlay_ports_linux/cairo/vcpkg.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "cairo",
|
||||
"version": "1.17.8",
|
||||
"description": "Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.",
|
||||
"homepage": "https://cairographics.org",
|
||||
"license": "MPL-1.1",
|
||||
"port-version": 2
|
||||
}
|
1
dependencies/vcpkg_overlay_ports_linux/glm/portfile.cmake
vendored
Normal file
1
dependencies/vcpkg_overlay_ports_linux/glm/portfile.cmake
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
8
dependencies/vcpkg_overlay_ports_linux/glm/vcpkg.json
vendored
Normal file
8
dependencies/vcpkg_overlay_ports_linux/glm/vcpkg.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "glm",
|
||||
"version": "0.9.9.8",
|
||||
"port-version": 3,
|
||||
"description": "OpenGL Mathematics (GLM)",
|
||||
"homepage": "https://glm.g-truc.net",
|
||||
"license": "MIT"
|
||||
}
|
1
dependencies/vcpkg_overlay_ports_linux/gtk3/portfile.cmake
vendored
Normal file
1
dependencies/vcpkg_overlay_ports_linux/gtk3/portfile.cmake
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
8
dependencies/vcpkg_overlay_ports_linux/gtk3/vcpkg.json
vendored
Normal file
8
dependencies/vcpkg_overlay_ports_linux/gtk3/vcpkg.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "gtk3",
|
||||
"version": "3.24.34",
|
||||
"port-version": 5,
|
||||
"description": "Portable library for creating graphical user interfaces.",
|
||||
"homepage": "https://www.gtk.org/",
|
||||
"license": null
|
||||
}
|
1
dependencies/vcpkg_overlay_ports_linux/libpng/portfile.cmake
vendored
Normal file
1
dependencies/vcpkg_overlay_ports_linux/libpng/portfile.cmake
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
8
dependencies/vcpkg_overlay_ports_linux/libpng/vcpkg.json
vendored
Normal file
8
dependencies/vcpkg_overlay_ports_linux/libpng/vcpkg.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "libpng",
|
||||
"version": "1.6.39",
|
||||
"port-version": 2,
|
||||
"description": "libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files",
|
||||
"homepage": "https://github.com/glennrp/libpng",
|
||||
"license": "libpng-2.0"
|
||||
}
|
0
dependencies/vcpkg_overlay_ports_mac/.gitkeep
vendored
Normal file
0
dependencies/vcpkg_overlay_ports_mac/.gitkeep
vendored
Normal file
71
dependencies/vcpkg_overlay_ports_mac/libusb/portfile.cmake
vendored
Normal file
71
dependencies/vcpkg_overlay_ports_mac/libusb/portfile.cmake
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
|
||||
if(VCPKG_TARGET_IS_LINUX)
|
||||
message("${PORT} currently requires the following tools and libraries from the system package manager:\n autoreconf\n libudev\n\nThese can be installed on Ubuntu systems via apt-get install autoconf libudev-dev")
|
||||
endif()
|
||||
|
||||
set(VERSION 1.0.26)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO libusb/libusb
|
||||
REF fcf0c710ef5911ae37fbbf1b39d48a89f6f14e8a # v1.0.26.11791 2023-03-12
|
||||
SHA512 0aa6439f7988487adf2a3bff473fec80b5c722a47f117a60696d2aa25c87cc3f20fb6aaca7c66e49be25db6a35eb0bb5f71ed7b211d1b8ee064c5d7f1b985c73
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(LIBUSB_PROJECT_TYPE dll)
|
||||
else()
|
||||
set(LIBUSB_PROJECT_TYPE static)
|
||||
endif()
|
||||
|
||||
# The README.md file in the archive is a symlink to README
|
||||
# which causes issues with the windows MSBUILD process
|
||||
file(REMOVE "${SOURCE_PATH}/README.md")
|
||||
|
||||
vcpkg_msbuild_install(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
PROJECT_SUBPATH msvc/libusb_${LIBUSB_PROJECT_TYPE}.vcxproj
|
||||
)
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/libusb/libusb.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/libusb-1.0")
|
||||
set(prefix "")
|
||||
set(exec_prefix [[${prefix}]])
|
||||
set(libdir [[${prefix}/lib]])
|
||||
set(includedir [[${prefix}/include]])
|
||||
configure_file("${SOURCE_PATH}/libusb-1.0.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libusb-1.0.pc" @ONLY)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libusb-1.0.pc" " -lusb-1.0" " -llibusb-1.0")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
set(includedir [[${prefix}/../include]])
|
||||
configure_file("${SOURCE_PATH}/libusb-1.0.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libusb-1.0.pc" @ONLY)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libusb-1.0.pc" " -lusb-1.0" " -llibusb-1.0")
|
||||
endif()
|
||||
else()
|
||||
vcpkg_list(SET MAKE_OPTIONS)
|
||||
vcpkg_list(SET LIBUSB_LINK_LIBRARIES)
|
||||
if(VCPKG_TARGET_IS_EMSCRIPTEN)
|
||||
vcpkg_list(APPEND MAKE_OPTIONS BUILD_TRIPLET --host=wasm32)
|
||||
endif()
|
||||
if("udev" IN_LIST FEATURES)
|
||||
vcpkg_list(APPEND MAKE_OPTIONS "--enable-udev")
|
||||
vcpkg_list(APPEND LIBUSB_LINK_LIBRARIES udev)
|
||||
else()
|
||||
vcpkg_list(APPEND MAKE_OPTIONS "--disable-udev")
|
||||
endif()
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
OPTIONS
|
||||
${MAKE_OPTIONS}
|
||||
"--enable-examples-build=no"
|
||||
"--enable-tests-build=no"
|
||||
)
|
||||
vcpkg_install_make()
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
5
dependencies/vcpkg_overlay_ports_mac/libusb/usage
vendored
Normal file
5
dependencies/vcpkg_overlay_ports_mac/libusb/usage
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
libusb can be imported via CMake FindPkgConfig module:
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
|
||||
|
||||
target_link_libraries(main PRIVATE PkgConfig::libusb)
|
8
dependencies/vcpkg_overlay_ports_mac/libusb/vcpkg.json
vendored
Normal file
8
dependencies/vcpkg_overlay_ports_mac/libusb/vcpkg.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "libusb",
|
||||
"version": "1.0.26.11791",
|
||||
"port-version": 7,
|
||||
"description": "a cross-platform library to access USB devices",
|
||||
"homepage": "https://github.com/libusb/libusb",
|
||||
"license": "LGPL-2.1-or-later"
|
||||
}
|
8
dist/linux/appimage.sh
vendored
8
dist/linux/appimage.sh
vendored
|
@ -10,6 +10,8 @@ curl -sSfL https://github.com"$(curl https://github.com/probonopd/go-appimage/re
|
|||
chmod a+x mkappimage.AppImage
|
||||
curl -sSfLO "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
|
||||
chmod a+x linuxdeploy-plugin-gtk.sh
|
||||
curl -sSfLO "https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh"
|
||||
chmod a+x linuxdeploy-plugin-checkrt.sh
|
||||
|
||||
if [[ ! -e /usr/lib/x86_64-linux-gnu ]]; then
|
||||
sed -i 's#lib\/x86_64-linux-gnu#lib64#g' linuxdeploy-plugin-gtk.sh
|
||||
|
@ -33,12 +35,14 @@ chmod +x AppDir/usr/bin/Cemu
|
|||
cp /usr/lib/x86_64-linux-gnu/{libsepol.so.1,libffi.so.7,libpcre.so.3,libGLU.so.1,libthai.so.0} AppDir/usr/lib
|
||||
|
||||
export UPD_INFO="gh-releases-zsync|cemu-project|Cemu|ci|Cemu.AppImage.zsync"
|
||||
export NO_STRIP=1
|
||||
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run \
|
||||
--appdir="${GITHUB_WORKSPACE}"/AppDir/ \
|
||||
-d "${GITHUB_WORKSPACE}"/AppDir/info.cemu.Cemu.desktop \
|
||||
-i "${GITHUB_WORKSPACE}"/AppDir/info.cemu.Cemu.png \
|
||||
-e "${GITHUB_WORKSPACE}"/AppDir/usr/bin/Cemu \
|
||||
--plugin gtk
|
||||
--plugin gtk \
|
||||
--plugin checkrt
|
||||
|
||||
if ! GITVERSION="$(git rev-parse --short HEAD 2>/dev/null)"; then
|
||||
GITVERSION=experimental
|
||||
|
@ -46,7 +50,7 @@ fi
|
|||
echo "Cemu Version Cemu-${GITVERSION}"
|
||||
|
||||
rm AppDir/usr/lib/libwayland-client.so.0
|
||||
echo "export LC_ALL=C" >> AppDir/apprun-hooks/linuxdeploy-plugin-gtk.sh
|
||||
echo -e "export LC_ALL=C\nexport FONTCONFIG_PATH=/etc/fonts" >> AppDir/apprun-hooks/linuxdeploy-plugin-gtk.sh
|
||||
VERSION="${GITVERSION}" ./mkappimage.AppImage --appimage-extract-and-run "${GITHUB_WORKSPACE}"/AppDir
|
||||
|
||||
mkdir -p "${GITHUB_WORKSPACE}"/artifacts/
|
||||
|
|
20
dist/linux/info.cemu.Cemu.metainfo.xml
vendored
20
dist/linux/info.cemu.Cemu.metainfo.xml
vendored
|
@ -3,15 +3,15 @@
|
|||
<!--Created with jdAppdataEdit 4.2-->
|
||||
<id>info.cemu.Cemu</id>
|
||||
<name>Cemu</name>
|
||||
<summary>Software to emulate Wii U games and applications on PC</summary>
|
||||
<summary xml:lang="de">Software zum emulieren von Wii U Spielen und Anwendungen auf dem PC</summary>
|
||||
<summary xml:lang="fr">Application pour émuler des jeux et applications Wii U sur PC</summary>
|
||||
<summary xml:lang="nl">Applicatie om Wii U spellen en applicaties te emuleren op PC</summary>
|
||||
<summary xml:lang="el">Πρόγραμμα προσομοίωσης παιχνιδιών και εφαρμογών Wii U στον υπολογιστή</summary>
|
||||
<summary xml:lang="es">Software para emular juegos y aplicaciones de Wii U en PC</summary>
|
||||
<summary xml:lang="pt_BR">Software para emular jogos e aplicativos de Wii U no PC</summary>
|
||||
<summary xml:lang="it">Software per emulare giochi e applicazioni per Wii U su PC</summary>
|
||||
<summary xml:lang="fi">Ojelmisto Wii U -pelien ja -sovellusten emulointiin PC:llä</summary>
|
||||
<summary>Nintendo Wii U Emulator</summary>
|
||||
<summary xml:lang="de">Nintendo Wii U Emulator</summary>
|
||||
<summary xml:lang="fr">Émulateur Nintendo Wii U</summary>
|
||||
<summary xml:lang="nl">Nintendo Wii U Emulator</summary>
|
||||
<summary xml:lang="el">Εξομοιωτής Nintendo Wii U</summary>
|
||||
<summary xml:lang="es">Emulador de Nintendo Wii U</summary>
|
||||
<summary xml:lang="pt_BR">Emulador Nintendo Wii U</summary>
|
||||
<summary xml:lang="it">Emulatore Nintendo Wii U</summary>
|
||||
<summary xml:lang="fi">Nintendo Wii U Emulaattori</summary>
|
||||
<developer_name>Cemu Project</developer_name>
|
||||
<launchable type="desktop-id">info.cemu.Cemu.desktop</launchable>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
|
@ -52,7 +52,7 @@
|
|||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="v2.0" date="2022-08-22" type="stable">
|
||||
<release version="2.0" date="2022-08-22" type="stable">
|
||||
<url>https://github.com/cemu-project/Cemu/releases/tag/v2.0</url>
|
||||
</release>
|
||||
</releases>
|
||||
|
|
17
dist/network_services.xml
vendored
Normal file
17
dist/network_services.xml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<content>
|
||||
<networkname>CustomExample</networkname>
|
||||
<disablesslverification>0</disablesslverification>
|
||||
<urls>
|
||||
<act>https://account.nintendo.net</act>
|
||||
<ecs>https://ecs.wup.shop.nintendo.net/ecs/services/ECommerceSOAP</ecs>
|
||||
<nus>https://nus.wup.shop.nintendo.net/nus/services/NetUpdateSOAP</nus>
|
||||
<ias>https://ias.wup.shop.nintendo.net/ias/services/IdentityAuthenticationSOAP</ias>
|
||||
<ccsu>https://ccs.wup.shop.nintendo.net/ccs/download</ccsu>
|
||||
<ccs>http://ccs.cdn.wup.shop.nintendo.net/ccs/download</ccs>
|
||||
<idbe>https://idbe-wup.cdn.nintendo.net/icondata</idbe>
|
||||
<boss>https://npts.app.nintendo.net/p01/tasksheet</boss>
|
||||
<tagaya>https://tagaya.wup.shop.nintendo.net/tagaya/versionlist</tagaya>
|
||||
<olv>https://discovery.olv.nintendo.net/v1/endpoint</olv>
|
||||
</urls>
|
||||
</content>
|
16
dist/windows/Cemu.manifest
vendored
Normal file
16
dist/windows/Cemu.manifest
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security>
|
||||
</trustInfo>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
|
@ -1,2 +0,0 @@
|
|||
"C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -B build/
|
||||
pause
|
|
@ -11,11 +11,6 @@ endif()
|
|||
|
||||
if(MSVC)
|
||||
add_compile_definitions(WIN32_LEAN_AND_MEAN CURL_STATICLIB)
|
||||
#add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
|
||||
# _CRT_SECURE_NO_WARNINGS
|
||||
# _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||
# _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
||||
# _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
|
||||
elseif(UNIX)
|
||||
if(APPLE)
|
||||
add_compile_definitions(
|
||||
|
@ -27,10 +22,11 @@ elseif(UNIX)
|
|||
add_compile_definitions(
|
||||
VK_USE_PLATFORM_XLIB_KHR # legacy. Do we need to support XLIB surfaces?
|
||||
VK_USE_PLATFORM_XCB_KHR
|
||||
VK_USE_PLATFORM_WAYLAND_KHR
|
||||
)
|
||||
if (ENABLE_WAYLAND)
|
||||
add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||
endif()
|
||||
endif()
|
||||
add_compile_options(-maes)
|
||||
# warnings
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
add_compile_options(-Wno-ambiguous-reversed-operator)
|
||||
|
@ -60,9 +56,16 @@ add_executable(CemuBin
|
|||
mainLLE.cpp
|
||||
)
|
||||
|
||||
if(MSVC AND MSVC_VERSION EQUAL 1940)
|
||||
# workaround for an msvc issue on VS 17.10 where generated ILK files are too large
|
||||
# see https://developercommunity.visualstudio.com/t/After-updating-to-VS-1710-the-size-of-/10665511
|
||||
set_target_properties(CemuBin PROPERTIES LINK_FLAGS "/INCREMENTAL:NO")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_sources(CemuBin PRIVATE
|
||||
resource/cemu.rc
|
||||
../dist/windows/cemu.manifest
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -79,11 +82,13 @@ if (MACOS_BUNDLE)
|
|||
set(MACOSX_BUNDLE_ICON_FILE "cemu.icns")
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "info.cemu.Cemu")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "Cemu")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${CMAKE_PROJECT_VERSION})
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION})
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2022 Cemu Project")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH}")
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH}")
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2024 Cemu Project")
|
||||
|
||||
set(MACOSX_BUNDLE_CATEGORY "public.app-category.games")
|
||||
set(MACOSX_MINIMUM_SYSTEM_VERSION "12.0")
|
||||
set(MACOSX_BUNDLE_TYPE_EXTENSION "wua")
|
||||
|
||||
set_target_properties(CemuBin PROPERTIES
|
||||
MACOSX_BUNDLE true
|
||||
|
@ -96,11 +101,18 @@ if (MACOS_BUNDLE)
|
|||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory "${CMAKE_SOURCE_DIR}/bin/${folder}" "${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/SharedSupport/${folder}")
|
||||
endforeach(folder)
|
||||
|
||||
add_custom_command (TARGET CemuBin POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy "/usr/local/lib/libMoltenVK.dylib" "${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/Frameworks/libMoltenVK.dylib")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(LIBUSB_PATH "${CMAKE_BINARY_DIR}/vcpkg_installed/x64-osx/debug/lib/libusb-1.0.0.dylib")
|
||||
else()
|
||||
set(LIBUSB_PATH "${CMAKE_BINARY_DIR}/vcpkg_installed/x64-osx/lib/libusb-1.0.0.dylib")
|
||||
endif()
|
||||
|
||||
add_custom_command (TARGET CemuBin POST_BUILD
|
||||
COMMAND bash -c "install_name_tool -add_rpath @executable_path/../Frameworks ${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/MacOS/${OUTPUT_NAME}")
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy "/usr/local/lib/libMoltenVK.dylib" "${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/Frameworks/libMoltenVK.dylib"
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${LIBUSB_PATH}" "${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/Frameworks/libusb-1.0.0.dylib"
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${CMAKE_SOURCE_DIR}/src/resource/update.sh" "${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/MacOS/update.sh"
|
||||
COMMAND bash -c "install_name_tool -add_rpath @executable_path/../Frameworks ${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/MacOS/${OUTPUT_NAME}"
|
||||
COMMAND bash -c "install_name_tool -change ${LIBUSB_PATH} @executable_path/../Frameworks/libusb-1.0.0.dylib ${CMAKE_SOURCE_DIR}/bin/${OUTPUT_NAME}.app/Contents/MacOS/${OUTPUT_NAME}")
|
||||
endif()
|
||||
|
||||
set_target_properties(CemuBin PROPERTIES
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
#include "Account.h"
|
||||
#include "util/helpers/helpers.h"
|
||||
#include "gui/CemuApp.h"
|
||||
#include "util/helpers/SystemException.h"
|
||||
|
||||
#include "util/helpers/StringHelpers.h"
|
||||
#include "config/ActiveSettings.h"
|
||||
#include "Cafe/IOSU/legacy/iosu_crypto.h"
|
||||
#include "Common/FileStream.h"
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
|
||||
#include <random>
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
|
||||
std::vector<Account> Account::s_account_list;
|
||||
|
||||
|
@ -168,14 +167,14 @@ std::error_code Account::Load()
|
|||
}
|
||||
catch(const std::exception& ex)
|
||||
{
|
||||
forceLog_printf("handled error in Account::Load: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "handled error in Account::Load: {}", ex.what());
|
||||
return AccountErrc::ParseError;
|
||||
}
|
||||
}
|
||||
|
||||
std::error_code Account::Save()
|
||||
{
|
||||
fs::path path = CemuApp::GetMLCPath(fmt::format(L"usr/save/system/act/{:08x}", m_persistent_id)).ToStdWstring();
|
||||
fs::path path = ActiveSettings::GetMlcPath(fmt::format(L"usr/save/system/act/{:08x}", m_persistent_id));
|
||||
if (!fs::exists(path))
|
||||
{
|
||||
std::error_code ec;
|
||||
|
@ -184,7 +183,7 @@ std::error_code Account::Save()
|
|||
return ec;
|
||||
}
|
||||
|
||||
path /= L"account.dat";
|
||||
path /= "account.dat";
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -302,7 +301,7 @@ void Account::SetMiiName(std::wstring_view name)
|
|||
const std::vector<Account>& Account::RefreshAccounts()
|
||||
{
|
||||
std::vector<Account> result;
|
||||
const fs::path path = CemuApp::GetMLCPath(L"usr/save/system/act").ToStdWstring();
|
||||
const fs::path path = ActiveSettings::GetMlcPath("usr/save/system/act");
|
||||
if (fs::exists(path))
|
||||
{
|
||||
for (const auto& it : fs::directory_iterator(path))
|
||||
|
@ -349,7 +348,7 @@ void Account::UpdatePersisidDat()
|
|||
f.close();
|
||||
}
|
||||
else
|
||||
forceLog_printf("Unable to save persisid.dat");
|
||||
cemuLog_log(LogType::Force, "Unable to save persisid.dat");
|
||||
}
|
||||
|
||||
bool Account::HasFreeAccountSlots()
|
||||
|
@ -417,7 +416,7 @@ fs::path Account::GetFileName(uint32 persistent_id)
|
|||
if (persistent_id < kMinPersistendId)
|
||||
throw std::invalid_argument(fmt::format("persistent id {:#x} is invalid", persistent_id));
|
||||
|
||||
return CemuApp::GetMLCPath(fmt::format(L"usr/save/system/act/{:08x}/account.dat", persistent_id)).ToStdWstring();
|
||||
return ActiveSettings::GetMlcPath(fmt::format("usr/save/system/act/{:08x}/account.dat", persistent_id));
|
||||
}
|
||||
|
||||
OnlineValidator Account::ValidateOnlineFiles() const
|
||||
|
@ -462,15 +461,14 @@ OnlineValidator Account::ValidateOnlineFiles() const
|
|||
|
||||
void Account::ParseFile(class FileStream* file)
|
||||
{
|
||||
std::vector<std::string> buffer;
|
||||
|
||||
std::string tmp;
|
||||
while (file->readLine(tmp))
|
||||
buffer.emplace_back(tmp);
|
||||
for (const auto& s : buffer)
|
||||
std::vector<uint8> buffer;
|
||||
buffer.resize(file->GetSize());
|
||||
if( file->readData(buffer.data(), buffer.size()) != buffer.size())
|
||||
throw std::system_error(AccountErrc::ParseError);
|
||||
for (const auto& s : StringHelpers::StringLineIterator(buffer))
|
||||
{
|
||||
std::string_view view = s;
|
||||
const auto find = view.find(L'=');
|
||||
const auto find = view.find('=');
|
||||
if (find == std::string_view::npos)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -16,22 +16,6 @@ enum class OnlineAccountError
|
|||
kPasswordCacheEmpty,
|
||||
kNoPrincipalId,
|
||||
};
|
||||
template <>
|
||||
struct fmt::formatter<OnlineAccountError> : formatter<string_view> {
|
||||
template <typename FormatContext>
|
||||
auto format(const OnlineAccountError v, FormatContext& ctx) {
|
||||
switch (v)
|
||||
{
|
||||
case OnlineAccountError::kNoAccountId: return formatter<string_view>::format("AccountId missing (The account is not connected to a NNID)", ctx);
|
||||
case OnlineAccountError::kNoPasswordCached: return formatter<string_view>::format("IsPasswordCacheEnabled is set to false (The remember password option on your Wii U must be enabled for this account before dumping it)", ctx);
|
||||
case OnlineAccountError::kPasswordCacheEmpty: return formatter<string_view>::format("AccountPasswordCache is empty (The remember password option on your Wii U must be enabled for this account before dumping it)", ctx);
|
||||
case OnlineAccountError::kNoPrincipalId: return formatter<string_view>::format("PrincipalId missing", ctx);
|
||||
default: break;
|
||||
}
|
||||
return formatter<string_view>::format("no error", ctx);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct OnlineValidator
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@ add_library(CemuCafe
|
|||
Filesystem/fscDeviceRedirect.cpp
|
||||
Filesystem/fscDeviceWua.cpp
|
||||
Filesystem/fscDeviceWud.cpp
|
||||
Filesystem/fscDeviceWuhb.cpp
|
||||
Filesystem/fsc.h
|
||||
Filesystem/FST/FST.cpp
|
||||
Filesystem/FST/FST.h
|
||||
|
@ -18,6 +19,9 @@ add_library(CemuCafe
|
|||
Filesystem/FST/KeyCache.h
|
||||
Filesystem/WUD/wud.cpp
|
||||
Filesystem/WUD/wud.h
|
||||
Filesystem/WUHB/RomFSStructs.h
|
||||
Filesystem/WUHB/WUHBReader.cpp
|
||||
Filesystem/WUHB/WUHBReader.h
|
||||
GamePatch.cpp
|
||||
GamePatch.h
|
||||
GameProfile/GameProfile.cpp
|
||||
|
@ -38,6 +42,10 @@ add_library(CemuCafe
|
|||
HW/Espresso/Debugger/Debugger.h
|
||||
HW/Espresso/Debugger/DebugSymbolStorage.cpp
|
||||
HW/Espresso/Debugger/DebugSymbolStorage.h
|
||||
HW/Espresso/Debugger/GDBStub.h
|
||||
HW/Espresso/Debugger/GDBStub.cpp
|
||||
HW/Espresso/Debugger/GDBBreakpoints.cpp
|
||||
HW/Espresso/Debugger/GDBBreakpoints.h
|
||||
HW/Espresso/EspressoISA.h
|
||||
HW/Espresso/Interpreter/PPCInterpreterALU.hpp
|
||||
HW/Espresso/Interpreter/PPCInterpreterFPU.cpp
|
||||
|
@ -210,6 +218,8 @@ add_library(CemuCafe
|
|||
HW/SI/SI.cpp
|
||||
HW/SI/si.h
|
||||
HW/VI/VI.cpp
|
||||
IOSU/ccr_nfc/iosu_ccr_nfc.cpp
|
||||
IOSU/ccr_nfc/iosu_ccr_nfc.h
|
||||
IOSU/fsa/fsa_types.h
|
||||
IOSU/fsa/iosu_fsa.cpp
|
||||
IOSU/fsa/iosu_fsa.h
|
||||
|
@ -237,6 +247,8 @@ add_library(CemuCafe
|
|||
IOSU/nn/iosu_nn_service.h
|
||||
IOSU/PDM/iosu_pdm.cpp
|
||||
IOSU/PDM/iosu_pdm.h
|
||||
IOSU/ODM/iosu_odm.cpp
|
||||
IOSU/ODM/iosu_odm.h
|
||||
OS/common/OSCommon.cpp
|
||||
OS/common/OSCommon.h
|
||||
OS/common/OSUtil.h
|
||||
|
@ -362,12 +374,24 @@ add_library(CemuCafe
|
|||
OS/libs/gx2/GX2_Texture.h
|
||||
OS/libs/gx2/GX2_TilingAperture.cpp
|
||||
OS/libs/h264_avc/H264Dec.cpp
|
||||
OS/libs/h264_avc/H264DecBackendAVC.cpp
|
||||
OS/libs/h264_avc/h264dec.h
|
||||
OS/libs/h264_avc/H264DecInternal.h
|
||||
OS/libs/h264_avc/parser
|
||||
OS/libs/h264_avc/parser/H264Parser.cpp
|
||||
OS/libs/h264_avc/parser/H264Parser.h
|
||||
OS/libs/mic/mic.cpp
|
||||
OS/libs/mic/mic.h
|
||||
OS/libs/nfc/ndef.cpp
|
||||
OS/libs/nfc/ndef.h
|
||||
OS/libs/nfc/nfc.cpp
|
||||
OS/libs/nfc/nfc.h
|
||||
OS/libs/nfc/stream.cpp
|
||||
OS/libs/nfc/stream.h
|
||||
OS/libs/nfc/TagV0.cpp
|
||||
OS/libs/nfc/TagV0.h
|
||||
OS/libs/nfc/TLV.cpp
|
||||
OS/libs/nfc/TLV.h
|
||||
OS/libs/nlibcurl/nlibcurl.cpp
|
||||
OS/libs/nlibcurl/nlibcurlDebug.hpp
|
||||
OS/libs/nlibcurl/nlibcurl.h
|
||||
|
@ -396,6 +420,10 @@ add_library(CemuCafe
|
|||
OS/libs/nn_idbe/nn_idbe.h
|
||||
OS/libs/nn_ndm/nn_ndm.cpp
|
||||
OS/libs/nn_ndm/nn_ndm.h
|
||||
OS/libs/nn_spm/nn_spm.cpp
|
||||
OS/libs/nn_spm/nn_spm.h
|
||||
OS/libs/nn_sl/nn_sl.cpp
|
||||
OS/libs/nn_sl/nn_sl.h
|
||||
OS/libs/nn_nfp/AmiiboCrypto.h
|
||||
OS/libs/nn_nfp/nn_nfp.cpp
|
||||
OS/libs/nn_nfp/nn_nfp.h
|
||||
|
@ -403,6 +431,20 @@ add_library(CemuCafe
|
|||
OS/libs/nn_nim/nn_nim.h
|
||||
OS/libs/nn_olv/nn_olv.cpp
|
||||
OS/libs/nn_olv/nn_olv.h
|
||||
OS/libs/nn_olv/nn_olv_Common.cpp
|
||||
OS/libs/nn_olv/nn_olv_Common.h
|
||||
OS/libs/nn_olv/nn_olv_InitializeTypes.cpp
|
||||
OS/libs/nn_olv/nn_olv_InitializeTypes.h
|
||||
OS/libs/nn_olv/nn_olv_DownloadCommunityTypes.cpp
|
||||
OS/libs/nn_olv/nn_olv_DownloadCommunityTypes.h
|
||||
OS/libs/nn_olv/nn_olv_UploadCommunityTypes.cpp
|
||||
OS/libs/nn_olv/nn_olv_UploadCommunityTypes.h
|
||||
OS/libs/nn_olv/nn_olv_UploadFavoriteTypes.cpp
|
||||
OS/libs/nn_olv/nn_olv_UploadFavoriteTypes.h
|
||||
OS/libs/nn_olv/nn_olv_PostTypes.cpp
|
||||
OS/libs/nn_olv/nn_olv_PostTypes.h
|
||||
OS/libs/nn_olv/nn_olv_OfflineDB.cpp
|
||||
OS/libs/nn_olv/nn_olv_OfflineDB.h
|
||||
OS/libs/nn_pdm/nn_pdm.cpp
|
||||
OS/libs/nn_pdm/nn_pdm.h
|
||||
OS/libs/nn_save/nn_save.cpp
|
||||
|
@ -413,10 +455,26 @@ add_library(CemuCafe
|
|||
OS/libs/nn_uds/nn_uds.h
|
||||
OS/libs/nsyshid/nsyshid.cpp
|
||||
OS/libs/nsyshid/nsyshid.h
|
||||
OS/libs/nsyshid/Backend.h
|
||||
OS/libs/nsyshid/AttachDefaultBackends.cpp
|
||||
OS/libs/nsyshid/Whitelist.cpp
|
||||
OS/libs/nsyshid/Whitelist.h
|
||||
OS/libs/nsyshid/BackendEmulated.cpp
|
||||
OS/libs/nsyshid/BackendEmulated.h
|
||||
OS/libs/nsyshid/BackendLibusb.cpp
|
||||
OS/libs/nsyshid/BackendLibusb.h
|
||||
OS/libs/nsyshid/Dimensions.cpp
|
||||
OS/libs/nsyshid/Dimensions.h
|
||||
OS/libs/nsyshid/Infinity.cpp
|
||||
OS/libs/nsyshid/Infinity.h
|
||||
OS/libs/nsyshid/Skylander.cpp
|
||||
OS/libs/nsyshid/Skylander.h
|
||||
OS/libs/nsyskbd/nsyskbd.cpp
|
||||
OS/libs/nsyskbd/nsyskbd.h
|
||||
OS/libs/nsysnet/nsysnet.cpp
|
||||
OS/libs/nsysnet/nsysnet.h
|
||||
OS/libs/ntag/ntag.cpp
|
||||
OS/libs/ntag/ntag.h
|
||||
OS/libs/padscore/padscore.cpp
|
||||
OS/libs/padscore/padscore.h
|
||||
OS/libs/proc_ui/proc_ui.cpp
|
||||
|
@ -451,11 +509,7 @@ add_library(CemuCafe
|
|||
OS/RPL/rpl_structs.h
|
||||
OS/RPL/rpl_symbol_storage.cpp
|
||||
OS/RPL/rpl_symbol_storage.h
|
||||
TitleList/BaseInfo.cpp
|
||||
TitleList/BaseInfo.h
|
||||
TitleList/GameInfo.h
|
||||
TitleList/MetaInfo.cpp
|
||||
TitleList/MetaInfo.h
|
||||
TitleList/ParsedMetaXml.h
|
||||
TitleList/SaveInfo.cpp
|
||||
TitleList/SaveInfo.h
|
||||
|
@ -476,6 +530,12 @@ set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CON
|
|||
|
||||
target_include_directories(CemuCafe PUBLIC "../")
|
||||
|
||||
if (glslang_VERSION VERSION_LESS "15.0.0")
|
||||
set(glslang_target "glslang::SPIRV")
|
||||
else()
|
||||
set(glslang_target "glslang")
|
||||
endif()
|
||||
|
||||
target_link_libraries(CemuCafe PRIVATE
|
||||
CemuAsm
|
||||
CemuAudio
|
||||
|
@ -491,7 +551,7 @@ target_link_libraries(CemuCafe PRIVATE
|
|||
Boost::nowide
|
||||
CURL::libcurl
|
||||
fmt::fmt
|
||||
glslang::SPIRV
|
||||
${glslang_target}
|
||||
ih264d
|
||||
OpenSSL::Crypto
|
||||
OpenSSL::SSL
|
||||
|
@ -502,6 +562,23 @@ target_link_libraries(CemuCafe PRIVATE
|
|||
zstd::zstd
|
||||
)
|
||||
|
||||
if (ENABLE_WAYLAND)
|
||||
# PUBLIC because wayland-client.h is included in VulkanAPI.h
|
||||
target_link_libraries(CemuCafe PUBLIC Wayland::Client)
|
||||
endif()
|
||||
|
||||
if (ENABLE_VCPKG)
|
||||
if(WIN32)
|
||||
set(PKG_CONFIG_EXECUTABLE "${VCPKG_INSTALLED_DIR}/x64-windows/tools/pkgconf/pkgconf.exe")
|
||||
endif()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
|
||||
target_link_libraries(CemuCafe PRIVATE PkgConfig::libusb)
|
||||
else ()
|
||||
find_package(libusb MODULE REQUIRED)
|
||||
target_link_libraries(CemuCafe PRIVATE libusb::libusb)
|
||||
endif ()
|
||||
|
||||
if (ENABLE_WXWIDGETS)
|
||||
target_link_libraries(CemuCafe PRIVATE wx::base wx::core)
|
||||
endif()
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
#include "Cafe/GameProfile/GameProfile.h"
|
||||
#include "Cafe/HW/Espresso/Interpreter/PPCInterpreterInternal.h"
|
||||
#include "Cafe/HW/Espresso/Recompiler/PPCRecompiler.h"
|
||||
#include "Cafe/HW/Espresso/Debugger/Debugger.h"
|
||||
#include "Cafe/OS/RPL/rpl_symbol_storage.h"
|
||||
#include "audio/IAudioAPI.h"
|
||||
#include "audio/IAudioInputAPI.h"
|
||||
#include "Cafe/HW/Espresso/Debugger/Debugger.h"
|
||||
|
||||
#include "config/ActiveSettings.h"
|
||||
#include "config/LaunchSettings.h"
|
||||
#include "Cafe/TitleList/GameInfo.h"
|
||||
#include "util/helpers/SystemException.h"
|
||||
#include "Cafe/GraphicPack/GraphicPack2.h"
|
||||
|
||||
#include "util/helpers/SystemException.h"
|
||||
#include "Common/cpu_features.h"
|
||||
#include "input/InputManager.h"
|
||||
|
||||
#include "Cafe/CafeSystem.h"
|
||||
#include "Cafe/TitleList/TitleList.h"
|
||||
#include "Cafe/TitleList/GameInfo.h"
|
||||
|
@ -22,14 +22,10 @@
|
|||
#include "Cafe/OS/libs/snd_core/ax.h"
|
||||
#include "Cafe/OS/RPL/rpl.h"
|
||||
#include "Cafe/HW/Latte/Core/Latte.h"
|
||||
|
||||
#include "Cafe/Filesystem/FST/FST.h"
|
||||
|
||||
#include "Common/FileStream.h"
|
||||
|
||||
#include "GamePatch.h"
|
||||
|
||||
#include <time.h>
|
||||
#include "HW/Espresso/Debugger/GDBStub.h"
|
||||
|
||||
#include "Cafe/IOSU/legacy/iosu_ioctl.h"
|
||||
#include "Cafe/IOSU/legacy/iosu_act.h"
|
||||
|
@ -40,12 +36,14 @@
|
|||
#include "Cafe/IOSU/legacy/iosu_boss.h"
|
||||
#include "Cafe/IOSU/legacy/iosu_nim.h"
|
||||
#include "Cafe/IOSU/PDM/iosu_pdm.h"
|
||||
#include "Cafe/IOSU/ccr_nfc/iosu_ccr_nfc.h"
|
||||
|
||||
// IOSU initializer functions
|
||||
#include "Cafe/IOSU/kernel/iosu_kernel.h"
|
||||
#include "Cafe/IOSU/fsa/iosu_fsa.h"
|
||||
#include "Cafe/IOSU/ODM/iosu_odm.h"
|
||||
|
||||
// Cafe OS initializer functions
|
||||
// Cafe OS initializer and shutdown functions
|
||||
#include "Cafe/OS/libs/avm/avm.h"
|
||||
#include "Cafe/OS/libs/drmapp/drmapp.h"
|
||||
#include "Cafe/OS/libs/TCL/TCL.h"
|
||||
|
@ -55,11 +53,14 @@
|
|||
#include "Cafe/OS/libs/gx2/GX2.h"
|
||||
#include "Cafe/OS/libs/gx2/GX2_Misc.h"
|
||||
#include "Cafe/OS/libs/mic/mic.h"
|
||||
#include "Cafe/OS/libs/nfc/nfc.h"
|
||||
#include "Cafe/OS/libs/ntag/ntag.h"
|
||||
#include "Cafe/OS/libs/nn_aoc/nn_aoc.h"
|
||||
#include "Cafe/OS/libs/nn_pdm/nn_pdm.h"
|
||||
#include "Cafe/OS/libs/nn_cmpt/nn_cmpt.h"
|
||||
#include "Cafe/OS/libs/nn_ccr/nn_ccr.h"
|
||||
#include "Cafe/OS/libs/nn_temp/nn_temp.h"
|
||||
#include "Cafe/OS/libs/nn_save/nn_save.h"
|
||||
|
||||
// HW interfaces
|
||||
#include "Cafe/HW/SI/si.h"
|
||||
|
@ -67,6 +68,15 @@
|
|||
// dependency to be removed
|
||||
#include "gui/guiWrapper.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if BOOST_OS_LINUX
|
||||
#include <sys/sysinfo.h>
|
||||
#elif BOOST_OS_MACOS
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
std::string _pathToExecutable;
|
||||
std::string _pathToBaseExecutable;
|
||||
|
||||
|
@ -132,7 +142,7 @@ void LoadMainExecutable()
|
|||
// otherwise search for first file with .rpx extension in the code folder
|
||||
if (!ScanForRPX())
|
||||
{
|
||||
forceLog_printf("Unable to find RPX executable");
|
||||
cemuLog_log(LogType::Force, "Unable to find RPX executable");
|
||||
cemuLog_waitForFlush();
|
||||
cemu_assert(false);
|
||||
}
|
||||
|
@ -142,7 +152,7 @@ void LoadMainExecutable()
|
|||
uint8* rpxData = fsc_extractFile(_pathToExecutable.c_str(), &rpxSize);
|
||||
if (rpxData == nullptr)
|
||||
{
|
||||
forceLog_printf("Failed to load \"%s\"", _pathToExecutable.c_str());
|
||||
cemuLog_log(LogType::Force, "Failed to load \"{}\"", _pathToExecutable);
|
||||
cemuLog_waitForFlush();
|
||||
cemu_assert(false);
|
||||
}
|
||||
|
@ -159,7 +169,7 @@ void LoadMainExecutable()
|
|||
{
|
||||
// RPX
|
||||
RPLLoader_AddDependency(_pathToExecutable.c_str());
|
||||
applicationRPX = rpl_loadFromMem(rpxData, rpxSize, (char*)_pathToExecutable.c_str());
|
||||
applicationRPX = RPLLoader_LoadFromMemory(rpxData, rpxSize, (char*)_pathToExecutable.c_str());
|
||||
if (!applicationRPX)
|
||||
{
|
||||
wxMessageBox(_("Failed to run this title because the executable is damaged"));
|
||||
|
@ -210,7 +220,7 @@ void InfoLog_TitleLoaded()
|
|||
fs::path effectiveSavePath = getTitleSavePath();
|
||||
std::error_code ec;
|
||||
const bool saveDirExists = fs::exists(effectiveSavePath, ec);
|
||||
cemuLog_force("Save path: {}{}", _pathToUtf8(effectiveSavePath), saveDirExists ? "" : " (not present)");
|
||||
cemuLog_log(LogType::Force, "Save path: {}{}", _pathToUtf8(effectiveSavePath), saveDirExists ? "" : " (not present)");
|
||||
|
||||
// log shader cache name
|
||||
cemuLog_log(LogType::Force, "Shader cache file: shaderCache/transferable/{:016x}.bin", titleId);
|
||||
|
@ -231,28 +241,21 @@ void InfoLog_TitleLoaded()
|
|||
void InfoLog_PrintActiveSettings()
|
||||
{
|
||||
const auto& config = GetConfig();
|
||||
forceLog_printf("------- Active settings -------");
|
||||
cemuLog_log(LogType::Force, "------- Active settings -------");
|
||||
|
||||
// settings to log:
|
||||
forceLog_printf("CPU-Mode: %s%s", fmt::format("{}", ActiveSettings::GetCPUMode()).c_str(), g_current_game_profile->GetCPUMode().has_value() ? " (gameprofile)" : "");
|
||||
forceLog_printf("Load shared libraries: %s%s", ActiveSettings::LoadSharedLibrariesEnabled() ? "true" : "false", g_current_game_profile->ShouldLoadSharedLibraries().has_value() ? " (gameprofile)" : "");
|
||||
forceLog_printf("Use precompiled shaders: %s%s", fmt::format("{}", ActiveSettings::GetPrecompiledShadersOption()).c_str(), g_current_game_profile->GetPrecompiledShadersState().has_value() ? " (gameprofile)" : "");
|
||||
forceLog_printf("Full sync at GX2DrawDone: %s", ActiveSettings::WaitForGX2DrawDoneEnabled() ? "true" : "false");
|
||||
cemuLog_log(LogType::Force, "CPU-Mode: {}{}", fmt::format("{}", ActiveSettings::GetCPUMode()).c_str(), g_current_game_profile->GetCPUMode().has_value() ? " (gameprofile)" : "");
|
||||
cemuLog_log(LogType::Force, "Load shared libraries: {}{}", ActiveSettings::LoadSharedLibrariesEnabled() ? "true" : "false", g_current_game_profile->ShouldLoadSharedLibraries().has_value() ? " (gameprofile)" : "");
|
||||
cemuLog_log(LogType::Force, "Use precompiled shaders: {}{}", fmt::format("{}", ActiveSettings::GetPrecompiledShadersOption()), g_current_game_profile->GetPrecompiledShadersState().has_value() ? " (gameprofile)" : "");
|
||||
cemuLog_log(LogType::Force, "Full sync at GX2DrawDone: {}", ActiveSettings::WaitForGX2DrawDoneEnabled() ? "true" : "false");
|
||||
cemuLog_log(LogType::Force, "Strict shader mul: {}", g_current_game_profile->GetAccurateShaderMul() == AccurateShaderMulOption::True ? "true" : "false");
|
||||
if (ActiveSettings::GetGraphicsAPI() == GraphicAPI::kVulkan)
|
||||
{
|
||||
forceLog_printf("Async compile: %s", GetConfig().async_compile.GetValue() ? "true" : "false");
|
||||
cemuLog_log(LogType::Force, "Async compile: {}", GetConfig().async_compile.GetValue() ? "true" : "false");
|
||||
if(!GetConfig().vk_accurate_barriers.GetValue())
|
||||
forceLog_printf("Accurate barriers are disabled!");
|
||||
cemuLog_log(LogType::Force, "Accurate barriers are disabled!");
|
||||
}
|
||||
|
||||
forceLog_printf("Console language: %s", fmt::format("{}", config.console_language).c_str());
|
||||
}
|
||||
|
||||
void PPCCore_setupSPR(PPCInterpreter_t* hCPU, uint32 coreIndex)
|
||||
{
|
||||
hCPU->sprExtended.PVR = 0x70010001;
|
||||
hCPU->spr.UPIR = coreIndex;
|
||||
hCPU->sprExtended.msr |= MSR_FP; // enable floating point
|
||||
cemuLog_log(LogType::Force, "Console language: {}", stdx::to_underlying(config.console_language.GetValue()));
|
||||
}
|
||||
|
||||
struct SharedDataEntry
|
||||
|
@ -283,7 +286,7 @@ struct
|
|||
|
||||
static_assert(sizeof(SharedDataEntry) == 0x1C);
|
||||
|
||||
uint32 loadSharedData()
|
||||
uint32 LoadSharedData()
|
||||
{
|
||||
// check if font files are dumped
|
||||
bool hasAllShareddataFiles = true;
|
||||
|
@ -337,7 +340,7 @@ uint32 loadSharedData()
|
|||
// advance write offset and pad to 16 byte alignment
|
||||
dataWritePtr += ((fileSize + 15) & ~15);
|
||||
}
|
||||
forceLog_printfW(L"COS: System fonts found. Generated shareddata (%dKB)", (uint32)(dataWritePtr - (uint8*)shareddataTable) / 1024);
|
||||
cemuLog_log(LogType::Force, "COS: System fonts found. Generated shareddata ({}KB)", (uint32)(dataWritePtr - (uint8*)shareddataTable) / 1024);
|
||||
return memory_getVirtualOffsetFromPointer(dataWritePtr);
|
||||
}
|
||||
// alternative method: load RAM dump
|
||||
|
@ -382,7 +385,7 @@ void cemu_initForGame()
|
|||
RPLLoader_Link();
|
||||
RPLLoader_NotifyControlPassedToApplication();
|
||||
uint32 linkTime = GetTickCount() - linkTimeStart;
|
||||
forceLog_printf("RPL link time: %dms", linkTime);
|
||||
cemuLog_log(LogType::Force, "RPL link time: {}ms", linkTime);
|
||||
// for HBL ELF: Setup OS-specifics struct
|
||||
if (isLaunchTypeELF)
|
||||
{
|
||||
|
@ -394,19 +397,24 @@ void cemu_initForGame()
|
|||
// replace any known function signatures with our HLE implementations and patch bugs in the games
|
||||
GamePatch_scan();
|
||||
}
|
||||
LatteGPUState.alwaysDisplayDRC = ActiveSettings::DisplayDRCEnabled();
|
||||
LatteGPUState.isDRCPrimary = ActiveSettings::DisplayDRCEnabled();
|
||||
InfoLog_PrintActiveSettings();
|
||||
Latte_Start();
|
||||
// check for debugger entrypoint bp
|
||||
if (g_gdbstub)
|
||||
{
|
||||
g_gdbstub->HandleEntryStop(_entryPoint);
|
||||
g_gdbstub->Initialize();
|
||||
}
|
||||
debugger_handleEntryBreakpoint(_entryPoint);
|
||||
// load graphic packs
|
||||
forceLog_printf("------- Activate graphic packs -------");
|
||||
cemuLog_log(LogType::Force, "------- Activate graphic packs -------");
|
||||
GraphicPack2::ActivateForCurrentTitle();
|
||||
// print audio log
|
||||
IAudioAPI::PrintLogging();
|
||||
IAudioInputAPI::PrintLogging();
|
||||
// everything initialized
|
||||
forceLog_printf("------- Run title -------");
|
||||
cemuLog_log(LogType::Force, "------- Run title -------");
|
||||
// wait till GPU thread is initialized
|
||||
while (g_isGPUInitFinished == false) std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
// init initial thread
|
||||
|
@ -415,61 +423,162 @@ void cemu_initForGame()
|
|||
coreinit::OSRunThread(initialThread, PPCInterpreter_makeCallableExportDepr(coreinit_start), 0, nullptr);
|
||||
// init AX and start AX I/O thread
|
||||
snd_core::AXOut_init();
|
||||
// init ppc recompiler
|
||||
PPCRecompiler_init();
|
||||
}
|
||||
|
||||
void cemu_deinitForGame()
|
||||
{
|
||||
// reset audio
|
||||
snd_core::AXOut_reset();
|
||||
snd_core::reset();
|
||||
// reset alarms
|
||||
coreinit::OSAlarm_resetAll();
|
||||
// delete all threads
|
||||
PPCCore_deleteAllThreads();
|
||||
// reset mount paths
|
||||
fsc_unmountAll();
|
||||
// reset RPL loader
|
||||
RPLLoader_ResetState();
|
||||
// reset GX2
|
||||
GX2::_GX2DriverReset();
|
||||
}
|
||||
|
||||
namespace CafeSystem
|
||||
{
|
||||
void InitVirtualMlcStorage();
|
||||
void MlcStorageMountTitle(TitleInfo& titleInfo);
|
||||
void MlcStorageUnmountAllTitles();
|
||||
|
||||
static bool s_initialized = false;
|
||||
static SystemImplementation* s_implementation{nullptr};
|
||||
bool sLaunchModeIsStandalone = false;
|
||||
std::optional<std::vector<std::string>> s_overrideArgs;
|
||||
|
||||
bool sSystemRunning = false;
|
||||
TitleId sForegroundTitleId = 0;
|
||||
|
||||
GameInfo2 sGameInfo_ForegroundTitle;
|
||||
|
||||
|
||||
static void _CheckForWine()
|
||||
{
|
||||
#if BOOST_OS_WINDOWS
|
||||
const HMODULE hmodule = GetModuleHandleA("ntdll.dll");
|
||||
if (!hmodule)
|
||||
return;
|
||||
|
||||
const auto pwine_get_version = (const char*(__cdecl*)())GetProcAddress(hmodule, "wine_get_version");
|
||||
if (pwine_get_version)
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Wine version: {}", pwine_get_version());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void logCPUAndMemoryInfo()
|
||||
{
|
||||
std::string cpuName = g_CPUFeatures.GetCPUName();
|
||||
if (!cpuName.empty())
|
||||
cemuLog_log(LogType::Force, "CPU: {}", cpuName);
|
||||
#if BOOST_OS_WINDOWS
|
||||
MEMORYSTATUSEX statex;
|
||||
statex.dwLength = sizeof(statex);
|
||||
GlobalMemoryStatusEx(&statex);
|
||||
uint32 memoryInMB = (uint32)(statex.ullTotalPhys / 1024LL / 1024LL);
|
||||
cemuLog_log(LogType::Force, "RAM: {}MB", memoryInMB);
|
||||
#elif BOOST_OS_LINUX
|
||||
struct sysinfo info {};
|
||||
sysinfo(&info);
|
||||
cemuLog_log(LogType::Force, "RAM: {}MB", ((static_cast<uint64_t>(info.totalram) * info.mem_unit) / 1024LL / 1024LL));
|
||||
#elif BOOST_OS_MACOS
|
||||
int64_t totalRam;
|
||||
size_t size = sizeof(totalRam);
|
||||
int result = sysctlbyname("hw.memsize", &totalRam, &size, NULL, 0);
|
||||
if (result == 0)
|
||||
cemuLog_log(LogType::Force, "RAM: {}MB", (totalRam / 1024LL / 1024LL));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_OS_WINDOWS
|
||||
std::string GetWindowsNamedVersion(uint32& buildNumber)
|
||||
{
|
||||
char productName[256];
|
||||
HKEY hKey;
|
||||
DWORD dwType = REG_SZ;
|
||||
DWORD dwSize = sizeof(productName);
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegQueryValueExA(hKey, "ProductName", NULL, &dwType, (LPBYTE)productName, &dwSize) != ERROR_SUCCESS)
|
||||
strcpy(productName, "Windows");
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
OSVERSIONINFO osvi;
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&osvi);
|
||||
buildNumber = osvi.dwBuildNumber;
|
||||
return std::string(productName);
|
||||
}
|
||||
#endif
|
||||
|
||||
void logPlatformInfo()
|
||||
{
|
||||
std::string buffer;
|
||||
const char* platform = NULL;
|
||||
#if BOOST_OS_WINDOWS
|
||||
uint32 buildNumber;
|
||||
std::string windowsVersionName = GetWindowsNamedVersion(buildNumber);
|
||||
buffer = fmt::format("{} (Build {})", windowsVersionName, buildNumber);
|
||||
platform = buffer.c_str();
|
||||
#elif BOOST_OS_LINUX
|
||||
if (getenv ("APPIMAGE"))
|
||||
platform = "Linux (AppImage)";
|
||||
else if (getenv ("SNAP"))
|
||||
platform = "Linux (Snap)";
|
||||
else if (platform = getenv ("container"))
|
||||
{
|
||||
if (strcmp (platform, "flatpak") == 0)
|
||||
platform = "Linux (Flatpak)";
|
||||
}
|
||||
else
|
||||
platform = "Linux";
|
||||
#elif BOOST_OS_MACOS
|
||||
platform = "MacOS";
|
||||
#endif
|
||||
cemuLog_log(LogType::Force, "Platform: {}", platform);
|
||||
}
|
||||
|
||||
static std::vector<IOSUModule*> s_iosuModules =
|
||||
{
|
||||
// entries in this list are ordered by initialization order. Shutdown in reverse order
|
||||
iosu::kernel::GetModule(),
|
||||
iosu::acp::GetModule(),
|
||||
iosu::fpd::GetModule(),
|
||||
iosu::pdm::GetModule(),
|
||||
iosu::ccr_nfc::GetModule(),
|
||||
};
|
||||
|
||||
// initialize all subsystems which are persistent and don't depend on a game running
|
||||
void Initialize()
|
||||
{
|
||||
static bool s_initialized = false;
|
||||
if (s_initialized)
|
||||
return;
|
||||
s_initialized = true;
|
||||
// init core systems
|
||||
cemuLog_log(LogType::Force, "------- Init {} -------", BUILD_VERSION_WITH_NAME_STRING);
|
||||
fsc_init();
|
||||
memory_init();
|
||||
cemuLog_log(LogType::Force, "Init Wii U memory space (base: 0x{:016x})", (size_t)memory_base);
|
||||
PPCCore_init();
|
||||
RPLLoader_InitState();
|
||||
cemuLog_log(LogType::Force, "mlc01 path: {}", _pathToUtf8(ActiveSettings::GetMlcPath()));
|
||||
_CheckForWine();
|
||||
// CPU and RAM info
|
||||
logCPUAndMemoryInfo();
|
||||
logPlatformInfo();
|
||||
cemuLog_log(LogType::Force, "Used CPU extensions: {}", g_CPUFeatures.GetCommaSeparatedExtensionList());
|
||||
// misc systems
|
||||
rplSymbolStorage_init();
|
||||
// allocate memory for all SysAllocators
|
||||
// must happen before all COS modules, but also before iosu::kernel::Init()
|
||||
// must happen before COS module init, but also before iosu::kernel::Initialize()
|
||||
SysAllocatorContainer::GetInstance().Initialize();
|
||||
// init IOSU
|
||||
iosu::kernel::Initialize();
|
||||
// init IOSU modules
|
||||
for(auto& module : s_iosuModules)
|
||||
module->SystemLaunch();
|
||||
// init IOSU (deprecated manual init)
|
||||
iosuCrypto_init();
|
||||
iosu::fsa::Initialize();
|
||||
iosuIoctl_init();
|
||||
iosuAct_init_depr();
|
||||
iosu::act::Initialize();
|
||||
iosu::fpd::Initialize();
|
||||
iosu::iosuMcp_init();
|
||||
iosu::mcp::Init();
|
||||
iosu::iosuAcp_init();
|
||||
iosu::boss_init();
|
||||
iosu::nim::Initialize();
|
||||
iosu::pdm::Initialize();
|
||||
iosu::odm::Initialize();
|
||||
// init Cafe OS
|
||||
avm::Initialize();
|
||||
drmapp::Initialize();
|
||||
|
@ -483,49 +592,86 @@ namespace CafeSystem
|
|||
H264::Initialize();
|
||||
snd_core::Initialize();
|
||||
mic::Initialize();
|
||||
nfc::Initialize();
|
||||
ntag::Initialize();
|
||||
// init hardware register interfaces
|
||||
HW_SI::Initialize();
|
||||
}
|
||||
|
||||
void SetImplementation(SystemImplementation* impl)
|
||||
{
|
||||
s_implementation = impl;
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
cemu_assert_debug(s_initialized);
|
||||
// if a title is running, shut it down
|
||||
if (sSystemRunning)
|
||||
ShutdownTitle();
|
||||
// shutdown persistent subsystems (deprecated manual shutdown)
|
||||
iosu::odm::Shutdown();
|
||||
iosu::act::Stop();
|
||||
iosu::mcp::Shutdown();
|
||||
iosu::fsa::Shutdown();
|
||||
// shutdown IOSU modules
|
||||
for(auto it = s_iosuModules.rbegin(); it != s_iosuModules.rend(); ++it)
|
||||
(*it)->SystemExit();
|
||||
s_initialized = false;
|
||||
}
|
||||
|
||||
std::string GetInternalVirtualCodeFolder()
|
||||
{
|
||||
return "/internal/current_title/code/";
|
||||
}
|
||||
|
||||
STATUS_CODE LoadAndMountForegroundTitle(TitleId titleId)
|
||||
void MountBaseDirectories()
|
||||
{
|
||||
const auto mlc = ActiveSettings::GetMlcPath();
|
||||
FSCDeviceHostFS_Mount("/cemuBossStorage/", _pathToUtf8(mlc / "usr/boss/"), FSC_PRIORITY_BASE);
|
||||
FSCDeviceHostFS_Mount("/vol/storage_mlc01/", _pathToUtf8(mlc / ""), FSC_PRIORITY_BASE);
|
||||
}
|
||||
|
||||
void UnmountBaseDirectories()
|
||||
{
|
||||
fsc_unmount("/vol/storage_mlc01/", FSC_PRIORITY_BASE);
|
||||
fsc_unmount("/cemuBossStorage/", FSC_PRIORITY_BASE);
|
||||
}
|
||||
|
||||
PREPARE_STATUS_CODE LoadAndMountForegroundTitle(TitleId titleId)
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Mounting title {:016x}", (uint64)titleId);
|
||||
sGameInfo_ForegroundTitle = CafeTitleList::GetGameInfo(titleId);
|
||||
if (!sGameInfo_ForegroundTitle.IsValid())
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Mounting failed: Game meta information is either missing, inaccessible or not valid (missing or invalid .xml files in code and meta folder)");
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
}
|
||||
// check base
|
||||
TitleInfo& titleBase = sGameInfo_ForegroundTitle.GetBase();
|
||||
if (!titleBase.IsValid())
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
if(!titleBase.ParseXmlInfo())
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
cemuLog_log(LogType::Force, "Base: {}", titleBase.GetPrintPath());
|
||||
// mount base
|
||||
if (!titleBase.Mount("/vol/content", "content", FSC_PRIORITY_BASE) || !titleBase.Mount(GetInternalVirtualCodeFolder(), "code", FSC_PRIORITY_BASE))
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Mounting failed");
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
}
|
||||
// check update
|
||||
TitleInfo& titleUpdate = sGameInfo_ForegroundTitle.GetUpdate();
|
||||
if (titleUpdate.IsValid())
|
||||
{
|
||||
if (!titleUpdate.ParseXmlInfo())
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
cemuLog_log(LogType::Force, "Update: {}", titleUpdate.GetPrintPath());
|
||||
// mount update
|
||||
if (!titleUpdate.Mount("/vol/content", "content", FSC_PRIORITY_PATCH) || !titleUpdate.Mount(GetInternalVirtualCodeFolder(), "code", FSC_PRIORITY_PATCH))
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Mounting failed");
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -537,26 +683,49 @@ namespace CafeSystem
|
|||
// todo - support for multi-title AOC
|
||||
TitleInfo& titleAOC = aocList[0];
|
||||
if (!titleAOC.ParseXmlInfo())
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
cemu_assert_debug(titleAOC.IsValid());
|
||||
cemuLog_log(LogType::Force, "DLC: {}", titleAOC.GetPrintPath());
|
||||
// mount AOC
|
||||
if (!titleAOC.Mount(fmt::format("/vol/aoc{:016x}", titleAOC.GetAppTitleId()), "content", FSC_PRIORITY_PATCH))
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Mounting failed");
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
}
|
||||
}
|
||||
else
|
||||
cemuLog_log(LogType::Force, "DLC: Not present");
|
||||
sForegroundTitleId = titleId;
|
||||
return STATUS_CODE::SUCCESS;
|
||||
return PREPARE_STATUS_CODE::SUCCESS;
|
||||
}
|
||||
|
||||
STATUS_CODE SetupExecutable()
|
||||
void UnmountForegroundTitle()
|
||||
{
|
||||
if(sLaunchModeIsStandalone)
|
||||
return;
|
||||
cemu_assert_debug(sGameInfo_ForegroundTitle.IsValid()); // unmounting title which was never mounted?
|
||||
if (!sGameInfo_ForegroundTitle.IsValid())
|
||||
return;
|
||||
sGameInfo_ForegroundTitle.GetBase().Unmount("/vol/content");
|
||||
sGameInfo_ForegroundTitle.GetBase().Unmount(GetInternalVirtualCodeFolder());
|
||||
if (sGameInfo_ForegroundTitle.HasUpdate())
|
||||
{
|
||||
if(auto& update = sGameInfo_ForegroundTitle.GetUpdate(); update.IsValid())
|
||||
{
|
||||
update.Unmount("/vol/content");
|
||||
update.Unmount(GetInternalVirtualCodeFolder());
|
||||
}
|
||||
}
|
||||
auto aocList = sGameInfo_ForegroundTitle.GetAOC();
|
||||
if (!aocList.empty())
|
||||
{
|
||||
TitleInfo& titleAOC = aocList[0];
|
||||
titleAOC.Unmount(fmt::format("/vol/aoc{:016x}", titleAOC.GetAppTitleId()));
|
||||
}
|
||||
}
|
||||
|
||||
PREPARE_STATUS_CODE SetupExecutable()
|
||||
{
|
||||
// mount mlc directories
|
||||
fscDeviceHostFS_mapBaseDirectories_deprecated();
|
||||
// set rpx path from cos.xml if available
|
||||
_pathToBaseExecutable = _pathToExecutable;
|
||||
if (!sLaunchModeIsStandalone)
|
||||
|
@ -587,35 +756,46 @@ namespace CafeSystem
|
|||
}
|
||||
}
|
||||
LoadMainExecutable();
|
||||
gameProfile_load();
|
||||
return STATUS_CODE::SUCCESS;
|
||||
return PREPARE_STATUS_CODE::SUCCESS;
|
||||
}
|
||||
|
||||
STATUS_CODE PrepareForegroundTitle(TitleId titleId)
|
||||
void SetupMemorySpace()
|
||||
{
|
||||
memory_mapForCurrentTitle();
|
||||
LoadSharedData();
|
||||
}
|
||||
|
||||
void DestroyMemorySpace()
|
||||
{
|
||||
memory_unmapForCurrentTitle();
|
||||
}
|
||||
|
||||
PREPARE_STATUS_CODE PrepareForegroundTitle(TitleId titleId)
|
||||
{
|
||||
CafeTitleList::WaitForMandatoryScan();
|
||||
sLaunchModeIsStandalone = false;
|
||||
_pathToExecutable.clear();
|
||||
TitleIdParser tip(titleId);
|
||||
if (tip.GetType() == TitleIdParser::TITLE_TYPE::AOC || tip.GetType() == TitleIdParser::TITLE_TYPE::BASE_TITLE_UPDATE)
|
||||
cemuLog_log(LogType::Force, "Launched titleId is not the base of a title");
|
||||
|
||||
// mount mlc storage
|
||||
MountBaseDirectories();
|
||||
// mount title folders
|
||||
STATUS_CODE r = LoadAndMountForegroundTitle(titleId);
|
||||
if (r != STATUS_CODE::SUCCESS)
|
||||
PREPARE_STATUS_CODE r = LoadAndMountForegroundTitle(titleId);
|
||||
if (r != PREPARE_STATUS_CODE::SUCCESS)
|
||||
return r;
|
||||
// map memory
|
||||
memory_mapForCurrentTitle();
|
||||
// load RPX
|
||||
r = SetupExecutable();
|
||||
if (r != STATUS_CODE::SUCCESS)
|
||||
gameProfile_load();
|
||||
// setup memory space and PPC recompiler
|
||||
SetupMemorySpace();
|
||||
PPCRecompiler_init();
|
||||
r = SetupExecutable(); // load RPX
|
||||
if (r != PREPARE_STATUS_CODE::SUCCESS)
|
||||
return r;
|
||||
|
||||
loadSharedData();
|
||||
InitVirtualMlcStorage();
|
||||
return STATUS_CODE::SUCCESS;
|
||||
return PREPARE_STATUS_CODE::SUCCESS;
|
||||
}
|
||||
|
||||
STATUS_CODE PrepareForegroundTitleFromStandaloneRPX(const fs::path& path)
|
||||
PREPARE_STATUS_CODE PrepareForegroundTitleFromStandaloneRPX(const fs::path& path)
|
||||
{
|
||||
sLaunchModeIsStandalone = true;
|
||||
cemuLog_log(LogType::Force, "Launching executable in standalone mode due to incorrect layout or missing meta files");
|
||||
|
@ -633,7 +813,7 @@ namespace CafeSystem
|
|||
if (!r)
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Failed to mount {}", _pathToUtf8(contentPath));
|
||||
return STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
return PREPARE_STATUS_CODE::UNABLE_TO_MOUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -645,28 +825,29 @@ namespace CafeSystem
|
|||
// since a lot of systems (including save folder location) rely on a TitleId, we derive a placeholder id from the executable hash
|
||||
auto execData = fsc_extractFile(_pathToExecutable.c_str());
|
||||
if (!execData)
|
||||
return STATUS_CODE::INVALID_RPX;
|
||||
return PREPARE_STATUS_CODE::INVALID_RPX;
|
||||
uint32 h = generateHashFromRawRPXData(execData->data(), execData->size());
|
||||
sForegroundTitleId = 0xFFFFFFFF00000000ULL | (uint64)h;
|
||||
cemuLog_log(LogType::Force, "Generated placeholder TitleId: {:016x}", sForegroundTitleId);
|
||||
// setup memory space and ppc recompiler
|
||||
SetupMemorySpace();
|
||||
PPCRecompiler_init();
|
||||
// load executable
|
||||
memory_mapForCurrentTitle();
|
||||
SetupExecutable();
|
||||
loadSharedData();
|
||||
InitVirtualMlcStorage();
|
||||
return STATUS_CODE::SUCCESS;
|
||||
return PREPARE_STATUS_CODE::SUCCESS;
|
||||
}
|
||||
|
||||
void _LaunchTitleThread()
|
||||
{
|
||||
// init
|
||||
for(auto& module : s_iosuModules)
|
||||
module->TitleStart();
|
||||
cemu_initForGame();
|
||||
// enter scheduler
|
||||
if (ActiveSettings::GetCPUMode() == CPUMode::MulticoreRecompiler)
|
||||
if (ActiveSettings::GetCPUMode() == CPUMode::MulticoreRecompiler && !LaunchSettings::ForceInterpreter())
|
||||
coreinit::OSSchedulerBegin(3);
|
||||
else
|
||||
coreinit::OSSchedulerBegin(1);
|
||||
iosu::pdm::StartTrackingTime(GetForegroundTitleId());
|
||||
}
|
||||
|
||||
void LaunchForegroundTitle()
|
||||
|
@ -697,6 +878,13 @@ namespace CafeSystem
|
|||
return sGameInfo_ForegroundTitle.GetVersion();
|
||||
}
|
||||
|
||||
uint32 GetForegroundTitleSDKVersion()
|
||||
{
|
||||
if (sLaunchModeIsStandalone)
|
||||
return 999999;
|
||||
return sGameInfo_ForegroundTitle.GetSDKVersion();
|
||||
}
|
||||
|
||||
CafeConsoleRegion GetForegroundTitleRegion()
|
||||
{
|
||||
if (sLaunchModeIsStandalone)
|
||||
|
@ -717,6 +905,13 @@ namespace CafeSystem
|
|||
return applicationName;
|
||||
}
|
||||
|
||||
uint32 GetForegroundTitleOlvAccesskey()
|
||||
{
|
||||
if (sLaunchModeIsStandalone)
|
||||
return -1;
|
||||
return sGameInfo_ForegroundTitle.GetBase().GetMetaInfo()->GetOlvAccesskey();
|
||||
}
|
||||
|
||||
std::string GetForegroundTitleArgStr()
|
||||
{
|
||||
if (sLaunchModeIsStandalone)
|
||||
|
@ -727,6 +922,47 @@ namespace CafeSystem
|
|||
return sGameInfo_ForegroundTitle.GetBase().GetArgStr();
|
||||
}
|
||||
|
||||
CosCapabilityBits GetForegroundTitleCosCapabilities(CosCapabilityGroup group)
|
||||
{
|
||||
if (sLaunchModeIsStandalone)
|
||||
return CosCapabilityBits::All;
|
||||
auto& update = sGameInfo_ForegroundTitle.GetUpdate();
|
||||
if (update.IsValid())
|
||||
{
|
||||
ParsedCosXml* cosXml = update.GetCosInfo();
|
||||
if (cosXml)
|
||||
return cosXml->GetCapabilityBits(group);
|
||||
}
|
||||
auto& base = sGameInfo_ForegroundTitle.GetBase();
|
||||
if(base.IsValid())
|
||||
{
|
||||
ParsedCosXml* cosXml = base.GetCosInfo();
|
||||
if (cosXml)
|
||||
return cosXml->GetCapabilityBits(group);
|
||||
}
|
||||
return CosCapabilityBits::All;
|
||||
}
|
||||
|
||||
// when switching titles custom parameters can be passed, returns true if override args are used
|
||||
bool GetOverrideArgStr(std::vector<std::string>& args)
|
||||
{
|
||||
args.clear();
|
||||
if(!s_overrideArgs)
|
||||
return false;
|
||||
args = *s_overrideArgs;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetOverrideArgs(std::span<std::string> args)
|
||||
{
|
||||
s_overrideArgs = std::vector<std::string>(args.begin(), args.end());
|
||||
}
|
||||
|
||||
void UnsetOverrideArgs()
|
||||
{
|
||||
s_overrideArgs = std::nullopt;
|
||||
}
|
||||
|
||||
// pick platform region based on title region
|
||||
CafeConsoleRegion GetPlatformRegion()
|
||||
{
|
||||
|
@ -743,24 +979,7 @@ namespace CafeSystem
|
|||
|
||||
void UnmountCurrentTitle()
|
||||
{
|
||||
TitleInfo& titleBase = sGameInfo_ForegroundTitle.GetBase();
|
||||
if (titleBase.IsValid())
|
||||
titleBase.UnmountAll();
|
||||
if (sGameInfo_ForegroundTitle.HasUpdate())
|
||||
{
|
||||
TitleInfo& titleUpdate = sGameInfo_ForegroundTitle.GetUpdate();
|
||||
if (titleUpdate.IsValid())
|
||||
titleUpdate.UnmountAll();
|
||||
}
|
||||
if (sGameInfo_ForegroundTitle.HasAOC())
|
||||
{
|
||||
auto titleInfoList = sGameInfo_ForegroundTitle.GetAOC();
|
||||
for(auto& it : titleInfoList)
|
||||
{
|
||||
if (it.IsValid())
|
||||
it.UnmountAll();
|
||||
}
|
||||
}
|
||||
UnmountForegroundTitle();
|
||||
fsc_unmount("/internal/code/", FSC_PRIORITY_BASE);
|
||||
}
|
||||
|
||||
|
@ -770,12 +989,22 @@ namespace CafeSystem
|
|||
return;
|
||||
coreinit::OSSchedulerEnd();
|
||||
Latte_Stop();
|
||||
iosu::pdm::Stop();
|
||||
iosu::act::Stop();
|
||||
iosu::mcp::Shutdown();
|
||||
iosu::fsa::Shutdown();
|
||||
// reset Cafe OS userspace modules
|
||||
snd_core::reset();
|
||||
coreinit::OSAlarm_Shutdown();
|
||||
GX2::_GX2DriverReset();
|
||||
nn::save::ResetToDefaultState();
|
||||
coreinit::__OSDeleteAllActivePPCThreads();
|
||||
RPLLoader_ResetState();
|
||||
for(auto it = s_iosuModules.rbegin(); it != s_iosuModules.rend(); ++it)
|
||||
(*it)->TitleStop();
|
||||
// reset Cemu subsystems
|
||||
PPCRecompiler_Shutdown();
|
||||
GraphicPack2::Reset();
|
||||
UnmountCurrentTitle();
|
||||
MlcStorageUnmountAllTitles();
|
||||
UnmountBaseDirectories();
|
||||
DestroyMemorySpace();
|
||||
sSystemRunning = false;
|
||||
}
|
||||
|
||||
|
@ -825,10 +1054,7 @@ namespace CafeSystem
|
|||
}
|
||||
TitleId titleId = titleInfo.GetAppTitleId();
|
||||
if (m_mlcMountedTitles.find(titleId) != m_mlcMountedTitles.end())
|
||||
{
|
||||
cemu_assert_suspicious(); // already mounted
|
||||
return;
|
||||
}
|
||||
std::string mlcStoragePath = GetMlcStoragePath(titleId);
|
||||
TitleInfo* mountTitleInfo = new TitleInfo(titleInfo);
|
||||
if (!mountTitleInfo->Mount(mlcStoragePath, "", FSC_PRIORITY_BASE))
|
||||
|
@ -855,6 +1081,16 @@ namespace CafeSystem
|
|||
MlcStorageMountTitle(it);
|
||||
}
|
||||
|
||||
void MlcStorageUnmountAllTitles()
|
||||
{
|
||||
for(auto& it : m_mlcMountedTitles)
|
||||
{
|
||||
std::string mlcStoragePath = GetMlcStoragePath(it.first);
|
||||
it.second->Unmount(mlcStoragePath);
|
||||
}
|
||||
m_mlcMountedTitles.clear();
|
||||
}
|
||||
|
||||
uint32 GetRPXHashBase()
|
||||
{
|
||||
return currentBaseApplicationHash;
|
||||
|
@ -865,4 +1101,9 @@ namespace CafeSystem
|
|||
return currentUpdatedApplicationHash;
|
||||
}
|
||||
|
||||
void RequestRecreateCanvas()
|
||||
{
|
||||
s_implementation->CafeRecreateCanvas();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue