Commit Graph

97 Commits

Author SHA1 Message Date
Vas Crabb
aa739563d1 Self-registering devices.
* MAME now walks all devices when generating -lx output irrespective of whether they're actually instantiated anywhere or not.
* -lx is at least 30% faster than previous implementation.
* Only possible drawback is that filtering drivers no longer filters devices.
2017-03-03 00:45:14 +11:00
AJR
2a89da877b device_image_interface cleanups (nw)
- Replace comparisons of software_entry() or part_entry() with nullptr with loaded_through_softlist() predicate.
- Eliminate the superfluous m_software_info_ptr member. The software_entry() accessor is still provided, but now rarely used.
- Eliminate two of the three arguments to load_software_part.
- Remove some unnecessary auto-typing in ui/inifile.cpp.
2017-02-27 00:38:50 -05:00
Vas Crabb
bc1065a311 Revert "Make "requirement" field in softlists actually work (MT 6464)"
This reverts commit 17af0f9c66.
2017-02-19 11:40:54 +11:00
AJR
17af0f9c66 Make "requirement" field in softlists actually work (MT 6464)
(nw) MAME's architecture for software loading remains gruesomely overcomplicated, and this makes it even less efficient than it already was. However, I think more invasive cleanups would best be left until later.
2017-01-11 13:00:41 -05:00
Vas Crabb
8179a84458 Introduce u8/u16/u32/u64/s8/s16/s32/s64
* 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
2016-11-19 05:38:48 +11:00
Miodrag Milanovic
6b18f90438 Revert "Added IS_ENABLED, so we have compiler check for non used part, it is checked but not compiled in (nw)"
This reverts commit c0407f073b.
2016-11-12 09:12:36 +01:00
Miodrag Milanovic
c0407f073b Added IS_ENABLED, so we have compiler check for non used part, it is checked but not compiled in (nw)
false and true now used instead of integer where used as bool
2016-11-11 18:50:14 +01:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
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
2016-10-22 13:13:17 +02:00
Miodrag Milanovic
d2e8f61149 dynamic_buffer is just std::vector<UINT8> (nw) 2016-10-21 12:35:05 +02:00
Robbbert
e2718c91de Added swpath. Allows users to specify location of loose software. 2016-10-12 19:37:38 +11:00
Vas Crabb
33b2c73395 srcclean (nw) 2016-09-26 04:51:59 +10:00
Vas Crabb
6a2b41aa0b Merge pull request #1332 from npwoods/option_guide_and_imgtool
option_guide C++-ification, touched up imgtool
2016-09-10 10:15:30 +10:00
Vas Crabb
0e03164fc1 Merge pull request #1290 from npwoods/set_filetype_for_softlist_images
Now setting m_filetype for images loaded from softlists
2016-09-09 22:22:24 +10:00
Nathan Woods
98df223c17 Allows devices to indicate whether image creation should be supported at the command line
This addresses MT bug #6372.  The prior issue is that creating serial and/or printer output relied on how image_load() would create images that were not there.  This behavior was not universally desirable (the consensus was that it was wrong for disk images, up in the air for cassettes etc).  This change makes it possible for devices to control this behavior.

Currently I have it associated with image_type(); this might not be the ideal fix.
2016-09-06 07:37:31 -04:00
Nathan Woods
4251194fe5 Worked around the OPTION_GUIDE_EXTERN issue by using a crazy trick involving namespaces
Caveats:
  1.  Because of how this trick works, it is no longer possible to declare an option guide as static, so I had to make a bunch of changes
  2.  I'm going to want the hardcore C++ guys (i.e. - Vas) to review this with a fine toothed comb
