summaryrefslogtreecommitdiffstatshomepage
path: root/docs/source/debugger
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-10-19 10:01:02 +1100
committer Vas Crabb <vas@vastheman.com>2021-10-19 10:01:02 +1100
commit7834d689bd27efdb80f4ee724bfd3daec30fdbf4 (patch)
tree1aaf2385d66088b223bf04baa5b1e18633a67e30 /docs/source/debugger
parentbc9a945c6bed02c14564e84981c964dabb94da8a (diff)
-docs: Documented debugger's built-in functions for expressions.
-Fixed a couple of coverity warnings.
Diffstat (limited to 'docs/source/debugger')
-rw-r--r--docs/source/debugger/cheats.rst4
-rw-r--r--docs/source/debugger/index.rst36
2 files changed, 38 insertions, 2 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 <debugger-command-cheatinit>`::
>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 <debugger-command-cheatnext>` 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 <debugger-command-cheatlist>` 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(<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).