summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/generic.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-290/+0
|
* lot more updated (nw) Miodrag Milanovic2015-05-111-5/+2
|
* Added dummy license headers for EMU section (nw) Miodrag Milanovic2015-05-071-0/+2
|
* Created memcard as device and removed it from machine/generic (nw) Miodrag Milanovic2014-04-171-144/+0
| | | | This should be image device instead but did not wish to change behavior for now
* Cleanups and version bumpmame0153 Miodrag Milanovic2014-04-071-1/+0
|
* Let running_machine handle nvram save/load (nw) Miodrag Milanovic2014-02-021-119/+0
|
* removed few legacy calls (nw) Miodrag Milanovic2014-02-021-5/+0
|
* Cleanups and version bumpmame0150 Miodrag Milanovic2013-09-171-1/+0
|
* removed some unused legacy functions / flagged a few more things as ↵ Oliver Stöneberg2013-08-221-2/+0
| | | | deprecated / reduced the DEPRECATED noise a bit for now nw)
* removed legacy trampoline generic_pulse_irq_line_and_vector() (nw) Oliver Stöneberg2013-07-241-2/+1
|
* removed some legacy interrupt trampolines (nw) Oliver Stöneberg2013-07-241-30/+1
|
* Cleanups and version bumpmame0149 Miodrag Milanovic2013-06-111-1/+1
|
* let's skip the extension when choosing the nvram folder name based on software Fabio Priuli2013-05-251-1/+1
|
* used parent image names so it will work for cmd parameters, also multiple ↵ Miodrag Milanovic2013-05-211-5/+22
| | | | images are supported (nw)
* Added NVRAMs for devices in software item named folder [Miodrag Milanovic] Miodrag Milanovic2013-05-211-6/+11
| | | | | out of whatsnew: This should help storing per game eeproms and other nvrams. NVRAM of root device is only stored in main folder in this case, since that is main machine nvram if any
* save state cleanup, converted state_save_register_global* into ↵ Miodrag Milanovic2013-05-081-1/+1
| | | | save_item/save_pointer (nw)
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-5/+5
|
* First pass at modernizing struct definitions. Aaron Giles2012-09-151-1/+1
|
* ioport.c C++ conversion. Mostly internal changes, with no Aaron Giles2012-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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")
* Made UI for BIOS selection where applicable, and moved info about current Miodrag Milanovic2012-04-301-2/+2
| | | system and default bios to device_t class (no whatsnew)
* Whoops, broke some stuff. Aaron Giles2012-04-101-0/+39
|
* Renamed device_irq_callback to device_irq_acknowledge_callback to Aaron Giles2012-04-101-181/+0
| | | | | | | | make its purpose clearer. Added delegate support for interrupt callbacks, and made driver_device variants of the generic interrupt helper callbacks. Did not convert existing callers yet due to logistical issues.
* modernization of some CUSTOM_INPUT's part 5 (no whatsnew) Miodrag Milanovic2012-04-091-2/+2
|
* Moved all drivers to using the audio/watchdog helpers defined in the ↵ Miodrag Milanovic2012-04-051-9/+0
| | | | driver_device base class. (no whatsnew)
* allow generic_pulse_irq_line to be longer than 1 cycle. Michaël Banaan Ananas2012-02-111-16/+16
| | | | | | | message to messdev: just change all callers: generic_pulse_irq_line(x, y); to generic_pulse_irq_line(x, y, 1);
* Clean-ups and version bumpmame0144u7 Angelo Salese2012-01-291-1/+1
|
* Fix NVRAM file naming. Aaron Giles2012-01-261-24/+16
|
* Move devices into a proper hierarchy and handle naming Aaron Giles2012-01-241-26/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Removed ugly function cpu_interrupt_enable() from the core, and updated all ↵ Angelo Salese2011-11-301-45/+0
| | | | the drivers that used it accordingly [Angelo Salese]
* Removed ugly function interrupt_enable_w from the core, and updated all the ↵ Angelo Salese2011-11-291-22/+0
| | | | | | | | | | | | | | | | drivers that used it accordingly [Angelo Salese] Fixed scratchy sound in Birdiy, unlike all other Pac-Man HW games irq mask is at $5001 instead of $5000, so fixing that fixed the sound as well [Angelo Salese] Fixed bogus irq/nmi mask bit in Yie Ar Kung-Fu (IRQ mask bit was masking BOTH lines before) [Angelo Salese] Fixed bogus irq mask to sound CPU in Syusse Oozumou [Angelo Salese] Fixed bogus irq mask bit in SNK6502 HW games (IRQ mask bit was masking BOTH lines before) [Angelo Salese] Marked Truco Clemente as GNW since it never really worked (coin chutes stops working after one play), nw Out of whatsnew: And then I've realized that there's also cpu_interrupt_enable() function, another 19 instances to kill ... -.-"
* Added generic helper read/write members to the driver_device base class. Aaron Giles2011-11-221-0/+9
| | | | Updated zodiack/zerozone to use them, removing the trampolines.
* Fix for handling nvram of subdevices, currently replace : with _ (no whatsnew) Miodrag Milanovic2011-11-041-2/+3
|
* nvram devices each have their own file. smf-2011-10-231-36/+62
|
* Clean-ups and version bumpmame0143u1 Angelo Salese2011-07-111-1/+1
|
* reduced number of cases. smf-2011-07-081-6/+2
|
* Fix nvram filename for non-biosed sets (no whatsnew) Miodrag Milanovic2011-07-081-1/+5
|
* nvram - in case of multiple bioses, system nvram will be saved in [Miodrag ↵ Miodrag Milanovic2011-07-061-2/+19
| | | | | | Milanovic] form systemname_biosnum.nv in cases when non-default bios is used. For default bios selection all stay the same.
* Changed input read/write and crosshair callbacks into delegates. Aaron Giles2011-05-111-1/+1
| | | | | 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-1/+1
| | | | | | | | | 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]
* Switch to using delegates for some callbacks: Aaron Giles2011-04-271-3/+3
| | | | | | | | | | | | - 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename state_manager -> save_manager since the term "state" is overloaded. Aaron Giles2011-04-201-4/+4
|
* Remove redundant item cpu from address_space, in favor of Aaron Giles2011-03-291-2/+2
| | | | | | | | | | | space->device(). S: space->cpu-> R: space->device\(\)\. S: space->cpu R: \&space->device\(\)
* BIG update. Aaron Giles2011-03-291-74/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15/+15
| | | | | | | | | | | | | 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.
* Added device_t::memory() to fetch a reference to the memory interface, Aaron Giles2011-03-271-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or assert if not present. Split address_space::install_[legacy_]handler into install_[legacy_]read_handler, install_[legacy_]write_handler, and install_[legacy_]readwrite_handler. Added variants of address_space handler installers which don't take mirror or mask parameters, since this is by far the most common case. Deprecated API cleanup. Simple search & replace: cpu_suspend ==> device_suspend cpu_resume ==> device_resume cpu_yield ==> device_yield cpu_spin ==> device_spin cpu_spinuntil_trigger ==> device_spin_until_trigger cpu_spinuntil_time ==> device_spin_until_time cpu_spinuntil_int ==> device_spin_until_interrupt cpu_eat_cycles ==> device_eat_cycles cpu_adjust_icount ==> device_adjust_icount cpu_triggerint ==> device_triggerint cpu_set_input_line ==> device_set_input_line cpu_set_input_line_vector ==> device_set_input_line_vector cpu_set_input_line_and_vector ==> device_set_input_line_and_vector cpu_set_irq_callback ==> device_set_irq_callback More complex changes: device_memory(device) ==> device->memory() device_get_space(device, spacenum) ==> device->memory().space(spacenum) cpu_get_address_space(cpu, spacenum) ==> cpu->memory().space(spacenum) cputag_get_address_space(mach, tag, spacenum) ==> mach->device("tag")->memory().space(spacenum) cputag_get_clock(mach, tag) ==> mach->device("tag")->unscaled_clock() cputag_set_clock(mach, tag, hz) ==> mach->device("tag")->set_unscaled_clock(hz) Some regex'es for the more prevalent cases above: S: cpu_get_address_space( *)\(( *)([^,]+)( *), * R: \3->memory().space\1\(\2 S: cputag_get_address_space( *)\(( *)([^,]+)( *),( *)([^,]+)( *), * R: \3->device\1\(\2\6\7\)->memory().space\1\(\2 S: cputag_get_clock( *)\(( *)([^,]+)( *),( *)([^ )]+) *\) R: \3->device\1\(\2\6\7\)->unscaled_clock\(\)
* Converted core_options to a class. Removed a bunch of marginal Aaron Giles2011-03-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* mame_file is now emu_file and is a class. It is required Aaron Giles2011-02-121-52/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Get rid of state_save_register_device_* macros in favor of direct Aaron Giles2011-02-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calls on the device object. Regex used: state_save_register_device_item( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\6\),\5\4\7\) state_save_register_device_item_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\6\),\5\4\7\) state_save_register_device_item_2d_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\6\),\5\4\7\) state_save_register_device_item_bitmap( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\*\6\),\5\4\7\) state_save_register_device_item_pointer( *)\(( *)([^,]+), *([^,]+),( *)([^,]+), *([^ )]+)( *)\) \3->save_pointer\1\(\2NAME\(\6\),\5\7,\5\4\8\) this->save_ save_ (save_item[^;]+), *0( *)\); \1\2\); (save_pointer[^;]+), *0( *)\); \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