diff options
| author | 2023-07-24 13:36:12 +0200 | |
|---|---|---|
| committer | 2026-01-07 08:01:34 +0100 | |
| commit | 63a40168225a343dcc9a4098daedbdc8e7a371eb (patch) | |
| tree | 0e8ee696536cfe43225f84847f4cce5958b013b6 /src/emu/debug/debugcon.cpp | |
| parent | f528cd6210bfc15b277ed3ff428a4973b9b912a5 (diff) | |
lisa: Massive updates
core: Better support for external mmus
Note: I didn't expect to push that one right now, it's missing
documentation among other things, but since some people seems to be
interested to work on that driver I don't want to hold them.
Diffstat (limited to 'src/emu/debug/debugcon.cpp')
| -rw-r--r-- | src/emu/debug/debugcon.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp index bfcb6a0a417..3bf0f80021f 100644 --- a/src/emu/debug/debugcon.cpp +++ b/src/emu/debug/debugcon.cpp @@ -657,6 +657,14 @@ bool debugger_console::validate_number_parameter(std::string_view param, u64 &re } } +bool debugger_console::validate_number_parameter(std::string_view param, offs_t &result) +{ + u64 res; + bool ret = validate_number_parameter(param, res); + result = res; + return ret; +} + /// \brief Validate parameter as a device /// @@ -764,14 +772,14 @@ bool debugger_console::validate_cpu_parameter(std::string_view param, device_t * /// default address space number is negative, the first address space /// exposed by the device will be used as the default. /// \param [in] The parameter string. -/// \param [in] spacenum The default address space index. If negative, +/// \param [inout] spacenum The default address space index. If negative, /// the first address space exposed by the device (i.e. the address -/// space with the lowest index) will be used as the default. -/// \param [out] result The addresfs space on success, or unchanged on -/// failure. +/// space with the lowest index) will be used as the default and +/// returned +/// \param [out] mintf Memory interface of the device when found /// \return true if the parameter refers to an address space in the /// current system, or false otherwise. -bool debugger_console::validate_device_space_parameter(std::string_view param, int spacenum, address_space *&result) +bool debugger_console::validate_device_space_parameter(std::string_view param, int &spacenum, device_memory_interface *&mintf) { device_t *device; std::string spacename; @@ -837,8 +845,7 @@ bool debugger_console::validate_device_space_parameter(std::string_view param, i } // ensure the device implements the memory interface - device_memory_interface *memory; - if (!device->interface(memory)) + if (!device->interface(mintf)) { printf("No memory interface found for device %s\n", device->name()); return false; @@ -847,11 +854,8 @@ bool debugger_console::validate_device_space_parameter(std::string_view param, i // fall back to supplied default space if appropriate if (spacename.empty() && (0 <= spacenum)) { - if (memory->has_space(spacenum)) - { - result = &memory->space(spacenum); + if (mintf->has_logical_space(spacenum)) return true; - } else { printf("No matching memory space found for device '%s'\n", device->tag()); @@ -860,11 +864,11 @@ bool debugger_console::validate_device_space_parameter(std::string_view param, i } // otherwise find the specified space or fall back to the first populated space - for (int i = 0; memory->max_space_count() > i; ++i) + for (int i = 0; mintf->max_space_count() > i; ++i) { - if (memory->has_space(i) && (spacename.empty() || (memory->space(i).name() == spacename))) + if (mintf->has_logical_space(i) && (spacename.empty() || (mintf->logical_space_config(i)->name() == spacename))) { - result = &memory->space(i); + spacenum = i; return true; } } @@ -894,7 +898,7 @@ bool debugger_console::validate_device_space_parameter(std::string_view param, i /// \param [out] addr The address on success, or unchanged on failure. /// \return true if the address is a valid expression evaluating to a /// number and the address space is found, or false otherwise. -bool debugger_console::validate_target_address_parameter(std::string_view param, int spacenum, address_space *&space, u64 &addr) +bool debugger_console::validate_target_address_parameter(std::string_view param, int &spacenum, device_memory_interface *&mintf, u64 &addr) { // check for the device delimiter std::string_view::size_type const devdelim = find_delimiter(param, [] (char ch) { return ':' == ch; }); @@ -903,15 +907,15 @@ bool debugger_console::validate_target_address_parameter(std::string_view param, device = param.substr(devdelim + 1); // parse the address first - u64 addrval; + offs_t addrval; if (!validate_number_parameter(param.substr(0, devdelim), addrval)) return false; - // find the address space - if (!validate_device_space_parameter(device, spacenum, space)) + // find the logical space + if (!validate_device_space_parameter(device, spacenum, mintf)) return false; - // set the address now that we have the space + // set the address now that we have the interface addr = addrval; return true; } |
