diff options
author | 0kmg <9137159+0kmg@users.noreply.github.com> | 2021-12-11 12:42:32 -0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-11 16:42:32 -0500 |
commit | 03ac15805ef89e8ad2163a914985e2312fc7d6da (patch) | |
tree | 195330bf192317fbd6548811e31eba09e207880d /src/mame/machine/nes.cpp | |
parent | 3c6f27277d045fc58a38d7a6fadcf92fcb68ec10 (diff) |
bus/nes_ctrl: Work on Famicom joypads + more separation of EXP port. (#8956)
* bus/nes_ctrl: Work on Famicom joypads + more separation of EXP port.
- Enforced proper strobe behavior on joypads. Added helper function to controller interface for common pattern.
- Added proper expansion port version of joypad.
- Streamlined pachinko controller by making it an expansion joypad subclass. Moreover, ball launch lever now works correctly!
- Added missing battery-backed WRAM to Pachio-kun 5, game runs now.
- Simplified arcade stick a bit, now also a subclass of the expansion joypad.
- Rewrote Hori Twin and 4 Players adapters. The latter's 4P mode protocol now works. In theory this supports six players simultaneously, though all known games using it have duplicate controls for P1 and P2.
machine/nes.cpp: Removed hack that shifted bit 0 reads to support controller port joypads on expansion port. There shouldn't be any expansion port devices left that write to bit 0.
* Fix missing battery-backed WRAM for Royal Blood and Vegas Connection, while we're at it.
Diffstat (limited to 'src/mame/machine/nes.cpp')
-rw-r--r-- | src/mame/machine/nes.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index 00052b0c437..fd8c87848b5 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -191,11 +191,7 @@ uint8_t nes_state::fc_in0_r() // bit 2 from P2 controller microphone ret |= m_ctrl2->read_bit2(); - // at the same time, we might have a standard joypad connected to the expansion port which - // shall be read as P3 (this is needed here to avoid implementing the expansion port as a - // different device compared to the standard control port... it might be changed later) - ret |= (m_exp->read_bit0() << 1); - // finally, read the expansion port as expected + // and bit 1 comes from expansion port ret |= m_exp->read_exp(0); return ret; } @@ -206,8 +202,7 @@ uint8_t nes_state::fc_in1_r() // bit 0 from controller port ret |= m_ctrl2->read_bit0(); - // finally, read the expansion port as expected (standard pad cannot be hooked as P4, so - // no read_bit0 here) + // bits 1-4 from expansion port (in theory bit 0 also can be read on AV Famicom when controller is unplugged) ret |= m_exp->read_exp(1); return ret; } |