mm/include/z64scripts.h
Derek Hensley 0b375cadb0
Msgevent OK (#1637)
* Decompiled, some commands still unnamed

* Use full weekevent reg names

* Fix func_8094E69C

* Fix Player_GetMask

* Eventinf, mask worn, and item action argument formatting

* decimal rupees

* Times (day, hours, minutes) as decimal

* msgEventScriptPos

* Callbacks

* Name final commands

* Enum

* Arrays

* functions

* Small cleanups

* Clean up actors

* Remove event from some variable names to make them shorter

* Some more function renames

* newline

* Missed a few unks in commands

* Update functions.txt

* PlayerMask

* MSGMODE_PAUSED

* Script time macros

* EnSob1_GetWelcome default

* Whole bunch of renames

* Format

* Add CMD to commands

* Update code_functions

* structs for size

* z64scripts.h

* MsgEventCallback -> MsgScriptCallback

* format

* MsgEvent_RunScript stop

* Remove cmd handler comment

* cmd -> script in MsgEvent_RunScript

---------

Co-authored-by: Thar0 <17233964+Thar0@users.noreply.github.com>
2024-06-14 21:35:22 -07:00

25 lines
841 B
C

#ifndef Z64SCRIPTS_H
#define Z64SCRIPTS_H
#include "PR/ultratypes.h"
// Macros to convert the time format used in the save struct into the format used in scripts (Schedule or Message)
#define SCRIPT_CONVERT_TIME(time) ((s32)((time) - 0x10000 / 360 * 90))
#define SCRIPT_CALC_TIME(hour, minute, dest, temp) \
(temp) = (hour)*60.0f; \
(temp) += (minute); \
(dest) = (temp) * (0x10000 / 60 / 24.0f); \
(dest) = SCRIPT_CONVERT_TIME(dest)
#define SCRIPT_TIME(hour, minute) SCRIPT_CONVERT_TIME((((hour)*60.0f) + (minute)) * (0x10000 / 60 / 24.0f))
#define SCRIPT_TIME_NOW SCRIPT_CONVERT_TIME(CURRENT_TIME)
#define SCRIPT_PACK_16(h, l) (((h) << 8) | (l))
#define SCRIPT_UNPACK_8(v) (u8)(v)
#define SCRIPT_UNPACK_16(v) (u8)_SHIFTR(v, 8, 8), (u8)_SHIFTR(v, 0, 8)
#endif