Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
54f043c
Util: Add fcontext fiber implementation
SSimco May 9, 2026
e43871f
swkbd: add swkbd callbacks & refactor
SSimco May 9, 2026
7d04612
UI: use atomics for window handle display/surface
SSimco May 9, 2026
bd076fe
audio: add method for setting audio delay
SSimco May 9, 2026
9f72963
coreinit: add pause/resume functionality
SSimco May 9, 2026
7157325
build: add CMake & vcpkg support for Android
SSimco May 9, 2026
42b2aac
cpu_features: add cpu brand name retrieval for Linux/Android AArch64
SSimco May 9, 2026
e75d2fe
common: refactor FileStream & implement Android filesystem access
SSimco May 9, 2026
ee17e2b
ExceptionHandler: add Android support for stack trace
SSimco May 9, 2026
e3d0443
Vulkan: add decoders that uncompress BCn textures
SSimco May 9, 2026
03e1aab
Vulkan: conditionally enable renderer features
SSimco May 9, 2026
4f64e11
Vulkan: implement Android surface & recreation
SSimco May 9, 2026
6705714
Vulkan: add support for custom drivers on android
SSimco May 9, 2026
8f0feef
ih264d: remove android logging
SSimco May 9, 2026
1d9bdd9
input: add methods to override button and axis values
SSimco May 9, 2026
b9febc4
GameProfile: Refactor encapsulation and controller profile accessors
SSimco Apr 23, 2026
8b1f104
cafe: log android platform
SSimco May 9, 2026
43d3766
input: add android input APIs
SSimco May 9, 2026
f0ebba6
android: add android app
SSimco Apr 23, 2026
d79373e
ci: add job for building android app
SSimco May 9, 2026
7c2324e
docs: add Android build steps & Kotlin coding style
SSimco May 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 43 additions & 0 deletions .github/actions/set-up-vcpkg-binary-cache-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Set up a vcpkg binary cache

description: Bootstraps vcpkg and configures GitHub Packages as a binary cache.

inputs:
github-token:
description: Token for authenticating with GitHub Packages
required: true

runs:
using: composite
steps:
- name: Bootstrap vcpkg
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./dependencies/vcpkg/bootstrap-vcpkg.bat
else
bash ./dependencies/vcpkg/bootstrap-vcpkg.sh
fi

- name: Setup NuGet Credentials for vcpkg
shell: bash
run: |
function vcpkg_nuget() {
if [ "$RUNNER_OS" == "Windows" ]; then
$(./dependencies/vcpkg/vcpkg.exe fetch nuget | tail -n 1) "$@"
else
mono $(./dependencies/vcpkg/vcpkg fetch nuget | tail -n 1) "$@"
fi
}

vcpkg_nuget \
sources add \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ inputs.github-token }}"

vcpkg_nuget \
setapikey "${{ inputs.github-token }}" \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
130 changes: 79 additions & 51 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ on:
required: false
type: string

secrets:
android_store_file_base64:
required: false
android_key_store_password:
required: false
android_key_alias:
required: false

env:
VCPKG_ROOT: "${{github.workspace}}/dependencies/vcpkg"
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
Expand Down Expand Up @@ -53,23 +61,10 @@ jobs:
sudo apt update -qq
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: "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: Setup vcpkg binary cache
uses: ./.github/actions/set-up-vcpkg-binary-cache-action
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: "cmake"
run: |
Expand Down Expand Up @@ -152,23 +147,10 @@ jobs:
with:
cmake-version: '3.29.0'

- name: "Bootstrap vcpkg"
run: |
./dependencies/vcpkg/bootstrap-vcpkg.bat

- name: 'Setup NuGet Credentials for vcpkg'
shell: 'bash'
run: |
`./dependencies/vcpkg/vcpkg.exe 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 }}"
`./dependencies/vcpkg/vcpkg.exe fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Setup vcpkg binary cache
uses: ./.github/actions/set-up-vcpkg-binary-cache-action
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: "cmake"
run: |
Expand Down Expand Up @@ -248,23 +230,10 @@ jobs:
with:
cmake-version: '3.29.0'

- 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: Setup vcpkg binary cache
uses: ./.github/actions/set-up-vcpkg-binary-cache-action
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: "cmake"
run: |
Expand Down Expand Up @@ -297,3 +266,62 @@ jobs:
with:
name: cemu-bin-macos-${{ matrix.arch }}
path: ./bin/Cemu.dmg

