54 Commits
Author SHA1 Message Date
ExzapandGitHub 101ff7783e Revert accidental removal of release tag 2022-09-24 12:55:13 +02:00
ExzapandGitHub 9caf57c2c5 Vulkan: Fix incorrect encoding for substituted R4G4 format (#288)
Fixed incorrect channel order when VK_FORMAT_R4G4_UNORM_PACK8 is substituted with VK_FORMAT_R4G4B4A4_UNORM_PACK16
2022-09-24 11:44:44 +02:00
ExzapandGitHub 8e89187f95 Remove misleading link from generated experimental releases 2022-09-24 11:11:54 +02:00
ExzapandGitHub 3bceb39966 Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287)
Removes the -DPUBLIC_RELEASE flag. Cemu's debug asserts are now only enabled if the build configuration is Debug. Similarly, on Windows the console is only shown for Debug builds.
2022-09-24 08:43:27 +02:00
jcrm1andGitHub b720d17a97 CI: Add macOS x64 to build check and releases (#274) 2022-09-23 11:17:50 +02:00
ExzapandGitHub 9b76b0e2d3 CI: Fix Windows build running out of disk space (#284)
- Clean package temporaries during building to save disk space
- Remove msvc workaround which is no longer needed
2022-09-22 11:34:13 +02:00
TillsunsetandGitHub 030d15900d Add MacOS build instructions (#279) 2022-09-20 20:26:54 +02:00
TillsunsetandGitHub 7864d76eca fixed the string encoding issue on macOS (#277) 2022-09-20 14:50:34 +02:00
Crementif 6fa0ac6eaa [docs] Recommend PUBLIC_RELEASE
Most people following the guide are currently not really developers and this was a fairly hidden option that's easily missed.

The disabled version will later change to be an actual custom cmake target instead of a preprocessor flag, but that'll require more code to be adjusted.

Not using the flag means that Cemu keeps some (performance-costing) debug checks in, alongside more logging and a debug logging console on Windows.
2022-09-20 00:15:53 +02:00
Crementif 510d80038d [coreinit] Add OSIsDebuggerPresent 2022-09-19 21:41:01 +02:00
SSimcoandGitHub 9f02733a0d Use unordered_map for keydown to allow codes above 255 (#248)
- Adds internal support for 32bit key codes, required for proper keyboard input on Linux
- Use gdk_keyval_name to get key name on Linux
2022-09-19 03:07:26 +02:00
ExzapandGitHub 5e968eff4f Fix 1x1 symbols in debugger window + Load icons from headers on all platforms
- Fixed an issue where the toolbar icons for the debugger were resized to 1x1
- On Windows we now load the PNG UI icons from the header-embedded pngs (`resource/embedded`) instead of via `cemu.rc` to match behavior of other platforms
2022-09-18 15:53:10 +02:00
TillsunsetandGitHub 867c0c5ca2 Fix some issues with building on macOS (#268)
* fixed building on macos, needs OBJC and OBJXX to be enabled
* changed to weak ordering due to string comparison not being strong ordering
* Use raw PNG bytes from "resource/embedded/resources.h" in all windows too
2022-09-18 14:39:00 +02:00
ExzapandGitHub 12b6830546 GX2: Add crash workaround for FFL uninitialized texture (#264)
When a game tries to generate Miis without the FFL files being dumped (<mlc>/sys/title/0005001b/10056000/content/) it will cause it to create and use a texture with invalid parameters.
This workaround catches and replaces bad texture parameters to avoid crashing further down the line.

Resolves crashes in Sonic Lost World, Super Mario 3D World and probably a few others.

We had this workaround in pre-2.0 Cemu already but it was dropped during refactoring.
2022-09-17 16:32:46 +02:00
dd14778561 [docs] Explain how to update local cemu repo + General fixes (#227)
Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com>
2022-09-17 14:53:46 +02:00
TillsunsetandGitHub 41dcd48048 Fix a small regression when building in Macos (#262) 2022-09-17 13:52:12 +02:00
Crementif c113565fe3 [deps] Update zarchive 2022-09-17 10:45:27 +02:00
Herman SemenovandGitHub 03f5967408 Fix incorrect streamout buffer index in GS + refactor various code (#258) 2022-09-17 03:45:18 +02:00
Maximilian Downey TwissandGitHub 4a3d02db55 Properly list files in CMakeLists instead of using GLOB (#249) 2022-09-17 03:24:57 +02:00
ExzapandGitHub 910cdf4d5c Refactor wxGameList color code and match previous style on light theme (#261)
Refactored to pre-calculate the game list row colors at the beginning of the function. If the background color is almost white as it is on Windows, we'll use the previous bluish secondary color instead of grey-scale lightness adjustment.
2022-09-17 02:39:52 +02:00
ShoegzerandGitHub 6ef36152c2 Use system color definitions for wxGameList (#241)
Previously it would use hard-coded bright colors which clashed with dark themes on Linux
2022-09-17 01:06:36 +02:00
ExzapandGitHub 63206eb9a8 coreinit: Return error code instead of success in Acquire failure (#260)
Spotted by @Fs00
It's currently not known if any games are affected by this
2022-09-16 14:25:38 +02:00
Francesco SaltoriandGitHub 664d7ee902 Clean up more Cemuhook leftovers (#253) 2022-09-16 13:34:41 +02:00
CrementifandGitHub cebdccfdf5 Update readme about matrix server
Supersedes https://github.com/cemu-project/Cemu/pull/245
2022-09-15 04:06:40 +02:00
ExzapandGitHub 61a3b07697 Merge pull request #238 from Fs00/more-translations
More l10n improvements and add workflow to generate POT file
2022-09-14 22:49:14 +02:00
Crementif 6cf5dc9a56 Add matrix server for non-discord chatting
Fixes https://github.com/cemu-project/Cemu/issues/113
2022-09-11 16:56:51 +02:00
ExzapandGitHub 0afa2d75aa CI: build.yml no longer invokes itself, always produce artifact (#243)
- Build check is now a separate workflow
- Build with release config instead of debug
- Upload artifacts
2022-09-11 06:41:19 +02:00
capitalistsandGitHub b5963afbb5 Fix DSUController socket option error on Linux (#234) 2022-09-11 04:20:40 +02:00
SSimcoandGitHub 9a60979242 Linux: Avoid out-of-bounds raw keycode array access (#226) 2022-09-11 02:00:02 +02:00
capitalistsandGitHub d4879da95c Implement analog triggers for DSUController (#239) 2022-09-11 01:32:17 +02:00
Fs00 b47b38448c Add workflow for generating POT file 2022-09-10 19:17:14 +02:00
Fs00 694b9ec495 Avoid including newlines in localizable string 2022-09-10 18:47:32 +02:00
Fs00 08db65bd5a Remove some dead code 2022-09-10 18:47:32 +02:00
Fs00 13aa0a4fd0 Make controller button names translatable and deduplicate code 2022-09-10 18:47:27 +02:00
Fs00 4c6f22ba39 Simplify a few window names 2022-09-10 13:55:37 +02:00
ExzapandGitHub 3349d7b424 Merge pull request #231 from Exzap/main
FSC: Replace wstring paths with utf8 encoded strings + misc clean up
2022-09-10 00:48:20 +02:00
Exzap 680beaaf21 Rename path _utf8Wrapper to _utf8ToPath for better clarity 2022-09-09 23:49:38 +02:00
Exzap 168ecf8825 FSC: Use utf8 path strings instead of wchar
Also introduced helper function _utf8ToPath() to convert a utf8-encoded string to fs::path
2022-09-09 23:49:38 +02:00
Exzap 1ce629126a FSC: Refactor FileTree and remove redundant path parser class 2022-09-09 23:49:38 +02:00
Exzap b8462cec8b FSC: Refactor to use FSCPath instead of legacy code 2022-09-09 23:49:38 +02:00
Exzap 0e0602e8d9 FSC: Use utf8 for mounting and internal target path 2022-09-09 23:49:38 +02:00
SSimcoandGitHub cf598e38c1 Linux: Find case-insensitive file/folder path if not found (#196) 2022-09-09 20:16:46 +02:00
uranuspucksaxophoneandGitHub 6dda53e84f Improve docs (#216) 2022-09-09 18:39:23 +02:00
goeiecool9999andGitHub 045a059742 fix for when file open is successful but the path isn't a file (#220)
FSC and indirectly coreinit relies on FileStream open failing for directories
2022-09-09 16:10:12 +02:00
TotalCaesar659andGitHub 76313fc238 Update bug tracker URL to use HTTPS (#211) 2022-09-08 23:52:45 +02:00
ExzapandGitHub 1e851fe7e2 Latte: Fix infinite loop in special state clearAsDepth() (#209)
This broke while refactoring code for the 2.0 release. Resolves Tokyo Mirage Session and Pokken freezing on boot. Probably also affects some other games

Also updated .gitignore
2022-09-08 17:33:31 +02:00
Timothy RedaelliandGitHub f032088902 Use _Exit instead of exit under Linux (#204)
The best ExitProcess alternative for Linux is _Exit since it doesn't
call exit handlers.
2022-09-08 17:05:31 +02:00
Tom LallyandGitHub 6cdb6eed17 Cleanup udiv128 (#206) 2022-09-08 02:12:53 +02:00
bitscherandGitHub 4eaa600b57 Fix various compiler warnings given by Clang (#170) 2022-09-07 20:04:32 +02:00
bslhqandGitHub 4d1be950e3 Fix various issues related to title names (#192)
Fixed various issues related to title names:
1. If console language is set to non-English, the title names in Title Manager may be empty.
2. Game list do not show custom names if list style set to icon or small icon.
3. Custom title names for some languages (like JP or CN) appear confusing if re-edited.
4. Unexpected overrides of variable values in ParsedMetaXml.h
2022-09-07 19:58:56 +02:00
Jun Bo BiandGitHub b752d2eddd fix clang-cl (#202) 2022-09-07 18:22:40 +02:00
Timothy RedaelliandGitHub 0a1985e481 Set timer milliseconds for "Controller settings" (#194)
This is needed to avoid having the Controller settings window black on Linux
2022-09-07 16:54:48 +02:00
goeiecool9999andGitHub e20bfd00ec Separate filestream.h into OS specific implementation files (#190) 2022-09-07 02:42:25 +02:00
Tom LallyandGitHub f8b5024c09 Improved macro clarity. (#188) 2022-09-07 02:27:52 +02:00
214 changed files with 2636 additions and 2096 deletions
+70 -44
View File
@@ -1,18 +1,6 @@
name: Build Cemu
on:
pull_request:
paths-ignore:
- "*.md"
types:
- opened
- synchronize
- reopened
push:
paths-ignore:
- "*.md"
branches:
- main
workflow_call:
inputs:
deploymode:
@@ -39,7 +27,7 @@ jobs:
if: ${{ inputs.deploymode == 'release' }}
run: |
echo "BUILD_MODE=release" >> $GITHUB_ENV
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
if: ${{ inputs.deploymode != 'release' }}
@@ -111,7 +99,7 @@ jobs:
if: ${{ inputs.deploymode == 'release' }}
run: |
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" | 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)
@@ -126,35 +114,6 @@ jobs:
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
- name: Workaround
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToRemove= @(
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ARM"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ARM64"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ARM64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.x86.x64"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.x86.x64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ATL"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ATL.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ATL.ARM"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ATL.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ATL.ARM64"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.ATL.ARM64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.MFC"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.MFC.ARM"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.MFC.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.MFC.ARM64"
"Microsoft.VisualStudio.Component.VC.14.32.17.2.MFC.ARM64.Spectre"
)
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
@@ -186,7 +145,7 @@ jobs:
cd build
echo "[INFO] BUILD_FLAGS: ${{ env.BUILD_FLAGS }}"
echo "[INFO] BUILD_MODE: ${{ env.BUILD_MODE }}"
cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }}
cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DVCPKG_INSTALL_OPTIONS="--clean-after-build"
- name: "Build Cemu"
run: |
@@ -203,3 +162,70 @@ jobs:
with:
name: cemu-bin-windows-x64
path: ./bin/Cemu.exe
build-macos:
runs-on: macos-12
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Setup release mode parameters (for deploy)
if: ${{ inputs.deploymode == 'release' }}
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 != '' }}
run: |
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV
- name: "Install system dependencies"
run: |
brew install llvm@14 ninja nasm molten-vk
- name: "Bootstrap vcpkg"
run: |
bash ./dependencies/vcpkg/bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials for vcpkg'
shell: 'bash'
run: |
mono `./dependencies/vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
mono `./dependencies/vcpkg/vcpkg fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: "cmake"
run: |
mkdir build
cd build
cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++ -G Ninja
- name: "Build Cemu"
run: |
cmake --build build
- name: Prepare artifact
if: ${{ inputs.deploymode == 'release' }}
run: chmod a+x bin/Cemu_release && mv bin/Cemu_release bin/Cemu
- name: Upload artifact
uses: actions/upload-artifact@v3
if: ${{ inputs.deploymode == 'release' }}
with:
name: cemu-bin-macos-x64
path: ./bin/Cemu
+21
View File
@@ -0,0 +1,21 @@
name: Build check
on:
pull_request:
paths-ignore:
- "*.md"
types:
- opened
- synchronize
- reopened
push:
paths-ignore:
- "*.md"
branches:
- main
jobs:
build:
uses: ./.github/workflows/build.yml
with:
deploymode: release
experimentalversion: 999999
@@ -25,6 +25,11 @@ jobs:
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
@@ -57,10 +62,19 @@ jobs:
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: |
ls ./
ls ./bin/
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
mv cemu-bin-macos-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.zip ${{ env.CEMU_FOLDER_NAME }}
rm -r ./${{ env.CEMU_FOLDER_NAME }}
- 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 - [changelog](https://cemu.info/changelog.html)" "v${{ env.CEMU_VERSION }}" ./upload
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
@@ -27,6 +27,11 @@ jobs:
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
@@ -61,7 +66,16 @@ jobs:
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: |
ls ./
ls ./bin/
cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }}
mv cemu-bin-macos-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.zip ${{ env.CEMU_FOLDER_NAME }}
rm -r ./${{ env.CEMU_FOLDER_NAME }}
- 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
+42
View File
@@ -0,0 +1,42 @@
name: Generate translation template
on:
pull_request:
paths-ignore:
- "*.md"
types:
- opened
- synchronize
- reopened
push:
paths-ignore:
- "*.md"
branches:
- main
jobs:
generate-pot:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
- name: "Install gettext"
run: |
sudo apt update -qq
sudo apt install -y gettext
- 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
--check=space-ellipsis --omit-header
-o cemu.pot
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: POT file
path: ./cemu.pot
if-no-files-found: error
+1
View File
@@ -32,6 +32,7 @@ bin/mlc01/*
bin/settings.xml
bin/title_list_cache.xml
bin/debugger/*
bin/sdcard/*
!bin/shaderCache/info.txt
bin/shaderCache/*
+39 -9
View File
@@ -12,11 +12,11 @@ Instructions:
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.exe.
- 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.
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.
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.
## Linux
@@ -25,14 +25,15 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required
### Installing dependencies
#### For Ubuntu and derivatives:
`sudo apt install -y git curl cmake ninja-build nasm libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev libpulse-dev`
Additionally, for ubuntu 20.04 only:
`sudo apt install -y git curl cmake ninja-build nasm libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev libpulse-dev`
*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`
#### For Arch and derivatives:
`sudo pacman -S git cmake clang ninja nasm base-devel linux-headers gtk3 libsecret libgcrypt systemd freeglut zip libpulse`
`sudo pacman -S git cmake clang ninja nasm base-devel linux-headers gtk3 libsecret libgcrypt systemd freeglut zip unzip libpulse`
#### For Fedora and derivatives:
`sudo dnf install git cmake clang ninja-build nasm kernel-headers gtk3-devel libsecret-devel libgcrypt-devel systemd-devel freeglut-devel perl-core zlib-devel cubeb-devel`
@@ -42,7 +43,7 @@ Additionally, for ubuntu 20.04 only:
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`.
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
#### 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).
@@ -56,4 +57,33 @@ You can use it by replacing the step 3 with the following:
- 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 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.
## 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.
### Installing dependencies
`brew install git cmake llvm@14 ninja nasm molten-vk`
### 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 -DPUBLIC_RELEASE=ON
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/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`.
#### Troubleshooting steps
- If step 3 gives you an error about not being able to find ninja, try appending `-DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja` to the command and running it again.
## Updating Cemu and source code
1. To update your Cemu local repository, use the command `git pull --recurse-submodules` (run this command on the Cemu root).
- This should update your local copy of Cemu and all of its dependencies.
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.
+12 -9
View File
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.21.1)
option(PUBLIC_RELEASE "Compile with debug asserts disabled and no console" OFF)
option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version
@@ -29,13 +28,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (PUBLIC_RELEASE)
add_compile_definitions(PUBLIC_RELEASE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) # enable LTO
endif()
add_compile_definitions($<$<CONFIG:Debug>:CEMU_DEBUG_ASSERT>) # if build type is debug, set CEMU_DEBUG_ASSERT
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# enable link time optimization for release builds
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
# floating point model: precise, fiber safe optimizations
@@ -48,10 +48,13 @@ if (MSVC)
else()
add_compile_options(/GT)
endif()
if (PUBLIC_RELEASE)
message(STATUS "Using additional optimization flags for MSVC")
add_compile_options(/Oi /Ot) # enable intrinsic functions, favor speed
endif()
# enable additional optimization flags for release builds
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Oi>) # enable intrinsic functions
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Ot>) # favor speed
endif()
if (APPLE)
enable_language(OBJC OBJCXX)
endif()
option(ENABLE_OPENGL "Enables the OpenGL backend" ON)
+3 -4
View File
@@ -1,7 +1,7 @@
{
"configurations": [
{
"name": "Release",
"name": "RelWithDebInfo",
"configurationType": "RelWithDebInfo",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
@@ -9,13 +9,12 @@
"installRoot": "${projectDir}\\out\\install\\${name}"
},
{
"name": "Public Release",
"configurationType": "RelWithDebInfo",
"name": "Release",
"configurationType": "Release",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DPUBLIC_RELEASE=ON"
},
{
"name": "Debug",
+8 -6
View File
@@ -2,6 +2,7 @@
[![Build Process](https://github.com/cemu-project/Cemu/actions/workflows/build.yml/badge.svg)](https://github.com/cemu-project/Cemu/actions/workflows/build.yml)
[![Discord](https://img.shields.io/discord/286429969104764928?label=Cemu&logo=discord&logoColor=FFFFFF)](https://discord.gg/5psYsup)
[![Matrix Server](https://img.shields.io/matrix/cemu:cemu.info?server_fqdn=matrix.cemu.info&label=cemu:cemu.info&logo=matrix&logoColor=FFFFFF)](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.
@@ -14,6 +15,7 @@ Cemu is currently only available for 64-bit Windows and Linux devices.
- [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)
#### Other relevant repositories:
@@ -22,11 +24,11 @@ Cemu is currently only available for 64-bit Windows and Linux devices.
## 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 from the [GitHub Releases](https://github.com/cemu-project/Cemu/releases/) or from [Cemu's website](https://cemu.info).
Cemu is currently only available in a portable format so no installation is required besides extracting it in a safe place.
See [Current State Of Linux builds](https://github.com/cemu-project/Cemu/issues/1) for information on using Cemu natively on Linux.
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.
Pre-2.0 releases can be found on Cemu's [changelog page](https://cemu.info/changelog.html).
@@ -36,16 +38,16 @@ To compile Cemu yourself on Windows or Linux, view the [BUILD.md file](/BUILD.md
## Issues
Issues with the emulator should be filed using [Github Issues](https://github.com/cemu-project/Cemu/issues).
The old bug tracker can be found at [bugs.cemu.info](http://bugs.cemu.info) and still contains relevant issues and feature suggestions.
Issues with the emulator should be filed using [GitHub Issues](https://github.com/cemu-project/Cemu/issues).
The old bug tracker can be found at [bugs.cemu.info](https://bugs.cemu.info) and still contains relevant issues and feature suggestions.
## Contributing
Pull requests are very welcome. For easier coordination you can visit the developer discussion channel on Discord: [https://discord.gg/5psYsup](https://discord.gg/5psYsup).
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).
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. Alternative communication channels (like IRC) are being considered.
Questions about Cemu's software architecture can also be answered on Discord (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.
+5 -11
View File
@@ -54,17 +54,10 @@ add_subdirectory(imgui)
add_subdirectory(resource)
add_subdirectory(asm)
if(PUBLIC_RELEASE)
add_executable(CemuBin WIN32
main.cpp
mainLLE.cpp
)
else()
add_executable(CemuBin
main.cpp
mainLLE.cpp
)
endif()
add_executable(CemuBin
main.cpp
mainLLE.cpp
)
if(WIN32)
target_sources(CemuBin PRIVATE
@@ -73,6 +66,7 @@ if(WIN32)
endif()
set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET CemuBin PROPERTY WIN32_EXECUTABLE $<NOT:$<CONFIG:Debug>>)
set_target_properties(CemuBin PROPERTIES
# multi-configuration generators will add a config subdirectory to RUNTIME_OUTPUT_DIRECTORY if no generator expression is used
+1 -1
View File
@@ -5,7 +5,7 @@
#include "config/ActiveSettings.h"
#include "Cafe/IOSU/legacy/iosu_crypto.h"
#include "Common/filestream.h"
#include "Common/FileStream.h"
#include <random>
#include <boost/random/uniform_int.hpp>
+468 -8
View File
@@ -1,13 +1,473 @@
project(CemuCafe)
file(GLOB_RECURSE CPP_FILES *.cpp)
file(GLOB_RECURSE H_FILES *.h)
add_library(CemuCafe
Account/Account.cpp
Account/AccountError.h
Account/Account.h
CafeSystem.cpp
CafeSystem.h
Filesystem/fsc.cpp
Filesystem/fscDeviceHostFS.cpp
Filesystem/fscDeviceHostFS.h
Filesystem/fscDeviceRedirect.cpp
Filesystem/fscDeviceWua.cpp
Filesystem/fscDeviceWud.cpp
Filesystem/fsc.h
Filesystem/FST/FST.cpp
Filesystem/FST/FST.h
Filesystem/FST/fstUtil.h
Filesystem/FST/KeyCache.cpp
Filesystem/FST/KeyCache.h
Filesystem/WUD/wud.cpp
Filesystem/WUD/wud.h
GamePatch.cpp
GamePatch.h
GameProfile/GameProfile.cpp
GameProfile/GameProfile.h
GraphicPack/GraphicPack2.cpp
GraphicPack/GraphicPack2.h
GraphicPack/GraphicPack2PatchesApply.cpp
GraphicPack/GraphicPack2Patches.cpp
GraphicPack/GraphicPack2Patches.h
GraphicPack/GraphicPack2PatchesParser.cpp
GraphicPack/GraphicPackError.h
HW/ACR/ACR.cpp
HW/AI/AI.cpp
HW/AI/AI.h
HW/Common/HwReg.h
HW/Espresso/Const.h
HW/Espresso/Debugger/Debugger.cpp
HW/Espresso/Debugger/Debugger.h
HW/Espresso/Debugger/DebugSymbolStorage.cpp
HW/Espresso/Debugger/DebugSymbolStorage.h
HW/Espresso/EspressoISA.h
HW/Espresso/Interpreter/PPCInterpreterALU.hpp
HW/Espresso/Interpreter/PPCInterpreterFPU.cpp
HW/Espresso/Interpreter/PPCInterpreterHelper.h
HW/Espresso/Interpreter/PPCInterpreterHLE.cpp
HW/Espresso/Interpreter/PPCInterpreterImpl.cpp
HW/Espresso/Interpreter/PPCInterpreterInternal.h
HW/Espresso/Interpreter/PPCInterpreterLoadStore.hpp
HW/Espresso/Interpreter/PPCInterpreterMain.cpp
HW/Espresso/Interpreter/PPCInterpreterOPC.cpp
HW/Espresso/Interpreter/PPCInterpreterOPC.hpp
HW/Espresso/Interpreter/PPCInterpreterPS.cpp
HW/Espresso/Interpreter/PPCInterpreterSPR.hpp
HW/Espresso/PPCCallback.h
HW/Espresso/PPCScheduler.cpp
HW/Espresso/PPCSchedulerLLE.cpp
HW/Espresso/PPCState.h
HW/Espresso/PPCTimer.cpp
HW/Espresso/Recompiler/PPCFunctionBoundaryTracker.h
HW/Espresso/Recompiler/PPCRecompiler.cpp
HW/Espresso/Recompiler/PPCRecompiler.h
HW/Espresso/Recompiler/PPCRecompilerImlAnalyzer.cpp
HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp
HW/Espresso/Recompiler/PPCRecompilerImlGenFPU.cpp
HW/Espresso/Recompiler/PPCRecompilerIml.h
HW/Espresso/Recompiler/PPCRecompilerImlOptimizer.cpp
HW/Espresso/Recompiler/PPCRecompilerImlRanges.cpp
HW/Espresso/Recompiler/PPCRecompilerImlRanges.h
HW/Espresso/Recompiler/PPCRecompilerImlRegisterAllocator2.cpp
HW/Espresso/Recompiler/PPCRecompilerImlRegisterAllocator.cpp
HW/Espresso/Recompiler/PPCRecompilerIntermediate.cpp
HW/Espresso/Recompiler/PPCRecompilerX64AVX.cpp
HW/Espresso/Recompiler/PPCRecompilerX64BMI.cpp
HW/Espresso/Recompiler/PPCRecompilerX64.cpp
HW/Espresso/Recompiler/PPCRecompilerX64FPU.cpp
HW/Espresso/Recompiler/PPCRecompilerX64Gen.cpp
HW/Espresso/Recompiler/PPCRecompilerX64GenFPU.cpp
HW/Espresso/Recompiler/PPCRecompilerX64.h
HW/Espresso/Recompiler/x64Emit.hpp
HW/Latte/Common/RegisterSerializer.cpp
HW/Latte/Common/RegisterSerializer.h
HW/Latte/Common/ShaderSerializer.cpp
HW/Latte/Common/ShaderSerializer.h
HW/Latte/Core/FetchShader.cpp
HW/Latte/Core/FetchShader.h
HW/Latte/Core/LatteAsyncCommands.cpp
HW/Latte/Core/LatteAsyncCommands.h
HW/Latte/Core/LatteBufferCache.cpp
HW/Latte/Core/LatteBufferCache.h
HW/Latte/Core/LatteBufferData.cpp
HW/Latte/Core/LatteCachedFBO.h
HW/Latte/Core/LatteCommandProcessor.cpp
HW/Latte/Core/LatteConst.h
HW/Latte/Core/LatteDefaultShaders.cpp
HW/Latte/Core/LatteDefaultShaders.h
HW/Latte/Core/LatteDraw.h
HW/Latte/Core/LatteGSCopyShaderParser.cpp
HW/Latte/Core/Latte.h
HW/Latte/Core/LatteIndices.cpp
HW/Latte/Core/LatteIndices.h
HW/Latte/Core/LatteOverlay.cpp
HW/Latte/Core/LatteOverlay.h
HW/Latte/Core/LattePerformanceMonitor.cpp
HW/Latte/Core/LattePerformanceMonitor.h
HW/Latte/Core/LattePM4.h
HW/Latte/Core/LatteQuery.cpp
HW/Latte/Core/LatteQueryObject.h
HW/Latte/Core/LatteRenderTarget.cpp
HW/Latte/Core/LatteRingBuffer.cpp
HW/Latte/Core/LatteRingBuffer.h
HW/Latte/Core/LatteShaderAssembly.h
HW/Latte/Core/LatteShaderCache.cpp
HW/Latte/Core/LatteShaderCache.h
HW/Latte/Core/LatteShader.cpp
HW/Latte/Core/LatteShaderGL.cpp
HW/Latte/Core/LatteShader.h
HW/Latte/Core/LatteSoftware.cpp
HW/Latte/Core/LatteSoftware.h
HW/Latte/Core/LatteStreamoutGPU.cpp
HW/Latte/Core/LatteSurfaceCopy.cpp
HW/Latte/Core/LatteTextureCache.cpp
HW/Latte/Core/LatteTexture.cpp
HW/Latte/Core/LatteTexture.h
HW/Latte/Core/LatteTextureLegacy.cpp
HW/Latte/Core/LatteTextureLoader.cpp
HW/Latte/Core/LatteTextureLoader.h
HW/Latte/Core/LatteTextureReadback.cpp
HW/Latte/Core/LatteTextureReadbackInfo.h
HW/Latte/Core/LatteTextureView.cpp
HW/Latte/Core/LatteTextureView.h
HW/Latte/Core/LatteThread.cpp
HW/Latte/Core/LatteTiming.cpp
HW/Latte/Core/LatteTiming.h
HW/Latte/ISA/LatteInstructions.h
HW/Latte/ISA/LatteReg.h
HW/Latte/ISA/RegDefines.h
HW/Latte/LatteAddrLib/AddrLibFastDecode.h
HW/Latte/LatteAddrLib/LatteAddrLib_Coord.cpp
HW/Latte/LatteAddrLib/LatteAddrLib.cpp
HW/Latte/LatteAddrLib/LatteAddrLib.h
HW/Latte/LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp
HW/Latte/LegacyShaderDecompiler/LatteDecompiler.cpp
HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLAttrDecoder.cpp
HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp
HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp
HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h
HW/Latte/LegacyShaderDecompiler/LatteDecompilerInstructions.h
HW/Latte/LegacyShaderDecompiler/LatteDecompilerInternal.h
HW/Latte/LegacyShaderDecompiler/LatteDecompilerRegisterDataTypeTracker.cpp
HW/Latte/Renderer/OpenGL/CachedFBOGL.h
HW/Latte/Renderer/OpenGL/LatteTextureGL.cpp
HW/Latte/Renderer/OpenGL/LatteTextureGL.h
HW/Latte/Renderer/OpenGL/LatteTextureViewGL.cpp
HW/Latte/Renderer/OpenGL/LatteTextureViewGL.h
HW/Latte/Renderer/OpenGL/OpenGLQuery.cpp
HW/Latte/Renderer/OpenGL/OpenGLRendererCore.cpp
HW/Latte/Renderer/OpenGL/OpenGLRenderer.cpp
HW/Latte/Renderer/OpenGL/OpenGLRenderer.h
HW/Latte/Renderer/OpenGL/OpenGLRendererStreamout.cpp
HW/Latte/Renderer/OpenGL/OpenGLRendererUniformData.cpp
HW/Latte/Renderer/OpenGL/OpenGLSurfaceCopy.cpp
HW/Latte/Renderer/OpenGL/OpenGLTextureReadback.h
HW/Latte/Renderer/OpenGL/RendererShaderGL.cpp
HW/Latte/Renderer/OpenGL/RendererShaderGL.h
HW/Latte/Renderer/OpenGL/TextureReadbackGL.cpp
HW/Latte/Renderer/Renderer.cpp
HW/Latte/Renderer/Renderer.h
HW/Latte/Renderer/RendererOuputShader.cpp
HW/Latte/Renderer/RendererOuputShader.h
HW/Latte/Renderer/RendererShader.cpp
HW/Latte/Renderer/RendererShader.h
HW/Latte/Renderer/Vulkan/CachedFBOVk.cpp
HW/Latte/Renderer/Vulkan/CachedFBOVk.h
HW/Latte/Renderer/Vulkan/CocoaSurface.h
HW/Latte/Renderer/Vulkan/LatteTextureViewVk.cpp
HW/Latte/Renderer/Vulkan/LatteTextureViewVk.h
HW/Latte/Renderer/Vulkan/LatteTextureVk.cpp
HW/Latte/Renderer/Vulkan/LatteTextureVk.h
HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp
HW/Latte/Renderer/Vulkan/RendererShaderVk.h
HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp
HW/Latte/Renderer/Vulkan/VKRBase.h
HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp
HW/Latte/Renderer/Vulkan/VKRMemoryManager.h
HW/Latte/Renderer/Vulkan/VKRPipelineInfo.cpp
HW/Latte/Renderer/Vulkan/VsyncDriver.cpp
HW/Latte/Renderer/Vulkan/VsyncDriver.h
HW/Latte/Renderer/Vulkan/VulkanAPI.cpp
HW/Latte/Renderer/Vulkan/VulkanAPI.h
HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp
HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.h
HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.cpp
HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.h
HW/Latte/Renderer/Vulkan/VulkanQuery.cpp
HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp
HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp
HW/Latte/Renderer/Vulkan/VulkanRenderer.h
HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp
HW/Latte/Renderer/Vulkan/VulkanTextureReadback.h
HW/Latte/ShaderInfo/ShaderDescription.cpp
HW/Latte/ShaderInfo/ShaderInfo.h
HW/Latte/ShaderInfo/ShaderInstanceInfo.cpp
HW/Latte/Transcompiler/LatteTC.cpp
HW/Latte/Transcompiler/LatteTCGenIR.cpp
HW/Latte/Transcompiler/LatteTC.h
HW/MMU/MMU.cpp
HW/MMU/MMU.h
HW/SI/SI.cpp
HW/SI/si.h
HW/VI/VI.cpp
IOSU/fsa/fsa_types.h
IOSU/fsa/iosu_fsa.cpp
IOSU/fsa/iosu_fsa.h
IOSU/iosu_ipc_common.h
IOSU/iosu_types_common.h
IOSU/kernel/iosu_kernel.cpp
IOSU/kernel/iosu_kernel.h
IOSU/legacy/iosu_acp.cpp
IOSU/legacy/iosu_acp.h
IOSU/legacy/iosu_act.cpp
IOSU/legacy/iosu_act.h
IOSU/legacy/iosu_boss.cpp
IOSU/legacy/iosu_boss.h
IOSU/legacy/iosu_crypto.cpp
IOSU/legacy/iosu_crypto.h
IOSU/legacy/iosu_fpd.cpp
IOSU/legacy/iosu_fpd.h
IOSU/legacy/iosu_ioctl.cpp
IOSU/legacy/iosu_ioctl.h
IOSU/legacy/iosu_mcp.cpp
IOSU/legacy/iosu_mcp.h
IOSU/legacy/iosu_nim.cpp
IOSU/legacy/iosu_nim.h
IOSU/nn/iosu_nn_service.cpp
IOSU/nn/iosu_nn_service.h
IOSU/PDM/iosu_pdm.cpp
IOSU/PDM/iosu_pdm.h
OS/common/OSCommon.cpp
OS/common/OSCommon.h
OS/common/OSUtil.h
OS/common/PPCConcurrentQueue.h
OS/libs/avm/avm.cpp
OS/libs/avm/avm.h
OS/libs/camera/camera.cpp
OS/libs/camera/camera.h
OS/libs/coreinit/coreinit_Alarm.cpp
OS/libs/coreinit/coreinit_Alarm.h
OS/libs/coreinit/coreinit_Atomic.cpp
OS/libs/coreinit/coreinit_Atomic.h
OS/libs/coreinit/coreinit_BSP.cpp
OS/libs/coreinit/coreinit_BSP.h
OS/libs/coreinit/coreinit_Callbacks.cpp
OS/libs/coreinit/coreinit_CodeGen.cpp
OS/libs/coreinit/coreinit_CodeGen.h
OS/libs/coreinit/coreinit_Coroutine.cpp
OS/libs/coreinit/coreinit_Coroutine.h
OS/libs/coreinit/coreinit.cpp
OS/libs/coreinit/coreinit_DynLoad.cpp
OS/libs/coreinit/coreinit_DynLoad.h
OS/libs/coreinit/coreinit_FG.cpp
OS/libs/coreinit/coreinit_FG.h
OS/libs/coreinit/coreinit_FS.cpp
OS/libs/coreinit/coreinit_FS.h
OS/libs/coreinit/coreinit_GHS.cpp
OS/libs/coreinit/coreinit_GHS.h
OS/libs/coreinit/coreinit.h
OS/libs/coreinit/coreinit_HWInterface.cpp
OS/libs/coreinit/coreinit_HWInterface.h
OS/libs/coreinit/coreinit_IM.cpp
OS/libs/coreinit/coreinit_IM.h
OS/libs/coreinit/coreinit_Init.cpp
OS/libs/coreinit/coreinit_IOS.cpp
OS/libs/coreinit/coreinit_IOS.h
OS/libs/coreinit/coreinit_IPCBuf.cpp
OS/libs/coreinit/coreinit_IPCBuf.h
OS/libs/coreinit/coreinit_IPC.cpp
OS/libs/coreinit/coreinit_IPC.h
OS/libs/coreinit/coreinit_LockedCache.cpp
OS/libs/coreinit/coreinit_LockedCache.h
OS/libs/coreinit/coreinit_MCP.cpp
OS/libs/coreinit/coreinit_MCP.h
OS/libs/coreinit/coreinit_MEM_BlockHeap.cpp
OS/libs/coreinit/coreinit_MEM_BlockHeap.h
OS/libs/coreinit/coreinit_MEM.cpp
OS/libs/coreinit/coreinit_MEM_ExpHeap.cpp
OS/libs/coreinit/coreinit_MEM_ExpHeap.h
OS/libs/coreinit/coreinit_MEM_FrmHeap.cpp
OS/libs/coreinit/coreinit_MEM_FrmHeap.h
OS/libs/coreinit/coreinit_MEM.h
OS/libs/coreinit/coreinit_Memory.cpp
OS/libs/coreinit/coreinit_Memory.h
OS/libs/coreinit/coreinit_MemoryMapping.cpp
OS/libs/coreinit/coreinit_MemoryMapping.h
OS/libs/coreinit/coreinit_MEM_UnitHeap.cpp
OS/libs/coreinit/coreinit_MEM_UnitHeap.h
OS/libs/coreinit/coreinit_MessageQueue.cpp
OS/libs/coreinit/coreinit_MessageQueue.h
OS/libs/coreinit/coreinit_Misc.cpp
OS/libs/coreinit/coreinit_Misc.h
OS/libs/coreinit/coreinit_MPQueue.cpp
OS/libs/coreinit/coreinit_MPQueue.h
OS/libs/coreinit/coreinit_OSScreen.cpp
OS/libs/coreinit/coreinit_OSScreen_font.h
OS/libs/coreinit/coreinit_OSScreen.h
OS/libs/coreinit/coreinit_OverlayArena.cpp
OS/libs/coreinit/coreinit_OverlayArena.h
OS/libs/coreinit/coreinit_Scheduler.cpp
OS/libs/coreinit/coreinit_Scheduler.h
OS/libs/coreinit/coreinit_Spinlock.cpp
OS/libs/coreinit/coreinit_Spinlock.h
OS/libs/coreinit/coreinit_Synchronization.cpp
OS/libs/coreinit/coreinit_SysHeap.cpp
OS/libs/coreinit/coreinit_SysHeap.h
OS/libs/coreinit/coreinit_SystemInfo.cpp
OS/libs/coreinit/coreinit_SystemInfo.h
OS/libs/coreinit/coreinit_Thread.cpp
OS/libs/coreinit/coreinit_Thread.h
OS/libs/coreinit/coreinit_ThreadQueue.cpp
OS/libs/coreinit/coreinit_Time.cpp
OS/libs/coreinit/coreinit_Time.h
OS/libs/dmae/dmae.cpp
OS/libs/dmae/dmae.h
OS/libs/drmapp/drmapp.cpp
OS/libs/drmapp/drmapp.h
OS/libs/erreula/erreula.cpp
OS/libs/erreula/erreula.h
OS/libs/gx2/GX2_AddrTest.cpp
OS/libs/gx2/GX2_Blit.cpp
OS/libs/gx2/GX2_Blit.h
OS/libs/gx2/GX2_Command.cpp
OS/libs/gx2/GX2_Command.h
OS/libs/gx2/GX2_ContextState.cpp
OS/libs/gx2/GX2.cpp
OS/libs/gx2/GX2_Draw.cpp
OS/libs/gx2/GX2_Draw.h
OS/libs/gx2/GX2_Event.cpp
OS/libs/gx2/GX2_Event.h
OS/libs/gx2/GX2.h
OS/libs/gx2/GX2_Memory.cpp
OS/libs/gx2/GX2_Memory.h
OS/libs/gx2/GX2_Misc.cpp
OS/libs/gx2/GX2_Misc.h
OS/libs/gx2/GX2_Query.cpp
OS/libs/gx2/GX2_Query.h
OS/libs/gx2/GX2_RenderTarget.cpp
OS/libs/gx2/GX2_Resource.cpp
OS/libs/gx2/GX2_Resource.h
OS/libs/gx2/GX2_Shader.cpp
OS/libs/gx2/GX2_Shader.h
OS/libs/gx2/GX2_shader_legacy.cpp
OS/libs/gx2/GX2_State.cpp
OS/libs/gx2/GX2_State.h
OS/libs/gx2/GX2_Streamout.cpp
OS/libs/gx2/GX2_Streamout.h
OS/libs/gx2/GX2_Surface_Copy.cpp
OS/libs/gx2/GX2_Surface_Copy.h
OS/libs/gx2/GX2_Surface.cpp
OS/libs/gx2/GX2_Surface.h
OS/libs/gx2/GX2_Texture.cpp
OS/libs/gx2/GX2_Texture.h
OS/libs/gx2/GX2_TilingAperture.cpp
OS/libs/h264_avc/H264Dec.cpp
OS/libs/h264_avc/h264dec.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/nlibcurl/nlibcurl.cpp
OS/libs/nlibcurl/nlibcurlDebug.hpp
OS/libs/nlibcurl/nlibcurl.h
OS/libs/nlibnss/nlibnss.cpp
OS/libs/nlibnss/nlibnss.h
OS/libs/nn_ac/nn_ac.cpp
OS/libs/nn_ac/nn_ac.h
OS/libs/nn_acp/nn_acp.cpp
OS/libs/nn_acp/nn_acp.h
OS/libs/nn_act/nn_act.cpp
OS/libs/nn_act/nn_act.h
OS/libs/nn_aoc/nn_aoc.cpp
OS/libs/nn_aoc/nn_aoc.h
OS/libs/nn_boss/nn_boss.cpp
OS/libs/nn_boss/nn_boss.h
OS/libs/nn_ccr/nn_ccr.cpp
OS/libs/nn_ccr/nn_ccr.h
OS/libs/nn_cmpt/nn_cmpt.cpp
OS/libs/nn_cmpt/nn_cmpt.h
OS/libs/nn_common.h
OS/libs/nn_ec/nn_ec.cpp
OS/libs/nn_ec/nn_ec.h
OS/libs/nn_fp/nn_fp.cpp
OS/libs/nn_fp/nn_fp.h
OS/libs/nn_idbe/nn_idbe.cpp
OS/libs/nn_idbe/nn_idbe.h
OS/libs/nn_ndm/nn_ndm.cpp
OS/libs/nn_ndm/nn_ndm.h
OS/libs/nn_nfp/AmiiboCrypto.h
OS/libs/nn_nfp/nn_nfp.cpp
OS/libs/nn_nfp/nn_nfp.h
OS/libs/nn_nim/nn_nim.cpp
OS/libs/nn_nim/nn_nim.h
OS/libs/nn_olv/nn_olv.cpp
OS/libs/nn_olv/nn_olv.h
OS/libs/nn_pdm/nn_pdm.cpp
OS/libs/nn_pdm/nn_pdm.h
OS/libs/nn_save/nn_save.cpp
OS/libs/nn_save/nn_save.h
OS/libs/nn_temp/nn_temp.cpp
OS/libs/nn_temp/nn_temp.h
OS/libs/nn_uds/nn_uds.cpp
OS/libs/nn_uds/nn_uds.h
OS/libs/nsyshid/nsyshid.cpp
OS/libs/nsyshid/nsyshid.h
OS/libs/nsyskbd/nsyskbd.cpp
OS/libs/nsyskbd/nsyskbd.h
OS/libs/nsysnet/nsysnet.cpp
OS/libs/nsysnet/nsysnet.h
OS/libs/padscore/padscore.cpp
OS/libs/padscore/padscore.h
OS/libs/proc_ui/proc_ui.cpp
OS/libs/proc_ui/proc_ui.h
OS/libs/snd_core/ax_aux.cpp
OS/libs/snd_core/ax_exports.cpp
OS/libs/snd_core/ax.h
OS/libs/snd_core/ax_internal.h
OS/libs/snd_core/ax_ist.cpp
OS/libs/snd_core/ax_mix.cpp
OS/libs/snd_core/ax_multivoice.cpp
OS/libs/snd_core/ax_out.cpp
OS/libs/snd_core/ax_voice.cpp
OS/libs/snd_user/snd_user.cpp
OS/libs/snd_user/snd_user.h
OS/libs/swkbd/swkbd.cpp
OS/libs/swkbd/swkbd.h
OS/libs/sysapp/sysapp.cpp
OS/libs/sysapp/sysapp.h
OS/libs/TCL/TCL.cpp
OS/libs/TCL/TCL.h
OS/libs/vpad/vpad.cpp
OS/libs/vpad/vpad.h
OS/libs/zlib125
OS/libs/zlib125/zlib125.cpp
OS/libs/zlib125/zlib125.h
OS/RPL/elf.cpp
OS/RPL/rpl.cpp
OS/RPL/rpl_debug_symbols.cpp
OS/RPL/rpl_debug_symbols.h
OS/RPL/rpl.h
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
TitleList/SaveList.cpp
TitleList/SaveList.h
TitleList/TitleId.h
TitleList/TitleInfo.cpp
TitleList/TitleInfo.h
TitleList/TitleList.cpp
TitleList/TitleList.h
)
if(APPLE)
file(GLOB_RECURSE MM_FILES *.mm)
add_library(CemuCafe ${CPP_FILES} ${MM_FILES} ${H_FILES})
else()
add_library(CemuCafe ${CPP_FILES} ${H_FILES})
target_sources(CemuCafe PRIVATE "HW/Latte/Renderer/Vulkan/CocoaSurface.mm")
endif()
set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+8 -8
View File
@@ -24,7 +24,7 @@
#include "Cafe/Filesystem/FST/FST.h"
#include "Common/filestream.h"
#include "Common/FileStream.h"
#include "GamePatch.h"
@@ -209,7 +209,7 @@ void InfoLog_TitleLoaded()
fs::path effectiveSavePath = getTitleSavePath();
std::error_code ec;
const bool saveDirExists = fs::exists(effectiveSavePath, ec);
cemuLog_force("Save path: {}{}", _utf8Wrapper(effectiveSavePath), saveDirExists ? "" : " (not present)");
cemuLog_force("Save path: {}{}", _pathToUtf8(effectiveSavePath), saveDirExists ? "" : " (not present)");
// log shader cache name
cemuLog_log(LogType::Force, "Shader cache file: shaderCache/transferable/{:016x}.bin", titleId);
@@ -577,7 +577,7 @@ namespace CafeSystem
const auto file = fsc_open(rpxPath.c_str(), FSC_ACCESS_FLAG::OPEN_FILE | FSC_ACCESS_FLAG::READ_PERMISSION, &status);
if (file)
{
_pathToExecutable = rpxPath;
_pathToExecutable = std::move(rpxPath);
fsc_close(file);
}
}
@@ -617,7 +617,7 @@ namespace CafeSystem
sLaunchModeIsStandalone = true;
cemuLog_log(LogType::Force, "Launching executable in standalone mode due to incorrect layout or missing meta files");
fs::path executablePath = path;
std::string dirName = _utf8Wrapper(executablePath.parent_path().filename());
std::string dirName = _pathToUtf8(executablePath.parent_path().filename());
if (boost::iequals(dirName, "code"))
{
// check for content folder
@@ -626,18 +626,18 @@ namespace CafeSystem
if (fs::is_directory(contentPath, ec))
{
// mounting content folder
bool r = FSCDeviceHostFS_Mount(std::string("/vol/content").c_str(), boost::nowide::widen(_utf8Wrapper(contentPath)).c_str(), FSC_PRIORITY_BASE);
bool r = FSCDeviceHostFS_Mount(std::string("/vol/content").c_str(), _pathToUtf8(contentPath), FSC_PRIORITY_BASE);
if (!r)
{
cemuLog_log(LogType::Force, "Failed to mount {}", _utf8Wrapper(contentPath).c_str());
cemuLog_log(LogType::Force, "Failed to mount {}", _pathToUtf8(contentPath));
return STATUS_CODE::UNABLE_TO_MOUNT;
}
}
}
// mount code folder to a virtual temporary path
FSCDeviceHostFS_Mount(std::string("/internal/code/").c_str(), boost::nowide::widen(_utf8Wrapper(executablePath.parent_path())).c_str(), FSC_PRIORITY_BASE);
FSCDeviceHostFS_Mount(std::string("/internal/code/").c_str(), _pathToUtf8(executablePath.parent_path()), FSC_PRIORITY_BASE);
std::string internalExecutablePath = "/internal/code/";
internalExecutablePath.append(_utf8Wrapper(executablePath.filename()));
internalExecutablePath.append(_pathToUtf8(executablePath.filename()));
_pathToExecutable = internalExecutablePath;
// 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());
+1 -1
View File
@@ -1,5 +1,5 @@
#include "Common/precompiled.h"
#include "Common/filestream.h"
#include "Common/FileStream.h"
#include "Cemu/ncrypto/ncrypto.h"
#include "Cafe/Filesystem/WUD/wud.h"
#include "util/crypto/aes128.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include "config/ActiveSettings.h"
#include "util/crypto/aes128.h"
#include "Common/filestream.h"
#include "Common/FileStream.h"
#include "util/helpers/StringHelpers.h"
std::mutex mtxKeyCache;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,7 +2,7 @@
#include <string.h>
#include <stdlib.h>
#include "wud.h"
#include "Common/filestream.h"
#include "Common/FileStream.h"
wud_t* wud_open(const fs::path& path)
{
+48 -143
View File
@@ -1,14 +1,15 @@
#include "Cafe/Filesystem/fsc.h"
#include "Cafe/Filesystem/FST/fstUtil.h"
struct FSCMountPathNode
{
std::string path;
std::vector<FSCMountPathNode*> subnodes;
FSCMountPathNode* parent;
// device target and path (if list_subnodes is nullptr)
// device target and path (if subnodes is empty)
fscDeviceC* device{ nullptr };
void* ctx{ nullptr };
std::wstring targetPath;
std::string deviceTargetPath; // the destination base path for the device, utf8
// priority
sint32 priority{};
@@ -24,7 +25,7 @@ struct FSCMountPathNode
}
};
// compare two file or directory names using FS rules
// compare two file or directory names using FSA rules
bool FSA_CompareNodeName(std::string_view a, std::string_view b)
{
if (a.size() != b.size())
@@ -74,25 +75,25 @@ void fsc_reset()
* /vol/content/data -> Map to HostFS
* If overlapping paths with different priority are created, then the higher priority one will be checked first
*/
FSCMountPathNode* fsc_createMountPath(CoreinitFSParsedPath* parsedMountPath, sint32 priority)
FSCMountPathNode* fsc_createMountPath(const FSCPath& mountPath, sint32 priority)
{
cemu_assert(priority >= 0 && priority < FSC_PRIORITY_COUNT);
fscEnter();
FSCMountPathNode* nodeParent = s_fscRootNodePerPrio[priority];
for(sint32 i=0; i<parsedMountPath->numNodes; i++)
for (size_t i=0; i< mountPath.GetNodeCount(); i++)
{
// search for subdirectory
FSCMountPathNode* nodeSub = nullptr; // set if we found a subnode with a matching name, else this is used to store the new nodes
for(auto& nodeItr : nodeParent->subnodes)
for (auto& nodeItr : nodeParent->subnodes)
{
if( coreinitFS_checkNodeName(parsedMountPath, i, nodeItr->path.c_str()) )
if (mountPath.MatchNodeName(i, nodeItr->path))
{
// subnode found
nodeSub = nodeItr;
break;
}
}
if( nodeSub )
if (nodeSub)
{
// traverse subnode
nodeParent = nodeSub;
@@ -100,10 +101,10 @@ FSCMountPathNode* fsc_createMountPath(CoreinitFSParsedPath* parsedMountPath, sin
}
// no matching subnode, add new entry
nodeSub = new FSCMountPathNode(nodeParent);
nodeSub->path = coreinitFS_getNodeName(parsedMountPath, i);
nodeSub->path = mountPath.GetNodeName(i);
nodeSub->priority = priority;
nodeParent->subnodes.emplace_back(nodeSub);
if( i == (parsedMountPath->numNodes-1) )
if (i == (mountPath.GetNodeCount() - 1))
{
// last node
fscLeave();
@@ -114,47 +115,44 @@ FSCMountPathNode* fsc_createMountPath(CoreinitFSParsedPath* parsedMountPath, sin
}
// path is empty or already mounted
fscLeave();
if (parsedMountPath->numNodes == 0)
if (mountPath.GetNodeCount() == 0)
return nodeParent;
return nullptr;
}
// Map a virtual FSC directory to a device and device directory
sint32 fsc_mount(const char* mountPath, const wchar_t* _targetPath, fscDeviceC* fscDevice, void* ctx, sint32 priority)
// Map a virtual FSC directory to a device. targetPath points to the destination base directory within the device
sint32 fsc_mount(std::string_view mountPath, std::string_view targetPath, fscDeviceC* fscDevice, void* ctx, sint32 priority)
{
cemu_assert(fscDevice); // device must not be nullptr
cemu_assert(fscDevice);
std::string mountPathTmp(mountPath);
// make sure the target path ends with a slash
std::wstring targetPath(_targetPath);
if (!targetPath.empty() && (targetPath.back() != '/' && targetPath.back() != '\\'))
targetPath.push_back('/');
std::string targetPathWithSlash(targetPath);
if (!targetPathWithSlash.empty() && (targetPathWithSlash.back() != '/' && targetPathWithSlash.back() != '\\'))
targetPathWithSlash.push_back('/');
// parse mount path
CoreinitFSParsedPath parsedMountPath;
coreinitFS_parsePath(&parsedMountPath, mountPath);
FSCPath parsedMountPath(mountPathTmp);
// register path
fscEnter();
FSCMountPathNode* node = fsc_createMountPath(&parsedMountPath, priority);
FSCMountPathNode* node = fsc_createMountPath(parsedMountPath, priority);
if( !node )
{
// path empty, invalid or already used
cemuLog_log(LogType::Force, "fsc_mount failed (virtual path: %s)", mountPath);
cemuLog_log(LogType::Force, "fsc_mount failed (virtual path: {})", mountPath);
fscLeave();
return FSC_STATUS_INVALID_PATH;
}
node->device = fscDevice;
node->ctx = ctx;
node->targetPath = targetPath;
node->deviceTargetPath = std::move(targetPathWithSlash);
fscLeave();
return FSC_STATUS_OK;
}
bool fsc_unmount(const char* mountPath, sint32 priority)
bool fsc_unmount(std::string_view mountPath, sint32 priority)
{
CoreinitFSParsedPath parsedMountPath;
coreinitFS_parsePath(&parsedMountPath, mountPath);
std::string _tmp(mountPath);
fscEnter();
FSCMountPathNode* mountPathNode = fsc_lookupPathVirtualNode(mountPath, priority);
FSCMountPathNode* mountPathNode = fsc_lookupPathVirtualNode(_tmp.c_str(), priority);
if (!mountPathNode)
{
fscLeave();
@@ -185,21 +183,19 @@ void fsc_unmountAll()
}
// lookup virtual path and find mounted device and relative device directory
bool fsc_lookupPath(const char* path, std::wstring& devicePathOut, fscDeviceC** fscDeviceOut, void** ctxOut, sint32 priority = FSC_PRIORITY_BASE)
bool fsc_lookupPath(const char* path, std::string& devicePathOut, fscDeviceC** fscDeviceOut, void** ctxOut, sint32 priority = FSC_PRIORITY_BASE)
{
// parse path
CoreinitFSParsedPath parsedPath;
coreinitFS_parsePath(&parsedPath, path);
FSCPath parsedPath(path);
FSCMountPathNode* nodeParent = s_fscRootNodePerPrio[priority];
sint32 i;
size_t i;
fscEnter();
for (i = 0; i < parsedPath.numNodes; i++)
for (i = 0; i < parsedPath.GetNodeCount(); i++)
{
// search for subdirectory
FSCMountPathNode* nodeSub = nullptr;
for(auto& nodeItr : nodeParent->subnodes)
{
if (coreinitFS_checkNodeName(&parsedPath, i, nodeItr->path.c_str()))
{
if (parsedPath.MatchNodeName(i, nodeItr->path))
{
nodeSub = nodeItr;
break;
@@ -213,17 +209,17 @@ bool fsc_lookupPath(const char* path, std::wstring& devicePathOut, fscDeviceC**
// no matching subnode
break;
}
// find deepest device mount point
// if the found node is not a device mount point, then travel back towards the root until we find one
while (nodeParent)
{
if (nodeParent->device)
{
devicePathOut = nodeParent->targetPath;
for (sint32 f = i; f < parsedPath.numNodes; f++)
devicePathOut = nodeParent->deviceTargetPath;
for (size_t f = i; f < parsedPath.GetNodeCount(); f++)
{
const char* nodeName = coreinitFS_getNodeName(&parsedPath, f);
devicePathOut.append(boost::nowide::widen(nodeName));
if (f < (parsedPath.numNodes - 1))
auto nodeName = parsedPath.GetNodeName(f);
devicePathOut.append(nodeName);
if (f < (parsedPath.GetNodeCount() - 1))
devicePathOut.push_back('/');
}
*fscDeviceOut = nodeParent->device;
@@ -241,19 +237,16 @@ bool fsc_lookupPath(const char* path, std::wstring& devicePathOut, fscDeviceC**
// lookup path and find virtual device node
FSCMountPathNode* fsc_lookupPathVirtualNode(const char* path, sint32 priority)
{
// parse path
CoreinitFSParsedPath parsedPath;
coreinitFS_parsePath(&parsedPath, path);
FSCPath parsedPath(path);
FSCMountPathNode* nodeCurrentDir = s_fscRootNodePerPrio[priority];
sint32 i;
fscEnter();
for (i = 0; i < parsedPath.numNodes; i++)
for (size_t i = 0; i < parsedPath.GetNodeCount(); i++)
{
// search for subdirectory
FSCMountPathNode* nodeSub = nullptr;
for (auto& nodeItr : nodeCurrentDir->subnodes)
{
if (coreinitFS_checkNodeName(&parsedPath, i, nodeItr->path.c_str()))
if (parsedPath.MatchNodeName(i, nodeItr->path))
{
nodeSub = nodeItr;
break;
@@ -360,11 +353,9 @@ private:
FSCVirtualFile* fsc_open(const char* path, FSC_ACCESS_FLAG accessFlags, sint32* fscStatus, sint32 maxPriority)
{
cemu_assert_debug(HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_FILE) || HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_DIR)); // must open either file or directory
FSCVirtualFile* dirList[FSC_PRIORITY_COUNT];
uint8 dirListCount = 0;
std::wstring devicePath;
std::string devicePath;
fscDeviceC* fscDevice = NULL;
*fscStatus = FSC_STATUS_UNDEFINED;
void* ctx;
@@ -455,7 +446,7 @@ bool fsc_createDir(char* path, sint32* fscStatus)
fscDeviceC* fscDevice = NULL;
*fscStatus = FSC_STATUS_UNDEFINED;
void* ctx;
std::wstring devicePath;
std::string devicePath;
fscEnter();
if( fsc_lookupPath(path, devicePath, &fscDevice, &ctx) )
{
@@ -472,8 +463,8 @@ bool fsc_createDir(char* path, sint32* fscStatus)
*/
bool fsc_rename(char* srcPath, char* dstPath, sint32* fscStatus)
{
std::wstring srcDevicePath;
std::wstring dstDevicePath;
std::string srcDevicePath;
std::string dstDevicePath;
void* srcCtx;
void* dstCtx;
fscDeviceC* fscSrcDevice = NULL;
@@ -492,7 +483,7 @@ bool fsc_rename(char* srcPath, char* dstPath, sint32* fscStatus)
*/
bool fsc_remove(char* path, sint32* fscStatus)
{
std::wstring devicePath;
std::string devicePath;
fscDeviceC* fscDevice = NULL;
*fscStatus = FSC_STATUS_UNDEFINED;
void* ctx;
@@ -691,7 +682,7 @@ bool fsc_doesFileExist(const char* path, sint32 maxPriority)
return true;
}
// helper function to check if a folder exists
// helper function to check if a directory exists
bool fsc_doesDirectoryExist(const char* path, sint32 maxPriority)
{
fscDeviceC* fscDevice = nullptr;
@@ -708,93 +699,7 @@ bool fsc_doesDirectoryExist(const char* path, sint32 maxPriority)
return true;
}
void coreinitFS_parsePath(CoreinitFSParsedPath* parsedPath, const char* path)
{
// if the path starts with a '/', skip it
if (*path == '/')
path++;
// init parsedPath struct
memset(parsedPath, 0x00, sizeof(CoreinitFSParsedPath));
// init parsed path data
size_t pathLength = std::min((size_t)640, strlen(path));
memcpy(parsedPath->pathData, path, pathLength);
// start parsing
sint32 offset = 0;
sint32 startOffset = 0;
if (offset < pathLength)
{
parsedPath->nodeOffset[parsedPath->numNodes] = offset;
parsedPath->numNodes++;
}
while (offset < pathLength)
{
if (parsedPath->pathData[offset] == '/' || parsedPath->pathData[offset] == '\\')
{
parsedPath->pathData[offset] = '\0';
offset++;
// double slashes are ignored and instead are handled like a single slash
if (parsedPath->pathData[offset] == '/' || parsedPath->pathData[offset] == '\\')
{
// if we're in the beginning and having a \\ it's a network path
if (offset != 1)
{
parsedPath->pathData[offset] = '\0';
offset++;
}
}
// start new node
if (parsedPath->numNodes < FSC_PARSED_PATH_NODES_MAX)
{
if (offset < pathLength)
{
parsedPath->nodeOffset[parsedPath->numNodes] = offset;
parsedPath->numNodes++;
}
}
continue;
}
offset++;
}
// handle special nodes like '.' or '..'
sint32 nodeIndex = 0;
while (nodeIndex < parsedPath->numNodes)
{
if (coreinitFS_checkNodeName(parsedPath, nodeIndex, ".."))
cemu_assert_suspicious(); // how does Cafe OS handle .. ?
else if (coreinitFS_checkNodeName(parsedPath, nodeIndex, "."))
{
// remove this node and shift back all following nodes by 1
parsedPath->numNodes--;
for (sint32 i = nodeIndex; i < parsedPath->numNodes; i++)
{
parsedPath->nodeOffset[i] = parsedPath->nodeOffset[i + 1];
}
// continue without increasing nodeIndex
continue;
}
nodeIndex++;
}
}
bool coreinitFS_checkNodeName(CoreinitFSParsedPath* parsedPath, sint32 index, const char* name)
{
if (index < 0 || index >= parsedPath->numNodes)
return false;
char* nodeName = parsedPath->pathData + parsedPath->nodeOffset[index];
if (boost::iequals(nodeName, name))
return true;
return false;
}
char* coreinitFS_getNodeName(CoreinitFSParsedPath* parsedPath, sint32 index)
{
if (index < 0 || index >= parsedPath->numNodes)
return nullptr;
return parsedPath->pathData + parsedPath->nodeOffset[index];
}
// Initialize Cemu's virtual filesystem
// initialize Cemu's virtual filesystem
void fsc_init()
{
fsc_reset();

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