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 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'docs/source/debugger') 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). -- cgit v1.2.3-70-g09d2