maxim-zhao / battlemaniacs-restoration

Modifications to Battlemaniacs for Master System to make it more like the SNES original
9 stars 2 forks source link

Music resync for both 50hz and 60hz outputs? #9

Open AlWesker opened 5 years ago

AlWesker commented 5 years ago

Would be possible to make the music engine to resync if it detects NTSC/60hz at boot? So the music is not speeded up when played at NTSC/60hz. This Master System conversion was designed with PAL/50hz in mind because of its intended European release origins and so the original Krysalis music engine didn't bother with resyncing. TecToy didn't care about this fact either when they released the shelved game in Brazil a couple of years later. There are several games which detect the Hz output difference at boot and resync the music accordingly. Does PSGLib allow this to be implemented?

maxim-zhao commented 5 years ago

I don't think it is a feature of PSGLib, but it may be possible to preprocess the VGMs to approximate 60Hz compatibility and simply select between then at runtime.

maxim-zhao commented 5 years ago

Thinking about it a bit more, just slowing the music won't stop the game being 20% too fast. I'm not sure it's helpful to just fix the music.

AlWesker commented 5 years ago

I'm not worried about the game being 20% too fast on NTSC/60hz. It seems to be perfectly playable that way. I'm fact, I mostly play the game that way as I have a Japanese Master System. I believe that just resyncing the music to be the same tempo both on PAL/50hz and NTSC/60hz will be enough. And probably resyncing the game speed too will be too much work to even consider it.

maxim-zhao commented 5 years ago

If you can work on adjusting the VGMs to 60Hz - I think there's a tool for that - then I can work on integrating the data.

AlWesker commented 5 years ago

Ok. I think we can put this on a lower priority until S T ★ R comes back and do the rest of the intended tracks. Even though this will also be necessary for the tracks that were already present in the game and he didn't compose. I'll see what can I do then.

AlWesker commented 5 years ago

@maxim-zhao, is this the tool to adjust the VGMs you mentioned? https://github.com/simondotm/vgm-converter

AlWesker commented 5 years ago

I resurrect this thread because there's a issue slightly related to this.

For some reason, the Dark Tower, Roller Coaster and Bonus Stage 2 tracks are implemented in the game as if they were 60hz tracks. I had the suspicion that maybe @MotavianRaider composed them as 60hz tracks by mistake, unlike Turbo Tunnel which is perfectly fine and implemented that way. But @sanchez-david has checked the .snm file of Dark Tower and confirmed me it's a 50hz track. In the case of Roller Coaster and Bonus Stage, I need the original .dmfs of the tracks to check them, which I will try to request to @MotavianRaider.

So what's the issue here? If these four tracks that @MotavianRaider did are all 50hz tracks, then why only Turbo Tunnel is playing as it should in 50hz and then the other three are playing slower in 50hz and perfectly fine in 60hz?

maxim-zhao commented 5 years ago

PSGLib doesn't care, it says one frame is one frame no matter if you composed at 50Hz or 60Hz. We'll need to change the music accordingly.

AlWesker commented 5 years ago

Then what seems to be the problem with Dark Tower, Roller Coaster and Bonus Stage 2? In the case of Roller Coaster and Bonus Stage 2 I don't know because first I have to get the original .dmfs off @MotavianRaider, but in the case of Dark Tower why it's detected by SnevenTracker as a 50hz composition and then interpreted by PSGLib as a 60hz one? What's odd is that Turbo Tunnel was also composed by him and that one is the only done by @MotavianRaider that plays perfectly fine.

maxim-zhao commented 5 years ago

It really doesn't matter if the original file says 50Hz or 60Hz, likewise for the VGM. There's some underlying frame count per tracker tick, and that's what drives everything. The music is thus faster on a 60Hz system, and depending on what you want to target, you may want to edit the source file to match. While it is possible to alter the VGM data, it's better to compose it to match what you want.

AlWesker commented 5 years ago

Well, it looks like that at least with Roller Coaster and Bonus Stage 2, we are going to need to investigate those ways to alter the VGM data in order to do properly working 50hz versions of both of these, because it seems I won't be able to get the original .dmf files that @MotavianRaider created but never sent or upload, since he only delivered the .vgm files back in the day. At least with Turbo Tunnel (which works fine on 50hz) and Dark Tower there are the proper .snm files (even if unlooped) together with its .vgm counterparts.

So I suppose that Dark Tower, Roller Coaster and Bonus Stage 2, as they are now, can serve as the first 60hz versions of the so planned future v2 with all the musics working right both in 50hz and 60hz?

maxim-zhao commented 5 years ago

Can you clarify what the issue is? Is the music too slow at 50Hz? Is 50Hz the target?

AlWesker commented 5 years ago

Yes. Dark Tower, Roller Coaster and Bonus Stage 2 are all playing too slow at 50hz, and fine at 60hz.

It's odd, because @MotavianRaider first did the Turbo Tunnel track, and that one is working fine at 50hz and too fast at 60hz, which is the norm in all the Battlemaniacs tracks (both the original Matt Furniss and the new ones that @sanchez-david is doing now), and he was aware of this because I remember he told me, but it only applies to the Turbo Tunnel track which he did first, then he did Dark Tower straight away but that one is fine at 60hz, not at 50hz which is too slow. Both of these were done in .snm/SnevenTracker. Then a couple of months later he moved to .dmf/Deflemask in order to handle the looping better, and did Roller Coaster and Bonus Stage 2, both following the 60hz pattern of Dark Tower. It's like he forgot and did it with a 60hz target.

We have the original .snm of Dark Tower in order to check out this. In fact, @sanchez-david checked it and told me the target is supposed to be 50hz, but the game runs it too slow at 50hz and fine at 60hz. I intended to get the .dmf files of Roller Coaster and Bonus Stage 2 to see if those could be checked out too, but due to circumstances involving @MotavianRaider I'm afraid it's not going to be possible, so anything with these will need to be sorted out with the .vgm files, if possible.