Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Maddie:emulation
melonds
melonds_PR1982.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File melonds_PR1982.patch of Package melonds
From 2be6e05b9d12e77db6f7c9c9509a976e5438bc0e Mon Sep 17 00:00:00 2001 From: DesperateProgrammer <tim.seidel@rwth-aachen.de> Date: Thu, 22 Feb 2024 13:15:02 +0100 Subject: [PATCH 1/3] Fix for crash at starting melonDS, if the configured DSi bios or nand files could not be loaded --- src/frontend/qt_sdl/EmuThread.cpp | 58 +++++++++++++++++++------------ 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/src/frontend/qt_sdl/EmuThread.cpp b/src/frontend/qt_sdl/EmuThread.cpp index 0728a0856a..d06ce1445a 100644 --- a/src/frontend/qt_sdl/EmuThread.cpp +++ b/src/frontend/qt_sdl/EmuThread.cpp @@ -152,29 +152,41 @@ std::unique_ptr<NDS> EmuThread::CreateConsole( { auto arm7ibios = ROMManager::LoadDSiARM7BIOS(); if (!arm7ibios) - return nullptr; - - auto arm9ibios = ROMManager::LoadDSiARM9BIOS(); - if (!arm9ibios) - return nullptr; - - auto nand = ROMManager::LoadNAND(*arm7ibios); - if (!nand) - return nullptr; - - auto sdcard = ROMManager::LoadDSiSDCard(); - DSiArgs args { - std::move(ndsargs), - *arm9ibios, - *arm7ibios, - std::move(*nand), - std::move(sdcard), - Config::DSiFullBIOSBoot, - }; - - args.GBAROM = nullptr; - - return std::make_unique<melonDS::DSi>(std::move(args)); + { + // Fallback to NDS mode , if bios for arm7 was not loaded + Config::ConsoleType = 0; + } else + { + auto arm9ibios = ROMManager::LoadDSiARM9BIOS(); + if (!arm9ibios) + { + // Fallback to NDS mode, if bios from arm9 was not loaded + Config::ConsoleType = 0; + } else + { + auto nand = ROMManager::LoadNAND(*arm7ibios); + if (!nand) + { + // Fallback to NDS mode, if NAND was not loaded + Config::ConsoleType = 0; + } else + { + auto sdcard = ROMManager::LoadDSiSDCard(); + DSiArgs args { + std::move(ndsargs), + *arm9ibios, + *arm7ibios, + std::move(*nand), + std::move(sdcard), + Config::DSiFullBIOSBoot, + }; + + args.GBAROM = nullptr; + + return std::make_unique<melonDS::DSi>(std::move(args)); + } + } + } } return std::make_unique<melonDS::NDS>(std::move(ndsargs)); From 1610967180d9dc11f1e98ecf5da56e84734e7196 Mon Sep 17 00:00:00 2001 From: DesperateProgrammer <tim.seidel@rwth-aachen.de> Date: Thu, 22 Feb 2024 13:29:59 +0100 Subject: [PATCH 2/3] Added Warnings to the Log, if falling back to NDS mode --- src/frontend/qt_sdl/EmuThread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/qt_sdl/EmuThread.cpp b/src/frontend/qt_sdl/EmuThread.cpp index d06ce1445a..1a7ca757b0 100644 --- a/src/frontend/qt_sdl/EmuThread.cpp +++ b/src/frontend/qt_sdl/EmuThread.cpp @@ -155,6 +155,7 @@ std::unique_ptr<NDS> EmuThread::CreateConsole( { // Fallback to NDS mode , if bios for arm7 was not loaded Config::ConsoleType = 0; + Log(LogLevel::Warn, "Failed to load ARM7 bios file, falling back to NDS mode\n"); } else { auto arm9ibios = ROMManager::LoadDSiARM9BIOS(); @@ -162,6 +163,7 @@ std::unique_ptr<NDS> EmuThread::CreateConsole( { // Fallback to NDS mode, if bios from arm9 was not loaded Config::ConsoleType = 0; + Log(LogLevel::Warn, "Failed to load ARM9 bios file, falling back to NDS mode\n"); } else { auto nand = ROMManager::LoadNAND(*arm7ibios); @@ -169,6 +171,7 @@ std::unique_ptr<NDS> EmuThread::CreateConsole( { // Fallback to NDS mode, if NAND was not loaded Config::ConsoleType = 0; + Log(LogLevel::Warn, "Failed to load NAND file, falling back to NDS mode\n"); } else { auto sdcard = ROMManager::LoadDSiSDCard(); From 459052999fcee92155cac055e5a028c1026548da Mon Sep 17 00:00:00 2001 From: DesperateProgrammer <tim.seidel@rwth-aachen.de> Date: Fri, 23 Feb 2024 19:07:36 +0100 Subject: [PATCH 3/3] Removed repititions --- src/frontend/qt_sdl/EmuThread.cpp | 54 ++++++++++++------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/src/frontend/qt_sdl/EmuThread.cpp b/src/frontend/qt_sdl/EmuThread.cpp index 1a7ca757b0..2ce82bc23d 100644 --- a/src/frontend/qt_sdl/EmuThread.cpp +++ b/src/frontend/qt_sdl/EmuThread.cpp @@ -151,44 +151,30 @@ std::unique_ptr<NDS> EmuThread::CreateConsole( if (Config::ConsoleType == 1) { auto arm7ibios = ROMManager::LoadDSiARM7BIOS(); - if (!arm7ibios) + auto arm9ibios = ROMManager::LoadDSiARM9BIOS(); + std::optional<melonDS::DSi_NAND::NANDImage> nand ; + if (arm7ibios) + nand = ROMManager::LoadNAND(*arm7ibios); + + if (!arm7ibios || !arm9ibios || !nand) { - // Fallback to NDS mode , if bios for arm7 was not loaded Config::ConsoleType = 0; - Log(LogLevel::Warn, "Failed to load ARM7 bios file, falling back to NDS mode\n"); + Log(LogLevel::Warn, "Failed to load emulation files (bios/nand image), falling back to NDS mode\n"); } else { - auto arm9ibios = ROMManager::LoadDSiARM9BIOS(); - if (!arm9ibios) - { - // Fallback to NDS mode, if bios from arm9 was not loaded - Config::ConsoleType = 0; - Log(LogLevel::Warn, "Failed to load ARM9 bios file, falling back to NDS mode\n"); - } else - { - auto nand = ROMManager::LoadNAND(*arm7ibios); - if (!nand) - { - // Fallback to NDS mode, if NAND was not loaded - Config::ConsoleType = 0; - Log(LogLevel::Warn, "Failed to load NAND file, falling back to NDS mode\n"); - } else - { - auto sdcard = ROMManager::LoadDSiSDCard(); - DSiArgs args { - std::move(ndsargs), - *arm9ibios, - *arm7ibios, - std::move(*nand), - std::move(sdcard), - Config::DSiFullBIOSBoot, - }; - - args.GBAROM = nullptr; - - return std::make_unique<melonDS::DSi>(std::move(args)); - } - } + auto sdcard = ROMManager::LoadDSiSDCard(); + DSiArgs args { + std::move(ndsargs), + *arm9ibios, + *arm7ibios, + std::move(*nand), + std::move(sdcard), + Config::DSiFullBIOSBoot, + }; + + args.GBAROM = nullptr; + + return std::make_unique<melonDS::DSi>(std::move(args)); } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor