Skip to content
Closed
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
37 changes: 37 additions & 0 deletions .github/workflows/deploy_arm64_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Linux Arm64
on: [push, pull_request]
jobs:
build-and-deploy:
runs-on: ubuntu-22.04-arm
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev
sudo apt-get install -y libgl1-mesa-dev libegl1-mesa-dev libasound2-dev
- name: Configure & Build 🔧
run: |
mkdir build
cd build
cmake .. -DUSE_GLES2=ON && cmake --build .

- name: GH Release 🚀
# You may pin to the exact commit or the version.
uses: actions/upload-artifact@v4
with:
name: LinuxArm64Release
path: build/bin/
#uses: softprops/action-gh-release@v0.1.5
#with:
# # Note-worthy description of changes in release
# # body: # optional
# # Path to load note-worthy description of changes in release from
# # body_path: # optional
# # Gives the release a custom name. Defaults to tag name
# name: LinuxRelease
# # Identify the release as a prerelease. Defaults to false
# prerelease: True
# # Newline-delimited list of path globs for asset files to upload
# files: build/bin/*
13 changes: 6 additions & 7 deletions .github/workflows/deploy_linux.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Build Linux
on: [push,pull_request]
on: [push, pull_request]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.3.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev
sudo apt-get install -y libgl1-mesa-dev libegl1-mesa-dev libasound2-dev
- name: Configure & Build 🔧
- name: Configure & Build 🔧
run: |
mkdir build
cd build
cmake .. && cmake --build .

- name: GH Release 🚀
# You may pin to the exact commit or the version.
uses: actions/upload-artifact@v4
with:
name: LinuxRelease
path: build/bin/
name: LinuxRelease
path: build/bin/
#uses: softprops/action-gh-release@v0.1.5
#with:
# # Note-worthy description of changes in release
Expand All @@ -35,4 +35,3 @@ jobs:
# prerelease: True
# # Newline-delimited list of path globs for asset files to upload
# files: build/bin/*

67 changes: 51 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.15) # Needed to set MSVC Runtime type
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)

if(APPLE AND (NOT IOS) AND (NOT ANDROID))
Expand All @@ -14,6 +15,9 @@ else()
project(SkyEmu C CXX)
endif()

