Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rajkosto/rpcs3 into mgs4
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkosto committed Oct 14, 2019
2 parents 6d49a32 + c0c8f34 commit 8891010
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Utilities/JIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,18 @@ void asmjit::build_transaction_enter(asmjit::X86Assembler& c, asmjit::Label fall
}
else
{
// Don't repeat on explicit XABORT instruction (workaround)
c.test(x86::eax, _XABORT_EXPLICIT);
c.jnz(fallback);

// Count an attempt without RETRY flag as 65 normal attempts and continue
c.push(x86::rax);
c.not_(x86::eax);
c.and_(x86::eax, _XABORT_RETRY);
c.shl(x86::eax, 5);
c.add(x86::eax, 1); // eax = RETRY ? 1 : 65
c.add(ctr, x86::rax);
c.pop(x86::rax);
}

c.cmp(ctr, less_than);
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/Emu/Cell/Modules/cellAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ error_code cellAudioInit()
g_audio->ports[i].number = i;
g_audio->ports[i].addr = g_audio_buffer + AUDIO_PORT_OFFSET * i;
g_audio->ports[i].index = g_audio_indices + i;
g_audio->ports[i].state = audio_port_state::closed;
}

g_audio->init = 1;
Expand All @@ -973,6 +974,7 @@ error_code cellAudioQuit(ppu_thread& ppu)
}

// TODO
g_audio->keys.clear();
g_audio->init = 0;

return CELL_OK;
Expand Down
14 changes: 14 additions & 0 deletions rpcs3/Emu/Cell/Modules/cellCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ error_code cellCameraEnd()

// TODO
g_camera->init = 0;
g_camera->reset_state();
return CELL_OK;
}

Expand Down Expand Up @@ -1356,6 +1357,19 @@ void camera_context::operator()()
}
}

void camera_context::reset_state()
{
read_mode = CELL_CAMERA_READ_FUNCCALL;
is_streaming = false;
is_attached = false;
is_open = false;
info.framerate = 0;
std::memset(&attr, 0, sizeof(attr));

std::scoped_lock lock(mutex_notify_data_map);
notify_data_map.clear();
}

void camera_context::send_attach_state(bool attached)
{
std::lock_guard lock(mutex_notify_data_map);
Expand Down
3 changes: 2 additions & 1 deletion rpcs3/Emu/Cell/Modules/cellCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ class camera_context

public:
void operator()();
void reset_state();
void send_attach_state(bool attached);
void set_attr(s32 attrib, u32 arg1, u32 arg2);

Expand Down Expand Up @@ -388,7 +389,7 @@ class camera_context
atomic_t<bool> is_attached{false};
atomic_t<bool> is_open{false};

CellCameraInfoEx info;
CellCameraInfoEx info{};

struct attr_t
{
Expand Down
3 changes: 2 additions & 1 deletion rpcs3/Emu/Cell/Modules/cellMic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void mic_context::load_config_and_init()
{
auto device_list = fmt::split(g_cfg.audio.microphone_devices, {"@@@"});

if (device_list.size())
if (device_list.size() && mic_list.empty())
{
switch (g_cfg.audio.microphone_type)
{
Expand Down Expand Up @@ -481,6 +481,7 @@ s32 cellMicEnd(ppu_thread& ppu)

// TODO
mic_thr->init = 0;
mic_thr->event_queue_key = 0;

return CELL_OK;
}
Expand Down

0 comments on commit 8891010

Please sign in to comment.