| 254 | } |
| 255 | |
| 256 | static void cdvdWriteNVM(const u8* src, int offset, int bytes) |
| 257 | { |
| 258 | int to_write = bytes; |
| 259 | if (static_cast<size_t>(offset + bytes) > sizeof(s_nvram)) [[unlikely]] |
| 260 | { |
| 261 | WARNING_LOG("CDVD: Out of bounds NVRAM write: offset={}, bytes={}", offset, bytes); |
| 262 | to_write = std::max(static_cast<int>(sizeof(s_nvram)) - offset, 0); |
| 263 | } |
| 264 | |
| 265 | if (to_write > 0) [[likely]] |
| 266 | std::memcpy(&s_nvram[offset], src, to_write); |
| 267 | } |
| 268 | |
| 269 | static void cdvdReadConsoleID(u8* id) |
| 270 | { |
no test coverage detected