GameBoy\Cbopcode::run PHP Method

run() public static method

Run the given cbopcode.
public static run ( Core $core, integer $address ) : mixed
$core Core
$address integer
return mixed
    public static function run(Core $core, $address)
    {
        $function = 'cbopcode' . $address;
        return Cbopcode::$function($core);
    }

Usage Example

 /**
  * Opcode #0xCB.
  *
  * Secondary OP Code Set:
  *
  * @param Core $core
  */
 public static function opcode203(Core $core)
 {
     $opcode = $core->memoryRead($core->programCounter);
     //Increment the program counter to the next instruction:
     $core->programCounter = $core->programCounter + 1 & 0xffff;
     //Get how many CPU cycles the current 0xCBXX op code counts for:
     $core->CPUTicks = $core->SecondaryTICKTable[$opcode];
     //Execute secondary OP codes for the 0xCB OP code call.
     Cbopcode::run($core, $opcode);
 }
Cbopcode