1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Start to introduce a 6526/8250.

This commit is contained in:
Thomas Harte 2021-07-18 11:36:13 -04:00
parent a5d0976c2d
commit 377cc7bdcd
3 changed files with 89 additions and 0 deletions

42
Components/6526/6526.hpp Normal file
View File

@ -0,0 +1,42 @@
//
// 6526.h
// Clock Signal
//
// Created by Thomas Harte on 18/07/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef _526_h
#define _526_h
#include <cstdint>
namespace MOS {
namespace MOS6526 {
class PortHandler {
};
enum class Personality {
// The 6526, used in machines such as the C64, has a BCD time-of-day clock.
Model6526,
// The 8250, used in the Amiga, provides a binary time-of-day clock.
Model8250,
};
template <typename BusHandlerT, Personality personality> class MOS6526 {
public:
/// Writes @c value to the register at @c address. Only the low two bits of the address are decoded.
void write(int address, uint8_t value);
/// Fetches the value of the register @c address. Only the low two bits of the address are decoded.
uint8_t read(int address);
};
}
}
#include "Implementation/6526Implementation.hpp"
#endif /* _526_h */

View File

@ -0,0 +1,27 @@
//
// 6526Implementation.hpp
// Clock Signal
//
// Created by Thomas Harte on 18/07/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef _526Implementation_h
#define _526Implementation_h
namespace MOS {
namespace MOS6526 {
template <typename BusHandlerT, Personality personality>
void MOS6526<BusHandlerT, personality>::write(int address, uint8_t value) {
}
template <typename BusHandlerT, Personality personality>
uint8_t MOS6526<BusHandlerT, personality>::read(int address) {
return 0xff;
}
}
}
#endif /* _526Implementation_h */

View File

@ -1920,6 +1920,8 @@
4BC080CF26A257A200D03FD8 /* StaticAnalyser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticAnalyser.cpp; sourceTree = "<group>"; };
4BC080D726A25ADA00D03FD8 /* Amiga.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Amiga.hpp; sourceTree = "<group>"; };
4BC080D826A25ADA00D03FD8 /* Amiga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Amiga.cpp; sourceTree = "<group>"; };
4BC080DE26A481C100D03FD8 /* 6526.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = 6526.hpp; sourceTree = "<group>"; };
4BC080E026A481C100D03FD8 /* 6526Implementation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = 6526Implementation.hpp; sourceTree = "<group>"; };
4BC0CB272446BC7B00A79DBB /* OPLTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OPLTests.mm; sourceTree = "<group>"; };
4BC1316D2346DE5000E4FF3D /* StaticAnalyser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = StaticAnalyser.hpp; sourceTree = "<group>"; };
4BC1316E2346DE5000E4FF3D /* Target.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Target.hpp; sourceTree = "<group>"; };
@ -4267,6 +4269,23 @@
path = Amiga;
sourceTree = "<group>";
};
4BC080DD26A481C100D03FD8 /* 6526 */ = {
isa = PBXGroup;
children = (
4BC080DE26A481C100D03FD8 /* 6526.hpp */,
4BC080DF26A481C100D03FD8 /* Implementation */,
);
path = 6526;
sourceTree = "<group>";
};
4BC080DF26A481C100D03FD8 /* Implementation */ = {
isa = PBXGroup;
children = (
4BC080E026A481C100D03FD8 /* 6526Implementation.hpp */,
);
path = Implementation;
sourceTree = "<group>";
};
4BC1316C2346DE5000E4FF3D /* Atari2600 */ = {
isa = PBXGroup;
children = (
@ -4326,6 +4345,7 @@
4BD468F81D8DF4290084958B /* 1770 */,
4BDACBE922FFA5B50045EF7E /* 5380 */,
4BC9DF4B1D04691600F44158 /* 6522 */,
4BC080DD26A481C100D03FD8 /* 6526 */,
4B1E85791D174DEC001EF87D /* 6532 */,
4BC9DF4C1D04691600F44158 /* 6560 */,
4BE845221F2FF7F400A5EA22 /* 6845 */,