2016-09-03 16:11:58 -04:00
Nathan Woods
965fb61f95 Attempting to make option_guide and option_guide::entry POD types; need to figure out a better way to do OPTION_GUIDE_EXTERN 2016-09-02 23:52:30 -04:00
Nathan Woods
2c9e00b96d Moving null_option_guide to global scope to avoid thread safety issues 2016-09-01 20:05:13 -04:00
Vas Crabb
c960435d3e srcclean and translation regeneration 2016-08-29 02:02:04 +10:00
Nathan Woods
b60879e595 option_guide C++-ification, touched up imgtool
The main point of this change is to C++-ify option_guide.  It was changed from a struct array to a class, namespaced etc, with the ultimate hope of incorporating an in-emulation image creation UI.

Imgtool got hit with a number of changes; I'll probably have to bring that off of the backburner and touch that up too
2016-08-27 16:41:11 -04:00
Nathan Woods
58090e0d5f Changed the "extension as filetype" behavior for software list images to be opt in behavior
It sounds like whether it is up in the air whether softlist file types should be derived from file extensions.  Fair enough.  This patch alters the earlier proposal so this at the very least becomes opt in behavior so that an ugly hack does not have to be replicated in client code in a potentially inconsistent and buggy fashion.
2016-08-25 08:28:35 -04:00
Nathan Woods
cd745e6095 Now setting m_filetype for images loaded from softlists 2016-08-22 09:15:24 -04:00
Nathan Woods
58e2f401ed Minor cleanups to device_image_interface::find_software_item() 2016-08-20 11:30:25 -04:00
Nathan Woods
e17497b9ee Standardized some names for softlist concepts
- "identifier" for a potentially fully qualified way to reference a software item (e.g. - apple2gs:3stooges:flop1)
- "list_name" for the name of a list (e.g. - apple2gs or a800_flop)
- "software_name" for the name of a software item (e.g. - 3stooges)
- "part_name" for the name of a part (e.g. - flop1)
2016-08-20 11:30:10 -04:00
Nathan Woods
a4f59b3242 Changing device_image_interface::determine_open_plan() to not support creating an image unless device_image_interface::create() is used
I'm somewhat surprised that this has not bit us until now.  The implication of how it used to work is that device_image_interface::load() could actually create images; it is hard to eliminate the possibility that something might be incorrectly relying on this behavior.  I've determined that this isn't the case for imgcntrl.cpp and floppycntrl.cpp
2016-08-19 08:24:23 -04:00
Vas Crabb
41e4133d0b Merge pull request #1222 from npwoods/move_software_name_parsing
device_image_interface::software_name_split() ==> softlist.cpp:software_name_parse()
2016-08-13 01:00:52 +10:00
Nathan Woods
68c2d88d51 Converted more softlist code to use std::string 2016-08-10 08:08:10 -04:00
Nathan Woods
9f5325a311 device_image_interface::software_name_split() ==> softlist.cpp:software_name_parse()
Also consolidated with code that performed a quick pass to identify whether a piece of text is a software name
2016-08-10 07:22:46 -04:00
Nathan Woods
1cda375d5e Eliminated device_image_interface::make_readonly()
Take note that I eliminated make_readonly(); here is why I think the calls were unnecessary:
1.  All image loads through softlists are done through common_process_file(), and thus going to be readonly anyways
2.  The cassette.cpp call to make_readonly() seems to be a residual hack, if a failure occurs the image will be unloaded anyways
2016-08-09 22:27:24 -04:00
Nathan Woods
01844ed061 More softlist-related conversions of strings to std::string 2016-08-08 19:51:32 -04:00
Miodrag Milanović
f67311c5a5 Merge pull request #1180 from npwoods/split_softlist_code_redo
Redo of split of src/emu/softlist.[cpp|h]
2016-08-08 13:43:06 +02:00
Nathan Woods
ff064ba37a More conversion of 'const char *' --> std::string in diimage 2016-08-04 07:21:27 -04:00
Nathan Woods
a9e706915c This fixes issues where softlist items (that were not for floppies) were loaded from the software list menu
I'm still not 100% satisfied with this patch.  While I got rid of the weird path when hook_proc() was called for a software list item,
I still don't like the whole m_init_phase infrastructure in devices, which seems to be an arbitrary piece of state.  Baby steps...
2016-08-02 20:06:08 -04:00
Nathan Woods
f9db568146 Redo of split of src/emu/softlist.[cpp|h]
This is a redo of the split first submitted in #137, with the following differences:
* The newly refactored rom_entry data structure is used
* I've kept the refactored softlist code in src/emu, in order to defer the mechanical process of moving it
* I've kept includes of softlist[_dev].h out of diimage.h, so that changes to either do not trigger an emu.h recompilation
* Obviously, this goes against the latest master
2016-08-02 17:40:49 -04:00
Vas Crabb
889ecdfd4f Let's give the new srcclean a spin... 2016-08-02 16:59:02 +10:00
Nathan Woods
a7b00e3f6d Converted more stuff in diimage to use std::string instead of 'const char *' 2016-08-01 20:24:06 -04:00
Nathan Woods
764371c72c Changed device_image_interface::load() to take 'const std::string &' 2016-08-01 19:44:01 -04:00
Nathan Woods
2d2a193c02 Fixing a stupid merge error that broke image loading 2016-08-01 08:13:10 -04:00
Vas Crabb
15e7be7ac8 Turn image init/validate into scoped enums to avoid accidental casts to/from integer and boolean types
The image error should also be turned into a scoped enum - the menus were assuming it was the same thing as an init result
2016-08-01 18:47:22 +10:00
Nathan Woods
59ca4d1763 1. Merge branch 'master' into diimage_filetype_as_stdstring
2.  Introduced is_filetype(), instead of normalizing filetype() to lower case
2016-07-31 23:52:57 -04:00
Nathan Woods
024f698364 Merge branch 'master' into separate_softlist_image_load 2016-07-31 15:20:49 -04:00
Nathan Woods
a4f24a24d3 This changes device_image_interface::filetype() to return 'const std::string &' instead of 'const char *'.
In the interests of removing burdens from client code, I also changed the following:
- filetype() will always return the file extension in lower case
- device_image_interface::filetype() will return the correct extension for files loaded as a part of softlists
- The code for extracting a file extension is now encapsulated in core_filename_extract_extension()

