summaryrefslogtreecommitdiffstats
path: root/src/GameBoy/TICKTables.php
diff options
context:
space:
mode:
authorGabriel Rodrigues Couto <gabriel@rodriguescouto.com.br>2016-02-21 20:45:44 -0300
committerGabriel Rodrigues Couto <gabriel@rodriguescouto.com.br>2016-02-21 20:45:44 -0300
commit5eb01ea29b520a3be3227c3138c1a24bebcf56b3 (patch)
tree5b3005cac48a899c29175fc647d25482a7259fcc /src/GameBoy/TICKTables.php
parent56c39212c4a891d4b716b84e0593b71dcaa14d8a (diff)
parentaedf29c506785f0bb46cdf54706005ae063d1e11 (diff)
downloadphp-terminal-gameboy-emulator-5eb01ea29b520a3be3227c3138c1a24bebcf56b3.zip
php-terminal-gameboy-emulator-5eb01ea29b520a3be3227c3138c1a24bebcf56b3.tar.gz
php-terminal-gameboy-emulator-5eb01ea29b520a3be3227c3138c1a24bebcf56b3.tar.bz2
Merge pull request #1 from pokemaobr/ajustando_nomes_para_psr0
Ajustando as pastas para PSR-0
Diffstat (limited to 'src/GameBoy/TICKTables.php')
-rw-r--r--src/GameBoy/TICKTables.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/GameBoy/TICKTables.php b/src/GameBoy/TICKTables.php
new file mode 100644
index 0000000..d6b0824
--- /dev/null
+++ b/src/GameBoy/TICKTables.php
@@ -0,0 +1,55 @@
+<?php
+namespace GameBoy;
+
+class TickTables
+{
+ public static $primary = [
+ //Number of machine cycles for each instruction:
+ /* 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F*/
+ 1, 3, 2, 2, 1, 1, 2, 1, 5, 2, 2, 2, 1, 1, 2, 1, //0
+ 1, 3, 2, 2, 1, 1, 2, 1, 3, 2, 2, 2, 1, 1, 2, 1, //1
+ 2, 3, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, //2
+ 2, 3, 2, 2, 3, 3, 3, 1, 2, 2, 2, 2, 1, 1, 2, 1, //3
+
+ 1, 1, 1, 1, 1, 1, 2, 1, 1, 1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