mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
Merge branch 'master' into more-dsp
This commit is contained in:
commit
33f45cf1f5
13 changed files with 83 additions and 42 deletions
|
@ -9,7 +9,8 @@
|
||||||
variables:
|
variables:
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
CORENAME: panda3ds
|
CORENAME: panda3ds
|
||||||
CORE_ARGS: -DBUILD_LIBRETRO_CORE=ON -DENABLE_USER_BUILD=ON -DENABLE_VULKAN=OFF -DENABLE_LUAJIT=OFF -DENABLE_DISCORD_RPC=OFF
|
BASE_CORE_ARGS: -DBUILD_LIBRETRO_CORE=ON -DENABLE_USER_BUILD=ON -DENABLE_VULKAN=OFF -DENABLE_LUAJIT=OFF -DENABLE_DISCORD_RPC=OFF -DENABLE_METAL=OFF
|
||||||
|
CORE_ARGS: ${BASE_CORE_ARGS}
|
||||||
|
|
||||||
# Inclusion templates, required for the build to work
|
# Inclusion templates, required for the build to work
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ libretro-build-osx-x64:
|
||||||
tags:
|
tags:
|
||||||
- mac-apple-silicon
|
- mac-apple-silicon
|
||||||
variables:
|
variables:
|
||||||
CORE_ARGS: -DBUILD_LIBRETRO_CORE=ON -DENABLE_USER_BUILD=ON -DENABLE_VULKAN=OFF -DENABLE_LUAJIT=OFF -DENABLE_DISCORD_RPC=OFF -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCRYPTOPP_AMD64=1
|
CORE_ARGS: ${BASE_CORE_ARGS} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCRYPTOPP_AMD64=1
|
||||||
extends:
|
extends:
|
||||||
- .libretro-osx-cmake-x86
|
- .libretro-osx-cmake-x86
|
||||||
- .core-defs
|
- .core-defs
|
||||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -82,3 +82,6 @@
|
||||||
[submodule "third_party/fdk-aac"]
|
[submodule "third_party/fdk-aac"]
|
||||||
path = third_party/fdk-aac
|
path = third_party/fdk-aac
|
||||||
url = https://github.com/Panda3DS-emu/fdk-aac/
|
url = https://github.com/Panda3DS-emu/fdk-aac/
|
||||||
|
[submodule "third_party/cryptoppwin"]
|
||||||
|
path = third_party/cryptoppwin
|
||||||
|
url = https://github.com/shadps4-emu/ext-cryptoppwin
|
||||||
|
|
|
@ -57,6 +57,7 @@ option(ENABLE_HTTP_SERVER "Enable HTTP server. Used for Discord bot support" OFF
|
||||||
option(ENABLE_DISCORD_RPC "Compile with Discord RPC support (disabled by default)" ON)
|
option(ENABLE_DISCORD_RPC "Compile with Discord RPC support (disabled by default)" ON)
|
||||||
option(ENABLE_LUAJIT "Enable scripting with the Lua programming language" ON)
|
option(ENABLE_LUAJIT "Enable scripting with the Lua programming language" ON)
|
||||||
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
||||||
|
option(USE_SYSTEM_SDL2 "Use the system's SDL2 package" OFF)
|
||||||
option(ENABLE_GIT_VERSIONING "Enables querying git for the emulator version" ON)
|
option(ENABLE_GIT_VERSIONING "Enables querying git for the emulator version" ON)
|
||||||
option(BUILD_HYDRA_CORE "Build a Hydra core" OFF)
|
option(BUILD_HYDRA_CORE "Build a Hydra core" OFF)
|
||||||
option(BUILD_LIBRETRO_CORE "Build a Libretro core" OFF)
|
option(BUILD_LIBRETRO_CORE "Build a Libretro core" OFF)
|
||||||
|
@ -126,7 +127,6 @@ include_directories(third_party/elfio/)
|
||||||
include_directories(third_party/hips/include/)
|
include_directories(third_party/hips/include/)
|
||||||
include_directories(third_party/imgui/)
|
include_directories(third_party/imgui/)
|
||||||
include_directories(third_party/dynarmic/src)
|
include_directories(third_party/dynarmic/src)
|
||||||
include_directories(third_party/cryptopp/)
|
|
||||||
include_directories(third_party/cityhash/include)
|
include_directories(third_party/cityhash/include)
|
||||||
include_directories(third_party/result/include)
|
include_directories(third_party/result/include)
|
||||||
include_directories(third_party/xxhash/include)
|
include_directories(third_party/xxhash/include)
|
||||||
|
@ -145,18 +145,22 @@ if(ENABLE_DISCORD_RPC AND NOT ANDROID)
|
||||||
include_directories(third_party/discord-rpc/include)
|
include_directories(third_party/discord-rpc/include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SDL_STATIC ON CACHE BOOL "" FORCE)
|
|
||||||
set(SDL_SHARED OFF CACHE BOOL "" FORCE)
|
|
||||||
set(SDL_TEST OFF CACHE BOOL "" FORCE)
|
|
||||||
|
|
||||||
if (NOT ANDROID)
|
if (NOT ANDROID)
|
||||||
add_subdirectory(third_party/SDL2)
|
if (USE_SYSTEM_SDL2)
|
||||||
target_link_libraries(AlberCore PUBLIC SDL2-static)
|
find_package(SDL2 CONFIG REQUIRED)
|
||||||
|
target_link_libraries(AlberCore PUBLIC SDL2::SDL2)
|
||||||
|
else()
|
||||||
|
set(SDL_STATIC ON CACHE BOOL "" FORCE)
|
||||||
|
set(SDL_SHARED OFF CACHE BOOL "" FORCE)
|
||||||
|
set(SDL_TEST OFF CACHE BOOL "" FORCE)
|
||||||
|
add_subdirectory(third_party/SDL2)
|
||||||
|
target_link_libraries(AlberCore PUBLIC SDL2-static)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(third_party/fmt)
|
add_subdirectory(third_party/fmt)
|
||||||
add_subdirectory(third_party/toml11)
|
add_subdirectory(third_party/toml11)
|
||||||
include_directories(${SDL2_INCLUDE_DIR})
|
|
||||||
include_directories(third_party/toml11)
|
include_directories(third_party/toml11)
|
||||||
include_directories(third_party/glm)
|
include_directories(third_party/glm)
|
||||||
include_directories(third_party/renderdoc)
|
include_directories(third_party/renderdoc)
|
||||||
|
@ -178,10 +182,21 @@ if(ANDROID)
|
||||||
target_link_libraries(AlberCore PRIVATE EGL log)
|
target_link_libraries(AlberCore PRIVATE EGL log)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CRYPTOPP_BUILD_TESTING OFF)
|
|
||||||
add_subdirectory(third_party/cryptopp)
|
|
||||||
add_subdirectory(third_party/glad)
|
add_subdirectory(third_party/glad)
|
||||||
|
|
||||||
|
# Cryptopp doesn't support compiling under clang-cl, so we have to include it as a prebuilt MSVC static library
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND MSVC)
|
||||||
|
add_subdirectory(third_party/cryptoppwin)
|
||||||
|
include_directories(third_party/cryptoppwin/include)
|
||||||
|
target_link_libraries(AlberCore PRIVATE cryptoppwin)
|
||||||
|
else()
|
||||||
|
set(CRYPTOPP_BUILD_TESTING OFF)
|
||||||
|
|
||||||
|
add_subdirectory(third_party/cryptopp)
|
||||||
|
include_directories(third_party/cryptopp)
|
||||||
|
target_link_libraries(AlberCore PRIVATE cryptopp)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LUAJIT)
|
if(ENABLE_LUAJIT)
|
||||||
add_subdirectory(third_party/LuaJIT luajit)
|
add_subdirectory(third_party/LuaJIT luajit)
|
||||||
include_directories(third_party/LuaJIT/src ${CMAKE_BINARY_DIR}/luajit)
|
include_directories(third_party/LuaJIT/src ${CMAKE_BINARY_DIR}/luajit)
|
||||||
|
@ -224,6 +239,11 @@ endif()
|
||||||
if(NOT MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT DISABLE_SSE4 AND HOST_X64)
|
if(NOT MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT DISABLE_SSE4 AND HOST_X64)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
|
||||||
|
elseif(MSVC AND NOT DISABLE_SSE4)
|
||||||
|
# Tell our SIMD code to use SSE4.1 by defining the relevant macros.
|
||||||
|
# Clang defines these macros, MSVC does not.
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D__SSE3__ /D__SSE4_1__")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D__SSE3__ /D__SSE4_1__")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_RENDERDOC_API)
|
if(ENABLE_RENDERDOC_API)
|
||||||
|
@ -574,7 +594,7 @@ set(ALL_SOURCES ${SOURCE_FILES} ${FS_SOURCE_FILES} ${CRYPTO_SOURCE_FILES} ${KERN
|
||||||
${AUDIO_SOURCE_FILES} ${HEADER_FILES} ${FRONTEND_HEADER_FILES})
|
${AUDIO_SOURCE_FILES} ${HEADER_FILES} ${FRONTEND_HEADER_FILES})
|
||||||
target_sources(AlberCore PRIVATE ${ALL_SOURCES})
|
target_sources(AlberCore PRIVATE ${ALL_SOURCES})
|
||||||
|
|
||||||
target_link_libraries(AlberCore PRIVATE dynarmic cryptopp glad resources_console_fonts teakra fdk-aac)
|
target_link_libraries(AlberCore PRIVATE dynarmic glad resources_console_fonts teakra fdk-aac)
|
||||||
target_link_libraries(AlberCore PUBLIC glad capstone fmt::fmt)
|
target_link_libraries(AlberCore PUBLIC glad capstone fmt::fmt)
|
||||||
|
|
||||||
if(ENABLE_DISCORD_RPC AND NOT ANDROID)
|
if(ENABLE_DISCORD_RPC AND NOT ANDROID)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Software Information
|
# Software Information
|
||||||
display_name = "Nintendo - 3DS (Panda3DS)"
|
display_name = "Nintendo - 3DS (Panda3DS)"
|
||||||
authors = "Panda3DS Authors (tm)"
|
authors = "Panda3DS Authors (tm)"
|
||||||
supported_extensions = "3ds|3dsx|elf|axf|cci|cxi|app"
|
supported_extensions = "3ds|3dsx|elf|axf|cci|cxi|app|ncch"
|
||||||
corename = "Panda3DS"
|
corename = "Panda3DS"
|
||||||
categories = "Emulator"
|
categories = "Emulator"
|
||||||
license = "GPLv3"
|
license = "GPLv3"
|
||||||
|
|
|
@ -21,10 +21,12 @@ class MiniAudioDevice {
|
||||||
bool running = false;
|
bool running = false;
|
||||||
|
|
||||||
std::vector<std::string> audioDevices;
|
std::vector<std::string> audioDevices;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MiniAudioDevice();
|
MiniAudioDevice();
|
||||||
// If safe is on, we create a null audio device
|
// If safe is on, we create a null audio device
|
||||||
void init(Samples& samples, bool safe = false);
|
void init(Samples& samples, bool safe = false);
|
||||||
|
void close();
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -162,19 +161,6 @@ namespace Helpers {
|
||||||
return std::bit_cast<To, From>(from);
|
return std::bit_cast<To, From>(from);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static std::vector<std::string> split(const std::string& s, const char c) {
|
|
||||||
std::istringstream tmp(s);
|
|
||||||
std::vector<std::string> result(1);
|
|
||||||
|
|
||||||
while (std::getline(tmp, *result.rbegin(), c)) {
|
|
||||||
result.emplace_back();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove temporary slot
|
|
||||||
result.pop_back();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}; // namespace Helpers
|
}; // namespace Helpers
|
||||||
|
|
||||||
// UDLs for memory size values
|
// UDLs for memory size values
|
||||||
|
|
|
@ -29,9 +29,9 @@ namespace Renderdoc {
|
||||||
#else
|
#else
|
||||||
namespace Renderdoc {
|
namespace Renderdoc {
|
||||||
static void loadRenderdoc() {}
|
static void loadRenderdoc() {}
|
||||||
static void startCapture() { Helpers::panic("Tried to start a Renderdoc capture while support for renderdoc is disabled") }
|
static void startCapture() { Helpers::panic("Tried to start a Renderdoc capture while support for renderdoc is disabled"); }
|
||||||
static void endCapture() { Helpers::panic("Tried to end a Renderdoc capture while support for renderdoc is disabled") }
|
static void endCapture() { Helpers::panic("Tried to end a Renderdoc capture while support for renderdoc is disabled"); }
|
||||||
static void triggerCapture() { Helpers::panic("Tried to trigger a Renderdoc capture while support for renderdoc is disabled") }
|
static void triggerCapture() { Helpers::panic("Tried to trigger a Renderdoc capture while support for renderdoc is disabled"); }
|
||||||
static void setOutputDir(const std::string& path, const std::string& prefix) {}
|
static void setOutputDir(const std::string& path, const std::string& prefix) {}
|
||||||
static constexpr bool isSupported() { return false; }
|
static constexpr bool isSupported() { return false; }
|
||||||
} // namespace Renderdoc
|
} // namespace Renderdoc
|
||||||
|
|
|
@ -68,7 +68,7 @@ Simply drag and drop a ROM to the executable if supported, or invoke the executa
|
||||||
<br>
|
<br>
|
||||||
Panda3DS can load ROMs in the following formats:
|
Panda3DS can load ROMs in the following formats:
|
||||||
- .3ds/.cci
|
- .3ds/.cci
|
||||||
- .cxi/.app
|
- .cxi/.app/.ncch
|
||||||
- .elf/.axf
|
- .elf/.axf
|
||||||
- .3dsx
|
- .3dsx
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ void MiniAudioDevice::init(Samples& samples, bool safe) {
|
||||||
|
|
||||||
// TODO: Make backend selectable here
|
// TODO: Make backend selectable here
|
||||||
found = true;
|
found = true;
|
||||||
//count = 1;
|
// count = 1;
|
||||||
//backends[0] = backend;
|
// backends[0] = backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
@ -81,8 +81,8 @@ void MiniAudioDevice::init(Samples& samples, bool safe) {
|
||||||
deviceConfig.playback.format = ma_format_s16;
|
deviceConfig.playback.format = ma_format_s16;
|
||||||
deviceConfig.playback.channels = channelCount;
|
deviceConfig.playback.channels = channelCount;
|
||||||
deviceConfig.sampleRate = sampleRate;
|
deviceConfig.sampleRate = sampleRate;
|
||||||
//deviceConfig.periodSizeInFrames = 64;
|
// deviceConfig.periodSizeInFrames = 64;
|
||||||
//deviceConfig.periods = 16;
|
// deviceConfig.periods = 16;
|
||||||
deviceConfig.pUserData = this;
|
deviceConfig.pUserData = this;
|
||||||
deviceConfig.aaudio.usage = ma_aaudio_usage_game;
|
deviceConfig.aaudio.usage = ma_aaudio_usage_game;
|
||||||
deviceConfig.wasapi.noAutoConvertSRC = true;
|
deviceConfig.wasapi.noAutoConvertSRC = true;
|
||||||
|
@ -130,7 +130,7 @@ void MiniAudioDevice::start() {
|
||||||
|
|
||||||
void MiniAudioDevice::stop() {
|
void MiniAudioDevice::stop() {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
Helpers::warn("MiniAudio device not initialized, can't start");
|
Helpers::warn("MiniAudio device not initialized, can't stop");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,3 +142,14 @@ void MiniAudioDevice::stop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MiniAudioDevice::close() {
|
||||||
|
stop();
|
||||||
|
|
||||||
|
if (initialized) {
|
||||||
|
initialized = false;
|
||||||
|
|
||||||
|
ma_device_uninit(&device);
|
||||||
|
ma_context_uninit(&context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
|
@ -15,6 +18,19 @@ namespace Crypto {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto splitString = [](const std::string& s, const char c) -> std::vector<std::string> {
|
||||||
|
std::istringstream tmp(s);
|
||||||
|
std::vector<std::string> result(1);
|
||||||
|
|
||||||
|
while (std::getline(tmp, *result.rbegin(), c)) {
|
||||||
|
result.emplace_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove temporary slot
|
||||||
|
result.pop_back();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
while (!file.eof()) {
|
while (!file.eof()) {
|
||||||
std::string line;
|
std::string line;
|
||||||
std::getline(file, line);
|
std::getline(file, line);
|
||||||
|
@ -24,7 +40,7 @@ namespace Crypto {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto parts = Helpers::split(line, '=');
|
const auto parts = splitString(line, '=');
|
||||||
if (parts.size() != 2) {
|
if (parts.size() != 2) {
|
||||||
Helpers::warn("Keys: Failed to parse %s", line.c_str());
|
Helpers::warn("Keys: Failed to parse %s", line.c_str());
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -50,6 +50,7 @@ Emulator::Emulator()
|
||||||
Emulator::~Emulator() {
|
Emulator::~Emulator() {
|
||||||
config.save();
|
config.save();
|
||||||
lua.close();
|
lua.close();
|
||||||
|
audioDevice.close();
|
||||||
|
|
||||||
#ifdef PANDA3DS_ENABLE_DISCORD_RPC
|
#ifdef PANDA3DS_ENABLE_DISCORD_RPC
|
||||||
discordRpc.stop();
|
discordRpc.stop();
|
||||||
|
@ -249,7 +250,7 @@ bool Emulator::loadROM(const std::filesystem::path& path) {
|
||||||
success = loadELF(path);
|
success = loadELF(path);
|
||||||
else if (extension == ".3ds" || extension == ".cci")
|
else if (extension == ".3ds" || extension == ".cci")
|
||||||
success = loadNCSD(path, ROMType::NCSD);
|
success = loadNCSD(path, ROMType::NCSD);
|
||||||
else if (extension == ".cxi" || extension == ".app")
|
else if (extension == ".cxi" || extension == ".app" || extension == ".ncch")
|
||||||
success = loadNCSD(path, ROMType::CXI);
|
success = loadNCSD(path, ROMType::CXI);
|
||||||
else if (extension == ".3dsx")
|
else if (extension == ".3dsx")
|
||||||
success = load3DSX(path);
|
success = load3DSX(path);
|
||||||
|
|
|
@ -189,7 +189,7 @@ void MainWindow::swapEmuBuffer() {
|
||||||
void MainWindow::selectROM() {
|
void MainWindow::selectROM() {
|
||||||
auto path = QFileDialog::getOpenFileName(
|
auto path = QFileDialog::getOpenFileName(
|
||||||
this, tr("Select 3DS ROM to load"), QString::fromStdU16String(emu->getConfig().defaultRomPath.u16string()),
|
this, tr("Select 3DS ROM to load"), QString::fromStdU16String(emu->getConfig().defaultRomPath.u16string()),
|
||||||
tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)")
|
tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.ncch *.3dsx *.elf *.axf)")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
|
|
1
third_party/cryptoppwin
vendored
Submodule
1
third_party/cryptoppwin
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit bc3441dd2d6a9728e747dc0180bc8b9065a2923c
|
Loading…
Add table
Reference in a new issue