Hacking NDSSFC/CATSFC revival

What sort of additional hotkeys do you want?


  • Total voters
    98

Rydian

Resident Furvert™
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
Just finished that, actually.

http://www.mediafire.com/?b66yyd693sbqbqq

It's the whole "new game" world-background text stuff's intro music. I cut it off right before the whole Biggs/Vicks/DAYQUIL+wedge thing, since as nice as it is, the section where the NPCs are talking relies on the user hitting buttons to advance it, so a timing comparison wouldn't work there.


EDIT: Oh, right, forgot the waveform screenshot.

ff3.png


Mmm, delicious stereo goodness. What's also delicious is that this game isn't WTFLOUD like Zelda 3.
 

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Just finished that, actually.

http://www.mediafire.com/?b66yyd693sbqbqq

It's the whole "new game" world-background text stuff's intro music. I cut it off right before the whole Biggs/Vicks/DAYQUIL+wedge thing, since as nice as it is, the section where the NPCs are talking relies on the user hitting buttons to advance it, so a timing comparison wouldn't work there.


EDIT: Oh, right, forgot the waveform screenshot.

ff3.png


Mmm, delicious stereo goodness. What's also delicious is that this game isn't WTFLOUD like Zelda 3.


Okay, thanks! Just tested it out and now I can compare both this and Snes9x 1.52/1.53 (should be roughly 1:09 long like yours, may be off by 1/4 second or so). For the DS, Final Fantasy 6 sounds pretty darn good (nowhere near the abomination that was the GBA port). The timing is definitely still off in the NDSSFC emulator, but it's not nearly as bad as it was before Nebuleon started working on these. That twinkling sound at the end of the soundtrack as it fades out should repeat itself clearly at its high tempo like in Snes9x 1.52, if that makes sense.

http://www.mediafire.com/?ct5cj5oibain3zo

Once more in FLAC.

(Hope he doesn't mind that we're doing this on his thread...)
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
I don't mind this being on the thread because it's related to the emulator and how I could improve it.

Just listened to the Zelda 3 waveform comparison. I have Audacity too, so I can listen to (and watch :P) the channels separately. I did notice that all versions of CATSFC until 1.24 or so skipped the second note in the rupee jingle - that also happens in Yoshi's Island, for the record.

And yes it's the second note, look at this:
zelda3-rupee-jingle.png


But I can't reproduce this in 1.30, even with the "prefer fluid video" setting; I can clearly hear the high note, then a middle note, then a high note again.

If this was indeed recorded on 1.30, then somehow the auto frameskip or audio code isn't timing correctly and skipping random notes that last up to 20 milliseconds. What doesn't help is that the frame time isn't an integer multiple of the DSTwo's system timer, which is 42.667 microseconds, and neither is the audio buffering time.

The frame time in NTSC is 20 milliseconds, which is 468.75 timer ticks. The code doesn't try to correct for these slightly-off (10.7 microseconds) frame times.

The audio buffering time is also 20 milliseconds, which is 468.75 timer ticks. The buffer is 640 samples long, and the sampling frequency is 32000 Hz, so the buffer time is 640 samples ÷ 32000 samples/s = 0.02 second. The code does try to correct for this slightly-off audio time by artificially delaying 3 out of 4 buffers by 42.667 microseconds.

Aligning the start of the music proper, the DS ends the music late by 300 milliseconds. Given that there are only 4 audio buffers on the DSTwo, and that 300 milliseconds is 15 audio buffers, I doubt this is related to the audio timer correction. Maybe it's just auto frameskip that's acting up...
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
And in FF6 (Japan; FF3 in America) the sound is off only by ~80 milliseconds out of 1min07.50. The DS version has 550 milliseconds of wind sound from the following sequence so I ignored that.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Haha... I did this on 1.28 or 1.29 or whatever. Downloaded 1.30 and never actually installed it!

Do you have the audio cable needed for this, or should I do a second set of tests with 1.30 when I get some free time again?
I don't. All I have are standard earphones and earbuds, no plug-to-plug cable.

