libretro / libretro-fceumm

FCEUmm libretro port.
GNU General Public License v2.0
125 stars 113 forks source link

Speaking of the Power Pad Implementation:) How about fixing up Family Trainer 5 : Meiro Daisakusen? #542

Open KMFDManic opened 1 year ago

KMFDManic commented 1 year ago

https://github.com/libretro/libretro-fceumm/commit/4dfadfd27a93c82a7b248f24773a802fe890235e

@arpruss You did a great job getting the Power Pad accounted for, and I had a fun time showcasing this stuff in a video:) I tested several of the games, and specifically found Family Trainer 5 : Merio Daisakusen (kind of like a 3d Goonies game!) didn't properly function on fceumm. But, it ran fine, albeit slow, on Mesen! I went through a few other games, Power Pad wise, and found some of those didn't fully work either. This is at least a start, in case you guys do wanna try to further add compatibility for these fun gems:)

@NRS-NewRisingSun Hopefully, this is something you see as feasible!:) I would personally love to see all of the Family Trainer Mappers make it in, of the ones that do not function. But, this particular issue revolves around the obviously coolest of them! Thanks in advance, both of you:)

My Video

https://www.youtube.com/watch?v=7YlPlp4dAbU

arpruss commented 1 year ago

Maybe the ones that don't work are Famicom?

I only test on ROMs from carts I own and ripped myself, and my collection is World Class Track Meet, Short Order / Eggsplode, Athletic World, and Super Team Sports. All are US NES carts and all work perfectly with Fceumm and a DIY USB adapter for two overlapping DDR pads. Maybe Famicom compatibility is the problem with the ROMs you're trying?

KMFDManic commented 1 year ago

@arpruss I greatly appreciate your efforts and what you have done. And, no the issues do not appear to be related to them being famicom games, as any other region I test, be it US, Europe, World, Japan, for games that do work, and are supported within fceumm..have been fine. I will have to take a look at the mappers that were added within Mesen and compare to this Repo, and hopefully that sets me on the right path. Meiro Daisakusen J, as well as Japan dumps both work fine on Mesen, but not on fceumm. Thanks again for your response, thus far:)

arpruss commented 1 year ago

Thanks for the kind words!

Btw, Are any of these Famicom games fun enough for me to bother buying them and ripping them to play, or is it more about completeness?

StormedBubbles commented 1 year ago

Hello,

