//
// sub_10029EC20 from 0x10029ec20 to 0x10029ee79 (601 bytes)
//
// 1 xrefs:
// > GameOptionsLayer::onPracticeMusicSync @ 0x10029ead9
//
// This function is hookable on this platform (idp: pc, 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 12:27:54 +0000
//
void __fastcall sub_10029EC20(__int64 a1)
{
unsigned int v1; // r15d
unsigned int v2; // r14d
const std::string::value_type *v3; // rsi
__int64 v4; // rax
__int64 v5; // r14
int v6; // eax
int v7; // edx
__int128 v8; // [rsp+0h] [rbp-80h] BYREF
void *data; // [rsp+10h] [rbp-70h]
__int128 v10; // [rsp+20h] [rbp-60h] BYREF
void *__p; // [rsp+30h] [rbp-50h]
std::string v12; // [rsp+38h] [rbp-48h] BYREF
std::string v13; // [rsp+50h] [rbp-30h] BYREF
*(_WORD *)&v13.__r_.__value_.__l.0 = 0;
v12.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14;
strcpy(v12.__r_.__value_.__s.__data_, "Scratch");
v1 = 10;
v2 = 2;
switch ( *(_DWORD *)(a1 + 1128) )
{
case 0:
std::string::assign(
&v13,
"You need a Music Unlocker to play normal music in practice mode.");
goto LABEL_10;
case 1:
v1 = 26;
std::string::assign(&v13, "I think the Diamond Shopkeeper has one, weird guy...");
goto LABEL_10;
case 2:
std::string::assign(&v13, "SpaRkle gnAsH Glorp sHiMmerRr crUnCHle bLinGz...");
std::string::assign(&v12, "Diamond Shopkeeper");
v1 = 40;
v2 = 4;
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_14;
goto LABEL_10;
case 3:
v3 = "See what I mean?...";
goto LABEL_9;
case 4:
std::string::assign(
&v13,
"ShiM gNaw glEaM... bRinG ShiNy!");
std::string::assign(&v12, "Diamond Shopkeeper");
v1 = 41;
v2 = 4;
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_14;
goto LABEL_10;
case 5:
v1 = 11;
std::string::assign(&v13, "Looks to me like you had enough shiny...");
goto LABEL_10;
case 6:
std::string::assign(
&v13,
"ShiMmer... sHim... bLiNg sNap... HA!");
std::string::assign(&v12, "Diamond Shopkeeper");
v1 = 42;
v2 = 4;
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_10;
LABEL_14:
sub_10001AD30(&v8, v12.__r_.__value_.__l.__data_, v12.__r_.__value_.__l.__size_);
break;
case 7:
v3 = "...";
LABEL_9:
v1 = 12;
std::string::assign(&v13, v3);
goto LABEL_10;
default:
LABEL_10:
data = v12.__r_.__value_.__l.__data_;
v8 = *(_OWORD *)&v12.__r_.__value_.__l.0;
break;
}
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
{
sub_10001AD30(&v10, v13.__r_.__value_.__l.__data_, v13.__r_.__value_.__l.__size_);
}
else
{
__p = v13.__r_.__value_.__l.__data_;
v10 = *(_OWORD *)&v13.__r_.__value_.__l.0;
}
v4 = DialogObject::create(&v8, &v10, v1, 0, 0xFFFFFF, 1.0);
v5 = DialogLayer::create(v4, v2);
if ( (v10 & 1) != 0 )
operator delete(__p);
if ( (v8 & 1) != 0 )
operator delete(data);
DialogLayer::addToMainScene(v5);
DialogLayer::updateChatPlacement(v5, 0);
DialogLayer::animateIn(v5, 1);
v6 = *(_DWORD *)(a1 + 1128);
v7 = 0;
if ( v6 < 7 )
v7 = v6 + 1;
*(_DWORD *)(a1 + 1128) = v7;
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v12.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v13.__r_.__value_.__l.__data_);
}