Port 2 not working, at least on em-fceux-site

Issue #38 resolved
Wendel Scardua created an issue

em-fceux version: 1.0.3

What goes wrong:

I’m using a fork of em-fceux-site in order to embed my NES games on itch.io But the latest game I made was for two players, and I just found out that I can’t make it work for the second player. Then I tried running both my game and Bubble Bobble on the original em-fceux-site (https://tsone.kapsi.fi/em-fceux/) and they didn’t work either. I’ve selected “Controller” for Port 2 in System settings, then tried setting keyboard controls for Controller 2 in Input Bindings, but the games seemed to ignore this. Input bindings for Controller 1 work just fine, though.

Steps to reproduce the bug:

  1. Open settings, in “System settings”, select “Controller” for Port 2, then close settings.
  2. Open a two-player game rom.
  3. Open Input Bindings, set some keyboard buttons for “Controller 2”, then close Input Bindings
  4. Start a two-player game. The second player won’t react to any input.

Browser: Firefox 81.0 / Chrome 85.0

OS: Windows 10

Comments (5)

  1. Wendel Scardua reporter

    While trying to debug I found this in em-fceux-site’s src/input.ts:

    private updateControllers() {
    // TODO: handle all active controllers
    return this.bitsForController('1');
    }

  2. Wendel Scardua reporter

    I’ll just use

    return this.bitsForController('2') << 8 | this.bitsForController('1');

    for now

  3. Valtteri Heikkilä repo owner

    Thanks for debugging! Good you found the cause. I’ll fix this shortly on the new version of the site.

  4. Log in to comment