Miracle Piano in FCEUX

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
Posts: 5
Joined: Tue Dec 22, 2020 8:24 am

Re: Miracle Piano in FCEUX

Post by DarkCecil » Fri Dec 25, 2020 9:53 pm

GreyRogue wrote:
Fri Dec 25, 2020 2:11 pm
I did add support for USB Midi devices as a MiraclePiano input/output on MiSTer a while back, which I tested with both a Yamaha keyboard and a Miracle Piano (with a USB adapter for both), so you can probably use it now if you want (don't have to wait for the real Miracle Piano). I didn't test it much, but I know it worked. If you want to use SNAC with a Miracle Piano cable to connect instead of USB Midi to the MiSTer, you do need a real Miracle Piano, though. The Yamaha will have the same instrument mismatch issue as FCEUX, unless you use your custom setup for Midi Output with your soundfont (ie, not using the Yamaha as sound generation; Midi Input only).
I tried that a while back actually with a regular USB A-B cable. I believe it only works with a proper cable like you have, USB on one end and 5-pin DINs on the other. Sadly I don't have one such cable, lol. And it has to be converted to mini-USB, since it's supposed to plug into the UART port, not the SNAC port. Yeah, oops. But I do already have the SNAC board and NES adapter, so that will probably be the way I go :)

Posts: 96
Joined: Sun Jan 12, 2020 8:42 pm

Re: Miracle Piano in FCEUX

Post by dink » Sun Dec 27, 2020 7:24 am

Dwedit wrote:
Fri Dec 25, 2020 10:16 am
It's not quite a brick wall yet, there are still ways to compensate for audio playing late. This is where RunAhead comes in. If the audio is 50ms late, you can Run Ahead 3 frames to make up for that.

I know that FCEUX doesn't have RunAhead implemented in there, but it's like 10 lines of code to add in the feature (plus fixing audio on loadstate, maybe I should send in a patch to add RunAhead into FCEUX)

What is the current main repository for taking Pull Requests? Looks like it's the TASVideos repository.
Interesting, I'd love to see your patch for RunAhead in fceux!
p.s. yes - it's the TASVideos repo :)

User avatar
Posts: 4411
Joined: Fri Nov 19, 2004 7:35 pm

Re: Miracle Piano in FCEUX

Post by Dwedit » Sun Dec 27, 2020 7:40 am

I've tried adding in RunAhead, and it works okay for some games, but other games crash. FCEUX doesn't really have the "rock-solid savestates" required for RunAhead to work consistently.
Akumajou Densetsu (Japanese Castlevania 3) does this:
This is not just caused by RunAhead. You can also reproduce this in stock FCEUX by repeating this sequence: Save State, Advance Frame, Load State, Advance Frame, then keep repeating. You'll see the exact same glitch happen after it finally boots up.

If anyone wants a testing build, let me know. You can help report bugs.

Another essential feature for reducing latency is Exclusive Fullscreen mode. Without it, Windows adds 3 frames of lag for desktop composition. Seriously, what the hell Windows. FCEUX is still using DirectDraw, and I need to find out if DirectDraw's fullscreen mode works the same way or not.

Meanwhile, I'd suggest contributing features to Mesen instead of FCEUX, as soon as the issue of who owns the new main repository gets sorted out. And I think the FCEUX maintainers agree as well, just look at thier Github page: "But you might like mesen more: https://github.com/SourMesen/Mesen"
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

Post Reply