Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/deploy_flatpak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build Flatpak
on: [push,pull_request]

jobs:
flatpak:
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Cache Flatpak Dependencies
uses: actions/cache@v4
with:
path: .flatpak-builder
key: flatpak-builder-${{ hashFiles('io.github.skylersaleh.SkyEmu.yml') }}
restore-keys: |
flatpak-builder-
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: SkyEmu.flatpak
manifest-path: flatpak/io.github.skylersaleh.SkyEmu.yml
run-tests: false
cache: false
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ option(USE_SYSTEM_CURL "Use the system's libcurl package" OFF)
option(USE_SYSTEM_OPENSSL "Use the system's OpenSSL package" OFF)
option(USE_SYSTEM_SDL2 "Use the system's SDL2 package" OFF)
option(RETRO_CORE_ONLY "Only build libretro core" OFF)
option(PLATFORM_FLATPAK "Build with customizations for Flatpak (forces writes to Flatpak sandbox)" OFF)

if(PLATFORM_FLATPAK)
add_definitions(-DSE_PLATFORM_FLATPAK=1)
endif()

if (EMSCRIPTEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ELIMINATE\_DUPLICATE\_FUNCTIONS=1 -s ENVIRONMENT=web -s ASSERTIONS=0 -s WASM=1 -DSE_PLATFORM_WEB --shell-file ${PROJECT_SOURCE_DIR}/src/shell.html -s USE_CLOSURE_COMPILER=0 ")
Expand Down
Binary file added flatpak/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions flatpak/io.github.skylersaleh.SkyEmu.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=SkyEmu
Comment=GB, GBC, GBA, and DS Emulator
Exec=skyemu-wrapper.sh
Icon=io.github.skylersaleh.SkyEmu
Categories=Game;Emulator;
Terminal=false
31 changes: 31 additions & 0 deletions flatpak/io.github.skylersaleh.SkyEmu.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.skylersaleh.SkyEmu</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<name>SkyEmu</name>
<developer_name>SkyEmu Developers</developer_name>
<summary>GB, GBC, GBA, and DS Emulator</summary>
<description>
<p>SkyEmu is a low level GameBoy, GameBoy Color, Game Boy Advance, and DS emulator. Its primary focus is to preserve these great systems for future generations while providing a good user experience through a good mixture of tradeoffs of accuracy, performance, features and usability.</p>
</description>
<launchable type="desktop-id">io.github.skylersaleh.SkyEmu.desktop</launchable>
<url type="homepage">https://github.com/skylersaleh/SkyEmu</url>
<url type="bugtracker">https://github.com/skylersaleh/SkyEmu/issues</url>
<url type="contact">https://discord.gg/tnUEtmJgA5</url>
<screenshots>
<screenshot type="default"><caption>A screenshot of SkyEmu running on different platform.</caption><image>https://raw.githubusercontent.com/TheRealYasri/io.github.skylersaleh.SkyEmu/refs/heads/TheRealYasri-patch-1/image1.png</image></screenshot>
</screenshots>
<releases>

<release version="v5" date="2026-02-11">
<url>https://github.com/skylersaleh/SkyEmu/releases/tag/v5</url>
</release>

</releases>
<categories>
<category>Game</category>
<category>Emulator</category>
</categories>
</component>

135 changes: 135 additions & 0 deletions flatpak/io.github.skylersaleh.SkyEmu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions flatpak/io.github.skylersaleh.SkyEmu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
app-id: io.github.skylersaleh.SkyEmu
runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
command: skyemu-wrapper.sh
finish-args:
- --share=network
- --socket=fallback-x11
- --socket=pulseaudio
- --device=all
- --filesystem=/mnt:ro
- --filesystem=/media:ro
- --filesystem=/run/media:ro
- --filesystem=home:ro

modules:
- name: SkyEmu
buildsystem: cmake
builddir: true
config-opts:
- -DPLATFORM_FLATPAK=ON
sources:
- type: git
url: https://github.com/skylersaleh/SkyEmu.git
tag: v5
commit: 46efbcbdb3b902373a09f4724e6d3b1a5acc4af3
- type: file
path: io.github.skylersaleh.SkyEmu.metainfo.xml
- type: file
path: io.github.skylersaleh.SkyEmu.desktop
- type: file
path: io.github.skylersaleh.SkyEmu.svg
- type: file
path: search_paths.bin
- type: file
path: user_settings.bin
- type: file
path: skyemu-wrapper.sh
post-install:
- install -Dm644 ../io.github.skylersaleh.SkyEmu.metainfo.xml /app/share/metainfo/io.github.skylersaleh.SkyEmu.metainfo.xml
- install -Dm644 ../io.github.skylersaleh.SkyEmu.desktop /app/share/applications/io.github.skylersaleh.SkyEmu.desktop
- install -Dm644 ../io.github.skylersaleh.SkyEmu.svg /app/share/icons/hicolor/scalable/apps/io.github.skylersaleh.SkyEmu.svg
- install -Dm644 ../search_paths.bin /app/share/skyemu/search_paths.bin
- install -Dm644 ../user_settings.bin /app/share/skyemu/user_settings.bin
- install -Dm755 ../skyemu-wrapper.sh /app/bin/skyemu-wrapper.sh








5 changes: 5 additions & 0 deletions flatpak/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
io.github.skylersaleh.SkyEmu.yml
- update version to download

io.github.skylersaleh.SkyEmu.metainfo.xml
- update release version info
Binary file added flatpak/search_paths.bin
Binary file not shown.
22 changes: 22 additions & 0 deletions flatpak/skyemu-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Define the target directory inside the sandbox
DATA_DIR="$XDG_DATA_HOME/Sky/SkyEmu"

# Create the directory if it doesn't exist
mkdir -p "$DATA_DIR"
mkdir -p "$DATA_DIR/saves"
mkdir -p "$DATA_DIR/cheats"
mkdir -p "$DATA_DIR/bios"

# Copy the modified default config file if it's not already there
if [ ! -f "$DATA_DIR/search_paths.bin" ]; then
cp /app/share/skyemu/search_paths.bin "$DATA_DIR/search_paths.bin"
fi

if [ ! -f "$DATA_DIR/user_settings.bin" ]; then
cp /app/share/skyemu/user_settings.bin "$DATA_DIR/user_settings.bin"
fi

# Launch the actual program
cd "$DATA_DIR"
exec /app/bin/SkyEmu "$@"
Binary file added flatpak/user_settings.bin
Binary file not shown.
16 changes: 12 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,10 @@ void se_load_rom(const char *filename){
se_reset_bios_info();
emu_state.force_dmg_mode=gui_state.settings.force_dmg_mode;
//Compute Save File Path
bool force_writes_to_paths = false;
#ifdef SE_PLATFORM_FLATPAK
force_writes_to_paths = true;
#endif
{
char *save_file=emu_state.save_file_path;
save_file[0] = '\0';
Expand All @@ -2463,13 +2467,13 @@ void se_load_rom(const char *filename){
se_join_path(emu_state.save_data_base_path, SB_FILE_PATH_SIZE, base, c, NULL);
#endif
snprintf(save_file, SB_FILE_PATH_SIZE, "%s.sav",emu_state.save_data_base_path);
if(!sb_file_exists(save_file)){
if(!sb_file_exists(save_file)||force_writes_to_paths){
const char* base, *c, *ext;
sb_breakup_path(filename,&base, &c, &ext);
char tmp_path[SB_FILE_PATH_SIZE];
se_join_path(tmp_path,SB_FILE_PATH_SIZE,gui_state.paths.save,c,".sav");

if(sb_file_exists(tmp_path)||gui_state.settings.save_to_path){
if(sb_file_exists(tmp_path)||gui_state.settings.save_to_path||force_writes_to_paths){
se_join_path(emu_state.save_data_base_path,SB_FILE_PATH_SIZE,gui_state.paths.save,c,NULL);
strncpy(save_file,tmp_path,SB_FILE_PATH_SIZE);
}
Expand All @@ -2482,12 +2486,12 @@ void se_load_rom(const char *filename){
const char* base, *c, *ext;
sb_breakup_path(filename,&base, &c, &ext);
snprintf(cheat_path, SB_FILE_PATH_SIZE, "%s.code",emu_state.save_data_base_path);
if(!sb_file_exists(cheat_path)){
if(!sb_file_exists(cheat_path)||force_writes_to_paths){
const char* base, *c, *ext;
sb_breakup_path(filename,&base, &c, &ext);
char tmp_path[SB_FILE_PATH_SIZE];
se_join_path(tmp_path,SB_FILE_PATH_SIZE,gui_state.paths.cheat_codes,c,".code");
if(sb_file_exists(tmp_path)||gui_state.settings.save_to_path){
if(sb_file_exists(tmp_path)||gui_state.settings.save_to_path||force_writes_to_paths){
strncpy(cheat_path,tmp_path,SB_FILE_PATH_SIZE);
}
}
Expand Down Expand Up @@ -6503,9 +6507,13 @@ void se_draw_menu_panel(){
se_input_path("Save File/State Path", gui_state.paths.save,ImGuiInputTextFlags_None);
se_input_path("BIOS/Firmware Path", gui_state.paths.bios,ImGuiInputTextFlags_None);
se_input_path("Cheat Code Path", gui_state.paths.cheat_codes,ImGuiInputTextFlags_None);
#ifndef SE_PLATFORM_FLATPAK
bool save_to_path=gui_state.settings.save_to_path;
se_checkbox("Create new files in paths",&save_to_path);
gui_state.settings.save_to_path=save_to_path;
#else
gui_state.settings.save_to_path = true;
#endif
if(memcmp(&gui_state.last_saved_paths, &gui_state.paths,sizeof(gui_state.paths))){
se_save_search_paths();
gui_state.last_saved_paths=gui_state.paths;
Expand Down