mmitch / gbsplay

gameboy sound player
https://mmitch.github.io/gbsplay/
Other
98 stars 20 forks source link

Wrong timing in certain Super Mario Land 2 subtunes #124

Closed ruby-R53 closed 5 months ago

ruby-R53 commented 5 months ago

I noticed subtune 11 and 10 of SML2's .gbs plays faster than it's supposed to play. It sounds higher-pitched. I'm not sure why it's happening, but I think it could be because gbsplay is not reading the dump correctly as it plays just fine on another player.

If it matters, I'm using alsa output, and building it with pulseaudio doesn't do anything (pipewire output doesn't work properly here for whatever reason).

However, I also noticed that if I put the start subtune to 11 or 10 on the command line, it plays normally. So maybe there's a code on the dump that sets the song speed to a different value and then gbsplay misreads it or something? I'm not really sure, this could be the dump's fault too.

I'm using the latest build of gbsplay currently.

mmitch commented 5 months ago

I can confirm this :-/

Additional info:

mrehkopf commented 5 months ago

Very strange, the issue seems to be triggered by playing subsong 9 and reversed by playing subsong 12...

mrehkopf commented 5 months ago

I'm guessing this is intentional as far as the sound design of the game is concerned - subsong 9 is the "hurry up" jingle when little time is left for the level. So it presumably sets a flag in RAM for the sound routine to increase playback pitch and tempo. Subsong 3 and 12 are "stage end" class subsongs so they probably reset the flag.

ruby-R53 commented 5 months ago

yeah, that's what i was thinking too but couldn't say it in understandable words lol

mmitch commented 5 months ago

Oops, GitHub automatically closed the issue when the pull request was merged to the master branch.

@ruby-R53 Could you please check out if this fixes the problem for you?

ruby-R53 commented 5 months ago

it fixed it indeed! nice job :)