summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/config.c
Commit message (Collapse)AuthorAgeFilesLines
* Moved eminline and related files into /src/osd since it's system related (nw) Miodrag Milanovic2014-04-161-1/+1
| | | | | | | | Moved delegates into /src/lib/util to enable usage of delegates in other project parts Moved mame_printf_* calls into /src/osd/osdcore.c and renamed them to osd_printf_* Changed mess.mak to display compilation of ymmu100.ppm nicely
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-5/+5
|
* First pass at modernizing struct definitions. Aaron Giles2012-09-151-3/+2
|
* Move driver list/enumerator to new file drivenum.c/.h. Aaron Giles2012-04-061-0/+1
| | | | Move game_driver definition and constants to new header gamedrv.h.
* Switch to using delegates for some callbacks: Aaron Giles2011-04-271-9/+9
| | | | | | | | | | | | - 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.
* (Big tangle of changes that all happened as I was looking into the ROM Aaron Giles2011-04-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loader rewrite, which is still in progress....) Replaced mamedriv.c with a new driver list mechanism that is generated by the build tools. The emulator core now expects the presence of a file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of driver names, one per line. C and C++ comments are still permitted. This file is parsed by a new build tool makelist which extracts the driver names, sorts them, and generates a file called drivlist.c, which is consumed by the core. [Aaron Giles] Added new osdcore function osd_malloc_array() which is identical to osd_malloc() but obviously hints that the underlying allocation is for an array. Updated all callers to use the appropriate form. Modified the Windows allocator to only use guard pages for array-style allocations, allowing us to enable them once again in debug builds. [Aaron Giles] Created new static class driver_list to wrap accesses to the list of available drivers. Improved speed of driver lookups by relying on the presorting done by makelist. [Aaron Giles] Created helper class driver_enumerator as a helper for iterating through the list of drivers. This class supports basic filtering and iteration, and also serves as a temporary cache of machine_configs. [Aaron Giles] Created cli_frontend object to wrap all the CLI handling code in clifront.c. Updated/simplified all the code to take advantage of the driver_enumerator. [Aaron Giles] Created media_auditor object to wrap all the auditing functions in audit.c. Updated all users to the new interface. Note that the new auditing mechanism is slightly out of sync with the romload code in terms of finding ROMs owned by devices, so it may mis-report some issues until the new ROM loading code is in. [Aaron Giles] Added concept of a per-device searchpath. For most devices, their searchpath is just the short name of the device. For driver_devices, the searchpath is driver[;parent[;bios]]. This searchpath will eventually be used by the rom loader to find ROMs. For now it is used by the media auditor only. [Aaron Giles] Created info_xml_creator object to wrap all the info generation functions in info.c. Converted the file to C++ and cleaned up the input processing code. [Aaron Giles] (not for whatsnew ... Known issues: auditing of CHDs appears busted, and debug builds report unfreed memory if you use the built-in game picker)
* BIG update. Aaron Giles2011-03-291-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+8
| | | | | | | | | | | | | 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.
* Converted core_options to a class. Removed a bunch of marginal Aaron Giles2011-03-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-34/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Not Worth Mentioning - uimenu.c - changed event to menu_event to not ↵ Derrick Renaud2011-01-241-2/+2
| | | | conflict with the C++ keyword. Can't monitor the event variable in Visual Studio due to the conflict.
* Split mame.c into mame.c and machine.c, the latter containing the Aaron Giles2010-06-301-3/+3
| | | | | | | | | | | | | | | | | | | 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.
* - removed MESS dependency from config.c Miodrag Milanovic2010-06-171-4/+0
| | | | | | | | - moved image legacy device implementation to devimage.c - created image.c implementation with initialization of devices/configuration for image devices, used those calls from mame.c - some minor cleanup of legacy device and initial implementation of some calls (no whatsnew for now, this is just for log,will put more info on final commit)
* Added the mameconfig version to the -listxml output [Oliver Stoneberg] Phil Bennett2010-01-111-8/+0
| | | | | | | | | | ---------- Forwarded message ---------- From: Oliver Stöneberg <oliverst@online.de> Date: Thu, Dec 31, 2009 at 2:45 PM Subject: mameconfig version in -listxml To: submit@mamedev.org This patch adds the mameconfig version to the -listxml output
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Created new central header "emu.h"; this should be included by pretty much any driver or device as the first include. This file in turn includes pretty much everything a driver or device will need, minus any other devices it references. Note that emu.h should *never* be included by another header file. - Updated all files in the core (src/emu) to use emu.h. - Removed a ton of redundant and poorly-tracked header includes from within other header files. - Temporarily changed driver.h to map to emu.h until we update files outside of the core. Added class wrapper around tagmap so it can be directly included and accessed within objects that need it. Updated all users to embed tagmap objects and changed them to call through the class. Added nicer functions for finding devices, ports, and regions in a machine: machine->device("tag") -- return the named device, or NULL machine->port("tag") -- return the named port, or NULL machine->region("tag"[, &length[, &flags]]) -- return the named region and optionally its length and flags Made the device tag an astring. This required touching a lot of code that printed the device to explicitly fetch the C-string from it. (Thank you gcc for flagging that issue!)
* Extended the astring class wrapper into something useful, and Aaron Giles2010-01-081-11/+6
| | | | | | | | | | | | | | | | | | useable as a stack object. Also designed the interfaces to allow for chaining operations. And added a casting operator to const char * for seamless use in most functions that take plain old C strings. Changed all uses of astring to use the object directly on the stack or embedded in objects instead of explicitly allocating and deallocating it. Removed a lot of annoying memory management code as a result. Changed interfaces that accepted/returned an astring * to use an astring & instead. Removed auto_alloc_astring(machine). Use auto_alloc(machine, astring) instead.
* Get rid of setjmp/longjmp for error handling in favor of exceptions. Aaron Giles2010-01-041-2/+2
| | | | | Fatalerror now maps to throwing an exception. Requires a full recompile.
* Bulk change alert. Aaron Giles2009-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update changes the way we handle memory allocation. Rather than allocating in terms of bytes, allocations are now done in terms of objects. This is done via new set of macros that replace the malloc_or_die() macro: alloc_or_die(t) - allocate memory for an object of type 't' alloc_array_or_die(t,c) - allocate memory for an array of 'c' objects of type 't' alloc_clear_or_die(t) - same as alloc_or_die but memset's the memory to 0 alloc_array_clear_or_die(t,c) - same as alloc_array_or_die but memset's the memory to 0 All original callers of malloc_or_die have been updated to call these new macros. If you just need an array of bytes, you can use alloc_array_or_die(UINT8, numbytes). Made a similar change to the auto_* allocation macros. In addition, added 'machine' as a required parameter to the auto-allocation macros, as the resource pools will eventually be owned by the machine object. The new macros are: auto_alloc(m,t) - allocate memory for an object of type 't' auto_alloc_array(m,t,c) - allocate memory for an array of 'c' objects of type 't' auto_alloc_clear(m,t) - allocate and memset auto_alloc_array_clear(m,t,c) - allocate and memset All original calls or auto_malloc have been updated to use the new macros. In addition, auto_realloc(), auto_strdup(), auto_astring_alloc(), and auto_bitmap_alloc() have been updated to take a machine parameter. Changed validity check allocations to not rely on auto_alloc* anymore because they are not done in the context of a machine. One final change that is included is the removal of SMH_BANKn macros. Just use SMH_BANK(n) instead, which is what the previous macros mapped to anyhow.
* Many casts added to the core files, and various other tweaks Aaron Giles2009-03-121-1/+1
| | | | to make them compile as either C or C++.
* Restructured input port internals and cleaned up inptport.c: Aaron Giles2008-05-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Input ports are now maintained hierarchically. At the top level are input ports, which contain a list of fields. Each field represents one or more bits of the port. Certain fields such as DIP switches and configuration switches contain a list of settings, which can be selected. DIP switch fields can also contain a list of DIP switch locations. * Normalized behavior of port overrides (via PORT_INCLUDE or by defining multiple overlapping bits). All fields within a port are kept in strict increasing bit order, so altered DIP switches are now kept in the appropriate order. This addresses MAMETesters bug 01671. * Live port state is now fully separate from configured state. This is manifested in a similar way to devices, where a const list of ports can be managed either offline or live. Each port has a pointer to an opaque set of live state which is NULL when offline or valid when live. Each port also has a running_machine * which is also NULL when offline. * Because of this new arrangement, the conversion from tokens to a list of ports now requires reasonably complex memory allocation, so these port lists must be explicitly allocated and freed (they are not mantained by automatic resource allocation). * Custom and changed callbacks now take a pointer to a field config instead of a running machine. This provides more information about what field triggered the change notification. The machine can be found by referenced field->port->machine. * The inptport.c module has been cleaned up and many ambiguities resolved. Most of this is internal, though it did result in osd_customize_inputport_list() being changed to osd_customize_input_type_list(). The parameter to this function is now a linked list instead of an array, and the structures referenced have been reorganized somewhat. * Updated config.c to pass machine parameters to its callbacks. * Updated validity checks, XML output, and UI system to handle the new structures. * Moved large table of default input settings to a separate include file inpttype.h. * Removed gross hacks in trackfld and hyperspt NVRAM. These may be broken as a result.
* Normalized function pointer typedefs: they are now all Aaron Giles2008-03-031-3/+3
| | | | | | | | | | suffixed with _func. Did this throughout the core and drivers I was familiar with. Fixed gcc compiler error with recent render.c changes. gcc does not like explicit (int) casts on float or double functions. This is fracking annoying and stupid, but there you have it.
* First in a series of updates to remove the use of the global Machine from as ↵ Zsolt Vasvari2008-01-241-21/+21
| | | | many places as possible
* Copyright cleanup: Aaron Giles2008-01-061-1/+1
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+363