FBNeo icon indicating copy to clipboard operation
FBNeo copied to clipboard

Some controls not working in some mahjong games

Open fatjing opened this issue 6 months ago • 10 comments

I'm reporting here as the libretro port says any issue should be reported upstream. I'm using the latest core fetched from buildbot.libretro.com

mgakuen: The Coin key doesn't work. Entering test mode by dip switch shows that other keys are ok

janjans1: The Start key doesn't work. Entering test mode by dip switch shows that other keys are ok

hypreact2: The Start key doesn't work in keyboard mode, which can be selected by dip switch. In joystick mode it seems all keys are ok. Related: #1029

janshin: Keyboard mode doesn't work. It can be selected by dip switch. Joystick mode seems ok.

Hot Gimmick series by Psikyo: hotgmck hgkairak hotgmck3 hotgm4ev hotgmcki Controls in all these games are not working. To be more specifically, they're super non-responsive. E.g. to discard a tile in position a, you'll have to press A multiple times rapidly. Which makes these games almost unplayable.

fatjing avatar Jun 15 '25 04:06 fatjing

Thanks for the report !

I'm not too sure what the psikyo4 issue could be about, maybe somebody else will have an idea. All other issues should be fixed once libretro's buildbot updates the core.

barbudreadmon avatar Jun 16 '25 12:06 barbudreadmon

After figuring out how to test inputs in service mode, they seem to work fine in that driver.

There is only 1 thing i feel concerned about : there is no concept of "keyboard index" in retroarch, so every player ends up using the same keyboard with the same keys, and pressing one key on the keyboard means it's pressed for both players at the same time. You can't even get around this by remapping, since there is no keyboard remapping in retroarch...

I wonder if that unresponsiveness is related to this. The only solution i can think about is to entirely disable keys for 2nd player in mahjong games, so i'll do that, let me know if it somehow improves responsiveness.

barbudreadmon avatar Jun 17 '25 07:06 barbudreadmon

I wonder if that unresponsiveness is related to this. The only solution i can think about is to entirely disable keys for 2nd player in mahjong games, so i'll do that, let me know if it somehow improves responsiveness.

I tested the latest bba201b commit (the buildbot finally updated the core) and unfortunately the Hot Gimmick games are still broken.

But I think your disabling keys for 2nd player is correct. During test mode in some games, pressing one key do light up both player 1 and player 2's input, which is obvious not ideal. Mame also provides input configuration for only player 1: https://docs.mamedev.org/usingmame/defaultkeys.html#default-mahjong-and-hanafuda-keys

And I have a question about Mahjong Bet key. What key on keyboard does FBN assigned the Mahjong Bet to? I tried the number 3 listed in Mame's doc but it didn't work. Though out of the 20ish mahjong games I tested, only 'hypreact' uses the Bet key.

fatjing avatar Jun 17 '25 15:06 fatjing

unfortunately the Hot Gimmick games are still broken.

Hmmm, could you confirm they are working properly in MAME ? Input test is working fine so it's a bit weird that they don't work properly in-game.

And I have a question about Mahjong Bet key. What key on keyboard does FBN assigned the Mahjong Bet to? I tried the number 3 listed in Mame's doc but it didn't work.

The mapping code can be found here. It seems i mapped Bet to RETROK_2 (=> 2), not entirely sure if i made a typo or if the old reference i used for this used that key.

barbudreadmon avatar Jun 17 '25 15:06 barbudreadmon

Hmmm, could you confirm they are working properly in MAME ? Input test is working fine so it's a bit weird that they don't work properly in-game.

Input test for Hot Gimmick games is not working on my side. In service mode, A, B and Start are working properly for navigation, but after entering Input Test, I get some weird behavior. Take 'hotgmck' for example:

  1. Enter service mode, enter the second entry 'Input Test', press keys and got no response Image

  2. In the step 1, smash keyboard like crazy, press A+B to exit Input Test, then enter it again, A,B,C,D are lit up Image

I've never used MAME before, and I couldn't get hotgmck up and running in it. Maybe the romset is not compatible? I need some time to figure out how to use it.

The mapping code can be found here. It seems i mapped Bet to RETROK_2 (=> 2), not entirely sure if i made a typo or if the old reference i used for this used that key.

Thank you. Through wayback machine, it seems they changed it from 2 to 3, along adding keys like Flip Flop, Take Score etc.

fatjing avatar Jun 17 '25 16:06 fatjing

Input test for Hot Gimmick games is not working on my side.

After entering service mode, you'll need to reopen core options and disable it, otherwise it prevents input test from working properly, it took me a while to understand this (this is probably expected behavior due to those inputs being multiplexed in that driver).

Maybe the romset is not compatible?

Hmm, we definitely use the same romset as current MAME, were you maybe using an older version of MAME ?

barbudreadmon avatar Jun 17 '25 16:06 barbudreadmon

I turned the service mode dipswitch into a diagnostic input, it's a bit nicer to avoid the problem in input test : https://github.com/finalburnneo/FBNeo/commit/28e05615b7b2bdeee7a484579843244ef9464762

barbudreadmon avatar Jun 17 '25 17:06 barbudreadmon

Hmm, we definitely use the same romset as current MAME, were you maybe using an older version of MAME ?

I'm using the latest version just downloaded from MAME's website. I finally got the games running. All of them are working properly control vice.

fatjing avatar Jun 17 '25 17:06 fatjing

Hi, Hot Gimmick series on Psikyo HW should be fixed now - thanks for letting us know :)

best regards,

  • dink

dinkc64 avatar Jun 25 '25 01:06 dinkc64

I sent the fix over to the libretro fork, it should be available from their buildbot soon.

barbudreadmon avatar Jun 25 '25 08:06 barbudreadmon

Thank you.

I tested the game and it's much better than before. However, the bug is not completely solved. There's a cheat skill in game called "牌塗り替え" which could change the tiles you don't need. By using that, you can observe the keys sort of have a "double/multi click" behavior.

fatjing avatar Jun 27 '25 09:06 fatjing

@dinkc64 I confirm there is still some kind of busy loop hack inconsistency : by adding some nCurrentFrame/data logging to see what is written at 0x0580000a, we can see that the behavior is vastly different whether sh2.cpp's BUSY_LOOP_HACKS is enabled or not. Using lower values than 9 in the busy loop hack fix slightly improves the consistency against disabled BUSY_LOOP_HACKS (with 3 giving the closest results ?), but still don't match entirely.

One idea, if simply disabling BUSY_LOOP_HACKS is not acceptable, would be to have the possibility to set the number of skipped cycles externally through some extern or function.

barbudreadmon avatar Jun 27 '25 11:06 barbudreadmon

Well, the internal irq needs to break out of the busy loop at a specific time. I think maybe its best to disable it, but it'll be at the cost of some games not running great on earlier cpus. well, if someone complains, we'll find a good idea then. For now disable the busy loop hacks and lets see if it fixes fatjing's problem with "牌塗り替え".

edit: I pushed the busy loop hack disable

dinkc64 avatar Jun 27 '25 13:06 dinkc64

@fatjing how fare the newer nightly ?

barbudreadmon avatar Jun 28 '25 05:06 barbudreadmon

Sorry, been busy lately. I tested the games and the controls are ok now.

fatjing avatar Jun 29 '25 01:06 fatjing