1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Improved VFS

- Implemended vfsDir.
- Improved vfsDevice.
- Improved vfsFile.
This commit is contained in:
DH 2014-02-16 17:19:06 +02:00
parent 5d59dae730
commit 321d323beb
36 changed files with 479 additions and 390 deletions

View File

@ -1,38 +1,52 @@
#pragma once
#include <chrono>
using namespace std::chrono;
class Timer
{
private:
bool stopped;
high_resolution_clock::time_point start;
high_resolution_clock::time_point end;
bool m_stopped;
std::chrono::high_resolution_clock::time_point m_start;
std::chrono::high_resolution_clock::time_point m_end;
public:
Timer() : stopped(false)
Timer() : m_stopped(false)
{
}
void Start()
{
stopped = false;
start = high_resolution_clock::now();
m_stopped = false;
m_start = std::chrono::high_resolution_clock::now();
}
void Stop()
{
stopped = true;
end = high_resolution_clock::now();
m_stopped = true;
m_end = std::chrono::high_resolution_clock::now();
}
double GetElapsedTimeInSec(){return GetElapsedTimeInMicroSec() / 1000000.0;}
double GetElapsedTimeInMilliSec(){return GetElapsedTimeInMicroSec() / 1000.0;}
double GetElapsedTimeInMicroSec()
double GetElapsedTimeInSec() const
{
if (!stopped)
end = high_resolution_clock::now();
return duration_cast<microseconds>(end - start).count();
return GetElapsedTimeInMicroSec() / 1000000.0;
}
double GetElapsedTimeInMilliSec() const
{
return GetElapsedTimeInMicroSec() / 1000.0;
}
double GetElapsedTimeInMicroSec() const
{
std::chrono::high_resolution_clock::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count();
}
double GetElapsedTimeInNanoSec() const
{
std::chrono::high_resolution_clock::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::nanoseconds>(now - m_start).count();
}
};

192
rpcs3.sln
View File

