Revert "hoc-clk: add live vdd2, live boost clock and basic pwm dimming"
This reverts commit 15b7df8ef1.
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
void InitializeAudioServer() {
|
||||
/* TODO: Support audio server. */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
struct CommandDataTakeScreenShot {
|
||||
vi::LayerStack layer_stack;
|
||||
u8 *buffer;
|
||||
size_t buffer_size;
|
||||
};
|
||||
|
||||
Result DoGetFirmwareVersionCommand(settings::system::FirmwareVersion *out);
|
||||
|
||||
template<typename SendHeader, typename SendData>
|
||||
Result DoTakeScreenShotCommand(const CommandDataTakeScreenShot ¶ms, SendHeader send_header, SendData send_data);
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
namespace {
|
||||
|
||||
template<typename SendData>
|
||||
void SendEmptyData(const CommandDataTakeScreenShot ¶ms, size_t remaining_size, SendData send_data) {
|
||||
/* Clear the data buffer. */
|
||||
std::memset(params.buffer, 0, params.buffer_size);
|
||||
|
||||
/* Send data until the end. */
|
||||
while (remaining_size > 0) {
|
||||
/* Send as much as we can. */
|
||||
const auto cur_size = std::min(remaining_size, params.buffer_size);
|
||||
send_data(params.buffer, cur_size);
|
||||
|
||||
/* Advance. */
|
||||
remaining_size -= cur_size;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Result DoGetFirmwareVersionCommand(settings::system::FirmwareVersion *out) {
|
||||
settings::system::GetFirmwareVersion(out);
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
template<typename SendHeader, typename SendData>
|
||||
Result DoTakeScreenShotCommand(const CommandDataTakeScreenShot ¶ms, SendHeader send_header, SendData send_data) {
|
||||
/* Initialize screenshot control. */
|
||||
R_TRY(capsrv::InitializeScreenShotControl());
|
||||
|
||||
/* Finalize screenshot control when we're done. */
|
||||
ON_SCOPE_EXIT { capsrv::FinalizeScreenShotControl(); };
|
||||
|
||||
/* Open screenshot read stream. */
|
||||
size_t data_size;
|
||||
s32 width, height;
|
||||
R_TRY(capsrv::OpenRawScreenShotReadStreamForDevelop(std::addressof(data_size), std::addressof(width), std::addressof(height), params.layer_stack, TimeSpan::FromSeconds(10)));
|
||||
|
||||
/* Close the screenshot stream when we're done. */
|
||||
ON_SCOPE_EXIT { capsrv::CloseRawScreenShotReadStreamForDevelop(); };
|
||||
|
||||
/* Send the header. */
|
||||
send_header(static_cast<s32>(data_size), width, height);
|
||||
|
||||
/* Read and send data. */
|
||||
size_t total_read_size = 0;
|
||||
auto data_guard = SCOPE_GUARD { SendEmptyData(params, data_size - total_read_size, send_data); };
|
||||
while (total_read_size < data_size) {
|
||||
/* Read data from the stream. */
|
||||
size_t read_size;
|
||||
R_TRY(capsrv::ReadRawScreenShotReadStreamForDevelop(std::addressof(read_size), params.buffer, params.buffer_size, total_read_size));
|
||||
|
||||
/* Send the data that was read. */
|
||||
send_data(params.buffer, read_size);
|
||||
|
||||
/* Advance. */
|
||||
total_read_size += read_size;
|
||||
}
|
||||
data_guard.Cancel();
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
#include "cs_command_impl.hpp"
|
||||
|
||||
/* Include command implementations. */
|
||||
#include "cs_command_impl.inc"
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
namespace {
|
||||
|
||||
struct ResponseFirmwareVersion {
|
||||
ResponseHeader header;
|
||||
settings::system::FirmwareVersion firmware_version;
|
||||
};
|
||||
|
||||
struct ResponseTakeScreenShot {
|
||||
ResponseHeader header;
|
||||
s32 data_size;
|
||||
s32 width;
|
||||
s32 height;
|
||||
};
|
||||
|
||||
constinit u8 g_data[0x1000];
|
||||
|
||||
}
|
||||
|
||||
bool CommandProcessor::ProcessCommand(const CommandHeader &header, const u8 *body, s32 socket) {
|
||||
switch (header.command) {
|
||||
case Command_GetFirmwareVersion:
|
||||
SendFirmwareVersion(socket, header);
|
||||
break;
|
||||
case Command_TakeScreenShot:
|
||||
this->TakeScreenShot(header, socket, vi::LayerStack_ApplicationForDebug);
|
||||
break;
|
||||
case Command_TakeForegroundScreenShot:
|
||||
this->TakeScreenShot(header, socket, vi::LayerStack_LastFrame);
|
||||
break;
|
||||
/* TODO: Command support. */
|
||||
default:
|
||||
scs::CommandProcessor::ProcessCommand(header, body, socket);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CommandProcessor::SendFirmwareVersion(s32 socket, const CommandHeader &header) {
|
||||
/* Build the response. */
|
||||
ResponseFirmwareVersion response = {
|
||||
.header = {
|
||||
.id = header.id,
|
||||
.response = Response_FirmwareVersion,
|
||||
.body_size = sizeof(response) - sizeof(response.header),
|
||||
},
|
||||
.firmware_version = {},
|
||||
};
|
||||
|
||||
/* Get the firmware version. */
|
||||
const Result result = DoGetFirmwareVersionCommand(std::addressof(response.firmware_version));
|
||||
if (R_SUCCEEDED(result)) {
|
||||
/* Send the response. */
|
||||
auto lk = MakeSendGuardBlock();
|
||||
Send(socket, std::addressof(response), sizeof(response));
|
||||
} else {
|
||||
SendErrorResult(socket, header, result);
|
||||
}
|
||||
}
|
||||
|
||||
void CommandProcessor::TakeScreenShot(const CommandHeader &header, s32 socket, vi::LayerStack layer_stack) {
|
||||
/* Create the command data. */
|
||||
const CommandDataTakeScreenShot params = {
|
||||
.layer_stack = layer_stack,
|
||||
.buffer = g_data,
|
||||
.buffer_size = sizeof(g_data),
|
||||
};
|
||||
|
||||
/* Take the screenshot. */
|
||||
Result result;
|
||||
{
|
||||
/* Acquire the send lock. */
|
||||
auto lk = MakeSendGuardBlock();
|
||||
|
||||
/* Perform the command. */
|
||||
result = DoTakeScreenShotCommand(params, [&](s32 data_size, s32 width, s32 height) {
|
||||
/* Use global buffer for response. */
|
||||
ResponseTakeScreenShot *response = reinterpret_cast<ResponseTakeScreenShot *>(g_data);
|
||||
|
||||
/* Set response header. */
|
||||
*response = {
|
||||
.header = {
|
||||
.id = header.id,
|
||||
.response = Response_ScreenShot,
|
||||
.body_size = static_cast<u32>(sizeof(data_size) + sizeof(width) + sizeof(height) + data_size),
|
||||
},
|
||||
.data_size = data_size,
|
||||
.width = width,
|
||||
.height = height,
|
||||
};
|
||||
|
||||
/* Send data. */
|
||||
Send(socket, response, sizeof(*response));
|
||||
}, [&](u8 *data, size_t data_size) {
|
||||
/* Send data. */
|
||||
Send(socket, data, data_size);
|
||||
});
|
||||
}
|
||||
|
||||
/* Handle the error case. */
|
||||
if (R_FAILED(result)) {
|
||||
SendErrorResult(socket, header, result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
void InitializeHidServer() {
|
||||
/* TODO: Support hid redirection server. */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
void InitializeRemoteVideoServer() {
|
||||
/* TODO: Support remote video server. */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::cs {
|
||||
|
||||
void InitializeTargetIoServer() {
|
||||
/* Launch target io server. */
|
||||
os::ProcessId process_id;
|
||||
scs::LaunchProgram(std::addressof(process_id), ncm::ProgramLocation::Make(ncm::SystemProgramId::DevServer, ncm::StorageId::None), nullptr, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user