Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
f260c74b
There was an error fetching the commit references. Please try again later.
Commit
f260c74b
authored
1 year ago
by
Liam
Browse files
Options
Downloads
Patches
Plain Diff
qt: fix romfs dumping for multiprogram applications
parent
1615a863
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/yuzu/main.cpp
+63
-50
63 additions, 50 deletions
src/yuzu/main.cpp
src/yuzu/main.h
+2
-1
2 additions, 1 deletion
src/yuzu/main.h
with
65 additions
and
51 deletions
src/yuzu/main.cpp
+
63
−
50
View file @
f260c74b
...
@@ -2573,50 +2573,41 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
...
@@ -2573,50 +2573,41 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
return
;
return
;
}
}
FileSys
::
VirtualFile
base_romfs
;
FileSys
::
VirtualFile
packed_update_raw
{};
if
(
loader
->
ReadRomFS
(
base_romfs
)
!=
Loader
::
ResultStatus
::
Success
)
{
loader
->
ReadUpdateRaw
(
packed_update_raw
);
failed
();
return
;
}
const
auto
&
installed
=
system
->
GetContentProvider
();
const
auto
&
installed
=
system
->
GetContentProvider
();
const
auto
romfs_title_id
=
SelectRomFSDumpTarget
(
installed
,
program_id
);
if
(
!
romfs_title_id
)
{
u64
title_id
{};
u8
raw_type
{};
if
(
!
SelectRomFSDumpTarget
(
installed
,
program_id
,
&
title_id
,
&
raw_type
))
{
failed
();
failed
();
return
;
return
;
}
}
const
auto
type
=
*
romfs_title_id
==
program_id
?
FileSys
::
ContentRecordType
::
Program
const
auto
type
=
static_cast
<
FileSys
::
ContentRecordType
>
(
raw_type
);
:
FileSys
::
ContentRecordType
::
Data
;
const
auto
base_nca
=
installed
.
GetEntry
(
title_id
,
type
);
const
auto
base_nca
=
installed
.
GetEntry
(
*
romfs_title_id
,
type
);
if
(
!
base_nca
)
{
if
(
!
base_nca
)
{
failed
();
failed
();
return
;
return
;
}
}
const
auto
base_romfs
=
base_nca
->
GetRomFS
();
if
(
!
base_romfs
)
{
failed
();
return
;
}
const
auto
dump_dir
=
const
auto
dump_dir
=
target
==
DumpRomFSTarget
::
Normal
target
==
DumpRomFSTarget
::
Normal
?
Common
::
FS
::
GetYuzuPath
(
Common
::
FS
::
YuzuPath
::
DumpDir
)
?
Common
::
FS
::
GetYuzuPath
(
Common
::
FS
::
YuzuPath
::
DumpDir
)
:
Common
::
FS
::
GetYuzuPath
(
Common
::
FS
::
YuzuPath
::
SDMCDir
)
/
"atmosphere"
/
"contents"
;
:
Common
::
FS
::
GetYuzuPath
(
Common
::
FS
::
YuzuPath
::
SDMCDir
)
/
"atmosphere"
/
"contents"
;
const
auto
romfs_dir
=
fmt
::
format
(
"{:016X}/romfs"
,
*
romfs_
title_id
);
const
auto
romfs_dir
=
fmt
::
format
(
"{:016X}/romfs"
,
title_id
);
const
auto
path
=
Common
::
FS
::
PathToUTF8String
(
dump_dir
/
romfs_dir
);
const
auto
path
=
Common
::
FS
::
PathToUTF8String
(
dump_dir
/
romfs_dir
);
FileSys
::
VirtualFile
romfs
;
const
FileSys
::
PatchManager
pm
{
title_id
,
system
->
GetFileSystemController
(),
installed
};
auto
romfs
=
pm
.
PatchRomFS
(
base_nca
.
get
(),
base_romfs
,
type
,
packed_update_raw
,
false
);
if
(
*
romfs_title_id
==
program_id
)
{
const
FileSys
::
PatchManager
pm
{
program_id
,
system
->
GetFileSystemController
(),
installed
};
romfs
=
pm
.
PatchRomFS
(
base_nca
.
get
(),
base_romfs
,
type
,
nullptr
,
false
);
}
else
{
romfs
=
installed
.
GetEntry
(
*
romfs_title_id
,
type
)
->
GetRomFS
();
}
const
auto
extracted
=
FileSys
::
ExtractRomFS
(
romfs
,
FileSys
::
RomFSExtractionType
::
Full
);
if
(
extracted
==
nullptr
)
{
failed
();
return
;
}
const
auto
out
=
VfsFilesystemCreateDirectoryWrapper
(
vfs
,
path
,
FileSys
::
Mode
::
ReadWrite
);
const
auto
out
=
VfsFilesystemCreateDirectoryWrapper
(
vfs
,
path
,
FileSys
::
Mode
::
ReadWrite
);
...
@@ -2640,6 +2631,12 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
...
@@ -2640,6 +2631,12 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
return
;
return
;
}
}
const
auto
extracted
=
FileSys
::
ExtractRomFS
(
romfs
,
FileSys
::
RomFSExtractionType
::
Full
);
if
(
extracted
==
nullptr
)
{
failed
();
return
;
}
const
auto
full
=
res
==
selections
.
constFirst
();
const
auto
full
=
res
==
selections
.
constFirst
();
const
auto
entry_size
=
CalculateRomFSEntrySize
(
extracted
,
full
);
const
auto
entry_size
=
CalculateRomFSEntrySize
(
extracted
,
full
);
...
@@ -4350,28 +4347,41 @@ bool GMainWindow::CheckSystemArchiveDecryption() {
...
@@ -4350,28 +4347,41 @@ bool GMainWindow::CheckSystemArchiveDecryption() {
return
mii_nca
->
GetRomFS
().
get
()
!=
nullptr
;
return
mii_nca
->
GetRomFS
().
get
()
!=
nullptr
;
}
}
std
::
optional
<
u64
>
GMainWindow
::
SelectRomFSDumpTarget
(
const
FileSys
::
ContentProvider
&
installed
,
bool
GMainWindow
::
SelectRomFSDumpTarget
(
const
FileSys
::
ContentProvider
&
installed
,
u64
program_id
,
u64
program_id
)
{
u64
*
selected_title_id
,
u8
*
selected_content_record_type
)
{
const
auto
dlc_entries
=
using
ContentInfo
=
std
::
pair
<
FileSys
::
TitleType
,
FileSys
::
ContentRecordType
>
;
installed
.
ListEntriesFilter
(
FileSys
::
TitleType
::
AOC
,
FileSys
::
ContentRecordType
::
Data
);
boost
::
container
::
flat_map
<
u64
,
ContentInfo
>
available_title_ids
;
std
::
vector
<
FileSys
::
ContentProviderEntry
>
dlc_match
;
dlc_match
.
reserve
(
dlc_entries
.
size
());
const
auto
RetrieveEntries
=
[
&
](
FileSys
::
TitleType
title_type
,
std
::
copy_if
(
dlc_entries
.
begin
(),
dlc_entries
.
end
(),
std
::
back_inserter
(
dlc_match
),
FileSys
::
ContentRecordType
record_type
)
{
[
&
program_id
,
&
installed
](
const
FileSys
::
ContentProviderEntry
&
entry
)
{
const
auto
entries
=
installed
.
ListEntriesFilter
(
title_type
,
record_type
);
return
FileSys
::
GetBaseTitleID
(
entry
.
title_id
)
==
program_id
&&
for
(
const
auto
&
entry
:
entries
)
{
installed
.
GetEntry
(
entry
)
->
GetStatus
()
==
Loader
::
ResultStatus
::
Success
;
if
(
FileSys
::
GetBaseTitleID
(
entry
.
title_id
)
==
program_id
&&
});
installed
.
GetEntry
(
entry
)
->
GetStatus
()
==
Loader
::
ResultStatus
::
Success
)
{
available_title_ids
[
entry
.
title_id
]
=
{
title_type
,
record_type
};
std
::
vector
<
u64
>
romfs_tids
;
}
romfs_tids
.
push_back
(
program_id
);
}
for
(
const
auto
&
entry
:
dlc_match
)
{
};
romfs_tids
.
push_back
(
entry
.
title_id
);
}
RetrieveEntries
(
FileSys
::
TitleType
::
Application
,
FileSys
::
ContentRecordType
::
Program
);
RetrieveEntries
(
FileSys
::
TitleType
::
AOC
,
FileSys
::
ContentRecordType
::
Data
);
if
(
romfs_tids
.
size
()
>
1
)
{
QStringList
list
{
QStringLiteral
(
"Base"
)};
if
(
available_title_ids
.
empty
())
{
for
(
std
::
size_t
i
=
1
;
i
<
romfs_tids
.
size
();
++
i
)
{
return
false
;
list
.
push_back
(
QStringLiteral
(
"DLC %1"
).
arg
(
romfs_tids
[
i
]
&
0x7FF
));
}
size_t
title_index
=
0
;
if
(
available_title_ids
.
size
()
>
1
)
{
QStringList
list
;
for
(
auto
&
[
title_id
,
content_info
]
:
available_title_ids
)
{
const
auto
hex_title_id
=
QString
::
fromStdString
(
fmt
::
format
(
"{:X}"
,
title_id
));
if
(
content_info
.
first
==
FileSys
::
TitleType
::
Application
)
{
list
.
push_back
(
QStringLiteral
(
"Application [%1]"
).
arg
(
hex_title_id
));
}
else
{
list
.
push_back
(
QStringLiteral
(
"DLC %1 [%2]"
).
arg
(
title_id
&
0x7FF
).
arg
(
hex_title_id
));
}
}
}
bool
ok
;
bool
ok
;
...
@@ -4379,13 +4389,16 @@ std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProv
...
@@ -4379,13 +4389,16 @@ std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProv
this
,
tr
(
"Select RomFS Dump Target"
),
this
,
tr
(
"Select RomFS Dump Target"
),
tr
(
"Please select which RomFS you would like to dump."
),
list
,
0
,
false
,
&
ok
);
tr
(
"Please select which RomFS you would like to dump."
),
list
,
0
,
false
,
&
ok
);
if
(
!
ok
)
{
if
(
!
ok
)
{
return
{}
;
return
false
;
}
}
return
romfs_tids
[
list
.
indexOf
(
res
)
]
;
title_index
=
list
.
indexOf
(
res
);
}
}
return
program_id
;
const
auto
selected_info
=
available_title_ids
.
nth
(
title_index
);
*
selected_title_id
=
selected_info
->
first
;
*
selected_content_record_type
=
static_cast
<
u8
>
(
selected_info
->
second
.
second
);
return
true
;
}
}
bool
GMainWindow
::
ConfirmClose
()
{
bool
GMainWindow
::
ConfirmClose
()
{
...
...
This diff is collapsed.
Click to expand it.
src/yuzu/main.h
+
2
−
1
View file @
f260c74b
...
@@ -375,7 +375,8 @@ private:
...
@@ -375,7 +375,8 @@ private:
void
RemoveAllTransferableShaderCaches
(
u64
program_id
);
void
RemoveAllTransferableShaderCaches
(
u64
program_id
);
void
RemoveCustomConfiguration
(
u64
program_id
,
const
std
::
string
&
game_path
);
void
RemoveCustomConfiguration
(
u64
program_id
,
const
std
::
string
&
game_path
);
void
RemoveCacheStorage
(
u64
program_id
);
void
RemoveCacheStorage
(
u64
program_id
);
std
::
optional
<
u64
>
SelectRomFSDumpTarget
(
const
FileSys
::
ContentProvider
&
,
u64
program_id
);
bool
SelectRomFSDumpTarget
(
const
FileSys
::
ContentProvider
&
,
u64
program_id
,
u64
*
selected_title_id
,
u8
*
selected_content_record_type
);
InstallResult
InstallNSPXCI
(
const
QString
&
filename
);
InstallResult
InstallNSPXCI
(
const
QString
&
filename
);
InstallResult
InstallNCA
(
const
QString
&
filename
);
InstallResult
InstallNCA
(
const
QString
&
filename
);
void
MigrateConfigFiles
();
void
MigrateConfigFiles
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment