diff --git a/rpcs3/Emu/NP/rpcn_client.cpp b/rpcs3/Emu/NP/rpcn_client.cpp index 41bc86c698..5d640a2261 100644 --- a/rpcs3/Emu/NP/rpcn_client.cpp +++ b/rpcs3/Emu/NP/rpcn_client.cpp @@ -292,8 +292,8 @@ namespace rpcn { if (msg.size() == 6) { - addr_sig = *utils::bless>(&msg[0]); - port_sig = *utils::bless>(&msg[4]); + addr_sig = read_from_ptr>(&msg[0]); + port_sig = read_from_ptr>(&msg[4]); last_pong_time = now; } @@ -308,8 +308,8 @@ namespace rpcn { std::vector ping(13); ping[0] = 1; - *utils::bless>(&ping[1]) = user_id; - *utils::bless>(&ping[9]) = local_addr_sig; + write_to_ptr>(ping, 1, user_id); + write_to_ptr>(ping, 9, +local_addr_sig); if (send_packet_from_p2p_port(ping, addr_rpcn_udp) == -1) { rpcn_log.error("Failed to send ping to RPCN!"); @@ -354,9 +354,9 @@ namespace rpcn } const u8 packet_type = header[0]; - const u16 command = *utils::bless>(&header[1]); - const u32 packet_size = *utils::bless>(&header[3]); - const u64 packet_id = *utils::bless>(&header[7]); + const u16 command = read_from_ptr>(&header[1]); + const u32 packet_size = read_from_ptr>(&header[3]); + const u64 packet_id = read_from_ptr>(&header[7]); if (packet_size < RPCN_HEADER_SIZE) return error_and_disconnect("Invalid packet size"); @@ -1707,7 +1707,7 @@ namespace rpcn std::vector data(COMMUNICATION_ID_SIZE + sizeof(u64)); memcpy(data.data(), communication_id.data, COMMUNICATION_ID_SIZE); - *utils::bless>(&data[COMMUNICATION_ID_SIZE]) = room_id; + write_to_ptr>(data, COMMUNICATION_ID_SIZE, room_id); return forge_send(CommandType::PingRoomOwner, req_id, data); } @@ -1811,7 +1811,7 @@ namespace rpcn { std::vector data(COMMUNICATION_ID_SIZE + sizeof(u32)); memcpy(data.data(), communication_id.data, COMMUNICATION_ID_SIZE); - *utils::bless>(&data[COMMUNICATION_ID_SIZE]) = board_id; + write_to_ptr>(data, COMMUNICATION_ID_SIZE, board_id); return forge_send(CommandType::GetBoardInfos, req_id, data); } diff --git a/rpcs3/Emu/NP/rpcn_client.h b/rpcs3/Emu/NP/rpcn_client.h index 046b27665f..7bbd908a4f 100644 --- a/rpcs3/Emu/NP/rpcn_client.h +++ b/rpcs3/Emu/NP/rpcn_client.h @@ -59,7 +59,7 @@ public: error = true; return 0; } - T res = *utils::bless>(&vec[i]); + T res = read_from_ptr>(&vec[i]); i += sizeof(T); return res; } diff --git a/rpcs3/Emu/RSX/RSXFIFO.cpp b/rpcs3/Emu/RSX/RSXFIFO.cpp index 8dcc7dbad9..c4e52c6e6b 100644 --- a/rpcs3/Emu/RSX/RSXFIFO.cpp +++ b/rpcs3/Emu/RSX/RSXFIFO.cpp @@ -195,7 +195,7 @@ namespace rsx } } - const auto ret = utils::bless>(&m_cache)[(addr - m_cache_addr) >> 2]; + const auto ret = read_from_ptr>(+m_cache[0], addr - m_cache_addr); return {true, ret}; } diff --git a/rpcs3/rpcs3qt/rsx_debugger.cpp b/rpcs3/rpcs3qt/rsx_debugger.cpp index 9074ad7977..ea06da2508 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.cpp +++ b/rpcs3/rpcs3qt/rsx_debugger.cpp @@ -426,12 +426,12 @@ namespace { case rsx::surface_color_format::b8: { - const u8 value = utils::bless(orig_buffer)[idx]; + const u8 value = read_from_ptr(orig_buffer, idx); return{ value, value, value }; } case rsx::surface_color_format::x32: { - const be_t stored_val = utils::bless>(orig_buffer)[idx]; + const be_t stored_val = read_from_ptr>(orig_buffer, idx); const u32 swapped_val = stored_val; const f32 float_val = std::bit_cast(swapped_val); const u8 val = float_val * 255.f; @@ -441,14 +441,14 @@ namespace case rsx::surface_color_format::x8b8g8r8_o8b8g8r8: case rsx::surface_color_format::x8b8g8r8_z8b8g8r8: { - const auto ptr = utils::bless(orig_buffer); + const auto ptr = reinterpret_cast(orig_buffer.data()); return{ ptr[1 + idx * 4], ptr[2 + idx * 4], ptr[3 + idx * 4] }; } case rsx::surface_color_format::a8r8g8b8: case rsx::surface_color_format::x8r8g8b8_o8r8g8b8: case rsx::surface_color_format::x8r8g8b8_z8r8g8b8: { - const auto ptr = utils::bless(orig_buffer); + const auto ptr = reinterpret_cast(orig_buffer.data()); return{ ptr[3 + idx * 4], ptr[2 + idx * 4], ptr[1 + idx * 4] }; } case rsx::surface_color_format::w16z16y16x16: @@ -581,7 +581,7 @@ void rsx_debugger::OnClickDrawCalls() { for (u32 col = 0; col < width; col++) { - const u8 stencil_val = utils::bless(orig_buffer)[row * width + col]; + const u8 stencil_val = reinterpret_cast(orig_buffer.data())[row * width + col]; buffer[4 * col + 0 + width * row * 4] = stencil_val; buffer[4 * col + 1 + width * row * 4] = stencil_val; buffer[4 * col + 2 + width * row * 4] = stencil_val; diff --git a/rpcs3/rpcs3qt/skylander_dialog.cpp b/rpcs3/rpcs3qt/skylander_dialog.cpp index c994c549ab..68cc771207 100644 --- a/rpcs3/rpcs3qt/skylander_dialog.cpp +++ b/rpcs3/rpcs3qt/skylander_dialog.cpp @@ -643,17 +643,17 @@ skylander_creator_dialog::skylander_creator_dialog(QWidget* parent) std::array buf{}; const auto data = buf.data(); // Set the block permissions - *utils::bless>(&data[0x36]) = 0x690F0F0F; + write_to_ptr>(data, 0x36, 0x690F0F0F); for (u32 index = 1; index < 0x10; index++) { - *utils::bless>(&data[(index * 0x40) + 0x36]) = 0x69080F7F; + write_to_ptr>(data, (index * 0x40) + 0x36, 0x69080F7F); } // Set the skylander infos - *utils::bless>(&data[0]) = (sky_id | sky_var) + 1; - *utils::bless>(&data[0x10]) = sky_id; - *utils::bless>(&data[0x1C]) = sky_var; + write_to_ptr>(data, (sky_id | sky_var) + 1); + write_to_ptr>(data, 0x10, sky_id); + write_to_ptr>(data, 0x1C, sky_var); // Set checksum - *utils::bless>(&data[0x1E]) = skylander_crc16(0xFFFF, data, 0x1E); + write_to_ptr>(data, 0x1E, skylander_crc16(0xFFFF, data, 0x1E)); sky_file.write(buf.data(), buf.size()); sky_file.close();