summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/fileio.h
Commit message (Collapse)AuthorAgeFilesLines
* ROM loading cleanup: Vas Crabb2020-04-151-14/+99
| | | | | | | | | | | | | | * More flexible constructors for path_iterator and emu_file * More straightforward system/device ROM loading and software loading when using ROM loader * Proper parent walk when searching for identical CHDs with different names from software list * Fixed hangs if software item parents form a loop * Fixed layouts being loaded from bogus empty paths Note that there are changes in behaviour: * For software list ROMs/disks, MAME will now search the software path before searching the machine path * The search path for the owner of the software list device is used, which may not be the driver itself * MAME will no longer load loose CHDs from the media path - it's just too unwieldy with the number of supported systems * MAME will no longer search archives above the top level of the media path
* (nw) Cleanup on the way: Vas Crabb2020-03-101-3/+0
| | | | | | | | | | * Add doxygen comments for bit manipulation functions * Add an overload of BIT that works like the AArch64 UBFX instruction * Kill off some of the silly concatenating overloads for emu_file::open * Make searchpath acually useful for devices This is a checkpoint - I'm planning to improve ROM loading behaviour at least a little.
* general cleanup: Vas Crabb2017-05-231-3/+0
| | | | | | | | | | | * move rarely-used output and pty interfaces out of emu.h * consolidate and de-duplicate forward declarations, also remove some obsolete ones * clean up more #include guard macros * scope down a few more things (nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h - this will make it far easier to keep them in sync with declarations than having them scattered through all the other files.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-28/+28
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-18/+18
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* dynamic_buffer is just std::vector<UINT8> (nw) Miodrag Milanovic2016-10-211-1/+1
|
* make path_iterator hold onto its search path Vas Crabb2016-08-191-14/+21
|
* Changed various string arguments for emu_file::open() from 'const char *' to ↵ Nathan Woods2016-07-291-8/+8
| | | | std::string
* Moved src/emu/hash.[cpp|h] into src/lib/util, and namespaced that code (and ↵ Nathan Woods2016-07-231-2/+2
| | | | hashing.[cpp|h]) into util::
* POSIX implementation for new directory read features, cleanup of Windows ↵ Vas Crabb2016-06-251-3/+3
| | | | implementation, return directory handle as smart pointer, fix full build [Vas Crabb]
* C++-ified osd_directory (now osd::directory), and added last_modified to ↵ Nathan Woods2016-06-241-2/+2
| | | | osd::directory::entry
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-1/+1
|
* Make emu_file archive searh order CRC+path, CRC+partial path, CRC, path, ↵ Vas Crabb2016-03-251-1/+0
| | | | partial path and fold some redundant code
* Fold some redundant code Vas Crabb2016-03-181-7/+1
|
* * Remove confusing method from vectorstreams that hide base_ios method ↵ Vas Crabb2016-03-181-6/+3
| | | | | | | | | | | | | (fixes disassembly view) * Allow std::string to pass through core_file unmolested (reduces temporary allocations) * Make zip/7z instances of same class with uniform interface * zippath browsing is broken at the moment This is another step towards transparent archive support. It's now possible to access zip and 7z archives with the same code. Nothing is taking advantage of it yet. There's now some very similar code in fileio.cpp and clifront.cpp that could be folded at some point.
* Make osd_file a polymorphic class that's held with smart pointers Vas Crabb2016-03-141-29/+25
| | | | | | | | | | | | | | | Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures Make zip_file and _7z_file classes rather than having free functions everywhere Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache Don't dump as much crap in global namespace Add solaris PTY implementation Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax Rearrange stuff so the same things are in file module for all OSDs Move file stuff into its own module 7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access Directory functions still need to be moved to file module SDL OSD may not initialise WinSock on Windows
* Use type-safe printf for core_file and emu_file, surprisingly few knock-on ↵ Vas Crabb2016-03-091-2/+5
| | | | | | effects Properly fix up a couple of places I64FMT was being used, still more to deal with
* Turn core_file into a proper class that gets cleaned up safely using unique_ptr Vas Crabb2016-03-061-6/+5
| | | | Subverted somewhat by chd_file class
* Add function for flushing file buffers Vas Crabb2016-03-011-0/+5
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-3/+3
|
* moved all to std::string (nw) Miodrag Milanovic2015-04-221-7/+7
|
* There is no implicit conversion to char* in std::string (nw) Miodrag Milanovic2015-04-121-2/+2
|
* Cleanups and version bumpmame0159 Miodrag Milanovic2015-02-251-2/+2
|
* Better performance for -verifyroms on samba share [qmc2] Miodrag Milanovic2015-02-121-1/+6
|
* Moved core template container classes up from emutempl.h to coretmpl.h: Aaron Giles2014-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Aaron Giles] * these classes now no longer take a resource_pool; everything is managed globally -- this means that objects added to lists must be allocated with global_alloc * added new auto_pointer<> template which wraps a pointer and auto-frees it upon destruction; it also defaults to NULL so it doesn't need to be explicitly initialized * moved tagged_list template to tagmap.h Redo of the low-level memory tracking system: [Aaron Giles] * moved low-level tracking out of emu\emualloc into lib\util\corealloc so it can be shared among all components and used by core libraries * global_alloc and friends no longer use a resource pool to track allocations; turns out this was a wholly redundant system that wasted a lot of memory * removed global_resource_pool entirely * added global_free_array to delete arrays allocated with global_alloc_array * added tracking of object versus array allocation; we will now error if you use global_free on an array, or global_free_array on an object Added new utility helper const_string_pool which can be used to efficiently accumulate strings that are not intended to be modified. Used by updated makelist and software list code. [Aaron Giles] Updated png2bdc and makelist tools to not leak memory and use more modern techniques (no more MAX_DRIVERS in makelist, for example). [Aaron Giles] Deprecated auto_strdup and removed all uses by way of caller-managed astrings and the software list rewrite. [Aaron Giles] Rewrote software list management: [Aaron Giles] * removed the notion of a software_list that is separate from a software_list_device; they are one and the same now * moved several functions into device_image_interface since they really didn't belong in the core software list class * lots of simplification as a result of the above changes Additional notes (no whatsnew): Moved definition of FPTR to osdcomm.h. Some changes happened in the OSD code to fix issues, especially regarding freeing arrays. SDL folks may need to fix up some of these. The following devices still are using tokens and should be modernized (I found them because they kept their token as void * and tried to delete it, which you can't): namco_52xx_device (mame/audio/namco52.c) namco_54xx_device (mame/audio/namco54.c) namco_06xx_device (mame/machine/namco06.c) namco_50xx_device (mame/machine/namco50.c) namco_51xx_device (mame/machine/namco51.c) namco_53xx_device (mame/machine/namco53.c) voodoo_device (emu/video/voodoo.c) mos6581_device (emu/sound/mos6581.c) aica_device (emu/sound/aica.c) scsp_device (emu/sound/scsp.c) dmadac_sound_device (emu/sound/dmadac.c) s3c2440_device (emu/machine/s3c2440.c) wd1770_device (emu/machine/wd17xx.c) latch8_device (emu/machine/latch8.c) duart68681_device (emu/machine/68681.c) s3c2400_device (emu/machine/s3c2400.c) s3c2410_device (emu/machine/s3c2410.c) strataflash_device (mess/machine/strata.c) hd63450_device (mess/machine/hd63450.c) tap_990_device (mess/machine/ti99/990_tap.c) omti8621_device (mess/machine/omti8621.c) vdt911_device (mess/video/911_vdt.c) apollo_graphics_15i (mess/video/apollo.c) asr733_device (mess/video/733_asr.c)
* rest of ATTR_PRINTF review (nw) Oliver Stöneberg2014-02-251-1/+1
|
* Bulk convert files that already had standard BSD license in my name Aaron Giles2013-10-161-31/+2
| | | | to new license tagged form.
* (MESS) fixed clang 3.2 warnings about unused private fields (nw) Oliver Stöneberg2013-03-201-1/+1
|
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-25/+25
|
* First pass at modernizing struct definitions. Aaron Giles2012-09-151-4/+4
|
* Add LZMA codec and .7z container support [David Haywood, R. Belmont] R. Belmont2012-02-121-0/+13
|
* Fix for systems where getc() is a #define rather than a function [ElBarto] R. Belmont2011-09-251-1/+4
|
* path_iterator::next() now takes an optional filename to append to Aaron Giles2011-03-141-1/+1
| | | | the path.
* Converted core_options to a class. Removed a bunch of marginal Aaron Giles2011-03-031-37/+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.
* Cleanups and version bump.mame0141u3 Aaron Giles2011-02-281-8/+8
|
* Hash generation and general cleanup. New class hash_collection holds Aaron Giles2011-02-141-2/+2
| | | | | | | | | | | 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-124/+163
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* - Fixed issue with image empty slot [Miodrag Milanovic] Miodrag Milanovic2010-11-261-6/+1
| | | | | - Default for writeconfig is now 0 for MESS since it is not needed anymore - Fixed handling of mounted devices on hard reset - Unified some emuopts code, and removed ifdefs
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-1/+1
| | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Added new function mame_fclose_and_open_next() which will close a file Aaron Giles2009-09-031-0/+3
| | | | | | | | | | | and then keep searching the searchpath for the next valid file. Did some internal rearranging in fileio.c to make this work. Changed cheat search so that it loads *all* cheat files in all search paths. Note that it is easy to end up with duplicate entries this way. Some currently disabled code is present which filters out duplicates, but the logic for doing this is quite unclear with the presence of text-only cheats, which is why the code is disabled for now.
* Fixed remaining occurrences of crsshairpath Fabio Priuli2009-07-141-25/+25
|
* Crosshair update Derrick Renaud2009-03-281-0/+1
| | | | | | | | | | | | | | | | | | * Added Crosshair Options menu - ability to individually enable/disable crosshairs - ability for them to automatically disappear after a set amount of time - ability to select crosshair graphic - all settings are saved in the cfg file * Removed F1 toggle for crosshairs * Added new command option -crsshairpath - store all selectable graphics here - see config.txt for further info OSD NOTE: render_load_png() has been changed to no longer force usage of the artwork directory. Do a search for "render_load_png(" and replace with "render_load_png(OPTION_ARTPATH, " if needed. ---------------------------- F1 is now free to use for something new. I was thinking it would be perfect for a context sensitive help file. Each menu item could have a help tag, that it would look up and display info from an HTML file.
* Fixed crash bug in DCS games. Aaron Giles2008-12-111-1/+1
| | | | | | | | | Updated the fcompress APIs to allow for specifying a compression level. Removed the concept of state saving tags, which was a hack to get save states to work with multiple CPU cores. Simplified the state saving system as a result, performing the operation in a single pass and without allocating a full blob of memory. Also enabled minimal compression.
* 02688: DIP switch settings are not being stored in INP files. Aaron Giles2008-12-041-0/+4
| | | | | | | To fix this, I had to break old INP files. While I was in there, I added corefile support for compressing/decompressing data on the fly, and enabled it for INPs, meaning the newer format INPs are output and processed compressed.
* Added new options 'cheatpath' to specify one or more paths for cheat Aaron Giles2008-07-311-1/+1
| | | | | | | | | | | | | | files. Removed old option 'cheat_file'. Updated xmlfile.c to specify the line number for each node, for more accurate error reporting. Removed old cheat.c/.h and replaced them with code that will read and write the new XML-based cheat format using the new cheatpath option (cheats still need to be enabled in order to load at all). Note that the cheats are not implemented yet, but they are fully parsed. To test saving, whenever a cheat file is successfully loaded, it is immediately written back out as 'output.xml' to the cheat directory for validation.
* Added uncompressed AVI recording. Extended aviio to be able Aaron Giles2008-05-131-0/+3
| | | | | | | | | | | | | | | | | | | to write RGB bitmaps. Unfortunately, the only option is fully uncompressed, which means the resulting AVIs are *HUGE* and may not play correctly in realtime due to high data rate. The intention is that these uncompressed AVIs are post-processed by other utilities to compress the video and produce a realtime playable result. Added new command-line option -aviwrite which works just like -mngwrite, except it produces AVIs and streams sound to them. Updated documentation accordingly. Shift+F12 still produces MNGs for now, though this might change in the future. Modified fileio.c to retain the full pathname to the file so that it can be queried while the file is open.
* 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"
* (From Oliver Stoneberg) Aaron Giles2008-01-031-1/+1
| | | | | | | This is an updated version of my earlier ATTR_PRINTF patch. It was reviewed by Atari Ace to use ATTR_PRINTF properly and fixes even more format errors. I also reviewed the whole source again and it is now used in all possible places.