You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
452 B
27 lines
452 B
4 years ago
|
/* PlipCpu.cpp
|
||
|
*
|
||
|
* Defines a CPU implementation.
|
||
|
*/
|
||
|
|
||
|
#include "PlipCpu.h"
|
||
|
|
||
|
namespace Plip::Cpu {
|
||
|
PlipCpu::PlipCpu(long hz, PlipMemoryMap* memoryMap) {
|
||
|
SetHz(hz);
|
||
|
m_memory = memoryMap;
|
||
|
}
|
||
|
|
||
|
long PlipCpu::GetCycleTime() const {
|
||
|
return m_cycle;
|
||
|
}
|
||
|
|
||
|
long PlipCpu::GetHz(long hz) const {
|
||
|
return m_hz;
|
||
|
}
|
||
|
|
||
|
void PlipCpu::SetHz(long hz) {
|
||
|
m_hz = hz;
|
||
|
m_cycle = 1000000000 / hz;
|
||
|
}
|
||
|
}
|