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
f6e22950
There was an error fetching the commit references. Please try again later.
Commit
f6e22950
authored
6 years ago
by
Zach Hilman
Browse files
Options
Downloads
Patches
Plain Diff
general_backend: Move StubApplet and add backend PhotoViewer
parent
80c9e4d3
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/core/hle/service/am/applets/general_backend.cpp
+54
-1
54 additions, 1 deletion
src/core/hle/service/am/applets/general_backend.cpp
src/core/hle/service/am/applets/general_backend.h
+48
-0
48 additions, 0 deletions
src/core/hle/service/am/applets/general_backend.h
with
102 additions
and
1 deletion
src/core/hle/service/am/applets/
stub_applet
.cpp
→
src/core/hle/service/am/applets/
general_backend
.cpp
+
54
−
1
View file @
f6e22950
...
@@ -6,9 +6,12 @@
...
@@ -6,9 +6,12 @@
#include
"common/hex_util.h"
#include
"common/hex_util.h"
#include
"common/logging/log.h"
#include
"common/logging/log.h"
#include
"core/core.h"
#include
"core/frontend/applets/general_frontend.h"
#include
"core/hle/kernel/process.h"
#include
"core/hle/result.h"
#include
"core/hle/result.h"
#include
"core/hle/service/am/am.h"
#include
"core/hle/service/am/am.h"
#include
"core/hle/service/am/applets/
stub_applet
.h"
#include
"core/hle/service/am/applets/
general_backend
.h"
namespace
Service
::
AM
::
Applets
{
namespace
Service
::
AM
::
Applets
{
...
@@ -30,6 +33,55 @@ static void LogCurrentStorage(AppletDataBroker& broker, std::string prefix) {
...
@@ -30,6 +33,55 @@ static void LogCurrentStorage(AppletDataBroker& broker, std::string prefix) {
}
}
}
}
PhotoViewer
::
PhotoViewer
(
const
Core
::
Frontend
::
PhotoViewerApplet
&
frontend
)
:
frontend
(
frontend
)
{}
PhotoViewer
::~
PhotoViewer
()
=
default
;
void
PhotoViewer
::
Initialize
()
{
Applet
::
Initialize
();
complete
=
false
;
const
auto
storage
=
broker
.
PopNormalDataToApplet
();
ASSERT
(
storage
!=
nullptr
);
const
auto
data
=
storage
->
GetData
();
ASSERT
(
!
data
.
empty
());
mode
=
static_cast
<
PhotoViewerAppletMode
>
(
data
[
0
]);
}
bool
PhotoViewer
::
TransactionComplete
()
const
{
return
complete
;
}
ResultCode
PhotoViewer
::
GetStatus
()
const
{
return
RESULT_SUCCESS
;
}
void
PhotoViewer
::
ExecuteInteractive
()
{
UNREACHABLE_MSG
(
"Unexpected interactive applet data."
);
}
void
PhotoViewer
::
Execute
()
{
if
(
complete
)
return
;
const
auto
callback
=
[
this
]
{
ViewFinished
();
};
switch
(
mode
)
{
case
PhotoViewerAppletMode
::
CurrentApp
:
frontend
.
ShowPhotosForApplication
(
Core
::
CurrentProcess
()
->
GetTitleID
(),
callback
);
break
;
case
PhotoViewerAppletMode
::
AllApps
:
frontend
.
ShowAllPhotos
(
callback
);
break
;
default:
UNIMPLEMENTED_MSG
(
"Unimplemented PhotoViewer applet mode={:02X}!"
,
static_cast
<
u8
>
(
mode
));
}
}
void
PhotoViewer
::
ViewFinished
()
{
broker
.
PushNormalDataFromApplet
(
IStorage
{{}});
broker
.
SignalStateChanged
();
}
StubApplet
::
StubApplet
()
=
default
;
StubApplet
::
StubApplet
()
=
default
;
StubApplet
::~
StubApplet
()
=
default
;
StubApplet
::~
StubApplet
()
=
default
;
...
@@ -67,4 +119,5 @@ void StubApplet::Execute() {
...
@@ -67,4 +119,5 @@ void StubApplet::Execute() {
broker
.
PushInteractiveDataFromApplet
(
IStorage
{
std
::
vector
<
u8
>
(
0x1000
)});
broker
.
PushInteractiveDataFromApplet
(
IStorage
{
std
::
vector
<
u8
>
(
0x1000
)});
broker
.
SignalStateChanged
();
broker
.
SignalStateChanged
();
}
}
}
// namespace Service::AM::Applets
}
// namespace Service::AM::Applets
This diff is collapsed.
Click to expand it.
src/core/hle/service/am/applets/general_backend.h
0 → 100644
+
48
−
0
View file @
f6e22950
// Copyright 2019 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include
"core/hle/service/am/applets/applets.h"
namespace
Service
::
AM
::
Applets
{
enum
class
PhotoViewerAppletMode
:
u8
{
CurrentApp
=
0
,
AllApps
=
1
,
};
class
PhotoViewer
final
:
public
Applet
{
public:
PhotoViewer
(
const
Core
::
Frontend
::
PhotoViewerApplet
&
frontend
);
~
PhotoViewer
()
override
;
void
Initialize
()
override
;
bool
TransactionComplete
()
const
override
;
ResultCode
GetStatus
()
const
override
;
void
ExecuteInteractive
()
override
;
void
Execute
()
override
;
void
ViewFinished
();
private:
const
Core
::
Frontend
::
PhotoViewerApplet
&
frontend
;
bool
complete
;
PhotoViewerAppletMode
mode
;
};
class
StubApplet
final
:
public
Applet
{
public:
StubApplet
();
~
StubApplet
()
override
;
void
Initialize
()
override
;
bool
TransactionComplete
()
const
override
;
ResultCode
GetStatus
()
const
override
;
void
ExecuteInteractive
()
override
;
void
Execute
()
override
;
};
}
// namespace Service::AM::Applets
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