early-access version 3921

This commit is contained in:
pineappleEA 2023-10-10 20:54:27 +02:00
parent c7233d4856
commit a0fb9f1798
10 changed files with 90 additions and 13 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 3920. This is the source code for early-access 3921.
## Legal Notice ## Legal Notice

View file

@ -77,6 +77,7 @@ void AudioRenderer::Wait() {
"{}, got {}", "{}, got {}",
Message::RenderResponse, msg); Message::RenderResponse, msg);
} }
PostDSPClearCommandBuffer();
} }
void AudioRenderer::Send(Direction dir, u32 message) { void AudioRenderer::Send(Direction dir, u32 message) {
@ -96,6 +97,15 @@ void AudioRenderer::SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u
command_buffers[session_id].reset_buffer = reset; command_buffers[session_id].reset_buffer = reset;
} }
void AudioRenderer::PostDSPClearCommandBuffer() noexcept {
command_buffers[0].buffer = 0;
command_buffers[0].size = 0;
command_buffers[0].reset_buffer = false;
command_buffers[1].buffer = 0;
command_buffers[1].size = 0;
command_buffers[1].reset_buffer = false;
}
u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept { u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept {
return command_buffers[session_id].remaining_command_count; return command_buffers[session_id].remaining_command_count;
} }

View file

@ -85,6 +85,8 @@ private:
*/ */
void CreateSinkStreams(); void CreateSinkStreams();
void PostDSPClearCommandBuffer() noexcept;
/// Core system /// Core system
Core::System& system; Core::System& system;
/// The output sink the AudioRenderer will send samples to /// The output sink the AudioRenderer will send samples to

View file

@ -49,7 +49,7 @@ public:
: ServiceFramework{system_, "IManagerForSystemService"} { : ServiceFramework{system_, "IManagerForSystemService"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, nullptr, "CheckAvailability"}, {0, &IManagerForSystemService::CheckAvailability, "CheckAvailability"},
{1, nullptr, "GetAccountId"}, {1, nullptr, "GetAccountId"},
{2, nullptr, "EnsureIdTokenCacheAsync"}, {2, nullptr, "EnsureIdTokenCacheAsync"},
{3, nullptr, "LoadIdTokenCache"}, {3, nullptr, "LoadIdTokenCache"},
@ -78,6 +78,13 @@ public:
RegisterHandlers(functions); RegisterHandlers(functions);
} }
private:
void CheckAvailability(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
}; };
// 3.0.0+ // 3.0.0+
@ -400,8 +407,8 @@ protected:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto base = rp.PopRaw<ProfileBase>(); const auto base = rp.PopRaw<ProfileBase>();
const auto user_data = ctx.ReadBuffer(); const auto user_data = ctx.ReadBuffer(0);
const auto image_data = ctx.ReadBuffer(1); const auto image_data = ctx.ReadBuffer(1); // TODO: Check if this buffer is always provided
LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}", LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}",
Common::StringFromFixedZeroTerminatedBuffer( Common::StringFromFixedZeroTerminatedBuffer(
@ -837,6 +844,29 @@ void Module::Interface::InitializeApplicationInfoV2(HLERequestContext& ctx) {
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void Module::Interface::BeginUserRegistration(HLERequestContext& ctx) {
const auto user_id = Common::UUID::MakeRandom();
profile_manager->CreateNewUser(user_id, "yuzu");
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());
IPC::ResponseBuilder rb{ctx, 6};
rb.Push(ResultSuccess);
rb.PushRaw(user_id);
}
void Module::Interface::CompleteUserRegistration(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());
profile_manager->WriteUserSaveFile();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::GetProfileEditor(HLERequestContext& ctx) { void Module::Interface::GetProfileEditor(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>(); Common::UUID user_id = rp.PopRaw<Common::UUID>();
@ -880,6 +910,17 @@ void Module::Interface::StoreSaveDataThumbnailApplication(HLERequestContext& ctx
StoreSaveDataThumbnail(ctx, uuid, tid); StoreSaveDataThumbnail(ctx, uuid, tid);
} }
void Module::Interface::GetBaasAccountManagerForSystemService(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto uuid = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString());
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IManagerForSystemService>(system, uuid);
}
void Module::Interface::StoreSaveDataThumbnailSystem(HLERequestContext& ctx) { void Module::Interface::StoreSaveDataThumbnailSystem(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto uuid = rp.PopRaw<Common::UUID>(); const auto uuid = rp.PopRaw<Common::UUID>();

View file

@ -33,10 +33,13 @@ public:
void TrySelectUserWithoutInteraction(HLERequestContext& ctx); void TrySelectUserWithoutInteraction(HLERequestContext& ctx);
void IsUserAccountSwitchLocked(HLERequestContext& ctx); void IsUserAccountSwitchLocked(HLERequestContext& ctx);
void InitializeApplicationInfoV2(HLERequestContext& ctx); void InitializeApplicationInfoV2(HLERequestContext& ctx);
void BeginUserRegistration(HLERequestContext& ctx);
void CompleteUserRegistration(HLERequestContext& ctx);
void GetProfileEditor(HLERequestContext& ctx); void GetProfileEditor(HLERequestContext& ctx);
void ListQualifiedUsers(HLERequestContext& ctx); void ListQualifiedUsers(HLERequestContext& ctx);
void ListOpenContextStoredUsers(HLERequestContext& ctx); void ListOpenContextStoredUsers(HLERequestContext& ctx);
void StoreSaveDataThumbnailApplication(HLERequestContext& ctx); void StoreSaveDataThumbnailApplication(HLERequestContext& ctx);
void GetBaasAccountManagerForSystemService(HLERequestContext& ctx);
void StoreSaveDataThumbnailSystem(HLERequestContext& ctx); void StoreSaveDataThumbnailSystem(HLERequestContext& ctx);
private: private:

View file

@ -23,7 +23,7 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
{99, nullptr, "DebugActivateOpenContextRetention"}, {99, nullptr, "DebugActivateOpenContextRetention"},
{100, nullptr, "GetUserRegistrationNotifier"}, {100, nullptr, "GetUserRegistrationNotifier"},
{101, nullptr, "GetUserStateChangeNotifier"}, {101, nullptr, "GetUserStateChangeNotifier"},
{102, nullptr, "GetBaasAccountManagerForSystemService"}, {102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"},
{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"},
{104, nullptr, "GetProfileUpdateNotifier"}, {104, nullptr, "GetProfileUpdateNotifier"},
{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, {105, nullptr, "CheckNetworkServiceAvailabilityAsync"},
@ -40,8 +40,8 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, {152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"},
{190, nullptr, "GetUserLastOpenedApplication"}, {190, nullptr, "GetUserLastOpenedApplication"},
{191, nullptr, "ActivateOpenContextHolder"}, {191, nullptr, "ActivateOpenContextHolder"},
{200, nullptr, "BeginUserRegistration"}, {200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"},
{201, nullptr, "CompleteUserRegistration"}, {201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"},
{202, nullptr, "CancelUserRegistration"}, {202, nullptr, "CancelUserRegistration"},
{203, nullptr, "DeleteUser"}, {203, nullptr, "DeleteUser"},
{204, nullptr, "SetUserPosition"}, {204, nullptr, "SetUserPosition"},

View file

@ -96,9 +96,10 @@ public:
bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new, bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
const UserData& data_new); const UserData& data_new);
void WriteUserSaveFile();
private: private:
void ParseUserSaveFile(); void ParseUserSaveFile();
void WriteUserSaveFile();
std::optional<std::size_t> AddToProfiles(const ProfileInfo& profile); std::optional<std::size_t> AddToProfiles(const ProfileInfo& profile);
bool RemoveProfileAtIndex(std::size_t index); bool RemoveProfileAtIndex(std::size_t index);

View file

@ -1557,7 +1557,7 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_)
{100, nullptr, "CreateGameMovieTrimmer"}, {100, nullptr, "CreateGameMovieTrimmer"},
{101, nullptr, "ReserveResourceForMovieOperation"}, {101, nullptr, "ReserveResourceForMovieOperation"},
{102, nullptr, "UnreserveResourceForMovieOperation"}, {102, nullptr, "UnreserveResourceForMovieOperation"},
{110, nullptr, "GetMainAppletAvailableUsers"}, {110, &ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers, "GetMainAppletAvailableUsers"},
{120, nullptr, "GetLaunchStorageInfoForDebug"}, {120, nullptr, "GetLaunchStorageInfoForDebug"},
{130, nullptr, "GetGpuErrorDetectedSystemEvent"}, {130, nullptr, "GetGpuErrorDetectedSystemEvent"},
{140, nullptr, "SetApplicationMemoryReservation"}, {140, nullptr, "SetApplicationMemoryReservation"},
@ -1652,6 +1652,25 @@ void ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo(HLERequestContext&
rb.PushRaw(applet_info); rb.PushRaw(applet_info);
} }
void ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(HLERequestContext& ctx) {
const Service::Account::ProfileManager manager{};
bool is_empty{true};
s32 user_count{-1};
LOG_INFO(Service_AM, "called");
if (manager.GetUserCount() > 0) {
is_empty = false;
user_count = static_cast<s32>(manager.GetUserCount());
ctx.WriteBuffer(manager.GetAllUsers());
}
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
rb.Push<u8>(is_empty);
rb.Push(user_count);
}
void ILibraryAppletSelfAccessor::PushInShowAlbum() { void ILibraryAppletSelfAccessor::PushInShowAlbum() {
const Applets::CommonArguments arguments{ const Applets::CommonArguments arguments{
.arguments_version = Applets::CommonArgumentVersion::Version3, .arguments_version = Applets::CommonArgumentVersion::Version3,

View file

@ -345,6 +345,7 @@ private:
void GetLibraryAppletInfo(HLERequestContext& ctx); void GetLibraryAppletInfo(HLERequestContext& ctx);
void ExitProcessAndReturn(HLERequestContext& ctx); void ExitProcessAndReturn(HLERequestContext& ctx);
void GetCallerAppletIdentityInfo(HLERequestContext& ctx); void GetCallerAppletIdentityInfo(HLERequestContext& ctx);
void GetMainAppletAvailableUsers(HLERequestContext& ctx);
void PushInShowAlbum(); void PushInShowAlbum();
void PushInShowCabinetData(); void PushInShowCabinetData();

View file

@ -66,9 +66,10 @@ struct Range {
switch (usage) { switch (usage) {
case MemoryUsage::Upload: case MemoryUsage::Upload:
case MemoryUsage::Stream: case MemoryUsage::Stream:
return VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; return VMA_ALLOCATION_CREATE_MAPPED_BIT |
VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT;
case MemoryUsage::Download: case MemoryUsage::Download:
return VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; return VMA_ALLOCATION_CREATE_MAPPED_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT;
case MemoryUsage::DeviceLocal: case MemoryUsage::DeviceLocal:
return {}; return {};
} }
@ -252,8 +253,7 @@ vk::Image MemoryAllocator::CreateImage(const VkImageCreateInfo& ci) const {
vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo& ci, MemoryUsage usage) const { vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo& ci, MemoryUsage usage) const {
const VmaAllocationCreateInfo alloc_ci = { const VmaAllocationCreateInfo alloc_ci = {
.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT | .flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage),
MemoryUsageVmaFlags(usage),
.usage = MemoryUsageVma(usage), .usage = MemoryUsageVma(usage),
.requiredFlags = 0, .requiredFlags = 0,
.preferredFlags = MemoryUsagePreferedVmaFlags(usage), .preferredFlags = MemoryUsagePreferedVmaFlags(usage),