diff --git a/src/include/86box/nvr.h b/src/include/86box/nvr.h index 85e0954f0..c6dc08a12 100644 --- a/src/include/86box/nvr.h +++ b/src/include/86box/nvr.h @@ -114,8 +114,8 @@ extern int nvr_save(void); extern int nvr_is_leap(int year); extern int nvr_get_days(int month, int year); extern void nvr_time_sync(void); -extern void nvr_time_get(struct tm *); -extern void nvr_time_set(struct tm *); +extern void nvr_time_get(void *priv); +extern void nvr_time_set(void *priv); extern void nvr_reg_write(uint16_t reg, uint8_t val, void *priv); extern void nvr_at_handler(int set, uint16_t base, nvr_t *nvr); diff --git a/src/nvr.c b/src/nvr.c index d833618d0..d0b05b93a 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -326,14 +326,15 @@ nvr_time_sync(void) /* Get current time from internal clock. */ void -nvr_time_get(struct tm *tm) +nvr_time_get(void *priv) { - uint8_t dom; - uint8_t mon; - uint8_t sum; - uint8_t wd; - uint16_t cent; - uint16_t yr; + struct tm *tm = (struct tm *) priv; + uint8_t dom; + uint8_t mon; + uint8_t sum; + uint8_t wd; + uint16_t cent; + uint16_t yr; tm->tm_sec = intclk.tm_sec; tm->tm_min = intclk.tm_min; @@ -352,8 +353,10 @@ nvr_time_get(struct tm *tm) /* Set internal clock time. */ void -nvr_time_set(struct tm *tm) +nvr_time_set(void *priv) { + struct tm *tm = (struct tm *) priv; + intclk.tm_sec = tm->tm_sec; intclk.tm_min = tm->tm_min; intclk.tm_hour = tm->tm_hour;