intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.
For member functions, this is actually simpler/cleaner:
value = ioport("tag")->read()
For legacy functions which have a driver_data state, it goes:
value = state->ioport("tag")->read()
For other legacy functions, they need to fetch the root device:
value = machine.root_device().ioport("tag")->read()
The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.
Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:
input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)
input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)
(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->
(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->
input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)
IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
and paths consistently for devices, I/O ports, memory
regions, memory banks, and memory shares. [Aaron Giles]
NOTE: there are likely regressions lurking here, mostly
due to devices not being properly found. I have temporarily
added more logging to -verbose to help understand what's
going on. Please let me know ASAP if anything that is being
actively worked on got broken.
As before, the driver device is the root device and all
other devices are owned by it. Previously all devices
were kept in a single master list, and the hierarchy was
purely logical. With this change, each device owns its
own list of subdevices, and the hierarchy is explicitly
manifest. This means when a device is removed, all of its
subdevices are automatically removed as well.
A side effect of this is that walking the device list is
no longer simple. To address this, a new set of iterator
classes is provided, which walks the device tree in a depth
first manner. There is a general device_iterator class for
walking all devices, plus templates for a device_type_iterator
and a device_interface_iterator which are used to build
iterators for identifying only devices of a given type or
with a given interface. Typedefs for commonly-used cases
(e.g., screen_device_iterator, memory_interface_iterator)
are provided. Iterators can also provide counts, and can
perform indexed lookups.
All device name lookups are now done relative to another
device. The maching_config and running_machine classes now
have a root_device() method to get the root of the hierarchy.
The existing machine->device("name") is now equivalent to
machine->root_device().subdevice("name").
A proper and normalized device path structure is now
supported. Device names that start with a colon are
treated as absolute paths from the root device. Device
names can also use a caret (^) to refer to the owning
device. Querying the device's tag() returns the device's
full path from the root. A new method basetag() returns
just the final tag.
The new pathing system is built on top of the
device_t::subtag() method, so anyone using that will
automatically support the new pathing rules. Each device
has its own internal map to cache successful lookups so
that subsequent lookups should be very fast.
Updated every place I could find that referenced devices,
memory regions, I/O ports, memory banks and memory shares
to leverage subtag/subdevice (or siblingtag/siblingdevice
which are built on top).
Removed the device_list class, as it doesn't apply any
more. Moved some of its methods into running_machine
instead.
Simplified the device callback system since the new
pathing can describe all of the special-case devices that
were previously handled manually.
Changed the core output function callbacks to be delegates.
Completely rewrote the validity checking mechanism. The
validity checker is now a proper C++ class, and temporarily
takes over the error and warning outputs. All errors and
warnings are collected during a session, and then output in
a consistent manner, with an explicit driver and source file
listed for each one, as well as additional device and/or
I/O port contexts where appropriate. Validity checkers
should no longer explicitly output this information, just
the error, assuming that the context is provided.
Rewrote the software_list_device as a modern device, getting
rid of the software_list_config abstraction and simplifying
things.
Changed the way FLAC compiles so that it works like other
external libraries, and also compiles successfully for MSVC
builds.
* Added the possibility to press contradictory direction digital
joystick input at the same time (i.e. up-down, left-right);
* Added the possibility to set an arbitrary value for coin impulses;
* fixed a bug with loop lever routine
* fixed a bug with analog joystick routine
Various fixes in tnzs.c driver [kanikani]
* Plump Pop
- update DIPSW item (collision between each players' child)
- added DIPLOCATION
* Extermination
* Arkanoid Revenge of DOH
* Dr.Toppel
* Kageki
* Chuka Taisen
* The Newzealand Story
- added DIPLOCATION
* Kabuki Z
- fixed difficulty DIPSW (EASY and MEDIUM is reversed)
- added DIPLOCATION
* Insector X
- fixed difficulty DIPSW (based on manual)
- added DIPLOCATION
Various fixes in tmnt.c driver [kanikani]
* T.M.N.T.
- fixed visible area (garbage on each side is correct (verified on PCB))
- fixed DIPSW
- added DIPLOCATION
* Golfing Greats
- fixed inputs
- fixed DIPSW
- added DIPLOCATION
* Trigon
* Cuebrick
* M.I.A.
* Punk Shot
- fixed DIPSW
- added DIPLOCATION
* Premiere Soccer
- added DIPLOCATION
Various fixes in ninjaw.c driver [kanikani]
* Ninja Warriors
- added DIPSW notes
* Darius II
- fixed DIPSW
- fixed game description
Various fixes in twin16.c driver [kanikani]
* Majuu no Oukoku
- fixed inputs
- fixed DIPSW
- added DIPLOCATION
* Gradius II
* Hard Puncher
* M.I.A.
* Cuebrick
- fixed DIPSW
- added DIPLOCATION
Fixed DIPSW in Darius II [kanikani]
Fixed DIPSW in Ninja Ryuukenden / Ninja Gaiden [kanikani]
Fixed inputs and DIPSW in toaplan1.c, toaplan2.c, twincobr.c, wardner.c drivers [kanikani]
Various fixes in galaga.c driver [kanikani]
* Bosconian
- fixed DIPSW
- fixed DIPLOCATION
* Galaga
* Xevious
* DigDug
- fixed DIPLOCATION
Fixed DIPSW and DIPLOCATION in segas24.c driver [kanikani]
Fixed DIPSW and DIPLOCATION in segas18.c driver [kanikani]
Fixed DIPSW in segag80r.c driver [kanikani]
Fixed DIPSW in segag80v.c driver [kanikani]
Fixed DIPSW in segald.c driver [kanikani]
Fixed DIPSW in Ninjakun and Penguin-Kun Wars [kanikani]
Various fixes in dec0.c driver [kanikani]
* Heavy Barrel
- fixed DIPSW
- fixed DIPLOCATION
* Birdie Try
* Dragon Ninja
* Fighting Fantasy
* Midnight Resistance
- fixed DIPSW
* Robocop
- fixed DIPLOCATION
Fixed coinage DIPSW using Sega common setting in segaybd.c,
segaorun.c, segaxbd.c, segahang.c, segae.c, segac2.c, segas16a.c
and segas16b.c drivers [kanikani]
Fixed coinage DIPSW using Konami common setting in chqflag.c, pooyan.c
and rockrage.c drivers [kanikani]
Various fixes in sega16b.c driver [kanikani]
* Ace Attacker
- added I/O board read routine
* Dunk Shot
- fixed DIPLOCATION
* Sukeban Janshi Ryuko
- added DIPSW
* Time Scanner
- fixed DIPSW
Various fixes in sega16a.c driver [kanikani]
* Ace Attacker
- changed to use analog device
* Sukeban Janshi Ryuko
- added DIPSW
* Time Scanner
- fixed DIPSW
Fixed / added comments in ninjakd2.c driver [kanikani]
Made some video optimizations in toypop.c driver [kanikani]
Fixed inputs and DIPSW in djmain.c driver [kanikani]
Fixed DIPLOCATION in Pop'n Stage [kanikani]
out of whatsnew:
- this requires a clean compile
- a bit of history: PORT_CATEGORY is an old concept introduced in MESS when there were no PORT_CONDITIONs available in the core; it basically made specific controller inputs to appear/disappear in the "Input this system" menu depending on the controller chosen to be used. As Aaron pointed out some time ago, PORT_CONDITION was already capable to give the same result, but we kept the code in MESS because newui did not fully support PORT_CONDITION. Now that newui is gone from the main MESS tree, PORT_CATEGORY has been fully replaced by PORT_CONDITION and the 'duplicate' code can finally be removed.