Commit Graph

2671 Commits

Author SHA1 Message Date
Vas Crabb
ac270744f3 Fix most implicit fallthrough warnings from clang 2020-11-17 09:18:37 +11:00
Vas Crabb
fee9a29a57 osd/modules/input: Fixed a couple of X11 resource leaks. 2020-11-16 16:14:18 +11:00
Vas Crabb
4298ce18fb Enable GCC implicit fallthrough warning.
I've guessed whether break or [[fallthrough]] is appropriate.  In cases
where it looked particularly suspicious, I added a FIXME comment.  All
of these changes should be reviewed by someone familiar with the code.
2020-11-15 03:58:54 +11: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
Lucien Murray-Pitts
1b9b9c9509
Add "n2a03" (6502 CPU clone) to gdbstub for NES, and swapped 6502 PC/SP to SP/PC (#7440) 2020-11-07 08:57:56 +11:00
Gustavo Del Dago
4493d92a2c Add m6809 support for gdb remote debugger. 2020-11-07 08:54:39 +11:00
Vas Crabb
cf7fe1e04d -bus/a2bus: Added Apple II Parallel Printer Interface Card.
-frontend/mame/audit.cpp: Fixed another annoying edge case.

-Cleaned up RawInput code slightly.
2020-11-01 00:37:28 +11:00
Vas Crabb
d6f7c7febf emu/debug: Removed more macros, added more const, make a couple more things use smart pointers. 2020-10-12 19:06:54 +11:00
Vas Crabb
d822e7ec4a Miscellaneous cleanup:
* osd/windows: Use steady clock for timing double-clicks.
* emu/uiinput.cpp: Made the event type a scoped enum.
2020-10-10 03:11:01 +11:00
Vas Crabb
b90fd35515 Various improvements to image file handling:
Moved MS DIB parser out of ICO file reader and made it available for
artwork and layout images.

Added more efficient I/O and better error checking for JPEG file loading
(MAME will no longer exit immediately on a bad JPEG file).

Made caller responsible for opening files for loading images, to avoid
decompressing images used in ZIP/7z artwork multiple times.

Added support for JPEG and Windows DIB to picture_image_device.

Added support for SVG image files in external artwork.

Added support for using I/O port value for animation state and masking
animation state values.

Made bounds elements more flexible in layouts.

Reworked headers to reduce dependencies.

Updated layout file format documentation.
2020-10-08 02:04:31 +11:00
Miodrag Milanović
fd6cf3c18b
Fix stray space char in osd_opengl.h 2020-10-03 14:00:45 +02:00
Vas Crabb
ae3560c57c emu/render.cpp: Consider that screens can be hidden when choosing a default view. 2020-10-03 04:52:06 +10:00
Vas Crabb
4f05917494 Got rid of global_alloc/global_free.
The global_alloc/global_free functions have outlived their usefulness.
They don't allow consistently overriding the default memory allocation
behaviour because they aren't used consistently, and we don't have
standard library allocator wrappers for them that we'd need to use them
consistently with all the standard library containers we're using.  If
you need to change the default allocator behaviour, you can override the
new/delete operators, and there are ways to get more fine-grained
control that way.  We're already doing that to pre-fill memory in debug
builds.

Code was already starting to depend on global_alloc/global_free wrapping
new/delete.  For example some parts of the code (including the UI and
Windows debugger) was putting the result of global_alloc in a
std::unique_ptr wrappers without custom deleters, and the SPU sound
device was assuming it could use global_free to release memory allocated
with operator new.  There was also code misunderstanding the behaviour
of global_alloc, for example the GROM port cartridge code was checking
for nullptr when a failure will actually throw std::bad_alloc.

As well as substituting new/delete, I've made several things use smart
pointers to reduce the chance of leaks, and fixed a couple of leaks,
too.
2020-10-03 03:00:24 +10:00
Vas Crabb
3b59cb8860 -Got rid of most of the remaining problematic uses of make_unique_clear.
-sound/discrete.cpp: Use C++ std::vector and range-based for.
2020-09-30 14:10:43 +10:00
Emmanuel Vadot
e996e148f3
FreeBSD fixes (#7295)
* psixptty: Fix for FreeBSD

We need to check for __FreeBSD__ not __FreeBSD_kernel__

* FreeBSD: Use gl includes from pkg-config

FreeBSD doesn't install the includes from 3rdparty software in a default
location so use pkg-config to get the correct path.

* FreeBSD: genieos is named simple bsd
2020-09-27 20:41:14 +10:00
Vas Crabb
a1d35e5abf Cleaned up bitmap API.
Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return
const-qualified references/pointers to pixesl, and added non-const
versions.  This makes bitmap more like standard library containers where
const protects the content as well as the dimensions.

Made the templated pixt accessor protected - having it public makes it
too easy to inadvertently get a pointer to the wrong location.

Removed the pix(8|16|32|64) accessors from the specific bitmaps.  You
could only use the "correct" one anyway, and having the "incorrect" ones
available prevented explicit instantiations of the class template
because the static assertions would fail.  You can still see the pixel
type in the bitmap class names, and you can't assign the result of
&pix(y, x) to the wrong kind of pointer without a cast.

Added fill member functions to the specific bitmap template, and added
a explicit instantiations.  This allows the bitmap size check to be
skipped on most bitmap fills, although the clipping check is still
there.  Also fixed a couple of places that were trying to fill an
indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with
zero to get the same net effect).  The explicit template instantiations
in the .cpp file mean the compiler can inline the function if necessary,
but don't need to generate a local out-of-line body if it chooses not
to.

Extended the size of the fill value parameter in the base bitmap class
to 64 bits so it works correctly for 64-bit bitmaps.

Fixed places where IE15 and VGM visualiser weren't accounting for row
bytes potentially being larger than width.

Fixed an off-by-one in an HP-DIO card where it was treating the Topcat
cursor right edge as exclusive.

Updated everything to work with the API changes, reduced the scope of
many variables, added more const, and replaced a few fill/copy loops
with stuff from <algorithm>.
2020-09-27 14:00:42 +10:00
Vas Crabb
b1b3b92b4b osd/windows: Don't restrict borderless full-screen windows to monitor work area (MT07745). 2020-09-12 22:45:06 +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
Rhett Aultman
17cd4dcb3b
Drop MASK from taputil.sh (#7162) 2020-08-31 16:15:46 -04:00
hap
057458b168 windows: reduce minimum window height (nw) 2020-06-26 15:33:53 +02:00
hap
e508e8a3f9 windows: more lenient with resizing very large views in windowed mode (nw) 2020-06-25 15:07:18 +02:00
hap
ed4e373546 drawd3d: properly clean up d3dintf (nw) 2020-06-21 20:10:18 +02:00
Ryan Holtz
520e5aea0d -bgfx: Don't try to invoke a frame immediately after resetting the renderer during tear-down. Fixes crash on exit with the d3d12 backend. [Ryan Holtz] 2020-06-20 15:37:15 +02:00
Ryan Holtz
9cc98f0b62 -bgfx: Corrected a data overrun in the d3d12 backend from allocating only enough texture data for width*height, not rowpixels*height. [Ryan Holtz] 2020-06-20 15:37:14 +02:00
Vas Crabb
5d4b8530d1 looks like I64 size qualifier is only needed for MSYS64 GCC 9 and earlier (nw) 2020-06-02 19:18:20 +10:00
Ryan Holtz
03230cb5d9 MAME Testers Bugs Fixed
-----------------------
07536: [Graphics] Prescale option does not work properly on D3D renderer (Ryan Holtz)

-renderer/d3d: Removed old StretchRect code. All drivers these days punt it to a shader backend anyway, and it's causing issues with -prescale. [Ryan Holtz]
2020-05-28 16:28:17 +02:00
Olivier Galibert
dbfff24288 Last memory change fixes (nw) 2020-05-25 19:42:26 +02:00
AJR
0fa6e7eb86 Debugger expression and memory access overhaul
- Memory references in expressions no longer default to the console's visible CPU if no device name was specified, except when entered through the console itself. Expressions in view windows now use the context of the currently selected device instead.
- The pcatmem debug command and similar qt mouseover function now produce an error message if the initial address translation fails.

Related internal changes (nw)
- The debugger_cpu class no longer interprets memory accesses. The existing routines have been moved into symbol_table (which used to invoke them as callbacks), and reimplemented in most other places. Thecode duplication is a bit messy, but could be potentially improved in the future with new utility classes.
- The cheat engine no longer needs to hook into the debugger_cpu class or instantiate a dummy instance of it.
- The inclusion of debug/express.h within emu.h has been undone. Some debugging structures now need unique_ptr to wrap the resulting incomplete classes; hopefully the performance impact of this is negligible. Another direct consequence is that the breakpoint, watchpoint and registerpoint classes are no longer inside device_debug and have their own source file.
- The breakpoint list is now a std::multimap, using the addresses as keys to hopefully expedite lookup.
- The visible CPU pointer has been removed from the debugger_cpu class, being now considered a property of the console instead.
- Many minor bits of code have been simplified.
2020-05-25 11:15:39 -04:00
AJR
f416607d19 OS X debugger: Avoid crashing when a nonexistent disassembly or memory view is selected (which may happen automatically with .cfg files) 2020-04-20 09:52:10 -04:00
AJR
b1bb8b0a02 font_osx.cpp: Why does Apple even have these macros? They're not expected to be defined on older MacOS versions... (nw) 2020-04-08 22:49:17 -04:00
arbee
6a59756b31 Mac: Use Arial Unicode MS as the default font (fixes missing glyphs in many layouts) and fixed deprecation warnings [R. Belmont] 2020-04-08 22:39:56 -04: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
Olivier Galibert
72a9d1409a Hey Travis, go test that for me, thanks (nw) 2020-03-31 21:49:13 +02:00
Olivier Galibert
c3c45bb12f Fix some deprecations (nw) 2020-03-31 14:46:55 +02:00
MetalliC
6c3e7c9782 document some error (nw) 2020-02-15 00:41:56 +02:00
Vas Crabb
aecb7fa019 copy-paste error (nw) 2020-01-31 19:04:19 +11:00
Vas Crabb
3536bbdd71 there are reasons for things being the way they were (nw) 2020-01-31 14:53:46 +11: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
Oliver Stöneberg
059243f68e
fixed some clang-tidy warnings (nw) (#6236)
* fixed some modernize-redundant-void-arg clang-tidy warnings (nw)

* fixed some modernize-use-bool-literals clang-tidy warnings (nw)

* fixed some modernize-use-emplace clang-tidy warnings (nw)

* fixed some performance-move-const-arg clang-tidy warnings (nw)

* fixed some readability-redundant-control-flow clang-tidy warnings (nw)

* fixed some readability-redundant-string-cstr clang-tidy warnings (nw)

* fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
2020-01-30 20:01:48 -05:00
couriersud
6251391508 Revert accidentally committed changes. (nw) 2020-01-25 16:47:47 +01:00
couriersud
ea1897f605 segas16b: Added analog filters. [Couriersud]
Analog filters added to systems with YM2151 and UPD7759.
Reviewers can use USE_NL define to produce unfiltered sound.
2020-01-25 15:35:28 +01:00
smf-
92bd148e05 fix build with clang 9.0.0 on windows
../../../../../src/osd/modules/input/input_winhybrid.cpp:107:16: error: suggest braces around initialization of
      subobject [-Werror,-Wmissing-braces]
                : m_variant({0})
2020-01-24 00:59:30 +00:00
R. Belmont
1a5b900759
Merge pull request #6195 from firewave/includes
use C++ library includes (nw)
2020-01-22 22:04:35 -05:00
Oliver Stöneberg
7c3aea8928 fixed some clang-tidy warnings (nw) (#6197)
* fixed some bugprone-throw-keyword-missing clang-tidy warnings (nw)

* fixed some modernize-use-nullptr clang-tidy warnings (nw)

* fixed some readability-delete-null-pointer clang-tidy warnings (nw)

* fixed some performance-faster-string-find clang-tidy warnings (nw)

* fixed some performance-for-range-copy clang-tidy warnings (nw)

* fixed some readability-redundant-string-cstr clang-tidy warnings (nw)
2020-01-22 22:03:35 -05:00
firewave
399515c7a7 use C++ library includes (nw) 2020-01-22 13:31:52 +01:00
AJR
197c94ceac input_sdl: Process control characters so that the natural keyboard can see them (SDL normally strips these out)
Don't strip linefeed characters (Ctrl-J) from natural keyboard input except when pasting strings
2020-01-10 12:09:15 -05:00
hap
1329bdb412 video: higher maximum prescale (nw) 2020-01-05 15:44:30 +01:00
hap
2ba885922a opengl: clamp to edge, same as the other renderers (nw) 2020-01-04 20:29:14 +01:00
Stiletto
88909dc0d0
Happy New Year 2020 (nw) (#6128)
Happy New Year 2020 (nw) (#6128)
2020-01-04 01:13:50 -05:00