Client code has been updated
2016-07-31 15:06:06 -04:00
Miodrag Milanovic
91fcff1b6d cleanup (nw) 2016-07-31 20:29:24 +02:00
Nathan Woods
b1b29cd44e Created device_image_interface::add_format() protected member and made device_image_interface::m_formatlist be private 2016-07-31 08:47:49 -04:00
Nathan Woods
5f1bb05263 Removed device_image_interface::has_been_created()
This method was necessary long ago when devices didn't have distinct load and create paths, which has since been addressed
2016-07-30 14:41:09 -04:00
Nathan Woods
81c8de57ca Changed device_image_interface::load() so that it is no longer responsible for both loading images and softlist items; now the latter
is done through a new method - device_image_interface::load_software()
2016-07-30 10:59:54 -04:00
Nathan Woods
0df4a2339a Three times is a charm 2016-07-30 09:28:48 -04:00
Nathan Woods
eb79ffac88 <+cuavas> you've changed the function, you get to change it properly! 2016-07-30 09:15:27 -04:00
Nathan Woods
cfd4397f3c Miscellaneous cleanups:
- Removed some c_str() calls when using util::zippath_parent()
- Removed the error code return value from set_image_filename()
- Consolidated error code translation (osd_file::error ==> image_error_t) in image_error_from_file_error()
- Other cosmetic improvements
2016-07-30 08:56:37 -04:00
Vas Crabb
9c9ee49c9f Merge pull request #1156 from npwoods/zippath_strstring
Converted a number of zippath calls that took 'const char *' to std::string
2016-07-30 12:25:22 +10:00
Nathan Woods
a7bfc73cfb Changed various string arguments for emu_file::open() from 'const char *' to std::string 2016-07-29 20:53:46 -04:00