16#include "SubComponent.h"
25class TOD final :
public SubComponent,
public Inspectable<TODInfo> {
29 Descriptions descriptions = {{
32 .description =
"Time-of-day Clock"
38 mutable TODInfo info = { };
82 TOD(C64 &ref, CIA &cia);
84 TOD& operator= (
const TOD& other) {
105 void serialize(T& worker)
117 } SERIALIZERS(serialize);
126 const Descriptions &getDescriptions()
const override {
return descriptions; }
130 void _dump(Category category, std::ostream& os)
const override;
131 void _reset(
bool hard)
override;
140 void cacheInfo(TODInfo &result)
const override;
148 u8 getTodHours()
const {
return (frozen ? latch.hour : tod.hour) & 0x9F; }
151 u8 getTodMinutes()
const {
return (frozen ? latch.min : tod.min) & 0x7F; }
154 u8 getTodSeconds()
const {
return (frozen ? latch.sec : tod.sec) & 0x7F; }
157 u8 getTodTenth()
const {
return (frozen ? latch.tenth : tod.tenth) & 0x0F; }
160 u8 getAlarmHours()
const {
return alarm.hour & 0x9F; }
163 u8 getAlarmMinutes()
const {
return alarm.min & 0x7F; }
166 u8 getAlarmSeconds()
const {
return alarm.sec & 0x7F; }
169 u8 getAlarmTenth()
const {
return alarm.tenth & 0x0F; }
172 void setTodHours(u8 value) { tod.hour = value & 0x9F; checkIrq(); }
175 void setTodMinutes(u8 value) { tod.min = value & 0x7F; checkIrq(); }
178 void setTodSeconds(u8 value) { tod.sec = value & 0x7F; checkIrq(); }
181 void setTodTenth(u8 value) { tod.tenth = value & 0x0F; checkIrq(); }
184 void setAlarmHours(u8 value) { alarm.hour = value & 0x9F; checkIrq(); }
187 void setAlarmMinutes(u8 value) { alarm.min = value & 0x7F; checkIrq(); }
190 void setAlarmSeconds(u8 value) { alarm.sec = value & 0x7F; checkIrq(); }
193 void setAlarmTenth(u8 value) { alarm.tenth = value & 0x0F; checkIrq(); }
208 void freeze() {
if (!frozen) { latch.value = tod.value; frozen =
true; } }
211 void defreeze() { frozen =
false; }
214 void stop() { stopped =
true; }
VirtualC64 project namespace.
Definition CmdQueue.cpp:16