From 7834d689bd27efdb80f4ee724bfd3daec30fdbf4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 19 Oct 2021 10:01:02 +1100 Subject: -docs: Documented debugger's built-in functions for expressions. -Fixed a couple of coverity warnings. --- docs/source/debugger/cheats.rst | 4 ++-- docs/source/debugger/index.rst | 36 +++++++++++++++++++++++++++++++++++ docs/source/usingmame/defaultkeys.rst | 4 ++-- src/frontend/mame/ui/auditmenu.cpp | 1 + src/frontend/mame/ui/datmenu.cpp | 2 +- 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/docs/source/debugger/cheats.rst b/docs/source/debugger/cheats.rst index 24e1e1d0440..0e8bdea5c60 100644 --- a/docs/source/debugger/cheats.rst +++ b/docs/source/debugger/cheats.rst @@ -30,7 +30,7 @@ infinite lives cheat for Raiden (``raiden``): :ref:`cheatinit command `:: >cheatinit ub - MAME debugger version 0.236 (mame0236-190-gf7a8ad4fc7d-dirty) + MAME debugger version 0.237 (mame0237) 36928 cheat locations initialized for NEC V30 ':maincpu' program space * Allow the game to run, lose a life and break into the debugger. * Use the :ref:`cheatnext command ` to @@ -43,7 +43,7 @@ infinite lives cheat for Raiden (``raiden``): >cheatnext -,1 Address=0B85 Start=03 Current=01 - 1 cheat found + 1 cheats found * Use the :ref:`cheatlist command ` to save the cheat candidate to a file:: diff --git a/docs/source/debugger/index.rst b/docs/source/debugger/index.rst index 0730a607688..4d8f8cffa45 100644 --- a/docs/source/debugger/index.rst +++ b/docs/source/debugger/index.rst @@ -387,3 +387,39 @@ access type) requires a tag to be specified. Memory accesses can be used as both lvalues and rvalues, so you can write ``b@100 = ff`` to store a byte in memory. + + +Functions +~~~~~~~~~ + +The debugger supports a number of useful utility functions in expressions. + +min(, ) + Returns the lesser of the two arguments. +max(, ) + Returns the greater of the two arguments. +if(, , ) + Returns **** if **** is true (non-zero), or + **** otherwise. Note that the expressions for + **** and **** are both evaluated irrespective of + whether **** is true or false. +abs() + Reinterprets the argument as a 64-bit signed integer and returns the + absolute value. +bit(, [, ]) + Extracts and right-aligns a bit field **** bits wide from **** + with least significant bit position position ****, counting from + the least significant bit. If **** is omitted, a single bit is + extracted. +s8() + Sign-extends the argument from 8 bits to 64 bits (overwrites bits 8 + through 63, inclusive, with the value of bit 7, counting from the + least significant bit). +s16() + Sign-extends the argument from 16 bits to 64 bits (overwrites bits + 16 through 63, inclusive, with the value of bit 15, counting from + the least significant bit). +s32() + Sign-extends the argument from 32 bits to 64 bits (overwrites bits + 32 through 63, inclusive, with the value of bit 31, counting from + the least significant bit). diff --git a/docs/source/usingmame/defaultkeys.rst b/docs/source/usingmame/defaultkeys.rst index d71e4208103..2992e31cb41 100644 --- a/docs/source/usingmame/defaultkeys.rst +++ b/docs/source/usingmame/defaultkeys.rst @@ -211,7 +211,7 @@ The system and software selection menus use additional controls **Shift+Tab** Moves keyboard/controller focus to the previous UI panel. **Left Alt+F** - Adds or removes the selected system or software list time from the favorites + Adds or removes the selected system or software list item from the favorites list. **Left Alt+E** Exports the currently displayed list of systems. @@ -220,7 +220,7 @@ The system and software selection menus use additional controls or software list item. (Shows information loaded by the data plugin from external files, including history.xml and mameinfo.dat.) **F1** - Audits system ROMs. + Audits system ROMs and disk images. .. _default-arcade-keys: diff --git a/src/frontend/mame/ui/auditmenu.cpp b/src/frontend/mame/ui/auditmenu.cpp index afe54aeaf69..9c93cf361bd 100644 --- a/src/frontend/mame/ui/auditmenu.cpp +++ b/src/frontend/mame/ui/auditmenu.cpp @@ -53,6 +53,7 @@ menu_audit::menu_audit(mame_ui_manager &mui, render_container &container) , m_current(nullptr) , m_cancel(false) , m_phase(phase::CONFIRMATION) + , m_fast(true) { std::string filename(emulator_info::get_configname()); filename += "_avail.ini"; diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index d77d3510e00..1d3ef0c7cff 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -83,7 +83,7 @@ menu_dats_view::menu_dats_view(mame_ui_manager &mui, render_container &container , m_parent(swinfo->parentname) { - if (swinfo && !swinfo->infotext.empty()) + if (!swinfo->infotext.empty()) m_items_list.emplace_back(_("Software List Info"), 0, ""); std::vector lua_list; if (mame_machine_manager::instance()->lua()->call_plugin("data_list", std::string(m_short).append(1, ',').append(m_list).c_str(), lua_list)) -- cgit v1.2.3