pub fn load_program(mut self, prog: Vec<u8>) -> Self {
        // Limit bytes
        let prog: Vec<u8> = prog.into_iter().take(0xFFF - 0x200).collect();
        // Write to memory
        for (i, b) in prog.iter().enumerate() {
            self.memory[0x200 + i] = *b;
        }
        self
    }
/// Loads the program (as a byte vector) into the emulator memory
Loads the program (as a byte vector) into the emulator memory
Loads the program ( as a byte vector ) into the emulator memory
pub fn load_program(mut self, prog: Vec<u8>) -> Self {
        // Limit bytes
        let prog: Vec<u8> = prog.into_iter().take(0xFFF - 0x200).collect();
        // Write to memory
        for (i, b) in prog.iter().enumerate() {
            self.memory[0x200 + i] = *b;
        }
        self
    }
pub fn load_program ( mut self , prog : Vec < u8 > ) -> Self { // Limit bytes let prog : Vec < u8 > = prog . into_iter ( ) . take ( 0xFFF - 0x200 ) . collect ( ) ; // Write to memory for ( i , b ) in prog . iter ( ) . enumerate ( ) { self . memory [ 0x200 + i ] = * b ; } self }
Loads the program (as a byte vector) into the emulator memory
Loads the program ( as a byte vector ) into the emulator memory
mut self
prog
Vec<u8>
mut self
prog
Vec<u8>