Compare commits

...

10 Commits

Author SHA1 Message Date
Lioncash
6b32e24161 gl_state: Make texture_units a std::array
Gets rid of the use of a raw C array.
2018-08-02 11:19:58 -04:00
bunnei
a03c644aed Merge pull request #896 from lioncash/audio-out
audio_out: Use Buffer::Tag alias in GetTagsAndReleaseBuffers()'s prototype
2018-08-02 09:51:47 -04:00
Lioncash
c1c397d37c audio_out: Use Buffer::Tag alias in GetTagsAndReleaseBuffers()'s prototype
This makes the Buffer::Tag usage consistent with the Stream class's
prototype of GetTagsAndReleaseBuffers().
2018-08-02 05:18:32 -04:00
bunnei
746d7d4d28 Merge pull request #888 from lioncash/caps
service: Add capture services
2018-08-01 21:34:28 -04:00
bunnei
9bb8720289 Merge pull request #890 from lioncash/logger
lm: Amend name of ILogger
2018-08-01 21:33:11 -04:00
bunnei
16b2fd9fc8 Merge pull request #889 from lioncash/fsp
service/filesystem: Add fsp:ldr and fsp:pr services
2018-08-01 21:32:54 -04:00
bunnei
200c95db8a Merge pull request #887 from lioncash/pcv
service: Add bpc and pcv services
2018-08-01 21:32:36 -04:00
Lioncash
f77cfab516 lm: Amend name of ILogger
Previously this was being registered with the name "Logger". While we're
at it, also change the name of the class to match it.
2018-08-01 17:08:44 -04:00
Lioncash
e39294c267 service: Add capture services
Adds the basic skeleton for the capture services based off information
provided by Switch Brew.
2018-08-01 16:45:51 -04:00
Lioncash
d109279543 service: Add bpc and pcv services
Adds the basic skeleton for the remaining pcv-related services based off
information on Switch Brew.
2018-08-01 16:13:04 -04:00
14 changed files with 365 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ StreamPtr AudioOut::OpenStream(u32 sample_rate, u32 num_channels,
sink->AcquireSinkStream(sample_rate, num_channels));
}
std::vector<u64> AudioOut::GetTagsAndReleaseBuffers(StreamPtr stream, size_t max_count) {
std::vector<Buffer::Tag> AudioOut::GetTagsAndReleaseBuffers(StreamPtr stream, size_t max_count) {
return stream->GetTagsAndReleaseBuffers(max_count);
}

View File

@@ -24,7 +24,7 @@ public:
Stream::ReleaseCallback&& release_callback);
/// Returns a vector of recently released buffers specified by tag for the specified stream
std::vector<u64> GetTagsAndReleaseBuffers(StreamPtr stream, size_t max_count);
std::vector<Buffer::Tag> GetTagsAndReleaseBuffers(StreamPtr stream, size_t max_count);
/// Starts an audio stream for playback
void StartStream(StreamPtr stream);

View File

