//
// MusicDownloadManager::limitDownloadedSongs from 0x82fdfc to 0x82fe84 (136 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::onDownloadSongCompleted @ 0x830004
// > ??> @ 0xb5848
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void MusicDownloadManager::limitDownloadedSongs(MusicDownloadManager *a1)
{
int m_customMenuSongID; // w21
int m_customPracticeSongID; // w22
cocos2d::CCArray *i; // x19
int v5; // w2
m_customMenuSongID = GameManager::sharedState()->m_customMenuSongID;
m_customPracticeSongID = GameManager::sharedState()->m_customPracticeSongID;
for ( i = MusicDownloadManager::getDownloadedSongs(a1);
(unsigned int)cocos2d::CCArray::count(i) > 0x32;
cocos2d::CCArray::removeLastObject(i, 1) )
{
v5 = *(_DWORD *)(cocos2d::CCArray::lastObject(i) + 316);
if ( m_customMenuSongID != v5 && m_customPracticeSongID != v5 )
MusicDownloadManager::deleteSong(a1, v5);
}
}