//
// GJKeybindManager::handleGlobalAudioAction from 0x10018bc1c to 0x10018be0c (496 bytes)
//
// 1 xrefs:
// > GJKeybindManager::handleGlobalAction @ 0x10018e258
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:59:52 +0000
//
__int64 __fastcall GJKeybindManager::handleGlobalAudioAction(__int64 a1, int a2)
{
unsigned int v2; // w20
int v4; // w19
__int64 v5; // x0
__int64 v6; // x0
double EffectsVolume; // d0
int v9; // w10
int v10; // w8
float v11; // s8
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x19
const char *v17; // x8
__int64 v18; // x0
char *CString; // x0
__int64 v21; // x0
void *__p[2]; // [xsp+18h] [xbp-68h] BYREF
char v23; // [xsp+2Fh] [xbp-51h]
void *__dst[2]; // [xsp+30h] [xbp-50h] BYREF
__int64 v25; // [xsp+40h] [xbp-40h]
__int128 v26; // [xsp+48h] [xbp-38h] BYREF
__int64 v27; // [xsp+58h] [xbp-28h]
v2 = a1 - 1001;
if ( (unsigned int)(a1 - 1001) > 4 || v2 == 2 )
return 0;
if ( a2 )
{
v4 = a1;
v5 = FMODAudioEngine::sharedEngine(a1);
if ( v2 > 1 )
EffectsVolume = FMODAudioEngine::getEffectsVolume(v5);
else
EffectsVolume = FMODAudioEngine::getBackgroundMusicVolume(v5);
if ( v4 == 1004 || v4 == 1001 )
v9 = 10;
else
v9 = -10;
v10 = ((int)(float)((float)(*(float *)&EffectsVolume * 100.0) + 0.5) + v9)
& ~(((int)(float)((float)(*(float *)&EffectsVolume * 100.0) + 0.5) + v9) >> 31);
if ( v10 >= 100 )
v10 = 100;
v11 = (float)(v10 + 5 - (unsigned __int8)(v10 + 5 - 10 * ((unsigned int)(205 * (v10 + 5)) >> 11))) / 100.0;
v12 = FMODAudioEngine::sharedEngine(v6);
if ( v2 > 1 )
v13 = FMODAudioEngine::setEffectsVolume(v12, v11);
else
v13 = FMODAudioEngine::setBackgroundMusicVolume(v12, v11);
v14 = GameManager::sharedState(v13);
if ( *(_QWORD *)(v14 + 952) )
{
v15 = GameManager::sharedState(v14);
v14 = (***(__int64 (__fastcall ****)(_QWORD))(v15 + 952))(*(_QWORD *)(v15 + 952));
}
v16 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector(v14) + 272);
if ( v16 )
{
v17 = "SFX";
if ( v2 < 2 )
v17 = "Music";
v18 = sub_1003065B0("%s Volume: %d%%", v17, (int)(float)((float)(v11 * 100.0) + 0.5));
CString = (char *)cocos2d::CCString::getCString(v18);
sub_100009900(&v26, CString);
if ( SHIBYTE(v27) < 0 )
{
sub_1000097D0(__dst, (void *)v26, *((unsigned __int64 *)&v26 + 1));
}
else
{
*(_OWORD *)__dst = v26;
v25 = v27;
}
sub_100009900(__p, "");
v21 = TextAlertPopup::create(__dst, 150, __p, 0.5, 0.6);
sub_10037DFF0(v16, 5656396, v21, 1000);
if ( v23 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v25) < 0 )
operator delete(__dst[0]);
if ( SHIBYTE(v27) < 0 )
operator delete((void *)v26);
}
}
return 1;
}