Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,14 @@ extern void ppu_register_function_at(u32 addr, u32 size, ppu_intrp_func_t ptr =
return;
}

size = utils::align<u32>(size + addr % 4, 4);
addr &= -4;

if (g_cfg.core.ppu_decoder == ppu_decoder_type::llvm)
{
return;
}

size = utils::align<u32>(size + addr % 4, 4);
addr &= -4;

// Initialize interpreter cache
while (size)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "stdafx.h"
#include "../overlay_manager.h"
#include "overlay_friends_list_dialog.h"
#include "Emu/System.h"
#include "Emu/NP/rpcn_config.h"
#include "Emu/vfs_config.h"

Expand Down Expand Up @@ -306,11 +305,11 @@ namespace rsx
}
}

Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
return;
}
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
close_dialog = true;
break;
case pad_button::square:
Expand Down Expand Up @@ -359,7 +358,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "stdafx.h"
#include "overlay_home_menu_message_box.h"
#include "Emu/System.h"
#include "Emu/system_config.h"

namespace rsx
Expand Down Expand Up @@ -77,7 +76,7 @@ namespace rsx
{
case pad_button::cross:
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
if (m_on_accept)
{
m_on_accept();
Expand All @@ -86,7 +85,7 @@ namespace rsx
}
case pad_button::circle:
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
if (m_on_cancel)
{
m_on_cancel();
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
if (!is_auto_repeat || auto_repeat_interval_ms >= user_interface::m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
}
return func(button_press);
}
Expand All @@ -169,7 +169,7 @@ namespace rsx
}
case pad_button::circle:
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
if (parent)
{
set_current_page(parent);
Expand Down Expand Up @@ -244,7 +244,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
if (!is_auto_repeat || auto_repeat_interval_ms >= user_interface::m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
return page_navigation::stay;
}
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ namespace rsx
{
return_code = selection_code::error;
}
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
close_dialog = true;
break;
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
close_dialog = true;
break;
case pad_button::dpad_up:
Expand Down Expand Up @@ -167,7 +167,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace rsx
if (m_list->m_items.empty() || is_auto_repeat)
break;

Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);

if (!get_current_selection().empty())
{
Expand All @@ -95,7 +95,7 @@ namespace rsx
close_dialog = true;
break;
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
close_dialog = true;
break;
case pad_button::dpad_up:
Expand Down Expand Up @@ -131,7 +131,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace rsx
switch (button_press)
{
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
close_dialog = true;
break;
case pad_button::square:
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
7 changes: 3 additions & 4 deletions rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "overlay_media_list_dialog.h"

#include "Emu/Cell/Modules/cellMusic.h"
#include "Emu/System.h"
#include "Emu/VFS.h"
#include "Utilities/StrUtil.h"
#include "Utilities/Thread.h"
Expand Down Expand Up @@ -154,13 +153,13 @@ namespace rsx
return_code = m_list->get_selected_index();
m_stop_input_loop = true;
play_cursor_sound = false;
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
break;
case pad_button::circle:
return_code = selection_code::canceled;
m_stop_input_loop = true;
play_cursor_sound = false;
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
break;
case pad_button::dpad_up:
m_list->select_previous();
Expand All @@ -182,7 +181,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
if (play_cursor_sound && (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default))
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
9 changes: 3 additions & 6 deletions rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace rsx
return_code = CELL_MSGDIALOG_BUTTON_YES;
}

Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
break;
}
case pad_button::circle:
Expand All @@ -175,7 +175,7 @@ namespace rsx
return_code = CELL_MSGDIALOG_BUTTON_NO;
}

Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
break;
}
default: return;
Expand Down Expand Up @@ -238,10 +238,7 @@ namespace rsx

if (!type.se_mute_on)
{
if (type.se_normal)
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ok.wav");
else
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ng.wav");
play_sound(type.se_normal ? sound_effect::dialog_ok : sound_effect::dialog_error);
}

