[BUG] Seiken Densetsu III Sound Problem

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
Yorlan

[BUG] Seiken Densetsu III Sound Problem

Post by Yorlan »

I've been using ZSNES on my laptop for a while, and everything runs fine; graphics scroll smoothly and sound plays well.

However, when I finally got around to downloading and beginning to play Seiken Densetsu III, some of the sound effects were way off what they originally are. For example, opening doors causes this high-pitched crackling sound rather than the usual door opening sound effect. Another high-pitched crackling sound occurs when the sailor raises the bridge before sailing off with the boat.

I thought it was the ROM itself. So, I asked my brother to send me the ROM I had on my desktop PC back at home. Again, it did the same thing.

When I asked my brother to upgrade ZSNES to the latest version, as he was using the last non-WIP version of ZSNES, everything sounded fine according to him. (I first noticed it when I downloaded SD3 in late September with the latest WIP version of ZSNES at that time.)

I'm not sure if this means anything or not, but while playing with the sound channels, channels 7 and 8 were the ones used for these sound effects.

Maybe I'm just unlucky?

Code: Select all

---------------------Internal ROM Info----------------------
       File: Seiken Densetsu 3.smc
       Name: SeikenDensetsu3e      Company: Square
     Header: Exists (type?)           Bank: HiROM
Interleaved: No                       SRAM: 64 Kb
       Type: Normal + Batt             ROM: 32 Mb
    Country: Japan                   Video: NTSC
  ROM Speed: 120ns (FastROM)       Version: 1.0
   Checksum: Bad 0x86DE != 0x19EF    CRC32: 7DBDE871
--------------------------Database--------------------------
   ROM wasn't found in the database (possible bad dump).
Laptop Specs:
System: Microsoft Windows XP Home Edition SP2
Processor: AMD Athlon Processor 3000+, MMX, 3DNOW
Memory: 510MB
Video: NVIDIA GeForce 4400 Go 64MB
Sound: SoundMAX Digital Audio
ZSNES Version: ZSNES WIP RC1 (latest available download as of Monday Dec 6, 2004)
DirectX: 9.0c

Desktop PC Specs:
System: Microsoft Windows 2000 Pro SP4
Processor: Intel Pentium III
Memory: 512MB
Video: ATI Radeon 7000 64MB
Sound: Creative Labs Sound Blaster Audigy OEM
ZSNES: ZSNES WIP RC1
DirectX: 9.0c
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

Yorlan's NSRT Output wrote:Company: Square
Bingo! That's SquareSoft/Enix "sound rape" for ya.
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
Paul Bunyan
Lumberjack
Posts: 110
Joined: Sat Jul 31, 2004 4:59 pm
Location: The Land of Trees, PA

Post by Paul Bunyan »