Family Trainer 8 (Takeshi's Castle) has an English-translation patch available and would be a good addition.

@arpruss thank you for adding this. I do have a quick question about mapping, though. I have two USB dance pads that are recognized as controllers and not keyboards. Can controller buttons be mapped to the RETROK keys somehow in RetroArch?

arpruss commented 1 year ago

@StormedBubbles:

You should be able to assign controller buttons. See Step 6 (which I say I haven't actually tried) in my Instructable: https://www.instructables.com/Playing-NES-Power-Pad-Games-in-Emulation/

Is Takeshi's Castle a good enough game to be worth paying the $20 or whatever it is on ebay?

StormedBubbles commented 1 year ago

Thanks for the link.

I don't think RetroArch mapping works that way, though. The menu you reference is for mapping things to joypad, analog, and lightgun inputs. Each input in that menu can have one physical controller button, controller axis direction, mouse button, and keyboard key mapped to it. The Power Pad implementation here uses the RETRO_DEVICE_KEYBOARD device type, which, if I'm reading the documentation correctly, requests the raw keys pressed on a physical keyboard or keyboard encoder. I only have familiarity with this device type from emulators for systems that used actual keyboards (MSX, Dreamcast, DOSBox).

Someone please correct me if I am wrong, but I believe RETRO_DEVICE_KEYBOARD keys are not remappable on the user end in the GUI or in configuration files. You would have to use a physical device that sends those exact keyboard keys.

On the other hand, the RETRO_DEVICE_JOYPAD device type is remappable by the user via physical controller buttons, physical mouse buttons, and physical keyboard keys. It offers 16 unique digital buttons per device (D-pad, 4 face buttons, 4 shoulder buttons, start, select, L3, R3). Then it wouldn't matter what sort of device or adapter you use as long as it's recognized as a controller, mouse, or keyboard. For example, you could still use the keyboard keys of your adapter as is while I could use the generic USB dance pads I have and someone else could use mouse buttons if desired.

EDIT: I was incorrect about remapping the keyboard keys. See below.

As for Family Trainer 8, it does already "work" in FCEUMM in the sense that I can load the game and go through menus with the P1 controller (even the hacked English translation). It's just that the Power Pad doesn't do anything to control the game in FCEUMM as far as I can tell. The Japanese equivalent of the Power Pad would have plugged in to the Famicom's expansion port, which is "port 5" in FCEUMM, but Mesen allows the game to be controlled with the Power Pad.

arpruss commented 1 year ago

I am pretty sure that if you put in the kind of settings that I show in the screenshot, then when you press the A button on a controller, it will generate a keyboard x, and so on. And your USB mat should just be a controller, no?

arpruss commented 1 year ago

I just checked. I plugged two controllers into my rpi3b, and had retroarch set to input 1 being auto or gamepad and input 2 to powerpad b. I could then remap the B key on my second gamepad to generate r (powerpad b4), and it was properly detected by the controller test rom that I was using. So as long as retroarch can see your mat as a usb controller, it should work.

StormedBubbles commented 12 months ago

Ahhh, thank you for that. I seem to learn something new in RetroArch everyday! I had no idea that the RETROK keys could be remapped like that.

For anyone who comes across this, in the RetroArch GUI, as long as you have one of the Power Pad devices mapped to port 2 or 3, you can go to Quick Menu -> Controls -> Port 2 (or 3), find the button you have already mapped to your gamepad, and scroll through the keyboard keys until you find the one you want. You can then save a game override so that that behavior is maintained between play sessions.

StormedBubbles commented 12 months ago

After refamiliarizing myself with the games I played as a kid, here is a case for Family Trainer 8:

The control scheme is pretty unique among the games I have tried. You have the typical alternate 6 and 7 to run and hit them both simultaneously to jump, but you can alternate 10 and 11 to run backwards to set yourself up for retrying missed jumps and can hold 2 and 3 together with your hands while your feet are on 6 and 7 to crouch. One of the minigames also uses buttons 5–8 only. I think that one might want you to rotate the pad 90 degrees.

The game runs (but without any controls, as far as I can tell) in lr-FCEUMM. It also runs in lr-mesen with some controls but doesn't appear to be functioning properly. The buttons don't do what they are supposed to there (regardless of whether I use the Power Pad or the Family Trainer).

arpruss commented 12 months ago

The cheapest I can find on eBay is $37 (including shipping from Japan).

StormedBubbles commented 12 months ago

Family Trainer 5 (mentioned in the OP) seems cheaper and much more plentiful on eBay. One site even has a boxed copy that appears to only have been opened to verify the contents. I didn't find anything less expensive than what you mentioned for Family Trainer 8. Family Trainer 9 is a direct sequel to 8, but that one is more expensive than 8!

StormedBubbles commented 11 months ago

Hi again. I added the Family Trainer (sides A and B) as a device in my own build. It is assigned to virtual controller port 5, which is lr-fceumm's interpretation of the Famicom expansion port. You can map the keyboard keys to buttons as mentioned above and also use Libretro's "map to port" functionality to hook up a second device from another port to port 5. The buttons are literally the same as the Power Pad's, so these are minor additions. The only real difference is identifying the device as a Famicom Expansion Port device instead of an NES device. The only thing I'm not sure about is whether it's worth adding the Start button from Side A. This is an input not found on the Power Pad (as far as I know). I'm not even sure what function it serves, and it looks so easy to hit accidentally on the real Family Trainer pad.

@KMFDManic I tested Family Trainer 5 and 8. They both work. Feedback is welcome in #571!

arpruss commented 11 months ago

Cool! Adding the start button sounds like a good idea. The user can leave it unmapped, of course.

StormedBubbles commented 11 months ago

This is a bit of a trouble spot for me. I see where that condition would go, and I essentially want the condition to be

if (input_cb(4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START))

(which would allow the user to map it easily) and the result to be JOY_START for port/player 0, but I don't get how to isolate that JOY_START result for that one player.

arpruss commented 11 months ago

I would remap the start button to a key on a keyboard. If you use a Wii Outdoor Adventure mat with my USB adapter ( https://www.instructables.com/Playing-NES-Power-Pad-Games-in-Emulation/ , step 4 ), then in Athletic World mode, the + button on the mat is bound to the space bar. (The adapter makes the mat behave like a keyboard. If you turn on numlock on the computer, that switches to Athletic World mode.) That could be a sensible bind for the start button.

StormedBubbles commented 11 months ago

Ah, that sounds perfect. Thanks for pointing that out. if (input_cb(0, RETRO_DEVICE_KEYBOARD, 0, RETROK_space)) is how I get a check on the RetroArch space-bar input being pressed, but I don't get how to isolate Player 1's Start input from FCEUMM to create the condition "if space bar pressed, then activate the P1 Start input." I see a few different ways that inputs are assigned and am not sure how to just grab the one button.

KMFDManic commented 2 months ago

@StormedBubbles Hope all is well. Somehow, I didn't realize you had even pinged me on your addition to "fix" up port 5 to handle power pad. In any case, better late than never, especially with a game (Family Trainer 5 Meiro Daisakusen) i've wanted to truly play for quite some time:) As a refresher, if you select input as family trainer a or b, are there 12 keyboard keys that are specifically mapped for the power pad, as is? Just trying to ascertain the best way to "get in the game", so to speak, as far as mapping keyboard for controller usage. Thanks:)

And, hopefully, you've gained some ground with Carnevil, as that is a fun gem for 2003 Plus, too:)

StormedBubbles commented 1 month ago

Hi,

Yes, there are 12 keyboard keys hard-coded to the Power Pad / Family Trainer buttons, but since the code uses RetroArch's internal keyboard inputs, you have a few options for actually activating those buttons.

One is that you can plug in a regular keyboard and just have the buttons work with no configuration, but you can also go into the controls sub-menu from the RA quick menu and manually assign the virtual keyboard keys to controller buttons as I described above.

I combined two generic USB dance pads into a single Power Pad / Family Trainer this way (I mapped 6 buttons to each of the dance pads). You also need the correct side (A or B) selected, or the buttons will be mirrored horizontally (as if you flipped the Power Pad over). I found Dance Aerobics to be the best game to test the inputs because it has an onscreen indicator that gives live feedback on which of the 12 buttons are currently being pressed.

I know for sure that Family Trainer volumes 5, 8, and 9 work fine (even the English-patched volume 8). I suggest having a guide handy for the controls (they're out there) because some of these games are not intuitive at all.

KMFDManic commented 1 month ago

@StormedBubbles thanks for the informative response. Do you happen to know the 12 keys binded on keyboard, offhand?

And, have you had any progress with Carnevil?

arpruss commented 1 month ago

qwer asdf zxcv

KMFDManic commented 1 month ago

@arpruss thanks:) I am looking forward to playing around more with this stuff.