pub fn load_rom(&mut self, path: &Path) -> io::Result<()> {
        // read file to u8 vector
        let mut rom_data = vec![];
        File::open(path)?.read_to_end(&mut rom_data)?;

        // chip-8 programs start at location 0x200
        rom_data.iter().enumerate().for_each(|(i, &data)| {
            self.write(i as u16 + 0x200, data);
        });

        Ok(())
    }
/// load the rom data to memory
load the rom data to memory
load the rom data to memory
pub fn load_rom(&mut self, path: &Path) -> io::Result<()> {
        // read file to u8 vector
        let mut rom_data = vec![];
        File::open(path)?.read_to_end(&mut rom_data)?;
        // chip-8 programs start at location 0x200
        rom_data.iter().enumerate().for_each(|(i, &data)| {
            self.write(i as u16 + 0x200, data);
        });
        Ok(())
    }
pub fn load_rom ( & mut self , path : & Path ) -> io :: Result < ( ) > { // read file to u8 vector let mut rom_data = vec ! [ ] ; File :: open ( path ) ? . read_to_end ( & mut rom_data ) ? ; // chip-8 programs start at location 0x200 rom_data . iter ( ) . enumerate ( ) . for_each ( | ( i , & data ) | { self . write ( i as u16 + 0x200 , data ) ; } ) ; Ok ( ( ) ) }
load the rom data to memory
load the rom data to memory
&mut self
path
&Path
&mut self
path
&Path