is this the patched version of the ROM, 'cuz you have a bad checksum there, chief.
It is my job to teach the dumb.
[url=http://free.grisoft.com/freeweb.php/doc/2/]Free Antivirus Scanner[/url]
[url=http://www.lavasoft.de/software/adaware/]Free Adware Scanner[/url]
[url=http://www.spybot.info/en/index.html]Free Spyware Scanner[/url]
Cecil
Paladin
Posts: 75
Joined: Fri Jul 30, 2004 2:25 am

Post by Cecil »

Paul Bunyan wrote:is this the patched version of the ROM, 'cuz you have a bad checksum there, chief.
Yeah, I have both the NSRT verified Japanese version and the English-patched version of the ROM, which I patched myself, and it's the same as Yorlan's. So, yes, he's got the English-patched version.
System Specs:

2.2GHz Athlon64 X2 4400+, 2GB DDR 400 SDRAM
EVGA Geforce 7600GT 256MB
Realtek AC '97
Microsoft Windows Vista Home Premium
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

This is the (in)famous Square SPC700 hardware buttrape, currently not emulated in zsnes.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

Hey grinvader, didn't I mention that a few posts back? :roll:
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
Agozer
16-bit Corpse | Nyoron~
Posts: 3534
Joined: Sun Aug 01, 2004 7:14 pm
Location: Nokia Land

Post by Agozer »

adventure_of_link wrote:Hey grinvader, didn't I mention that a few posts back? :roll:
But grin put it so much better. 8)
whicker: franpa is grammatically correct, and he still gets ripped on?
sweener2001: Grammatically correct this one time? sure. every other time? no. does that give him a right? not really.
Image
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

adventure_of_link wrote:Hey grinvader, didn't I mention that a few posts back? :roll:
Did you mention that zsnes was unable to emulate it ?
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

No, I didn't. :oops: My bad.
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
Starman Ghost
Trooper
Posts: 535
Joined: Wed Jul 28, 2004 3:26 am

Post by Starman Ghost »

To clarify, this sound rape is sending erroneous data to the spc to create sounds not normally possible.
[code]<Guo_Si> Hey, you know what sucks?
<TheXPhial> vaccuums
<Guo_Si> Hey, you know what sucks in a metaphorical sense?
<TheXPhial> black holes
<Guo_Si> Hey, you know what just isn't cool?
<TheXPhial> lava?[/code]
Yorlan

Not emulated?

Post by Yorlan »

grinvader wrote:This is the (in)famous Square SPC700 hardware buttrape, currently not emulated in zsnes.
That's the thing.

I downloaded ZSNES 1.337 Win Port 1.06 and it plays just fine. Absolutely no problem with the sound of SD3. Only means I've found to fix the problem.

Maybe a sound update that was installed in version 1.35 began causing this problem? :wink:

But my question is: is anyone else experiencing this bug with SD3?
Joe Camacho
Devil's Advocate
Posts: 2293
Joined: Mon Aug 02, 2004 7:51 pm
Location: Hmo. Son.

Re: Not emulated?

Post by Joe Camacho »

Yorlan wrote:
grinvader wrote:This is the (in)famous Square SPC700 hardware buttrape, currently not emulated in zsnes.
That's the thing.

I downloaded ZSNES 1.337 Win Port 1.06 and it plays just fine. Absolutely no problem with the sound of SD3. Only means I've found to fix the problem.

Maybe a sound update that was installed in version 1.35 began causing this problem? :wink:

But my question is: is anyone else experiencing this bug with SD3?
That's because IIRC that version of zsnes had a crack that "fixed" the soundrape, instead of a better emulation of SPC700, I think later the developers decided that for the sake of the emulator, removed some cracks and instead worked of a better emulation of SPC700.

Feel free to correct me if I'm wrong.
*Sometimes I edit my posts just to correct mistakes.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

That's the gist of it. Zsnes went from an incorrect emulation to an absence of emulation, which is *better*.

Don't argue about that.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

This rape requires Gaussian interpolation, and it requires each stage of the interpolation process to be clipped/wrapped the same as the actual hardware. Libopenspc does it like so:

For gaussian curve half gauss[0...255], helper offsets:

Code: Select all

static const int *G1 = &gauss[256], *G2 = &gauss[512], *G3 = &gauss[255], *G4 = &gauss[-1];
And the voice mixfrac in the range of -4096 ... -1, and I'm sure if you can follow this code, you probably understand sampbuf and sampptr, and how the rotating history buffer works and is ordered...

Code: Select all

vl = vp->mixfrac >> 4;
vr = ((G4[-vl] * vp->sampbuf[vp->sampptr]) >> 11) & ~1;
vr += ((G3[-vl] * vp->sampbuf[(vp->sampptr + 1) & 3]) >> 11) & ~1;
vr += ((G2[vl] * vp->sampbuf[(vp->sampptr + 2) & 3]) >> 11) & ~1;
vr = (signed short) vr;
vr += ((G1[vl] * vp->sampbuf[(vp->sampptr + 3) & 3]) >> 11) & ~1;
outx = (signed short)vr;
if (outx != vr) outx = 0x7FFF - (vr >> 24);
The clipping change is a minor optimization by Shay Green, although I didn't copy his version of the code directly because it alters the clipping/wrapping behavior. This, in addition to the ADPCM decoding, which I believe is already correct...

So, 1, 2, 3, *wrap*, 4, *clip*. I think... Meh.

Whee. *Awaits post by TRAC or other qualified developer to elaborate on this, and/or why the existing behaviour has such a profound effect or something...*

EDIT: Eh, I just bit compared with FF6 wind, and there's no difference with this, which is what Game_Music_Emu is doing. I *guess* there may be at least one sample which abuses the above, but this isn't it. Anyway, here's what the other code is doing:

Code: Select all

// Interleaved gauss table (to improve cache coherency).
// gauss [i] [j] = normal_gauss [(1 - j) * 256 + i]
const short Spc_Dsp::gauss [256] [2] = ...

Code: Select all

// Gaussian interpolation using most recent 4 samples
const short* table = gauss [fraction];
const short* table2 = gauss [255 - fraction];
int s = ((table  [0] * voice.interp3) >> 12) +
		((table  [1] * voice.interp2) >> 12) +
		((table2 [1] * voice.interp1) >> 12) +
		((table2 [0] * voice.interp0) >> 12);
int output = noise_amp; // noise is almost never used
if ( !(g.noise_enables & vbit) )
	output = clamp_16( s * 2 );
Eh, whatever. It's probably more than just the ADPCM decoding, clipping, and interpolation behavior.

Either way, switch to 32000Hz, stereo, Gaussian interpolation, no low-pass filtering, for the most accurate mixing results available, timing and spoony internal mixing system notwithstanding.
Melly

Post by Melly »

So why wasn't the sound crack in 1.337 used in the latest versions of ZSNES?
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Melly wrote:So why wasn't the sound crack in 1.337 used in the latest versions of ZSNES?
grinvader wrote:That's the gist of it. Zsnes went from an incorrect emulation to an absence of emulation, which is *better*.

Don't argue about that.
In other words, although it sounds good in 1.337, the emulation of it is hackish and inaccurate. The developers want accurate emulation.
Melly

Post by Melly »

I see... thanks hehe :) I love the graphics on 1.42 but the sound on 1.337... oh well :cry:
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Of course there are other emulators you could try, such as SNEeSe. SNEeSE has the most accurate sound of all the SNES emulators. I don't know how it handles that game, but it worth a try checking. :)

Find more SNES emulators at http://www.zophar.net/snes.html
Zuzma

Post by Zuzma »

Well most games don't look very good due to incomplete emulation but the sound is amazing. SNEeSe is the sound whores emulator of choice. The latest CVS version sounds almost perfict to me. Some games have popping and crackling but I'm sure that's just some kind of timing problem. I think it's also the only snes emu that runs earth worm jim 2 with sound without any hacks. Er oh and Seiken Densetsu 3 does indeed work.
SirXeno

Post by SirXeno »

guess that solves my buggered sound question heh, guess ya have to balance annoyances, having to change the screen layers constantly or have miss pitched sounds =/
Zuzma

Post by Zuzma »

It isn't nearly that bad but I guess I'm kind of used to it since I use it quite often. I figure once he gets all the cpu quirks and sound ones worked out he'll just go strait to the ppu emulation. Most of the devs already know alot about how it works so it may not take him that long to add it in. Keep in mind this is all speculation and nothing to do with the actual author.
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Byuu seems to be making some fantastic progress, as well. I know his emulator is more of a research emu, but as more and more people get really fast PCs, it's still exciting.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Post Reply