Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
03142 DIP/Input Major Always May 4, 2009, 10:39 Dec 28, 2009, 10:26
Tester mahlemiut View Status Public Platform MAME (Official Binary)
Assigned To Resolution Fixed OS
Status [?] Resolved Driver
Version 0.131 Fixed in Version 0.136 Build Normal
Fixed in Git Commit Github Pull Request #
Summary 03142: All drivers using PORT_CHANGED callbacks: Input port callback functions are not triggered correctly during INP playback.
Description When playing back INPs in MAME or MESS from drivers that use PORT_CHANGED callback functions, they are not triggered by input from the INP file. Instead, they are still triggered by normal input. For example, in Zaxxon, you can insert coins while recording, as normal. But on playback of the resulting INP, coins are not registered unless you again press 5. No normal inputs should be accepted during INP playback.
Steps To Reproduce Record an INP (use mame zaxxon -record test.inp).
When emulation starts, insert a few coins, and exit MAME.
Playback the INP again (use mame zaxxon -playback test.inp).
You will not see any coins inserted, as you would expect. You can insert coins during playback by pressing 5, which should not happen.
Additional Information This behaviour was first noted in the MESS Amiga driver, where the keyboard doesn't appear to work on INP playback. I believe it was determined that the keyboard inputs are recorded in the INP file, just not used on playback. It was initially thought to be local to that driver, until I tested the Neo Geo Pocket driver, which did the same with just the power button (other controls worked fine on playback). The power button input was the only input with a PORT_CHANGED callback, which pretty much confirmed these callbacks as not working on INP playback correctly. I checked through the current MAME source, and found 28 drivers that use these callbacks, mostly for coin inputs. I tested both Zaxxon and Ladybug to confirm for sure that it is a MAME issue.
Github Commit
Flags
Regression Version 0.125u3
Affected Sets / Systems All drivers using PORT_CHANGED callbacks
Attached Files
? file icon inputport-281209.diff (835 bytes) Dec 28, 2009, 01:48
[Show Content]
Relationships
There are no relationship linked to this issue.
Notes
4
User avatar
No.04315
Tafoid
Administrator
May 4, 2009, 13:53
edited on: May 4, 2009, 13:54
Good catch. Using Ladybug and Zaxxon, I confirmed the behavior. I also narrowed down regression to 0.125u3.

 Added a PORT_CUSTOM for the eeprom bit reading. Updated several
drivers to use that by specifying it in their input ports instead
of having a custom read handler that inserted the bit forcefully.
Also added a PORT_CUSTOM for the ticket dispenser callback as well.
Updated the dcheese driver to use it. Many more drivers can be updated
to use these new PORT_CUSTOMs in the future, eliminating hacky input
port read handlers. [Aaron Giles]
User avatar
No.05228
mahlemiut
Developer
Dec 1, 2009, 21:18
Changes to the input port system in 0.135u2 haven't affected this bug.
User avatar
No.05330
mahlemiut
Developer
Dec 28, 2009, 01:51
Attached a potential fix. Seems to work for Zaxxon and Ladybug. Hopefully it doesn't cause any major issues (just seems too easy for something that has been around for the past 10 releases)

Have yet to test it in MESS, will do that now.
User avatar
No.05334
etabeta
Developer
Dec 28, 2009, 10:25
your patch has been accepted