From 363fe5901a2f2525bda4b2cd3ca859681258b30b Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Sun, 17 Dec 2023 04:45:54 +0100 Subject: [PATCH] add some more error handling, whitespace in cmake file --- src/Cafe/HW/Latte/Core/LatteThread.cpp | 3 +++ src/util/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteThread.cpp b/src/Cafe/HW/Latte/Core/LatteThread.cpp index 09667266..8710a754 100644 --- a/src/Cafe/HW/Latte/Core/LatteThread.cpp +++ b/src/Cafe/HW/Latte/Core/LatteThread.cpp @@ -285,12 +285,15 @@ void LatteThread_InitBootSound() catch (const std::runtime_error& ex) { cemuLog_log(LogType::Force, "Failed to initialise audio device for bootup sound"); + return; } g_BootSndAudioDev->Play(); std::string sndPath = fmt::format("{}/meta/{}", CafeSystem::GetMlcStoragePath(CafeSystem::GetForegroundTitleId()), "bootSound.btsnd"); sint32 fscStatus = FSC_STATUS_UNDEFINED; g_bootSndFileHandle = fsc_open(sndPath.c_str(), FSC_ACCESS_FLAG::OPEN_FILE | FSC_ACCESS_FLAG::READ_PERMISSION, &fscStatus); + if(!g_bootSndFileHandle) + return; g_BootSndFileReader = std::make_unique(g_bootSndFileHandle, audioBlockSize); } diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 8d86eb6d..ed33b8a5 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -1,7 +1,7 @@ add_library(CemuUtil boost/bluetooth.h - bootSound/BootSoundReader.cpp - bootSound/BootSoundReader.h + bootSound/BootSoundReader.cpp + bootSound/BootSoundReader.h ChunkedHeap/ChunkedHeap.h containers/flat_hash_map.hpp containers/IntervalBucketContainer.h