-docs: Documented debugger's built-in functions for expressions.

-Fixed a couple of coverity warnings.
This commit is contained in:
Vas Crabb 2021-10-19 10:01:02 +11:00
parent bc9a945c6b
commit 7834d689bd
5 changed files with 42 additions and 5 deletions

View File

@ -30,7 +30,7 @@ infinite lives cheat for Raiden (``raiden``):
:ref:`cheatinit command <debugger-command-cheatinit>`:: :ref:`cheatinit command <debugger-command-cheatinit>`::
>cheatinit ub >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 36928 cheat locations initialized for NEC V30 ':maincpu' program space
* Allow the game to run, lose a life and break into the debugger. * Allow the game to run, lose a life and break into the debugger.
* Use the :ref:`cheatnext command <debugger-command-cheatnext>` to * Use the :ref:`cheatnext command <debugger-command-cheatnext>` to
@ -43,7 +43,7 @@ infinite lives cheat for Raiden (``raiden``):
>cheatnext -,1 >cheatnext -,1
Address=0B85 Start=03 Current=01 Address=0B85 Start=03 Current=01
1 cheat found 1 cheats found
* Use the :ref:`cheatlist command <debugger-command-cheatlist>` to save * Use the :ref:`cheatlist command <debugger-command-cheatlist>` to save
the cheat candidate to a file:: the cheat candidate to a file::

View File

@ -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 Memory accesses can be used as both lvalues and rvalues, so you can write
``b@100 = ff`` to store a byte in memory. ``b@100 = ff`` to store a byte in memory.
Functions
~~~~~~~~~
The debugger supports a number of useful utility functions in expressions.
min(<a>, <b>)
Returns the lesser of the two arguments.
max(<a>, <b>)
Returns the greater of the two arguments.
if(<cond>, <trueval>, <falseval>)
Returns **<trueval>** if **<cond>** is true (non-zero), or
**<falseval>** otherwise. Note that the expressions for
**<trueval>** and **<falseval>** are both evaluated irrespective of
whether **<cond>** is true or false.
abs(<x>)
Reinterprets the argument as a 64-bit signed integer and returns the
absolute value.
bit(<x>, <n>[, <w>])
Extracts and right-aligns a bit field **<w>** bits wide from **<x>**
with least significant bit position position **<n>**, counting from
the least significant bit. If **<w>** is omitted, a single bit is
extracted.
s8(<x>)
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(<x>)
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(<x>)
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).

View File

@ -211,7 +211,7 @@ The system and software selection menus use additional controls
**Shift+Tab** **Shift+Tab**
Moves keyboard/controller focus to the previous UI panel. Moves keyboard/controller focus to the previous UI panel.
**Left Alt+F** **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. list.
**Left Alt+E** **Left Alt+E**
Exports the currently displayed list of systems. 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 or software list item. (Shows information loaded by the data plugin from
external files, including history.xml and mameinfo.dat.) external files, including history.xml and mameinfo.dat.)
**F1** **F1**
Audits system ROMs. Audits system ROMs and disk images.
.. _default-arcade-keys: .. _default-arcade-keys:

View File

@ -53,6 +53,7 @@ menu_audit::menu_audit(mame_ui_manager &mui, render_container &container)
, m_current(nullptr) , m_current(nullptr)
, m_cancel(false) , m_cancel(false)
, m_phase(phase::CONFIRMATION) , m_phase(phase::CONFIRMATION)
, m_fast(true)
{ {
std::string filename(emulator_info::get_configname()); std::string filename(emulator_info::get_configname());
filename += "_avail.ini"; filename += "_avail.ini";

View File

@ -83,7 +83,7 @@ menu_dats_view::menu_dats_view(mame_ui_manager &mui, render_container &container
, m_parent(swinfo->parentname) , m_parent(swinfo->parentname)
{ {
if (swinfo && !swinfo->infotext.empty()) if (!swinfo->infotext.empty())
m_items_list.emplace_back(_("Software List Info"), 0, ""); m_items_list.emplace_back(_("Software List Info"), 0, "");
std::vector<std::string> lua_list; std::vector<std::string> 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)) if (mame_machine_manager::instance()->lua()->call_plugin("data_list", std::string(m_short).append(1, ',').append(m_list).c_str(), lua_list))