From 9c45e9c7df1efa5bc1c8e73b6eaef4726b828d3e Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Tue, 4 Feb 2025 19:59:47 +0100 Subject: add span type --- lib/nes/sys/nes.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/nes/sys/nes.cc') diff --git a/lib/nes/sys/nes.cc b/lib/nes/sys/nes.cc index 3195826..5cc47a4 100644 --- a/lib/nes/sys/nes.cc +++ b/lib/nes/sys/nes.cc @@ -3,8 +3,8 @@ namespace nes::sys { - nes::nes(display& display, u8 const* rom_data, u32 rom_length) - : cartridge_{ rom_data, rom_length } + nes::nes(display& display, span const rom_data) + : cartridge_{ rom_data } , display_{ display } , ppu_{ cpu_, cartridge_, display_ } , cpu_{ ppu_, cartridge_, controller_1_, controller_2_ } @@ -52,7 +52,7 @@ namespace nes::sys auto nes::get_snapshot() -> snapshot { auto res = snapshot{}; - res.sram = std::vector(cartridge_.get_ram(), cartridge_.get_ram() + cartridge_.get_ram_length()); + res.sram = std::vector(cartridge_.get_ram().begin(), cartridge_.get_ram().end()); cpu_.build_snapshot(res); ppu_.build_snapshot(res); return res; -- cgit v1.3.1