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
f5cf9960
There was an error fetching the commit references. Please try again later.
Commit
f5cf9960
authored
7 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
loader: Expose program title.
parent
035716d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/loader/loader.h
+9
-0
9 additions, 0 deletions
src/core/loader/loader.h
src/core/loader/ncch.cpp
+20
-0
20 additions, 0 deletions
src/core/loader/ncch.cpp
src/core/loader/ncch.h
+2
-12
2 additions, 12 deletions
src/core/loader/ncch.h
with
31 additions
and
12 deletions
src/core/loader/loader.h
+
9
−
0
View file @
f5cf9960
...
...
@@ -166,6 +166,15 @@ public:
return
ResultStatus
::
ErrorNotImplemented
;
}
/**
* Get the title of the application
* @param title Reference to store the application title into
* @return ResultStatus result of function
*/
virtual
ResultStatus
ReadTitle
(
std
::
string
&
title
)
{
return
ResultStatus
::
ErrorNotImplemented
;
}
protected
:
FileUtil
::
IOFile
file
;
bool
is_loaded
=
false
;
...
...
This diff is collapsed.
Click to expand it.
src/core/loader/ncch.cpp
+
20
−
0
View file @
f5cf9960
...
...
@@ -4,7 +4,9 @@
#include
<algorithm>
#include
<cinttypes>
#include
<codecvt>
#include
<cstring>
#include
<locale>
#include
<memory>
#include
"common/logging/log.h"
#include
"common/string_util.h"
...
...
@@ -420,4 +422,22 @@ ResultStatus AppLoader_NCCH::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_
return
ResultStatus
::
ErrorNotUsed
;
}
ResultStatus
AppLoader_NCCH
::
ReadTitle
(
std
::
string
&
title
)
{
std
::
vector
<
u8
>
data
;
Loader
::
SMDH
smdh
;
ReadIcon
(
data
);
if
(
!
Loader
::
IsValidSMDH
(
data
))
{
return
ResultStatus
::
ErrorInvalidFormat
;
}
memcpy
(
&
smdh
,
data
.
data
(),
sizeof
(
Loader
::
SMDH
));
const
auto
&
short_title
=
smdh
.
GetShortTitle
(
SMDH
::
TitleLanguage
::
English
);
auto
title_end
=
std
::
find
(
short_title
.
begin
(),
short_title
.
end
(),
u'\0'
);
title
=
Common
::
UTF16ToUTF8
(
std
::
u16string
{
short_title
.
begin
(),
title_end
});
return
ResultStatus
::
Success
;
}
}
// namespace Loader
This diff is collapsed.
Click to expand it.
src/core/loader/ncch.h
+
2
−
12
View file @
f5cf9960
...
...
@@ -191,23 +191,13 @@ public:
ResultStatus
ReadLogo
(
std
::
vector
<
u8
>&
buffer
)
override
;
/**
* Get the program id of the application
* @param out_program_id Reference to store program id into
* @return ResultStatus result of function
*/
ResultStatus
ReadProgramId
(
u64
&
out_program_id
)
override
;
/**
* Get the RomFS of the application
* @param romfs_file Reference to buffer to store data
* @param offset Offset in the file to the RomFS
* @param size Size of the RomFS in bytes
* @return ResultStatus result of function
*/
ResultStatus
ReadRomFS
(
std
::
shared_ptr
<
FileUtil
::
IOFile
>&
romfs_file
,
u64
&
offset
,
u64
&
size
)
override
;
ResultStatus
ReadTitle
(
std
::
string
&
title
)
override
;
private
:
/**
* Reads an application ExeFS section of an NCCH file into AppLoader (e.g. .code, .logo, etc.)
...
...
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