NDSSFC/CATSFC revival

Discussion in 'Supercard' started by Nebuleon, Dec 22, 2012.

?

What sort of additional hotkeys do you want?

Quickly save/load a saved state 33 vote(s) 47.8%
Move emulation to/from the bottom screen 20 vote(s) 29.0%
Toggle aspect ratio: [3] Middle of screen to [4] Entire screen anti-aliased 29 vote(s) 42.0%
Toggle CPU frequency: 5 to 2 17 vote(s) 24.6%
Toggle 8-bit era sound, with triangle waves and noise 17 vote(s) 24.6%
Multiple votes are allowed.
Dec 22, 2012

NDSSFC/CATSFC revival by Nebuleon at 4:10 AM (57,346 Views / 12 Likes) 649 Comments

    • Newcomer

    Skelux New Member

    Member Since:
    Jul 21, 2009
    Message Count:
    26
    Country:
    Australia
    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.
    Last edited by Skelux, Feb 1, 2013


    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    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.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    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.

    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!
    Last edited by Nebuleon, Feb 2, 2013. Reason: 1.26 micro-release
    Boriar, 2ndApex and Rydian like this.
    • Member

    Killermech Cookie Monster

    Member Since:
    Mar 5, 2004
    Message Count:
    1,809
    Country:
    Sweden
    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 :)
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    Replying inline in bold:
    • Newcomer

    Skelux New Member

    Member Since:
    Jul 21, 2009
    Message Count:
    26
    Country:
    Australia
    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?
    Last edited by Skelux, Feb 3, 2013
    • Member

    Killermech Cookie Monster

    Member Since:
    Mar 5, 2004
    Message Count:
    1,809
    Country:
    Sweden
    @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.
    • Newcomer

    Firebug2009 New Member

    Member Since:
    Jan 7, 2013
    Message Count:
    15
    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
    Rydian likes this.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    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.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    That's nice to hear :) Did you do that on automatic frame skipping?
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    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).
    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 :)
    • Member

    Rydian Resident Furvert™

    Member Since:
    Feb 4, 2010
    Message Count:
    27,885
    Location:
    Cave Entrance, Watching Cyan Write Letters
    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?
    Nebuleon likes this.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    Replying inline in bold:
    • Member

    Rydian Resident Furvert™

    Member Since:
    Feb 4, 2010
    Message Count:
    27,885
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Worse camera angle and lighting this time 'cause it's late and I'm tired.

    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    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.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    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!
    Last edited by Nebuleon, Feb 4, 2013
    wolfmanz51 likes this.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    CATSFC 1.28, the Correct SDK Version Edition, is released.

    Controller status sync is perfect. Screen tearing is reduced. FPS increased. All rejoice!
    • Member

    wolfmanz51 Game Design Student

    Member Since:
    Nov 24, 2008
    Message Count:
    419
    Location:
    Somewhere in cali
    Country:
    United States
    Wow now thats Playable
    Last edited by wolfmanz51, Feb 4, 2013
    • Member

    Rydian Resident Furvert™

    Member Since:
    Feb 4, 2010
    Message Count:
    27,885
    Location:
    Cave Entrance, Watching Cyan Write Letters
    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"
    Nebuleon likes this.
    • Member

    Nebuleon MAH BOI/GURL

    Member Since:
    Dec 22, 2012
    Message Count:
    892
    Country:
    Canada
    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.

Share This Page