jotego / jtcores

FPGA cores compatible with multiple arcade game machines and KiCAD schematics of arcade games. Working on MiSTer FPGA/Analogue Pocket
https://patreon.com/jotego
GNU General Public License v3.0
226 stars 40 forks source link

shouse: alternative controls #626

Closed jotego closed 3 months ago

jotego commented 5 months ago

This one was missed when support for other boot-up keys was added in #544. The four-player versions of Tank Force won't boot up. They currently boot to a "KEY ERROR", so it might be the key indeed but it could simply be that missing the joystick connections produce an error in the boot up sequence.

Adding these connections requires having the JTFRAME_4PLAYERS macro defined. That will make the other two joysticks appear as ports. MAME's namcos1.cpp file in the doc folder details how to connect the new joysticks.

gyurco commented 5 months ago

The key error is simple, just need to change 'setname' to 'machine' in mame2mra.toml

diff --git a/cores/shouse/cfg/mame2mra.toml b/cores/shouse/cfg/mame2mra.toml
index ddb91eb3..1f85d4bb 100644
--- a/cores/shouse/cfg/mame2mra.toml
+++ b/cores/shouse/cfg/mame2mra.toml
@@ -44,7 +44,7 @@ data= [
     { machine="rompers",  data="03 B6 07 FF FF FF FF FF" },
     { machine="blastoff", data="03 B7 00 07 03 05 FF FF" },
     { setname="ws89",     data="03 B8 02 FF FF FF FF FF" },
-    { setname="tankfrce", data="03 B9 05 FF 01 FF 02 FF" },
+    { machine="tankfrce", data="03 B9 05 FF 01 FF 02 FF" },
     { machine="dangseed", data="03 34 06 FF 05 FF 00 04" },
     { machine="pistoldm", data="03 35 01 02 00 FF 04 FF" },
     { machine="ws90",     data="03 36 04 FF 07 FF 03 FF" },

However there are several games with missing/custom controls, like Tank Force 4p, Quester (paddle), Face Off (looks like the same as Tank Force 4p), Berabowman.

gyurco commented 5 months ago

Should I send a PR with the toml change (looks easier to do the edit than preparing the PR).

jotego commented 5 months ago

Should I send a PR with the toml change (looks easier to do the edit than preparing the PR).

I just made the change. Thank you for identifying it. Could we keep this issue to implement the missing controls where necessary?

gyurco commented 5 months ago

I just made the change. Thank you for identifying it. Could we keep this issue to implement the missing controls where necessary?

Yes, sure.

gyurco commented 4 months ago

I would accept some advice about controls:

jotego commented 4 months ago
  • Faceoff/Tank Force 4p: Faceoff is actually 2 players, two sticks/player. I think it should use either left/right stick on the same controller, or joystick 1/2 and 3/4. Is there any method to select between the two methods?

Letting the user select is indeed a good idea. JTKCHAMP is a similar case. The selection is made through a new DIP switch defined in the TOML:

[dipsw]
extra=[
    { name="Link joysticks", options="Off,On", bits="8" },
]

To get access to the second analog stick you need to define the macro JTFRAME_ANALOG_DUAL. I will probably get rid of these macros soon as the game instance comes via a template now and that makes things much easier to maintain.

  • Berabowman: jump and attack buttons are actually pressure sensitive. In MAME, there are 3 buttons assigned to each move (like small jump/medium jump/high jump). Should I use 6 buttons, too?

That is a good solution. It requires changing the definition for the number of buttons in the .def file and then the button names in the TOML.

  • Quaster is a spinner user, I don't have a specific spinner, and as I see, the MiSTer handles them separately them from analog joystick. Maybe I can look at Arkanoid 2 how to use it.

The spinner is different from the analog joystick as it does not provide an absolute position. It only tells you whether it is spinning or not and the direction.

JTFRAME has a spinner emulator using the joystick and the mouse. So you can connect the spinner input even if you do not have a spinner.

Arcade games are a bit tricky when it comes to spinners. Sometimes there are resets for the spinner counts or other features that make it less generic than it should. A lot of these games used a small spinner controller that you can find instantiated in cores such as JTCPS1. MAME sometimes does not identify this controller correctly. But if it is there, adding support becomes very easy because it is just a matter of connecting it. Maybe there is some PCB picture where you can see the chip?

gyurco commented 4 months ago
  • Faceoff/Tank Force 4p: Faceoff is actually 2 players, two sticks/player. I think it should use either left/right stick on the same controller, or joystick 1/2 and 3/4. Is there any method to select between the two methods?

Letting the user select is indeed a good idea. JTKCHAMP is a similar case. The selection is made through a new DIP switch defined in the TOML:

[dipsw]
extra=[
    { name="Link joysticks", options="Off,On", bits="8" },
]

To get access to the second analog stick you need to define the macro JTFRAME_ANALOG_DUAL. I will probably get rid of these macros soon as the game instance comes via a template now and that makes things much easier to maintain.

I need only the digital part, as I see, access to these are not standardized (on MiST, it's joystick[19:16]).

gyurco commented 4 months ago

The spinner is different from the analog joystick as it does not provide an absolute position. It only tells you whether it is spinning or not and the direction.

JTFRAME has a spinner emulator using the joystick and the mouse. So you can connect the spinner input even if you do not have a spinner.

Arcade games are a bit tricky when it comes to spinners. Sometimes there are resets for the spinner counts or other features that make it less generic than it should. A lot of these games used a small spinner controller that you can find instantiated in cores such as JTCPS1. MAME sometimes does not identify this controller correctly. But if it is there, adding support becomes very easy because it is just a matter of connecting it. Maybe there is some PCB picture where you can see the chip?

Quester seems to expect a 8 bit counter as spinner. But it's not hard to create one from the quadrature input (dial signal), however is there anything in the framework which I can re-use?

jotego commented 4 months ago

I need only the digital part, as I see, access to these are not standardized (on MiST, it's joystick[19:16]).

I do not remember seeing those bits in MiSTer/Pocket. This is the reference for Pocket inputs. If it is not supported on MiSTer/Pocket, we should not go down that road.

Is it possible to simply use one joystick for control on Face Off?

Quester seems to expect a 8 bit counter as spinner. But it's not hard to create one from the quadrature input (dial signal), however is there anything in the framework which I can re-use?

I think you probably need jt4701. Check out how to use it on jtcps1_main. It is also used on other cores.

gyurco commented 4 months ago

I need only the digital part, as I see, access to these are not standardized (on MiST, it's joystick[19:16]).

I do not remember seeing those bits in MiSTer/Pocket. This is the reference for Pocket inputs. If it is not supported on MiSTer/Pocket, we should not go down that road.

Is it possible to simply use one joystick for control on Face Off?

Only half of the team is controllable with one stick. We can use joy1/2 for player1 and and joy3/4 for player2 then.

jotego commented 4 months ago

That sounds better

jotego commented 4 months ago

Thank for the PR. @jtmiki, please try out the affected games so we can close the issue:

jotego commented 4 months ago

What was the conclusion with 4-player version of Tank Force? I do not edits related to controls? (Although there was an edit for getting the right key)

gyurco commented 4 months ago

Controls are the same as the 2-player version, just supports more controllers.

jotego commented 3 months ago

Tank Force 4 player controls are not completed:

You can test it in service mode, advancing with the service key (9) will show the controls window. All 4-player inputs are mapped to the keyboard in JTFRAME.

Credits for players 1/2 were swapped in all games -prior to this issue- I fixed that one in c694259f. Could you finish off these couple of things with Tank Force?

jotego commented 3 months ago

@jtmiki please test Tank Force 4 player controls in today's compile_all.

jotego commented 3 months ago

tested Tank Force 4p (all 4 coin chutes and controls for all 4 players) and it works correctly. @jtmiki mark it as completed.