diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-04 19:59:47 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-04 19:59:47 +0100 |
| commit | 9c45e9c7df1efa5bc1c8e73b6eaef4726b828d3e (patch) | |
| tree | 4be985efa8e697fd6ef5838eec69c32c40c5d4a5 /lib/nes/sys/nes.cc | |
| parent | e791ac9a46095e0241181da89c35a7c702982c21 (diff) | |
add span type
Diffstat (limited to 'lib/nes/sys/nes.cc')
| -rw-r--r-- | lib/nes/sys/nes.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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<u8 const> 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; |
