pub fn add_table(&mut self) {
        // TODO: this functions is useless, I can do everything in the constructor
        if (self.debug_mode) {
            eprintln!("Loading tables");
        }
        let table: [fn(&mut Chip8); 0xF+1] = [Chip8::Table0, Chip8::OP_1nnn, Chip8::OP_2nnn, Chip8::OP_3xkk, Chip8::OP_4xkk, Chip8::OP_5xy0, Chip8::OP_6xkk, Chip8::OP_7xkk, Chip8::Table8, Chip8::OP_9xy0, Chip8::OP_Annn, Chip8::OP_Bnnn, Chip8::OP_Cxkk, Chip8::OP_Dxyn, Chip8::TableE, Chip8::TableF];
        // TODO: filling them with OP_ERR is redundant as I already do so when creating the array in the constructor
        let mut table0: [fn(&mut Chip8); 0xE+1] = [Chip8::OP_ERR; 0xE+1];
        let mut table8: [fn(&mut Chip8); 0xE+1] = [Chip8::OP_ERR; 0xE+1];
        let mut tableE: [fn(&mut Chip8); 0xE+1] = [Chip8::OP_ERR; 0xE+1];
        let mut tableF: [fn(&mut Chip8); 0x65+1] = [Chip8::OP_ERR; 0x65+1];

        table0[0x0] = Chip8::OP_00E0;
        table0[0xE] = Chip8::OP_00EE;

        table8[0x0] = Chip8::OP_8xy0;
        table8[0x1] = Chip8::OP_8xy1;
        table8[0x2] = Chip8::OP_8xy2;
        table8[0x3] = Chip8::OP_8xy3;
        table8[0x4] = Chip8::OP_8xy4;
        table8[0x5] = Chip8::OP_8xy5;
        table8[0x6] = Chip8::OP_8xy6;
        table8[0x7] = Chip8::OP_8xy7;
        table8[0xE] = Chip8::OP_8xyE;

        tableE[0x1] = Chip8::OP_ExA1;
        tableE[0xE] = Chip8::OP_Ex9E;

        tableF[0x07] = Chip8::OP_Fx07;
        tableF[0x0A] = Chip8::OP_Fx0A;
        tableF[0x15] = Chip8::OP_Fx15;
        tableF[0x18] = Chip8::OP_Fx18;
        tableF[0x1E] = Chip8::OP_Fx1E;
        tableF[0x29] = Chip8::OP_Fx29;
        tableF[0x33] = Chip8::OP_Fx33;
        tableF[0x55] = Chip8::OP_Fx55;
        tableF[0x65] = Chip8::OP_Fx65;


        // Apply the newly generated tables
        self.table = table;
        self.table0 = table0;
        self.table8 = table8;
        self.tableE = tableE;
        self.tableF = tableF;

        if (self.debug_mode) {
            eprintln!("Tables loaded");
        }
    }
/// Add the correct function pointer tables to the newly created Chip8 object
Add the correct function pointer tables to the newly created Chip8 object
Add the correct function pointer tables to the newly created Chip8 object
pub fn add_table(&mut self) {
        // TODO: this functions is useless, I can do everything in the constructor
        if (self.debug_mode) {
            eprintln!("Loading tables");
        }
        let table: [fn(&mut Chip8); 0xF+1] = [Chip8::Table0, Chip8::OP_1nnn, Chip8::OP_2nnn, Chip8::OP_3xkk, Chip8::OP_4xkk, Chip8::OP_5xy0, Chip8::OP_6xkk, Chip8::OP_7xkk, Chip8::Table8, Chip8::OP_9xy0, Chip8::OP_Annn, Chip8::OP_Bnnn, Chip8::OP_Cxkk, Chip8::OP_Dxyn, Chip8::TableE, Chip8::TableF];
        // TODO: filling them with OP_ERR is redundant as I already do so when creating the array in the constructor
        let mut table0: [fn(&mut Chip8); 0xE+1] = [Chip8::OP_ERR; 0xE+1];
        let mut table8: [fn(&mut Chip8); 0xE+1] = [Chip8::OP_ERR; 0xE+1];
        let mut tableE: [fn(&mut Chip8); 0xE+1] = [Chip8::OP_ERR; 0xE+1];
        let mut tableF: [fn(&mut Chip8); 0x65+1] = [Chip8::OP_ERR; 0x65+1];
        table0[0x0] = Chip8::OP_00E0;
        table0[0xE] = Chip8::OP_00EE;
        table8[0x0] = Chip8::OP_8xy0;
        table8[0x1] = Chip8::OP_8xy1;
        table8[0x2] = Chip8::OP_8xy2;
        table8[0x3] = Chip8::OP_8xy3;
        table8[0x4] = Chip8::OP_8xy4;
        table8[0x5] = Chip8::OP_8xy5;
        table8[0x6] = Chip8::OP_8xy6;
        table8[0x7] = Chip8::OP_8xy7;
        table8[0xE] = Chip8::OP_8xyE;
        tableE[0x1] = Chip8::OP_ExA1;
        tableE[0xE] = Chip8::OP_Ex9E;
        tableF[0x07] = Chip8::OP_Fx07;
        tableF[0x0A] = Chip8::OP_Fx0A;
        tableF[0x15] = Chip8::OP_Fx15;
        tableF[0x18] = Chip8::OP_Fx18;
        tableF[0x1E] = Chip8::OP_Fx1E;
        tableF[0x29] = Chip8::OP_Fx29;
        tableF[0x33] = Chip8::OP_Fx33;
        tableF[0x55] = Chip8::OP_Fx55;
        tableF[0x65] = Chip8::OP_Fx65;
        // Apply the newly generated tables
        self.table = table;
        self.table0 = table0;
        self.table8 = table8;
        self.tableE = tableE;
        self.tableF = tableF;
        if (self.debug_mode) {
            eprintln!("Tables loaded");
        }
    }
