+/* Return true if address is valid, false otherwise. */
+int
+memory_check_address(enum mem_id_t id, unsigned long address, int display_error)
+{
+ if (address >= (unsigned long) mem_infos[id].max_size) {
+ if (display_error == DISPLAY_ERROR_YES)
+ log_err("Address out of range ($%X >= $%X", address,
+ mem_infos[id].max_size - 1);
+ return false;
+ }
+ else
+ return true;
+}
+