mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 16:19:25 +02:00
Determine whether to use AUDREN_REVISION_1-4 via the sysver, instead of hard-coding it for the 3.0+ rev. Updated comments and added AUDREN_REVISION_5/AUDREN_REVISION_6 defines.
This commit is contained in:
parent
e7117a7903
commit
8767ea798b
@ -24,10 +24,12 @@
|
|||||||
#define AUDREN_MEMPOOL_ALIGNMENT 0x1000
|
#define AUDREN_MEMPOOL_ALIGNMENT 0x1000
|
||||||
#define AUDREN_BUFFER_ALIGNMENT 0x40
|
#define AUDREN_BUFFER_ALIGNMENT 0x40
|
||||||
|
|
||||||
#define AUDREN_REVISION_1 0x31564552 // REV1 [1.0.0+?]
|
#define AUDREN_REVISION_1 0x31564552 // REV1 [1.0.0+]
|
||||||
#define AUDREN_REVISION_2 0x32564552 // REV2 [2.0.0+?]
|
#define AUDREN_REVISION_2 0x32564552 // REV2 [2.0.0+]
|
||||||
#define AUDREN_REVISION_3 0x33564552 // REV3 [3.0.0+?]
|
#define AUDREN_REVISION_3 0x33564552 // REV3 [3.0.0+]
|
||||||
#define AUDREN_REVISION_4 0x34564552 // REV4 [somewhere after 3.0.0, possibly 4.0.0+?]
|
#define AUDREN_REVISION_4 0x34564552 // REV4 [4.0.0+]
|
||||||
|
#define AUDREN_REVISION_5 0x35564552 // REV5 [6.0.0+]
|
||||||
|
#define AUDREN_REVISION_6 0x36564552 // REV6 [6.1.0+]
|
||||||
|
|
||||||
#define AUDREN_NODEID(_a,_b,_c) ((((u32)(_a) & 0xF) << 28) | (((u32)(_b) & 0xFFF) << 16) | ((u32)(_c) & 0xFFFF))
|
#define AUDREN_NODEID(_a,_b,_c) ((((u32)(_a) & 0xF) << 28) | (((u32)(_b) & 0xFFF) << 16) | ((u32)(_c) & 0xFFFF))
|
||||||
#define AUDREN_FINAL_MIX_ID 0
|
#define AUDREN_FINAL_MIX_ID 0
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "kernel/ipc.h"
|
#include "kernel/ipc.h"
|
||||||
#include "kernel/tmem.h"
|
#include "kernel/tmem.h"
|
||||||
#include "kernel/event.h"
|
#include "kernel/event.h"
|
||||||
|
#include "kernel/detect.h"
|
||||||
#include "services/sm.h"
|
#include "services/sm.h"
|
||||||
#include "services/applet.h"
|
#include "services/applet.h"
|
||||||
#include "services/audren.h"
|
#include "services/audren.h"
|
||||||
@ -55,8 +56,14 @@ Result audrenInitialize(const AudioRendererConfig* config)
|
|||||||
return MAKERESULT(Module_Libnx, LibnxError_BadInput);
|
return MAKERESULT(Module_Libnx, LibnxError_BadInput);
|
||||||
|
|
||||||
// Choose revision (i.e. if splitters are used then at least revision 2 must be used)
|
// Choose revision (i.e. if splitters are used then at least revision 2 must be used)
|
||||||
// (TODO: abstract away differences between revisions according to provided parameters)
|
if (kernelAbove400())
|
||||||
g_audrenRevision = AUDREN_REVISION_3; // todo: ?!?
|
g_audrenRevision = AUDREN_REVISION_4;
|
||||||
|
else if (kernelAbove300())
|
||||||
|
g_audrenRevision = AUDREN_REVISION_3;
|
||||||
|
else if (kernelAbove200())
|
||||||
|
g_audrenRevision = AUDREN_REVISION_2;
|
||||||
|
else
|
||||||
|
g_audrenRevision = AUDREN_REVISION_1;
|
||||||
|
|
||||||
// Prepare parameter structure
|
// Prepare parameter structure
|
||||||
AudioRendererParameter param = {0};
|
AudioRendererParameter param = {0};
|
||||||
|
Loading…
Reference in New Issue
Block a user