Skip to content
Snippets Groups Projects
Verified Commit 10c29662 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: more efficient RAM data retrieval

parent 9f90a831
No related branches found
No related tags found
No related merge requests found
Pipeline #3052 failed
......@@ -344,8 +344,8 @@ impl Emulator {
// then we've reached the time to re-save the battery backed RAM
// into a *.sav file in the file system
if counter % store_count == 0 && self.system.rom().has_battery() {
let ram_data = self.system.ram_data_eager();
write_file(&self.ram_path, &ram_data);
let ram_data = self.system.rom().ram_data();
write_file(&self.ram_path, ram_data);
}
// obtains an event from the SDL sub-system to be
......
......@@ -621,6 +621,16 @@ impl Cartridge {
}
}
impl Cartridge {
pub fn rom_data(&self) -> &Vec<u8> {
&self.rom_data
}
pub fn ram_data(&self) -> &Vec<u8> {
&self.ram_data
}
}
impl Default for Cartridge {
fn default() -> Self {
Self::new()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment