diff --git a/overlay/source/symbol.hpp b/overlay/source/symbol.hpp index f739999..c033bdd 100644 --- a/overlay/source/symbol.hpp +++ b/overlay/source/symbol.hpp @@ -12,7 +12,7 @@ class AlphaSymbol { constexpr AlphaSymbol(size_t width, size_t height, const u8 *data) : m_width(width), m_height(height), m_data(data) {} - void draw(s32 x, s32 y, tsl::gfx::Renderer *renderer, tsl::gfx::Color color) const { + void draw(s32 x, s32 y, tsl::gfx::Renderer *renderer, tsl::Color color) const { const u8 *ptr = this->m_data; const s32 x_offset = x - (m_width / 2); const s32 y_offset = y - (m_height / 2); diff --git a/sys-tune/source/impl/music_player.cpp b/sys-tune/source/impl/music_player.cpp index 175576b..a4891a2 100644 --- a/sys-tune/source/impl/music_player.cpp +++ b/sys-tune/source/impl/music_player.cpp @@ -32,7 +32,7 @@ namespace ams::tune::impl { std::vector g_shuffle_playlist; std::string g_current = ""; u32 g_queue_position; - os::Mutex g_mutex; + os::Mutex g_mutex(false); RepeatMode g_repeat = RepeatMode::All; ShuffleMode g_shuffle = ShuffleMode::Off; diff --git a/sys-tune/source/main.cpp b/sys-tune/source/main.cpp index 55d2726..f945c33 100644 --- a/sys-tune/source/main.cpp +++ b/sys-tune/source/main.cpp @@ -97,16 +97,16 @@ int main(int argc, char *argv[]) { GpioPadSession headphone_detect_session; R_ABORT_UNLESS(gpioOpenSession(&headphone_detect_session, GpioPadName(0x15))); - os::Thread gpioThread; - os::Thread pscThread; - os::Thread audioThread; - R_ABORT_UNLESS(gpioThread.Initialize(tune::impl::GpioThreadFunc, &headphone_detect_session, 0x1000, 0x20)); - R_ABORT_UNLESS(pscThread.Initialize(tune::impl::PscThreadFunc, &pm_module, 0x1000, 0x20)); - R_ABORT_UNLESS(audioThread.Initialize(tune::impl::AudioThreadFunc, nullptr, 0x2000, 0x20)); + ::Thread gpioThread; + ::Thread pscThread; + ::Thread audioThread; + R_ABORT_UNLESS(threadCreate(&gpioThread, tune::impl::GpioThreadFunc, &headphone_detect_session, nullptr, 0x1000, 0x20, -2)); + R_ABORT_UNLESS(threadCreate(&pscThread, tune::impl::PscThreadFunc, &pm_module, nullptr, 0x1000, 0x20, -2)); + R_ABORT_UNLESS(threadCreate(&audioThread, tune::impl::AudioThreadFunc, nullptr, nullptr, 0x2000, 0x20, -2)); - R_ABORT_UNLESS(gpioThread.Start()); - R_ABORT_UNLESS(pscThread.Start()); - R_ABORT_UNLESS(audioThread.Start()); + R_ABORT_UNLESS(threadStart(&gpioThread)); + R_ABORT_UNLESS(threadStart(&pscThread)); + R_ABORT_UNLESS(threadStart(&audioThread)); /* Create services */ R_ABORT_UNLESS(g_server_manager.RegisterServer(MusicServiceName, MusicMaxSessions)); @@ -115,13 +115,13 @@ int main(int argc, char *argv[]) { tune::impl::Exit(); - R_ABORT_UNLESS(gpioThread.Wait()); - R_ABORT_UNLESS(pscThread.Wait()); - R_ABORT_UNLESS(audioThread.Wait()); + R_ABORT_UNLESS(threadWaitForExit(&gpioThread)); + R_ABORT_UNLESS(threadWaitForExit(&pscThread)); + R_ABORT_UNLESS(threadWaitForExit(&audioThread)); - R_ABORT_UNLESS(gpioThread.Join()); - R_ABORT_UNLESS(pscThread.Join()); - R_ABORT_UNLESS(audioThread.Join()); + R_ABORT_UNLESS(threadClose(&gpioThread)); + R_ABORT_UNLESS(threadClose(&pscThread)); + R_ABORT_UNLESS(threadClose(&audioThread)); /* Close gpio session. */ gpioPadClose(&headphone_detect_session);