@@ -169,7 +169,9 @@ void FileBackend::Write(const Entry& entry) {
SUB(Service, AOC) \
SUB(Service, APM) \
SUB(Service, BCAT) \
SUB(Service, BPC) \
SUB(Service, BTM) \
SUB(Service, Capture) \
SUB(Service, Fatal) \
SUB(Service, FGM) \
SUB(Service, Friend) \
@@ -188,6 +190,7 @@ void FileBackend::Write(const Entry& entry) {
SUB(Service, NVDRV) \
SUB(Service, PCIE) \
SUB(Service, PCTL) \
SUB(Service, PCV) \
SUB(Service, PREPO) \
SUB(Service, SET) \
SUB(Service, SM) \

View File

@@ -56,7 +56,9 @@ enum class Class : ClassType {
Service_APM, ///< The APM (Performance) service
Service_Audio, ///< The Audio (Audio control) service
Service_BCAT, ///< The BCAT service
Service_BPC, ///< The BPC service
Service_BTM, ///< The BTM service
Service_Capture, ///< The capture service
Service_Fatal, ///< The Fatal service
Service_FGM, ///< The FGM service
Service_Friend, ///< The friend service
@@ -75,6 +77,7 @@ enum class Class : ClassType {
Service_NVDRV, ///< The NVDRV (Nvidia driver) service
Service_PCIE, ///< The PCIe service
Service_PCTL, ///< The PCTL (Parental control) service
Service_PCV, ///< The PCV (Parental control) service
Service_PREPO, ///< The PREPO (Play report) service
Service_SET, ///< The SET (Settings) service
Service_SM, ///< The SM (Service manager) service

View File

@@ -154,10 +154,14 @@ add_library(core STATIC
hle/service/bcat/bcat.h
hle/service/bcat/module.cpp
hle/service/bcat/module.h
hle/service/bpc/bpc.cpp
hle/service/bpc/bpc.h
hle/service/btdrv/btdrv.cpp
hle/service/btdrv/btdrv.h
hle/service/btm/btm.cpp
hle/service/btm/btm.h
hle/service/caps/caps.cpp
hle/service/caps/caps.h
hle/service/erpt/erpt.cpp
hle/service/erpt/erpt.h
hle/service/es/es.cpp
@@ -251,6 +255,8 @@ add_library(core STATIC
hle/service/pctl/module.h
hle/service/pctl/pctl.cpp
hle/service/pctl/pctl.h
hle/service/pcv/pcv.cpp
hle/service/pcv/pcv.h
hle/service/pm/pm.cpp
hle/service/pm/pm.h
hle/service/prepo/prepo.cpp

View File

@@ -0,0 +1,57 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include "core/hle/service/bpc/bpc.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
namespace Service::BPC {
class BPC final : public ServiceFramework<BPC> {
public:
explicit BPC() : ServiceFramework{"bpc"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "ShutdownSystem"},
{1, nullptr, "RebootSystem"},
{2, nullptr, "GetWakeupReason"},
{3, nullptr, "GetShutdownReason"},
{4, nullptr, "GetAcOk"},
{5, nullptr, "GetBoardPowerControlEvent"},
{6, nullptr, "GetSleepButtonState"},
{7, nullptr, "GetPowerEvent"},
{8, nullptr, "Unknown1"},
{9, nullptr, "Unknown2"},
{10, nullptr, "Unknown3"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class BPC_R final : public ServiceFramework<BPC_R> {
public:
explicit BPC_R() : ServiceFramework{"bpc:r"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "GetExternalRtcValue"},
{1, nullptr, "SetExternalRtcValue"},
{2, nullptr, "ReadExternalRtcResetFlag"},
{3, nullptr, "ClearExternalRtcResetFlag"},
};
// clang-format on
RegisterHandlers(functions);
}
};
void InstallInterfaces(SM::ServiceManager& sm) {
std::make_shared<BPC>()->InstallAsService(sm);
std::make_shared<BPC_R>()->InstallAsService(sm);
}
} // namespace Service::BPC

View File

@@ -0,0 +1,15 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
namespace Service::SM {
class ServiceManager;
}
namespace Service::BPC {
void InstallInterfaces(SM::ServiceManager& sm);
} // namespace Service::BPC

View File

@@ -0,0 +1,152 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include "core/hle/service/caps/caps.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
namespace Service::Capture {
class CAPS_A final : public ServiceFramework<CAPS_A> {
public:
explicit CAPS_A() : ServiceFramework{"caps:a"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "Unknown1"},
{1, nullptr, "Unknown2"},
{2, nullptr, "Unknown3"},
{3, nullptr, "Unknown4"},
{4, nullptr, "Unknown5"},
{5, nullptr, "Unknown6"},
{6, nullptr, "Unknown7"},
{7, nullptr, "Unknown8"},
{8, nullptr, "Unknown9"},
{9, nullptr, "Unknown10"},
{10, nullptr, "Unknown11"},
{11, nullptr, "Unknown12"},
{12, nullptr, "Unknown13"},
{13, nullptr, "Unknown14"},
{14, nullptr, "Unknown15"},
{301, nullptr, "Unknown16"},
{401, nullptr, "Unknown17"},
{501, nullptr, "Unknown18"},
{1001, nullptr, "Unknown19"},
{1002, nullptr, "Unknown20"},
{8001, nullptr, "Unknown21"},
{8002, nullptr, "Unknown22"},
{8011, nullptr, "Unknown23"},
{8012, nullptr, "Unknown24"},
{8021, nullptr, "Unknown25"},
{10011, nullptr, "Unknown26"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class CAPS_C final : public ServiceFramework<CAPS_C> {
public:
explicit CAPS_C() : ServiceFramework{"caps:c"} {
// clang-format off
static const FunctionInfo functions[] = {
{2001, nullptr, "Unknown1"},
{2002, nullptr, "Unknown2"},
{2011, nullptr, "Unknown3"},
{2012, nullptr, "Unknown4"},
{2013, nullptr, "Unknown5"},
{2014, nullptr, "Unknown6"},
{2101, nullptr, "Unknown7"},
{2102, nullptr, "Unknown8"},
{2201, nullptr, "Unknown9"},
{2301, nullptr, "Unknown10"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class CAPS_SC final : public ServiceFramework<CAPS_SC> {
public:
explicit CAPS_SC() : ServiceFramework{"caps:sc"} {
// clang-format off
static const FunctionInfo functions[] = {
{1, nullptr, "Unknown1"},
{2, nullptr, "Unknown2"},
{1001, nullptr, "Unknown3"},
{1002, nullptr, "Unknown4"},
{1003, nullptr, "Unknown5"},
{1011, nullptr, "Unknown6"},
{1012, nullptr, "Unknown7"},
{1201, nullptr, "Unknown8"},
{1202, nullptr, "Unknown9"},
{1203, nullptr, "Unknown10"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class CAPS_SS final : public ServiceFramework<CAPS_SS> {
public:
explicit CAPS_SS() : ServiceFramework{"caps:ss"} {
// clang-format off
static const FunctionInfo functions[] = {
{201, nullptr, "Unknown1"},
{202, nullptr, "Unknown2"},
{203, nullptr, "Unknown3"},
{204, nullptr, "Unknown4"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class CAPS_SU final : public ServiceFramework<CAPS_SU> {
public:
explicit CAPS_SU() : ServiceFramework{"caps:su"} {
// clang-format off
static const FunctionInfo functions[] = {
{201, nullptr, "SaveScreenShot"},
{203, nullptr, "SaveScreenShotEx0"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class CAPS_U final : public ServiceFramework<CAPS_U> {
public:
explicit CAPS_U() : ServiceFramework{"caps:u"} {
// clang-format off
static const FunctionInfo functions[] = {
{102, nullptr, "GetAlbumFileListByAruid"},
{103, nullptr, "DeleteAlbumFileByAruid"},
{104, nullptr, "GetAlbumFileSizeByAruid"},
{110, nullptr, "LoadAlbumScreenShotImageByAruid"},
{120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"},
{60002, nullptr, "OpenAccessorSessionForApplication"},
};
// clang-format on
RegisterHandlers(functions);
}
};
void InstallInterfaces(SM::ServiceManager& sm) {
std::make_shared<CAPS_A>()->InstallAsService(sm);
std::make_shared<CAPS_C>()->InstallAsService(sm);
std::make_shared<CAPS_SC>()->InstallAsService(sm);
std::make_shared<CAPS_SS>()->InstallAsService(sm);
std::make_shared<CAPS_SU>()->InstallAsService(sm);
std::make_shared<CAPS_U>()->InstallAsService(sm);
}
} // namespace Service::Capture

View File

@@ -0,0 +1,15 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
namespace Service::SM {
class ServiceManager;
}
namespace Service::Capture {
void InstallInterfaces(SM::ServiceManager& sm);
} // namespace Service::Capture

View File

@@ -13,11 +13,11 @@
namespace Service::LM {
class Logger final : public ServiceFramework<Logger> {
class ILogger final : public ServiceFramework<ILogger> {
public:
Logger() : ServiceFramework("Logger") {
ILogger() : ServiceFramework("ILogger") {
static const FunctionInfo functions[] = {
{0x00000000, &Logger::Initialize, "Initialize"},
{0x00000000, &ILogger::Initialize, "Initialize"},
{0x00000001, nullptr, "SetDestination"},
};
RegisterHandlers(functions);
@@ -182,7 +182,7 @@ public:
void OpenLogger(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<Logger>();
rb.PushIpcInterface<ILogger>();
LOG_DEBUG(Service_LM, "called");
}

View File

@@ -0,0 +1,84 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include "core/hle/service/pcv/pcv.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
namespace Service::PCV {
class PCV final : public ServiceFramework<PCV> {
public:
explicit PCV() : ServiceFramework{"pcv"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "SetPowerEnabled"},
{1, nullptr, "SetClockEnabled"},
{2, nullptr, "SetClockRate"},
{3, nullptr, "GetClockRate"},
{4, nullptr, "GetState"},
{5, nullptr, "GetPossibleClockRates"},
{6, nullptr, "SetMinVClockRate"},
{7, nullptr, "SetReset"},
{8, nullptr, "SetVoltageEnabled"},
{9, nullptr, "GetVoltageEnabled"},
{10, nullptr, "GetVoltageRange"},
{11, nullptr, "SetVoltageValue"},
{12, nullptr, "GetVoltageValue"},
{13, nullptr, "GetTemperatureThresholds"},
{14, nullptr, "SetTemperature"},
{15, nullptr, "Initialize"},
{16, nullptr, "IsInitialized"},
{17, nullptr, "Finalize"},
{18, nullptr, "PowerOn"},
{19, nullptr, "PowerOff"},
{20, nullptr, "ChangeVoltage"},
{21, nullptr, "GetPowerClockInfoEvent"},
{22, nullptr, "GetOscillatorClock"},
{23, nullptr, "GetDvfsTable"},
{24, nullptr, "GetModuleStateTable"},
{25, nullptr, "GetPowerDomainStateTable"},
{26, nullptr, "GetFuseInfo"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class PCV_ARB final : public ServiceFramework<PCV_ARB> {
public:
explicit PCV_ARB() : ServiceFramework{"pcv:arb"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "ReleaseControl"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class PCV_IMM final : public ServiceFramework<PCV_IMM> {
public:
explicit PCV_IMM() : ServiceFramework{"pcv:imm"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "SetClockRate"},
};
// clang-format on
RegisterHandlers(functions);
}
};
void InstallInterfaces(SM::ServiceManager& sm) {
std::make_shared<PCV>()->InstallAsService(sm);
std::make_shared<PCV_ARB>()->InstallAsService(sm);
std::make_shared<PCV_IMM>()->InstallAsService(sm);
}
} // namespace Service::PCV

View File

@@ -0,0 +1,15 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
namespace Service::SM {
class ServiceManager;
}
namespace Service::PCV {
void InstallInterfaces(SM::ServiceManager& sm);
} // namespace Service::PCV

View File

@@ -21,8 +21,10 @@
#include "core/hle/service/apm/apm.h"
#include "core/hle/service/audio/audio.h"
#include "core/hle/service/bcat/bcat.h"
#include "core/hle/service/bpc/bpc.h"
#include "core/hle/service/btdrv/btdrv.h"
#include "core/hle/service/btm/btm.h"
#include "core/hle/service/caps/caps.h"
#include "core/hle/service/erpt/erpt.h"
#include "core/hle/service/es/es.h"
#include "core/hle/service/eupld/eupld.h"
@@ -47,6 +49,7 @@
#include "core/hle/service/nvdrv/nvdrv.h"
#include "core/hle/service/pcie/pcie.h"
#include "core/hle/service/pctl/pctl.h"
#include "core/hle/service/pcv/pcv.h"
#include "core/hle/service/pm/pm.h"
#include "core/hle/service/prepo/prepo.h"
#include "core/hle/service/service.h"
@@ -204,8 +207,10 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
APM::InstallInterfaces(*sm);
Audio::InstallInterfaces(*sm);
BCAT::InstallInterfaces(*sm);
BPC::InstallInterfaces(*sm);
BtDrv::InstallInterfaces(*sm);
BTM::InstallInterfaces(*sm);
Capture::InstallInterfaces(*sm);
ERPT::InstallInterfaces(*sm);
ES::InstallInterfaces(*sm);
EUPLD::InstallInterfaces(*sm);
@@ -230,6 +235,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
Nvidia::InstallInterfaces(*sm);
PCIe::InstallInterfaces(*sm);
PCTL::InstallInterfaces(*sm);
PCV::InstallInterfaces(*sm);
PlayReport::InstallInterfaces(*sm);
PM::InstallInterfaces(*sm);
Set::InstallInterfaces(*sm);

View File

@@ -82,7 +82,7 @@ public:
GLenum logic_op; // GL_LOGIC_OP_MODE
// 3 texture units - one for each that is used in PICA fragment shader emulation
struct {
struct TextureUnit {
GLuint texture_2d; // GL_TEXTURE_BINDING_2D
GLuint sampler; // GL_SAMPLER_BINDING
struct {
@@ -104,7 +104,8 @@ public:
Unbind();
sampler = 0;
}
} texture_units[32];
};
std::array<TextureUnit, 32> texture_units;
struct {
GLuint read_framebuffer; // GL_READ_FRAMEBUFFER_BINDING