summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/inptport.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* inptport.* -> ioport.* Aaron Giles2011-06-281-4923/+0
| | | | Plus fix headers of device.*
* Fixed PORT_CONDITION to look relative to device (no whatsnew) Miodrag Milanovic2011-06-221-17/+19
|
* Death by static initialization order. Fixed declaration order at the Aaron Giles2011-06-201-5/+2
| | | | | | | top of input.c. Removed default_seq since all uses of it are covered by is_default() and set_default().
* inptport: Disable the default sequence recognition for now. [O. Galibert] Olivier Galibert2011-06-101-1/+2
| | | | | | Aaron, is that something not really implemented yet, or a remnant of the previous input system? The rest of the code is pretty much not able to cope with ITEM_ID_SEQ_DEFAULT, and disabling the recognition seems to just work.
* fixed building with msvc smf-2011-06-071-1/+1
|
* Cleanups and version bumpmame0142u5 Angelo Salese2011-06-051-1/+1
|
* inpttype: fix lifetime error (nwn) Olivier Galibert2011-06-051-1/+1
|
* (Finally found the time to finish this....) Aaron Giles2011-05-301-183/+126
| | | | | | | | | | | | | | | | | | | | | | | | Low-level input upgrade. Classes now exist for input_codes, input_items, input_devices, and input_seqs. Also created an input_manager class to hold machine-global state and made it accessible via machine.input(). Expanded the device index range (0-255, up from 0-16), and the OSD can now specify the device index explicitly if they can better keep the indexes from varying run-to-run. [Aaron Giles] Note that I've built and run SDL on Windows, but not all the code paths were exercised. If you use mice/joysticks extensively double-check them to be sure it all still works as expected. This is mainly an OSD and core change. The only thing impacting drivers is if they query for specific keys for debugging. The following S&Rs took care of most of that: S: input_code_pressed( *)\(( *)([^, ]+) *, * R: \3\.input\(\)\.code_pressed\1\(\2 S: input_code_pressed_once( *)\(( *)([^, ]+) *, * R: \3\.input\(\)\.code_pressed_once\1\(\2
* inptport.c - Keyboard chars initialization fix [Tom Clayton] Miodrag Milanovic2011-05-251-0/+1
|
* Cleanups and version bumpmame0142u4 Angelo Salese2011-05-241-2/+2
|
* Changed input read/write and crosshair callbacks into delegates. Aaron Giles2011-05-111-20/+39
| | | | | Changed signature for callbacks to take an input_field_config reference instead of pointer.
* Switch input ports to use function-based constructors instead of tokens. Aaron Giles2011-05-101-1031/+286
| | | | | | | | | Remove the old tokenizing helpers. Add basic classes for ports, fields, settings, and dip locations as a first step. These will be fully cleaned up later. Added machine() method to field to hide all the necessary indirection. Changed custom/changed handlers into generic read/write handlers, and added wrappers to convert them to device read/write lines. [Aaron Giles]
* Attach gamedrv's input ports to the driver_device, so that there's Aaron Giles2011-05-051-10/+1
| | | | | no longer anything special about how they are processed. Removed logic that handled the game inputs as a special case.
* Switch to using delegates for some callbacks: Aaron Giles2011-04-271-4/+4
| | | | | | | | | | | | - non-device timer callbacks - machine state changing callbacks - configuration callbacks - per-screen VBLANK callbacks - DRC backend callbacks For the timer case only, I added wrappers for the old-style functions. Over time, drivers should switch to device timers instead, reducing the number of timers that are directly allocated through the scheduler.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing modern devices and the legacy wrappers to work in this environment. This in general greatly simplifies writing a modern device. [Aaron Giles] General notes: * some more cleanup probably needs to happen behind this change, but I needed to get it in before the next device modernization or import from MESS :) * new template function device_creator which automatically defines the static function that creates the device; use this instead of creating a static_alloc_device_config function * added device_stop() method which is called at around the time the previous device_t's destructor was called; if you auto_free anything, do it here because the machine is gone when the destructor is called * changed the static_set_* calls to pass a device_t & instead of a device_config * * for many devices, the static config structure member names over- lapped the device's names for devcb_* functions; in these cases the members in the interface were renamed to have a _cb suffix * changed the driver_enumerator to only cache 100 machine_configs because caching them all took a ton of memory; fortunately this implementation detail is completely hidden behind the driver_enumerator interface * got rid of the macros for creating derived classes; doing it manually is now clean enough that it isn't worth hiding the details in a macro
* Privatized most of the m_machine pointers in the system to prevent Aaron Giles2011-04-191-3/+3
| | | | direct use.
* Move overridable device->rom_region(), device->machine_config_additions(), and Aaron Giles2011-03-301-1/+2
| | | | | device->input_ports() to protected methods. Added non-virtual wrappers around them.
* BIG update. Aaron Giles2011-03-291-241/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove redundant machine items from address_space and device_t. Neither machine nor m_machine are directly accessible anymore. Instead a new getter machine() is available which returns a machine reference. So: space->machine->xxx ==> space->machine().xxx device->machine->yyy ==> device->machine().yyy Globally changed all running_machine pointers to running_machine references. Any function/method that takes a running_machine takes it as a required parameter (1 or 2 exceptions). Being consistent here gets rid of a lot of odd &machine or *machine, but it does mean a very large bulk change across the project. Structs which have a running_machine * now have that variable renamed to m_machine, and now have a shiny new machine() method that works like the space and device methods above. Since most of these are things that should eventually be devices anyway, consider this a step in that direction. 98% of the update was done with regex searches. The changes are architected such that the compiler will catch the remaining errors: // find things that use an embedded machine directly and replace // with a machine() getter call S: ->machine-> R: ->machine\(\)\. // do the same if via a reference S: \.machine-> R: \.machine\(\)\. // convert function parameters to running_machine & S: running_machine \*machine([^;]) R: running_machine \&machine\1 // replace machine-> with machine. S: machine-> R: machine\. // replace &machine() with machine() S: \&([()->a-z0-9_]+machine\(\)) R: \1 // sanity check: look for this used as a cast (running_machine &) // and change to this: *(running_machine *)
* Cleanup of machine.h. Shuffled some fields around, and moved several Aaron Giles2011-03-281-3/+3
| | | | | | | | | | | | | to private member variables with accessors: machine->m_respool ==> machine->respool() machine->config ==> machine->config() machine->gamedrv ==> machine->system() machine->m_regionlist ==> machine->first_region() machine->sample_rate ==> machine->sample_rate() Also converted internal lists to use simple_list.
* Cleanups and version bump.mame0141u4 Aaron Giles2011-03-251-12/+12
|
* Added possibility of altering default input port setting for devices. ↵ Miodrag Milanovic2011-03-161-0/+26
| | | | [Miodrag Milanovic]
* inptport: Add existence and used bits interface for automatic controller ↵ Olivier Galibert2011-03-051-1/+52
| | | | adaptation [O. Galibert]
* Converted core_options to a class. Removed a bunch of marginal Aaron Giles2011-03-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functionality in favor of alternate mechanisms. Errors are now reported via an astring rather than via callbacks. Every option must now specify a type (command, integer, float, string, boolean, etc). Command behavior has changed so that only one command is permitted. [Aaron Giles] Changed fileio system to accept just a raw searchpath instead of an options/option name combination. [Aaron Giles] Created emu_options class dervied from core_options which wraps core emulator options. Added mechanisms to cleanly change the system name and add/remove system-specific options, versus the old way using callbacks. Also added read accessors for all the options, to ensure consistency in how parameters are handled. Changed most core systems to access emu_options instead of core_options. Also changed machine->options() to return emu_options. [Aaron Giles] Created cli_options class derived from emu_options which adds the command-line specific options. Updated clifront code to leverage the new class and the new core behaviors. cli_execute() now accepts a cli_options object when called. [Aaron Giles] Updated both SDL and Windows to have their own options classes, derived from cli_options, which add the OSD-specific options on top of everything else. Added accessors for all the options so that queries are strongly typed and simplified. [Aaron Giles] Out of whatsnew: I've surely screwed up some stuff, though I have smoke tested a bunch of things. Let me know if you hit anything odd. Also I know this change will impact the WINUI stuff, please let me know if there are issues. All the functionality necessary should still be present. If it's not obvious, please talk to me before adding stuff to the core_options class.
* Removed unnecessary machine parameter from device-specific input_port_read. ↵ Curt Coder2011-03-021-3/+3
| | | | [Curt Coder]
* Cleanups and version bump.mame0141u3 Aaron Giles2011-02-281-2/+2
|
* Added overloaded input_port_read() for reading device owned input ports. ↵ Curt Coder2011-02-251-0/+15
| | | | [Curt Coder]
* core: Make DEVICE_SELF work in ports. [O. Galibert] Olivier Galibert2011-02-231-0/+14
|
* Input ports can now be added to device, names are formed as sub tags from ↵ Miodrag Milanovic2011-02-131-10/+26
| | | | parent device tag. [Miodrag Milanovic]
* mame_file is now emu_file and is a class. It is required Aaron Giles2011-02-121-33/+34
| | | | | | | | | | | | | | | | | | | | | | | | to pass a core_options object to the constructor, along with a search path. This required pushing either a running_machine or a core_options through some code that wasn't previously ready to handle it. emu_files can be reused over multiple open/close sessions, and a lot of core code cleaned up nicely as things were converted to them. Also created a file_enumerator class for iterating over files in a searchpath. This replaces the old mame_openpath functions. Changed machine->options() to return a reference. Removed public nvram_open() and fixed jchan/kaneko16 to stop directly saving NVRAM. Removed most of the mame_options() calls; this will soon go away entirely, so don't add any more. Added core_options to device_validity_check() so they can be used to validate things.
* Move generic templates from emucore.h to emutempl.h. Aaron Giles2011-02-071-1/+1
| | | | | | Normalize the tagged_list template to wrap a regular standard_list and have similar semantics. Updated a few direct callers to handle the changes.
* As promised, the bulk update of timer calls: Aaron Giles2011-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timer_adjust_oneshot(t,...) => t->adjust(...) timer_adjust_periodic(t,...) => t->adjust(...) timer_reset(t,...) => t->reset(...) timer_enable(t,...) => t->enable(...) timer_enabled(t) => t->enabled() timer_get_param(t) => t->param() timer_get_ptr(t) => t->ptr() timer_set_param(t,...) => t->set_param(...) timer_set_ptr(t) => t->set_ptr(...) timer_timeelapsed(t) => t->elapsed() timer_timeleft(t) => t->remaining() timer_starttime(t) => t->start() timer_firetime(t) => t->expire() Also remove some stray legacy cpuexec* macros that were lurking in schedule.h): cpuexec_describe_context(m) => m->describe_context() cpuexec_boost_interleave(m,...) => m->scheduler().boot_interleave(...) cpuexec_trigger(m,...) => m->scheduler().trigger(...) cpuexec_triggertime(m,...) => m->scheduler().trigger(...) Specific regex'es used: timer_adjust_oneshot( *)\(( *)([^,;]+), * \3->adjust\1\(\2 timer_adjust_periodic( *)\(( *)([^,;]+), * \3->adjust\1\(\2 (->adjust.*), *0( *)\) \1\2\) timer_reset( *)\(( *)([^,;]+), * \3->reset\1\(\2 (->reset *\(.*)attotime::never \1 timer_enable( *)\(( *)([^,;]+), * \3->enable\1\(\2 timer_enabled( *)\(( *)([^,;)]+)\) \3->enabled\1\(\2\) timer_get_param( *)\(( *)([^,;)]+)\) \3->param\1\(\2\) timer_get_ptr( *)\(( *)([^,;)]+)\) \3->ptr\1\(\2\) timer_timeelapsed( *)\(( *)([^,;)]+)\) \3->elapsed\1\(\2\) timer_timeleft( *)\(( *)([^,;)]+)\) \3->remaining\1\(\2\) timer_starttime( *)\(( *)([^,;)]+)\) \3->start\1\(\2\) timer_firetime( *)\(( *)([^,;)]+)\) \3->expire\1\(\2\) timer_set_param( *)\(( *)([^,;]+), * \3->set_param\1\(\2 timer_set_ptr( *)\(( *)([^,;]+), * \3->set_ptr\1\(\2 cpuexec_describe_context( *)\(( *)([^,;)]+)\) \3->describe_context\1\(\2\) \&m_machine->describe_context m_machine.describe_context cpuexec_boost_interleave( *)\(( *)([^,;]+), * \3->scheduler().boost_interleave\1\(\2 cpuexec_trigger( *)\(( *)([^,;]+), * \3->scheduler().trigger\1\(\2 cpuexec_triggertime( *)\(( *)([^,;]+), * \3->scheduler().trigger\1\(\2
* Fix build break from last checkin. Aaron Giles2011-02-061-2/+2
| | | | | | | | | | | | | | | | | Also replace timer_get_time() with machine->time() 1. Main conversion timer_get_time( *)\( *([^)]+) *\) \2->time\1() 2. Cleanup #1 &machine->time machine.time 3. Cleanup #2 &m_machine->time m_machine.time
* Convert emu_timers to objects. Move implementation and management of Aaron Giles2011-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timers into the scheduler. Retain TIMER devices as a separate wrapper in timer.c/.h. Inline wrappers are currently provided for all timer operations; a future update will bulk clean these up. Rather than using macros which hide generation of a string-ified name for callback functions, the new methods require passing both a function pointer plus a name string. A new macro FUNC() can be used to output both, and another macro MFUNC() can be used to output a stub-wrapped class member as a callback. Also added a time() method on the machine, so that machine->time() gives the current emulated time. A wrapper for timer_get_time is currently provided but will be bulk replaced in the future. For this update, convert all classic timer_alloc, timer_set, timer_pulse, and timer_call_after_resynch calls into method calls on the scheduler. For new device timers, added methods to the device_t class that make creating and managing these much simpler. Modern devices were updated to use these. Here are the regexes used; some manual cleanup (compiler-caught) will be needed since regex doesn't handle nested parentheses cleanly 1. Convert timer_call_after_resynch calls timer_call_after_resynch( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().synchronize\1\(\2FUNC(\6), \5, \4\) 2. Clean up trailing 0, NULL parameters (synchronize[^;]+), 0, NULL\) \1) 3. Clean up trailing NULL parameters (synchronize[^;]+), NULL\) \1) 4. Clean up completely empty parameter lists synchronize\(FUNC\(NULL\)\) synchronize() 5. Convert timer_set calls timer_set( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_set\1\(\2\4, FUNC(\7), \6, \5\) 6. Clean up trailing 0, NULL parameters (timer_set[^;]+), 0, NULL\) \1) 7. Clean up trailing NULL parameters (timer_set[^;]+), NULL\) \1) 8. Convert timer_set calls timer_pulse( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_pulse\1\(\2\4, FUNC(\7), \6, \5\) 9. Clean up trailing 0, NULL parameters (timer_pulse[^;]+), 0, NULL\) \1) 10. Clean up trailing NULL parameters (timer_pulse[^;]+), NULL\) \1) 11. Convert timer_alloc calls timer_alloc( *)\(( *)([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_alloc\1\(\2FUNC(\4), \5\) 12. Clean up trailing NULL parameters (timer_alloc[^;]+), NULL\) \1) 13. Clean up trailing 0 parameters (timer_alloc[^;]+), 0\) \1) 14. Fix oddities introduced \&m_machine->scheduler() m_machine.scheduler()
* Converted attotime to a class, with proper operators. Removed old Aaron Giles2011-02-031-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | global functions which are now superceded by the operators and methods on the class. [Aaron Giles] Required mappings are: attotime_make(a,b) => attotime(a,b) attotime_to_double(t) => t.as_double() double_to_attotime(d) => attotime::from_double(d) attotime_to_attoseconds(t) => t.as_attoseconds() attotime_to_ticks(t,f) => t.as_ticks(f) ticks_to_attotime(t,f) => attotime::from_ticks(t,f) attotime_add(a,b) => a + b attotime_add_attoseconds(a,b) => a + attotime(0, b) attotime_sub(a,b) => a - b attotime_sub_attoseconds(a,b) => a - attotime(0, b) attotime_compare(a,b) == 0 => a == b attotime_compare(a,b) != 0 => a != b attotime_compare(a,b) < 0 => a < b attotime_compare(a,b) <= 0 => a <= b attotime_compare(a,b) > 0 => a > b attotime_compare(a,b) >= 0 => a >= b attotime_mul(a,f) => a * f attotime_div(a,f) => a / f attotime_min(a,b) => min(a,b) attotime_max(a,b) => max(a,b) attotime_is_never(t) => t.is_never() attotime_string(t,p) => t.as_string(p) In addition, some existing #defines still exist but will go away: attotime_zero => attotime::zero attotime_never => attotime::never ATTOTIME_IN_SEC(s) => attotime::from_seconds(s) ATTOTIME_IN_MSEC(m) => attotime::from_msec(m) ATTOTIME_IN_USEC(u) => attotime::from_usec(u) ATTOTIME_IN_NSEC(n) => attotime::from_nsec(n) ATTOTIME_IN_HZ(h) => attotime::from_hz(h)
* > From: atari_ace@frontier.com Aaron Giles2011-01-271-74/+90
| | | | | | | | | | | | | | | | | | | | | > To: submit@mamedev.org > CC: atariace@hotmail.com > Subject: [patch] Cleanup natural keyboard support > Date: Tue, 14 Dec 2010 07:20:08 -0800 > > Hi mamedev, > > inputx_setup_natural_keyboard sets callbacks from the core into the > drivers which lack machine or device pointers. This means that > drivers that use this api can't completely place their state in > non-global storage. This patch fixes that by adding the machine > parameter to the callbacks, and places the implementation data into > input_port_private as well. > > This really only affects MESS, since nothing in MAME uses this api. > > ~aa
* Fixed crash for PC based MAME drivers (no whatsnew) Miodrag Milanovic2011-01-231-1/+1
|
* 720 - added Driver Configuration option to allow the controls to be set to ↵ Derrick Renaud2011-01-231-1/+1
| | | | | | Real 720 Controller Input; fake joystick; or fake spinner. It defaults to fake spinner for mouse/spinner use. [Derrick Renaud] Changed the Analog Controls menu to only list controls selected in the Driver Configuration. [Derrick Renaud]
* - Moved IPT_KEYBOARD -> IPT_KEYPAD for MAME systems not using full ↵ Miodrag Milanovic2011-01-051-3/+0
| | | | | keyboard_interrupt (no whatsnew) - Removed not needed ifdefs from pckeybrd.c and inptport.c
* mame_rand() -> machine->rand() Aaron Giles2010-12-311-1/+1
|
* Split the screen device into a separate module. Aaron Giles2010-12-021-1/+1
| | | | | Converted global video routines into a video_manager. Moved video manager initialization earlier in startup.
* Create new class osd_interface to house OSD callbacks. Added new Aaron Giles2010-10-211-1/+1
| | | | | | | | | module osdepend.c with default empty implementations. Changed mame_execute() and cli_execute() to accept a reference to an osd_interface which is provided by the caller. Updated SDL and Windows OSD to create an osd_interface-derived class and moved their OSD callbacks to be members.
* Converted render.c objects into C++ objects. Updated all callers. Aaron Giles2010-10-131-1/+2
|
* I had originally wanted to convert the profiler to use scopes (e.g., Aaron Giles2010-08-211-2/+2
| | | | | | | | | | | | | | | | | create a stack class that started the profiler in the constructor and stopped it in the destructor). Sadly, doing that causes gcc to call out to hook up the unwind chain, and this tanks performance quite badly, even when the profiler is off. Since I had already class-ified profiler.c, I decided to keep the old way of doing things but wrap it in the newer classes. So at least it wasn't a complete waste of my time. Search & replace: profiler_mark_start -> g_profiler.start profiler_mark_end -> g_profiler.end
* Haze: Made "Input file is for..." warning non-fatal (it crashed MAME before, ↵ Angelo Salese2010-08-211-1/+1
| | | | | | | | | | and it's not really fatal anyway, sets can be renamed, and some inps are compatible across sets) in this case, I've recoreded an init inp for the igrosoft games, which works with all sets with the same service menu.. it plays fine on them, but because of this fatalerror MAME crashes when i attempt to use it with a set other than the one i recorded with which isn't good behavior I see no issue with it.. mame shouldn't crash in that situation, and sometimes you want that behavior. (not worth mentioning)
* Split mame.c into mame.c and machine.c, the latter containing the Aaron Giles2010-06-301-40/+40
| | | | | | | | | | | | | | | | | | | running_machine definition and implementation. Moved global machine-level operations and accessors into methods on the running_machine class. For the most part, this doesn't affect drivers except for a few occasional bits: mame_get_phase() == machine->phase() add_reset_callback() == machine->add_notifier(MACHINE_NOTIFY_RESET, ...) add_exit_callback() == machine->add_notifier(MACHINE_NOTIFY_EXIT, ...) mame_get_base_datetime() == machine->base_datetime() mame_get_current_datetime() == machine->current_datetime() Cleaned up the region_info class, removing most global region accessors except for memory_region() and memory_region_length(). Again, this doesn't generally affect drivers.
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance as a result of this change. Do not panic; report issues to the list in the short term and I will look into them. There are probably also some details I forgot to mention. Please ask questions if anything is not clear. NOTE: This is a major internal change to the way devices are handled in MAME. There is a small impact on drivers, but the bulk of the changes are to the devices themselves. Full documentation on the new device handling is in progress at http://mamedev.org/devwiki/index.php/MAME_Device_Basics Defined two new casting helpers: [Aaron Giles] downcast<type>(value) should be used for safe and efficient downcasting from a base class to a derived class. It wraps static_cast<> by adding an assert that a matching dynamic_cast<> returns the same result in debug builds. crosscast<type>(value) should be used for safe casting from one type to another in multiple inheritance scenarios. It compiles to a dynamic_cast<> plus an assert on the result. Since it does not optimize down to static_cast<>, you should prefer downcast<> over crosscast<> when you can. Redefined running_device to be a proper C++ class (now called device_t). Same for device_config (still called device_config). All devices and device_configs must now be derived from these base classes. This means each device type now has a pair of its own unique classes that describe the device. Drivers are encouraged to use the specific device types instead of the generic running_device or device_t classes. Drivers that have a state class defined in their header file are encouraged to use initializers off the constructor to locate devices. [Aaron Giles] Removed the following fields from the device and device configuration classes as they never were necessary or provided any use: device class, device family, source file, version, credits. [Aaron Giles] Added templatized variant of machine->device() which performs a downcast as part of the device fetch. Thus machine->device<timer_device>("timer") will locate a device named "timer", downcast it to a timer_device, and assert if the downcast fails. [Aaron Giles] Removed most publically accessible members of running_device/device_t in favor of inline accessor functions. The only remaining public member is machine. Thus all references to device->type are now device->type(), etc. [Aaron Giles] Created a number of device interface classes which are designed to be mix- ins for the device classes, providing specific extended functionality and information. There are standard interface classes for sound, execution, state, nvram, memory, and disassembly. Devices can opt into 0 or more of these classes. [Aaron Giles] Converted the classic CPU device to a standard device that uses the execution, state, memory, and disassembly interfaces. Used this new class (cpu_device) to implement the existing CPU device interface. In the future it will be possible to convert each CPU core to its own device type, but for now they are still all CPU devices with a cpu_type() that specifies exactly which kind of CPU. [Aaron Giles] Created a new header devlegcy.h which wraps the old device interface using some special template classes. To use these with an existing device, simply remove from the device header the DEVICE_GET_INFO() declaration and the #define mapping the ALL_CAPS name to the DEVICE_GET_INFO. In their place #include "devlegcy.h" and use the DECLARE_LEGACY_DEVICE() macro. In addition, there is a DECLARE_LEGACY_SOUND_DEVICE() macro for wrapping existing sound devices into new-style devices, and a DECLARE_LEGACY_NVRAM_DEVICE() for wrapping NVRAM devices. Also moved the token and inline_config members to the legacy device class, as these are not used in modern devices. [Aaron Giles] Converted the standard base devices (VIDEO_SCREEN, SPEAKER, and TIMER) from legacy devices to the new C++ style. Also renamed VIDEO_SCREEN to simply SCREEN. The various global functions that were previously used to access information or modify the state of these devices are now replaced by methods on the device classes. Specifically: video_screen_configure() == screen->configure() video_screen_set_visarea() == screen->set_visible_area() video_screen_update_partial() == screen->update_partial() video_screen_update_now() == screen->update_now() video_screen_get_vpos() == screen->vpos() video_screen_get_hpos() == screen->hpos() video_screen_get_vblank() == screen->vblank() video_screen_get_hblank() == screen->hblank() video_screen_get_width() == screen->width() video_screen_get_height() == screen->height() video_screen_get_visible_area() == screen->visible_area() video_screen_get_time_until_pos() == screen->time_until_pos() video_screen_get_time_until_vblank_start() == screen->time_until_vblank_start() video_screen_get_time_until_vblank_end() == screen->time_until_vblank_end() video_screen_get_time_until_update() == screen->time_until_update() video_screen_get_scan_period() == screen->scan_period() video_screen_get_frame_period() == screen->frame_period() video_screen_get_frame_number() == screen->frame_number() timer_device_adjust_oneshot() == timer->adjust() timer_device_adjust_periodic() == timer->adjust() timer_device_reset() == timer->reset() timer_device_enable() == timer->enable() timer_device_enabled() == timer->enabled() timer_device_get_param() == timer->param() timer_device_set_param() == timer->set_param() timer_device_get_ptr() == timer->get_ptr() timer_device_set_ptr() == timer->set_ptr() timer_device_timeelapsed() == timer->time_elapsed() timer_device_timeleft() == timer->time_left() timer_device_starttime() == timer->start_time() timer_device_firetime() == timer->fire_time() Updated all drivers that use the above functions to fetch the specific device type (timer_device or screen_device) and call the appropriate method. [Aaron Giles] Changed machine->primary_screen and the 'screen' parameter to VIDEO_UPDATE to specifically pass in a screen_device object. [Aaron Giles] Defined a new custom interface for the Z80 daisy chain. This interface behaves like the standard interfaces, and can be added to any device that implements the Z80 daisy chain behavior. Converted all existing Z80 daisy chain devices to new-style devices that inherit this interface. [Aaron Giles] Changed the way CPU state tables are built up. Previously, these were data structures defined by a CPU core which described all the registers and how to output them. This functionality is now part of the state interface and is implemented via the device_state_entry class. Updated all CPU cores which were using the old data structure to use the new form. The syntax is currently awkward, but will be cleaner for CPUs that are native new devices. [Aaron Giles] Converted the okim6295 and eeprom devices to the new model. These were necessary because they both require multiple interfaces to operate and it didn't make sense to create legacy device templates for these single cases. (okim6295 needs the sound interface and the memory interface, while eeprom requires both the nvram and memory interfaces). [Aaron Giles] Changed parameters in a few callback functions from pointers to references in situations where they are guaranteed to never be NULL. [Aaron Giles] Removed MDRV_CPU_FLAGS() which was only used for disabling a CPU. Changed it to MDRV_DEVICE_DISABLE() instead. Updated drivers. [Aaron Giles] Reorganized the token parsing for machine configurations. The core parsing code knows how to create/replace/remove devices, but all device token parsing is now handled in the device_config class, which in turn will make use of any interface classes or device-specific token handling for custom token processing. [Aaron Giles] Moved many validity checks out of validity.c and into the device interface classes. For example, address space validation is now part of the memory interface class. [Aaron Giles] Consolidated address space parameters (bus width, endianness, etc.) into a single address_space_config class. Updated all code that queried for address space parameters to use the new mechanism. [Aaron Giles]
* Increased number of coinslots to 12, and tilt inputs to 4, required by ↵ Angelo Salese2010-05-271-1/+1
| | | | in-progress gambling driver [David Haywood]
* Disable many unused variables as identifed by cppcheck. [Oliver Stöneberg] Scott Stone2010-04-231-2/+2
|
* inptport.c: fixed keyboard detection (mainly for MESS) [Fabio Priuli] Fabio Priuli2010-04-111-0/+3
|
* Added a new input type IPT_KEYPAD for MESS, to distinguish between fully ↵ Fabio Priuli2010-04-051-1/+2
| | | | featured keyboards and keypad controllers [Fabio Priuli]