mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
[MIC] Add GetPower
This commit is contained in:
parent
ef22fd91da
commit
92a1f18af7
2 changed files with 11 additions and 0 deletions
|
@ -17,6 +17,7 @@ class MICService {
|
|||
// Service commands
|
||||
void getEventHandle(u32 messagePointer);
|
||||
void getGain(u32 messagePointer);
|
||||
void getPower(u32 messagePointer);
|
||||
void isSampling(u32 messagePointer);
|
||||
void mapSharedMem(u32 messagePointer);
|
||||
void setClamp(u32 messagePointer);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace MICCommands {
|
|||
SetGain = 0x00080040,
|
||||
GetGain = 0x00090000,
|
||||
SetPower = 0x000A0040,
|
||||
GetPower = 0x000B0000,
|
||||
SetIirFilter = 0x000C0042,
|
||||
SetClamp = 0x000D0040,
|
||||
CaptainToadFunction = 0x00100040,
|
||||
|
@ -33,6 +34,7 @@ void MICService::handleSyncRequest(u32 messagePointer) {
|
|||
switch (command) {
|
||||
case MICCommands::GetEventHandle: getEventHandle(messagePointer); break;
|
||||
case MICCommands::GetGain: getGain(messagePointer); break;
|
||||
case MICCommands::GetPower: getPower(messagePointer); break;
|
||||
case MICCommands::IsSampling: isSampling(messagePointer); break;
|
||||
case MICCommands::MapSharedMem: mapSharedMem(messagePointer); break;
|
||||
case MICCommands::SetClamp: setClamp(messagePointer); break;
|
||||
|
@ -101,6 +103,14 @@ void MICService::setPower(u32 messagePointer) {
|
|||
mem.write32(messagePointer + 4, Result::Success);
|
||||
}
|
||||
|
||||
void MICService::getPower(u32 messagePointer) {
|
||||
log("MIC::GetPower\n");
|
||||
|
||||
mem.write32(messagePointer, IPC::responseHeader(0xB, 2, 0));
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
mem.write8(messagePointer + 8, micEnabled ? 1 : 0);
|
||||
}
|
||||
|
||||
void MICService::setClamp(u32 messagePointer) {
|
||||
u8 val = mem.read8(messagePointer + 4);
|
||||
log("MIC::SetClamp (value = %d)\n", val);
|
||||
|
|
Loading…
Add table
Reference in a new issue