Compare commits
40 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
195b4b5129 | ||
|
|
138c03d565 | ||
|
|
5d38bb36c3 | ||
|
|
36dc44fb22 | ||
|
|
6a36ffb86c | ||
|
|
18507b09b2 | ||
|
|
73c0ef7453 | ||
|
|
62a8c61e36 | ||
|
|
01f379baa7 | ||
|
|
15318b6601 | ||
|
|
33eba9b96e | ||
|
|
ed296e47f1 | ||
|
|
2b3ee30a46 | ||
|
|
e50188374f | ||
|
|
ee08c39b72 | ||
|
|
d3e63e4220 | ||
|
|
e2f06dbc17 | ||
|
|
b17763e3d4 | ||
|
|
5fcf8d530a | ||
|
|
6f22471a72 | ||
|
|
c65ac49238 | ||
|
|
c7452bab90 | ||
|
|
f2b4b668e3 | ||
|
|
0568346cc3 | ||
|
|
8bff9c9152 | ||
|
|
10955d72ef | ||
|
|
66388f7576 | ||
|
|
7fa32af1c7 | ||
|
|
1998a16557 | ||
|
|
7172ff4d9a | ||
|
|
b2386fc712 | ||
|
|
1c98f3a9b3 | ||
|
|
60d650cc4e | ||
|
|
d92636d424 | ||
|
|
d05dc3f4dd | ||
|
|
008823724f | ||
|
|
9ae55884d2 | ||
|
|
a66eb7351b | ||
|
|
9a9d33a741 | ||
|
|
0a8d13801a |
@@ -32,7 +32,7 @@ matrix:
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: IuTT8DjxzNgOtaEsyOpz1JaSmtDtHSsWZnJKmSBwXAzgP2ZU4Ja3/q0z5PwbC5Ql7kuFahuYTE5oi7lbJBuu2P3y1Wj2zvFozGUkA3JUvEXDNOPS9QTJ1EYd6O+wenZoj7d/Pn+ZeIgyEafnnZsGBb8lMQnV9MfIHgYlZQ5EyF3n4XikT2h1UbDBYx74ciXZIxFEulx68kDr9Q4/U+zIYQmYv2N+lgXSLDkFrCJ046gRcujPYGPqE6jVw0kKni80CTTpuDF5prU8yIBeiffjkJ3Qx1a17G07eZ4r83P4XUOlaHbRBmA/8ywZvLF2Gep3wGKfSFgMWbPxBJk5ZSYcOOAgMsEcg0+gBK9gLTwO4pbmc2GvqP21yRQBzgtbFoEtAHLu5lVPBkZU7kZuRMJtRdqvFIwOLhpnRS8IknFOD5vjtaFiNdGWaK9ePdsGvplijnXcPafkumakc4+eVEiXb6/KzdX1zXdur5tuUPFytm0Oy6IJcGIf8FHXGvUlmWsnPzwfusij9JgeQOP+uegc9PdBfL+h7L5rk+ilELt3cXD5K7wgov/4hkl5istNJ2bm0IioIstWss8QQQTkyscGoeh/oXmUpOL4FdsTvsWhDR3QKeq8nSzgDkqLe0iSbplQGnC7o7ytNbldmxJvf3nylwglA8w3HlqLHtZLkUOcuQ0=
|
||||
secure: ElsIAlbvVXBNKsP31nVPysh+mf0GQA4DiL/y5iJeQxKQYR6iRoNo+RfzOBmdswdo0bE/PGeBAlfzCkp15gjhWf6Je0N6dRpczmcmLq6SSQFn1Mpq00xMJB2AgQIlaHs6KFgoUA173EBKbPwgU/NubTFpJFm/Wa+NcSWAHQXKL9KT2M3qKpxNkPl3mKEVsbch4REP+T/46vsa+ikw0VE0kIs6V93LqUQZpI2F0Dhihx8Cxr5iedkE1QsNK+QSX9iItMHbfek9OH980gP7L3lkZltyAA1Pk0c37OAgz2PwczwNKwCT8jg9PMzdcKmWouvLyAkZFuA806ElzwHY3oEd91Zm6+Bk5n24yBKZ9027AZzw38NK2Z2m9Akb8+ar8PdsKU6N5pDutX9qSLayr0oMgJ0s7/xnGBGdL3gfkPCFc50xO/2DxlsOR+zAhPNM9Y76hhGy6A7/40+9uzrJvd4nAuDvIXRzi2Yl2L7mKBE4suMKbFLtk2LlgM0qY5JMVTQ8NliaEtqopfPur2KWFVJUpWDNLtNX8xGqhfwg7cLjIiGmnxSaJBTDuZI6dpEjkWkU0n1xYhGqEqit8DbehYzazozMJ+Vsr8hku7jGlUtlw+U6HG1e19O2y4aGeSwYPROcCNz+BLwmVM8oZE3Roy3qoaa2yiFf+sy6rUHznrhsfEM=
|
||||
file_glob: true
|
||||
file: "artifacts/*"
|
||||
skip_cleanup: true
|
||||
|
||||
15
appveyor.yml
15
appveyor.yml
@@ -13,8 +13,8 @@ environment:
|
||||
# Tell msys2 to inherit the current directory when starting the shell
|
||||
CHERE_INVOKING: 1
|
||||
matrix:
|
||||
- BUILD_TYPE: mingw
|
||||
- BUILD_TYPE: msvc
|
||||
- BUILD_TYPE: mingw
|
||||
|
||||
platform:
|
||||
- x64
|
||||
@@ -80,12 +80,19 @@ after_build:
|
||||
$env:BUILD_SYMBOLS = $MSVC_BUILD_PDB
|
||||
$env:BUILD_UPDATE = $MSVC_SEVENZIP
|
||||
|
||||
$BUILD_DIR = ".\msvc_build\bin\Release"
|
||||
|
||||
# Make a debug symbol upload
|
||||
mkdir pdb
|
||||
Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb
|
||||
Get-ChildItem "$BUILD_DIR\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb
|
||||
7z a -tzip $MSVC_BUILD_PDB .\pdb\*.pdb
|
||||
rm "$BUILD_DIR\*.pdb"
|
||||
|
||||
mkdir $RELEASE_DIST
|
||||
Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
|
||||
# get rid of extra exes by copying everything over, then deleting all the exes, then copying just the exes we want
|
||||
Copy-Item "$BUILD_DIR\*" -Destination $RELEASE_DIST -Recurse
|
||||
rm "$RELEASE_DIST\*.exe"
|
||||
Get-ChildItem "$BUILD_DIR" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
|
||||
Copy-Item .\license.txt -Destination $RELEASE_DIST
|
||||
Copy-Item .\README.md -Destination $RELEASE_DIST
|
||||
7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
|
||||
@@ -163,7 +170,7 @@ deploy:
|
||||
provider: GitHub
|
||||
release: $(appveyor_repo_tag_name)
|
||||
auth_token:
|
||||
secure: "argb6oi2TYLB4wDy+HoCC8PuGAmsnocSk12CQ5614XAPO+NVPndlkLv1utnDFfg2"
|
||||
secure: QqePPnXbkzmXct5c8hZ2X5AbsthbI6cS1Sr+VBzcD8oUOIjfWJJKXVAQGUbQAbb0
|
||||
artifact: update,build
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
2
externals/catch
vendored
2
externals/catch
vendored
Submodule externals/catch updated: 3dcc923351...cd76f5730c
@@ -53,10 +53,10 @@ template <typename T>
|
||||
class Field : public FieldInterface {
|
||||
public:
|
||||
Field(FieldType type, std::string name, const T& value)
|
||||
: type(type), name(std::move(name)), value(value) {}
|
||||
: name(std::move(name)), type(type), value(value) {}
|
||||
|
||||
Field(FieldType type, std::string name, T&& value)
|
||||
: type(type), name(std::move(name)), value(std::move(value)) {}
|
||||
: name(std::move(name)), type(type), value(std::move(value)) {}
|
||||
|
||||
Field(const Field& other) : Field(other.type, other.name, other.value) {}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ set(SRCS
|
||||
hle/service/sm/controller.cpp
|
||||
hle/service/sm/sm.cpp
|
||||
hle/service/time/time.cpp
|
||||
hle/service/time/time_s.cpp
|
||||
hle/service/vi/vi.cpp
|
||||
hle/service/vi/vi_m.cpp
|
||||
hle/shared_page.cpp
|
||||
@@ -90,6 +89,7 @@ set(HEADERS
|
||||
file_sys/ivfc_archive.h
|
||||
file_sys/path_parser.h
|
||||
file_sys/savedata_archive.h
|
||||
file_sys/title_metadata.h
|
||||
frontend/emu_window.h
|
||||
frontend/framebuffer_layout.h
|
||||
frontend/input.h
|
||||
@@ -148,7 +148,6 @@ set(HEADERS
|
||||
hle/service/sm/controller.h
|
||||
hle/service/sm/sm.h
|
||||
hle/service/time/time.h
|
||||
hle/service/time/time_s.h
|
||||
hle/service/vi/vi.h
|
||||
hle/service/vi/vi_m.h
|
||||
hle/shared_page.h
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
|
||||
@@ -905,7 +905,7 @@ void ToggleServer(bool status) {
|
||||
server_enabled = status;
|
||||
|
||||
// Start server
|
||||
if (!IsConnected() && Core::System().GetInstance().IsPoweredOn()) {
|
||||
if (!IsConnected() && Core::System::GetInstance().IsPoweredOn()) {
|
||||
Init();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -255,9 +255,8 @@ static ResultCode CancelSynchronization(Handle thread_handle) {
|
||||
/// Attempts to locks a mutex, creating it if it does not already exist
|
||||
static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr,
|
||||
Handle requesting_thread_handle) {
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called holding_thread_handle=0x%08X, mutex_addr=0x%llx, "
|
||||
"requesting_current_thread_handle=0x%08X",
|
||||
LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, "
|
||||
"requesting_current_thread_handle=0x%08X",
|
||||
holding_thread_handle, mutex_addr, requesting_thread_handle);
|
||||
|
||||
SharedPtr<Thread> holding_thread = g_handle_table.Get<Thread>(holding_thread_handle);
|
||||
@@ -547,9 +546,8 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
|
||||
|
||||
Core::System::GetInstance().PrepareReschedule();
|
||||
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, "
|
||||
"threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X",
|
||||
LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, "
|
||||
"threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X",
|
||||
entry_point, name.c_str(), arg, stack_top, priority, processor_id, *out_handle);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace HID {
|
||||
|
||||
// Updating period for each HID device.
|
||||
// TODO(shinyquagsire23): These need better values.
|
||||
constexpr u64 pad_update_ticks = BASE_CLOCK_RATE / 234;
|
||||
constexpr u64 accelerometer_update_ticks = BASE_CLOCK_RATE / 104;
|
||||
constexpr u64 gyroscope_update_ticks = BASE_CLOCK_RATE / 101;
|
||||
constexpr u64 pad_update_ticks = BASE_CLOCK_RATE / 10000;
|
||||
constexpr u64 accelerometer_update_ticks = BASE_CLOCK_RATE / 10000;
|
||||
constexpr u64 gyroscope_update_ticks = BASE_CLOCK_RATE / 10000;
|
||||
|
||||
class IAppletResource final : public ServiceFramework<IAppletResource> {
|
||||
public:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/nvdrv/devices/nvdisp_disp0.h"
|
||||
#include "core/hle/service/nvdrv/devices/nvmap.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
@@ -28,6 +29,8 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3
|
||||
using PixelFormat = RendererBase::FramebufferInfo::PixelFormat;
|
||||
const RendererBase::FramebufferInfo framebuffer_info{
|
||||
addr, offset, width, height, stride, static_cast<PixelFormat>(format)};
|
||||
|
||||
Core::System::GetInstance().perf_stats.EndGameFrame();
|
||||
VideoCore::g_renderer->SwapBuffers(framebuffer_info);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,18 @@ void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(nv_result);
|
||||
}
|
||||
|
||||
void NVDRV::Close(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
u32 fd = rp.Pop<u32>();
|
||||
|
||||
auto result = nvdrv->Close(fd);
|
||||
|
||||
IPC::RequestBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
IPC::RequestBuilder rb{ctx, 3};
|
||||
@@ -60,6 +72,7 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name)
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &NVDRV::Open, "Open"},
|
||||
{1, &NVDRV::Ioctl, "Ioctl"},
|
||||
{2, &NVDRV::Close, "Close"},
|
||||
{3, &NVDRV::Initialize, "Initialize"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
private:
|
||||
void Open(Kernel::HLERequestContext& ctx);
|
||||
void Ioctl(Kernel::HLERequestContext& ctx);
|
||||
void Close(Kernel::HLERequestContext& ctx);
|
||||
void Initialize(Kernel::HLERequestContext& ctx);
|
||||
|
||||
std::shared_ptr<Module> nvdrv;
|
||||
|
||||
@@ -49,5 +49,15 @@ u32 Module::Ioctl(u32 fd, u32 command, const std::vector<u8>& input, std::vector
|
||||
return device->ioctl(command, input, output);
|
||||
}
|
||||
|
||||
ResultCode Module::Close(u32 fd) {
|
||||
auto itr = open_files.find(fd);
|
||||
ASSERT_MSG(itr != open_files.end(), "Tried to talk to an invalid device");
|
||||
|
||||
open_files.erase(itr);
|
||||
|
||||
// TODO(flerovium): return correct result code if operation failed.
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace Nvidia
|
||||
} // namespace Service
|
||||
|
||||
@@ -35,6 +35,8 @@ public:
|
||||
u32 Open(std::string device_name);
|
||||
/// Sends an ioctl command to the specified file descriptor.
|
||||
u32 Ioctl(u32 fd, u32 command, const std::vector<u8>& input, std::vector<u8>& output);
|
||||
/// Closes a device file descriptor and returns operation success.
|
||||
ResultCode Close(u32 fd);
|
||||
|
||||
private:
|
||||
/// Id to use for the next open file descriptor.
|
||||
|
||||
@@ -32,6 +32,12 @@ void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service, "called");
|
||||
}
|
||||
|
||||
void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) {
|
||||
DuplicateSession(ctx);
|
||||
|
||||
LOG_WARNING(Service, "(STUBBED) called, using DuplicateSession");
|
||||
}
|
||||
|
||||
void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestBuilder rb{ctx, 3};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
@@ -46,7 +52,7 @@ Controller::Controller() : ServiceFramework("IpcController") {
|
||||
{0x00000001, nullptr, "ConvertDomainToSession"},
|
||||
{0x00000002, &Controller::DuplicateSession, "DuplicateSession"},
|
||||
{0x00000003, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"},
|
||||
{0x00000004, nullptr, "DuplicateSessionEx"},
|
||||
{0x00000004, &Controller::DuplicateSessionEx, "DuplicateSessionEx"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public:
|
||||
private:
|
||||
void ConvertSessionToDomain(Kernel::HLERequestContext& ctx);
|
||||
void DuplicateSession(Kernel::HLERequestContext& ctx);
|
||||
void DuplicateSessionEx(Kernel::HLERequestContext& ctx);
|
||||
void QueryPointerBufferSize(Kernel::HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,14 +2,140 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <chrono>
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/service/time/time.h"
|
||||
#include "core/hle/service/time/time_s.h"
|
||||
|
||||
namespace Service {
|
||||
namespace Time {
|
||||
|
||||
class ISystemClock final : public ServiceFramework<ISystemClock> {
|
||||
public:
|
||||
ISystemClock() : ServiceFramework("ISystemClock") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISystemClock::GetCurrentTime, "GetCurrentTime"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
private:
|
||||
void GetCurrentTime(Kernel::HLERequestContext& ctx) {
|
||||
const s64 time_since_epoch{std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count()};
|
||||
IPC::RequestBuilder rb{ctx, 4};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u64>(time_since_epoch);
|
||||
LOG_DEBUG(Service, "called");
|
||||
}
|
||||
};
|
||||
|
||||
class ISteadyClock final : public ServiceFramework<ISteadyClock> {
|
||||
public:
|
||||
ISteadyClock() : ServiceFramework("ISteadyClock") {}
|
||||
};
|
||||
|
||||
class ITimeZoneService final : public ServiceFramework<ITimeZoneService> {
|
||||
public:
|
||||
ITimeZoneService() : ServiceFramework("ITimeZoneService") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"},
|
||||
{101, &ITimeZoneService::ToCalendarTimeWithMyRule, "ToCalendarTimeWithMyRule"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
private:
|
||||
void GetDeviceLocationName(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
LocationName name{};
|
||||
IPC::RequestBuilder rb{ctx, 11};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushRaw(name);
|
||||
}
|
||||
|
||||
void ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
u64 posixTime = rp.Pop<u64>();
|
||||
|
||||
LOG_WARNING(Service, "(STUBBED) called, posixTime=0x%016llX", posixTime);
|
||||
|
||||
CalendarTime calendarTime{2018, 1, 1, 0, 0, 0};
|
||||
CalendarAdditionalInfo additionalInfo{};
|
||||
IPC::RequestBuilder rb{ctx, 10};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushRaw(calendarTime);
|
||||
rb.PushRaw(additionalInfo);
|
||||
}
|
||||
};
|
||||
|
||||
void TIME::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
|
||||
auto client_port = std::make_shared<ISystemClock>()->CreatePort();
|
||||
auto session = client_port->Connect();
|
||||
if (session.Succeeded()) {
|
||||
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
|
||||
(*session)->GetObjectId());
|
||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
}
|
||||
|
||||
void TIME::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
|
||||
auto client_port = std::make_shared<ISystemClock>()->CreatePort();
|
||||
auto session = client_port->Connect();
|
||||
if (session.Succeeded()) {
|
||||
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
|
||||
(*session)->GetObjectId());
|
||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
}
|
||||
|
||||
void TIME::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
|
||||
auto client_port = std::make_shared<ISteadyClock>()->CreatePort();
|
||||
auto session = client_port->Connect();
|
||||
if (session.Succeeded()) {
|
||||
LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u",
|
||||
(*session)->GetObjectId());
|
||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
}
|
||||
|
||||
void TIME::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ITimeZoneService>();
|
||||
LOG_DEBUG(Service, "called");
|
||||
}
|
||||
|
||||
TIME::TIME(const char* name) : ServiceFramework(name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x00000000, &TIME::GetStandardUserSystemClock, "GetStandardUserSystemClock"},
|
||||
{0x00000001, &TIME::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"},
|
||||
{0x00000002, &TIME::GetStandardSteadyClock, "GetStandardSteadyClock"},
|
||||
{0x00000003, &TIME::GetTimeZoneService, "GetTimeZoneService"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
std::make_shared<TimeS>()->InstallAsService(service_manager);
|
||||
std::make_shared<TIME>("time:a")->InstallAsService(service_manager);
|
||||
std::make_shared<TIME>("time:r")->InstallAsService(service_manager);
|
||||
std::make_shared<TIME>("time:s")->InstallAsService(service_manager);
|
||||
std::make_shared<TIME>("time:u")->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Time
|
||||
|
||||
@@ -9,6 +9,42 @@
|
||||
namespace Service {
|
||||
namespace Time {
|
||||
|
||||
// TODO(Rozelette) RE this structure
|
||||
struct LocationName {
|
||||
INSERT_PADDING_BYTES(0x24);
|
||||
};
|
||||
static_assert(sizeof(LocationName) == 0x24, "LocationName structure has incorrect size");
|
||||
|
||||
struct CalendarTime {
|
||||
u16_le year;
|
||||
u8 month; // Starts at 1
|
||||
u8 day; // Starts at 1
|
||||
u8 hour;
|
||||
u8 minute;
|
||||
u8 second;
|
||||
INSERT_PADDING_BYTES(1);
|
||||
};
|
||||
static_assert(sizeof(CalendarTime) == 0x8, "CalendarTime structure has incorrect size");
|
||||
|
||||
// TODO(Rozelette) RE this structure
|
||||
struct CalendarAdditionalInfo {
|
||||
INSERT_PADDING_BYTES(0x18);
|
||||
};
|
||||
static_assert(sizeof(CalendarAdditionalInfo) == 0x18,
|
||||
"CalendarAdditionalInfo structure has incorrect size");
|
||||
|
||||
class TIME final : public ServiceFramework<TIME> {
|
||||
public:
|
||||
explicit TIME(const char* name);
|
||||
~TIME() = default;
|
||||
|
||||
private:
|
||||
void GetStandardUserSystemClock(Kernel::HLERequestContext& ctx);
|
||||
void GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx);
|
||||
void GetStandardSteadyClock(Kernel::HLERequestContext& ctx);
|
||||
void GetTimeZoneService(Kernel::HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
/// Registers all Time services with the specified service manager.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <chrono>
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/service/time/time_s.h"
|
||||
|
||||
namespace Service {
|
||||
namespace Time {
|
||||
|
||||
class ISystemClock final : public ServiceFramework<ISystemClock> {
|
||||
public:
|
||||
ISystemClock() : ServiceFramework("ISystemClock") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISystemClock::GetCurrentTime, "GetCurrentTime"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
private:
|
||||
void GetCurrentTime(Kernel::HLERequestContext& ctx) {
|
||||
const s64 time_since_epoch{std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count()};
|
||||
IPC::RequestBuilder rb{ctx, 4};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u64>(time_since_epoch);
|
||||
LOG_DEBUG(Service, "called");
|
||||
}
|
||||
};
|
||||
|
||||
void TimeS::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
|
||||
auto client_port = std::make_shared<ISystemClock>()->CreatePort();
|
||||
auto session = client_port->Connect();
|
||||
if (session.Succeeded()) {
|
||||
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
|
||||
(*session)->GetObjectId());
|
||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
}
|
||||
|
||||
TimeS::TimeS() : ServiceFramework("time:s") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x00000000, &TimeS::GetStandardUserSystemClock, "GetStandardUserSystemClock"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Time
|
||||
} // namespace Service
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service {
|
||||
namespace Time {
|
||||
|
||||
class TimeS final : public ServiceFramework<TimeS> {
|
||||
public:
|
||||
TimeS();
|
||||
~TimeS() = default;
|
||||
|
||||
private:
|
||||
void GetStandardUserSystemClock(Kernel::HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Time
|
||||
} // namespace Service
|
||||
@@ -62,20 +62,6 @@ static constexpr u32 PageAlignSize(u32 size) {
|
||||
return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK;
|
||||
}
|
||||
|
||||
static std::vector<u8> ReadSegment(FileUtil::IOFile& file, const NroSegmentHeader& header) {
|
||||
std::vector<u8> data;
|
||||
data.resize(header.size);
|
||||
|
||||
file.Seek(header.offset + sizeof(NroHeader), SEEK_SET);
|
||||
size_t bytes_read{file.ReadBytes(data.data(), header.size)};
|
||||
if (header.size != PageAlignSize(static_cast<u32>(bytes_read))) {
|
||||
LOG_CRITICAL(Loader, "Failed to read NRO segment bytes", header.size);
|
||||
return {};
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
|
||||
FileUtil::IOFile file(path, "rb");
|
||||
if (!file.IsOpen()) {
|
||||
@@ -95,7 +81,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
|
||||
// Build program image
|
||||
Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("", 0);
|
||||
std::vector<u8> program_image;
|
||||
program_image.resize(PageAlignSize(nro_header.file_size + nro_header.bss_size));
|
||||
program_image.resize(PageAlignSize(nro_header.file_size));
|
||||
file.Seek(0, SEEK_SET);
|
||||
file.ReadBytes(program_image.data(), nro_header.file_size);
|
||||
|
||||
@@ -107,24 +93,18 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
|
||||
|
||||
// Read MOD header
|
||||
ModHeader mod_header{};
|
||||
u32 bss_size{Memory::PAGE_SIZE}; // Default .bss to page size if MOD0 section doesn't exist
|
||||
// Default .bss to NRO header bss size if MOD0 section doesn't exist
|
||||
u32 bss_size{PageAlignSize(nro_header.bss_size)};
|
||||
std::memcpy(&mod_header, program_image.data() + nro_header.module_header_offset,
|
||||
sizeof(ModHeader));
|
||||
const bool has_mod_header{mod_header.magic == Common::MakeMagic('M', 'O', 'D', '0')};
|
||||
if (has_mod_header) {
|
||||
// Resize program image to include .bss section and page align each section
|
||||
bss_size = PageAlignSize(mod_header.bss_end_offset - mod_header.bss_start_offset);
|
||||
codeset->data.size += bss_size;
|
||||
}
|
||||
codeset->data.size += bss_size;
|
||||
program_image.resize(PageAlignSize(static_cast<u32>(program_image.size()) + bss_size));
|
||||
|
||||
// Relocate symbols if there was a proper MOD header - This must happen after the image has been
|
||||
// loaded into memory
|
||||
if (has_mod_header) {
|
||||
Relocate(program_image, nro_header.module_header_offset + mod_header.dynamic_offset,
|
||||
load_base);
|
||||
}
|
||||
|
||||
// Load codeset for current process
|
||||
codeset->name = path;
|
||||
codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image));
|
||||
@@ -141,9 +121,11 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
return ResultStatus::Error;
|
||||
}
|
||||
|
||||
// Load and relocate "main" and "sdk" NSO
|
||||
static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR};
|
||||
process = Kernel::Process::Create("main");
|
||||
|
||||
// Load NRO
|
||||
static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR};
|
||||
|
||||
if (!LoadNro(filepath, base_addr)) {
|
||||
return ResultStatus::ErrorInvalidFormat;
|
||||
}
|
||||
@@ -152,9 +134,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
process->address_mappings = default_address_mappings;
|
||||
process->resource_limit =
|
||||
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
|
||||
process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE);
|
||||
|
||||
ResolveImports();
|
||||
process->Run(base_addr + sizeof(NroHeader), 48, Kernel::DEFAULT_STACK_SIZE);
|
||||
|
||||
is_loaded = true;
|
||||
return ResultStatus::Success;
|
||||
|
||||
@@ -88,7 +88,7 @@ static constexpr u32 PageAlignSize(u32 size) {
|
||||
return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK;
|
||||
}
|
||||
|
||||
VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relocate) {
|
||||
VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base) {
|
||||
FileUtil::IOFile file(path, "rb");
|
||||
if (!file.IsOpen()) {
|
||||
return {};
|
||||
@@ -135,12 +135,6 @@ VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relo
|
||||
const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)};
|
||||
program_image.resize(image_size);
|
||||
|
||||
// Relocate symbols if there was a proper MOD header - This must happen after the image has been
|
||||
// loaded into memory
|
||||
if (has_mod_header && relocate) {
|
||||
Relocate(program_image, module_offset + mod_header.dynamic_offset, load_base);
|
||||
}
|
||||
|
||||
// Load codeset for current process
|
||||
codeset->name = path;
|
||||
codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image));
|
||||
@@ -181,8 +175,6 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
|
||||
process->Run(Memory::PROCESS_IMAGE_VADDR, 48, Kernel::DEFAULT_STACK_SIZE);
|
||||
|
||||
ResolveImports();
|
||||
|
||||
is_loaded = true;
|
||||
return ResultStatus::Success;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
|
||||
|
||||
private:
|
||||
VAddr LoadNso(const std::string& path, VAddr load_base, bool relocate = false);
|
||||
VAddr LoadNso(const std::string& path, VAddr load_base);
|
||||
|
||||
std::string filepath;
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ PerfStats::Results PerfStats::GetAndResetStats(u64 current_system_time_us) {
|
||||
double PerfStats::GetLastFrameTimeScale() {
|
||||
std::lock_guard<std::mutex> lock(object_mutex);
|
||||
|
||||
constexpr double FRAME_LENGTH = 1.0 / 60; // GPU::SCREEN_REFRESH_RATE;
|
||||
constexpr double FRAME_LENGTH = 1.0 / 60;
|
||||
return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH;
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(
|
||||
pollers.push_back(std::make_unique<SDLButtonPoller>());
|
||||
break;
|
||||
}
|
||||
return std::move(pollers);
|
||||
return pollers;
|
||||
}
|
||||
} // namespace Polling
|
||||
} // namespace SDL
|
||||
|
||||
@@ -66,11 +66,7 @@ file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*)
|
||||
|
||||
create_directory_groups(${SRCS} ${HEADERS} ${UIS})
|
||||
|
||||
if (Qt5_FOUND)
|
||||
qt5_wrap_ui(UI_HDRS ${UIS})
|
||||
else()
|
||||
qt4_wrap_ui(UI_HDRS ${UIS})
|
||||
endif()
|
||||
qt5_wrap_ui(UI_HDRS ${UIS})
|
||||
|
||||
if (APPLE)
|
||||
set(MACOSX_ICON "../../dist/yuzu.icns")
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#include <QApplication>
|
||||
#include <QHBoxLayout>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
// Required for screen DPI information
|
||||
#include <QScreen>
|
||||
#include <QWindow>
|
||||
#endif
|
||||
|
||||
#include "common/microprofile.h"
|
||||
#include "common/scm_rev.h"
|
||||
@@ -19,8 +15,7 @@
|
||||
#include "input_common/motion_emu.h"
|
||||
#include "yuzu/bootmanager.h"
|
||||
|
||||
EmuThread::EmuThread(GRenderWindow* render_window)
|
||||
: exec_step(false), running(false), stop_run(false), render_window(render_window) {}
|
||||
EmuThread::EmuThread(GRenderWindow* render_window) : render_window(render_window) {}
|
||||
|
||||
void EmuThread::run() {
|
||||
render_window->MakeCurrent();
|
||||
@@ -120,15 +115,13 @@ GRenderWindow::~GRenderWindow() {
|
||||
|
||||
void GRenderWindow::moveContext() {
|
||||
DoneCurrent();
|
||||
// We need to move GL context to the swapping thread in Qt5
|
||||
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
|
||||
|
||||
// If the thread started running, move the GL Context to the new thread. Otherwise, move it
|
||||
// back.
|
||||
auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr)
|
||||
? emu_thread
|
||||
: qApp->thread();
|
||||
child->context()->moveToThread(thread);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GRenderWindow::SwapBuffers() {
|
||||
@@ -191,12 +184,8 @@ QByteArray GRenderWindow::saveGeometry() {
|
||||
}
|
||||
|
||||
qreal GRenderWindow::windowPixelRatio() {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
// windowHandle() might not be accessible until the window is displayed to screen.
|
||||
return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
|
||||
#else
|
||||
return 1.0f;
|
||||
#endif
|
||||
}
|
||||
|
||||
void GRenderWindow::closeEvent(QCloseEvent* event) {
|
||||
@@ -299,9 +288,7 @@ void GRenderWindow::OnEmulationStopping() {
|
||||
void GRenderWindow::showEvent(QShowEvent* event) {
|
||||
QWidget::showEvent(event);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
// windowHandle() is not initialized until the Window is shown, so we connect it here.
|
||||
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
|
||||
SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
* @return True if the emulation thread is running, otherwise false
|
||||
* @note This function is thread-safe
|
||||
*/
|
||||
bool IsRunning() {
|
||||
bool IsRunning() const {
|
||||
return running;
|
||||
}
|
||||
|
||||
@@ -68,12 +68,12 @@ public:
|
||||
void RequestStop() {
|
||||
stop_run = true;
|
||||
SetRunning(false);
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
bool exec_step;
|
||||
bool running;
|
||||
std::atomic<bool> stop_run;
|
||||
bool exec_step = false;
|
||||
bool running = false;
|
||||
std::atomic<bool> stop_run{false};
|
||||
std::mutex running_mutex;
|
||||
std::condition_variable running_cv;
|
||||
|
||||
|
||||
@@ -72,5 +72,6 @@ void ConfigureSystem::refreshConsoleID() {
|
||||
if (reply == QMessageBox::No)
|
||||
return;
|
||||
u64 console_id{};
|
||||
ui->label_console_id->setText("Console ID: 0x" + QString::number(console_id, 16).toUpper());
|
||||
ui->label_console_id->setText(
|
||||
tr("Console ID: 0x%1").arg(QString::number(console_id, 16).toUpper()));
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} {
|
||||
* Checks if all words separated by spaces are contained in another string
|
||||
* This offers a word order insensitive search function
|
||||
*
|
||||
* @param String that gets checked if it contains all words of the userinput string
|
||||
* @param String containing all words getting checked
|
||||
* @param haystack String that gets checked if it contains all words of the userinput string
|
||||
* @param userinput String containing all words getting checked
|
||||
* @return true if the haystack contains all words of userinput
|
||||
*/
|
||||
bool GameList::containsAllWords(QString haystack, QString userinput) {
|
||||
|
||||
@@ -124,8 +124,8 @@ custom_bottom_top =
|
||||
custom_bottom_right =
|
||||
custom_bottom_bottom =
|
||||
|
||||
#Whether to toggle frame limiter on or off.
|
||||
# 0: Off , 1 (default): On
|
||||
# Whether to toggle frame limiter on or off.
|
||||
# 0: Off, 1 (default): On
|
||||
toggle_framelimit =
|
||||
|
||||
# Swaps the prominent screen with the other screen.
|
||||
|
||||
Reference in New Issue
Block a user