summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/cheat.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* cheatopt: add the global cheat enable toggle to the menu hap2024-02-111-3/+5
|
* Various updates, mostly around Lua: Vas Crabb2023-03-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compile Lua as C++. When Lua is compiled as C, it uses setjmp/longjmp for error handling, resulting in failure to unwind intermediate stack frames. Trying to ensure no objects with non-trivial destructors are in scope when raising a Lua error is error-prone. In particular, converting an exception to a Lua error becomes convoluted, and raising a Lua error from a constructor is effectively impossible. Updated Lua to 5.4.4 - this includes a brand-new garbage collector implementation with better performance. The main thing removed is the deprecated bitlib. Updated sol2 to version 3.3.0 - this adds support for Lua 5.4 and fixes a number of issues, including not correctly handling errors when Lua is built as C++. Updated LuaFileSystem to version 1.8.0 - this adds support for symbolic links on Windows, as well as Lua 5.4 compatibility. Updated LuaSQLite3 to version 0.9.5 - this fixes issues in multi-threaded environments, as well as Lua 5.4 compatibility. Fixed double-free after attempting to construct a debugger expression from Lua with an invalid string, and exposed expression error to Lua in a better way. Added warning level print function to Lua. Fixed saving cheats with shift operators in expressions, although this code isn't actually used as there's no cheat editor.
* Remove fileio.h from emu.h AJR2022-02-111-0/+1
|
* Clean up various loose ends: Vas Crabb2022-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | frontend: Exposed debug symbol tables and parsed expressions to Lua (these can be used when the debugger is not active). Also made it simpler to walk input types. imagedev/bitbngr.cpp: Added software list loader support (used by sitcom). sitcom.cpp: Replaced bankdev with a memory view. Also added a bar graph for the timer DAC output, and made the DL1414 displays squarer in the layout like they are in real life. They still don't look right because the internal segment drawing code doen't draw the segments the right width. docs: Fixed broken links and added missing links in command line options index. Also removed documentation for an option that no longer exists and fixed some inconsistent terminology. Separated includes by module in various drivers.
* frontend: Use util::core_file instead of emu_file where applicable AJR2022-01-301-6/+6
|
* A little more refactoring, and Coverity fixes: Vas Crabb2021-11-251-0/+7
| | | | | | | | | | * emu/ioport.h: Marked PORT_RESET deprecated. * emu/rendlay.cpp: Removed old dot matrix components. * emu/rendlay.cpp: Added warning message for reel components. * Changed a few more fruit machines to eliminate reel components; also made the reel lamps simpler and more efficient in these layouts. * emu, frontend: Fixed various errors reported by Coverity, one of which actaully breaks stuff.
* frontend: Cleaned up rendering of info views. Vas Crabb2021-10-171-8/+11
| | | | | | | | | | | | | | | | | | | | | | Put the description for systems in the info box - it's useful for the fruit machines with very long names that are truncated in the list. Also stopped truncating manufactuer and parent name in the info box. Made the text layout class capable of handling lines containing combinatations of left/centre/right-justified text and got rid of the legacy UI manager text wrapping function. Made the system/software selection menus and the info viewer share the same code for formatting info text. This means the multi-column layout works properly in the info viewer now, and the code is a lot simpler. Also the system/software selection menus don't have to redo the text layout every frame now. Made the info viewer update the text layout if the output aspect ratio changes, and cleaned up more legacy code. The lines in the info viewer are no longer bogus "menu items", and there's a lot less special-case code to support it in the base menu class. This commit includes an update to the Chinese translations from YuiFAN.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-3/+3
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* Use std::clamp in more source files AJR2021-08-151-1/+2
|
* Much more core std::string_view modernization AJR2021-01-201-1/+2
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* C++17 string handling updates (without charconv so as not to break GCC 7) AJR2020-12-081-14/+14
| | | | | | - render.cpp, rendlay.cpp, ui/ui.cpp, ui/menu.cpp: Change argument types for text processing functions from const char * to std::string_view - ui/menu.cpp: Add overloads of item_append omitting the frequently empty subtext argument - cheat.cpp: Remove some c_str() calls that became unnecessary a while ago
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* -Switch to building MAME as C++17. Vas Crabb2020-11-151-1/+1
| | | | | | | * 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
* Debugger expression and memory access overhaul AJR2020-05-251-17/+2
| | | | | | | | | | | | | - 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.
* Make expressions octal for applicable address spaces in disassembly view AJR2020-04-131-7/+7
| | | | | | | | | | debug/express.cpp, debugcpu.cpp: General cleanup (nw) - Change default base from hardcoded macro to dynamic parameter for parsed_expression - Change symbol table parameters and variables to references or std::reference_wrapper - Remove the (unused) ability to construct a parsed_expression without a symbol table - Eliminate symbol_table &table and void *memory_param arguments from callbacks (superfluous now that std::function can bind everything necessary) - Eliminate globalref pointer from symbol_table - Add explicitly defaulted move constructor and move assignment operator
* (nw) Cleanup on the way: Vas Crabb2020-03-101-13/+13
| | | | | | | | | | * 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.
* use C++ library includes (nw) firewave2020-01-221-1/+1
|
* Spring cleaning: Vas Crabb2019-11-011-3/+6
| | | | | | | | | | | | * Changed emu_fatalerror to use util::string_format semantics * Fixed some incorrectly marked up stuff in build scripts * Make internal layout compression type a scoped enum (only zlib is supported still, but at least the values aren't magic numbers now) * Fixed memory leaks in Xbox USB * There can only be one "perfect quantum" device - enforce that only the root machine can set it, as allowing subdevices to will cause weird issues with slot cards overiding it * Allow multiple devices to set maximum quantum and use the most restrictive one (it's maximum quantum, it would be minimum interleave) * Got rid of device_slot_card_interface as it wasn't providing value * Added a helper template to reduce certain kinds of boilerplate in slots/buses * Cleaned up some particularly bad slot code (plenty more of that to do), and made some slots more idiomatic
* Spelling (#5796) Zoë Blade2019-10-241-1/+1
| | | | | | | | | | | | * Tidy up comments * Fix typos * Fix spelling * Tidy * Tidy
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-2/+2
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* Refactored UI font metrics (#5291) npwoods2019-06-301-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed the various usages of UI_*COLOR to be calls to src/frontend/mame/ui/moptions.h The various UI_*COLOR macros were implemented as calls to decode_ui_color, which cached the values for the various options in a static array, which was obviously a gross hack. This refactoring is strategic because I am trying to confine awareness of mame_ui_manager to code in src/frontend/mame/ui, and the implementation of decode_ui_color() relied on the ability to access mame_ui_manager as a singleton from outside this code. * Created a ui_colors object, so that queries for UI RGB values would not always require parsing strings * Replaced UI_TARGET_FONT_[ROWS|HEIGHT] and UI_BOX_[LR|TD]_BORDER macros with property calls These macros were implemented with a call to a function (get_font_rows()) that opportunistically stashed the results of option accesses in static variables; in other words, a gross hack Because get_font_rows() attempted to access mame_ui_manager as a singleton, it was an obstactle to providing an alternative implementation of ui_manager * Remove stray debugging cruft that found a way into the other PR
* (nw) misc cleanup: start replacing auto_alloc_* with smart pointers, get Vas Crabb2017-12-011-4/+4
| | | | | rid of reference constants in the debugger in favour of capturing the value in the bind/lambda (less ugly casting)
* * Make XML file a class of its own managed with smart poitners Vas Crabb2017-07-211-2/+2
| | | | * Save/restore a little more of Cocoa debugger state
* device_image_interface cleanups (nw) AJR2017-02-271-1/+1
| | | | | | | - 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.
* small cleanup (nw) Vas Crabb2017-02-021-11/+6
|
* Don't crash on bad cheat expressions, also make the code look more like ↵ Vas Crabb2017-02-021-288/+306
| | | | 'enterprise-grade' C++
* XML refactoring: Vas Crabb2016-12-111-21/+21
| | | | | | | * 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
* more xmlfile cleanup (nw) Vas Crabb2016-11-171-7/+6
| | | | | | | | * 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
* Turn xmlfile API into something that looks like C++ Vas Crabb2016-11-171-45/+45
| | | | It's still a bit quirky but it's far better encapsulated before, and it plays nice with const (nw)
* Do not use FUNC in delegate where applicable (nw) Miodrag Milanovic2016-11-061-1/+1
|
* Improvements to rgb_t (nw) AJR2016-10-221-1/+1
| | | | | | | - Make most class methods constexpr - Make color constants (white, black, etc.) into constexpr factory methods, in order to fix a static initialization problem discussed on the MAMEWorld forums. (Note that while C++14 allows constexpr member variables to be initialized outside classes, current compilers' support for C++14 constexpr rules has proven to be lamentably deficient.) - Create bitmap_rgb32::erase to simplify syntax in update handlers
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-34/+34
| | | | | 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
* Really fix -debug -cheat crash this time, nw therealmogminer@gmail.com2016-08-271-2/+6
|
* Save a few lines (nw) Vas Crabb2016-08-191-16/+3
|
* make path_iterator hold onto its search path Vas Crabb2016-08-191-2/+2
|
* cleanup of some conversions (nw) Miodrag Milanovic2016-07-311-1/+1
|
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-4/+4
| | | | to inline functions (nw)
* Reduce repeated string allocation in audit code [Vas Crabb] Vas Crabb2016-07-111-9/+9
|
* UI refactoring: [Vas Crabb] Vas Crabb2016-07-101-1/+1
| | | | | | | | | * std::bind - accept no substitutes * pointer -> reference conversion * make more menu members private or protected * don't play so fast and loose with integer types * reduce some vector copying * make more static constants const
* Cleanup and version bumpmame0175 Miodrag Milanovic2016-06-291-3/+3
|
* cheat: step one item at a time and write valid xml (nw) cracyc2016-06-231-1/+2
|
* Fixed compile error: Robbbert2016-06-191-1/+1
| | | | | | error: expected identifier before numeric constant OPAQUE error: expected '}' before numeric constant error: expected unqualified-id before numeric constant
* Use ui::text_layout::text_layout and ui::text_layout::word_wrapping enums Nathan Woods2016-06-181-9/+9
|
* Fix crashing where cheat enabled (nw) Miodrag Milanovic2016-06-121-2/+4
|
* Major refactoring of debugger core [Ryan Holtz] therealmogminer@gmail.com2016-06-081-2/+2
| | | | | | | | * Eliminate globals/file statics * Remove lots of stuff from global scope * Use std::function for custom command registration * Eliminate some trampolines * Build fixes from Vas Crabb and balr0g
* using std::vector<std::unique_ptr<xxx>> instead of simple_list<xxx> in cheat ↵ Miodrag Milanovic2016-06-021-57/+59
| | | | engine (nw)
* ui refactoring [Vas Crabb] Vas Crabb2016-05-271-5/+5
| | | | | | | * move menu classes into ::ui namesapce * reduce scope of many symbols (first step in making UI code less rage-inducing so I can fix text input)
* Relieve UI menus and such from having to constantly fetch UI object from ↵ AJR2016-04-261-4/+5
| | | | global state (nw)
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-2/+2
|
* Split UI and frontend part from core [Miodrag Milanovic] Miodrag Milanovic2016-04-231-0/+1446