set_text(text);
Expand Down
8 changes: 4 additions & 4 deletions rpcs3/Emu/RSX/Overlays/overlay_osk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ namespace rsx
}
case pad_button::start:
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_oskenter.wav");
play_sound(sound_effect::osk_accept);
Close(CELL_OSKDIALOG_CLOSE_CONFIRM);
play_cursor_sound = false;
break;
Expand All @@ -840,15 +840,15 @@ namespace rsx
}
case pad_button::cross:
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_oskenter.wav");
play_sound(sound_effect::osk_accept);
on_accept();
m_reset_pulse = true;
play_cursor_sound = false;
break;
}
case pad_button::circle:
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_oskcancel.wav");
play_sound(sound_effect::osk_cancel);
Close(CELL_OSKDIALOG_CLOSE_CANCEL);
play_cursor_sound = false;
break;
Expand Down Expand Up @@ -890,7 +890,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
if (play_cursor_sound && (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default))
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}

if (m_reset_pulse)
Expand Down
7 changes: 3 additions & 4 deletions rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "overlay_save_dialog.h"
#include "overlay_video.h"
#include "Utilities/date_time.h"
#include "Emu/System.h"

namespace rsx
{
Expand Down Expand Up @@ -133,11 +132,11 @@ namespace rsx
if (m_no_saves)
break;
return_code = m_list->get_selected_index();
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
close_dialog = true;
break;
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
close_dialog = true;
break;
case pad_button::dpad_up:
Expand Down Expand Up @@ -173,7 +172,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "stdafx.h"
#include "overlay_trophy_notification.h"
#include "Emu/Cell/ErrorCodes.h"
#include "Emu/System.h"

namespace rsx
{
Expand Down Expand Up @@ -70,7 +69,7 @@ namespace rsx
{
// First tick
creation_time_us = timestamp_us;
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_trophy.wav");
play_sound(sound_effect::trophy);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ namespace rsx
{
return_code = selection_code::error;
}
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
play_sound(sound_effect::accept);
close_dialog = true;
break;
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
play_sound(sound_effect::cancel);
close_dialog = true;
break;
case pad_button::dpad_up:
Expand Down Expand Up @@ -153,7 +153,7 @@ namespace rsx
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
play_sound(sound_effect::cursor);
}
}

Expand Down
27 changes: 27 additions & 0 deletions rpcs3/Emu/RSX/Overlays/overlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,33 @@ namespace rsx
{
namespace overlays
{
std::string get_sound_filepath(sound_effect sound)
{
const auto get_sound_filename = [sound]()
{
switch (sound)
{
case sound_effect::cursor: return "snd_cursor"sv;
case sound_effect::accept: return "snd_decide"sv;
case sound_effect::cancel: return "snd_cancel"sv;
case sound_effect::osk_accept: return "snd_oskenter"sv;
case sound_effect::osk_cancel: return "snd_oskcancel"sv;
case sound_effect::dialog_ok: return "snd_system_ok"sv;
case sound_effect::dialog_error: return "snd_system_ng"sv;
case sound_effect::trophy: return "snd_trophy"sv;
}

fmt::throw_exception("Unreachable (sound=%d)", static_cast<u32>(sound));
};

return fmt::format("%ssounds/%s.wav", fs::get_config_dir(), get_sound_filename());
}

void play_sound(sound_effect sound, std::optional<f32> volume)
{
Emu.GetCallbacks().play_sound(get_sound_filepath(sound), volume);
}

thread_local DECLARE(user_interface::g_thread_bit) = 0;

u32 user_interface::alloc_thread_bit()
Expand Down
15 changes: 15 additions & 0 deletions rpcs3/Emu/RSX/Overlays/overlays.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ namespace rsx
{
namespace overlays
{
enum class sound_effect
{
cursor,
accept,
cancel,
osk_accept,
osk_cancel,
dialog_ok,
dialog_error,
trophy,
};

std::string get_sound_filepath(sound_effect sound);
void play_sound(sound_effect sound, std::optional<f32> volume = std::nullopt);

// Bitfield of UI signals to overlay manager
enum status_bits : u32
{
Expand Down
Loading
Loading