summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/audit.c
Commit message (Collapse)AuthorAgeFilesLines
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-2/+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-16/+10
| | | | | | | | | | | | | | | | | | 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.
* NOTE: This change requires two new osd functions: osd_malloc() and Aaron Giles2010-01-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd_free(). They take the same parameters as malloc() and free(). Renamed mamecore.h -> emucore.h. New C++-aware memory manager, implemented in emualloc.*. This is a simple manager that allows you to add any type of object to a resource pool. Most commonly, allocated objects are added, and so a set of allocation macros is provided to allow you to manage objects in a particular pool: pool_alloc(p, t) = allocate object of type 't' and add to pool 'p' pool_alloc_clear(p, t) = same as above, but clear the memory first pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type 't' and add to pool 'p' pool_alloc_array_clear(p, t, c) = same, but with clearing pool_free(p, v) = free object 'v' and remove it from the pool Note that pool_alloc[_clear] is roughly equivalent to "new t" and pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also note that pool_free works for single objects and arrays. There is a single global_resource_pool defined which should be used for any global allocations. It has equivalent macros to the pool_* macros above that automatically target the global pool. In addition, the memory module defines global new/delete overrides that access file and line number parameters so that allocations can be tracked. Currently this tracking is only done if MAME_DEBUG is enabled. In debug builds, any unfreed memory will be printed at the end of the session. emualloc.h also has #defines to disable malloc/free/realloc/calloc. Since emualloc.h is included by emucore.h, this means pretty much all code within the emulator is forced to use the new allocators. Although straight new/delete do work, their use is discouraged, as any allocations made with them will not be tracked. Changed the familar auto_alloc_* macros to map to the resource pool model described above. The running_machine is now a class and contains a resource pool which is automatically destructed upon deletion. If you are a driver writer, all your allocations should be done with auto_alloc_*. Changed all drivers and files in the core using malloc/realloc or the old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros instead, or the global_alloc_* macros if necessary. Added simple C++ wrappers for astring and bitmap_t, as these need proper constructors/destructors to be used for auto_alloc_astring and auto_alloc_bitmap. Removed references to the winalloc prefix file. Most of its functionality has moved into the core, save for the guard page allocations, which are now implemented in osd_alloc and osd_free.
* Removed the various HAS_xxxx for sound cores. To select sound cores, Aaron Giles2010-01-021-3/+1
| | | | | just choose them in the make system. Further granularity is not necessary. This also means that the samples core is always required.
* Cleaned up braces in the code so that they are properly balanced. [Atari Ace] Aaron Giles2009-12-281-1/+1
|
* Bulk change alert. Aaron Giles2009-04-261-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ignores optional and no dump roms when checking whether all roms exist in ↵ smf-2009-04-131-12/+10
| | | | the parent.
* refactored the audit code to make it more consistent with the original. smf-2009-04-111-44/+34
|
* applies same rules to chds as roms. smf-2009-04-111-4/+3
|
* change to last patch to only treat a file as found if it's not from a parent. smf-2009-04-111-4/+7
|
* audit still passes for romsets with no dumped/required roms, but returns NOT ↵ smf-2009-04-111-1/+16
| | | | FOUND if everything else is not found.
* changed audit to report best available if the romset contains no dumped or ↵ smf-2009-04-111-9/+2
| | | | required roms.
* Many casts added to the core files, and various other tweaks Aaron Giles2009-03-121-2/+2
| | | | to make them compile as either C or C++.
* From: R. Reucher [rene.reucher@batcom-it.net] Aaron Giles2009-03-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sent: Friday, February 27, 2009 10:17 AM To: submit@mamedev.org Cc: qmc2-devel@lists.sourceforge.net Subject: Proposed patch for src/emu/audit.c Dear MAME developers, I've created the attached diff to src/emu/audit.c (0.129u5) to allow for reporting a ROM state of "correct" when a game/machine doesn't require any ROM files at all (currently it will be reported as "not found", which is wrong IMHO). I know that this isn't really relevant for MAME, but it is for MESS -- so I hope you'll accept the patch. Thanks, Rene -- Rene Reucher rene.reucher@batcom-it.net http://www.batcom-it.net/ It is only people of small moral stature who have to stand on their dignity.
* 02180: Corrupt archives are read without problems Couriersud2009-03-041-6/+6
| | | | | | | * corrupt files in archives now generate an error * archive files ending in "/" will not be tested for crc - skip path entries * add new flag FILE_OPEN_NO_PRELOAD to skip decompressing on open This is used in audit.c, which only tests whether files exist * added error checking to all calls to load_file_zipped
* Ok, this is The Big One. Aaron Giles2009-02-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please note: regression testing is in progress, but the first round of glaring regressions have already been taken care of. That said, there is likely to be a host of regressions as a result of this change. Also note: There are still a few rough edges in the interfaces. I will try to clean them up systematically once the basic system is working. All sound chips are now proper devices. Merged the sound chip interface into the device interface, removing any differences (such as the whole ALIASing concept). Modified every sound chip in the following ways: * updated to match the device interface * reduced read/write handlers down to the minimal number * added the use of get_safe_token() for ensuring correctness * other minor cleanup Removed the custom sound device. The additional work to just make custom sound cases into full devices is minimal, so I just converted them all over to be actual devices. Vastly simplified the sound interfaces, removing the ghastly sndti_* business and moving everyone over to using tags for sound identity. sndintrf, like cpuintrf, is now just a header file with no implementation. Modified each and every driver that references a sound chip: * all memory maps explicitly reference the targeted device via AM_DEVREAD/AM_DEVWRITE/AM_DEVREADWRITE * 16-bit and 32-bit accesses to 8-bit chips no longer use trampoline functions but instead use the 8-bit AM_DEVREAD/WRITE macros * all references to sound chips are now done via tags * note that these changes are brute force, not optimal; in many cases drivers should grab pointers to devices in MACHINE_START and stash them away
* Fixed compilation errors if HAS_SAMPLES is 0 Nathan Woods2009-01-151-3/+3
|
* romload cleanups: Aaron Giles2009-01-021-5/+1
| | | | | | | | | | | - added running_machine to internal structure, removed as explicit parameter - added new function rom_file_size() to compute the size of a ROM - removed rom_first_chunk() and rom_next_chunk() which are no longer needed - changed progress display to be based on size of ROMs loaded, not number - changed temporary load buffer to be dynamically allocated - fixed reload logic to handle skipped BIOSes Also changed rand_memory() to use a fixed seed for consistent behavior.
* 02680: carnevil: -verifyrom fails to consider if a CHD is a BAD_DUMP Aaron Giles2008-12-041-1/+5
|
* Cleanups and version bump.mame0127u3 Aaron Giles2008-09-111-2/+2
|
* Added concept of rom sources to the rom loader. Updated auditing, Aaron Giles2008-09-061-33/+74
| | | | | CLI utilities, validity checks, and ROM loading to use these new functions so that device-specific ROMs are handled properly.
* Added PR-8210 support to the ldplayer. Fixed step forward command on the ↵ Aaron Giles2008-08-221-0/+4
| | | | | | | | | | | | PR-8210. 02136: cubeqst: from minimal UI cubeqst requires the optional CHD 02127: xymg: The game name should be Xing Yun Man Guan and "Pin Yin:"should be omitted 02138: flamegun: Debugger/Cheat System upper case cpu tag of MAIN doesn't work 02139: In audio/system16.c, there is a reference to REGION_SOUND1 02133: chindrah: The title of Zhong Guo Long?(Hong Kong,V011H) is Dong Fang Zhi Zhu(Hong Kong, V011H) 02126: corrupt CHDs are reported as missing
* Updated structure and naming conventions of the following sound interfaces. Derrick Renaud2008-08-081-2/+2
| | | | | | struct CustomSound_interface to custom_sound_interface struct Samplesinterface to samples_interface struct SN76477interface to SN76477_interface struct AY8910interface to AY8910_interface
* Converted MACHINE_DRIVER definitions from function Aaron Giles2008-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructors to tokenized lists. For the most part this is a non-invasive change, except for those drivers using MDRV_WATCHDOG_TIME_INIT. In order to allow for tokenization of attotimes, a set of new macros is provided called UINT64_ATTOTIME_IN_x() which follows the same pattern as ATTOTIME_IN_x() but packs the attotime down into a single 64-bit value for easier tokenization. Separated MDRV_DEVICE_CONFIG_DATA into 32-bit and 64-bit versions. Added floating-point versions with configurable resolutions. Fixed several errors in the machine drivers which were caught by the additional checks now done in the machine config detokenization code. Converted speakers into devices. Machine->config no longer houses an array of speakers; instead they are iterated through using the new macros (defined in sound.h) speaker_output_first() and speaker_output_next(). Updated all relevant code to do this. Improved game info display with multiple screens. Fixed bug which caused all screens to display equally. Added typedefs for all the machine config callback functions at the top of driver.h.
* Removed expand_machine_driver(). Aaron Giles2008-02-181-9/+10
| | | | | | Replaced with machine_config_alloc() and machine_config_free(). Updated all call sites. Normalized info.c style and simplified some of the code.
* 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"
* Changes for MAME 0.121u3.mame0121u3 Aaron Giles2007-12-171-2/+2
|
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+505