build-android:
runs-on: ubuntu-24.04

steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
submodules: "recursive"
fetch-depth: 0

- name: Install system dependencies
run: |
sudo apt update -qq
sudo apt install -y gettext mono-complete

- name: Uncompile message catalogs
run: |
for mo_file in bin/resources/*/cemu.mo
do
echo $mo_file
language_code=$(basename $(dirname $mo_file))
po_file=src/android/app/src/main/assets/translations/$language_code/cemu.po
mkdir -p $(dirname $po_file)
msgunfmt $mo_file -o $po_file || echo "Failed to uncompile message catalog from $mo_file"
done

- name: Setup vcpkg binary cache
uses: ./.github/actions/set-up-vcpkg-binary-cache-action
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Build Cemu
env:
ANDROID_STORE_FILE_BASE64: ${{ secrets.android_store_file_base64 }}
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.android_key_store_password }}
ANDROID_KEY_ALIAS: ${{ secrets.android_key_alias }}
EMULATOR_VERSION_MAJOR: ${{ inputs.next_version_major }}
EMULATOR_VERSION_MINOR: ${{ inputs.next_version_minor }}
run: |
export JAVA_HOME=$JAVA_HOME_21_X64

cd ./src/android

if [[ -n "$ANDROID_STORE_FILE_BASE64" ]]; then
base64 --decode <<< "${ANDROID_STORE_FILE_BASE64}" > store.jks
export ANDROID_STORE_FILE=$(pwd)/store.jks
echo "Android signing store file has been set up."
else
echo "No Android signing store file provided. The APK will not be signed with a release key."
fi

./gradlew assembleRelease

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cemu-bin-android
path: ./src/android/app/build/outputs/apk/*/*.apk
7 changes: 7 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
call-release-build:
uses: ./.github/workflows/build.yml
needs: calculate-version
secrets:
android_store_file_base64: ${{ secrets.ANDROID_STORE_FILE_BASE64 }}
android_key_store_password: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
android_key_alias: ${{ secrets.ANDROID_KEY_ALIAS }}
with:
next_version_major: ${{ needs.calculate-version.outputs.next_version_major }}
next_version_minor: ${{ needs.calculate-version.outputs.next_version_minor }}
Expand Down Expand Up @@ -152,6 +156,9 @@ jobs:
cp $bin_dir/Cemu.dmg ../upload/cemu-${{ env.CEMU_VERSION }}-macos-12-$arch.dmg
done

