Modules/clock/Usage

From MSX Game Library

Revision as of 12:31, 13 January 2024 by Aoineko (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< 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: