Hacking NDSSFC/CATSFC revival

What sort of additional hotkeys do you want?


  • Total voters
    98

Skelux

Well-Known Member
Newcomer
Joined
Jul 21, 2009
Messages
83
Trophies
0
XP
413
Country
Code:
Settings.SoundSync = TRUE;
This line, added in commit 286bfd58050a13e2e0e30bb35a7a1d189ec7edd1, causes the graphical stuttering, but making it FALSE makes the sound stutter. See CATSFC issue 27 for more discussion on this problem.

For HitsuMaruku, SoundSync = FALSE solves the note length problem, but for me, SoundSync = FALSE makes it worse.

However, as I see just now, it does lower the frames per second a lot.

I see that S9xProcessSound is called after every scanline, so 224*60 times per second, and it tries to buffer a truckload of sound samples every time it's called. Maybe it should stop trying to push so much audio... It actually buffers 92.8 milliseconds of audio data during one frame of 20 milliseconds, then does God-knows-what for 3 more frames.

I'll try fixing that a bit more. But it may end up with subtle silences or crackling in certain games. (The SDK sucks about that; it can't give me an indication that it's out of sound...)

Thanks, I hope it turns out well. In my opinion, video output comes in priority over audio. The glitches in the sound are not very noticeable while playing anyhow.

On another topic, was the source for the GBA emulator ever released? I'd like to revise it a little.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Thanks, I hope it turns out well. In my opinion, video output comes in priority over audio. The glitches in the sound are not very noticeable while playing anyhow.

On another topic, was the source for the GBA emulator ever released? I'd like to revise it a little.
If you had my current test build, in which, every 1.7 seconds, the sound crackles for 1/30 of a second and repeats what has been emitted 1.65 seconds prior for 1/15 of a second, it would get on your nerves really quickly. Less then 1/100 of a second lost every 20 seconds or more would not be bad, though.

I'm trying to play with buffer sizes and sound output intervals to alleviate the graphical stuttering and the audio stuttering at once; maybe I'll succeed, maybe I'll just have to stutter the audio again.

As for the GBA emulator, please see the last page, 6 as of this writing, of Supercard DSTWO: GBA Emulator Details.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
CATSFC 1.25 is released, which has completely rewritten sound-output timing code that doesn't try to push truckloads of audio at once to the DS. Audio jitter of under 23 milliseconds is good!

So: Less note-length jumping by default, even if that default is to set SoundSync to FALSE. And a new setting to set SoundSync to TRUE if you want perfect note lengths at the expense of video. I recommend that mode if you're playing a "soundtrack game" -- a game you play more for the soundtrack -- or a sound-test mode in a game. The setting is in Video & audio and it's called Fluidity.

Thanks, I hope it turns out well. In my opinion, video output comes in priority over audio. The glitches in the sound are not very noticeable while playing anyhow.
Re-quoting you so you get notifications. Please test out 1.25 1.26 (because 1.25 tried a LITTLE too hard to autocorrect its timing and crackled like a record every 23 milliseconds) and comment on filetrip or here :)

ALSO:
* Close your DS in the menu and it shall suspend. Previously, this was done only during emulation.
* Correctly-sorted file selectors.
* 279 milliseconds (0.28 sec) faster startup!
 

Killermech

Cookie Monster
Member
Joined
Mar 5, 2004
Messages
1,809
Trophies
0
Website
Visit site
XP
274
Country
I don't know what kind of black sorcery you used, but holy mother of bunny. In 1.24 which I tried yesterday, Star Fox is actually playable. With frameskip 2 it is actually running pretty good, naturally it's slower than normal but it is in a state where you can play the game entirely.

I've also tried other more resource intensive games and they have all gone to a state where a major improvement is noticeable. Such as in Mario RPG where it's also running tons better than before.
For all these games, Frameskip 2 or lower seems to be the magic setting. Any higher and you'll suddenly notice the big stuttering.

As for some other games, I still find BagSFC to run those in better performance. But overall the boost in 1.24 is beyond impressive as even the games that I find running better in BagSFC, are almost up to par now.

Very amazing work and looking forward to what else you have up to your sleeve :)
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Replying inline in bold:
I don't know what kind of black sorcery you used, but holy mother of bunny. In 1.24 which I tried yesterday, Star Fox is actually playable. With frameskip 2 it is actually running pretty good, naturally it's slower than normal but it is in a state where you can play the game entirely.
Neb: A lot of games are playable under reduced frameskip, even Yoshi's Island. If they skip 10 frames on auto frameskip, does that really count? :P Also, black sorcery? You're a wizard now, Nebuleon!

I've also tried other more resource intensive games and they have all gone to a state where a major improvement is noticeable. Such as in Mario RPG where it's also running tons better than before.
For all these games, Frameskip 2 or lower seems to be the magic setting. Any higher and you'll suddenly notice the big stuttering.
Neb: Yay!