pub fn add_table ( & mut self ) { // TODO: this functions is useless, I can do everything in the constructor if ( self . debug_mode ) { eprintln ! ( " " ) ; } let table : [ fn ( & mut Chip8 ) ; 0xF + 1 ] = [ Chip8 :: Table0 , Chip8 :: OP_1nnn , Chip8 :: OP_2nnn , Chip8 :: OP_3xkk , Chip8 :: OP_4xkk , Chip8 :: OP_5xy0 , Chip8 :: OP_6xkk , Chip8 :: OP_7xkk , Chip8 :: Table8 , Chip8 :: OP_9xy0 , Chip8 :: OP_Annn , Chip8 :: OP_Bnnn , Chip8 :: OP_Cxkk , Chip8 :: OP_Dxyn , Chip8 :: TableE , Chip8 :: TableF ] ; // TODO: filling them with OP_ERR is redundant as I already do so when creating the array in the constructor let mut table0 : [ fn ( & mut Chip8 ) ; 0xE + 1 ] = [ Chip8 :: OP_ERR ; 0xE + 1 ] ; let mut table8 : [ fn ( & mut Chip8 ) ; 0xE + 1 ] = [ Chip8 :: OP_ERR ; 0xE + 1 ] ; let mut tableE : [ fn ( & mut Chip8 ) ; 0xE + 1 ] = [ Chip8 :: OP_ERR ; 0xE + 1 ] ; let mut tableF : [ fn ( & mut Chip8 ) ; 0x65 + 1 ] = [ Chip8 :: OP_ERR ; 0x65 + 1 ] ; table0 [ 0x0 ] = Chip8 :: OP_00E0 ; table0 [ 0xE ] = Chip8 :: OP_00EE ; table8 [ 0x0 ] = Chip8 :: OP_8xy0 ; table8 [ 0x1 ] = Chip8 :: OP_8xy1 ; table8 [ 0x2 ] = Chip8 :: OP_8xy2 ; table8 [ 0x3 ] = Chip8 :: OP_8xy3 ; table8 [ 0x4 ] = Chip8 :: OP_8xy4 ; table8 [ 0x5 ] = Chip8 :: OP_8xy5 ; table8 [ 0x6 ] = Chip8 :: OP_8xy6 ; table8 [ 0x7 ] = Chip8 :: OP_8xy7 ; table8 [ 0xE ] = Chip8 :: OP_8xyE ; tableE [ 0x1 ] = Chip8 :: OP_ExA1 ; tableE [ 0xE ] = Chip8 :: OP_Ex9E ; tableF [ 0x07 ] = Chip8 :: OP_Fx07 ; tableF [ 0x0A ] = Chip8 :: OP_Fx0A ; tableF [ 0x15 ] = Chip8 :: OP_Fx15 ; tableF [ 0x18 ] = Chip8 :: OP_Fx18 ; tableF [ 0x1E ] = Chip8 :: OP_Fx1E ; tableF [ 0x29 ] = Chip8 :: OP_Fx29 ; tableF [ 0x33 ] = Chip8 :: OP_Fx33 ; tableF [ 0x55 ] = Chip8 :: OP_Fx55 ; tableF [ 0x65 ] = Chip8 :: OP_Fx65 ; // Apply the newly generated tables self . table = table ; self . table0 = table0 ; self . table8 = table8 ; self . tableE = tableE ; self . tableF = tableF ; if ( self . debug_mode ) { eprintln ! ( " " ) ; } }
Add the correct function pointer tables to the newly created Chip8 object
Add the correct function pointer tables to the newly created Chip8 object
&mut self