diff options
| author | Günther Neuwirth <e0626638@student.tuwien.ac.at> | 2009-05-27 16:43:43 +0200 |
|---|---|---|
| committer | Günther Neuwirth <e0626638@student.tuwien.ac.at> | 2009-05-27 16:43:43 +0200 |
| commit | 064eaaed391835d0e0d057466f6f552e43e79bd8 (patch) | |
| tree | 9dd40d61761624f10a83f001425bc35a1dfdfd00 /ue4/mycpu/ccpu.h | |
| parent | 26a97259f5a7b066cff2927e88c867fac2aaad87 (diff) | |
| download | ooprog-064eaaed391835d0e0d057466f6f552e43e79bd8.tar.gz ooprog-064eaaed391835d0e0d057466f6f552e43e79bd8.tar.bz2 ooprog-064eaaed391835d0e0d057466f6f552e43e79bd8.zip | |
add cdatset
Diffstat (limited to 'ue4/mycpu/ccpu.h')
| -rw-r--r-- | ue4/mycpu/ccpu.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ue4/mycpu/ccpu.h b/ue4/mycpu/ccpu.h index 519cee9..545b870 100644 --- a/ue4/mycpu/ccpu.h +++ b/ue4/mycpu/ccpu.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #include "cprogram.h" | 22 | #include "cprogram.h" |
| 23 | 23 | ||
| 24 | /* forward declare CProgram */ | 24 | /* forward declare CProgram */ |
| 25 | template <class T> | 25 | template <class T=CDat<int>, int width=0> |
| 26 | class CProgram; | 26 | class CProgram; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| @@ -31,7 +31,7 @@ class CProgram; | |||
| 31 | * CPU implementation. Used as a container for memory and instructions. | 31 | * CPU implementation. Used as a container for memory and instructions. |
| 32 | * Implements a run method to execute the program (= the instructions). | 32 | * Implements a run method to execute the program (= the instructions). |
| 33 | */ | 33 | */ |
| 34 | template <class T> | 34 | template<class T=CDat<int>, int width=0> |
| 35 | class CCPU | 35 | class CCPU |
| 36 | { | 36 | { |
| 37 | typedef typename std::set<CDisplay<T> *>::iterator displayiterator; | 37 | typedef typename std::set<CDisplay<T> *>::iterator displayiterator; |
| @@ -250,8 +250,8 @@ class CCPU | |||
| 250 | 250 | ||
| 251 | /*----------------------------------------------------------------------------*/ | 251 | /*----------------------------------------------------------------------------*/ |
| 252 | 252 | ||
| 253 | template <class T> | 253 | template<class T, int width> |
| 254 | CCPU<T>::CCPU(const unsigned cnt) | 254 | CCPU<T, width>::CCPU(const unsigned cnt) |
| 255 | : m_regcnt(cnt), m_memory(NULL), m_program(NULL), m_flagzero(false), m_flagsign(false) | 255 | : m_regcnt(cnt), m_memory(NULL), m_program(NULL), m_flagzero(false), m_flagsign(false) |
| 256 | { | 256 | { |
| 257 | /* create registers */ | 257 | /* create registers */ |
| @@ -266,7 +266,7 @@ CCPU<T>::CCPU(const unsigned cnt) | |||
| 266 | 266 | ||
| 267 | /*----------------------------------------------------------------------------*/ | 267 | /*----------------------------------------------------------------------------*/ |
| 268 | 268 | ||
| 269 | template <class T> | 269 | template<class T, int width> |
| 270 | CCPU<T>::~CCPU() | 270 | CCPU<T>::~CCPU() |
| 271 | { | 271 | { |
| 272 | /* delete registers */ | 272 | /* delete registers */ |
| @@ -280,7 +280,7 @@ CCPU<T>::~CCPU() | |||
| 280 | 280 | ||
| 281 | /*----------------------------------------------------------------------------*/ | 281 | /*----------------------------------------------------------------------------*/ |
| 282 | 282 | ||
| 283 | template <class T> | 283 | template<class T, int width> |
| 284 | void CCPU<T>::run() | 284 | void CCPU<T>::run() |
| 285 | { | 285 | { |
| 286 | if (m_memory == NULL) | 286 | if (m_memory == NULL) |
| @@ -312,7 +312,7 @@ void CCPU<T>::run() | |||
| 312 | /*----------------------------------------------------------------------------*/ | 312 | /*----------------------------------------------------------------------------*/ |
| 313 | 313 | ||
| 314 | #if DEBUG | 314 | #if DEBUG |
| 315 | template <class T> | 315 | template<class T, int width> |
| 316 | void CCPU<T>::dumpRegisters(std::ostream& out) | 316 | void CCPU<T>::dumpRegisters(std::ostream& out) |
| 317 | { | 317 | { |
| 318 | out << "[REGISTER DUMP]" << std::endl; | 318 | out << "[REGISTER DUMP]" << std::endl; |
