libretro / libretro-fceumm

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

Arkanoid II: duplicated controls in (relative) mouse mode, limited paddle range, requests for more core options #572

Open StormedBubbles opened 1 year ago

StormedBubbles commented 1 year ago

There was a special version of the Arkanoid controller for Arkanoid II on the Famicom. It plugged in to the expansion port like the original version of the controller, but it had an additional expansion port to allow you to plug in another paddle and play the 2-player versus mode with dual paddles.

I could be reading the code in libretro.c incorrectly, but it looks to me like lr-fceumm is meant to include dual-paddle support. From what I see, you are meant to set port 5 to Arkanoid, which activates case RETRO_DEVICE_FC_ARKANOID that takes mouse inputs from both port 1 and port 5:

   for (port = 0; port < MAX_PORTS; port++)
   {
      switch (nes_input.type[port])
      {
         case RETRO_DEVICE_ARKANOID:
         case RETRO_DEVICE_FC_ARKANOID:
         case RETRO_DEVICE_ZAPPER:
               get_mouse_input(port, nes_input.type[port], nes_input.MouseData[port]);
            break;
      }
   }
   {
      case RETRO_DEVICE_FC_ARKANOID:
      case RETRO_DEVICE_FC_OEKAKIDS:
      case RETRO_DEVICE_FC_SHADOW:
         get_mouse_input(0, nes_input.type[4], nes_input.FamicomData);
         break;
.
.
.

However, that does not work. I can only gain control of player 1's paddle (via port 1's mouse index). I can control both players with mice by setting both port 2 and port 5 to Arkanoid, but the behavior is strange. In that case, the mice used for ports 1 and 2 both control the movement of both players. The orientation of the mouse in port 1 is correct for player 1 and reversed for player 2, while the orientation of the mouse in port 2 is correct for player 2 and reversed for player 1. In addition, only port 1's left click is allowed to select things in the menu, so it seems that support is there. The duplication of control over the movement just has to be removed, but I do not see why that is happening. Anyone have an idea?

Note: in order to even use a paddle during gameplay, you have to use the SELECT button on port 1's controller to cycle menu options and use port 1's left click to choose the currently selected option. You want a "VS" game against a "FRIEND" to activate the 2-player mode that has simultaneous play with 2 paddles. Using the START button on the controller to choose the menu options puts the game in controller mode where you have to use the d-pad to move the onscreen paddle.

Widge-5 commented 1 year ago

However, that does not work. I can only gain control of player 1's paddle (via port 1's mouse index). I can control both players with mice by setting both port 2 and port 5 to Arkanoid, but the behavior is strange. In that case, the mice used for ports 1 and 2 both control the movement of both players.

I believe this is because you have the core option Arkanoid Mode incorrectly set as Mouse instead of Absolute Mouse. I can reproduce that behaviour if I set that to Mouse. If you set it to Absolute Mouse and make the Device Type in Ports 2 and 5 Arkanoid then you will be able to control the two player paddles in vs mode independently. It's confusing, but the Mouse Index set in Port 1 will control player 1, and the Mouse Index of Port 2 will control player 2. Each of those mouse devices will also be able to launch the ball with a left click when it is their turn to do so, and can't launch the ball of the other player. Only Player 1 can start the game from the menu.

The orientation of the mouse in port 1 is correct for player 1 and reversed for player 2, while the orientation of the mouse in port 2 is correct for player 2 and reversed for player 1.

Same here. I'm using Sinden lightguns here and it is the X-axis of the guns' movements that control the paddles, even in the vertical orientation of the vs game mode. Left-to-right for player 1 moves the paddle top to bottom, where it is right-to-left for player 2 to do the same. I would humbly appreciate additional core options that could (a)change which axis is used and (b)invert said axis per player.

I also observe that Player 1 is unable to reach the top of the playing area but can reach the bottom, and player 2 can reach the top but not the bottom. Also, in single player mode, the paddle cannot reach the left edge of the area. I observe the same deficiencies when using an analog stick in Stelladaptor mode. However, when played with a controller's d-pad, all extremes can be reached. this makes me wonder if the range used in Arkanoid mode is too short, however I don't know if this is normal behaviour on real hardware. Arkanoid 1 doesn't seem to have this issue. @StormedBubbles what devices are you using and do you experience the same thing?

StormedBubbles commented 1 year ago

Thanks for the clarifications. Yes, it is indeed only with the Mouse mode (the default) that I experience the issue of both mice controlling the movement of both paddles. The other settings all allow me to control the paddles independently with ports 2 (player 2) and 5 (player 1) set to Arkanoid and the controller/mouse devices set to ports 1 (player 1) and 2 (player 2) via the appropriate device indices. I looked at libretro.c again and am unsure of why that happens with the regular relative mouse only.

I am using two spinners, which both act as an X-axis of a mouse, so I don't have the issue with needing the axis swapped. Those requests are good ideas, though. I do have some idea of how to implement those, but the code is already very tidy, and anything I would come up with wouldn't be nearly as clean 😅

For anyone unaware, Sinden Lightguns are absolute mice that track position using a bright (usually white) border around the game. This is easily accomplished in RetroArch via the overlay settings, so any game that uses absolute coordinates could potentially be controlled very accurately by one of these devices.

I also experience the issue with the limited movement range with my spinners and analog sticks in Arkanoid II. The left player can't reach the top of the play area, and the right player can't reach the bottom. The ball can reach both of those spots, so they should be reachable by the paddle too (and they are with the D-pad). It appears that the lower bound of the paddle axis is too high. As with the requested core options, I don't want to upset any balance created with other games using those coordinates by attempting to adjust them.