mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 16:13:23 +00:00
Bugfix
This commit is contained in:
parent
2032b15acf
commit
fdc5fa34be
@ -280,13 +280,13 @@ void SPUThread::ProcessCmd(u32 cmd, u32 tag, u32 lsa, u64 ea, u32 size)
|
||||
{
|
||||
case MFC_PUT_CMD:
|
||||
{
|
||||
memcpy(vm::get_ptr<void>((u32)ea), vm::get_ptr<void>(ls_offset + lsa), size);
|
||||
memcpy(vm::get_ptr(vm::cast(ea)), vm::get_ptr(ls_offset + lsa), size);
|
||||
return;
|
||||
}
|
||||
|
||||
case MFC_GET_CMD:
|
||||
{
|
||||
memcpy(vm::get_ptr<void>(ls_offset + lsa), vm::get_ptr<void>((u32)ea), size);
|
||||
memcpy(vm::get_ptr(ls_offset + lsa), vm::get_ptr(vm::cast(ea)), size);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -470,13 +470,17 @@ void SPUThread::EnqMfcCmd(MFCReg& MFCArgs)
|
||||
{
|
||||
vm::reservation_op(ea, 128, [this, tag, lsa, ea]()
|
||||
{
|
||||
ProcessCmd(MFC_PUT_CMD, tag, lsa, ea, 128);
|
||||
memcpy(vm::get_priv_ptr(vm::cast(ea)), vm::get_ptr(ls_offset + lsa), 128);
|
||||
});
|
||||
|
||||
if (op == MFC_PUTLLUC_CMD)
|
||||
{
|
||||
MFCArgs.AtomicStat.PushUncond(MFC_PUTLLUC_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
// tag may be used here
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2229,8 +2229,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
|
||||
|
||||
temp.reset(new u8[out_bpp * out_w * out_h]);
|
||||
|
||||
AVPixelFormat in_format = m_color_format == 4 ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_BGRA; // ???
|
||||
AVPixelFormat out_format = m_color_conv_fmt == 7 ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_BGRA; // ???
|
||||
AVPixelFormat in_format = m_color_format == 4 ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_ARGB; // ???
|
||||
AVPixelFormat out_format = m_color_conv_fmt == 7 ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_ARGB; // ???
|
||||
|
||||
std::unique_ptr<SwsContext, void(*)(SwsContext*)> sws(sws_getContext(width, height, in_format, out_w, out_h, out_format, inter ? SWS_FAST_BILINEAR : SWS_POINT, NULL, NULL, NULL), sws_freeContext);
|
||||
|
||||
|
@ -18,6 +18,7 @@ void LogBase::LogOutput(LogType type, const std::string& text) const
|
||||
case LogWarning: LOG_WARNING(HLE, GetName() + ": " + text); break;
|
||||
case LogError: LOG_ERROR(HLE, GetName() + " error: " + text); break;
|
||||
case LogTodo: LOG_ERROR(HLE, GetName() + " TODO: " + text); break;
|
||||
case LogFatal: throw GetName() + " error: " + text;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ class LogBase
|
||||
LogSuccess,
|
||||
LogWarning,
|
||||
LogError,
|
||||
LogFatal,
|
||||
LogTodo,
|
||||
};
|
||||
|
||||
@ -68,6 +69,12 @@ public:
|
||||
LogPrepare(LogError, fmt, fmt::do_unveil(args)...);
|
||||
}
|
||||
|
||||
template<typename... Targs>
|
||||
__forceinline void Fatal(const char* fmt, Targs... args) const
|
||||
{
|
||||
LogPrepare(LogFatal, fmt, fmt::do_unveil(args)...);
|
||||
}
|
||||
|
||||
template<typename... Targs>
|
||||
__forceinline void Todo(const char* fmt, Targs... args) const
|
||||
{
|
||||
|
@ -679,7 +679,11 @@ int cellAdecGetPcm(u32 handle, vm::ptr<float> outBuffer)
|
||||
return CELL_ADEC_ERROR_EMPTY;
|
||||
}
|
||||
|
||||
AVFrame* frame = af.data;
|
||||
std::unique_ptr<AVFrame, void(*)(AVFrame*)> frame(af.data, [](AVFrame* frame)
|
||||
{
|
||||
av_frame_unref(frame);
|
||||
av_frame_free(&frame);
|
||||
});
|
||||
|
||||
if (outBuffer)
|
||||
{
|
||||
@ -766,13 +770,10 @@ int cellAdecGetPcm(u32 handle, vm::ptr<float> outBuffer)
|
||||
}
|
||||
else
|
||||
{
|
||||
cellAdec->Error("cellAdecGetPcm(): unsupported frame format (channels=%d, format=%d)", frame->channels, frame->format);
|
||||
Emu.Pause();
|
||||
cellAdec->Fatal("cellAdecGetPcm(): unsupported frame format (channels=%d, format=%d)", frame->channels, frame->format);
|
||||
}
|
||||
}
|
||||
|
||||
av_frame_unref(af.data);
|
||||
av_frame_free(&af.data);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -693,36 +693,35 @@ int cellVdecGetPicture(u32 handle, vm::ptr<const CellVdecPicFormat> format, vm::
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
std::unique_ptr<AVFrame, void(*)(AVFrame*)> frame(vf.data, [](AVFrame* frame)
|
||||
{
|
||||
av_frame_unref(frame);
|
||||
av_frame_free(&frame);
|
||||
});
|
||||
|
||||
if (outBuff)
|
||||
{
|
||||
const u32 buf_size = align(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1), 128);
|
||||
|
||||
if (format->formatType != CELL_VDEC_PICFMT_YUV420_PLANAR)
|
||||
{
|
||||
cellVdec->Todo("cellVdecGetPicture: unknown formatType(%d)", (u32)format->formatType);
|
||||
return CELL_OK;
|
||||
cellVdec->Fatal("cellVdecGetPicture: unknown formatType(%d)", format->formatType);
|
||||
}
|
||||
|
||||
if (format->colorMatrixType != CELL_VDEC_COLOR_MATRIX_TYPE_BT709)
|
||||
{
|
||||
cellVdec->Todo("cellVdecGetPicture: unknown colorMatrixType(%d)", (u32)format->colorMatrixType);
|
||||
return CELL_OK;
|
||||
cellVdec->Fatal("cellVdecGetPicture: unknown colorMatrixType(%d)", format->colorMatrixType);
|
||||
}
|
||||
|
||||
AVFrame& frame = *vf.data;
|
||||
const u32 buf_size = align(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1), 128);
|
||||
|
||||
// TODO: zero padding bytes
|
||||
|
||||
int err = av_image_copy_to_buffer(outBuff.get_ptr(), buf_size, frame.data, frame.linesize, vdec->ctx->pix_fmt, frame.width, frame.height, 1);
|
||||
int err = av_image_copy_to_buffer(outBuff.get_ptr(), buf_size, frame->data, frame->linesize, vdec->ctx->pix_fmt, frame->width, frame->height, 1);
|
||||
if (err < 0)
|
||||
{
|
||||
cellVdec->Error("cellVdecGetPicture: av_image_copy_to_buffer failed (err=0x%x)", err);
|
||||
Emu.Pause();
|
||||
cellVdec->Fatal("cellVdecGetPicture: av_image_copy_to_buffer failed (err=0x%x)", err);
|
||||
}
|
||||
}
|
||||
|
||||
av_frame_unref(vf.data);
|
||||
av_frame_free(&vf.data);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -863,8 +862,7 @@ int cellVdecGetPicItem(u32 handle, vm::ptr<u32> picItem_ptr)
|
||||
{
|
||||
auto mp2 = vm::ptr<CellVdecMpeg2Info>::make(info.addr() + sizeof(CellVdecPicItem));
|
||||
|
||||
cellVdec->Todo("cellVdecGetPicItem(MPEG2)");
|
||||
Emu.Pause();
|
||||
cellVdec->Fatal("cellVdecGetPicItem(MPEG2)");
|
||||
}
|
||||
|
||||
*picItem_ptr = info.addr();
|
||||
|
@ -128,7 +128,7 @@ int cellVpostExec(u32 handle, vm::ptr<const u8> inPicBuff, vm::ptr<const CellVpo
|
||||
//u64 stamp0 = get_system_time();
|
||||
std::unique_ptr<u8[]> pA(new u8[w*h]);
|
||||
|
||||
memset(pA.get(), (const u8)ctrlParam->outAlpha, w*h);
|
||||
memset(pA.get(), ctrlParam->outAlpha, w*h);
|
||||
|
||||
//u64 stamp1 = get_system_time();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user