Improve Various Matchings and Cleanup (#809)

* Improve various matchings and cleanup

* Fix warnings

* Missed 2

* Few hex to dec

* PR Suggestions

* More PR Suggestions

* Document time calculation

* Improved use of macros

* DAY_LENGTH macro

* More cleanup of functions

Co-authored-by: hensldm <https://github.com/hensldm>

* Missing a space

* PR Suggestions

* Use DAY_LENGTH more
This commit is contained in:
engineer124
2022-05-25 21:36:49 -04:00
committed by GitHub
parent 9fcf1bd55b
commit c2c7240634
50 changed files with 190 additions and 251 deletions
+1
View File
@@ -51,6 +51,7 @@
#define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60))
#define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1))
#define DAY_LENGTH (CLOCK_TIME(24, 0))
#define TIME_TO_MINUTES_F(time) ((time) * ((24.0f * 60.0f) / 0x10000)) // 0.021972656f
#define CLOCK_TIME_F(hr, min) (((hr) * 60.0f + (min)) * (0x10000 / (24.0f * 60.0f)))
+2 -2
View File
@@ -129,9 +129,9 @@ typedef struct Save {
/* 0x000C */ u16 time; // "zelda_time"
/* 0x000E */ u16 owlSaveLocation;
/* 0x0010 */ s32 isNight; // "asahiru_fg"
/* 0x0014 */ u32 daySpeed; // "change_zelda_time"
/* 0x0014 */ s32 daySpeed; // "change_zelda_time"
/* 0x0018 */ s32 day; // "totalday"
/* 0x001C */ u32 daysElapsed; // "eventday"
/* 0x001C */ s32 daysElapsed; // "eventday"
/* 0x0020 */ u8 playerForm; // "player_character"
/* 0x0021 */ u8 snowheadCleared; // "spring_flag"
/* 0x0022 */ u8 hasTatl; // "bell_flag"