chiark / gitweb /
a couple more files which escaped from source control master
authorThomas Thurman <tthurman@gnome.org>
Sat, 6 Nov 2010 13:36:32 +0000 (09:36 -0400)
committerThomas Thurman <tthurman@gnome.org>
Sat, 6 Nov 2010 13:36:32 +0000 (09:36 -0400)
src/Clock.cpp [new file with mode: 0644]
src/Clock.h [new file with mode: 0644]
src/MemoryMap.cpp [new file with mode: 0644]
src/MemoryMap.h [new file with mode: 0644]

diff --git a/src/Clock.cpp b/src/Clock.cpp
new file mode 100644 (file)
index 0000000..fbe8813
--- /dev/null
@@ -0,0 +1,13 @@
+#include "Clock.h"
+
+Clock::Clock(): QObject() {
+  m_clock = 0;
+}
+
+unsigned long Clock::getTime() {
+  return m_clock;
+}
+
+void Clock::advance(int cycles) {
+  m_clock += cycles;
+}
diff --git a/src/Clock.h b/src/Clock.h
new file mode 100644 (file)
index 0000000..2da1c6b
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef CLOCK_H
+#define CLOCK_H 1
+
+#include <QObject>
+
+class Clock: public QObject {
+ public:
+  Clock();
+
+  /**
+   * Returns the current timestamp in cycles.
+   */
+  unsigned long getTime();
+
+  /**
+   * Advances the clock by a given number of
+   * cycles.
+   */
+  void advance(int cycles);
+
+ private:
+  unsigned long m_clock;
+};
+
+#endif
diff --git a/src/MemoryMap.cpp b/src/MemoryMap.cpp
new file mode 100644 (file)
index 0000000..df64373
--- /dev/null
@@ -0,0 +1,18 @@
+#include "MemoryMap.h"
+#include <QDebug>
+
+MemoryMap::MemoryMap(Memory *inside):
+  QObject() {
+
+  Q_UNUSED(inside);
+
+}
+
+int MemoryMap::read(int address) {
+  qDebug() << "Memory map read from" << address << "- returning 0";
+  return 0;
+}
+
+void MemoryMap::write(int address, int value) {
+  qDebug() << "Memory map write to" << address << "with" << value;
+}
diff --git a/src/MemoryMap.h b/src/MemoryMap.h
new file mode 100644 (file)
index 0000000..2e49e4f
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef MEMORYMAP_H
+#define MEMORYMAP_H
+
+#include <QObject>
+#include "Memory.h"
+
+class MemoryMap: public QObject {
+
+  Q_OBJECT
+
+ public:
+  MemoryMap(Memory *inside);
+
+  virtual int read(int address);
+  virtual void write(int address, int value);
+
+};
+
+#endif