Nuked-OPN2 icon indicating copy to clipboard operation
Nuked-OPN2 copied to clipboard

Issues with some Konami games (Lethal Enforcers etc)

Open DUSTINODELLOFFICIAL opened this issue 6 years ago • 8 comments

Lethal Enforcers & other Konami games with its sound driver (TMNT Tournament Fighters...) have patches that sound like they might have wrong algorithm settings or operators' envelopes wrong. Tested with Genesis Plus GX

DUSTINODELLOFFICIAL avatar Nov 03 '17 23:11 DUSTINODELLOFFICIAL

Do you mean this difference?

The GENS's emulator is pretty outdated and it's first I listened by myself from SEGA and I can't tell is it semi-accurate or total mess because I wasn't listened real chip (for example, Disnay's Aladdin where "Gloomy tune" also plays with different envelopes on different emulators).

Wohlstand avatar Nov 03 '17 23:11 Wohlstand

Can you please record samples from real hardware and emulator for comparison?

nukeykt avatar Nov 04 '17 00:11 nukeykt

I'm including short samples because the problem is very obvious and you will notice immediately. I've marked the emulator "emul" and the real hardware "real." The real TMNT recording is from my Model 1. The real Lethal Enforcers recording is from my Model 2 with ASIC YM3438, but the emulator's mode has no effect on it, the output is incorrect either way. No filter on emulator recordings.

https://mega.nz/#F!5ZAkkDpD!w69RQr1u25nHyRz3e2zLlQ

DUSTINODELLOFFICIAL avatar Nov 04 '17 00:11 DUSTINODELLOFFICIAL

Weird. These songs sound correct on VGMPlay with Nuked OPN2 core. Do these songs play correctly with MAME core in GPGX?

nukeykt avatar Nov 04 '17 01:11 nukeykt

Here's the Lethal Enforcers clip on the MAME core, seems OK to me: https://mega.nz/#!oMAhEC5L!N1yL7BI_o_ZTUMRS2OcirAdqiD-GEf0nlUGQlZwoe_M

I also just tried Nuked with VGMPlay and it seems fine. It could be a GPGX bug or quirk I suppose.

I don't know if this will help: I do seem to remember seeing some code in GPGX (I am currently working on a DSP sound filter/op amp simulation for it to compliment your excellent core) that seemed intended to simulate Z80 bus latency, is it possible that this is causing problems with the ym3438 core being out of sync with the rest of the emulator's state somehow?

Oh, before you ask, I also made sure to test with an unmodified GPGX to make sure I hadn't somehow introduced the bug!

DUSTINODELLOFFICIAL avatar Nov 04 '17 01:11 DUSTINODELLOFFICIAL

I'm not sure if this is the same bug I am experiencing or not, but I suspect it is. I am witnessing a very obvious problem in Castlevania - Bloodlines (USA) (Beta) (1993-08-04) (CRC32: ca0df45b, SHA1: a7ed6359456e7a6f730e77c7b8aeb86562d6a31b).

The title screen sounds fuzzy, but things are especially noticeable in in the sound test, specifically BGM 05 after switching to some other track and back to it. The fact that it is so obvious and jarring in this instance may make it easier to track down the root cause using this game as opposed to some others listed.

The game is mentioned in this (closed, seemingly perceived as resolved) issue: https://github.com/ekeeke/Genesis-Plus-GX/issues/289

I first experienced this in an emulator I am currently writing that uses Nuked-OPN2, but it is also present in Genesis Plus GX when using the Nuked core in both YM2612 and YM3438 modes, but not the MAME core. Since the behaviour is identical between my emulator and Genesis Plus GX I am led to believe it is common to the Nuked-OPN2 core and not just a matter of Z80 timing in a single emulator.

carmiker avatar Aug 03 '21 21:08 carmiker

@carmiker Can you confirm it appears only when switching from a different BGM to 05 versus starting BGM 05 from scratch? Maybe you can take a VGM dump of that short period of time from an emulator like Kega Fusion or whatever modern one that actually supports VGM logging and post a zip of it here. I want to rule out the game itself not setting certain YM2612 parameters when songs play in sound test, which would be a result of game programming rather than inaccurate emulation.

apollolux avatar Aug 03 '21 21:08 apollolux

@apollolux it happens to varying degrees no matter what you do, for instance the fuzzy sound on the title screen. It is simply VERY obvious with BGM 05 after having played a different track.

I can confirm this issue is not exhibited on my VA3 non-TMSS USA Genesis.

I dumped a few VGMs using Kega Fusion on my Windows computer and played them with the Nuked core using: https://github.com/ValleyBell/vgmplay-libvgm

I cannot reproduce the problem in vgmplay. Very interesting, and perhaps this specific game is very timing-sensitive such that both my emulator and Genesis Plus GX in combination with Nuked-OPN2 are revealing this sensitivity despite being otherwise unrelated codebases. Regardless, it would be nice to know exactly what causes this effect. If I discover anything as I continue work on my emulator I will update this issue.

carmiker avatar Aug 03 '21 22:08 carmiker