12 users online: ASSATAKKU,  BeeKaay, El Cuh Fermin, Flaming Hot Toons,  icrawfish, LucasMegaStriker, Paithus,  patcdr, Revenge319, TCgamerboy2002,  Teows, ZappaMania - Guests: 130 - Bots: 122
Users: 58,916 (2,241 active)
Latest user: almostbobsaget

Bugged Addmusic detection?

I added an option to my emulator to use shadow echo RAM, which prevents the ear-torture and crashing of the earlier bugged Addmusic versions and allows one to run previously ZSNES-only ROM hacks.

The downside is that people have to know to enable the option, and it's not good to just always leave it enabled as it may interfere with other games.

I would like it to be automatic, so I wanted to pose a question / challenge to this board: is there a pattern of bytes, say from the Addmusic ASM code, that will only appear in bugged versions of Addmusic, but not in corrected versions?

If such a pattern exists, then I can automatically enable the shadow echo RAM only for the older Addmusic hacks, and leave it off everywhere else.

Barring this, the only other option is likely a database of SHA256 ROM hashes for games to opt-in to the echo shadow RAM, but that seems like a substantially more difficult challenge, given there's probably hundreds of these that would need to be cataloged and indexed. But presuming that turns out to be the only way, would anyone here be up for making such a list? Just need it to be a CSV file in the format of "SHA256,Hack Name", and I can take it from there.

I don't think it would be easy or even possible to have a fool proof way of detecting whether the hack has correct custom music implementation as there are many versions of Addmusic (Carol's, Romi's, HuFlungDu's, AddmusicM, Java Addmusic, whatever was used to insert music in VIP 3 and even more) with a lot of them lost to time. There's also the fact that while not broken versions of Addmusic have existed for a while now (as in they didn't put valuable data in the echo buffer) AddmusicK was the first one to not allow the user to insert a song with echo buffer set to a value that's too big, so certain hacks using the same tool work while others don't. And then there's the SMAS music patch of which I've seen one version that inserted some music data into the echo buffer.

I also have a question, how exactly would you even determine whether the Addmusic checks should be ran by BSNES?
Check out Team Hack Fix/Translations' thread full of fixed and translated SMW hacks!

Wanted Permabanned or Dead by new staff team
While I don't know of any patterns to detect faulty addmusics and I also don't have the time to go through every single hack which is suspected to have bad music, I'm pretty sure that no SMW hacks depend on being able to read the echo buffer. Thus, it's relatively safe to just enable the workaround for all SMW hacks. It's possible to grab a list of pretty much all SMW hacks ever released from Zandro's hack database. There's ~23000 entries there currently, so storing the SHA1 hashes of each of them is going to take ~460KB in the binary (or, with names, 2.4MB uncompressed). If you insist on using SHA256 instead of SHA1, you'll have to either download the BPS of every hack in the DB or contact Zandro directly, as he hasn't published them anywhere. (The SHA1 hashes, on the other hand, can be scraped from the index list of each "section", because the hack links themselves contain the SHA1 hash of the ROM.)

Originally posted by Super Maks 64
I also have a question, how exactly would you even determine whether the Addmusic checks should be ran by BSNES?
Probably just unconditionally run them when a ROM is loaded.