- name: Create release from android-bin
run: cp cemu-bin-android/*.apk upload/cemu-${{ env.CEMU_VERSION }}.apk

- 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
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "dependencies/xbyak_aarch64"]
path = dependencies/xbyak_aarch64
url = https://github.com/fujitsu/xbyak_aarch64
[submodule "dependencies/libadrenotools"]
path = dependencies/libadrenotools
url = https://github.com/bylaws/libadrenotools
11 changes: 11 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [Installing Tool Dependencies](#installing-tool-dependencies)
- [Installing Library Dependencies](#installing-library-dependencies)
- [Build Cemu using CMake](#build-cemu-using-cmake)
- [Android](#android)
- [FreeBSD](#freebsd)
- [Installing Dependencies](#installing-dependencies)
- [Build Cemu on BSD with CMake](#build-cemu-on-bsd-with-cmake)
Expand Down Expand Up @@ -198,6 +199,16 @@ Alternatively, you can use the non-privateapi version of MoltenVK, but you may e
- **On an Apple Silicon Mac:** `-DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja`
- **On an Intel Mac:** `-DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja`

## Android
Prerequisites:
- git
- [Android studio](https://developer.android.com/studio)

Instructions:
1. Run `git clone --recursive https://github.com/cemu-project/Cemu`
2. Open the project located in `src/android` in Android Studio
3. Click Build > Make Project

## FreeBSD

The following instructions to build Cemu on FreeBSD are experimental. Some features available on other platforms are not available on FreeBSD (discord rich presence, bluetooth/support for actual Wii U controllers, auto-updates, etc.)
Expand Down
39 changes: 32 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21.1)
cmake_minimum_required(VERSION 3.25)

option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
option(MACOS_BUNDLE "The executable when built on macOS will be created as an application bundle" OFF)
Expand Down Expand Up @@ -38,15 +38,30 @@ if (ENABLE_VCPKG)
)
endif()

if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT VCPKG_TARGET_ANDROID)
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_linux;${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports")
elseif(APPLE)
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_mac;${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports")
else()
elseif(WIN32)
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_win;${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports")
elseif(VCPKG_TARGET_ANDROID)
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")

if(VCPKG_TARGET_ANDROID)
message("Configuring for Android with ABI ${ANDROID_ABI}")
if(ANDROID_ABI MATCHES "arm64-v8a")
set(VCPKG_TARGET_TRIPLET "arm64-android" CACHE STRING "" FORCE)
elseif(ANDROID_ABI MATCHES "x86_64")
set(VCPKG_TARGET_TRIPLET "x64-android" CACHE STRING "" FORCE)
else()
message(FATAL_ERROR "Unsupported ANDROID_ABI '${ANDROID_ABI}'")
endif()
set(ENV{ANDROID_NDK_HOME} ${ANDROID_NDK})
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${ANDROID_NDK}/build/cmake/android.toolchain.cmake)
endif()

set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake")
# Set this so that all the various find_package() calls don't need an explicit
# CONFIG option
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
Expand Down Expand Up @@ -154,6 +169,9 @@ find_package(CURL REQUIRED)
find_package(pugixml REQUIRED)
find_package(RapidJSON REQUIRED)
find_package(Boost COMPONENTS program_options filesystem nowide REQUIRED)
if(ANDROID)
find_package(Boost COMPONENTS context iostreams REQUIRED)
endif()
find_package(libzip REQUIRED)
find_package(glslang REQUIRED)
find_package(ZLIB REQUIRED)
Expand All @@ -173,7 +191,7 @@ if (NOT TARGET glslang::SPIRV AND TARGET SPIRV)
add_library(glslang::SPIRV ALIAS SPIRV)
endif()

if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND NOT ANDROID)
find_package(X11 REQUIRED)
if (ENABLE_WAYLAND)
find_package(Wayland REQUIRED Client)
Expand Down Expand Up @@ -224,7 +242,7 @@ if (ENABLE_HIDAPI)
add_compile_definitions(HAS_HIDAPI)
endif ()

if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT ANDROID)
if(ENABLE_FERAL_GAMEMODE)
add_compile_definitions(ENABLE_FERAL_GAMEMODE)
add_subdirectory(dependencies/gamemode EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -268,4 +286,11 @@ if (NOT ZArchive_FOUND)
add_subdirectory("dependencies/ZArchive" EXCLUDE_FROM_ALL)
endif()

if(ANDROID)
if(CEMU_ARCHITECTURE MATCHES "(aarch64)|(AARCH64)")
add_subdirectory("dependencies/libadrenotools" EXCLUDE_FROM_ALL)
endif()
add_subdirectory("dependencies/stb" EXCLUDE_FROM_ALL)
endif()

add_subdirectory(src)
4 changes: 3 additions & 1 deletion CODING_STYLE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

# 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.
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.

These coding-style guidelines apply only to the C/C++ codebase. For Kotlin, we follow the official Kotlin Coding Conventions as outlined in the [Kotlin documentation](https://kotlinlang.org/docs/coding-conventions.html).

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.

Expand Down
8 changes: 1 addition & 7 deletions dependencies/ih264d/decoder/ih264d_dpb_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
*****************************************************************************
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#ifdef __ANDROID__
#include <log/log.h>
#endif

#include "ih264_typedefs.h"
#include "ih264_macros.h"
#include "ih264_platform_macros.h"
Expand Down Expand Up @@ -902,10 +900,6 @@ WORD32 ih264d_read_mmco_commands(struct _DecStruct * ps_dec)
{
if (j >= MAX_REF_BUFS)
{
#ifdef __ANDROID__
ALOGE("b/25818142");
android_errorWriteLog(0x534e4554, "25818142");
#endif
ps_dpb_cmds->u1_num_of_commands = 0;
return -1;
}
Expand Down
1 change: 1 addition & 0 deletions dependencies/libadrenotools
Submodule libadrenotools added at 8fae8c
7 changes: 7 additions & 0 deletions dependencies/stb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.25)

project(stb LANGUAGES C)

add_library(stb INTERFACE)

target_include_directories(stb INTERFACE include)
Loading
Loading