summaryrefslogtreecommitdiffstatshomepage
path: root/docs/source/techspecs
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-07-31 23:47:16 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-08-01 00:21:19 -0400
commitbb0964f9a284b15851773f5428bd602ca01cc28b (patch)
treee2c7c0dc17e42a88046cf6de8b357daee868b9d9 /docs/source/techspecs
parentd050ba956ed79015389bc2cba7399db9cbd62684 (diff)
Changes to debugger memory address translation
- memory_translate now returns an address space number rather a boolean flag, permitting addresses in part of one space to map to an entirely different space. This is primarily intended to help MCUs which have blocks of internal memory that can be dynamically remapped, but may also allow for more accurate emulation of MMUs that drive multiple external address spaces, since the old limit of four address spaces per MAME device has been lifted. - memory_translate has also been made a const method, in spite of a couple of badly behaved CPU cores that can't honestly treat it as one. - The (read|write)_(byte|word|dword|qword|memory|opcode) accessors have been transferred from debugger_cpu to device_memory_interface, with somewhat modified arguments corresponding to the translate function it calls through to if requested.
Diffstat (limited to 'docs/source/techspecs')
-rw-r--r--docs/source/techspecs/device_memory_interface.rst68
1 files changed, 63 insertions, 5 deletions
diff --git a/docs/source/techspecs/device_memory_interface.rst b/docs/source/techspecs/device_memory_interface.rst
index d38faf8c996..1b338db94d8 100644
--- a/docs/source/techspecs/device_memory_interface.rst
+++ b/docs/source/techspecs/device_memory_interface.rst
@@ -102,14 +102,72 @@ version tests for AS_PROGRAM/AS_0.
5. MMU support for disassembler
-------------------------------
-| bool **translate**\ (int spacenum, int intention, offs_t &address)
+| int **translate**\ (int spacenum, int intention, offs_t &address)
Does a logical to physical address translation through the device's
MMU. spacenum gives the space number, intention the type of the
future access (TRANSLATE_(READ|WRITE|FETCH)(|_USER|_DEBUG)) and
address is an inout parameter with the address to translate and its
-translated version. Should return true if the translation went
-correctly, false if the address is unmapped.
+translated version. This returns the translated space number if
+the translation went correctly, or AS_INVALID if the address is
+unmapped.
-Note that for some historical reason the device itself must override
-the virtual method **memory_translate** with the same signature.
+Note that the device itself must override the virtual method
+**memory_translate** with the same signature.
+
+
+| u8 **read_byte**\ (int spacenum, offs_t address, int intention)
+
+Returns a byte from the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_READ(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| u16 **read_word**\ (int spacenum, offs_t address, int intention)
+
+Returns a word from the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_READ(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| u32 **read_dword**\ (int spacenum, offs_t address, int intention)
+
+Returns a dword from the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_READ(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| u64 **read_qword**\ (int spacenum, offs_t address, int intention)
+Returns a qword from the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_READ(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| u64 **read_memory**\ (int spacenum, offs_t address, int size, int intention)
+Returns 1, 2, 4 or 8 bytes from the specified memory space, as per
+**read_byte**, **read_word**, **read_dword** or **read_qword**.
+
+| void **write_byte**\ (int spacenum, offs_t address, u8 data, int intention)
+Writes a byte to the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_WRITE(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| void **write_word**\ (int spacenum, offs_t address, u16 data, int intention)
+Writes a word to the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_WRITE(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| void **write_dword**\ (int spacenum, offs_t address, u32 data, int intention)
+Writes a dword to the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_WRITE(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| void **write_qword**\ (int spacenum, offs_t address, u64 data, int intention)
+Writes a qword to the specified memory space, doing address
+translation if requested. The intention must be specified as either
+TRANSLATE_WRITE(|_USER|_DEBUG) or TRANSLATE_NONE.
+
+| void **write_memory**\ (int spacenum, offs_t address, u64 data, int size, int intention)
+Writes 1, 2, 4 or 8 bytes to the specified memory space, as per
+**write_byte**, **write_word**, **write_dword** or **write_qword**.
+
+| u64 read_opcode(int spacenum, offs_t offset, int size)
+Reads 1, 2, 4 or 8 bytes at the given offset from the specified
+opcode space. This calls **translate** with TRANSLATE_FETCH_DEBUG
+as the intention.