Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some cleanup and log messages silencing #7116

Merged
merged 2 commits into from
Dec 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions rpcs3/Emu/Cell/Modules/cellCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ error_code cellCameraGetType(s32 dev_num, vm::ptr<s32> type)

s32 cellCameraIsAvailable(s32 dev_num)
{
cellCamera.todo("cellCameraIsAvailable(dev_num=%d)", dev_num);
cellCamera.warning("cellCameraIsAvailable(dev_num=%d)", dev_num);

if (g_cfg.io.camera == camera_handler::null)
{
Expand All @@ -611,7 +611,7 @@ s32 cellCameraIsAvailable(s32 dev_num)

s32 cellCameraIsAttached(s32 dev_num)
{
cellCamera.todo("cellCameraIsAttached(dev_num=%d)", dev_num);
cellCamera.warning("cellCameraIsAttached(dev_num=%d)", dev_num);

if (g_cfg.io.camera == camera_handler::null)
{
Expand Down Expand Up @@ -650,7 +650,7 @@ s32 cellCameraIsAttached(s32 dev_num)

s32 cellCameraIsOpen(s32 dev_num)
{
cellCamera.todo("cellCameraIsOpen(dev_num=%d)", dev_num);
cellCamera.warning("cellCameraIsOpen(dev_num=%d)", dev_num);

if (g_cfg.io.camera == camera_handler::null)
{
Expand All @@ -674,9 +674,9 @@ s32 cellCameraIsOpen(s32 dev_num)
return g_camera->is_open;
}

error_code cellCameraIsStarted(s32 dev_num)
s32 cellCameraIsStarted(s32 dev_num)
{
cellCamera.todo("cellCameraIsStarted(dev_num=%d)", dev_num);
cellCamera.warning("cellCameraIsStarted(dev_num=%d)", dev_num);

if (g_cfg.io.camera == camera_handler::null)
{
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/Modules/cellDmux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Demuxer : public ppu_thread
{
DemuxerTask task;
DemuxerStream stream = {};
ElementaryStream* esALL[96]; memset(esALL, 0, sizeof(esALL));
ElementaryStream* esALL[96]{};
ElementaryStream** esAVC = &esALL[0]; // AVC (max 16 minus M2V count)
ElementaryStream** esM2V = &esALL[16]; // M2V (max 16 minus AVC count)
ElementaryStream** esDATA = &esALL[32]; // user data (max 16)
Expand Down
20 changes: 10 additions & 10 deletions rpcs3/Emu/Cell/Modules/cellGem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static bool ds3_input_to_pad(const u32 port_no, be_t<u16>& digital_buttons, be_t
}
}

memset(&digital_buttons, 0, sizeof(digital_buttons));
digital_buttons = 0;

// map the Move key to R1 and the Trigger to R2

Expand Down Expand Up @@ -310,10 +310,10 @@ static bool mouse_input_to_pad(const u32 mouse_no, be_t<u16>& digital_buttons, b
return false;
}

memset(&digital_buttons, 0, sizeof(digital_buttons));

const auto& mouse_data = handler->GetMice().at(0);

digital_buttons = 0;

if ((mouse_data.buttons & CELL_MOUSE_BUTTON_1) && (mouse_data.buttons & CELL_MOUSE_BUTTON_2))
digital_buttons |= CELL_GEM_CTRL_CIRCLE;
if (mouse_data.buttons & CELL_MOUSE_BUTTON_3)
Expand Down Expand Up @@ -732,7 +732,7 @@ error_code cellGemGetImageState(u32 gem_num, vm::ptr<CellGemImageState> gem_imag

error_code cellGemGetInertialState(u32 gem_num, u32 state_flag, u64 timestamp, vm::ptr<CellGemInertialState> inertial_state)
{
cellGem.todo("cellGemGetInertialState(gem_num=%d, state_flag=%d, timestamp=0x%x, inertial_state=0x%x)", gem_num, state_flag, timestamp, inertial_state);
cellGem.warning("cellGemGetInertialState(gem_num=%d, state_flag=%d, timestamp=0x%x, inertial_state=0x%x)", gem_num, state_flag, timestamp, inertial_state);

const auto gem = g_fxo->get<gem_config>();

Expand Down Expand Up @@ -767,7 +767,7 @@ error_code cellGemGetInertialState(u32 gem_num, u32 state_flag, u64 timestamp, v

error_code cellGemGetInfo(vm::ptr<CellGemInfo> info)
{
cellGem.todo("cellGemGetInfo(info=*0x%x)", info);
cellGem.warning("cellGemGetInfo(info=*0x%x)", info);

const auto gem = g_fxo->get<gem_config>();

Expand Down Expand Up @@ -864,7 +864,7 @@ error_code cellGemGetRumble(u32 gem_num, vm::ptr<u8> rumble)

error_code cellGemGetState(u32 gem_num, u32 flag, u64 time_parameter, vm::ptr<CellGemState> gem_state)
{
cellGem.todo("cellGemGetState(gem_num=%d, flag=0x%x, time=0x%llx, gem_state=*0x%x)", gem_num, flag, time_parameter, gem_state);
cellGem.warning("cellGemGetState(gem_num=%d, flag=0x%x, time=0x%llx, gem_state=*0x%x)", gem_num, flag, time_parameter, gem_state);

const auto gem = g_fxo->get<gem_config>();

Expand Down Expand Up @@ -1247,7 +1247,7 @@ error_code cellGemTrackHues(vm::cptr<u32> req_hues, vm::ptr<u32> res_hues)

error_code cellGemUpdateFinish()
{
cellGem.todo("cellGemUpdateFinish()");
cellGem.warning("cellGemUpdateFinish()");

const auto gem = g_fxo->get<gem_config>();

Expand All @@ -1265,15 +1265,15 @@ error_code cellGemUpdateFinish()

if (!gem->camera_frame)
{
return CELL_GEM_NO_VIDEO;
return not_an_error(CELL_GEM_NO_VIDEO);
}

return CELL_OK;
}

error_code cellGemUpdateStart(vm::cptr<void> camera_frame, u64 timestamp)
{
cellGem.todo("cellGemUpdateStart(camera_frame=*0x%x, timestamp=%d)", camera_frame, timestamp);
cellGem.warning("cellGemUpdateStart(camera_frame=*0x%x, timestamp=%d)", camera_frame, timestamp);

const auto gem = g_fxo->get<gem_config>();

Expand All @@ -1293,7 +1293,7 @@ error_code cellGemUpdateStart(vm::cptr<void> camera_frame, u64 timestamp)
gem->camera_frame = camera_frame.addr();
if (!camera_frame)
{
return CELL_GEM_NO_VIDEO;
return not_an_error(CELL_GEM_NO_VIDEO);
}

return CELL_OK;
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/Emu/Cell/Modules/cellKb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ error_code cellKbGetInfo(vm::ptr<CellKbInfo> info)
if (!info)
return CELL_KB_ERROR_INVALID_PARAMETER;

std::memset(info.get_ptr(), 0, info.size());

std::lock_guard<std::mutex> lock(handler->m_mutex);

const KbInfo& current_info = handler->GetInfo();
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/Modules/cellL10n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ s32 _ConvertStr(s32 src_code, const void *src, s32 src_len, s32 dst_code, void *
s32 _L10nConvertStr(s32 src_code, vm::cptr<void> src, vm::cptr<s32> src_len, s32 dst_code, vm::ptr<void> dst, vm::ptr<s32> dst_len)
{
s32 dstLen = *dst_len;
s32 result = _ConvertStr(src_code, src.get_ptr(), *src_len, dst_code, dst == vm::null ? NULL : dst.get_ptr(), &dstLen, false);
s32 result = _ConvertStr(src_code, src.get_ptr(), *src_len, dst_code, dst ? dst.get_ptr() : nullptr, &dstLen, false);
*dst_len = dstLen;
return result;
}
Expand Down Expand Up @@ -413,7 +413,7 @@ s32 jstrnchk(vm::cptr<u8> src, s32 src_len)

for (s32 len = 0; len < src_len; len++)
{
if (src != vm::null)
if (src)
{
if (*src >= 0xa1 && *src <= 0xfe)
{
Expand Down Expand Up @@ -1274,7 +1274,7 @@ s32 UTF16stoUTF8s(vm::cptr<u16> utf16, vm::ref<s32> utf16_len, vm::ptr<u8> utf8,
// return SRCIllegal;
//}

if (utf8 != vm::null)
if (utf8)
{
if (len > max_len)
{
Expand Down
5 changes: 4 additions & 1 deletion rpcs3/Emu/Cell/Modules/cellMouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ error_code cellMouseGetInfo(vm::ptr<CellMouseInfo> info)
return CELL_MOUSE_ERROR_INVALID_PARAMETER;
}

std::memset(info.get_ptr(), 0, info.size());

const MouseInfo& current_info = handler->GetInfo();
info->max_connect = current_info.max_connect;
info->now_connect = current_info.now_connect;
Expand Down Expand Up @@ -192,13 +194,14 @@ error_code cellMouseGetData(u32 port_no, vm::ptr<CellMouseData> data)
return CELL_MOUSE_ERROR_NO_DEVICE;
}

std::memset(data.get_ptr(), 0, data.size());

// TODO: check if (current_info.mode[port_no] != CELL_MOUSE_INFO_TABLET_MOUSE_MODE) has any impact

MouseDataList& data_list = handler->GetDataList(port_no);

if (data_list.empty())
{
*data = {};
return CELL_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/Modules/cellNetCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ error_code cellNetCtlNetStartDialogUnloadAsync(vm::ptr<CellNetCtlNetStartDialogR

error_code cellNetCtlGetNatInfo(vm::ptr<CellNetCtlNatInfo> natInfo)
{
cellNetCtl.todo("cellNetCtlGetNatInfo(natInfo=*0x%x)", natInfo);
cellNetCtl.warning("cellNetCtlGetNatInfo(natInfo=*0x%x)", natInfo);

if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
{
Expand Down
7 changes: 3 additions & 4 deletions rpcs3/Emu/Cell/Modules/cellOskDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ error_code cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dia
std::memset(osk->osk_text, 0, sizeof(osk->osk_text));
std::memset(osk->osk_text_old, 0, sizeof(osk->osk_text_old));

if (inputFieldInfo->init_text.addr() != 0)
if (inputFieldInfo->init_text)
{
for (u32 i = 0; (i < maxLength) && (inputFieldInfo->init_text[i] != 0); i++)
{
Expand All @@ -124,10 +124,9 @@ error_code cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dia

// Get message to display above the input field
// Guarantees 0 terminated (+1). In praxis only 128 but for now lets display all of it
char16_t message[CELL_OSKDIALOG_STRING_SIZE + 1];
std::memset(message, 0, sizeof(message));
char16_t message[CELL_OSKDIALOG_STRING_SIZE + 1]{};

if (inputFieldInfo->message.addr() != 0)
if (inputFieldInfo->message)
{
for (u32 i = 0; (i < CELL_OSKDIALOG_STRING_SIZE) && (inputFieldInfo->message[i] != 0); i++)
{
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/Modules/cellPngDec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ s32 pngDecSetParameter(PStream stream, PInParam in_param, POutParam out_param, P
// This shouldnt ever happen, but not sure what to do if it does, just want it logged for now
if (stream->info.bitDepth != 16 && in_param->outputBitDepth == 16)
cellPngDec.error("Output depth of 16 with non input depth of 16 specified!");
if (in_param->commandPtr != vm::null)
if (in_param->commandPtr)
cellPngDec.warning("Ignoring CommandPtr.");

if (stream->info.colorSpace != in_param->outputColorSpace)
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/Modules/cellSpurs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3691,7 +3691,7 @@ s32 _cellSpursTasksetAttribute2Initialize(vm::ptr<CellSpursTasksetAttribute2> at
{
cellSpurs.warning("_cellSpursTasksetAttribute2Initialize(attribute=*0x%x, revision=%d)", attribute, revision);

memset(attribute.get_ptr(), 0, sizeof(CellSpursTasksetAttribute2));
std::memset(attribute.get_ptr(), 0, attribute.size());
attribute->revision = revision;
attribute->name = vm::null;
attribute->args = 0;
Expand Down Expand Up @@ -3960,11 +3960,11 @@ s32 _cellSpursTasksetAttributeInitialize(vm::ptr<CellSpursTasksetAttribute> attr
}
}

memset(attribute.get_ptr(), 0, sizeof(CellSpursTasksetAttribute));
std::memset(attribute.get_ptr(), 0, attribute.size());
attribute->revision = revision;
attribute->sdk_version = sdk_version;
attribute->args = args;
memcpy(attribute->priority, priority.get_ptr(), 8);
std::memcpy(attribute->priority, priority.get_ptr(), 8);
attribute->taskset_size = 6400/*CellSpursTaskset::size*/;
attribute->max_contention = max_contention;
return CELL_OK;
Expand Down
33 changes: 12 additions & 21 deletions rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,16 +903,14 @@ void spursSysServiceMain(spu_thread& spu, u32 pollStatus)
spursSysServiceCleanupAfterSystemWorkload(spu, ctxt);

// Trace - SERVICE: INIT
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_SERVICE;
pkt.data.service.incident = CELL_SPURS_TRACE_SERVICE_INIT;
cellSpursModulePutTrace(&pkt, ctxt->dmaTagId);
}

// Trace - START: Module='SYS '
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_START;
memcpy(pkt.data.start.module, "SYS ", 4);
pkt.data.start.level = 1; // Policy module
Expand All @@ -928,14 +926,13 @@ void spursSysServiceMain(spu_thread& spu, u32 pollStatus)
if (cellSpursModulePollStatus(spu, nullptr))
{
// Trace - SERVICE: EXIT
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_SERVICE;
pkt.data.service.incident = CELL_SPURS_TRACE_SERVICE_EXIT;
cellSpursModulePutTrace(&pkt, ctxt->dmaTagId);

// Trace - STOP: GUID
memset(&pkt, 0, sizeof(pkt));
pkt = {};
pkt.header.tag = CELL_SPURS_TRACE_TAG_STOP;
pkt.data.stop = SPURS_GUID_SYS_WKL;
cellSpursModulePutTrace(&pkt, ctxt->dmaTagId);
Expand All @@ -956,8 +953,7 @@ void spursSysServiceMain(spu_thread& spu, u32 pollStatus)
// If we reach here it means that the SPU is idling

// Trace - SERVICE: WAIT
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_SERVICE;
pkt.data.service.incident = CELL_SPURS_TRACE_SERVICE_WAIT;
cellSpursModulePutTrace(&pkt, ctxt->dmaTagId);
Expand Down Expand Up @@ -1287,8 +1283,7 @@ void spursSysServiceCleanupAfterSystemWorkload(spu_thread& spu, SpursKernelConte
ctxt->wklCurrentId = wklId;

// Trace - STOP: GUID
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_STOP;
pkt.data.stop = SPURS_GUID_SYS_WKL;
cellSpursModulePutTrace(&pkt, ctxt->dmaTagId);
Expand Down Expand Up @@ -1638,8 +1633,7 @@ void spursTasksetExit(spu_thread& spu)
auto ctxt = vm::_ptr<SpursTasksetContext>(spu.offset + 0x2700);

// Trace - STOP
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = 0x54; // Its not clear what this tag means exactly but it seems similar to CELL_SPURS_TRACE_TAG_STOP
pkt.data.stop = SPURS_GUID_TASKSET_PM;
cellSpursModulePutTrace(&pkt, ctxt->dmaTagId);
Expand Down Expand Up @@ -1755,8 +1749,7 @@ void spursTasksetDispatch(spu_thread& spu)
taskInfo->elf.set(taskInfo->elf.addr() & 0xFFFFFFFFFFFFFFF8);

// Trace - Task: Incident=dispatch
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_TASK;
pkt.data.task.incident = CELL_SPURS_TRACE_TASK_DISPATCH;
pkt.data.task.taskId = taskId;
Expand Down Expand Up @@ -1791,7 +1784,7 @@ void spursTasksetDispatch(spu_thread& spu)
}

// Trace - GUID
memset(&pkt, 0, sizeof(pkt));
pkt = {};
pkt.header.tag = CELL_SPURS_TRACE_TAG_GUID;
pkt.data.guid = 0; // TODO: Put GUID of taskId here
cellSpursModulePutTrace(&pkt, 0x1F);
Expand Down Expand Up @@ -1845,7 +1838,7 @@ void spursTasksetDispatch(spu_thread& spu)
spu.set_ch_value(SPU_WrEventMask, ctxt->savedSpuWriteEventMask);

// Trace - GUID
memset(&pkt, 0, sizeof(pkt));
pkt = {};
pkt.header.tag = CELL_SPURS_TRACE_TAG_GUID;
pkt.data.guid = 0; // TODO: Put GUID of taskId here
cellSpursModulePutTrace(&pkt, 0x1F);
Expand Down Expand Up @@ -1949,8 +1942,7 @@ s32 spursTasksetProcessSyscall(spu_thread& spu, u32 syscallNum, u32 args)
if (incident)
{
// Trace - TASK
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = CELL_SPURS_TRACE_TAG_TASK;
pkt.data.task.incident = incident;
pkt.data.task.taskId = ctxt->taskId;
Expand Down Expand Up @@ -1982,8 +1974,7 @@ void spursTasksetInit(spu_thread& spu, u32 pollStatus)
kernelCtxt->moduleId[1] = 'K';

// Trace - START: Module='TKST'
CellSpursTracePacket pkt;
memset(&pkt, 0, sizeof(pkt));
CellSpursTracePacket pkt{};
pkt.header.tag = 0x52; // Its not clear what this tag means exactly but it seems similar to CELL_SPURS_TRACE_TAG_START
memcpy(pkt.data.start.module, "TKST", 4);
pkt.data.start.level = 2;
Expand Down