The last version with sound-related additions is 1.30, but 1.30 only has audio fixes dealing with saved states. The last "new and improved sound" version is 1.29. If you have 1.28, then just put 1.30 anyway ;) But if what you had is 1.29, then it should be equivalent to 1.30. Check with Options/Version information.
 

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Yeah, 1.28 is still using the old 22050 Hz non-interpolated sound. 1.29 is a major improvement. Tests are invalid for now :(

What tests? What would you like Rydian and me to do to help? I just feel like I should help you fix the SPC700 timing up a bit is all...I'd best not bother ya then. :(
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Rydian performed tests of audio timing and accuracy, but the audio was known to be incorrect in the version he tested. So all the waveform pictures and sound bites he posted are invalid and I'll wait for him to post sound bites for the most recent version. It's a bit like bug reports in the open-source world: bugs are sometimes rejected without any consideration if they're not filed against the most recent version, unless a developer knows there have been no changes impacting a subsystem since the bug's appearance version.

He used a plug-to-plug cable to record the DS sound from the DS's output jack into the mic input jack on his computer to produce what you saw and heard from his posts.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
For the APU/S-SMP stuff, here's an excellent thread on byuu's message board: http://board.byuu.org/viewtopic.php?f=16&t=1597

Basically, Blargg's code is faster and more accurate but freezes or crashes in some games. Plus, as Snes9x staffer BearOso states,
blargg himself said that the SMP core in snes_spc was only intended for use in music players (hence the streaming bugs), and it's also slightly apparent when just looking its code.
I don't know if that has been fixed in Snes9x 1.53 yet. BearOso's reply is dated 2011-05-02, while Snes9x 1.53 was released 2011-09-29. Did byuu work with BearOso on this, for the benefit of both emulators, during those 4 months?
 

Rydian

Resident Furvert™
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
I set my computer up to play the input as it comes in so I could better control the volume levels and junk... so this second set of recordings should be mastered better (as far as peaking without clipping).

  • Zelda 3
    comparison2.png


    So CATSFC 1.30 has all three notes... but...

    comparison1.png


    It still starts the title screen music early, though it ends it around the same time (which is weird to hear). In addition in the first example you can see that even though analogue static would account for notes not ending precisely, CATSFC seems to be cutting "quiet" periods short... I would try to examine how it treats individual notes better (to see if it's cutting everything short emulation-wise and running slightly fast), but what with the analogue blending of sounds it's hard to tell.

    And here's the channel split whateverthecrap again.
    http://www.mediafire.com/?mg3msjwu2ezbcy2



  • Final Fantasy 3(US)/III/6/VI/ROKU
    This shit's like, waveform porn, man.
    audio_porn.png

    Look at those sexy curves and that stereo goodness.

    http://www.mediafire.com/?nqmiwqcv6x9xkjw
 

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Rydian performed tests of audio timing and accuracy, but the audio was known to be incorrect in the version he tested. So all the waveform pictures and sound bites he posted are invalid and I'll wait for him to post sound bites for the most recent version. It's a bit like bug reports in the open-source world: bugs are sometimes rejected without any consideration if they're not filed against the most recent version, unless a developer knows there have been no changes impacting a subsystem since the bug's appearance version.

He used a plug-to-plug cable to record the DS sound from the DS's output jack into the mic input jack on his computer to produce what you saw and heard from his posts.

Ah, gotcha. I remember him saying he used the wrong version. Oopsie-doodle :shy: Would you like me to post some recordings as well or will his suffice?

For the APU/S-SMP stuff, here's an excellent thread on byuu's message board:http://board.byuu.org/viewtopic.php?f=16&t=1597

Basically, Blargg's code is faster and more accurate but freezes or crashes in some games. Plus, as Snes9x staffer BearOso states,

I don't know if that has been fixed in Snes9x 1.53 yet. BearOso's reply is dated 2011-05-02, while Snes9x 1.53 was released 2011-09-29. Did byuu work with BearOso on this, for the benefit of both emulators, during those 4 months?
Oh, that makes sense actually. I wonder what exactly they implemented to give the Snes9x its cycle-accuracy audio compared to a real console (either way, they got it to sound pretty damned close, I can't tell a real system or 1.52/1.53 apart)....

I set my computer up to play the input as it comes in so I could better control the volume levels and junk... so this second set of recordings should be mastered better (as far as peaking without clipping).

  • Zelda 3
    comparison2.png


    So CATSFC 1.30 has all three notes... but...

    comparison1.png


    It still starts the title screen music early, though it ends it around the same time (which is weird to hear). In addition in the first example you can see that even though analogue static would account for notes not ending precisely, CATSFC seems to be cutting "quiet" periods short... I would try to examine how it treats individual notes better (to see if it's cutting everything short emulation-wise and running slightly fast), but what with the analogue blending of sounds it's hard to tell.

    And here's the channel split whateverthecrap again.
    http://www.mediafire.com/?mg3msjwu2ezbcy2



  • Final Fantasy 3(US)/III/6/VI/ROKU
    This shit's like, waveform porn, man.
    audio_porn.png

    Look at those sexy curves and that stereo goodness.

    http://www.mediafire.com/?nqmiwqcv6x9xkjw

The recordings sound helluva lot better this time around. Final Fantasy 3/6 on the DS sounds pretty nice considering the state of the SPC700 emulation.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
The thing with the Zelda 3 rupee sound, specifically, is that if your fluidity is set to prefer video, the sound state is sampled every 20 milliseconds only, so if the state is already perfect for a note to be started or ended, it will start or end correctly, but otherwise you will get the note early or late, or ending late. This is a limitation of the sound mixing code.

It is more efficient to "ignore" a channel that's muted for 640 samples in a row than to ignore it once each time in 640 mixing operations. It is also more cache-efficient (instruction cache and data cache on the MIPS) to execute the sound mixing code ONCE with 640 samples to output, than 640 times with ONE sample to output, interspersed with CPU emulation. That's how the setting makes video more fluid: it relies on muted channels and acceptable sound latencies. The only way to fix that would be to mix fewer samples in a row more times per frame, but that's just bringing it back towards "prefer fluid audio".

There is some timing catch-up code thrown into the mix, so that may be why the Zelda 3 music ends at the proper time.

As for the Final Fantasy naming-confusion-between-Japan-and-America fest, is that waveform from CATSFC? :blink: Holy crap, that's some waveform porn there!
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Ah, gotcha. I remember him saying he used the wrong version. Oopsie-doodle :shy: Would you like me to post some recordings as well or will his suffice?
Rydian's latest Zelda 3 recording includes a Snes9x 1.5x part in the right channel, not sure about Final Fantasy. If you could record Snes9x 1.5x playing Final Fantasy 6/3/DatVersion with the same music as above, I'd appreciate it.

Oh, that makes sense actually. I wonder what exactly they implemented to give the Snes9x its cycle-accuracy audio compared to a real console (either way, they got it to sound pretty damned close, I can't tell a real system or 1.52/1.53 apart)....
I dunno, but it sounds awesome :D
 

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Rydian's latest Zelda 3 recording includes a Snes9x 1.5x part in the right channel, not sure about Final Fantasy. If you could record Snes9x 1.5x playing Final Fantasy 6/3/DatVersion with the same music as above, I'd appreciate it.


I dunno, but it sounds awesome :D

Will do :P

Here it is, recorded from Snes9x 1.52/1.53 (they sound exactly the same in terms of accuracy, FLAC format) 32,000 Hz, stereo
http://www.mediafire.com/?au1559upqvlsylg

If I had my Snes with me, I'd find a way to record directly, but since I don't, this is as close as we can get, but it should help gauge an ABX test if necessary. The recording ain't the best quality, but I equalized it to compensate a bit. Hopefully this helps.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Oh, that makes sense actually. I wonder what exactly they implemented to give the Snes9x its cycle-accuracy audio compared to a real console (either way, they got it to sound pretty damned close, I can't tell a real system or 1.52/1.53 apart)....
Looking around on byuu's message board, byuu is hellbent on accuracy, so much that he got people to use logic analysers and oscilloscopes on their SNESes; got some custom controller boards and crimps and so on; got memory and DMA/HDMA timings from test ROMs on real hardware, and even went so far as to write motherboard and memory map manifests to emulate the Super Famicom versus the Super Nintendo and its multiple revisions, PAL and NTSC, etc. He also did power-cycle and reset tests to get the values of certain hardware registers at hard and soft reset.

So Snes9x must have gotten serious help from byuu's BSNES.
 
  • Like
Reactions: the_randomizer

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Looking around on byuu's message board, byuu is hellbent on accuracy, so much that he got people to use logic analysers and oscilloscopes on their SNESes; got some custom controller boards and crimps and so on; got memory and DMA/HDMA timings from test ROMs on real hardware, and even went so far as to write motherboard and memory map manifests to emulate the Super Famicom versus the Super Nintendo and its multiple revisions, PAL and NTSC, etc. He also did power-cycle and reset tests to get the values of certain hardware registers at hard and soft reset.

So Snes9x must have gotten serious help from byuu's BSNES.

Hellbent is right, but I remember saying he helped a lot in the audio department, but in the long run it helped us finally have cycle-accurate SPC700 emulation. Oh, and I updated my last post with the FF6 recording just in case ya missed it. Hope it helps with comparing the two.

Now that I mention it, I think I have a real SNES in my brother's room at my parent's house....and I have an original cartridge of Final Fantasy VI, but the battery no longer works, so all my saves are gone. I also have Chrono Trigger and Final Fantasy V, so maybe, just maybe, I can test those...? The tricky part is hooking it up to my PC and using Audacity, but I'm sure it can be done.
 

Rydian

Resident Furvert™
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
The thing with the Zelda 3 rupee sound, specifically, is that if your fluidity is set to prefer video, the sound state is sampled every 20 milliseconds only, so if the state is already perfect for a note to be started or ended, it will start or end correctly, but otherwise you will get the note early or late, or ending late. This is a limitation of the sound mixing code.
Yeah all my recordings are on "prefer fluid video" since I assume that's how people want to play, and I don't want to give a false impression that video and audio are of a certain level when it's one or the other at a time.

There is some timing catch-up code thrown into the mix, so that may be why the Zelda 3 music ends at the proper time.
It certainly sounds like it catches up near the end.

As for the Final Fantasy naming-confusion-between-Japan-and-America fest, is that waveform from CATSFC? :blink: Holy crap, that's some waveform porn there!
Yeah, that's from FF6 on CATSFC, I didn't do an SNES9x recording for that one since it was just for randomizer to hear/see (as there's no notable issues for me to compare against), also I wanted to leave it stereo because it actually makes great use of it in the music (opposed to most games that are just stereo in name).

FF6's soundtrack is... just way better than that of most other SNES games, you can really see how much effort the devs put into the game, and what the SNES is capable of on the audio front.
 
  • Like
Reactions: the_randomizer

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    OctoAori20 @ OctoAori20: Nice nice-