Modules/clock/Usage

From MSX Game Library

< Modules‎ | clock

For example, display the current year:

RTC_Initialize();
u8 year = RTC_GetYear();
Print_DrawFormat("This year: %i", 1980 + year);

Save data to CMOS memory:

u8 saveData[6];
saveData[0] = 0xFF;
saveData[1] = 100;
saveData[2] = 0;
RTC_SaveData(saveData);

The MSX2 real-time clock is a Ricoh RP-5C01. For more information about this device: