mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
Fixed x64 compilation errors & cellFsGetFreeSize
This commit is contained in:
parent
4770e5af08
commit
05db17b2b0
4 changed files with 23 additions and 2 deletions
|
@ -299,7 +299,7 @@ bool SELFDecrypter::LoadMetadata()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform AES-CTR encryption on the metadata headers.
|
// Perform AES-CTR encryption on the metadata headers.
|
||||||
u32 ctr_nc_off = 0;
|
size_t ctr_nc_off = 0;
|
||||||
u8 ctr_stream_block[0x10];
|
u8 ctr_stream_block[0x10];
|
||||||
aes_setkey_enc(&aes, meta_info.key, 128);
|
aes_setkey_enc(&aes, meta_info.key, 128);
|
||||||
aes_crypt_ctr(&aes, metadata_headers_size, &ctr_nc_off, meta_info.iv, ctr_stream_block, metadata_headers, metadata_headers);
|
aes_crypt_ctr(&aes, metadata_headers_size, &ctr_nc_off, meta_info.iv, ctr_stream_block, metadata_headers, metadata_headers);
|
||||||
|
@ -347,7 +347,7 @@ bool SELFDecrypter::DecryptData()
|
||||||
// Parse the metadata section headers to find the offsets of encrypted data.
|
// Parse the metadata section headers to find the offsets of encrypted data.
|
||||||
for (int i = 0; i < meta_hdr.section_count; i++)
|
for (int i = 0; i < meta_hdr.section_count; i++)
|
||||||
{
|
{
|
||||||
u32 ctr_nc_off = 0;
|
size_t ctr_nc_off = 0;
|
||||||
u8 ctr_stream_block[0x10];
|
u8 ctr_stream_block[0x10];
|
||||||
u8 data_key[0x10];
|
u8 data_key[0x10];
|
||||||
u8 data_iv[0x10];
|
u8 data_iv[0x10];
|
||||||
|
|
|
@ -294,5 +294,6 @@ void sys_fs_init()
|
||||||
sys_fs.AddFunc(0xdb869f20, cellFsAioInit);
|
sys_fs.AddFunc(0xdb869f20, cellFsAioInit);
|
||||||
sys_fs.AddFunc(0x9f951810, cellFsAioFinish);
|
sys_fs.AddFunc(0x9f951810, cellFsAioFinish);
|
||||||
sys_fs.AddFunc(0x1a108ab7, cellFsGetBlockSize);
|
sys_fs.AddFunc(0x1a108ab7, cellFsGetBlockSize);
|
||||||
|
sys_fs.AddFunc(0xaa3b4bcd, cellFsGetFreeSize);
|
||||||
aio_init = false;
|
aio_init = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,6 +261,7 @@ extern int cellFsFtruncate(u32 fd, u64 size);
|
||||||
extern int cellFsTruncate(u32 path_addr, u64 size);
|
extern int cellFsTruncate(u32 path_addr, u64 size);
|
||||||
extern int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size);
|
extern int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size);
|
||||||
extern int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size);
|
extern int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size);
|
||||||
|
extern int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count);
|
||||||
|
|
||||||
//cellVideo
|
//cellVideo
|
||||||
extern int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr);
|
extern int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr);
|
||||||
|
|
|
@ -465,3 +465,22 @@ int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size)
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
|
||||||
|
{
|
||||||
|
const wxString& ps3_path = Memory.ReadString(path_addr);
|
||||||
|
sys_fs.Warning("cellFsGetFreeSize(path=\"%s\", block_size_addr=0x%x, block_count_addr=0x%x)",
|
||||||
|
ps3_path.wx_str(), block_size.GetAddr(), block_count.GetAddr());
|
||||||
|
|
||||||
|
if (Memory.IsGoodAddr(path_addr) || !block_size.IsGood() || !block_count.IsGood())
|
||||||
|
return CELL_EFAULT;
|
||||||
|
|
||||||
|
if (ps3_path.empty())
|
||||||
|
return CELL_EINVAL;
|
||||||
|
|
||||||
|
// TODO: Get real values. Currently, it always returns 40 GB of free space divided in 4 KB blocks
|
||||||
|
block_size = 4096; // ?
|
||||||
|
block_count = 10485760; // ?
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue