This commit is contained in:
Nekotekina 2014-03-15 03:15:18 +04:00
commit 024aa0660c
9 changed files with 32 additions and 49 deletions

View File

@ -44,6 +44,8 @@ void OpenALThread::Init()
void OpenALThread::Quit()
{
m_context = alcGetCurrentContext();
m_device = alcGetContextsDevice(m_context);
alcMakeContextCurrent(nullptr);
alcDestroyContext(m_context);
alcCloseDevice(m_device);

View File

@ -139,7 +139,7 @@ struct AudioConfig //custom structure
: m_is_audio_initialized(false)
, m_is_audio_finalized(false)
, m_port_in_use(0)
, event_key(0)
, event_key(0x80004d494f323221)
, counter(0)
{
memset(&m_ports, 0, sizeof(AudioPortConfig) * AUDIO_PORT_COUNT);

View File

@ -375,33 +375,24 @@ bool GLGSRender::LoadProgram()
if(!m_cur_shader_prog)
{
ConLog.Warning("LoadProgram: m_cur_shader_prog == NULL");
return false;
}
m_fp_buf_num = m_prog_buffer.SearchFp(*m_cur_shader_prog, m_shader_prog);
if(m_fp_buf_num == -1) m_shader_prog.Decompile(*m_cur_shader_prog);
if(!m_cur_vertex_prog)
{
ConLog.Warning("LoadProgram: m_cur_vertex_prog == NULL");
return false;
}
//ConLog.Write("Create program");
m_fp_buf_num = m_prog_buffer.SearchFp(*m_cur_shader_prog, m_shader_prog);
m_vp_buf_num = m_prog_buffer.SearchVp(*m_cur_vertex_prog, m_vertex_prog);
if(m_vp_buf_num == -1)
{
ConLog.Warning("VP not found in buffer!");
m_vertex_prog.Decompile(*m_cur_vertex_prog);
}
//ConLog.Write("Create program");
if(m_fp_buf_num == -1)
{
ConLog.Warning("FP not found in buffer!");
m_shader_prog.Decompile(*m_cur_shader_prog);
m_shader_prog.Wait();
m_shader_prog.Compile();
checkForGlError("m_shader_prog.Compile");
@ -412,6 +403,8 @@ bool GLGSRender::LoadProgram()
if(m_vp_buf_num == -1)
{
ConLog.Warning("VP not found in buffer!");
m_vertex_prog.Decompile(*m_cur_vertex_prog);
m_vertex_prog.Wait();
m_vertex_prog.Compile();
checkForGlError("m_vertex_prog.Compile");

View File

@ -3,12 +3,12 @@
RSXTexture::RSXTexture()
{
m_index = 0;
m_index = 0;
}
RSXTexture::RSXTexture(u8 index)
{
m_index = index;
m_index = index;
}
void RSXTexture::Init()

View File

@ -333,29 +333,13 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
m_surface_width = (a0 >> 16) & 0xff;
m_surface_height = (a0 >> 24) & 0xff;
if(count >= 2)
switch (min((u32)6, count))
{
m_surface_pitch_a = ARGS(1);
if(count >= 3)
{
m_surface_offset_a = ARGS(2);
if(count >= 4)
{
m_surface_offset_z = ARGS(3);
if(count >= 5)
{
m_surface_offset_b = ARGS(4);
if(count >= 6)
{
m_surface_pitch_b = ARGS(5);
}
}
}
}
case 6: m_surface_pitch_b = ARGS(5);
case 5: m_surface_offset_b = ARGS(4);
case 4: m_surface_offset_z = ARGS(3);
case 3: m_surface_offset_a = ARGS(2);
case 2: m_surface_pitch_a = ARGS(1);
}
gcmBuffer* buffers = (gcmBuffer*)Memory.GetMemFromAddr(m_gcm_buffers_addr);

View File

@ -60,7 +60,7 @@ int cellAudioInit()
memset(buffer2, 0, sizeof(buffer2));
memset(oal_buffer.get(), 0, oal_buffer_size * sizeof(u16));
if(Ini.AudioOutMode.GetValue() == 1)
if(m_audio_out)
{
m_audio_out->Init();
m_audio_out->Open(oal_buffer.get(), oal_buffer_size*sizeof(u16));
@ -151,7 +151,10 @@ int cellAudioInit()
if(oal_buffer_offset >= oal_buffer_size)
{
m_audio_out->AddData(oal_buffer.get(), oal_buffer_offset * sizeof(u16));
if(m_audio_out)
{
m_audio_out->AddData(oal_buffer.get(), oal_buffer_offset * sizeof(u16));
}
oal_buffer_offset = 0;
}
@ -438,21 +441,22 @@ int cellAudioCreateNotifyEventQueue(mem32_t id, mem64_t key)
{
cellAudio.Warning("cellAudioCreateNotifyEventQueue(id_addr=0x%x, key_addr=0x%x)", id.GetAddr(), key.GetAddr());
if (Emu.GetEventManager().CheckKey(0x80004d494f323221))
while (Emu.GetEventManager().CheckKey(m_config.event_key))
{
return CELL_AUDIO_ERROR_EVENT_QUEUE;
m_config.event_key++; // experimental
//return CELL_AUDIO_ERROR_EVENT_QUEUE;
}
EventQueue* eq = new EventQueue(SYS_SYNC_FIFO, SYS_PPU_QUEUE, 0x80004d494f323221, 0x80004d494f323221, 32);
EventQueue* eq = new EventQueue(SYS_SYNC_FIFO, SYS_PPU_QUEUE, m_config.event_key, m_config.event_key, 32);
if (!Emu.GetEventManager().RegisterKey(eq, 0x80004d494f323221))
if (!Emu.GetEventManager().RegisterKey(eq, m_config.event_key))
{
delete eq;
return CELL_AUDIO_ERROR_EVENT_QUEUE;
}
id = cellAudio.GetNewId(eq);
key = 0x80004d494f323221;
key = m_config.event_key;
return CELL_OK;
}
@ -467,7 +471,7 @@ int cellAudioSetNotifyEventQueue(u64 key)
{
cellAudio.Warning("cellAudioSetNotifyEventQueue(key=0x%llx)", key);
m_config.event_key = key;
//m_config.event_key = key;
/*EventQueue* eq;
if (!Emu.GetEventManager().GetEventQueue(key, eq))
@ -496,7 +500,7 @@ int cellAudioRemoveNotifyEventQueue(u64 key)
return CELL_AUDIO_ERROR_PARAM;
}
m_config.event_key = 0;
m_config.event_key = 0x80004d494f323221;
// TODO: disconnect port

View File

@ -166,7 +166,7 @@ int cellSysmoduleLoadModule(u16 id)
return CELL_SYSMODULE_ERROR_UNKNOWN;
}
if(m->IsLoaded())
if(m->IsLoaded() && id != 0x10) // CELL_SYSMODULE_GCM_SYS and CELL_SYSMODULE_GCM share the same ID
{
return CELL_SYSMODULE_ERROR_DUPLICATED;
}

View File

@ -287,7 +287,7 @@ int sys_net_shutdown(s32 s, s32 how)
int sys_net_socket(s32 family, s32 type, s32 protocol)
{
sys_net.Warning("socket(family=%d, type=%d, protocol=%d", family, type, protocol);
sys_net.Warning("socket(family=%d, type=%d, protocol=%d)", family, type, protocol);
int ret = socket(family, type, protocol);
g_lastError = getLastError();
return ret;

View File

@ -416,7 +416,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue());
chbox_audio_dump->Enable(Emu.IsStopped());
cbox_audio_out->Enable(Emu.IsStopped());
//cbox_audio_out->Enable(Emu.IsStopped());
chbox_hle_logging->Enable(Emu.IsStopped());
cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0);