mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-09-18 15:32:33 +00:00
Merge pull request #876 from tambry/master
CellVideoOut fix, formatting fixes and Travis compiling fix
This commit is contained in:
commit
8f5d9b2c0e
6 changed files with 88 additions and 57 deletions
|
@ -16,8 +16,8 @@ enum VideoErrorCode
|
||||||
|
|
||||||
enum CellVideoOut
|
enum CellVideoOut
|
||||||
{
|
{
|
||||||
CELL_VIDEO_OUT_PRIMARY,
|
CELL_VIDEO_OUT_PRIMARY = 0,
|
||||||
CELL_VIDEO_OUT_SECONDARY,
|
CELL_VIDEO_OUT_SECONDARY = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CellVideoOutResolutionId
|
enum CellVideoOutResolutionId
|
||||||
|
|
|
@ -124,9 +124,11 @@ s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<be_t<u64>> nread)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
if (nbytes != (u32)nbytes) return CELL_ENOMEM;
|
if (nbytes != (u32)nbytes)
|
||||||
|
return CELL_ENOMEM;
|
||||||
|
|
||||||
// TODO: checks
|
// TODO: checks
|
||||||
|
|
||||||
|
@ -276,9 +278,8 @@ s32 cellFsFstat(u32 fd, vm::ptr<CellFsStat> sb)
|
||||||
|
|
||||||
IDType type;
|
IDType type;
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE) {
|
if (!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE)
|
||||||
return CELL_ESRCH;
|
return CELL_ESRCH;
|
||||||
}
|
|
||||||
|
|
||||||
sb->st_mode =
|
sb->st_mode =
|
||||||
CELL_FS_S_IRUSR | CELL_FS_S_IWUSR | CELL_FS_S_IXUSR |
|
CELL_FS_S_IRUSR | CELL_FS_S_IWUSR | CELL_FS_S_IXUSR |
|
||||||
|
@ -307,6 +308,7 @@ s32 cellFsMkdir(vm::ptr<const char> path, u32 mode)
|
||||||
|
|
||||||
if (vfsDir().IsExists(_path))
|
if (vfsDir().IsExists(_path))
|
||||||
return CELL_EEXIST;
|
return CELL_EEXIST;
|
||||||
|
|
||||||
if (!Emu.GetVFS().CreateDir(_path))
|
if (!Emu.GetVFS().CreateDir(_path))
|
||||||
return CELL_EBUSY;
|
return CELL_EBUSY;
|
||||||
|
|
||||||
|
@ -426,9 +428,9 @@ s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<be_t<u64>> pos)
|
||||||
|
|
||||||
IDType type;
|
IDType type;
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if (!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE) {
|
if (!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE)
|
||||||
return CELL_ESRCH;
|
return CELL_ESRCH;
|
||||||
}
|
|
||||||
*pos = file->Seek(offset, seek_mode);
|
*pos = file->Seek(offset, seek_mode);
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -441,9 +443,9 @@ s32 cellFsFtruncate(u32 fd, u64 size)
|
||||||
|
|
||||||
IDType type;
|
IDType type;
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if (!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE) {
|
if (!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE)
|
||||||
return CELL_ESRCH;
|
return CELL_ESRCH;
|
||||||
}
|
|
||||||
u64 initialSize = file->GetSize();
|
u64 initialSize = file->GetSize();
|
||||||
|
|
||||||
if (initialSize < size)
|
if (initialSize < size)
|
||||||
|
@ -504,7 +506,8 @@ s32 cellFsFGetBlockSize(u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64> block_siz
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
*sector_size = 4096; // ?
|
*sector_size = 4096; // ?
|
||||||
*block_size = 4096; // ?
|
*block_size = 4096; // ?
|
||||||
|
@ -585,17 +588,16 @@ s32 cellFsStReadInit(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
fs_config.m_ring_buffer = *ringbuf;
|
fs_config.m_ring_buffer = *ringbuf;
|
||||||
|
|
||||||
// If the size is less than 1MB
|
// If the size is less than 1MB
|
||||||
if(ringbuf->ringbuf_size < 0x40000000) {
|
if (ringbuf->ringbuf_size < 0x40000000)
|
||||||
fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024);
|
fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024);
|
fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024);
|
||||||
}
|
|
||||||
|
|
||||||
// alloc memory
|
// alloc memory
|
||||||
fs_config.m_buffer = (u32)Memory.Alloc(fs_config.m_alloc_mem_size, 1024);
|
fs_config.m_buffer = (u32)Memory.Alloc(fs_config.m_alloc_mem_size, 1024);
|
||||||
|
@ -613,7 +615,8 @@ s32 cellFsStReadFinish(u32 fd)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
Memory.Free(fs_config.m_buffer);
|
Memory.Free(fs_config.m_buffer);
|
||||||
fs_config.m_fs_status = CELL_FS_ST_NOT_INITIALIZED;
|
fs_config.m_fs_status = CELL_FS_ST_NOT_INITIALIZED;
|
||||||
|
@ -628,7 +631,8 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
*ringbuf = fs_config.m_ring_buffer;
|
*ringbuf = fs_config.m_ring_buffer;
|
||||||
|
|
||||||
|
@ -644,7 +648,8 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
*status = fs_config.m_fs_status;
|
*status = fs_config.m_fs_status;
|
||||||
|
|
||||||
|
@ -658,7 +663,8 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
*regid = fs_config.m_regid;
|
*regid = fs_config.m_regid;
|
||||||
|
|
||||||
|
@ -672,7 +678,8 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
fs_config.m_current_addr = fs_config.m_buffer + (u32)offset;
|
fs_config.m_current_addr = fs_config.m_buffer + (u32)offset;
|
||||||
fs_config.m_fs_status = CELL_FS_ST_PROGRESS;
|
fs_config.m_fs_status = CELL_FS_ST_PROGRESS;
|
||||||
|
@ -687,7 +694,8 @@ s32 cellFsStReadStop(u32 fd)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
fs_config.m_fs_status = CELL_FS_ST_STOP;
|
fs_config.m_fs_status = CELL_FS_ST_STOP;
|
||||||
|
|
||||||
|
@ -701,7 +709,8 @@ s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr<u64> rsize)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
// TODO: use ringbuffer (fs_config)
|
// TODO: use ringbuffer (fs_config)
|
||||||
fs_config.m_regid += size;
|
fs_config.m_regid += size;
|
||||||
|
@ -721,7 +730,8 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -733,7 +743,8 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -745,7 +756,8 @@ s32 cellFsStReadWait(u32 fd, u64 size)
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -757,7 +769,8 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr<void (*)(int xfd, u64 xsi
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if (!sys_fs->CheckId(fd, file))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,7 @@ u32 EventFlag::check()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_protocol == SYS_SYNC_PRIORITY)
|
if (m_protocol == SYS_SYNC_PRIORITY)
|
||||||
{
|
|
||||||
target = sq.pop_prio();
|
target = sq.pop_prio();
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
@ -42,13 +40,13 @@ s32 sys_event_flag_create(vm::ptr<u32> eflag_id, vm::ptr<sys_event_flag_attr> at
|
||||||
sys_event_flag.Warning("sys_event_flag_create(eflag_id_addr=0x%x, attr_addr=0x%x, init=0x%llx)",
|
sys_event_flag.Warning("sys_event_flag_create(eflag_id_addr=0x%x, attr_addr=0x%x, init=0x%llx)",
|
||||||
eflag_id.addr(), attr.addr(), init);
|
eflag_id.addr(), attr.addr(), init);
|
||||||
|
|
||||||
if (eflag_id.addr() == NULL)
|
if (!eflag_id)
|
||||||
{
|
{
|
||||||
sys_event_flag.Error("sys_event_flag_create(): invalid memory access (eflag_id_addr=0x%x)", eflag_id.addr());
|
sys_event_flag.Error("sys_event_flag_create(): invalid memory access (eflag_id_addr=0x%x)", eflag_id.addr());
|
||||||
return CELL_EFAULT;
|
return CELL_EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr.addr() == NULL)
|
if (!attr)
|
||||||
{
|
{
|
||||||
sys_event_flag.Error("sys_event_flag_create(): invalid memory access (attr_addr=0x%x)", attr.addr());
|
sys_event_flag.Error("sys_event_flag_create(): invalid memory access (attr_addr=0x%x)", attr.addr());
|
||||||
return CELL_EFAULT;
|
return CELL_EFAULT;
|
||||||
|
@ -64,9 +62,7 @@ s32 sys_event_flag_create(vm::ptr<u32> eflag_id, vm::ptr<sys_event_flag_attr> at
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr->pshared.ToBE() != se32(0x200))
|
if (attr->pshared.ToBE() != se32(0x200))
|
||||||
{
|
|
||||||
return CELL_EINVAL;
|
return CELL_EINVAL;
|
||||||
}
|
|
||||||
|
|
||||||
switch (attr->type.ToBE())
|
switch (attr->type.ToBE())
|
||||||
{
|
{
|
||||||
|
@ -370,7 +366,7 @@ s32 sys_event_flag_get(u32 eflag_id, vm::ptr<u64> flags)
|
||||||
{
|
{
|
||||||
sys_event_flag.Log("sys_event_flag_get(eflag_id=%d, flags_addr=0x%x)", eflag_id, flags.addr());
|
sys_event_flag.Log("sys_event_flag_get(eflag_id=%d, flags_addr=0x%x)", eflag_id, flags.addr());
|
||||||
|
|
||||||
if (flags.addr() == NULL)
|
if (!flags)
|
||||||
{
|
{
|
||||||
sys_event_flag.Error("sys_event_flag_create(): invalid memory access (flags_addr=0x%x)", flags.addr());
|
sys_event_flag.Error("sys_event_flag_create(): invalid memory access (flags_addr=0x%x)", flags.addr());
|
||||||
return CELL_EFAULT;
|
return CELL_EFAULT;
|
||||||
|
|
|
@ -76,13 +76,24 @@ void sys_game_process_exitspawn(
|
||||||
for (auto &arg : argv) {
|
for (auto &arg : argv) {
|
||||||
sys_process.Log("argument: %s", arg.c_str());
|
sys_process.Log("argument: %s", arg.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &en : env) {
|
for (auto &en : env) {
|
||||||
sys_process.Log("env_argument: %s", en.c_str());
|
sys_process.Log("env_argument: %s", en.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: execute the file in <path> with the args in argv
|
//TODO: execute the file in <path> with the args in argv
|
||||||
//and the environment parameters in envp and copy the data
|
//and the environment parameters in envp and copy the data
|
||||||
//from data_addr into the adress space of the new process
|
//from data_addr into the adress space of the new process
|
||||||
//then kill the current process
|
//then kill the current process
|
||||||
|
|
||||||
|
Emu.Pause();
|
||||||
|
sys_process.Success("Process finished");
|
||||||
|
|
||||||
|
CallAfter([]()
|
||||||
|
{
|
||||||
|
Emu.Stop();
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,13 +135,24 @@ void sys_game_process_exitspawn2(
|
||||||
for (auto &arg : argv) {
|
for (auto &arg : argv) {
|
||||||
sys_process.Log("argument: %s", arg.c_str());
|
sys_process.Log("argument: %s", arg.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &en : env) {
|
for (auto &en : env) {
|
||||||
sys_process.Log("env_argument: %s", en.c_str());
|
sys_process.Log("env_argument: %s", en.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: execute the file in <path> with the args in argv
|
//TODO: execute the file in <path> with the args in argv
|
||||||
//and the environment parameters in envp and copy the data
|
//and the environment parameters in envp and copy the data
|
||||||
//from data_addr into the adress space of the new process
|
//from data_addr into the adress space of the new process
|
||||||
//then kill the current process
|
//then kill the current process
|
||||||
|
|
||||||
|
Emu.Pause();
|
||||||
|
sys_process.Success("Process finished");
|
||||||
|
|
||||||
|
CallAfter([]()
|
||||||
|
{
|
||||||
|
Emu.Stop();
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ void KernelExplorer::Update()
|
||||||
sprintf(name, "Modules (%d)", count);
|
sprintf(name, "Modules (%d)", count);
|
||||||
const auto& node = m_tree->AppendItem(root, name);
|
const auto& node = m_tree->AppendItem(root, name);
|
||||||
const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_PRX);
|
const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_PRX);
|
||||||
sprintf(name, "Segment List (%d)", 2 * objects.size()); // TODO: Assuming 2 segments per PRX file is not good
|
sprintf(name, "Segment List (%l)", 2 * objects.size()); // TODO: Assuming 2 segments per PRX file is not good
|
||||||
m_tree->AppendItem(node, name);
|
m_tree->AppendItem(node, name);
|
||||||
for (const auto& id : objects)
|
for (const auto& id : objects)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue