mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-22 06:19:54 -04:00
SCHEDULE_TIME (#1438)
* SCHEDULE_CALC_TIME_ALT * add s32 cast to avoid f32 -> u16 direct cast * SCHEDULE_TIME * remove the alts * Update explanation about the script
This commit is contained in:
@@ -28,10 +28,13 @@
|
||||
*/
|
||||
|
||||
// Macro to convert the time format used in the save struct into the format used in Schedule
|
||||
#define SCHEDULE_CONVERT_TIME(time) ((u16)((time) - 0x10000 / 360 * 90))
|
||||
#define SCHEDULE_CONVERT_TIME(time) ((s32)((time) - 0x10000 / 360 * 90))
|
||||
|
||||
#define SCHEDULE_TIME(hour, minute) SCHEDULE_CONVERT_TIME((((hour)*60.0f) + (minute)) * (0x10000 / 60 / 24.0f))
|
||||
|
||||
#define SCHEDULE_TIME_NOW SCHEDULE_CONVERT_TIME(gSaveContext.save.time)
|
||||
|
||||
typedef enum {
|
||||
typedef enum ScheduleCommandId {
|
||||
/* 0x00 */ SCHEDULE_CMD_ID_CHECK_FLAG_S, // Checks if a weekEventReg flag is set and branches if so, short range branch
|
||||
/* 0x01 */ SCHEDULE_CMD_ID_CHECK_FLAG_L, // Checks if a weekEventReg flag is set and branches if so, long range branch
|
||||
/* 0x02 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, // Checks if the current time is within the range of the two provided times and branches if so, short range branch
|
||||
|
||||
Reference in New Issue
Block a user