summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diimage.c
Commit message (Collapse)AuthorAgeFilesLines
* removed unnecessary strlen() usage (no whatsnew) Oliver Stöneberg2012-07-271-1/+1
|
* Added device image type for individual ROM images (as used in some Amstrad ↵ mahlemiut2012-05-071-0/+2
| | | | CPC applications) (no whatsnew)
* Changed device->subregion to device->memregion. Moved Aaron Giles2012-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memory_region management into the memory manager instead of directly in the machine. Hid the global region method; now all regions must be looked up relative to a device. If you're a member function, you can just use memregion("tag") directly. If you're a global function or a device referencing global regions, use machine().root_device().memregion("tag") to look up regions relative to the root. S&R to convert all references: machine([()]*)\.region machine\1\.root_device\(\).subregion Then remove redundant machine().root_device() within src/mame: ([ \t])machine\(\)\.root_device\(\)\. \1 And use state->memregion() if we have a state variable present: (state *= *[^;]+driver_data[^}]+)([^ \t]*)machine[()]*\.root_device\(\)\. \1state-> Finally some cleanup: screen.state-> state-> device->state-> state-> space->state-> state-> And a few hand-tweaks.
* 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.
* Display softlist in menu only for devices having interface set (no whatsnew) Miodrag Milanovic2012-03-301-1/+1
|
* Sync with MESS (no whatsnew) Miodrag Milanovic2012-03-061-6/+8
|
* Clean-ups and version bumpmame0145u2 Angelo Salese2012-02-261-1/+1
|
* Give more proper name and disabled loading of soflist items in ↵ Miodrag Milanovic2012-02-211-3/+3
| | | | open_image_file call (no whatsnew)
* Added helpers for loading file for slot determination (no whatsnew) Miodrag Milanovic2012-02-211-3/+25
|
* Remove redundant hashing code, use hashing.h instead. Aaron Giles2012-02-161-1/+2
| | | | | | Remove overabstraction in hash.h; it's ok to hard code the two types of hashes we have. Even adding another one would not be very difficult. ;)
* Some cleanup of some observed #include redundancy from source files which ↵ Scott Stone2012-02-061-1/+0
| | | | use emu.h (nw)
* Clean-ups and version bump Angelo Salese2012-02-051-1/+1
|
* workaround for softlist images ending up with the wrong basename. this fixes ↵ Fabio Priuli2012-02-051-1/+9
| | | | | problems with nvram and snap handling in softlist. no whatsnew. I'm not sure if the change from "m_image_name = softlist:gamename" to "m_image_name = softlist:gamename:partname" was done on purpose, but given how close we are to the release, I think it's safer to fix it here than to modify the softlist code.
* Fix regression on softload item load using menus (no whatsnew) Miodrag Milanovic2012-01-301-5/+17
|
* Sync with MESS (no whatsnew) Miodrag Milanovic2012-01-251-3/+11
|
* Move devices into a proper hierarchy and handle naming Aaron Giles2012-01-241-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* floppy: Do specific UI handling [O. Galibert] Olivier Galibert2012-01-231-41/+64
|
* Cleanups and version bumpmame0144u5 Angelo Salese2012-01-081-5/+5
|
* uiimage/diimage: Dumbify the menus and add a control layer [O. Galibert] Olivier Galibert2012-01-071-2/+302
|
* Removed old C-based interface to astrings. astring exists only as Aaron Giles2012-01-031-9/+7
| | | | | | a class now. Updated all stragglers (mostly tools) to use the class form. [Aaron Giles]
* Clean-ups and version bumpmame0144 Angelo Salese2011-11-131-1/+1
|
* Call unload image for cart softlist items too (no whatsnew) Miodrag Milanovic2011-11-101-1/+2
|
* - Removing MD5 support in ROMLOAD_* [Oliver Stoneberg] Miodrag Milanovic2011-07-311-1/+1
| | | | - Various core and tools memory leaks fixes [Oliver Stoneberg]
* Update support for slot devices based softlists (no whatsnew) Miodrag Milanovic2011-07-171-1/+1
|
* Cleanups and version bumpmame0142u6 Angelo Salese2011-06-191-1/+1
|
* Converted printer image device to modern (no whatsnew) Miodrag Milanovic2011-06-141-1/+29
|
* Cleanup of image device base classes and prepare for rewrite (no whatsnew) Miodrag Milanovic2011-06-101-1/+465
|
* Removed memory allocation calls from image device (no whatsnew) Miodrag Milanovic2011-05-251-42/+0
|
* Fixed problem with image devices due to same name in interface and device ↵ Miodrag Milanovic2011-05-041-2/+2
| | | | class (no whatsnew)
* diimage.c: fix uninitialized variables found by Valgrind [R. Belmont] R. Belmont2011-05-011-1/+3
|
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-61/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* (Big tangle of changes that all happened as I was looking into the ROM Aaron Giles2011-04-131-4/+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)
* cartslot.c/chd_cd.c: added support for a callback function to test softlist ↵ Fabio Priuli2011-04-071-1/+1
| | | | | sharedfeat (e.g. 'compatibility') and display a warning message accordingly. updated cdi.c as an example [Fabio Priuli] support for floppy and tapes is in progress, but I have to discuss with Micko first :)
* BIG update. Aaron Giles2011-03-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Removed hashfile and dependencies (no whatsnew) Miodrag Milanovic2011-02-141-44/+0
|
* Hash generation and general cleanup. New class hash_collection holds Aaron Giles2011-02-141-36/+12
| | | | | | | | | | | and manages a collection of hashes, and can be built from an internal format string which is stored with each ROM. All core instances are cleaned up to use the new interfaces, but it's likely that hashfile code in MESS will need an update. Also compacted the form of the hash strings used for ROMs, and fixed verification/hashing of non-ZIPped files.
* mame_file is now emu_file and is a class. It is required Aaron Giles2011-02-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Ok, last major rename for this round: Aaron Giles2011-01-011-2/+2
| | | | | | | | | | | | | | | | memory_region() == machine->region()->base() memory_region_length() == machine->region()->bytes() region_info -> memory_region Regex searches: S: memory_region( *)\(( *)([^,&]+), *([^)]+)\) R: \3->region\1\(\2\4\)->base\(\) S: memory_region_length( *)\(( *)([^,&]+), *([^)]+)\) R: \3->region\1\(\2\4\)->bytes\(\)
* Swap: (astring.len() != 0) -> astring Aaron Giles2010-08-211-5/+5
| | | | Swap: (astring.len() == 0) -> !astring
* Fixed image device error handling [ShimaPong, Miodrag Milanovic] Miodrag Milanovic2010-08-041-15/+13
|
* Fixed image based cheat file loading (no whatsnew) Miodrag Milanovic2010-07-281-6/+5
|
* Cleanups and version bump.mame0138u4 Aaron Giles2010-07-221-1/+1
|
* Adding ability to support other types of software lists, so floppies, ↵ Miodrag Milanovic2010-07-081-0/+1
| | | | cassettes, cd-roms are now possible to be used [Miodrag Milanovic]
* Cleanups and version bump.mame0138u3 Aaron Giles2010-07-061-10/+10
|
* Added new static call in diimage and added call to initialize subdevices for ↵ Miodrag Milanovic2010-06-291-0/+15
| | | | image device (no whatsnew)
* Implemented hash file and battery support and did some cleanup (no whatsnew) Miodrag Milanovic2010-06-241-1/+195
|
* - Moved ioproc implementation from MESS [Miodrag Milanovic] Miodrag Milanovic2010-06-231-9/+40
| | | - Implemented more image device calls, and did some cleanup (no whatsnew)
* - Moved softlist implementation from MESS [Miodrag Milanovic] Miodrag Milanovic2010-06-201-42/+143
| | | | | - Moved image related UI from MESS to emu core - Reimplemented filename related image device calls
* fix Linux 64-bit compile (no whatsnew) R. Belmont2010-06-191-1/+1
|