- create_and_send_msg(cc, MSG_READ_MEM_RES, 0, &fast_ram_array[address], length);
+ if (get_mapped_item_by_address(cfg, address) != -1) {
+ int32_t index = get_mapped_item_by_address(cfg, address);
+ uint8_t *map = &cfg->map_data[index][address - cfg->map_offset[index]];
+ create_and_send_msg(cc, MSG_READ_MEM_RES, 0, map, length);
+ } else {
+ // No idea if this actually works.
+ for (int i = 0; i < length; i++) {
+ manual_read_buf[i] = (unsigned char)ps_read_8(address + i);
+ }
+ create_and_send_msg(cc, MSG_READ_MEM_RES, 0, manual_read_buf, length);
+ }
+