mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 20:24:01 +01:00
Add feature to cache ISOs in RAM to avoid I/O stutters. 64-bit only. Loading gets slow though.
TODO: Make it cache in the background on load. Allow on 32-bit for small ISOs.
This commit is contained in:
1 parent
0df4afce67
commit
291e5e53c0
6 files changed
+56
-4
No files matched your search
@@ -44,6 +44,20 @@ BlockDevice *constructBlockDevice(const char *filename) {
|
||||
return new FileBlockDevice(f);
|
||||
}
|
||||
|
||||
RAMBlockDevice::RAMBlockDevice(BlockDevice *device) {
|
||||
totalBlocks_ = device->GetNumBlocks();
|
||||
u32 blockSize = GetBlockSize();
|
||||
image_ = new u8[totalBlocks_ * blockSize];
|
||||
for (int i = 0; i < totalBlocks_; i++) {
|
||||
device->ReadBlock(i, image_ + i * blockSize);
|
||||
}
|
||||
delete device;
|
||||
}
|
||||
|
||||
RAMBlockDevice::~RAMBlockDevice() {
|
||||
delete[] image_;
|
||||
}
|
||||
|
||||
|
||||
// Android NDK does not support 64-bit file I/O using C streams
|
||||
// so we fall back onto syscalls
|
||||
|
||||
Reference in new issue
Block a user