mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-02-22 15:11:00 +00:00
some progress on SpkSpeakerCtrl.md
This commit is contained in:
parent
5aa2997be1
commit
5e5f3bc078
@ -8,7 +8,7 @@ setSpeakerOnCallback__14SpkSpeakerCtrlFll,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
setSpeakerPlay__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
startPlayCallback__14SpkSpeakerCtrlFll,SpkSpeakerCtrl.o,Speaker.a,false
|
||||
setSpeakerOff__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
retryConnection__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,false
|
||||
retryConnection__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
reconnect__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
framework__14SpkSpeakerCtrlFv,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
reconnectProcess__14SpkSpeakerCtrlFl,SpkSpeakerCtrl.o,Speaker.a,true
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Game",
|
||||
"message": "11.948%",
|
||||
"message": "11.949%",
|
||||
"color": "blue"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Speaker",
|
||||
"message": "49.743%",
|
||||
"message": "50.654%",
|
||||
"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) | 49.743881616391576% |
|
||||
| [Speaker](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker.md) | 50.65452475811042% |
|
||||
| [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) | 55.497382198952884% | 15 / 21 | 71.42857142857143% | :eight_pointed_black_star:
|
||||
| [SpkSpeakerCtrl.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker/SpkSpeakerCtrl.md) | 58.289703315881326% | 16 / 21 | 76.19047619047619% | :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.
|
||||
|
||||
|
||||
# 15 / 21 Completed -- (71.42857142857143%)
|
||||
# 16 / 21 Completed -- (76.19047619047619%)
|
||||
# SpkSpeakerCtrl.o
|
||||
| Symbol | Decompiled? |
|
||||
| ------------- | ------------- |
|
||||
@ -18,7 +18,7 @@
|
||||
| `setSpeakerPlay__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `startPlayCallback__14SpkSpeakerCtrlFll` | :x: |
|
||||
| `setSpeakerOff__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `retryConnection__14SpkSpeakerCtrlFl` | :x: |
|
||||
| `retryConnection__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `reconnect__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
| `framework__14SpkSpeakerCtrlFv` | :white_check_mark: |
|
||||
| `reconnectProcess__14SpkSpeakerCtrlFl` | :white_check_mark: |
|
||||
|
@ -43,6 +43,15 @@ public:
|
||||
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 SpeakerInfo sSpeakerInfo[4];
|
||||
|
||||
static SpkMixingBuffer* sMixingBuffer;
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution/types.h>
|
||||
|
||||
struct SomeStruct {
|
||||
u32 _0;
|
||||
u32 _4;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "Game/Speaker/SpkSpeakerCtrl.hpp"
|
||||
#include <revolution/wpad.h>
|
||||
#include <mem.h>
|
||||
|
||||
SpkSoundHandle sAdjustSoundHandle[4];
|
||||
|
||||
@ -11,19 +12,11 @@ void SpkSpeakerCtrl::setMixingBuffer(SpkMixingBuffer *pMixingBuffer) {
|
||||
|
||||
// SpkSpeakerCtrl::setup
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// reguse issues
|
||||
void SpkSpeakerCtrl::connect(s32 idx) {
|
||||
BOOL state = OSDisableInterrupts();
|
||||
sSpeakerInfo[idx]._0 = 1;
|
||||
sSpeakerInfo[idx]._1 = 0;
|
||||
sSpeakerInfo[idx]._24 = 0;
|
||||
SpkSpeakerCtrl::initReconnect(idx);
|
||||
sSpeakerInfo[idx]._30 = -1;
|
||||
SpkSpeakerCtrl::setSpeakerOn(idx);
|
||||
initInfoDefaults(idx);
|
||||
OSRestoreInterrupts(state);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SpkSpeakerCtrl::setSpeakerOn(s32 idx) {
|
||||
BOOL state = OSDisableInterrupts();
|
||||
@ -68,7 +61,27 @@ void SpkSpeakerCtrl::setSpeakerPlay(s32 idx) {
|
||||
OSRestoreInterrupts(state);
|
||||
}
|
||||
|
||||
// SpkSpeakerCtrl::startPlayCallback
|
||||
#ifdef NON_MATCHING
|
||||
void SpkSpeakerCtrl::startPlayCallback(s32 idx, s32 a2) {
|
||||
BOOL enabled = OSDisableInterrupts();
|
||||
|
||||
if (!enabled) {
|
||||
SpeakerInfo* inf = &sSpeakerInfo[idx];
|
||||
inf->_1 = 1;
|
||||
inf->_22 = 1;
|
||||
inf->_24 = 0;
|
||||
inf->_30 = 28800;
|
||||
memset(&sSpeakerInfo[idx]._2, 0, 0x20);
|
||||
}
|
||||
else {
|
||||
if (enabled == -3) {
|
||||
sSpeakerInfo[idx]._24 = 2;
|
||||
}
|
||||
}
|
||||
|
||||
OSRestoreInterrupts(enabled);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SpkSpeakerCtrl::setSpeakerOff(s32 idx) {
|
||||
sSpeakerInfo[idx]._1 = 0;
|
||||
@ -77,10 +90,11 @@ void SpkSpeakerCtrl::setSpeakerOff(s32 idx) {
|
||||
WPADControlSpeaker(idx, 0, 0);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// fun switch case mismatches
|
||||
void SpkSpeakerCtrl::retryConnection(s32 idx) {
|
||||
switch (sSpeakerInfo[idx]._24) {
|
||||
case 0:
|
||||
case 3:
|
||||
break;
|
||||
case 1:
|
||||
SpkSpeakerCtrl::setSpeakerOn(idx);
|
||||
break;
|
||||
@ -89,7 +103,6 @@ void SpkSpeakerCtrl::retryConnection(s32 idx) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void SpkSpeakerCtrl::reconnect(s32 idx) {
|
||||
if (sSpeakerInfo[idx]._0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user