if(UNIX AND NOT APPLE AND (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64"))
set(SE_PLATFORM_ARM64_LINUX 1)
endif()

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
Expand All @@ -28,6 +32,9 @@ 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(USE_GLES3 "Use OpenGLES3" OFF)
option(USE_GLES2 "Use OpenGLES2" OFF)

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 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_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 All @@ -49,7 +56,7 @@ if (MSVC)
# No secure development lifecycle features
# Exception handling model: Catch C++ exceptions only, assume that "extern C" functions will never throw a C++ exception.
# Disable all forms of MSVC debug iterator checking in new and old Visual Studios.
# Causes the application to use the multithread, static version of the run-time library.
# Causes the application to use the multithread, static version of the run-time library.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT /Ox /Ob2 /Oi /Ot /GT /GF /GS- /fp:fast /fp:except- /MP /sdl- /EHsc /D_SECURE_SCL=0 /D_SCL_SECURE_NO_WARNINGS /D_ITERATOR_DEBUG_LEVEL=0 /D_HAS_ITERATOR_DEBUGGING=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT /Ox /Ob2 /Oi /Ot /GT /GF /GS- /fp:fast /fp:except- /MP /sdl- /EHsc /D_SECURE_SCL=0 /D_SCL_SECURE_NO_WARNINGS /D_ITERATOR_DEBUG_LEVEL=0 /D_HAS_ITERATOR_DEBUGGING=0 ")

Expand All @@ -64,9 +71,9 @@ if (NOT EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ")
set(UNICODE_GUI 1)
else ()
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG")
endif ()
if(IOS)
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum iOS deployment version" FORCE)
Expand All @@ -79,11 +86,17 @@ if(WIN32)
endif()
if(ANDROID)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT IOS)
find_package(OpenGL)
if(SE_PLATFORM_ARM64_LINUX AND USE_GLES3)
# For Raspberry Pi, use OpenGLES
find_package(OpenGLES REQUIRED)
else()
# For other platforms, use regular OpenGL
find_package(OpenGL)
endif()
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

Expand All @@ -93,6 +106,15 @@ if ((CMAKE_SYSTEM_NAME STREQUAL Linux) AND NOT EMSCRIPTEN AND NOT ANDROID)
find_package(Threads REQUIRED)
find_package(ALSA REQUIRED)
set(SE_PLATFORM_LINUX TRUE)

# GLES3 support on the Raspberry Pi
if (SE_PLATFORM_ARM64_LINUX AND USE_GLES3)
set(SE_FORCE_GLES3 TRUE)
add_definitions(-DSE_FORCE_GLES3=1)
elseif (SE_PLATFORM_ARM64_LINUX AND USE_GLES2)
set(SE_FORCE_GLES2 TRUE)
add_definitions(-DSE_FORCE_GLES2=1)
endif()
add_definitions(-DSE_PLATFORM_LINUX=1)
endif()
if (UNIX AND NOT APPLE AND NOT SE_PLATFORM_LINUX AND NOT EMSCRIPTEN AND NOT ANDROID)
Expand Down Expand Up @@ -148,8 +170,8 @@ endif()
# TinyFileDialogs
if ((NOT IOS) AND (NOT EMSCRIPTEN) AND (NOT ANDROID) AND (NOT SE_PLATFORM_LINUX) AND (NOT SE_PLATFORM_FREEBSD))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_TINY_FILE_DIALOGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_TINY_FILE_DIALOGS")
add_library(tinyfd STATIC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_TINY_FILE_DIALOGS")
add_library(tinyfd STATIC
src/tinyfiledialogs/tinyfiledialogs.h
src/tinyfiledialogs/tinyfiledialogs.c
)
Expand All @@ -163,13 +185,13 @@ if(NOT EMSCRIPTEN)
endif()

#=== LIBRARY: cimgui + Dear ImGui
add_library(cimgui STATIC
src/cimgui/cimgui.cpp
src/cimgui/cimgui.h
add_library(cimgui STATIC
src/cimgui/cimgui.cpp
src/cimgui/cimgui.h
src/cimgui/imgui/imgui.cpp
src/cimgui/imgui/imgui.h
src/cimgui/imgui/imgui_widgets.cpp
src/cimgui/imgui/imgui_draw.cpp
src/cimgui/imgui/imgui_widgets.cpp
src/cimgui/imgui/imgui_draw.cpp
src/cimgui/imgui/imgui_tables.cpp
src/cimgui/imgui/imgui_demo.cpp
)
Expand All @@ -186,20 +208,20 @@ if(USE_SDL)
set(SDL_SHARED OFF CACHE BOOL "Build Shared" FORCE)
set(SDL_STATIC ON CACHE BOOL "Build Static" FORCE)
set(SDL_FORCE_STATIC_VCRT ON CACHE BOOL "USE LIBC" FORCE)
set(SDL_LIBC ON CACHE BOOL "USE LIBC" FORCE)
set(SDL_LIBC ON CACHE BOOL "USE LIBC" FORCE)
set(SDL_STATIC_PIC ON CACHE BOOL "Build Static PIC" FORCE)
# Allow some projects to be built conditionally.
set(SDL2_DISABLE_SDL2MAIN ON CACHE BOOL "Disable building/installation of SDL2main" FORCE)
set(SDL2_DISABLE_INSTALL ON CACHE BOOL "Disable installation of SDL2" FORCE)
set(SDL2_DISABLE_UNINSTALL ON CACHE BOOL "Disable uninstallation of SDL2" FORCE)
set(SDL2_DISABLE_UNINSTALL ON CACHE BOOL "Disable uninstallation of SDL2" FORCE)

set(SDL_LIBC ON CACHE BOOL "Use the system C library" ${OPT_DEF_LIBC} FORCE)
set(SDL_ATOMIC OFF CACHE BOOL "SDL Video support" FORCE)
set(SDL_AUDIO OFF CACHE BOOL "SDL Video support" FORCE)
set(SDL_FILE OFF CACHE BOOL "SDL Video support" FORCE)
set(SDL_THREAD OFF CACHE BOOL "SDL Video support" FORCE)
set(SDL_RENDER OFF CACHE BOOL "SDL Video support" FORCE)
set(SDL_LOCALE OFF CACHE BOOL "SDL Video support" FORCE)
set(SDL_LOCALE OFF CACHE BOOL "SDL Video support" FORCE)

add_definitions(-DSDL_LEAN_AND_MEAN=1)
add_subdirectory(src/SDL2)
Expand Down Expand Up @@ -252,7 +274,19 @@ else()
set_property(TARGET sokol PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
if (SE_PLATFORM_LINUX OR SE_PLATFORM_FREEBSD)
target_include_directories(sokol PRIVATE "${X11_INCLUDE_DIR}")
if(SE_FORCE_GLES2)
find_package(OpenGLES COMPONENTS V2 REQUIRED)
if(OpenGLES_V2_FOUND)
target_link_libraries(sokol INTERFACE ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} OpenGLES::OpenGLESv2 EGL dl)
endif()
elseif(SE_FORCE_GLES3)
find_package(OpenGLES COMPONENTS V3 REQUIRED)
if(OpenGLES_V3_FOUND)
target_link_libraries(sokol INTERFACE ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} OpenGLES::OpenGLESv3 EGL dl)
endif()
else()
target_link_libraries(sokol INTERFACE ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} OpenGL::OpenGL dl)
endif()
endif()
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(sokol INTERFACE m)
Expand Down Expand Up @@ -471,4 +505,5 @@ endif()

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
BUNDLE DESTINATION "${CMAKE_INSTALL_PREFIX}/Applications")
BUNDLE DESTINATION "${CMAKE_INSTALL_PREFIX}/Applications"
)
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://nightly.link/skylersaleh/SkyEmu/workflows/deploy_ios/dev/iOSRelease.zip" rel="Download iOS">![iOS Build](https://github.com/skylersaleh/SkyEmu/actions/workflows/deploy_ios.yml/badge.svg)</a>
<a href="https://nightly.link/skylersaleh/SkyEmu/workflows/deploy_freebsd/dev/FreeBSDRelease.zip" rel="Download FreeBSD">![FreeBSD Build](https://github.com/skylersaleh/SkyEmu/actions/workflows/deploy_freebsd.yml/badge.svg)</a>
<a href="https://web.skyemu.app/branch/dev" rel="Web Build">![Web Build](https://github.com/skylersaleh/SkyEmu/actions/workflows/deploy_web.yml/badge.svg)</a>
<a href="https://discord.gg/tnUEtmJgA5" rel="Join Discord Server">![Discord Shield](https://discordapp.com/api/guilds/1131322341645893783/widget.png?style=shield)</a>
<a href="https://discord.gg/tnUEtmJgA5" rel="Join Discord Server">![Discord Shield](https://discordapp.com/api/guilds/1131322341645893783/widget.png?style=shield)</a>

![SkyEmu](https://github.com/skylersaleh/SkyEmu/assets/7118296/03d74d15-070c-4353-8f37-263847bc0750)

Expand All @@ -21,7 +21,7 @@ SkyEmu is a low level GameBoy, GameBoy Color, Game Boy Advance, and DS emulator.
- Game Controller and Rumble Support with configureable keybinds
- 4x Persistent Save State Slots with screenshot preview
- Game fastforward and rewind support (supporting [very long rewind times](https://www.youtube.com/watch?v=Sfc_1NKbiKg))
- Action Replay Cheat Code Engine
- Action Replay Cheat Code Engine
- Localization in Armenian, Chinese, Danish, Dutch, English, German, Greek, Italian, Polish, and Russian
- Support for emulating the Real Time Clock and Solar Sensor
- CPU, MMIO, and Memory Debuggers
Expand All @@ -37,11 +37,11 @@ The latest version of the emulator can also be played without installing at the

[https://web.skyemu.app/](https://web.skyemu.app/)

The web app emulates everything locally on your machine using web assembly and javascript. Because of this all files stay local to your machine like the regular native build, however there is a performance cost to performing the emulation inside a web browser.
The web app emulates everything locally on your machine using web assembly and javascript. Because of this all files stay local to your machine like the regular native build, however there is a performance cost to performing the emulation inside a web browser.

On Mobile platforms it is recommended to add this to the home screen and launch from there. This will prevent the web browser from auto deleting save files and will make the app full screen.

Note: Platform BIOS/Firmware files are not required as SkyEmu bundles open source replacement BIOS/stubs. However, it is strongly recommended to dump official BIOS/firmware as the open source replacements lack many of the features of the native firmware/BIOS (such as colorizing GB games and the startup splashes) and are not as accurate.
Note: Platform BIOS/Firmware files are not required as SkyEmu bundles open source replacement BIOS/stubs. However, it is strongly recommended to dump official BIOS/firmware as the open source replacements lack many of the features of the native firmware/BIOS (such as colorizing GB games and the startup splashes) and are not as accurate.

## Discord Server

Expand All @@ -57,39 +57,47 @@ Note: Platform BIOS/Firmware files are not required as SkyEmu bundles open sourc
- U: L shoulder
- I: R shoulder

On mobile platforms an onscreen touch screen controller is provided.
On mobile platforms an onscreen touch screen controller is provided.

## Loading save files and BIOSs

On web builds save files and the BIOS can be loaded by dragging them onto the page or loading them using the ROM file picker. The GBA BIOS must be named `gba_bios.bin` for the emulator to pick it up. Save files must be named the name of the rom file with the extension `.sav`. So for example if the ROM was `MyRomFile.gba` the save file must be called `MyRomFile.sav`.
On web builds save files and the BIOS can be loaded by dragging them onto the page or loading them using the ROM file picker. The GBA BIOS must be named `gba_bios.bin` for the emulator to pick it up. Save files must be named the name of the rom file with the extension `.sav`. So for example if the ROM was `MyRomFile.gba` the save file must be called `MyRomFile.sav`.

On native builds the above naming convention still applies, but the save/BIOS files must be instead located in the same folder as the ROM file, instead of being dragged or loaded in the emulator itself.

## Native Build Instructions

Native builds are experimental currently but can be built using the following commands:

```bash
mkdir build
cd build
cmake ..
cmake --build .
```

For Raspberry Pi, you'll want to enable OpenGLES support:
```bash
mkdir build
cd build
cmake ..
cmake --build .
cmake .. -DUSE_GLES3=ON # or -DUSE_GLES2=ON if GLES3 isn't supported
cmake --build .
```

The output binaries should be in the build/bin folder

Native builds support loading roms through the command line by specifying the path to the ROM as the first argument:
Native builds support loading roms through the command line by specifying the path to the ROM as the first argument:

```
```bash
./SkyEmu path/to/rom.gba
```

## Accuracy/Compatibility

SkyEmu has been tested on 100s of ROMs and most common games should be playable with no to minor bugs currently. However, the GBA emulation is significantly more accurate than the GB/GBC emulation.
SkyEmu has been tested on 100s of ROMs and most common games should be playable with no to minor bugs currently. However, the GBA emulation is significantly more accurate than the GB/GBC emulation.

**GBA**:
- Per Pixel PPU Implementation capable of both scan line and mid scan line effects (SkyEmu and NanoBoyAdvance are the only GBA emulators released to support this)
- Per Pixel PPU Implementation capable of both scan line and mid scan line effects (SkyEmu and NanoBoyAdvance are the only GBA emulators released to support this)
- Passes the AGS Aging Test ROM (SkyEmu is the second SW based GBA emulator to ever pass this)
- Can run difficult to emulate GBA games such as the NES Classics Series, Golden Sun and Hello Kitty Miracle Fashion Maker
- 100% Passes all ArmWrestler Tests
Expand All @@ -98,15 +106,15 @@ SkyEmu has been tested on 100s of ROMs and most common games should be playable
- Passes 2020/2020 GBA Suite timing tests when utilizing the official GBA BIOS (SkyEmu is one of the few emulators capable of passing this test).
- Full instruction pipeline and prefetch emulation

**GB**:
**GB**:
- Passes all of Blargg's CPU instruction tests
- Passes DMG and GBC acid2 PPU conformance tests
- Passes MBCtest
- Dotclk based PPU implementation
- Anti-aliased audio synthesis with support for APU changes per sample (supports Pikachu's voice in Pokemon Yellow/Pokemon Pinball)

## Birds of a Feather
- [**Pokemon Bot**](https://github.com/OFFTKP/pokemon-bot): A discord bot that can connect to SkyEmu to allow your discord users to play GB/GBC/GBA/NDS games.
- [**Pokemon Bot**](https://github.com/OFFTKP/pokemon-bot): A discord bot that can connect to SkyEmu to allow your discord users to play GB/GBC/GBA/NDS games.
- [**Panda3DS**](https://github.com/wheremyfoodat/Panda3DS): Panda themed HLE 3DS emulator
- [**NanoBoyAdvance**](https://github.com/nba-emu/NanoBoyAdvance): A Game Boy Advance emulator focusing on hardware research and cycle-accurate emulation
- [**Dust**](https://github.com/kelpsyberry/dust): DS emulator for desktop devices and the web
Expand Down
Loading
Loading