mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 04:29:13 +12:00
Merge branch 'master' into sd-card
This commit is contained in:
commit
eaccc627b9
8 changed files with 30 additions and 7 deletions
|
@ -482,6 +482,7 @@ void Kernel::setThreadPriority() {
|
|||
}
|
||||
|
||||
void Kernel::getCurrentProcessorNumber() {
|
||||
logSVC("GetCurrentProcessorNumber()\n");
|
||||
const ProcessorID id = threads[currentThreadIndex].processorID;
|
||||
s32 ret;
|
||||
|
||||
|
@ -658,4 +659,4 @@ bool Kernel::shouldWaitOnObject(KernelObject* object) {
|
|||
Helpers::panic("Not sure whether to wait on object (type: %s)", object->getTypeName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,6 +166,7 @@ u32 Memory::read32(u32 vaddr) {
|
|||
if (vaddr >= VirtualAddrs::VramStart && vaddr < VirtualAddrs::VramStart + VirtualAddrs::VramSize) {
|
||||
static int shutUpCounter = 0;
|
||||
if (shutUpCounter < 5) { // Stop spamming about VRAM reads after the first 5
|
||||
shutUpCounter++;
|
||||
Helpers::warn("VRAM read!\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ namespace HIDCommands {
|
|||
EnableGyroscopeLow = 0x00130000,
|
||||
DisableGyroscopeLow = 0x00140000,
|
||||
GetGyroscopeLowRawToDpsCoefficient = 0x00150000,
|
||||
GetGyroscopeLowCalibrateParam = 0x00160000
|
||||
GetGyroscopeLowCalibrateParam = 0x00160000,
|
||||
GetSoundVolume = 0x00170000,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -46,6 +47,7 @@ void HIDService::handleSyncRequest(u32 messagePointer) {
|
|||
case HIDCommands::GetGyroscopeLowCalibrateParam: getGyroscopeLowCalibrateParam(messagePointer); break;
|
||||
case HIDCommands::GetGyroscopeLowRawToDpsCoefficient: getGyroscopeCoefficient(messagePointer); break;
|
||||
case HIDCommands::GetIPCHandles: getIPCHandles(messagePointer); break;
|
||||
case HIDCommands::GetSoundVolume: getSoundVolume(messagePointer); break;
|
||||
default: Helpers::panic("HID service requested. Command: %08X\n", command);
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +109,18 @@ void HIDService::getGyroscopeCoefficient(u32 messagePointer) {
|
|||
mem.write32(messagePointer + 8, Helpers::bit_cast<u32, float>(gyroscopeCoeff));
|
||||
}
|
||||
|
||||
// The volume here is in the range [0, 0x3F]
|
||||
// It is read directly from I2C Device 3 register 0x09
|
||||
// Since we currently do not have audio, set the volume a bit below max (0x30)
|
||||
void HIDService::getSoundVolume(u32 messagePointer) {
|
||||
log("HID::GetSoundVolume\n");
|
||||
constexpr u8 volume = 0x30;
|
||||
|
||||
mem.write32(messagePointer, IPC::responseHeader(0x17, 2, 0));
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
mem.write8(messagePointer + 8, volume);
|
||||
}
|
||||
|
||||
void HIDService::getIPCHandles(u32 messagePointer) {
|
||||
log("HID::GetIPCHandles\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue