Compare commits

...

4 Commits

Author SHA1 Message Date
Jermz e461ee3856 Merge branch 'dev' into 'dev'
Adding beggining of CI build

See merge request suyu-emu/suyu!69
2024-03-09 01:31:41 +00:00
niansa 16e19b0b3c Implement option to start QLaunch from Tools menu 2024-03-09 01:28:33 +00:00
Jamie d95ca08f68 Merge remote-tracking branch 'upstream/dev' into dev
fixing merge issues & rebasing upstream onto dev
2024-03-07 12:48:27 -05:00
Jamie 4593234f30 Adding beggining of CI build
Needed for #8
2024-03-06 22:24:50 -05:00
6 changed files with 115 additions and 2 deletions

View File

@ -1,6 +1,25 @@
variables:
PR_NUMBER: "pr$CI_MERGE_REQUEST_IID"
stages:
- format
- build
- build-mac
- build-msvc
- android
format:
stage: format
image: ubuntu:latest
before_script:
- echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" >> /etc/apt/sources.list
- apt-get update
- apt-get -y install git clang-format-15 clang-15 sdkmanager android-sdk bash openjdk-21-jdk openjdk-21-jre && clang-format-15 --version
- export ANDROID_HOME="/usr/lib/android-sdk/"
- echo y | sdkmanager --sdk_root=/usr/lib/android-sdk --licenses
script:
- bash -ex ./.ci/scripts/format/script.sh
clang-format:
stage: format
@ -24,3 +43,52 @@ build-linux:
artifacts:
paths:
- artifacts/*
build-mac:
stage: build-mac
image: ubuntu:latest
script:
- apt-get update -y
- apt-get install -y autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja-build nlohmann-json openssl pkg-config qt5-default libsdl2-dev speex zlib1g-dev zlib zstd
- mkdir build
- cd build
- export Qt5_DIR="/usr/local/Qt-5.x/lib/cmake"
- cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
- ninja
artifacts:
name: "macos"
paths:
- build/
build-msvc:
stage: build-msvc
image: mcr.microsoft.com/windows/servercore:ltsc2019
script:
- Invoke-WebRequest -Uri "https://github.com/mbitsnbites/buildcache/releases/download/v0.28.4/buildcache-windows.zip" -OutFile "buildcache-windows.zip"
- Expand-Archive -Path "buildcache-windows.zip" -DestinationPath "C:\buildcache"
- echo "C:\buildcache\bin" | Out-File -FilePath $env:Path -Encoding utf8 -Append
- .\.ci\scripts\windows\install-vulkan-sdk.ps1
- .\CMakeModules\MSVCCache.cmake
- glslangValidator --version
- mkdir build
- cd build
- cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify -DYUZU_CRASH_DUMPS=ON
- cmake --build .
artifacts:
name: "msvc"
paths:
- build/
android:
stage: android
image: openjdk:17
script:
- apt-get update -y
- apt-get install -y ccache apksigner glslang-dev glslang-tools
- bash -c "export PR_NUMBER=$PR_NUMBER; ./.ci/scripts/android/build.sh"
artifacts:
name: "android"
paths:
- artifacts/

View File

@ -15,8 +15,8 @@ IGlobalStateController::IGlobalStateController(Core::System& system_)
{0, nullptr, "RequestToEnterSleep"},
{1, nullptr, "EnterSleep"},
{2, nullptr, "StartSleepSequence"},
{3, nullptr, "StartShutdownSequence"},
{4, nullptr, "StartRebootSequence"},
{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"},
{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"},
{9, nullptr, "IsAutoPowerDownRequested"},
{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"},
{11, nullptr, "NotifyCecSettingsChanged"},
@ -31,6 +31,18 @@ IGlobalStateController::IGlobalStateController(Core::System& system_)
RegisterHandlers(functions);
}
Result IGlobalStateController::StartShutdownSequence() {
LOG_INFO(Service_AM, "called");
system.Exit();
R_SUCCEED();
}
Result IGlobalStateController::StartRebootSequence() {
LOG_INFO(Service_AM, "called");
system.Exit();
R_SUCCEED();
}
IGlobalStateController::~IGlobalStateController() = default;
Result IGlobalStateController::LoadAndApplyIdlePolicySettings() {

View File

@ -18,6 +18,8 @@ public:
~IGlobalStateController() override;
private:
Result StartShutdownSequence();
Result StartRebootSequence();
Result LoadAndApplyIdlePolicySettings();
Result ShouldSleepOnBoot(Out<bool> out_should_sleep_on_boot);
Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);

View File

@ -1577,6 +1577,7 @@ void GMainWindow::ConnectMenuEvents() {
[this]() { OnCabinet(Service::NFP::CabinetMode::StartFormatter); });
connect_menu(ui->action_Load_Mii_Edit, &GMainWindow::OnMiiEdit);
connect_menu(ui->action_Open_Controller_Menu, &GMainWindow::OnOpenControllerMenu);
connect_menu(ui->action_Load_Home_Menu, &GMainWindow::OnHomeMenu);
connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot);
// TAS
@ -4291,6 +4292,29 @@ void GMainWindow::OnOpenControllerMenu() {
LibraryAppletParameters(ControllerAppletId, Service::AM::AppletId::Controller));
}
void GMainWindow::OnHomeMenu() {
constexpr u64 QLaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
if (!bis_system) {
QMessageBox::warning(this, tr("No firmware available"),
tr("Please install the firmware to use the Home Menu."));
return;
}
auto qlaunch_applet_nca = bis_system->GetEntry(QLaunchId, FileSys::ContentRecordType::Program);
if (!qlaunch_applet_nca) {
QMessageBox::warning(this, tr("Home Menu Applet"),
tr("Home Menu is not available. Please reinstall firmware."));
return;
}
system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch);
const auto filename = QString::fromStdString((qlaunch_applet_nca->GetFullPath()));
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
BootGame(filename, LibraryAppletParameters(QLaunchId, Service::AM::AppletId::QLaunch));
}
void GMainWindow::OnCaptureScreenshot() {
if (emu_thread == nullptr || !emu_thread->IsRunning()) {
return;

View File

@ -399,6 +399,7 @@ private slots:
void OnCabinet(Service::NFP::CabinetMode mode);
void OnMiiEdit();
void OnOpenControllerMenu();
void OnHomeMenu();
void OnCaptureScreenshot();
void OnCheckFirmwareDecryption();
void OnLanguageChanged(const QString& locale);

View File

@ -173,6 +173,7 @@
<addaction name="action_Load_Album"/>
<addaction name="action_Load_Mii_Edit"/>
<addaction name="action_Open_Controller_Menu"/>
<addaction name="action_Load_Home_Menu"/>
<addaction name="separator"/>
<addaction name="action_Capture_Screenshot"/>
<addaction name="menuTAS"/>
@ -475,6 +476,11 @@
<string>Install Decryption Keys</string>
</property>
</action>
<action name="action_Load_Home_Menu">
<property name="text">
<string>Open Home Menu</string>
</property>
</action>
</widget>
<resources>
<include location="suyu.qrc"/>