As for some other games, I still find BagSFC to run those in better performance. But overall the boost in 1.24 is beyond impressive as even the games that I find running better in BagSFC, are almost up to par now.
Neb: Which games are you thinking of? And do you really mean 1.24 or 1.25? If you meant 1.24, try out 1.25, because it has way better synchronised sound code, which in turn gives even more fluid video. It might compare favo(u)rably to NDSSFC 1.06, BAGSFC R3 and CATSFC 1.07 (1.1).

Very amazing work and looking forward to what else you have up to your sleeve :)
Neb: Up BassAceGold's sleeve! I am trying out some rather untested things with him in a CATSFC Experimental branch, and they have the potential to bring more speed to the emulator... or make it crash. It's important that we get things stable first. Due to the improvements made, I'm testing out every ROM I own in zipped form, because I don't want the file access or decompression routines to break unnoticed.
 

Skelux

Well-Known Member
Newcomer
Joined
Jul 21, 2009
Messages
83
Trophies
0
XP
413
Country
Thanks, it works great now. That was the only thing deterring me from using your emulator.

edit: I have a suggestion. Would allowing the user to disable selected layers of graphics speed up emulation of slower games?
 

Killermech

Cookie Monster
Member
Joined
Mar 5, 2004
Messages
1,809
Trophies
0
Website
Visit site
XP
274
Country
@Nebuleon
It was with 1.24 and the game which is the most noticeable for me is Aladdin (E). I'm aware the European games has a significant lower fps standard and the difference isn't as noticeable in Aladdin (U) between the two, but it still provides the difference. There are others as well, like Super Star Wars.

I tried 1.26 yesterday and it was unplayable for me. I was randomly getting half second key input lags all over the place. Sometimes not as much, sometimes it ran better with a specific frame skip setting and sometimes it was almost all the time. I tried this with both the video fluid and audio fluid setting. In which the audio fluid setting was inferior in both speed and sound for some reason to the video fluid setting.
So I went back to 1.24 for now.

Also, what I meant with playable is that the game actually ran fluidly (slower than normal) and was controllable. I tried for example Star Fox with Frameskip setting at 3 and it stuttered too much to be enjoyable (auto / 10 frameskip was a nightmare :P). But at Frameskip 2 it was very enjoyable and playable.

I'll try out 1.25 later today and see how that works.
 

Firebug2009

Member
Newcomer
Joined
Jan 7, 2013
Messages
15
Trophies
0
XP
55
Country
Canada
i was able to complete the mushroom cup in SNES Mario Kart without much problems and then play a few minutes of Super Mario RPG yesterday - before i got sucked into Terranigma.....so hats off to you sir! you are freakin' incredible
 
  • Like
Reactions: Rydian

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
@Nebuleon
It was with 1.24 and the game which is the most noticeable for me is Aladdin (E). I'm aware the European games has a significant lower fps standard and the difference isn't as noticeable in Aladdin (U) between the two, but it still provides the difference. There are others as well, like Super Star Wars.

I tried 1.26 yesterday and it was unplayable for me. I was randomly getting half second key input lags all over the place. Sometimes not as much, sometimes it ran better with a specific frame skip setting and sometimes it was almost all the time. I tried this with both the video fluid and audio fluid setting. In which the audio fluid setting was inferior in both speed and sound for some reason to the video fluid setting.
So I went back to 1.24 for now.

Also, what I meant with playable is that the game actually ran fluidly (slower than normal) and was controllable. I tried for example Star Fox with Frameskip setting at 3 and it stuttered too much to be enjoyable (auto / 10 frameskip was a nightmare :P). But at Frameskip 2 it was very enjoyable and playable.

I'll try out 1.25 later today and see how that works.
1.24 was an odd version, really. For some people it worked better, for some people it worked worse. And the SDK just sucks, so the input lag has always been there, but it doesn't show up in all games on a certain version.

1.26 has sound-output timing differences, S9xProcessSound loops instead of udelay, lack of ROM initialisation (zero'd memory) at startup, suspend on lid close in the menu, and memcpy versus memmove optimisations. I dare say that the more synchronised audio causes less communication on the DSTWO<->DS "cart bus", but the video fluidity setting gives you seriously high FPS, and that probably kills the controls because of the high amounts of communication.

In layman's terms, there's just so much stuff being discussed between the DSTWO and the DS to render the video that it can't hear me yelling my small request for controller status.

I will work more on this now. Because playing platformers and puzzles like that is a big no-no.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
CATSFC 1.27, the Controller Status Edition, is now released.

It also deals with a bug when returning from SNES global mute, which was causing Super Mario World to corrupt the first half-second of all the tunes it freshly loaded (after the MARIO START! screen).
[...] I tried 1.26 yesterday and it was unplayable for me. I was randomly getting half second key input lags all over the place. Sometimes not as much, sometimes it ran better with a specific frame skip setting and sometimes it was almost all the time.
Please test 1.27 instead of 1.25 and report on how well it works. I sprinkled controller status calls into the code during frame rendering and audio rendering, so it should synchronise much better. It won't recognise super-short taps, but it won't ignore your releasing of a button for half a second anymore either.

I dunno how the GBA emulator does it, but it synchronises its controller status perfectly...

Rydian, if you're still around, can you test Super Metroid on 1.27 like you did for 1.17? I'm curious to see how well the modifications from 1.24 to 1.27 work with that game :)
 

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
Your Rydian Senses™ were tingling, eh?

Pros.
- The immense slowdown that starts when the boss appears in the intro stage is greatly lessened. The slowdown is still there (and the framerate drops a bit more when more sprites appear like with his fire attack and the spaceship falling apart in the escape), but it's entirely playable now!

Cons.
- Some minor input issues, like the character will keep running for half a second ~50% of the time when I let go, and every couple of shots if I'm tapping quickly, one will miss.
- The "inside cave" area from the end of the earlier tests actually runs slightly worse and there's visual tearing.

The second con is no problem, I don't mind normal areas running slightly-slow if problem-areas like the first are fixed to such a level, but the input lag issues might be a problem.

Need a video?
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Replying inline in bold:
Your Rydian Senses™ were tingling, eh?
Neb: Hehe..! :creep:

Pros.
- The immense slowdown that starts when the boss appears in the intro stage is greatly lessened. The slowdown is still there (and the framerate drops a bit more when more sprites appear like with his fire attack and the spaceship falling apart in the escape), but it's entirely playable now!
Neb: Great - but there being any slowdown is kind of bad.

Cons.
- Some minor input issues, like the character will keep running for half a second ~50% of the time when I let go, and every couple of shots if I'm tapping quickly, one will miss.
Neb: Argh! This controller synchronisation thing isn't working at all! Screw this SDK, seriously. :wacko: Was it better in 1.17 or 1.24? The thing with 1.24 is that its video/audio fluidity pales in comparison with 1.25, so I dunno what to do.
- The "inside cave" area from the end of the earlier tests actually runs slightly worse and there's visual tearing.

The second con is no problem, I don't mind normal areas running slightly-slow if problem-areas like the first are fixed to such a level, but the input lag issues might be a problem.

Need a video?
Neb: Yes, I'd like to see the extent to which there is slowdown in the boss fight, and the extent to which button releases are off for you.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
That shows me what I needed, thanks a lot :)

What I get from the video:
* At the start, your shots are sometimes missed.
* In the corridor, you run farther than you should, most of the time only a little but sometimes it's a long shot.
* The boss fight seems to roll at 15+ FPS instead of 8.
* The falling debris sequence seems to roll at ~12 FPS (no timestamps at the top-right in this one, so I can't count with slow-mo) instead of 6.
* Screen tearing when the FPS is higher than 30.

The screen tearing is there because I use no double-buffering; if I did, then it would miss even more button presses - those you issue while the DSTWO waits for the DS to have finished drawing a frame. But nothing seems to be helping.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Wow.

I am so dumb. This is epic dumb. I'm sorry BassAceGold and everyone else involved... but I have made a mistake.

In the README.md, I write that you need to extract the SDK v0.13beta into /opt/ds2sdk, then overwrite it with v1.2, then add BAG's stuff for DMA, right? I didn't do that fully. So I was compiling against an old libds2b.a. The newer one has the controller status stuff fixed in ds2_getrawInput. Or at least it appears to be fixed in Super Mario World's Chocolate Island 1 level.

Before 1.28, which will have no source-code changes on GitHub, I need to test some games. I just had to throw this out there first.

edit: Yeah, Zelda picks up every single button press, even the slightest tap of the Left and Right keys; Metroid has way high FPS even when the cave collapses, and it doesn't tear at all where Rydian said it did. I'm releasing this post-haste!
 
  • Like
Reactions: wolfmanz51

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
Pft, I've done worse.

The screen tearing in the cave is still there, but much less common. Either way, visually it's much easier to deal with.

Anyways, amazing improvement! I never thought games would run so well. Now I'll have to reclassify SNES emulation on the DSTwo from "a nice idea, but get something else for it" to "it's not perfect but it's playable"
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Pft, I've done worse.

The screen tearing in the cave is still there, but much less common. Either way, visually it's much easier to deal with.

Anyways, amazing improvement! I never thought games would run so well. Now I'll have to reclassify SNES emulation on the DSTwo from "a nice idea, but get something else for it" to "it's not perfect but it's playable"
Tomorrow I'll revisit the entire git commit log for CATSFC and revert stuff that's not necessary or can be redone. Maybe I put in a hack that's now useless and takes performance away, or maybe I can implement something that I couldn't do before because it would have been implemented on a shaky codebase.

Removing vertical sync is one of those decisions I made early on. I thought that in the time the DSTwo took to wait for the screen to be sent, all button presses were lost, so I removed that. It also helped frame-rate at the time.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: "Now I know why he took his own life"