Merge pull request #248 from wheremyfoodat/wheremyfoodat-patch-1

Reorder functions in Y2R::handleSyncRequest
This commit is contained in:
wheremyfoodat 2023-09-01 18:54:16 +03:00 committed by GitHub
commit bc19aa8e3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,6 +57,10 @@ void Y2RService::handleSyncRequest(u32 messagePointer) {
switch (command) {
case Y2RCommands::DriverInitialize: driverInitialize(messagePointer); break;
case Y2RCommands::DriverFinalize: driverFinalize(messagePointer); break;
case Y2RCommands::GetBlockAlignment: getBlockAlignment(messagePointer); break;
case Y2RCommands::GetInputLines: getInputLines(messagePointer); break;
case Y2RCommands::GetInputLineWidth: getInputLineWidth(messagePointer); break;
case Y2RCommands::GetOutputFormat: getOutputFormat(messagePointer); break;
case Y2RCommands::GetTransferEndEvent: getTransferEndEvent(messagePointer); break;
case Y2RCommands::IsBusyConversion: isBusyConversion(messagePointer); break;
case Y2RCommands::PingProcess: pingProcess(messagePointer); break;
@ -78,10 +82,6 @@ void Y2RService::handleSyncRequest(u32 messagePointer) {
case Y2RCommands::SetTransferEndInterrupt: setTransferEndInterrupt(messagePointer); break;
case Y2RCommands::StartConversion: [[likely]] startConversion(messagePointer); break;
case Y2RCommands::StopConversion: stopConversion(messagePointer); break;
case Y2RCommands::GetBlockAlignment: getBlockAlignment(messagePointer); break;
case Y2RCommands::GetInputLines: getInputLines(messagePointer); break;
case Y2RCommands::GetInputLineWidth: getInputLineWidth(messagePointer); break;
case Y2RCommands::GetOutputFormat: getOutputFormat(messagePointer); break;
default: Helpers::panic("Y2R service requested. Command: %08X\n", command);
}
}
@ -107,7 +107,9 @@ void Y2RService::driverFinalize(u32 messagePointer) {
void Y2RService::getTransferEndEvent(u32 messagePointer) {
log("Y2R::GetTransferEndEvent\n");
if (!transferEndEvent.has_value()) transferEndEvent = kernel.makeEvent(ResetType::OneShot);
if (!transferEndEvent.has_value()) {
transferEndEvent = kernel.makeEvent(ResetType::OneShot);
}
mem.write32(messagePointer, IPC::responseHeader(0xF, 1, 2));
mem.write32(messagePointer + 4, Result::Success);
@ -284,7 +286,9 @@ void Y2RService::setInputLines(u32 messagePointer) {
Helpers::panic("Y2R: Invalid input line count");
} else {
// According to Citra, the Y2R module seems to accidentally skip setting the line # if it's 1024
if (lines != 1024) inputLines = lines;
if (lines != 1024) {
inputLines = lines;
}
mem.write32(messagePointer + 4, Result::Success);
}
}
@ -356,4 +360,4 @@ void Y2RService::startConversion(u32 messagePointer) {
if (transferEndEvent.has_value()) {
kernel.signalEvent(transferEndEvent.value());
}
}
}