ImDebugger: Add basic filesystem browser. Add partial support for "save file dialogs" to System.

This commit is contained in:
Henrik Rydgård
2024-11-25 23:03:15 +01:00
parent 20c4649963
commit 47d8e292eb
13 changed files with 165 additions and 43 deletions
+5 -9
View File
@@ -243,7 +243,7 @@ void VirtualDiscFileSystem::DoState(PointerWrap &p)
// We don't savestate handlers (loaded on fs load), but if they change, it may not load properly.
}
Path VirtualDiscFileSystem::GetLocalPath(std::string localpath) {
Path VirtualDiscFileSystem::GetLocalPath(std::string localpath) const {
if (localpath.empty())
return basePath;
@@ -303,18 +303,14 @@ int VirtualDiscFileSystem::getFileListIndex(std::string &fileName)
return (int)fileList.size()-1;
}
int VirtualDiscFileSystem::getFileListIndex(u32 accessBlock, u32 accessSize, bool blockMode)
{
for (size_t i = 0; i < fileList.size(); i++)
{
if (fileList[i].firstBlock <= accessBlock)
{
int VirtualDiscFileSystem::getFileListIndex(u32 accessBlock, u32 accessSize, bool blockMode) const {
for (size_t i = 0; i < fileList.size(); i++) {
if (fileList[i].firstBlock <= accessBlock) {
u32 sectorOffset = (accessBlock-fileList[i].firstBlock)*2048;
u32 totalFileSize = blockMode ? (fileList[i].totalSize+2047) & ~2047 : fileList[i].totalSize;
u32 endOffset = sectorOffset+accessSize;
if (endOffset <= totalFileSize)
{
if (endOffset <= totalFileSize) {
return (int)i;
}
}