本文整理汇总了C++中logs::channel::trace方法的典型用法代码示例。如果您正苦于以下问题:C++ channel::trace方法的具体用法?C++ channel::trace怎么用?C++ channel::trace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logs::channel
的用法示例。
在下文中一共展示了channel::trace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cellPadPeriphGetInfo
s32 cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
{
sys_io.trace("cellPadPeriphGetInfo(info=*0x%x)", info);
const auto handler = fxm::get<PadHandlerBase>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
const PadInfo& rinfo = handler->GetInfo();
info->max_connect = rinfo.max_connect;
info->now_connect = rinfo.now_connect;
info->system_info = rinfo.system_info;
std::vector<Pad>& pads = handler->GetPads();
// TODO: Support other types of controllers
for (u32 i = 0; i < CELL_PAD_MAX_PORT_NUM; ++i)
{
if (i >= pads.size())
break;
info->port_status[i] = pads[i].m_port_status;
info->port_setting[i] = pads[i].m_port_setting;
info->device_capability[i] = pads[i].m_device_capability;
info->device_type[i] = pads[i].m_device_type;
info->pclass_type[i] = CELL_PAD_PCLASS_TYPE_STANDARD;
info->pclass_profile[i] = 0x0;
}
return CELL_OK;
}
示例2: sys_event_queue_tryreceive
error_code sys_event_queue_tryreceive(u32 equeue_id, vm::ptr<sys_event_t> event_array, s32 size, vm::ptr<u32> number)
{
sys_event.trace("sys_event_queue_tryreceive(equeue_id=0x%x, event_array=*0x%x, size=%d, number=*0x%x)", equeue_id, event_array, size, number);
const auto queue = idm::get<lv2_obj, lv2_event_queue>(equeue_id);
if (!queue)
{
return CELL_ESRCH;
}
if (queue->type != SYS_PPU_QUEUE)
{
return CELL_EINVAL;
}
semaphore_lock lock(queue->mutex);
s32 count = 0;
while (queue->sq.empty() && count < size && !queue->events.empty())
{
auto& dest = event_array[count++];
auto event = queue->events.front();
queue->events.pop_front();
std::tie(dest.source, dest.data1, dest.data2, dest.data3) = event;
}
*number = count;
return CELL_OK;
}
示例3: sys_spu_thread_group_yield
s32 sys_spu_thread_group_yield(u32 id)
{
sys_spu.trace("sys_spu_thread_group_yield(id=0x%x)", id);
LV2_LOCK;
const auto group = idm::get<lv2_spu_group_t>(id);
if (!group)
{
return CELL_ESRCH;
}
if (group->type & SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT) // this check may be inaccurate
{
return CELL_OK;
}
if (group->state != SPU_THREAD_GROUP_STATUS_RUNNING)
{
return CELL_ESTAT;
}
// SPU_THREAD_GROUP_STATUS_READY state is not used, so this function does nothing
return CELL_OK;
}
示例4: cellFsClosedir
s32 cellFsClosedir(u32 fd)
{
cellFs.trace("cellFsClosedir(fd=0x%x)", fd);
// call the syscall
return sys_fs_closedir(fd);
}
示例5: cellVideoOutGetState
error_code cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutState> state)
{
cellSysutil.trace("cellVideoOutGetState(videoOut=%d, deviceIndex=%d, state=*0x%x)", videoOut, deviceIndex, state);
if (deviceIndex) return CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND;
switch (videoOut)
{
case CELL_VIDEO_OUT_PRIMARY:
state->state = CELL_VIDEO_OUT_OUTPUT_STATE_ENABLED;
state->colorSpace = CELL_VIDEO_OUT_COLOR_SPACE_RGB;
state->displayMode.resolutionId = g_video_out_resolution_id.at(g_cfg.video.resolution); // TODO
state->displayMode.scanMode = CELL_VIDEO_OUT_SCAN_MODE_PROGRESSIVE;
state->displayMode.conversion = CELL_VIDEO_OUT_DISPLAY_CONVERSION_NONE;
state->displayMode.aspect = g_video_out_aspect_id.at(g_cfg.video.aspect_ratio); // TODO
state->displayMode.refreshRates = CELL_VIDEO_OUT_REFRESH_RATE_59_94HZ;
return CELL_OK;
case CELL_VIDEO_OUT_SECONDARY:
*state = { CELL_VIDEO_OUT_OUTPUT_STATE_DISABLED }; // ???
return CELL_OK;
}
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
示例6: cellFsRead
s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
{
cellFs.trace("cellFsRead(fd=0x%x, buf=0x%x, nbytes=0x%llx, nread=0x%x)", fd, buf, nbytes, nread);
// call the syscall
return sys_fs_read(fd, buf, nbytes, nread ? nread : vm::var<u64>{});
}
示例7: cellFsWriteWithOffset
ppu_error_code cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr<void> buf, u64 data_size, vm::ptr<u64> nwrite)
{
cellFs.trace("cellFsWriteWithOffset(fd=%d, offset=0x%llx, buf=*0x%x, data_size=0x%llx, nwrite=*0x%x)", fd, offset, buf, data_size, nwrite);
if (!buf)
{
if (nwrite) *nwrite = 0;
return CELL_EFAULT;
}
if (fd - 3 > 252)
{
if (nwrite) *nwrite = 0;
return CELL_EBADF;
}
vm::var<lv2_file_op_rw> arg;
arg->_vtable = vm::cast(0xfa8b0000); // Intentionally wrong (provide correct vtable if necessary)
arg->op = 0x8000000b;
arg->fd = fd;
arg->buf = vm::const_ptr_cast<void>(buf);
arg->offset = offset;
arg->size = data_size;
// Call the syscall
const s32 rc = sys_fs_fcntl(fd, 0x8000000b, arg, arg.size());
// Write size written
if (nwrite) *nwrite = rc && rc != CELL_EFSSPECIFIC ? 0 : arg->out_size.value();
return NOT_AN_ERROR(rc ? rc : arg->out_code.value());
}
示例8: cellPadGetCapabilityInfo
error_code cellPadGetCapabilityInfo(u32 port_no, vm::ptr<CellPadCapabilityInfo> info)
{
sys_io.trace("cellPadGetCapabilityInfo(port_no=%d, data_addr:=0x%x)", port_no, info.addr());
const auto handler = fxm::get<pad_thread>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
if (port_no >= CELL_MAX_PADS || !info)
return CELL_PAD_ERROR_INVALID_PARAMETER;
const auto& pads = handler->GetPads();
if (port_no >= pads.size() || port_no >= handler->GetInfo().max_connect)
return CELL_PAD_ERROR_NO_DEVICE;
const auto pad = pads[port_no];
if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED))
return CELL_PAD_ERROR_NO_DEVICE;
// Should return the same as device capability mask, psl1ght has it backwards in pad->h
info->info[port_no] = pad->m_device_capability;
return CELL_OK;
}
示例9: cellPadSetPortSetting
error_code cellPadSetPortSetting(u32 port_no, u32 port_setting)
{
sys_io.trace("cellPadSetPortSetting(port_no=%d, port_setting=0x%x)", port_no, port_setting);
const auto handler = fxm::get<pad_thread>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
if (port_no >= CELL_MAX_PADS)
return CELL_PAD_ERROR_INVALID_PARAMETER;
const auto& pads = handler->GetPads();
// CELL_PAD_ERROR_NO_DEVICE is not returned in this case.
// TODO: Set the setting regardless
if (port_no >= pads.size() || port_no >= handler->GetInfo().max_connect)
return CELL_OK;
const auto pad = pads[port_no];
pad->m_port_setting = port_setting;
// can also return CELL_PAD_ERROR_UNSUPPORTED_GAMEPAD
return CELL_OK;
}
示例10: cellPadGetInfo
error_code cellPadGetInfo(vm::ptr<CellPadInfo> info)
{
sys_io.trace("cellPadGetInfo(info=*0x%x)", info);
const auto handler = fxm::get<pad_thread>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
if (!info)
return CELL_PAD_ERROR_INVALID_PARAMETER;
std::memset(info.get_ptr(), 0, sizeof(CellPadInfo));
const PadInfo& rinfo = handler->GetInfo();
info->max_connect = rinfo.max_connect;
info->now_connect = rinfo.now_connect;
info->system_info = rinfo.system_info;
const auto& pads = handler->GetPads();
for (u32 i = 0; i < CELL_MAX_PADS; ++i)
{
if (i >= pads.size())
break;
info->status[i] = pads[i]->m_port_status;
pads[i]->m_port_status &= ~CELL_PAD_STATUS_ASSIGN_CHANGES;
info->product_id[i] = 0x0268;
info->vendor_id[i] = 0x054C;
}
return CELL_OK;
}
示例11: sizeof
error_code cellPadGetInfo2(vm::ptr<CellPadInfo2> info)
{
sys_io.trace("cellPadGetInfo2(info=*0x%x)", info);
const auto handler = fxm::get<pad_thread>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
if (!info)
return CELL_PAD_ERROR_INVALID_PARAMETER;
std::memset(info.get_ptr(), 0, sizeof(CellPadInfo2));
const PadInfo& rinfo = handler->GetInfo();
info->max_connect = rinfo.max_connect;
info->now_connect = rinfo.now_connect;
info->system_info = rinfo.system_info;
const auto& pads = handler->GetPads();
for (u32 i = 0; i < CELL_PAD_MAX_PORT_NUM; ++i)
{
if (i >= pads.size())
break;
info->port_status[i] = pads[i]->m_port_status;
pads[i]->m_port_status &= ~CELL_PAD_STATUS_ASSIGN_CHANGES;
info->port_setting[i] = pads[i]->m_port_setting;
info->device_capability[i] = pads[i]->m_device_capability;
info->device_type[i] = pads[i]->m_device_type;
}
return CELL_OK;
}
示例12: cellPadSetActDirect
error_code cellPadSetActDirect(u32 port_no, vm::ptr<CellPadActParam> param)
{
sys_io.trace("cellPadSetActDirect(port_no=%d, param=*0x%x)", port_no, param);
const auto handler = fxm::get<pad_thread>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
if (port_no >= CELL_MAX_PADS || !param)
return CELL_PAD_ERROR_INVALID_PARAMETER;
const auto& pads = handler->GetPads();
if (port_no >= pads.size() || port_no >= handler->GetInfo().max_connect)
return CELL_PAD_ERROR_NO_DEVICE;
const auto pad = pads[port_no];
if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED))
return CELL_PAD_ERROR_NO_DEVICE;
// TODO: find out if this is checked here or later or at all
if (!(pad->m_device_capability & CELL_PAD_CAPABILITY_ACTUATOR))
return CELL_PAD_ERROR_UNSUPPORTED_GAMEPAD;
// make sure reserved bits are 0. Looks like this happens after checking the pad status
for (int i = 0; i < 6; i++)
if (param->reserved[i])
return CELL_PAD_ERROR_INVALID_PARAMETER;
handler->SetRumble(port_no, param->motor[1], param->motor[0] > 0);
return CELL_OK;
}
示例13: cellPadPeriphGetData
error_code cellPadPeriphGetData(u32 port_no, vm::ptr<CellPadPeriphData> data)
{
sys_io.trace("cellPadPeriphGetData(port_no=%d, data=*0x%x)", port_no, data);
const auto handler = fxm::get<pad_thread>();
if (!handler)
return CELL_PAD_ERROR_UNINITIALIZED;
// port_no can only be 0-6 in this function
if (port_no >= CELL_PAD_MAX_PORT_NUM || !data)
return CELL_PAD_ERROR_INVALID_PARAMETER;
const auto& pads = handler->GetPads();
if (port_no >= pads.size() || port_no >= handler->GetInfo().max_connect)
return CELL_PAD_ERROR_NO_DEVICE;
const auto pad = pads[port_no];
if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED))
return CELL_PAD_ERROR_NO_DEVICE;
// todo: support for 'unique' controllers, which goes in offsets 24+ in padData
data->pclass_type = CELL_PAD_PCLASS_TYPE_STANDARD;
data->pclass_profile = 0x0;
return cellPadGetData(port_no, vm::get_addr(&data->cellpad_data));
}
示例14: cellSysutilCheckCallback
s32 cellSysutilCheckCallback(ppu_thread& ppu)
{
cellSysutil.trace("cellSysutilCheckCallback()");
const auto cbm = fxm::get_always<sysutil_cb_manager>();
while (true)
{
std::lock_guard<std::mutex> lock(cbm->mutex);
if (cbm->registered.empty())
{
break;
}
const auto func = std::move(cbm->registered.front());
cbm->registered.pop();
if (s32 res = func(ppu))
{
return res;
}
}
return CELL_OK;
}
示例15: cellMouseGetData
s32 cellMouseGetData(u32 port_no, vm::ptr<CellMouseData> data)
{
sys_io.trace("cellMouseGetData(port_no=%d, data=*0x%x)", port_no, data);
const auto handler = fxm::get<MouseHandlerBase>();
if (!handler)
{
return CELL_MOUSE_ERROR_UNINITIALIZED;
}
if (port_no >= handler->GetMice().size())
{
return CELL_MOUSE_ERROR_NO_DEVICE;
}
MouseData& current_data = handler->GetData(port_no);
data->update = current_data.update;
data->buttons = current_data.buttons;
data->x_axis = current_data.x_axis;
data->y_axis = current_data.y_axis;
data->wheel = current_data.wheel;
data->tilt = current_data.tilt;
current_data.update = CELL_MOUSE_DATA_NON;
current_data.x_axis = 0;
current_data.y_axis = 0;
current_data.wheel = 0;
return CELL_OK;
}