pokeemerald/include/rtc.h
Josh 6cc878919d Identify unused functions in siirtc.c, m4a.c & rtc.c
"SiiRtcSetAlarm" in siirtc.c, the "FormatHex" functions in rtc.c and "UnusedDummyFunc", m4aSongNumStartOrContinue", m4aSongNumContinue", "MusicPlayerJumpTableCopy" in m4a.c are all unused in vanilla so they've been changed to use the "UNUSED" attribute.
2025-08-09 20:57:59 +01:00

45 lines
1.4 KiB
C

#ifndef GUARD_RTC_UTIL_H
#define GUARD_RTC_UTIL_H
#include "siirtc.h"
#define RTC_INIT_ERROR 0x0001
#define RTC_INIT_WARNING 0x0002
#define RTC_ERR_12HOUR_CLOCK 0x0010
#define RTC_ERR_POWER_FAILURE 0x0020
#define RTC_ERR_INVALID_YEAR 0x0040
#define RTC_ERR_INVALID_MONTH 0x0080
#define RTC_ERR_INVALID_DAY 0x0100
#define RTC_ERR_INVALID_HOUR 0x0200
#define RTC_ERR_INVALID_MINUTE 0x0400
#define RTC_ERR_INVALID_SECOND 0x0800
#define RTC_ERR_FLAG_MASK 0x0FF0
extern struct Time gLocalTime;
void RtcDisableInterrupts(void);
void RtcRestoreInterrupts(void);
u32 ConvertBcdToBinary(u8 bcd);
bool8 IsLeapYear(u32 year);
u16 ConvertDateToDayCount(u8 year, u8 month, u8 day);
u16 RtcGetDayCount(struct SiiRtcInfo *rtc);
void RtcInit(void);
u16 RtcGetErrorStatus(void);
void RtcGetInfo(struct SiiRtcInfo *rtc);
void RtcGetDateTime(struct SiiRtcInfo *rtc);
void RtcGetStatus(struct SiiRtcInfo *rtc);
void RtcGetRawInfo(struct SiiRtcInfo *rtc);
u16 RtcCheckInfo(struct SiiRtcInfo *rtc);
void RtcReset(void);
void RtcCalcTimeDifference(struct SiiRtcInfo *rtc, struct Time *result, struct Time *t);
void RtcCalcLocalTime(void);
void RtcInitLocalTimeOffset(s32 hour, s32 minute);
void RtcCalcLocalTimeOffset(s32 days, s32 hours, s32 minutes, s32 seconds);
void CalcTimeDifference(struct Time *result, struct Time *t1, struct Time *t2);
u32 RtcGetMinuteCount(void);
u32 RtcGetLocalDayCount(void);
#endif // GUARD_RTC_UTIL_H