ipatix/agbplay

Envelope Issue in Pokémon Ruby/Sapphire/Emerald

N6661 opened this issue · 10 comments

N6661 commented

The attack of some notes on PSG ch 1 & 2 in the Ending Theme from Pokémon Ruby/Sapphire/Emerald (song 455 on all three ROMs) are completely missing.

Issue originated in 00f4fe5 and has persisted since.

See attached zip for examples of mGBA output and agbplay output.
example.zip

N6661 commented

For what it's worth, 00f4fe5 introduced the above-mentioned attack bug into Pokémon Center from Pokémon Ruby/Sapphire/Emerald (song 400 on all three ROMs) and while the issue in Pokémon Center was fixed in 04cfdb, the same issue in Ending Theme was not. (Example of the problem in Pokémon Center).

To clarify, neither Ending Theme nor Pokémon Center had the attack bug before 00f4fe5.

It seems that there're still some edge cases in regards to volume calculation that still isn't quite accurate.

Maybe this is related to #44, I'll have to check. I haven't really spent much time with agbplay lately, but perhaps I may be able to have a look at it some time soon.

So would you say the problem in the first example can be described as the tone dropping out even though it should not?

N6661 commented

It may or may not be, idk. That's why I opened a separate issue since #44 existed before 00f4fe5. And yes, I suppose you could call it dropping out in both examples.

ipatix commented

Can you check if the problem is fixed?

N6661 commented

Unfortunately the issue has not been fixed. Regardless of what simulate-cgb-sustain-bug is set to, the error still persists. However, this issue was previously fixed in the psg_debugging branch which doesn't seem to have been merged into the current master branch. It also means that this issue is a separate issue from #44.

edit: spelling

N6661 commented

I did a preliminary test by manually merging the code changes from psg_debugging with the current master branch and that fixes this issue without undoing the fix for #44. I'll let you have a more thorough look at the code though since I don't know if my janky manual splicing has any unintended consequences. Just letting you know, that seems to be the right direction.

ipatix commented

Lol, I don't remember this branch at all. I'll have to check what I've done there...

ipatix commented

Okay, I remember the idea but were always smarter afterwards and I already see edge cases where that fix doesn't work. I'm working on a proper fix right now.

ipatix commented

Should be fixed now.