Commit Graph

23 Commits

Author SHA1 Message Date
Miodrag Milanovic
643d0e9d92 Clean-ups and version bump 2012-05-21 06:24:12 +00:00
Miodrag Milanovic
acc1e50723 cleanup (nw) 2012-05-10 14:53:40 +00:00
Miodrag Milanovic
a7ae8990b5 Fixed natural keyboard issues in ioport (no whatsnew) 2012-05-10 14:36:06 +00:00
Miodrag Milanovic
0238c610f7 Clean-ups and version bump 2012-05-07 06:57:50 +00:00
Aaron Giles
0a119e20fe Fix issue where changes to the default input config did not
apply to the game-specific config.

Also fixed none/default toggle for game-specific configs.
2012-05-07 06:38:35 +00:00
Aaron Giles
3c92a3c17c Fix some analog control issues due to incorrect assumption
that scale factors were INT32's not INT64's.

Also explicitly use ioport_value for lookup tables instead
of UINT32.
2012-05-05 20:08:22 +00:00
Aaron Giles
4553555132 Fix saving changes to inputs, player mappings, and a couple
of odd joystick problems.
2012-05-04 19:24:01 +00:00
Aaron Giles
26d4fc6b3a Fix issue where initial values are not set up correctly. 2012-05-04 12:45:20 +00:00
Aaron Giles
2a88e54278 ioport.c C++ conversion. Mostly internal changes, with no
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")
2012-05-03 09:00:08 +00:00
Angelo Salese
ded30e907e Clean-ups and version bump 2012-04-22 14:10:44 +00:00
Aaron Giles
f3de08a9f8 Created ioport_manager and moved the port list to it.
Removed global port lookups, now all lookups must be
done through device_t::ioport().
2012-04-22 05:07:46 +00:00
Aaron Giles
a4d175be28 Guess at a fix for clickable artwork. 2012-02-05 05:15:21 +00:00
Aaron Giles
ed0207f126 Move devices into a proper hierarchy and handle naming
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.
2012-01-24 20:18:55 +00:00
Nathan Woods
cdd0600db4 Added hot/cold attributes. Made the MAME executable 1% smaller by using the
cold attribute on setup functions
2011-11-06 11:06:58 +00:00
Alex W. Jackson
741649b99c Put DEF_STR( International ) back, it's used in MESS (no whatsnew) 2011-10-31 22:33:10 +00:00
Alex W. Jackson
44cb1ec614 Added some common country and language names to the default strings, and removed some unused and/or redundant strings [Alex Jackson] 2011-10-31 22:04:58 +00:00
Yasuhiro Ogawa
eb1f227cd0 fix listing of switches used by gambling games [kanikani] 2011-10-24 12:09:20 +00:00
Angelo Salese
e6b9af5ec6 Clean-ups and version bump 2011-10-23 15:06:49 +00:00
Angelo Salese
43a482c6eb Made some fixes/additions to the input system [kanikani]
* 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]
2011-10-23 13:29:16 +00:00
Fabio Priuli
b081e27161 removed support for PORT_CATEGORY from the core, since PORT_CONDITION is enough to deal with removable controllers in MESS [Fabio Priuli]
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.
2011-08-17 06:08:33 +00:00
smf-
8154fdc70d hack for building with visual studio, to go with the hack for gcc 2011-07-12 11:42:15 +00:00
Miodrag Milanovic
f5cfbe977d Added default port values support for slot devices (no whatsnew) 2011-06-29 14:31:07 +00:00
Aaron Giles
6bd42bd8df inptport.* -> ioport.*
Plus fix headers of device.*
2011-06-28 19:38:11 +00:00