aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Games/Emulation/DCPU16.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Games/Emulation/DCPU16.pm')
-rw-r--r--lib/Games/Emulation/DCPU16.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Games/Emulation/DCPU16.pm b/lib/Games/Emulation/DCPU16.pm
index bec7b44..78081ba 100644
--- a/lib/Games/Emulation/DCPU16.pm
+++ b/lib/Games/Emulation/DCPU16.pm
@@ -24,6 +24,8 @@ sub new {
SP => 0x0000,
O => 0x0000,
+ clock => 0,
+
halt => undef,
delay => 0,
time_taken => TIME_TAKEN_NONE,
@@ -68,6 +70,7 @@ sub registers { shift->{registers} }
sub PC { shift->{PC} }
sub SP { shift->{SP} }
sub O { shift->{O} }
+sub clock { shift->{clock} }
sub load {
my $self = shift;
@@ -88,6 +91,8 @@ sub run {
sub step {
my $self = shift;
+ $self->{clock}++;
+
if ($self->{delay}) {
$self->{delay}--;
return;