mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-02-21 14:40:36 +00:00
SpkSpeakerCtrl::connect match I forgot to commit a while ago
This commit is contained in:
parent
5e5f3bc078
commit
d224532af6
@ -14,7 +14,7 @@ framework__14SpkSpeakerCtrlFv,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
reconnectProcess__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
initReconnect__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
continuousUsingProcess__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
updateSpeaker__14SpkSpeakerCtrlFP7OSAlarmP9OSContext,SpkSpeakerCtrl.o,Speaker.a,false
|
||||
updateSpeaker__14SpkSpeakerCtrlFP7OSAlarmP9OSContext,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
isEnable__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
extensionProcess__14SpkSpeakerCtrlFll,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
getDeviceVolume__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Game",
|
||||
"message": "11.949%",
|
||||
"message": "11.956%",
|
||||
"color": "blue"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Speaker",
|
||||
"message": "50.654%",
|
||||
"message": "54.752%",
|
||||
"color": "daa520"
|
||||
}
|
@ -21,6 +21,6 @@
|
||||
| [Ride](https://github.com/shibbo/Petari/blob/master/docs/lib/Ride.md) | 0.0% |
|
||||
| [Scene](https://github.com/shibbo/Petari/blob/master/docs/lib/Scene.md) | 13.849590469099033% |
|
||||
| [Screen](https://github.com/shibbo/Petari/blob/master/docs/lib/Screen.md) | 6.315748206421598% |
|
||||
| [Speaker](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker.md) | 50.65452475811042% |
|
||||
| [Speaker](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker.md) | 54.75241889584519% |
|
||||
| [System](https://github.com/shibbo/Petari/blob/master/docs/lib/System.md) | 14.681379713534055% |
|
||||
| [Util](https://github.com/shibbo/Petari/blob/master/docs/lib/Util.md) | 10.090099514848767% |
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
| Object | Percentage (of Bytes) | Functions Done / Total Functions | Percentage (Functions) | Status
|
||||
| ------------- | ------------- | ------------- | ------------- | -------------
|
||||
| [SpkSpeakerCtrl.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker/SpkSpeakerCtrl.md) | 58.289703315881326% | 16 / 21 | 76.19047619047619% | :eight_pointed_black_star:
|
||||
| [SpkSpeakerCtrl.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker/SpkSpeakerCtrl.md) | 70.85514834205934% | 17 / 21 | 80.95238095238095% | :eight_pointed_black_star:
|
||||
| [SpkSystem.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker/SpkSystem.md) | 70.3125% | 11 / 14 | 78.57142857142857% | :eight_pointed_black_star:
|
||||
| [SpkMixingBuffer.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker/SpkMixingBuffer.md) | 55.952380952380956% | 3 / 4 | 75.0% | :eight_pointed_black_star:
|
||||
| [SpkWave.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker/SpkWave.md) | 100.0% | 7 / 7 | 100.0% | :white_check_mark:
|
||||
|
@ -5,7 +5,7 @@
|
||||
| :white_check_mark: | Function is completed.
|
||||
|
||||
|
||||
# 16 / 21 Completed -- (76.19047619047619%)
|
||||
# 17 / 21 Completed -- (80.95238095238095%)
|
||||
# SpkSpeakerCtrl.o
|
||||
| Symbol | Decompiled? |
|
||||
| ------------- | ------------- |
|
||||
@ -24,7 +24,7 @@
|
||||
| `reconnectProcess__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `initReconnect__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `continuousUsingProcess__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `updateSpeaker__14SpkSpeakerCtrlFP7OSAlarmP9OSContext` | :x: |
|
||||
| `updateSpeaker__14SpkSpeakerCtrlFP7OSAlarmP9OSContext` | :white_check_mark: |
|
||||
| `isEnable__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `extensionProcess__14SpkSpeakerCtrlFll` | :white_check_mark: |
|
||||
| `getDeviceVolume__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
|
@ -9,7 +9,7 @@ public:
|
||||
|
||||
void mix(s32, s16 *, s32, f32, s32);
|
||||
const s16* getSamples(s32) const;
|
||||
void update(s32);
|
||||
bool update(s32);
|
||||
|
||||
const s16* mSamples[4];
|
||||
};
|
@ -38,18 +38,17 @@ public:
|
||||
static void reconnectProcess(s32);
|
||||
static void initReconnect(s32);
|
||||
static void continuousUsingProcess(s32);
|
||||
static void updateSpekaer(OSAlarm *, OSContext *);
|
||||
static void updateSpeaker(OSAlarm *, OSContext *);
|
||||
static bool isEnable(s32);
|
||||
static void extensionProcess(s32, s32);
|
||||
static f32 getDeviceVolume(s32);
|
||||
|
||||
static void initInfoDefaults(s32 idx) {
|
||||
sSpeakerInfo[idx]._0 = 1;
|
||||
sSpeakerInfo[idx]._1 = 0;
|
||||
sSpeakerInfo[idx]._24 = 0;
|
||||
SpkSpeakerCtrl::initReconnect(idx);
|
||||
sSpeakerInfo[idx]._30 = -1;
|
||||
SpkSpeakerCtrl::setSpeakerOn(idx);
|
||||
|
||||
}
|
||||
|
||||
static inline SpeakerInfo& getSpeakerInfo(s32 idx) {
|
||||
return sSpeakerInfo[idx];
|
||||
}
|
||||
|
||||
static SpeakerInfo sSpeakerInfo[4];
|
||||
|
@ -11,6 +11,8 @@ typedef struct {
|
||||
u8 data[32];
|
||||
} WENCInfo;
|
||||
|
||||
s32 WENCGetEncodeData(WENCInfo *, u32, const s16 *, s32, u8 *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -38,6 +38,8 @@ void WPADDisconnect(s32);
|
||||
s32 WPADGetInfoAsync(s32, WPADInfo *, WPADCallback);
|
||||
|
||||
void WPADSetAutoSleepTime(u8);
|
||||
BOOL WPADCanSendStreamData(s32);
|
||||
s32 WPADSendStreamData(s32, void *, u16);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -14,7 +14,12 @@ void SpkSpeakerCtrl::setMixingBuffer(SpkMixingBuffer *pMixingBuffer) {
|
||||
|
||||
void SpkSpeakerCtrl::connect(s32 idx) {
|
||||
BOOL state = OSDisableInterrupts();
|
||||
initInfoDefaults(idx);
|
||||
sSpeakerInfo[idx]._0 = 1;
|
||||
sSpeakerInfo[idx]._1 = 0;
|
||||
sSpeakerInfo[idx]._24 = 0;
|
||||
SpkSpeakerCtrl::initReconnect(idx);
|
||||
sSpeakerInfo[idx]._30 = -1;
|
||||
SpkSpeakerCtrl::setSpeakerOn(idx);
|
||||
OSRestoreInterrupts(state);
|
||||
}
|
||||
|
||||
@ -159,7 +164,45 @@ void SpkSpeakerCtrl::continuousUsingProcess(s32 idx) {
|
||||
}
|
||||
}
|
||||
|
||||
// SpkSpeakerCtrl::updateSpeaker
|
||||
void SpkSpeakerCtrl::updateSpeaker(OSAlarm *, OSContext *) {
|
||||
for (s32 i = 0; i < 4; i++) {
|
||||
if (sMixingBuffer != nullptr) {
|
||||
SpeakerInfo& inf = getSpeakerInfo(i);
|
||||
|
||||
if (inf._1) {
|
||||
if (!inf._23) {
|
||||
if (sMixingBuffer->update(i)) {
|
||||
bool v5 = true;
|
||||
|
||||
if (inf._1 && sMixingBuffer != nullptr) {
|
||||
BOOL en = OSDisableInterrupts();
|
||||
|
||||
if (!WPADCanSendStreamData(i)) {
|
||||
|
||||
OSRestoreInterrupts(en);
|
||||
}
|
||||
else {
|
||||
if (inf._22) {
|
||||
v5 = false;
|
||||
inf._22 = 0;
|
||||
}
|
||||
|
||||
const s16* samples = sMixingBuffer->getSamples(i);
|
||||
u8 data[16];
|
||||
WENCGetEncodeData(&inf._2, v5, samples, 40, data);
|
||||
WPADSendStreamData(i, data, 0x14);
|
||||
OSRestoreInterrupts(en);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
inf._22 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SpkSpeakerCtrl::isEnable(s32 idx) {
|
||||
bool ret = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user