Merge pull request #286 from Nekotekina/master

Some bugs fixed
This commit is contained in:
Alexandro Sánchez Bach 2014-05-31 00:20:39 +02:00
commit a0cc3a0fb0
4 changed files with 21 additions and 15 deletions

View File

@ -1174,6 +1174,12 @@ void GLGSRender::Flip()
checkForGlError("glScissor");
}
for (uint i = 0; i<m_post_draw_objs.size(); ++i)
{
m_post_draw_objs[i].Draw();
}
m_frame->Flip(m_context);
static u8* src_buffer = nullptr;
static u32 width = 0;

View File

@ -140,7 +140,7 @@ int cellAudioInit()
auto buf = (be_t<float>*)&Memory[buf_addr];
static const float k = 0.5f; // may be 1.0f
static const float k = 1.0f; // may be 1.0f
const float m = port.level;
if (port.channel == 2)

View File

@ -112,7 +112,7 @@ int cellPamfGetHeaderSize(mem_ptr_t<PamfHeader> pAddr, u64 fileSize, mem64_t pSi
cellPamf.Warning("cellPamfGetHeaderSize(pAddr=0x%x, fileSize=%d, pSize_addr=0x%x)",
pAddr.GetAddr(), fileSize, pSize.GetAddr());
if (!pAddr.IsGood() || !pSize.IsGood())
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048) || !pSize.IsGood())
return CELL_PAMF_ERROR_INVALID_ARG;
//if ((u32)pAddr->magic != 0x464d4150)
@ -128,7 +128,7 @@ int cellPamfGetHeaderSize2(mem_ptr_t<PamfHeader> pAddr, u64 fileSize, u32 attrib
cellPamf.Warning("cellPamfGetHeaderSize2(pAddr=0x%x, fileSize=%d, attribute=0x%x, pSize_addr=0x%x)",
pAddr.GetAddr(), fileSize, attribute, pSize.GetAddr());
if (!pAddr.IsGood() || !pSize.IsGood())
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048) || !pSize.IsGood())
return CELL_PAMF_ERROR_INVALID_ARG;
//if ((u32)pAddr->magic != 0x464d4150)
@ -144,7 +144,7 @@ int cellPamfGetStreamOffsetAndSize(mem_ptr_t<PamfHeader> pAddr, u64 fileSize, me
cellPamf.Warning("cellPamfGetStreamOffsetAndSize(pAddr=0x%x, fileSize=%d, pOffset_addr=0x%x, pSize_addr=0x%x)",
pAddr.GetAddr(), fileSize, pOffset.GetAddr(), pSize.GetAddr());
if (!pAddr.IsGood() || !pOffset.IsGood() || !pSize.IsGood())
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048) || !pOffset.IsGood() || !pSize.IsGood())
return CELL_PAMF_ERROR_INVALID_ARG;
//if ((u32)pAddr->magic != 0x464d4150)
@ -161,7 +161,7 @@ int cellPamfVerify(mem_ptr_t<PamfHeader> pAddr, u64 fileSize)
{
cellPamf.Warning("cellPamfVerify(pAddr=0x%x, fileSize=%d)", pAddr.GetAddr(), fileSize);
if (!pAddr.IsGood())
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048))
return CELL_PAMF_ERROR_INVALID_ARG;
return CELL_OK;
@ -176,7 +176,7 @@ int cellPamfReaderInitialize(mem_ptr_t<CellPamfReader> pSelf, mem_ptr_t<PamfHead
cellPamf.Warning("cellPamfReaderInitialize(pSelf=0x%x, pAddr=0x%x, fileSize=%d, attribute=0x%x)",
pSelf.GetAddr(), pAddr.GetAddr(), fileSize, attribute);
if (!pSelf.IsGood() || !pAddr.IsGood())
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pAddr.GetAddr(), 2048))
return CELL_PAMF_ERROR_INVALID_ARG;
if (fileSize)

View File

@ -62,7 +62,7 @@ int sys_event_flag_destroy(u32 eflag_id)
int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 timeout)
{
sys_event_flag.Warning("sys_event_flag_wait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x, timeout=%lld)",
sys_event_flag.Log("sys_event_flag_wait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x, timeout=%lld)",
eflag_id, bitptn, mode, result.GetAddr(), timeout);
if (result.IsGood()) result = 0;
@ -133,7 +133,7 @@ int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64
while (true)
{
if (ef->signal.GetOwner() == tid)
if (ef->signal.unlock(tid, tid) == SMR_OK)
{
SMutexLocker lock(ef->m_mutex);
@ -200,7 +200,7 @@ int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64
int sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result)
{
sys_event_flag.Warning("sys_event_flag_trywait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x)",
sys_event_flag.Log("sys_event_flag_trywait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x)",
eflag_id, bitptn, mode, result.GetAddr());
if (result.IsGood()) result = 0;
@ -257,7 +257,7 @@ int sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result)
int sys_event_flag_set(u32 eflag_id, u64 bitptn)
{
sys_event_flag.Warning("sys_event_flag_set(eflag_id=%d, bitptn=0x%llx)", eflag_id, bitptn);
sys_event_flag.Log("sys_event_flag_set(eflag_id=%d, bitptn=0x%llx)", eflag_id, bitptn);
EventFlag* ef;
if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH;
@ -282,7 +282,7 @@ int sys_event_flag_set(u32 eflag_id, u64 bitptn)
int sys_event_flag_clear(u32 eflag_id, u64 bitptn)
{
sys_event_flag.Warning("sys_event_flag_clear(eflag_id=%d, bitptn=0x%llx)", eflag_id, bitptn);
sys_event_flag.Log("sys_event_flag_clear(eflag_id=%d, bitptn=0x%llx)", eflag_id, bitptn);
EventFlag* ef;
if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH;
@ -295,7 +295,7 @@ int sys_event_flag_clear(u32 eflag_id, u64 bitptn)
int sys_event_flag_cancel(u32 eflag_id, mem32_t num)
{
sys_event_flag.Warning("sys_event_flag_cancel(eflag_id=%d, num_addr=0x%x)", eflag_id, num.GetAddr());
sys_event_flag.Log("sys_event_flag_cancel(eflag_id=%d, num_addr=0x%x)", eflag_id, num.GetAddr());
EventFlag* ef;
if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH;
@ -314,7 +314,6 @@ int sys_event_flag_cancel(u32 eflag_id, mem32_t num)
for (u32 i = 0; i < tids.size(); i++)
{
if (Emu.IsStopped()) break;
ef->signal.lock(tids[i]);
}
@ -339,7 +338,7 @@ int sys_event_flag_cancel(u32 eflag_id, mem32_t num)
int sys_event_flag_get(u32 eflag_id, mem64_t flags)
{
sys_event_flag.Warning("sys_event_flag_get(eflag_id=%d, flags_addr=0x%x)", eflag_id, flags.GetAddr());
sys_event_flag.Log("sys_event_flag_get(eflag_id=%d, flags_addr=0x%x)", eflag_id, flags.GetAddr());
EventFlag* ef;
if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH;
@ -349,7 +348,8 @@ int sys_event_flag_get(u32 eflag_id, mem64_t flags)
return CELL_EFAULT;
}
flags = ef->flags; // ???
SMutexLocker lock(ef->m_mutex);
flags = ef->flags;
return CELL_OK;
}