@ -1,7 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}"
ProjectSection(ProjectDependencies) = postProject
{CD478F02-7550-58A5-E085-CE4BC0C0AD23} = {CD478F02-7550-58A5-E085-CE4BC0C0AD23}
@ -124,10 +122,6 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DLL Debug|Win32 = DLL Debug|Win32
DLL Debug|x64 = DLL Debug|x64
DLL Release|Win32 = DLL Release|Win32
DLL Release|x64 = DLL Release|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
@ -136,14 +130,6 @@ Global
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|Win32.Build.0 = Debug|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.ActiveCfg = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.Build.0 = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Debug|Win32.ActiveCfg = Debug|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Debug|Win32.Build.0 = Debug|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Debug|x64.ActiveCfg = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Debug|x64.Build.0 = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Release|Win32.ActiveCfg = Release|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Release|Win32.Build.0 = Release|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Release|x64.ActiveCfg = Release|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.DLL Release|x64.Build.0 = Release|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|Win32.ActiveCfg = Release|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|Win32.Build.0 = Release|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.ActiveCfg = Release|x64
@ -152,14 +138,6 @@ Global
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|Win32.Build.0 = Debug|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|x64.ActiveCfg = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|x64.Build.0 = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Debug|x64.Build.0 = DLL Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Release|Win32.Build.0 = DLL Release|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Release|x64.ActiveCfg = DLL Release|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.DLL Release|x64.Build.0 = DLL Release|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|Win32.ActiveCfg = Release|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|Win32.Build.0 = Release|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|x64.ActiveCfg = Release|x64
@ -168,14 +146,6 @@ Global
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|Win32.Build.0 = Debug|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|x64.ActiveCfg = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|x64.Build.0 = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Debug|x64.Build.0 = DLL Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Release|Win32.Build.0 = DLL Release|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Release|x64.ActiveCfg = DLL Release|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.DLL Release|x64.Build.0 = DLL Release|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|Win32.ActiveCfg = Release|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|Win32.Build.0 = Release|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|x64.ActiveCfg = Release|x64
@ -184,14 +154,6 @@ Global
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|Win32.Build.0 = Debug|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|x64.ActiveCfg = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|x64.Build.0 = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Debug|x64.Build.0 = DLL Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Release|Win32.Build.0 = DLL Release|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Release|x64.ActiveCfg = DLL Release|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.DLL Release|x64.Build.0 = DLL Release|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|Win32.ActiveCfg = Release|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|Win32.Build.0 = Release|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|x64.ActiveCfg = Release|x64
@ -200,14 +162,6 @@ Global
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|Win32.Build.0 = Debug|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|x64.ActiveCfg = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|x64.Build.0 = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Debug|x64.Build.0 = DLL Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Release|Win32.Build.0 = DLL Release|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Release|x64.ActiveCfg = DLL Release|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.DLL Release|x64.Build.0 = DLL Release|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|Win32.ActiveCfg = Release|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|Win32.Build.0 = Release|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|x64.ActiveCfg = Release|x64
@ -216,14 +170,6 @@ Global
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|Win32.Build.0 = Debug|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|x64.ActiveCfg = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|x64.Build.0 = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Debug|x64.Build.0 = DLL Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Release|Win32.Build.0 = DLL Release|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Release|x64.ActiveCfg = DLL Release|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.DLL Release|x64.Build.0 = DLL Release|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|Win32.ActiveCfg = Release|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|Win32.Build.0 = Release|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|x64.ActiveCfg = Release|x64
@ -232,14 +178,6 @@ Global
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|Win32.Build.0 = Debug|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|x64.ActiveCfg = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|x64.Build.0 = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Debug|x64.Build.0 = DLL Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Release|Win32.Build.0 = DLL Release|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Release|x64.ActiveCfg = DLL Release|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.DLL Release|x64.Build.0 = DLL Release|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|Win32.ActiveCfg = Release|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|Win32.Build.0 = Release|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|x64.ActiveCfg = Release|x64
@ -248,14 +186,6 @@ Global
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|Win32.Build.0 = Debug|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|x64.ActiveCfg = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|x64.Build.0 = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Debug|x64.Build.0 = DLL Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Release|Win32.Build.0 = DLL Release|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Release|x64.ActiveCfg = DLL Release|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.DLL Release|x64.Build.0 = DLL Release|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|Win32.ActiveCfg = Release|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|Win32.Build.0 = Release|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|x64.ActiveCfg = Release|x64
@ -264,14 +194,6 @@ Global
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|Win32.Build.0 = Debug|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|x64.ActiveCfg = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|x64.Build.0 = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Debug|x64.Build.0 = DLL Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Release|Win32.Build.0 = DLL Release|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Release|x64.ActiveCfg = DLL Release|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.DLL Release|x64.Build.0 = DLL Release|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|Win32.ActiveCfg = Release|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|Win32.Build.0 = Release|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|x64.ActiveCfg = Release|x64
@ -280,14 +202,6 @@ Global
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|Win32.Build.0 = Debug|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|x64.ActiveCfg = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|x64.Build.0 = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Debug|x64.Build.0 = DLL Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Release|Win32.Build.0 = DLL Release|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Release|x64.ActiveCfg = DLL Release|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.DLL Release|x64.Build.0 = DLL Release|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|Win32.ActiveCfg = Release|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|Win32.Build.0 = Release|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|x64.ActiveCfg = Release|x64
@ -296,14 +210,6 @@ Global
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|Win32.Build.0 = Debug|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|x64.ActiveCfg = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|x64.Build.0 = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Debug|x64.Build.0 = DLL Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Release|Win32.Build.0 = DLL Release|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Release|x64.ActiveCfg = DLL Release|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.DLL Release|x64.Build.0 = DLL Release|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|Win32.ActiveCfg = Release|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|Win32.Build.0 = Release|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|x64.ActiveCfg = Release|x64
@ -312,14 +218,6 @@ Global
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|Win32.Build.0 = Debug|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|x64.ActiveCfg = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|x64.Build.0 = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Debug|x64.Build.0 = DLL Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Release|Win32.Build.0 = DLL Release|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Release|x64.ActiveCfg = DLL Release|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.DLL Release|x64.Build.0 = DLL Release|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|Win32.ActiveCfg = Release|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|Win32.Build.0 = Release|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|x64.ActiveCfg = Release|x64
@ -328,14 +226,6 @@ Global
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|Win32.Build.0 = Debug|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|x64.ActiveCfg = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|x64.Build.0 = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Debug|x64.Build.0 = DLL Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Release|Win32.Build.0 = DLL Release|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Release|x64.ActiveCfg = DLL Release|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.DLL Release|x64.Build.0 = DLL Release|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|Win32.ActiveCfg = Release|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|Win32.Build.0 = Release|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|x64.ActiveCfg = Release|x64
@ -344,14 +234,6 @@ Global
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|Win32.Build.0 = Debug|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|x64.ActiveCfg = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|x64.Build.0 = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Debug|x64.Build.0 = DLL Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Release|Win32.Build.0 = DLL Release|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Release|x64.ActiveCfg = DLL Release|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.DLL Release|x64.Build.0 = DLL Release|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|Win32.ActiveCfg = Release|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|Win32.Build.0 = Release|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|x64.ActiveCfg = Release|x64
@ -360,14 +242,6 @@ Global
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|Win32.Build.0 = Debug|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|x64.ActiveCfg = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|x64.Build.0 = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Debug|x64.Build.0 = DLL Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Release|Win32.Build.0 = DLL Release|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Release|x64.ActiveCfg = DLL Release|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.DLL Release|x64.Build.0 = DLL Release|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|Win32.ActiveCfg = Release|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|Win32.Build.0 = Release|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|x64.ActiveCfg = Release|x64
@ -376,14 +250,6 @@ Global
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|Win32.Build.0 = Debug|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|x64.ActiveCfg = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|x64.Build.0 = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Debug|x64.Build.0 = DLL Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Release|Win32.Build.0 = DLL Release|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Release|x64.ActiveCfg = DLL Release|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.DLL Release|x64.Build.0 = DLL Release|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|Win32.ActiveCfg = Release|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|Win32.Build.0 = Release|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|x64.ActiveCfg = Release|x64
@ -392,14 +258,6 @@ Global
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|Win32.Build.0 = Debug|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|x64.ActiveCfg = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|x64.Build.0 = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Debug|x64.Build.0 = DLL Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Release|Win32.Build.0 = DLL Release|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Release|x64.ActiveCfg = DLL Release|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.DLL Release|x64.Build.0 = DLL Release|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|Win32.ActiveCfg = Release|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|Win32.Build.0 = Release|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|x64.ActiveCfg = Release|x64
@ -408,14 +266,6 @@ Global
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|Win32.Build.0 = Debug|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|x64.ActiveCfg = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|x64.Build.0 = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Debug|x64.Build.0 = DLL Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Release|Win32.Build.0 = DLL Release|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Release|x64.ActiveCfg = DLL Release|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.DLL Release|x64.Build.0 = DLL Release|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|Win32.ActiveCfg = Release|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|Win32.Build.0 = Release|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|x64.ActiveCfg = Release|x64
@ -424,14 +274,6 @@ Global
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|Win32.Build.0 = Debug|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|x64.ActiveCfg = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|x64.Build.0 = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Debug|x64.Build.0 = DLL Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Release|Win32.Build.0 = DLL Release|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Release|x64.ActiveCfg = DLL Release|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.DLL Release|x64.Build.0 = DLL Release|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|Win32.ActiveCfg = Release|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|Win32.Build.0 = Release|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|x64.ActiveCfg = Release|x64
@ -440,14 +282,6 @@ Global
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|Win32.Build.0 = Debug|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|x64.ActiveCfg = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|x64.Build.0 = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Debug|x64.Build.0 = DLL Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Release|Win32.Build.0 = DLL Release|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Release|x64.ActiveCfg = DLL Release|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.DLL Release|x64.Build.0 = DLL Release|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|Win32.ActiveCfg = Release|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|Win32.Build.0 = Release|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|x64.ActiveCfg = Release|x64
@ -456,14 +290,6 @@ Global
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug|Win32.Build.0 = Debug|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug|x64.ActiveCfg = Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug|x64.Build.0 = Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Debug|x64.Build.0 = DLL Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Release|Win32.Build.0 = DLL Release|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Release|x64.ActiveCfg = DLL Release|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.DLL Release|x64.Build.0 = DLL Release|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Release|Win32.ActiveCfg = Release|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Release|Win32.Build.0 = Release|Win32
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Release|x64.ActiveCfg = Release|x64
@ -472,14 +298,6 @@ Global
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug|Win32.Build.0 = Debug|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug|x64.ActiveCfg = Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug|x64.Build.0 = Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Debug|x64.Build.0 = DLL Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Release|Win32.Build.0 = DLL Release|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Release|x64.ActiveCfg = DLL Release|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.DLL Release|x64.Build.0 = DLL Release|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Release|Win32.ActiveCfg = Release|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.Release|Win32.Build.0 = Release|Win32
{23E1C437-A951-5943-8639-A17F3CF2E606}.Release|x64.ActiveCfg = Release|x64
@ -488,14 +306,6 @@ Global
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug|Win32.Build.0 = Debug|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug|x64.ActiveCfg = Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug|x64.Build.0 = Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Debug|Win32.Build.0 = DLL Debug|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Debug|x64.ActiveCfg = DLL Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Debug|x64.Build.0 = DLL Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Release|Win32.ActiveCfg = DLL Release|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Release|Win32.Build.0 = DLL Release|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Release|x64.ActiveCfg = DLL Release|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.DLL Release|x64.Build.0 = DLL Release|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Release|Win32.ActiveCfg = Release|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Release|Win32.Build.0 = Release|Win32
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Release|x64.ActiveCfg = Release|x64

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "VFS.h"
#include "Emu/HDD/HDD.h"
#include "vfsDeviceLocalFile.h"
int sort_devices(const void* _a, const void* _b)
{
@ -22,7 +23,7 @@ void VFS::Mount(const wxString& ps3_path, const wxString& local_path, vfsDevice*
if(m_devices.GetCount() > 1)
{
std::qsort(m_devices.GetPtr(), m_devices.GetCount(), sizeof(vfsDevice*), sort_devices);
//std::qsort(m_devices.GetPtr(), m_devices.GetCount(), sizeof(vfsDevice*), sort_devices);
}
}
@ -49,37 +50,150 @@ void VFS::UnMountAll()
}
}
vfsStream* VFS::Open(const wxString& ps3_path, vfsOpenMode mode)
std::shared_ptr<vfsFileBase> VFS::OpenFile(const wxString& ps3_path, vfsOpenMode mode) const
{
vfsDevice* stream = nullptr;
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
stream = dev->GetNew();
stream->Open(path, mode);
if(std::shared_ptr<vfsFileBase> res = dev->GetNewFileStream())
{
res->Open(path, mode);
return res;
}
}
return stream;
return nullptr;
}
void VFS::Create(const wxString& ps3_path)
std::shared_ptr<vfsDirBase> VFS::OpenDir(const wxString& ps3_path) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
dev->Create(path);
if(std::shared_ptr<vfsDirBase> res = dev->GetNewDirStream())
{
res->Open(path);
return res;
}
}
return nullptr;
}
void VFS::Close(vfsStream*& device)
bool VFS::CreateFile(const wxString& ps3_path) const
{
delete device;
device = nullptr;
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
if(std::shared_ptr<vfsFileBase> res = dev->GetNewFileStream())
{
return res->Create(path);
}
}
return false;
}
vfsDevice* VFS::GetDevice(const wxString& ps3_path, wxString& path)
bool VFS::CreateDir(const wxString& ps3_path) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
if(std::shared_ptr<vfsDirBase> res = dev->GetNewDirStream())
{
return res->Create(path);
}
}
return false;
}
bool VFS::RemoveFile(const wxString& ps3_path) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
if(std::shared_ptr<vfsFileBase> res = dev->GetNewFileStream())
{
return res->Remove(path);
}
}
return false;
}
bool VFS::RemoveDir(const wxString& ps3_path) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
if(std::shared_ptr<vfsDirBase> res = dev->GetNewDirStream())
{
return res->Remove(path);
}
}
return false;
}
bool VFS::ExistsFile(const wxString& ps3_path) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
if(std::shared_ptr<vfsFileBase> res = dev->GetNewFileStream())
{
return res->Exists(path);
}
}
return false;
}
bool VFS::ExistsDir(const wxString& ps3_path) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path, path))
{
if(std::shared_ptr<vfsDirBase> res = dev->GetNewDirStream())
{
return res->IsExists(path);
}
}
return false;
}
bool VFS::RenameFile(const wxString& ps3_path_from, const wxString& ps3_path_to) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path_from, path))
{
if(std::shared_ptr<vfsFileBase> res = dev->GetNewFileStream())
{
return res->Rename(path, ps3_path_to);
}
}
return false;
}
bool VFS::RenameDir(const wxString& ps3_path_from, const wxString& ps3_path_to) const
{
wxString path;
if(vfsDevice* dev = GetDevice(ps3_path_from, path))
{
if(std::shared_ptr<vfsDirBase> res = dev->GetNewDirStream())
{
return res->Rename(path, ps3_path_to);
}
}
return false;
}
vfsDevice* VFS::GetDevice(const wxString& ps3_path, wxString& path) const
{
u32 max_eq;
s32 max_i=-1;
@ -101,14 +215,18 @@ vfsDevice* VFS::GetDevice(const wxString& ps3_path, wxString& path)
return &m_devices[max_i];
}
vfsDevice* VFS::GetDeviceLocal(const wxString& local_path, wxString& path)
vfsDevice* VFS::GetDeviceLocal(const wxString& local_path, wxString& path) const
{
u32 max_eq;
s32 max_i=-1;
wxFileName file_path(local_path);
file_path.Normalize();
wxString mormalized_path = file_path.GetFullPath();
for(u32 i=0; i<m_devices.GetCount(); ++i)
{
const u32 eq = m_devices[i].CmpLocalPath(local_path);
const u32 eq = m_devices[i].CmpLocalPath(mormalized_path);
if(max_i < 0 || eq > max_eq)
{
@ -135,11 +253,11 @@ void VFS::Init(const wxString& path)
switch(entries[i].device)
{
case vfsDevice_LocalFile:
dev = new vfsLocalFile();
dev = new vfsDeviceLocalFile();
break;
case vfsDevice_HDD:
dev = new vfsHDD(entries[i].device_path);
dev = new vfsDeviceHDD(entries[i].device_path);
break;
default:

View File

@ -36,11 +36,19 @@ struct VFS
void UnMount(const wxString& ps3_path);
void UnMountAll();
vfsStream* Open(const wxString& ps3_path, vfsOpenMode mode);
void Create(const wxString& ps3_path);
void Close(vfsStream*& device);
vfsDevice* GetDevice(const wxString& ps3_path, wxString& path);
vfsDevice* GetDeviceLocal(const wxString& local_path, wxString& path);
std::shared_ptr<vfsFileBase> OpenFile(const wxString& ps3_path, vfsOpenMode mode) const;
std::shared_ptr<vfsDirBase> OpenDir(const wxString& ps3_path) const;
bool CreateFile(const wxString& ps3_path) const;
bool CreateDir(const wxString& ps3_path) const;
bool RemoveFile(const wxString& ps3_path) const;
bool RemoveDir(const wxString& ps3_path) const;
bool ExistsFile(const wxString& ps3_path) const;
bool ExistsDir(const wxString& ps3_path) const;
bool RenameFile(const wxString& ps3_path_from, const wxString& ps3_path_to) const;
bool RenameDir(const wxString& ps3_path_from, const wxString& ps3_path_to) const;
vfsDevice* GetDevice(const wxString& ps3_path, wxString& path) const;
vfsDevice* GetDeviceLocal(const wxString& local_path, wxString& path) const;
void Init(const wxString& path);
void SaveLoadDevices(Array<VFSManagerEntry>& res, bool is_load);

View File

@ -45,14 +45,20 @@ u32 vfsDevice::CmpLocalPath(const wxString& local_path)
if(local_path.Len() < m_local_path.Len())
return 0;
const u32 lim = min(m_local_path.Len(), local_path.Len());
wxFileName path0(m_local_path);
path0.Normalize();
wxArrayString arr0 = wxSplit(path0.GetFullPath(), '\\');
wxArrayString arr1 = wxSplit(local_path, '\\');
const u32 lim = min(arr0.GetCount(), arr1.GetCount());
u32 ret = 0;
for(u32 i=0; i<lim; ++i, ++ret)
for(u32 i=0; i<lim; ret += arr0[i++].Len() + 1)
{
if(m_local_path[i] != local_path[i])
if(arr0[i].CmpNoCase(arr1[i]) != 0)
{
return 0;
break;
}
}
@ -175,7 +181,9 @@ wxString vfsDevice::GetWinPath(const wxString& p, bool is_dir)
if(is_dir && ret[ret.Len() - 1] != '\\') ret += '\\';
return ret;
wxFileName res(ret);
res.Normalize();
return res.GetFullPath();
}
wxString vfsDevice::GetWinPath(const wxString& l, const wxString& r)
@ -195,7 +203,7 @@ wxString vfsDevice::GetPs3Path(const wxString& p, bool is_dir)
for(u32 i=0; i<p.Len(); ++i)
{
if(p[i] == '/' || p[i] == '\\')
if(p[i] == L'/' || p[i] == L'\\')
{
if(!is_ls)
{

View File

@ -1,19 +1,8 @@
#pragma once
#include "vfsStream.h"
#include <mutex>
#include "vfsFileBase.h"
#include "vfsDirBase.h"
enum vfsOpenMode
{
vfsRead = 0x1,
vfsWrite = 0x2,
vfsExcl = 0x4,
vfsAppend = 0x8,
vfsReadWrite = vfsRead | vfsWrite,
vfsWriteExcl = vfsWrite | vfsExcl,
vfsWriteAppend = vfsWrite | vfsAppend,
};
class vfsDevice : public vfsStream
class vfsDevice
{
wxString m_ps3_path;
wxString m_local_path;
@ -23,9 +12,9 @@ public:
vfsDevice(const wxString& ps3_path, const wxString& local_path);
vfsDevice() {}
virtual vfsDevice* GetNew()=0;
virtual bool Open(const wxString& path, vfsOpenMode mode = vfsRead)=0;
virtual bool Create(const wxString& path)=0;
virtual std::shared_ptr<vfsFileBase> GetNewFileStream()=0;
virtual std::shared_ptr<vfsDirBase> GetNewDirStream()=0;
wxString GetLocalPath() const;
wxString GetPs3Path() const;

View File

@ -0,0 +1,14 @@
#include "stdafx.h"
#include "vfsDeviceLocalFile.h"
#include "vfsLocalFile.h"
#include "vfsLocalDir.h"
std::shared_ptr<vfsFileBase> vfsDeviceLocalFile::GetNewFileStream()
{
return std::make_shared<vfsLocalFile>(this);
}
std::shared_ptr<vfsDirBase> vfsDeviceLocalFile::GetNewDirStream()
{
return std::make_shared<vfsLocalDir>(this);
}

View File

@ -0,0 +1,9 @@
#pragma once
#include "vfsDevice.h"
class vfsDeviceLocalFile : public vfsDevice
{
public:
virtual std::shared_ptr<vfsFileBase> GetNewFileStream() override;
virtual std::shared_ptr<vfsDirBase> GetNewDirStream() override;
};

70
rpcs3/Emu/FS/vfsDir.cpp Normal file
View File

@ -0,0 +1,70 @@
#include "stdafx.h"
#include "vfsDir.h"
vfsDir::vfsDir()
: vfsDirBase(nullptr)
, m_stream(nullptr)
{
}
vfsDir::vfsDir(const wxString path)
: vfsDirBase(nullptr)
, m_stream(nullptr)
{
Open(path);
}
bool vfsDir::Open(const wxString& path)
{
Close();
m_stream = Emu.GetVFS().OpenDir(path);
return m_stream && m_stream->IsOpened();
}
bool vfsDir::Create(const wxString& path)
{
return m_stream->Create(path);
}
bool vfsDir::IsExists(const wxString& path) const
{
return m_stream->IsExists(path);
}
const Array<DirEntryInfo>& vfsDir::GetEntries() const
{
return m_stream->GetEntries();
}
bool vfsDir::Rename(const wxString& from, const wxString& to)
{
return m_stream->Rename(from, to);
}
bool vfsDir::Remove(const wxString& path)
{
return m_stream->Remove(path);
}
const DirEntryInfo* vfsDir::Read()
{
return m_stream->Read();
}
void vfsDir::Close()
{
m_stream.reset();
return vfsDirBase::Close();
}
wxString vfsDir::GetPath() const
{
return m_stream->GetPath();
}
bool vfsDir::IsOpened() const
{
return m_stream && m_stream->IsOpened() && vfsDirBase::IsOpened();
}

25
rpcs3/Emu/FS/vfsDir.h Normal file
View File

@ -0,0 +1,25 @@
#pragma once
#include "vfsDirBase.h"
class vfsDir : public vfsDirBase
{
private:
std::shared_ptr<vfsDirBase> m_stream;
public:
vfsDir();
vfsDir(const wxString path);
virtual bool Open(const wxString& path) override;
virtual bool IsOpened() const override;
virtual bool IsExists(const wxString& path) const override;
virtual const Array<DirEntryInfo>& GetEntries() const override;
virtual void Close() override;
virtual wxString GetPath() const override;
virtual bool Create(const wxString& path) override;
//virtual bool Create(const DirEntryInfo& info) override;
virtual bool Rename(const wxString& from, const wxString& to) override;
virtual bool Remove(const wxString& path) override;
virtual const DirEntryInfo* Read() override;
};

View File

@ -1,9 +1,10 @@
#include "stdafx.h"
#include "vfsDirBase.h"
vfsDirBase::vfsDirBase(const wxString& path)
vfsDirBase::vfsDirBase(vfsDevice* device)
: m_pos(0)
, m_device(device)
{
Open(path);
}
vfsDirBase::~vfsDirBase()
@ -18,6 +19,7 @@ bool vfsDirBase::Open(const wxString& path)
if(!IsExists(path))
return false;
m_pos = 0;
m_cwd += '/' + path;
return true;
}
@ -46,4 +48,12 @@ void vfsDirBase::Close()
wxString vfsDirBase::GetPath() const
{
return m_cwd;
}
const DirEntryInfo* vfsDirBase::Read()
{
if (m_pos >= m_entries.GetCount())
return nullptr;
return &m_entries[m_pos++];
}

View File

@ -32,9 +32,11 @@ class vfsDirBase
protected:
wxString m_cwd;
Array<DirEntryInfo> m_entries;
uint m_pos;
vfsDevice* m_device;
public:
vfsDirBase(const wxString& path);
vfsDirBase(vfsDevice* device);
virtual ~vfsDirBase();
virtual bool Open(const wxString& path);
@ -48,4 +50,5 @@ public:
//virtual bool Create(const DirEntryInfo& info)=0;
virtual bool Rename(const wxString& from, const wxString& to)=0;
virtual bool Remove(const wxString& path)=0;
virtual const DirEntryInfo* Read();
};

View File

@ -2,55 +2,51 @@
#include "vfsFile.h"
vfsFile::vfsFile()
: vfsFileBase()
: vfsFileBase(nullptr)
, m_stream(nullptr)
{
}
vfsFile::vfsFile(const wxString path, vfsOpenMode mode)
: vfsFileBase()
: vfsFileBase(nullptr)
, m_stream(nullptr)
{
Open(path, mode);
}
vfsFile::~vfsFile()
{
Close();
}
vfsDevice* vfsFile::GetNew()
{
return new vfsFile();
}
bool vfsFile::Open(const wxString& path, vfsOpenMode mode)
{
Close();
m_stream = Emu.GetVFS().Open(path, mode);
m_stream = Emu.GetVFS().OpenFile(path, mode);
return m_stream && m_stream->IsOpened();
}
bool vfsFile::Create(const wxString& path)
{
if(wxFileExists(path)) return false;
return m_stream->Create(path);
}
wxFile f;
return f.Create(path);
bool vfsFile::Exists(const wxString& path)
{
return m_stream->Exists(path);
}
bool vfsFile::Rename(const wxString& from, const wxString& to)
{
return m_stream->Rename(from, to);
}
bool vfsFile::Remove(const wxString& path)
{
return m_stream->Remove(path);
}
bool vfsFile::Close()
{
if(m_stream)
{
delete m_stream;
m_stream = nullptr;
return vfsFileBase::Close();
}
return false;
m_stream.reset();
return vfsFileBase::Close();
}
u64 vfsFile::GetSize()

View File

@ -4,17 +4,17 @@
class vfsFile : public vfsFileBase
{
private:
vfsStream* m_stream;
std::shared_ptr<vfsFileBase> m_stream;
public:
vfsFile();
vfsFile(const wxString path, vfsOpenMode mode = vfsRead);
~vfsFile();
virtual vfsDevice* GetNew() override;
virtual bool Open(const wxString& path, vfsOpenMode mode = vfsRead) override;
virtual bool Create(const wxString& path) override;
virtual bool Exists(const wxString& path) override;
virtual bool Rename(const wxString& from, const wxString& to) override;
virtual bool Remove(const wxString& path) override;
virtual bool Close() override;
virtual u64 GetSize() override;

View File

@ -1,7 +1,9 @@
#include "stdafx.h"
#include "vfsFileBase.h"
vfsFileBase::vfsFileBase() : vfsDevice()
vfsFileBase::vfsFileBase(vfsDevice* device)
: vfsStream()
, m_device(device)
{
}

View File

@ -1,24 +1,37 @@
#pragma once
#include "vfsDevice.h"
#include "vfsStream.h"
struct vfsFileBase : public vfsDevice
enum vfsOpenMode
{
vfsRead = 0x1,
vfsWrite = 0x2,
vfsExcl = 0x4,
vfsAppend = 0x8,
vfsReadWrite = vfsRead | vfsWrite,
vfsWriteExcl = vfsWrite | vfsExcl,
vfsWriteAppend = vfsWrite | vfsAppend,
};
class vfsDevice;
struct vfsFileBase : public vfsStream
{
protected:
wxString m_path;
vfsOpenMode m_mode;
vfsDevice* m_device;
public:
vfsFileBase();
vfsFileBase(vfsDevice* device);
virtual ~vfsFileBase();
virtual bool Open(const wxString& path, vfsOpenMode mode) override;
virtual bool Open(const wxString& path, vfsOpenMode mode);
virtual bool Close() override;
/*
virtual bool Create(const wxString& path)=0;
virtual bool Exists(const wxString& path)=0;
virtual bool Rename(const wxString& from, const wxString& to)=0;
virtual bool Remove(const wxString& path)=0;
*/
virtual bool Create(const wxString& path) { return false; }
virtual bool Exists(const wxString& path) { return false; }
virtual bool Rename(const wxString& from, const wxString& to) { return false; }
virtual bool Remove(const wxString& path) { return false; }
wxString GetPath() const;
vfsOpenMode GetOpenMode() const;
};

View File

@ -2,9 +2,7 @@
#include "vfsLocalDir.h"
#include <direct.h>
vfsLocalDir::vfsLocalDir(const wxString& path)
: vfsDirBase(path)
, m_pos(0)
vfsLocalDir::vfsLocalDir(vfsDevice* device) : vfsDirBase(device)
{
}
@ -39,14 +37,6 @@ bool vfsLocalDir::Open(const wxString& path)
return true;
}
const DirEntryInfo* vfsLocalDir::Read()
{
if (m_pos >= m_entries.GetCount())
return 0;
return &m_entries[m_pos++];
}
bool vfsLocalDir::Create(const wxString& path)
{
return wxFileName::Mkdir(path, 0777, wxPATH_MKDIR_FULL);

View File

@ -7,11 +7,10 @@ private:
u32 m_pos;
public:
vfsLocalDir(const wxString& path = wxEmptyString);
vfsLocalDir(vfsDevice* device);
virtual ~vfsLocalDir();
virtual bool Open(const wxString& path) override;
const DirEntryInfo* Read();
virtual bool Create(const wxString& path) override;
virtual bool Rename(const wxString& from, const wxString& to) override;

View File

@ -27,28 +27,27 @@ static const wxSeekMode vfs2wx_seek(vfsSeekMode mode)
return wxFromStart;
}
vfsLocalFile::vfsLocalFile() : vfsFileBase()
vfsLocalFile::vfsLocalFile(vfsDevice* device) : vfsFileBase(device)
{
}
vfsLocalFile::vfsLocalFile(const wxString path, vfsOpenMode mode) : vfsFileBase()
{
Open(path, mode);
}
vfsDevice* vfsLocalFile::GetNew()
{
return new vfsLocalFile();
}
bool vfsLocalFile::Open(const wxString& path, vfsOpenMode mode)
{
Close();
if(!m_file.Access(vfsDevice::GetWinPath(GetLocalPath(), path), vfs2wx_mode(mode))) return false;
if(m_device)
{
if(!m_file.Access(vfsDevice::GetWinPath(m_device->GetLocalPath(), path), vfs2wx_mode(mode))) return false;
return m_file.Open(vfsDevice::GetWinPath(GetLocalPath(), path), vfs2wx_mode(mode)) &&
vfsFileBase::Open(vfsDevice::GetPs3Path(GetPs3Path(), path), mode);
return m_file.Open(vfsDevice::GetWinPath(m_device->GetLocalPath(), path), vfs2wx_mode(mode)) &&
vfsFileBase::Open(vfsDevice::GetPs3Path(m_device->GetPs3Path(), path), mode);
}
else
{
if(!m_file.Access(path, vfs2wx_mode(mode))) return false;
return m_file.Open(path, vfs2wx_mode(mode)) && vfsFileBase::Open(path, mode);
}
}
bool vfsLocalFile::Create(const wxString& path)

View File

@ -7,9 +7,7 @@ private:
wxFile m_file;
public:
vfsLocalFile();
vfsLocalFile(const wxString path, vfsOpenMode mode = vfsRead);
vfsDevice* GetNew();
vfsLocalFile(vfsDevice* device);
virtual bool Open(const wxString& path, vfsOpenMode mode = vfsRead) override;
virtual bool Create(const wxString& path) override;

View File

@ -1,3 +1,16 @@
#include "stdafx.h"
#include "HDD.h"
vfsDeviceHDD::vfsDeviceHDD(const std::string& hdd_path) : m_hdd_path(hdd_path)
{
}
std::shared_ptr<vfsFileBase> vfsDeviceHDD::GetNewFileStream()
{
return std::make_shared<vfsHDD>(this, m_hdd_path);
}
std::shared_ptr<vfsDirBase> vfsDeviceHDD::GetNewDirStream()
{
return nullptr;
}

View File

@ -262,7 +262,7 @@ public:
if(!size)
return 0;
vfsDeviceLocker lock(m_hdd);
//vfsDeviceLocker lock(m_hdd);
const u32 block_size = m_hdd_info.block_size - sizeof(vfsHDD_Block);
u64 rsize = min<u64>(block_size - m_position, size);
@ -310,7 +310,7 @@ public:
if(!size)
return 0;
vfsDeviceLocker lock(m_hdd);
//vfsDeviceLocker lock(m_hdd);
const u32 block_size = m_hdd_info.block_size - sizeof(vfsHDD_Block);
@ -409,6 +409,17 @@ public:
}
};
class vfsDeviceHDD : public vfsDevice
{
std::string m_hdd_path;
public:
vfsDeviceHDD(const std::string& hdd_path);
virtual std::shared_ptr<vfsFileBase> GetNewFileStream() override;
virtual std::shared_ptr<vfsDirBase> GetNewDirStream() override;
};
class vfsHDD : public vfsFileBase
{
vfsHDD_Hdr m_hdd_info;
@ -419,11 +430,13 @@ class vfsHDD : public vfsFileBase
const wxString& m_hdd_path;
public:
vfsHDD(const wxString& hdd_path)
: m_hdd_file(hdd_path, vfsReadWrite)
vfsHDD(vfsDevice* device, const wxString& hdd_path)
: m_hdd_file(device)
, m_file(m_hdd_file, m_hdd_info)
, m_hdd_path(hdd_path)
, vfsFileBase(device)
{
m_hdd_file.Open(hdd_path, vfsReadWrite);
m_hdd_file.Read(&m_hdd_info, sizeof(vfsHDD_Hdr));
m_cur_dir_block = m_hdd_info.next_block;
if(!m_hdd_info.block_size)
@ -435,11 +448,6 @@ public:
m_hdd_file.Read(&m_cur_dir, sizeof(vfsHDD_Entry));
}
virtual vfsDevice* GetNew()
{
return new vfsHDD(m_hdd_path);
}
__forceinline u32 GetMaxNameLen() const
{
return m_hdd_info.block_size - sizeof(vfsHDD_Entry);
@ -861,4 +869,4 @@ public:
{
return m_file.GetSize();
}
};
};

View File

@ -961,7 +961,7 @@ int cellSysCacheMount(mem_ptr_t<CellSysCacheParam> param)
char id[CELL_SYSCACHE_ID_SIZE];
strncpy(id, param->cacheId, CELL_SYSCACHE_ID_SIZE);
strncpy(param->getCachePath, ("/dev_hdd1/cache/" + std::string(id) + "/").c_str(), CELL_SYSCACHE_PATH_MAX);
Emu.GetVFS().Create(wxString(param->getCachePath));
Emu.GetVFS().CreateFile(wxString(param->getCachePath));
return CELL_SYSCACHE_RET_OK_RELAYED;
}

View File

@ -106,11 +106,7 @@ int sceNpTrophyCreateContext(mem32_t context, mem_ptr_t<SceNpCommunicationId> co
// TODO: There are other possible errors
// TODO: Is the TROPHY.TRP file necessarily located in this path?
wxString ps3_path = "/app_home/TROPDIR/";
wxString local_path;
Emu.GetVFS().GetDevice(ps3_path, local_path);
vfsLocalDir dir(local_path);
vfsDir dir("/app_home/TROPDIR/");
if(!dir.IsOpened())
return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST;
@ -119,13 +115,14 @@ int sceNpTrophyCreateContext(mem32_t context, mem_ptr_t<SceNpCommunicationId> co
{
if (entry->flags & DirEntry_TypeDir)
{
vfsStream* stream = Emu.GetVFS().Open(ps3_path + entry->name + "/TROPHY.TRP", vfsRead);
if (stream)
auto f = Emu.GetVFS().OpenFile("/app_home/TROPDIR/" + entry->name + "/TROPHY.TRP", vfsRead);
if (f && f->IsOpened())
{
sceNpTrophyInternalContext ctxt;
ctxt.trp_stream = stream;
ctxt.trp_stream = f.get();
ctxt.trp_name = entry->name;
s_npTrophyInstance.contexts.push_back(ctxt);
f = nullptr;
return CELL_OK;
}
}

View File

@ -35,20 +35,18 @@ bool sdata_check(u32 version, u32 flags, u64 filesizeInput, u64 filesizeTmp)
int sdata_unpack(wxString packed_file, wxString unpacked_file)
{
vfsStream* packed_stream = Emu.GetVFS().Open(packed_file, vfsRead);
vfsStream* unpacked_stream = Emu.GetVFS().Open(unpacked_file, vfsWrite);
auto packed_stream = Emu.GetVFS().OpenFile(packed_file, vfsRead);
auto unpacked_stream = Emu.GetVFS().OpenFile(unpacked_file, vfsWrite);
if(!packed_stream || !packed_stream->IsOpened())
{
sys_fs.Error("'%s' not found! flags: 0x%08x", packed_file.wx_str(), vfsRead);
delete packed_stream;
return CELL_ENOENT;
}
if(!unpacked_stream || !unpacked_stream->IsOpened())
{
sys_fs.Error("'%s' couldn't be created! flags: 0x%08x", unpacked_file.wx_str(), vfsWrite);
delete unpacked_stream;
return CELL_ENOENT;
}
@ -105,9 +103,6 @@ int sdata_unpack(wxString packed_file, wxString unpacked_file)
}
}
packed_stream->Close();
unpacked_stream->Close();
return CELL_OK;
}
@ -131,8 +126,9 @@ int cellFsSdataOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
int ret = sdata_unpack(path, unpacked_path);
if (ret) return ret;
vfsStream* stream = Emu.GetVFS().Open(unpacked_path, vfsRead);
fd = sys_fs.GetNewId(stream, flags);
auto stream = Emu.GetVFS().OpenFile(unpacked_path, vfsRead);
fd = sys_fs.GetNewId(stream.get(), flags);
stream = nullptr;
return CELL_OK;
}

View File

@ -17,7 +17,7 @@ int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
if(flags & CELL_O_CREAT)
{
_oflags &= ~CELL_O_CREAT;
Emu.GetVFS().Create(ppath);
Emu.GetVFS().CreateFile(ppath);
}
vfsOpenMode o_mode;
@ -55,9 +55,7 @@ int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
{
_oflags &= ~CELL_O_TRUNC;
//truncate file before opening it as read/write
vfsStream* stream = Emu.GetVFS().Open(ppath, vfsWrite);
stream->Close();
delete stream;
Emu.GetVFS().OpenFile(ppath, vfsWrite);
}
o_mode = vfsReadWrite;
break;
@ -69,17 +67,16 @@ int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
return CELL_EINVAL;
}
vfsStream* stream = Emu.GetVFS().Open(ppath, o_mode);
auto stream = Emu.GetVFS().OpenFile(ppath, o_mode);
if(!stream || !stream->IsOpened())
{
sys_fs.Error("\"%s\" not found! flags: 0x%08x", ppath.wx_str(), flags);
delete stream;
return CELL_ENOENT;
}
fd = sys_fs.GetNewId(stream, flags);
fd = sys_fs.GetNewId(stream.get(), flags);
stream = nullptr;
ConLog.Warning("*** cellFsOpen(path=\"%s\"): fd = %d", path.wx_str(), fd.GetValue());
return CELL_OK;
@ -145,16 +142,14 @@ int cellFsOpendir(u32 path_addr, mem32_t fd)
if(!Memory.IsGoodAddr(path_addr) || !fd.IsGood())
return CELL_EFAULT;
wxString localPath;
Emu.GetVFS().GetDevice(path, localPath);
vfsLocalDir* dir = new vfsLocalDir(localPath);
std::shared_ptr<vfsDirBase> dir = Emu.GetVFS().OpenDir(path);
if(!dir->IsOpened())
{
delete dir;
return CELL_ENOENT;
}
fd = sys_fs.GetNewId(dir);
fd = sys_fs.GetNewId(dir.get());
dir = nullptr;
return CELL_OK;
}
@ -174,7 +169,7 @@ int cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread)
nread = 1;
Memory.WriteString(dir.GetAddr()+2, info->name.wx_str());
dir->d_namlen = info->name.Length();
dir->d_type = (info->flags & 0x1) ? CELL_FS_TYPE_REGULAR : CELL_FS_TYPE_DIRECTORY;
dir->d_type = (info->flags & DirEntry_TypeFile) ? CELL_FS_TYPE_REGULAR : CELL_FS_TYPE_DIRECTORY;
}
else
{

View File

@ -92,9 +92,9 @@ void Emulator::CheckStatus()
bool Emulator::IsSelf(const std::string& path)
{
vfsLocalFile f(path);
vfsLocalFile f(nullptr);
if(!f.IsOpened())
if(!f.Open(path))
return false;
SceHeader hdr;
@ -238,7 +238,7 @@ void Emulator::Load()
try
{
if(!(is_error = !l.Analyze() || l.GetMachine() == MACHINE_Unknown))
if(!(is_error = !l.Analyze()) && l.GetMachine() != MACHINE_Unknown)
{
switch(l.GetMachine())
{

View File

@ -107,16 +107,6 @@ public:
void SetPath(const wxString& path, const wxString& elf_path = wxEmptyString);
void SetTitleID(const wxString& id);
std::shared_ptr<vfsFileBase> OpenFile(const wxString& path, vfsOpenMode mode = vfsRead)
{
return std::shared_ptr<vfsFileBase>((vfsFileBase*)m_vfs.Open(path, mode));
}
std::shared_ptr<vfsStream> OpenStream(const wxString& path, vfsOpenMode mode = vfsRead)
{
return std::shared_ptr<vfsStream>(m_vfs.Open(path, mode));
}
CPUThreadManager& GetCPU() { return m_thread_manager; }
PadManager& GetPadManager() { return m_pad_manager; }
KeyboardManager& GetKeyboardManager() { return m_keyboard_manager; }

View File

@ -294,7 +294,9 @@ void DisAsmFrame::Dump(wxCommandEvent& WXUNUSED(event))
if(ctrl.ShowModal() == wxID_CANCEL) return;
vfsStream& f_elf = *new vfsLocalFile(Emu.m_path);
vfsLocalFile& f_elf = *new vfsLocalFile(nullptr);
f_elf.Open(Emu.m_path);
ConLog.Write("path: %s", Emu.m_path.wx_str());
Elf_Ehdr ehdr;
ehdr.Load(f_elf);

View File

@ -50,8 +50,10 @@ void GameViewer::LoadPSF()
for(uint i=0; i<m_games.GetCount(); ++i)
{
const wxString& path = m_path + m_games[i] + "\\PARAM.SFO";
if(!wxFileExists(path)) continue;
vfsLocalFile f(path);
vfsLocalFile f(nullptr);
if(!f.Open(path))
continue;
PSFLoader psf(f);
if(!psf.Load(false)) continue;
psf.m_info.root = m_games[i];

View File

@ -67,7 +67,7 @@ VHDDExplorer::VHDDExplorer(wxWindow* parent, const wxString& hdd_path) : wxDialo
m_list->InsertColumn(2, "Size");
m_list->InsertColumn(3, "Creation time");
m_hdd = new vfsHDD(hdd_path);
m_hdd = new vfsHDD(nullptr, hdd_path);
UpdateList();
Connect(m_list->GetId(), wxEVT_COMMAND_LIST_BEGIN_DRAG, wxListEventHandler(VHDDExplorer::OnListDrag));
Connect(m_list->GetId(), wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(VHDDExplorer::DClick));

View File

@ -162,11 +162,13 @@ bool Loader::Load()
return false;
}
/*
const wxString& root = wxFileName(wxFileName(m_stream->GetPath()).GetPath()).GetPath();
wxString ps3_path;
const wxString& psf_path = root + "\\" + "PARAM.SFO";
if(wxFileExists(psf_path))
vfsFile f(psf_path);
if(f.IsOpened())
{
vfsLocalFile f(psf_path);
PSFLoader psf_l(f);
if(psf_l.Load())
{
@ -175,6 +177,6 @@ bool Loader::Load()
psf_l.Close();
}
}
*/
return true;
}

View File

@ -16,7 +16,7 @@ bool TRPLoader::Install(std::string dest, bool show)
for (const TRPEntry& entry : m_entries)
{
char* buffer = new char [entry.size];
Emu.GetVFS().Create(dest+entry.name);
Emu.GetVFS().CreateFile(dest+entry.name);
vfsFile file(dest+entry.name, vfsWrite);
trp_f.Seek(entry.offset);
trp_f.Read(buffer, entry.size);

View File

@ -227,6 +227,8 @@
<ClCompile Include="Emu\Event.cpp" />
<ClCompile Include="Emu\FS\VFS.cpp" />
<ClCompile Include="Emu\FS\vfsDevice.cpp" />
<ClCompile Include="Emu\FS\vfsDeviceLocalFile.cpp" />
<ClCompile Include="Emu\FS\vfsDir.cpp" />
<ClCompile Include="Emu\FS\vfsDirBase.cpp" />
<ClCompile Include="Emu\FS\vfsFile.cpp" />
<ClCompile Include="Emu\FS\vfsFileBase.cpp" />

View File

@ -394,12 +394,18 @@
<ClCompile Include="Loader\TRP.cpp">
<Filter>Loader</Filter>
</ClCompile>
<ClCompile Include="Emu\GS\RSXTexture.cpp">
<ClCompile Include="Emu\GS\RSXTexture.cpp">
<Filter>Emu\GS</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\sceNpTrophy.cpp">
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\sceNpTrophy.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\FS\vfsDeviceLocalFile.cpp">
<Filter>Emu\FS</Filter>
</ClCompile>
<ClCompile Include="Emu\FS\vfsDir.cpp">
<Filter>Emu\FS</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="rpcs3.rc" />

View File

@ -210,9 +210,10 @@ enum Status
#include "Emu/FS/vfsFileBase.h"
#include "Emu/FS/vfsLocalDir.h"
#include "Emu/FS/vfsLocalFile.h"
#include "Emu/FS/vfsFile.h"
#include "Emu/FS/vfsStream.h"
#include "Emu/FS/vfsStreamMemory.h"
#include "Emu/FS/vfsFile.h"
#include "Emu/FS/vfsDir.h"
#include "rpcs3.h"
#define _PRGNAME_ "RPCS3"