Commit Graph

30 Commits

Author SHA1 Message Date
Vas Crabb
aeb9eae874
util: Further API cleanups: (#8661)
* Turned `core_file` into an implementation of `random_read_write`.
* Turned PNG errors into a standard error category.
* Added a helper for generating what look like derived classes on-the-fly.
2021-10-05 03:34:45 +11:00
AJR
60e518cc50 Low-level #include overhaul
- vecstream.h: Revert changes made in aa29519528. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h.
- strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified.
- osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments.
- Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
2021-01-02 15:18:15 -05:00
AJR
aa29519528 Further additions of std::string_view
- corefile.cpp, fileio.cpp: Change puts to take a std::string_view parameter
- rendlay.cpp: Use std::string_view instead of bare pointers in various functions
- vecstream.h: Add std::string_view conversion operator to obtain output buffer without needing to make it a C string with explicit null termination
- xmlfile.cpp: Add get_attribute_string_ptr method that distinguishes between empty strings and absent attributes without falling back to C strings
2021-01-01 12:22:17 -05:00
AJR
505860225c util/xmlfile.cpp: C++ comment conversion 2020-12-31 15:26:21 -05:00
Vas Crabb
55b8ca317a -Switch to building MAME as C++17.
* Updated sol2 to 3.2.2
* Updated pugixml to 1.10
* Increased minimum clang version to 6
* Cleaned up some stuff that can use new features
2020-11-15 03:53:47 +11:00
Vas Crabb
0c8938f584 -emu/rendlay.cpp: Allow item animation.
-cgang.cpp: Make internal artwork more fun.
2020-10-05 00:18:33 +11:00
Vas Crabb
ea75c97d6d xmlfile.cpp: Put newline where it’s supposed to go after element content. 2020-09-06 02:33:04 +10:00
Vas Crabb
94601c77cc -util/xmlfile: Escape attribute and element content.
The previous behaviour was unintuitive - parsing an XML file and writing
it out immediately would produce invalid XML if the file contained any
characters that needed escaping.  It makes far more sense to escape on
writing rather than expecting the user to escape input.

-Add preliminary support for visibility toggles to artwork system.

This allows the user to show/hide related elements in a view, with
nesting.  The view can specify whether elements are shown or hidden by
default.  Settings are saved per host window/screen per view.  There is
no way to set the initial visibility state on the command line.  Legacy
"Space Invaders cabinet model" layers are mapped onto visibility
toggles.

This is not stable yet.  In particular, the XML element/attribute names
have not been finalised.  The new features have not been added to
complay.py to prevent them from being used before they're finalised.
2020-09-06 01:41:44 +10:00
Vas Crabb
83ea46d158 Don't ignore config elements with attributes but no child nodes. 2020-09-02 22:10:29 +10:00
Vas Crabb
9445f1d831 frontend: Added option to skip repeated imperfect emulation warnings.
The option is called skip_warnings, and it must be set in ui.ini (it can
be set using the internal UI).  Red warnings cannot be skipped; yellow
warning can be skipped under certain circumstances.

For a yellow warning to be skipped, the system must have been launched
in a way that allows warnings to be displayed, in a configuration with
the same set of devices flagged with unemulated/imperfect features,
within the last seven days, and the warning must have been displayed
within the past 14 days.

Also fixed a bug with display of the MACHINE_NO_COCKTAIL flag in the
internal UI, and increased the size of XML integer attributes to 64
bits.
2020-09-02 17:41:34 +10:00
Oliver Stöneberg
e9f6bd8d01
Revert "fixed some modernize-use-equals-default clang-tidy warnings (… (#6360)
* Revert "fixed some modernize-use-equals-default clang-tidy warnings (nw)"

This reverts commit 54486ab9

* fixed merge error
2020-04-08 11:10:21 -04:00
Oliver Stöneberg
dfaf9dd5bc
fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) 2020-01-30 21:46:27 -05:00
Oliver Stöneberg
4a10205777
fixed some modernize-use-equals-default clang-tidy warnings (nw) (#6237) 2020-01-30 21:45:34 -05:00
firewave
399515c7a7 use C++ library includes (nw) 2020-01-22 13:31:52 +01:00
Vas Crabb
dce955c68d rendlay: allow user variables and repetition in layouts, also add a few more predefined variables 2018-07-22 03:22:31 +10:00
Vas Crabb
bc9d99d58b use C locale for int/float in XML files 2018-01-05 17:12:01 +11:00
Vas Crabb
d7984c7d0c Add a method for copying part of an XML tree into another tree and use it to fix Cocoa debugger fatal error 2017-07-21 13:03:44 +10:00
Vas Crabb
05e84dccc0 * Make XML file a class of its own managed with smart poitners
* Save/restore a little more of Cocoa debugger state
2017-07-21 11:47:41 +10:00
Vas Crabb
c8f1954467 XML refactoring:
* move stuff to namespace util::xml
* scope down some enums
* split config load/save delegate types
* make config load take const so it can't mangle data
2016-12-11 18:15:41 +11:00
Vas Crabb
0757bf61fd Work around buggy standard libraries (nw) 2016-11-21 07:48:43 +11:00
Vas Crabb
1b12a8940b gah, wasn't quite compatible (nw) 2016-11-17 21:04:52 +11:00
Vas Crabb
346e0a8a92 more xmlfile cleanup (nw)
* an empty tag and a self-closing tag are semantically equivalent, so std::string can be used saving some manual allocation
* a valid tag can't have an empty name, so that can be std::string too
* still expose empty strings as nullptr to API users
* scope down the int_format enum
* # is not £ ffs
2016-11-17 20:38:38 +11:00
Vas Crabb
2354a42010 Turn xmlfile API into something that looks like C++
It's still a bit quirky but it's far better encapsulated before, and it plays nice with const (nw)
2016-11-17 01:44:03 +11:00
Miodrag Milanovic
88b5a5c09f Cleanup linux OSD (nw) 2016-10-22 18:42:47 +02:00
Miodrag Milanovic
a6bdefec8c more TRUE/FALSE cleanup (nw) 2016-10-22 16:37:12 +02: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
89c5e1f681 Various cleanups suggested by static analyzer (nw) 2016-04-24 12:58:31 +02:00
Vas Crabb
73b44c9429 Turn core_file into a proper class that gets cleaned up safely using unique_ptr
Subverted somewhat by chd_file class
2016-03-06 21:49:56 +11:00
Miodrag Milanovic
91605d3f4d clang-modernize part 1 (nw) 2015-12-03 18:17:25 +01:00
Miodrag Milanovic
7c19aac60e Rename *.c -> *.cpp in our source (nw) 2015-11-08 12:56:12 +01:00