| 1 |
#include "MSXVictorHC9xSystemControl.hh" |
| 2 |
|
| 3 |
#include "serialize.hh" |
| 4 |
|
| 5 |
#include <cassert> |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
namespace openmsx { |
| 22 |
|
| 23 |
MSXVictorHC9xSystemControl::MSXVictorHC9xSystemControl(const DeviceConfig& config) |
| 24 |
: MSXDevice(config) |
| 25 |
{ |
| 26 |
} |
| 27 |
|
| 28 |
byte MSXVictorHC9xSystemControl::readMem(uint16_t address, EmuTime time) |
| 29 |
{ |
| 30 |
return peekMem(address, time); |
| 31 |
} |
| 32 |
|
| 33 |
byte MSXVictorHC9xSystemControl::peekMem(uint16_t address, EmuTime ) const |
| 34 |
{ |
| 35 |
(void)address; |
| 36 |
assert (address == 0x7FFD); |
| 37 |
return systemControlRegister; |
| 38 |
} |
| 39 |
|
| 40 |
void MSXVictorHC9xSystemControl::writeMem(uint16_t address, byte value, EmuTime ) { |
| 41 |
(void)address; |
| 42 |
assert (address == 0x7FFD); |
| 43 |
systemControlRegister = (value & 0x3F) | 0x80; |
| 44 |
} |
| 45 |
|
| 46 |
bool MSXVictorHC9xSystemControl::allowUnaligned() const |
| 47 |
{ |
| 48 |
|
| 49 |
return true; |
| 50 |
} |
| 51 |
|
| 52 |
template<typename Archive> |
| 53 |
void MSXVictorHC9xSystemControl::serialize(Archive& ar, unsigned ) |
| 54 |
{ |
| 55 |
ar.template serializeBase<MSXDevice>(*this); |
| 56 |
ar.serialize("systemControlRegister", systemControlRegister); |
| 57 |
} |
| 58 |
|
| 59 |
INSTANTIATE_SERIALIZE_METHODS(MSXVictorHC9xSystemControl); |
| 60 |
REGISTER_MSXDEVICE(MSXVictorHC9xSystemControl, "VictorHC9xSystemControl"); |
| 61 |
|
| 62 |
} |