openMSX
MSXVictorHC9xSystemControl.cc
Go to the documentation of this file.
2#include "serialize.hh"
3#include <cassert>
4
5// This implementation is documented in the HC-95 service manual:
6//
7// System control:
8// 7FFD I/O bit 0 NMI CONTROL "0" ENABLE
9// I/O bit 1 INT CONTROL "1" ENABLE
10// I/O bit 2 WAIT CONTROL "0" ENABLE
11// I/O bit 3 JVC MODE ACK FLAG "1" JVC ACK
12// I/O bit 4 FDC DREQ CONTROL "1" ENABLE
13// I/O bit 5 RS-232C FLAG "1" ENABLE
14// I bit 6 TURBO MODE FLAG "1" TURBO
15// I bit 7 JVC MODE FLAG "0" JVC MODE
16
17// turbo mode is determined by a physical switch on the machine (hence readonly)
18
19namespace openmsx {
20
25
26byte MSXVictorHC9xSystemControl::readMem(word address, EmuTime::param time)
27{
28 return peekMem(address, time);
29}
30
31byte MSXVictorHC9xSystemControl::peekMem(word address, EmuTime::param /*time*/) const
32{
33 (void)address; // avoid warning for non-assert compiles
34 assert (address == 0x7FFD);
35 return systemControlRegister;
36}
37
38void MSXVictorHC9xSystemControl::writeMem(word address, byte value, EmuTime::param /*time*/) {
39 (void)address; // avoid warning for non-assert compiles
40 assert (address == 0x7FFD);
41 systemControlRegister = (value & 0x3F) | 0x80;
42}
43
45{
46 // OK, because this device doesn't call any 'fillDeviceXXXCache()'functions.
47 return true;
48}
49
50template<typename Archive>
51void MSXVictorHC9xSystemControl::serialize(Archive& ar, unsigned /*version*/)
52{
53 ar.template serializeBase<MSXDevice>(*this);
54 ar.serialize("systemControlRegister", systemControlRegister);
55}
56
59
60} // namespace openmsx
#define REGISTER_MSXDEVICE(CLASS, NAME)
Definition MSXDevice.hh:356
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
void serialize(Archive &ar, unsigned version)
bool allowUnaligned() const override
By default we don't allow unaligned <mem> specifications in the config file.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
MSXVictorHC9xSystemControl(const DeviceConfig &config)
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)