TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.21k stars 385 forks source link

Cannot start game in VS Super Mario Bros. #2494

Open feraligatr opened 3 years ago

feraligatr commented 3 years ago

BizHawk 2.5.2, Win7 x64, NesHawk Core, Vs Super Mario Bros. [!] rom from GoodSet

  1. Load ROM
  2. Insert Coin
  3. Screen prompts "PUSH BUTTON (Blue) FOR 1-PLAYER" Now whatever I press, it doesn't start.

In FCEUX, "select" button works.

YoshiRulz commented 3 years ago

edit 2022-01-10: tl;dr for future humans: P1 and P2 are swapped in hardware (oversimplifying, see details below) but NesHawk doesn't handle that correctly at the moment, so they're not swapped, thereby appearing swapped. Got it? Good.


Original comment w/ workaround:

The (virtual) gamepads are swapped. I'm not sure if that's an emulation bug or if the game was programmed that way, but for now just add P2 in NES > Controller Settings... and set its keybinds.

nattthebear commented 3 years ago

This is a core bug; P1 and P2 are swapped from what they're supposed to be in VS mode.

YoshiRulz commented 3 years ago

Seems it was done intentionally? https://github.com/TASEmulators/BizHawk/blob/c0b6bf61b1a06db2ce5287bfc74a7ab2fffbf4ef/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs#L763-L771

nattthebear commented 3 years ago

That should be correct. I assumed the swapping wasn't being done.

I know different models of VS System screwed with certain regs in certain ways (piracy protection?), is it possible that some VS Systems actually had not-swapped controller regs? Maybe we can check in fceu

alyosha-tas commented 3 years ago

Here is nesdev's current documentation: http://wiki.nesdev.com/w/index.php/Vs._System#cite_note-2

For controller reading specifically they link to here: https://forums.nesdev.com/viewtopic.php?p=220654#p220654

Mesen implements basically the same as that comment: https://github.com/SourMesen/Mesen/blob/master/Core/VsControlManager.cpp

nattthebear commented 3 years ago

Great, so some games swap P1 and P2, and some don't, and some even swap particular buttons. Good old VS.

From an architectural standpoint, it would nice to see this stuff handled in the controller deck abstraction layer instead of hardcodes inside the core.

YoshiRulz commented 2 years ago

Are we in agreement to copy Mesen?


handled in the controller deck abstraction layer instead of [hardcoded] inside the core

Those controller decks are part of their respective cores.

nattthebear commented 2 years ago

I mean in here https://github.com/TASEmulators/BizHawk/blob/c0b6bf61b1a06db2ce5287bfc74a7ab2fffbf4ef/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs instead of in here https://github.com/TASEmulators/BizHawk/blob/c0b6bf61b1a06db2ce5287bfc74a7ab2fffbf4ef/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs#L763-L771

alyosha-tas commented 2 years ago

I don't really care one way or another, it's pretty messy and tedious no matter what.