-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy patheztr_api.h
More file actions
2235 lines (2007 loc) · 75.8 KB
/
eztr_api.h
File metadata and controls
2235 lines (2007 loc) · 75.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef __EZTR_API__
#define __EZTR_API__
/*! \file eztr_api.h
\version 2.3.0
\brief The main header for EZTR
*/
#include "modding.h"
#include "global.h"
#ifdef DOXYGEN
#define EZTR_IMPORT(func) func
#define EZTR_PACK_STRUCT
#else
#define EZTR_IMPORT(func) RECOMP_IMPORT(EZTR_MOD_ID_STR, func)
#define EZTR_PACK_STRUCT __attribute__((packed))
typedef struct {
u16 new_id;
u8 out_success;
} _EZTR_CustomMsgHandleSetter;
#define __EZTR_CUSTOM_MSG_HANDLE_BODY(name) { \
static u16 id; \
static u8 is_set = 0; \
if (setter != NULL) { \
if (is_set) { \
_EZTR_ReportDebugMessage("EZTR_CustomMsgHandle '" #name "', Header Version 2.3.0: The textId has already been set and will not be updated."); \
setter->out_success = 0; \
} \
else { \
_EZTR_ReportDebugMessage("EZTR_CustomMsgHandle '" #name "', Header Version 2.3.0: Assignment of textId was successful."); \
id = setter->new_id; \
is_set = 1; \
setter->out_success = 1; \
} \
} \
return id; \
} \
#endif
/**
* \defgroup General
*
* \brief General API information.
*
* @{
*/
/**
* @brief The mod id string for EZTR.
*
* The `eztr_api.h` imports all the functions and events needed for EZTR,
* so you probably won't need to use this directly.
*/
#define EZTR_MOD_ID_STR "MM_EZ_Text_Replacer_API"
#ifndef DOXYGEN
EZTR_IMPORT( void _EZTR_ReportFatalMessage(char* msg));
EZTR_IMPORT( void _EZTR_ReportErrorMessage(char* msg));
EZTR_IMPORT( void _EZTR_ReportWarningMessage(char* msg));
EZTR_IMPORT( void _EZTR_ReportInfoMessage(char* msg));
EZTR_IMPORT( void _EZTR_ReportDebugMessage(char* msg));
EZTR_IMPORT( void _EZTR_ReportVerboseMessage(char* msg));
// Typo, Included for backwards compatibility:
EZTR_IMPORT( void _EXTR_ReportErrorMessage(char* msg));
#endif
#define EZTR_MSG_HIGHEST_ID 0x354C
/**
* @brief The the full size of message buffer, in bytes.
*
* Also equivalent to maximum length of buffer in single-byte characters (`char`).
*/
#define EZTR_MSG_BUFFER_SIZE 1280
/**
* @brief The maximum length of buffer in two-byte characters (`wchar`).
*
* Not really used, but included for parity with the base game.
*/
#define EZTR_MSG_BUFFER_WIDE_SIZE 640
/**
* @brief The size of the message buffer's header region, in bytes.
*
* Also servers as the starting index of the message buffer's content region.
*
*/
#define EZTR_MSG_HEADER_SIZE 11
/**
* @brief The size of the message buffer's content region, in bytes.
*
* Useful if you need to loop throught a buffer's content.
*/
#define EZTR_MSG_CONTENT_SIZE 1269 // MESSAGE_BUFFER_SIZE - MESSAGE_HEADER_SIZE
#define EZTR_MSG_ENDING_CHAR '\xBF'
#define EZTR_PIPE_CHAR '|'
/** @}*/
/**
* \defgroup CustomMsgHandle
*
* \brief Macros and types used for working with the handles for custom messages.
*
* This page contains all of the information in custom message handles an how to use them.
*
* It's worth noting that a custom message handle is actually a function, defined through macros.
* In brief, here are the important things to know:
* * The handler's only argument is a pointer that EZTR uses internally. Modders don't need to use it.
* * You can retrieve the handle's textId by calling it with NULL as the argument (`handle(NULL)`)
* * By default, the handle can only have its textId assigned once (See below on how to change this behavior).
* * Handles created using `EZTR_DEFINE_CUSTOM_MSG_HANDLE`, the recommended macro for creating custom message handles, are marked with `RECOMP_EXPORT`.
*
* This implementation was decided on to ensure that the textIds of custom messages are not lost through
* variable reassignments, and to facilitate mods potentially needing to access/modify each other's messages.
*
* For those interested in the technical details: The function's only argument is used by EZTR to set the textId variable
* when a custom message is assigned to it, and to check that the assignment was a success.
*
* The version of the handle function included in this header stores the textId in a static variable, and includes logic that
* will only allow the textId to be set once. If a second attempt to set the ID is made, an error message is printed. Rather than
* change a handle's textId, you should change the stored message at that id.
*
* If you want to change the behavior of the handles, you can write your own custom message handle functions, but
* it's not recommended.
*
* @{
*/
/**
* @brief Uses to set/get the actual symbol name for custom message handles
* If you want to add a prefix/suffix to your custom message handles globally, it can be done here.
*/
#ifdef EZTR_NO_HANDLE_PREFIX
#define EZTR_CUSTOM_MSG_HANDLE_NAME(name) name
#else
#define EZTR_CUSTOM_MSG_HANDLE_NAME(name_suffix) EZTR_CustomMsgHandle_##name_suffix
#endif
/**
* @brief Creates a non-exported CustomMsgHandle object
*
* Most mods are not installed in a vacuum. You should consider exporting your custom message handles
* so that other mods can access the messages you define if need be (compatibility patches, addons, etc.)
*
*/
#define EZTR_DEFINE_CUSTOM_MSG_HANDLE_NO_EXPORT(name) \
u16 EZTR_CUSTOM_MSG_HANDLE_NAME(name)(_EZTR_CustomMsgHandleSetter* setter) \
__EZTR_CUSTOM_MSG_HANDLE_BODY(name)
/**
* @brief Creates a CustomMsgHandle object
*
* This is the primary method for creating handles for custom messages. You'll need to use this macro
* inside one of your .c files (outside of any functions) to create the handle itself. Use
* `EZTR_DECLARE_CUSTOM_MSG_HANDLE` to access the handle from other files.
*
* See the `EZTR_CustomMsgHandle` documentation for more information about handles and how they work.
*
*/
#define EZTR_DEFINE_CUSTOM_MSG_HANDLE(name) RECOMP_EXPORT \
u16 EZTR_CUSTOM_MSG_HANDLE_NAME(name)(_EZTR_CustomMsgHandleSetter* setter) \
__EZTR_CUSTOM_MSG_HANDLE_BODY(name)
/**
* @brief Creates a declaration for a CustomMsgHandle object.
*
* Use this reference handles created in other .c files. Also works in headers.
*
*/
#define EZTR_DECLARE_CUSTOM_MSG_HANDLE(name) u16 EZTR_CUSTOM_MSG_HANDLE_NAME(name)(_EZTR_CustomMsgHandleSetter* setter)
/**
* @brief Creates a declaration for a CustomMsgHandle object. Alternative to `EZTR_DECLARE_CUSTOM_MSG_HANDLE`.
*
* Use this reference handles created in other .c files. Also works in headers.
*
*/
#define EZTR_EXTERN_CUSTOM_MSG_HANDLE(name) EZTR_DECLARE_CUSTOM_MSG_HANDLE(name)
/**
* @brief Declares and imports a CustomMsgHandle object from another mod.
*
* This will allow you to use and interact with custom messages from other mods.
*/
#define EZTR_IMPORT_CUSTOM_MSG_HANDLE(mod_str, name_suffix) RECOMP_IMPORT(mod_str, u16 EZTR_CustomMsgHandle_##name_suffix(_EZTR_CustomMsgHandleSetter* setter))
/**
* @brief Declares and imports a CustomMsgHandle object from another mod.
*
* This will allow you to use and interact with custom messages from other mods.
*/
#define EZTR_IMPORT_CUSTOM_MSG_HANDLE_NO_PREFIX(mod_str, name) RECOMP_IMPORT(mod_str, u16 name(_EZTR_CustomMsgHandleSetter* setter))
/**
* @brief Gets the textId from a custom message handle.
*
* A more readable alternative to `handle(NULL)`
*
*/
#define EZTR_GET_CUSTOM_MSG_ID(handle) handle(NULL)
// Shorthand:
/**
* @brief Shorthand for `EZTR_CUSTOM_MSG_HANDLE_NAME()`
*
* Useful if you want to use global prefixes.
*
*/
#define EZTR_HNAME(name_suffix) EZTR_CUSTOM_MSG_HANDLE_NAME(name_suffix)
/**
* @brief Gets the textId from a custom message handle.
*
* A more readable alternative to `handle(NULL)`, and shorthand for `EZTR_GET_CUSTOM_MSG_ID()`
*
* Note that this macro won't apply the global prefix if it's enabled. You'll need to use something like
* `EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(my_handle))` or `EZTR_GET_ID(EZTR_HNAME(my_handle))`.
*/
#define EZTR_GET_ID(handle) EZTR_GET_CUSTOM_MSG_ID(handle)
/**
* @brief Gets the textId from a custom message handle.
*
* A more readable alternative to `EZTR_CustomMsgHandle_##handle(NULL)`.
*
* This macro WILL apply the global prefix if it's enabled, and can be considered shorthand for
* `EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(my_handle))` or `EZTR_GET_ID(EZTR_HNAME(my_handle))`.
*/
#define EZTR_GET_ID_H(handle) EZTR_GET_CUSTOM_MSG_ID(EZTR_CUSTOM_MSG_HANDLE_NAME(handle))
/** @}*/
/**
* @brief A macro to easily create message callback functions.
*
* This macro can be used to create both the function definition and declaration (if one is needed);
*
* * To create the definition, use `EZTR_MSG_CALLBACK(my_callback) {...}`
* * To create the declaration, use `EZTR_MSG_CALLBACK(my_callback);`
*
* `my_callback` can then be passed to any `EZTR_Basic_*` function as the `callback` argument.
* `my_callback` will be run immediately after EZTR loads the message from its internal
* table, allowing you to make changes (or completely regenerate the message from scratch)
* before the message is displayed.
*
* The function generated by this macro has 3 arguments:
* * `EZTR_MsgBuffer* buf` - A message buffer, prepopulated with a copy of whatever message you stored. Write to this buffer the change the message.
* * `u16 textId` - The textId of the message. Useful if you want multiple messages to be controlled by one callback function.
* * `PlayState* play` - The current PlayState for the game. This makes it easy to generate text based on the game's state.
*
*/
#define EZTR_MSG_CALLBACK(fname) void fname(EZTR_MsgBuffer* buf, u16 textId, PlayState* play)
/**
* @brief Used to declare a function that should run after EZTR has finished initializing.
*
* This is where you should declare all of your text replacements. You don't want to declare them during a
* `recomp_on_init` event, since EZTR may not have initialized itself yet, and attempting to declare text
* replacements before that will cause a crash. Additionally, declaring messaged here will ensure that mod
* priority order is respected when declaring replacements.
*
* As of version 2.1.0, EZTR now enforces that message all calls to `EZTR_Basic_*` functions must be made here.
*
* Example: `EZTR_ON_INIT void declare_my_text() {...}`
*
*/
#define EZTR_ON_INIT RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnInit)
/**
* @brief Used to declare a callback function for when EZTR dumps a message. Normally, EZTR only prints that message to the game console,
* but this callback will allow you to do other things with that information. This `EZTR_ON_DUMP_BUFFER` event is only called when EZTR's
* text dump setting is set to `On`.
*
* This is a feature intended for developers, for the creation of EZTR-related tools. It should not be used for gameplay.
*
* The functions parameters are
* * `const char* category`, currently only returns 'Game'.
* * `u16 textId`, the ID of the message being dumped.
* * ` s32 len`, the size of the message in bytes.
* * `EZTR_MsgBuffer* buf`, the message buffer itself.
*
*/
#define EZTR_ON_DUMP_BUFFER(func_name) \
RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnDumpBuffer) void func_name(const char* category, u16 textId, s32 len, EZTR_MsgBuffer* buf)
/**
* @brief Used to declare a callback function for when EZTR dumps the entire message buffer. Normally, EZTR only prints that message to the game console,
* but this callback will allow you to do other things with that information. This `EZTR_ON_DUMP_BUFFER` event is only called when EZTR's
* text dump setting is set to `Full`.
*
* This is a feature intended for developers, for the creation of EZTR-related tools. It should not be used for gameplay.
*
* The functions parameters are
* * `const char* category`, currently only returns 'Game'.
* * `u16 textId`, the ID of the message being dumped.
* * ` s32 len`, the size of the message in bytes.
* * `EZTR_MsgBuffer* buf`, the message buffer itself.
*
*/
#define EZTR_ON_DUMP_BUFFER_FULL(func_name) \
RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnDumpBufferFull) void func_name(const char* category, u16 textId, s32 len, EZTR_MsgBuffer* buf)
/**
* @brief Used by certain members of `EZTR_MsgData` (and the message header generally) to indicate that said member is not in use.
*
* The header members in question are:
*
* * `next_message_id`
* * `first_item_rupees`
* * `second_item_rupees`
*
*/
#define EZTR_NO_VALUE 0xffff
/**
* \defgroup Types
*
* \brief Type definitions that EZTR uses for Majora's Mask messages.
*
* @{
*/
/**
* @brief The message buffers type as defined in the Majora's Mask decompilation.
*
* While you can edit messages by interacting with this struct directly, EZTR
* offers much better ways of editing messages.
*/
typedef union {
char schar[EZTR_MSG_BUFFER_SIZE]; // msgBuf
u16 wchar[EZTR_MSG_BUFFER_WIDE_SIZE]; // msgBufWide
u64 force_structure_alignment_msg;
} EZTR_MsgBuffer_Raw;
/**
* @brief The message buffer, but with the header and content regions defined as seperate arrays.
*
* The `content` member can be passed to the `EZTR_MsgSContent_` functions for use in text operations.
*
*/
typedef struct {
char header[EZTR_MSG_HEADER_SIZE];
char content[EZTR_MSG_CONTENT_SIZE];
} EZTR_MsgBuffer_Partition;
/**
* @brief The message buffer, with the header represented as its individual members.
*
* When compiled, this struct is marked with the `packed` attribute to ensure that it's members align
* to their proper locations within the buffer.
*
* The `padding` member represents a section of the buffer that is unused, and should thus be ignored.
*
* The `content` member can be passed to the `EZTR_MsgSContent_` functions for use in text operations.
*
*/
typedef struct EZTR_PACK_STRUCT {
u8 text_box_type;
u8 text_box_y_pos;
u8 display_icon;
u16 next_message_id;
u16 first_item_rupees;
u16 second_item_rupees;
u16 padding;
char content[EZTR_MSG_CONTENT_SIZE];
} EZTR_MsgBuffer_Data;
/**
* @brief A union of the three MsgBuffer structs, and the primary type for interacting with message data.
*
* Each member of the union is a different way of representing the buffer in code.
*
* * `raw` is the buffer as it exists in the Majora's Mask decomp.
* * `partitions` is the buffer, seperated into it's two primary regions (header and content).
* * `data` is the buffer, with it's header and content values listed as individual members.
*
* Do not allocate this on the stack, as you'll likely end up with a StackOverflow. Instead, create a buffer using
* `EZTR_MsgBuffer_Create()` of one of it's sister functions.
*/
typedef union {
EZTR_MsgBuffer_Raw raw;
EZTR_MsgBuffer_Partition partitions;
EZTR_MsgBuffer_Data data;
} EZTR_MsgBuffer;
/**
* @brief The type declaration for custom message handle.
*
* These are created using either the `EZTR_DEFINE_CUSTOM_MSG_HANDLE()` macro
* or the `EZTR_DEFINE_CUSTOM_MSG_HANDLE_NO_EXPORT()` macro in one of your .c files,
* outside of any functions.
*
*
*/
typedef u16 (*EZTR_CustomMsgHandle)(_EZTR_CustomMsgHandleSetter* setter);
/**
* @brief The function pointer type for message callbacks.
*
* To easily create functions that match this type, see the `EZTR_MSG_CALLBACK()` macro.
*
*/
typedef void (*EZTR_MsgCallback)(EZTR_MsgBuffer* buf, u16 textId, PlayState* play);
/**
* @brief Used in the message header to indicate the style of textbox used for the message.
*
* You can set the text box type by assigning to the `text_box_type` member of EZTR_MsgData,
* or by using `EZTR_MsgBuffer_SetTextBoxType()`.
*
*/
typedef enum {
EZTR_STANDARD_TEXT_BOX_I = 0X00,
EZTR_WOODEN_SIGN_BACKGROUND = 0X01,
EZTR_TRANSLUSCENT_BLUE_TEXT_BOX = 0X02,
EZTR_OCARINA_STAFF = 0X03,
EZTR_INVISIBLE_TEXT_BOX_I = 0X04,
EZTR_INVISIBLE_TEXT_BOX_II = 0X05,
EZTR_STANDARD_TEXT_BOX_II = 0X06,
EZTR_INVISIBLE_TEXT_BOX = 0X07,
EZTR_BLUE_TEXT_BOX = 0X08,
EZTR_RED_TEXT_BOX_I = 0X09,
EZTR_INVISIBLE_TEXT_BOX_III = 0X0A,
EZTR_INVISIBLE_TEXT_BOX_IV = 0X0B,
EZTR_INVISIBLE_TEXT_BOX_V = 0X0C,
EZTR_BOMBERS_NOTEBOOK = 0X0D,
EZTR_INVISIBLE_TEXT_BOX_VI = 0X0E,
EZTR_RED_TEXT_BOX_II = 0X0F
} EZTR_TextBoxType;
/**
* @brief Used in the message header to indicate a display icon for the message.
*
* You can set the display icon by assigning to the `display_icon` member of EZTR_MsgData,
* or by using `EZTR_MsgBuffer_SetTextBoxDIsplayIcon()`.
*
* Note that the value for not displaying an icon is `EZTR_ICON_NO_ICON`, and NOT
*
* `EZTR_ICON_NOTHING` or it's variants.
*/
typedef enum {
EZTR_ICON_NOTHING = 0x00,
EZTR_ICON_GREEN_RUPEE = 0x01,
EZTR_ICON_BLUE_RUPEE = 0x02,
EZTR_ICON_WHITE_RUPEE = 0x03,
EZTR_ICON_RED_RUPEE = 0x04,
EZTR_ICON_PURPLE_RUPEE = 0x05,
EZTR_ICON_WHITE_RUPEE_1 = 0x06,
EZTR_ICON_ORANGE_RUPEE = 0x07,
EZTR_ICON_ADULT_WALLET = 0x08,
EZTR_ICON_GIANTS_WALLET = 0x09,
EZTR_ICON_RECOVERY_HEART = 0x0A,
EZTR_ICON_RECOVERY_HEART_1 = 0x0B,
EZTR_ICON_PIECE_OF_HEART = 0x0C,
EZTR_ICON_HEART_CONTAINER = 0x0D,
EZTR_ICON_SMALL_MAGIC_JAR = 0x0E,
EZTR_ICON_LARGE_MAGIC_JAR = 0x0F,
EZTR_ICON_RECOVERY_HEART_2 = 0x10,
EZTR_ICON_STRAY_FAIRY = 0x11,
EZTR_ICON_RECOVERY_HEART_3 = 0x12,
EZTR_ICON_RECOVERY_HEART_4 = 0x13,
EZTR_ICON_BOMB = 0x14,
EZTR_ICON_BOMB_1 = 0x15,
EZTR_ICON_BOMB_2 = 0x16,
EZTR_ICON_BOMB_3 = 0x17,
EZTR_ICON_BOMB_4 = 0x18,
EZTR_ICON_DEKU_STICK = 0x19,
EZTR_ICON_BOMBCHU = 0x1A,
EZTR_ICON_BOMB_BAG = 0x1B,
EZTR_ICON_BIG_BOMB_BAG = 0x1C,
EZTR_ICON_BIGGER_BOMB_BAG = 0x1D,
EZTR_ICON_HEROS_BOW = 0x1E,
EZTR_ICON_HEROS_BOW_1 = 0x1F,
EZTR_ICON_HEROS_BOW_2 = 0x20,
EZTR_ICON_HEROS_BOW_3 = 0x21,
EZTR_ICON_QUIVER = 0x22,
EZTR_ICON_BIG_QUIVER = 0x23,
EZTR_ICON_BIGGEST_QUIVER = 0x24,
EZTR_ICON_FIRE_ARROW = 0x25,
EZTR_ICON_ICE_ARROW = 0x26,
EZTR_ICON_LIGHT_ARROW = 0x27,
EZTR_ICON_DEKU_NUT = 0x28,
EZTR_ICON_DEKU_NUT_1 = 0x29,
EZTR_ICON_DEKU_NUT_2 = 0x2A,
EZTR_ICON_NOTHING_1 = 0x2B,
EZTR_ICON_NOTHING_2 = 0x2C,
EZTR_ICON_NOTHING_3 = 0x2D,
EZTR_ICON_NOTHING_4 = 0x2E,
EZTR_ICON_NOTHING_5 = 0x2F,
EZTR_ICON_NOTHING_6 = 0x30,
EZTR_ICON_NOTHING_7 = 0x31,
EZTR_ICON_HEROS_SHIELD = 0x32,
EZTR_ICON_MIRROR_SHIELD = 0x33,
EZTR_ICON_POWDER_KEG = 0x34,
EZTR_ICON_MAGIC_BEAN = 0x35,
EZTR_ICON_PICTOGRAPH_BOX = 0x36,
EZTR_ICON_KOKIRI_SWORD = 0x37,
EZTR_ICON_RAZOR_SWORD = 0x38,
EZTR_ICON_GILDED_SWORD = 0x39,
EZTR_ICON_FIERCE_DEITYS_SWORD = 0x3A,
EZTR_ICON_GREAT_FAIRYS_SWORD = 0x3B,
EZTR_ICON_SMALL_KEY = 0x3C,
EZTR_ICON_BOSS_KEY = 0x3D,
EZTR_ICON_DUNGEON_MAP = 0x3E,
EZTR_ICON_COMPASS = 0x3F,
EZTR_ICON_POWDER_KEG_1 = 0x40,
EZTR_ICON_HOOKSHOT = 0x41,
EZTR_ICON_LENS_OF_TRUTH = 0x42,
EZTR_ICON_PICTOGRAPH_BOX_1 = 0x43,
EZTR_ICON_FISHING_ROD = 0x44,
EZTR_ICON_NOTHING_8 = 0x45,
EZTR_ICON_NOTHING_9 = 0x46,
EZTR_ICON_NOTHING_10 = 0x47,
EZTR_ICON_NOTHING_11 = 0x48,
EZTR_ICON_NOTHING_12 = 0x49,
EZTR_ICON_NOTHING_13 = 0x4A,
EZTR_ICON_NOTHING_14 = 0x4B,
EZTR_ICON_OCARINA_OF_TIME = 0x4C,
EZTR_ICON_NOTHING_15 = 0x4D,
EZTR_ICON_NOTHING_16 = 0x4E,
EZTR_ICON_NOTHING_17 = 0x4F,
EZTR_ICON_BOMBERS_NOTEBOOK = 0x50,
EZTR_ICON_NOTHING_18 = 0x51,
EZTR_ICON_GOLD_SKULLTULA_TOKEN = 0x52,
EZTR_ICON_NOTHING_19 = 0x53,
EZTR_ICON_NOTHING_20 = 0x54,
EZTR_ICON_ODOLWAS_REMAINS = 0x55,
EZTR_ICON_GOHTS_REMAINS = 0x56,
EZTR_ICON_GYORGS_REMAINS = 0x57,
EZTR_ICON_TWINMOLDS_REMAINS = 0x58,
EZTR_ICON_RED_POTION = 0x59,
EZTR_ICON_EMPTY_BOTTLE = 0x5A,
EZTR_ICON_RED_POTION_1 = 0x5B,
EZTR_ICON_GREEN_POTION = 0x5C,
EZTR_ICON_BLUE_POTION = 0x5D,
EZTR_ICON_FAIRYS_SPIRIT = 0x5E,
EZTR_ICON_DEKU_PRINCESS = 0x5F,
EZTR_ICON_MILK = 0x60,
EZTR_ICON_MILK_HALF = 0x61,
EZTR_ICON_FISH = 0x62,
EZTR_ICON_BUG = 0x63,
EZTR_ICON_BLUE_FIRE = 0x64,
EZTR_ICON_POE = 0x65,
EZTR_ICON_BIG_POE = 0x66,
EZTR_ICON_SPRING_WATER = 0x67,
EZTR_ICON_HOT_SPRING_WATER = 0x68,
EZTR_ICON_ZORA_EGG = 0x69,
EZTR_ICON_GOLD_DUST = 0x6A,
EZTR_ICON_MUSHROOM = 0x6B,
EZTR_ICON_NOTHING_21 = 0x6C,
EZTR_ICON_NOTHING_22 = 0x6D,
EZTR_ICON_SEAHORSE = 0x6E,
EZTR_ICON_CHATEAU_ROMANI = 0x6F,
EZTR_ICON_HYLIAN_LOACH = 0x70,
EZTR_ICON_NOTHING_23 = 0x71,
EZTR_ICON_NOTHING_24 = 0x72,
EZTR_ICON_NOTHING_25 = 0x73,
EZTR_ICON_NOTHING_26 = 0x74,
EZTR_ICON_NOTHING_27 = 0x75,
EZTR_ICON_NOTHING_28 = 0x76,
EZTR_ICON_NOTHING_29 = 0x77,
EZTR_ICON_DEKU_MASK = 0x78,
EZTR_ICON_GORON_MASK = 0x79,
EZTR_ICON_ZORA_MASK = 0x7A,
EZTR_ICON_FIERCE_DEITY_MASK = 0x7B,
EZTR_ICON_MASK_OF_TRUTH = 0x7C,
EZTR_ICON_KAFEIS_MASK = 0x7D,
EZTR_ICON_ALL_NIGHT_MASK = 0x7E,
EZTR_ICON_BUNNY_HOOD = 0x7F,
EZTR_ICON_KEATON_MASK = 0x80,
EZTR_ICON_GARO_MASK = 0x81,
EZTR_ICON_ROMANI_MASK = 0x82,
EZTR_ICON_CIRCUS_LEADERS_MASK = 0x83,
EZTR_ICON_POSTMANS_HAT = 0x84,
EZTR_ICON_COUPLES_MASK = 0x85,
EZTR_ICON_GREAT_FAIRYS_MASK = 0x86,
EZTR_ICON_GIBDO_MASK = 0x87,
EZTR_ICON_DON_GEROS_MASK = 0x88,
EZTR_ICON_KAMAROS_MASK = 0x89,
EZTR_ICON_CAPTAINS_HAT = 0x8A,
EZTR_ICON_STONE_MASK = 0x8B,
EZTR_ICON_BREMEN_MASK = 0x8C,
EZTR_ICON_BLAST_MASK = 0x8D,
EZTR_ICON_MASK_OF_SCENTS = 0x8E,
EZTR_ICON_GIANTS_MASK = 0x8F,
EZTR_ICON_NOTHING_30 = 0x90,
EZTR_ICON_CHATEAU_ROMANI_1 = 0x91,
EZTR_ICON_MILK_1 = 0x92,
EZTR_ICON_GOLD_DUST_1 = 0x93,
EZTR_ICON_HYLIAN_LOACH_1 = 0x94,
EZTR_ICON_SEAHORSE_1 = 0x95,
EZTR_ICON_MOONS_TEAR = 0x96,
EZTR_ICON_TOWN_TITLE_DEED = 0x97,
EZTR_ICON_SWAMP_TITLE_DEED = 0x98,
EZTR_ICON_MOUNTAIN_TITLE_DEED = 0x99,
EZTR_ICON_OCEAN_TITLE_DEED = 0x9A,
EZTR_ICON_NOTHING_31 = 0x9B,
EZTR_ICON_NOTHING_32 = 0x9C,
EZTR_ICON_NOTHING_33 = 0x9D,
EZTR_ICON_NOTHING_34 = 0x9E,
EZTR_ICON_NOTHING_35 = 0x9F,
EZTR_ICON_ROOM_KEY = 0xA0,
EZTR_ICON_SPECIAL_DELIVERY_TO_MAMA = 0xA1,
EZTR_ICON_NOTHING_36 = 0xA2,
EZTR_ICON_NOTHING_37 = 0xA3,
EZTR_ICON_NOTHING_38 = 0xA4,
EZTR_ICON_NOTHING_39 = 0xA5,
EZTR_ICON_NOTHING_40 = 0xA6,
EZTR_ICON_NOTHING_41 = 0xA7,
EZTR_ICON_NOTHING_42 = 0xA8,
EZTR_ICON_NOTHING_43 = 0xA9,
EZTR_ICON_LETTER_TO_KAFEI = 0xAA,
EZTR_ICON_PENDANT_OF_MEMORIES = 0xAB,
EZTR_ICON_NOTHING_44 = 0xAC,
EZTR_ICON_NOTHING_45 = 0xAD,
EZTR_ICON_NOTHING_46 = 0xAE,
EZTR_ICON_NOTHING_47 = 0xAF,
EZTR_ICON_NOTHING_48 = 0xB0,
EZTR_ICON_NOTHING_49 = 0xB1,
EZTR_ICON_NOTHING_50 = 0xB2,
EZTR_ICON_TINGLES_MAP = 0xB3,
EZTR_ICON_TINGLES_MAP_1 = 0xB4,
EZTR_ICON_TINGLES_MAP_2 = 0xB5,
EZTR_ICON_TINGLES_MAP_3 = 0xB6,
EZTR_ICON_TINGLES_MAP_4 = 0xB7,
EZTR_ICON_TINGLES_MAP_5 = 0xB8,
EZTR_ICON_TINGLES_MAP_6 = 0xB9,
EZTR_ICON_NOTHING_51 = 0xBA,
EZTR_ICON_NOTHING_52 = 0xBB,
EZTR_ICON_NOTHING_53 = 0xBC,
EZTR_ICON_NOTHING_54 = 0xBD,
EZTR_ICON_NOTHING_55 = 0xBE,
EZTR_ICON_NOTHING_56 = 0xBF,
EZTR_ICON_NOTHING_57 = 0xC0,
EZTR_ICON_NOTHING_58 = 0xC1,
EZTR_ICON_NOTHING_59 = 0xC2,
EZTR_ICON_NOTHING_60 = 0xC3,
EZTR_ICON_NOTHING_61 = 0xC4,
EZTR_ICON_NOTHING_62 = 0xC5,
EZTR_ICON_NOTHING_63 = 0xC6,
EZTR_ICON_NOTHING_64 = 0xC7,
EZTR_ICON_NOTHING_65 = 0xC8,
EZTR_ICON_NOTHING_66 = 0xC9,
EZTR_ICON_NOTHING_67 = 0xCA,
EZTR_ICON_NOTHING_68 = 0xCB,
EZTR_ICON_NOTHING_69 = 0xCC,
EZTR_ICON_NOTHING_70 = 0xCD,
EZTR_ICON_NOTHING_71 = 0xCE,
EZTR_ICON_NOTHING_72 = 0xCF,
EZTR_ICON_NOTHING_73 = 0xD0,
EZTR_ICON_NOTHING_74 = 0xD1,
EZTR_ICON_NOTHING_75 = 0xD2,
EZTR_ICON_NOTHING_76 = 0xD3,
EZTR_ICON_NOTHING_77 = 0xD4,
EZTR_ICON_NOTHING_78 = 0xD5,
EZTR_ICON_NOTHING_79 = 0xD6,
EZTR_ICON_NOTHING_80 = 0xD7,
EZTR_ICON_SMALL_BLACK_LINE = 0xD8,
EZTR_ICON_SMALL_BLACK_LINE_1 = 0xD9,
EZTR_ICON_SMALL_BLACK_LINE_2 = 0xDA,
EZTR_ICON_SMALL_BLACK_LINE_3 = 0xDB,
EZTR_ICON_ANJU = 0xDC,
EZTR_ICON_KAFEI = 0xDD,
EZTR_ICON_CURIOSITY_SHOP_OWNER = 0xDE,
EZTR_ICON_BOMB_SHOP_OWNERS_MOTHER = 0xDF,
EZTR_ICON_ROMANI = 0xE0,
EZTR_ICON_CREMIA = 0xE1,
EZTR_ICON_MAYOR_DOTOUR = 0xE2,
EZTR_ICON_MADAME_AROMA = 0xE3,
EZTR_ICON_TOTO = 0xE4,
EZTR_ICON_GORMAN = 0xE5,
EZTR_ICON_POSTMAN = 0xE6,
EZTR_ICON_ROSA_SISTERS = 0xE7,
EZTR_ICON_TOILET_HAND = 0xE8,
EZTR_ICON_GRANNY = 0xE9,
EZTR_ICON_KAMARO = 0xEA,
EZTR_ICON_GROG = 0xEB,
EZTR_ICON_GORMAN_BROTHERS = 0xEC,
EZTR_ICON_SHIRO = 0xED,
EZTR_ICON_GURU_GURU = 0xEE,
EZTR_ICON_BOMBERS = 0xEF,
EZTR_ICON_EXCLAMATION_MARK = 0xF0,
EZTR_ICON_NOTHING_81 = 0xF1,
EZTR_ICON_NOTHING_82 = 0xF2,
EZTR_ICON_NOTHING_83 = 0xF3,
EZTR_ICON_NOTHING_84 = 0xF4,
EZTR_ICON_NOTHING_85 = 0xF5,
EZTR_ICON_NOTHING_86 = 0xF6,
EZTR_ICON_NOTHING_87 = 0xF7,
EZTR_ICON_NOTHING_88 = 0xF8,
EZTR_ICON_NOTHING_89 = 0xF9,
EZTR_ICON_NOTHING_90 = 0xFA,
EZTR_ICON_NOTHING_91 = 0xFB,
EZTR_ICON_NOTHING_92 = 0xFC,
EZTR_ICON_NOTHING_93 = 0xFD,
EZTR_ICON_NO_ICON = 0xFE,
EZTR_ICON_MAX = 0xFE
} EZTR_TextBoxIcon;
/** @}*/
/**
* \defgroup Control_Code_Macros
* \brief Macros for the various control codes and non-printable bytes used in the Majora's Mask text encoding.
*
* Most of this information was pulled from [the CloudModding wiki](https://wiki.cloudmodding.com/mm/Text_Format).
*
* @{
*/
/**
* @brief Following Text Color: Default
*
* Default is usually white, but may be black (ie: for notebook updates).
*
*/
#define EZTR_CC_COLOR_DEFAULT "\x00"
/**
* @brief Following Text Color: Red
*/
#define EZTR_CC_COLOR_RED "\x01"
/**
* @brief Following Text Color: Green
*/
#define EZTR_CC_COLOR_GREEN "\x02"
/**
* @brief Following Text Color: Blue
*/
#define EZTR_CC_COLOR_BLUE "\x03"
/**
* @brief Following Text Color: Yellow
*/
#define EZTR_CC_COLOR_YELLOW "\x04"
/**
* @brief Following Text Color: Turquoise
*/
#define EZTR_CC_COLOR_LIGHTBLUE "\x05"
/**
* @brief Following Text Color: Pink
*/
#define EZTR_CC_COLOR_PINK "\x06"
/**
* @brief Following Text Color: Silver
*/
#define EZTR_CC_COLOR_SILVER "\x07"
/**
* @brief Following Text Color: Orange
*/
#define EZTR_CC_COLOR_ORANGE "\x08"
/**
* @brief Slows down text (not used)
*
* Text normally prints 2 letters at a time. 0A acts as a null character. So 0A0A prints nothing not even a space when normally 2 letters are printed.
*
*/
#define EZTR_CC_TEXT_SPEED "\x0a"
/**
* @brief Print: Hits Required to Win Jungle Cruise Reward
*/
#define EZTR_CC_HS_BOAT_ARCHERY "\x0b"
/**
* @brief Print: Stray Fairies Collected in Current Dungeon
*
*/
#define EZTR_CC_STRAY_FAIRIES "\x0c"
/**
* @brief Print: Gold Skulltulas Collected in Current Spider House
*/
#define EZTR_CC_TOKENS "\x0d"
/**
* @brief Print: 0
*/
#define EZTR_CC_POINTS_TENS "\x0e"
/**
* @brief Print: 0
*/
#define EZTR_CC_POINTS_THOUSANDS "\x0f"
/**
* @brief Box Break I
*
* Used when four lines of text have been printed, but can technically be used anywhere. More robust than 12/000B? [?]
*
*/
#define EZTR_CC_BOX_BREAK "\x10"
/**
* @brief Line Break
*/
#define EZTR_CC_NEWLINE "\x11"
/**
* @brief Box Break II
*
* Used when three lines of text have been printed. Usually preceded by a 13/000C character.
*
*/
#define EZTR_CC_BOX_BREAK2 "\x12"
/**
* @brief Reset Cursor Position to Start of Current Line
*
* Used as a filler when there are fewer than four lines of text. Usually preceded by a newline when two lines of text have been printed.
*
*/
#define EZTR_CC_CARRIAGE_RETURN "\x13"
/**
* @brief Print: xx Spaces
*
* The value of the next byte will control how many spaces to print.
*
*/
#define EZTR_CC_SHIFT "\x14"
/**
* @brief Print: %c Spaces
*
* The value of the next byte will control how many spaces to print.
* This macro adds a `%%c` flag after the control code, enabling you to set the argument byte using EZTR's printf handling.
*
* See \ref prinf_functions for more information on EZTR's custom printf behavior.
*/
#define EZTR_CC_SHIFT_ARGC "\x14%c"
/**
* @brief Disable Text Skip I
*
* Triangle box. Does not play sound.
*
*/
#define EZTR_CC_CONTINUE "\x15"
/**
* @brief Print: Player Name
*/
#define EZTR_CC_NAME "\x16"
/**
* @brief Enable: Instantaneous Text
*/
#define EZTR_CC_QUICKTEXT_ENABLE "\x17"
/**
* @brief Disable: Instantaneous Text
*/
#define EZTR_CC_QUICKTEXT_DISABLE "\x18"
/**
* @brief Disable Text Skip II
*
* Triangle box. Plays "Text Finished" sound.
*
*/
#define EZTR_CC_EVENT "\x19"
/**
* @brief Disable Text Box Close
*
* Used for shop item descriptions.
*
*/
#define EZTR_CC_PERSISTENT "\x1a"
/**
* @brief Delay for xxxx Before Printing Remaining Text
*
* The next two bytes determine the length of the delay.
*
*/
#define EZTR_CC_BOX_BREAK_DELAYED "\x1b"
/**
* @brief Delay for xxxx Before Printing Remaining Text
*
* The next two bytes determine the length of the delay.
* This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling.
*
* See \ref prinf_functions for more information on EZTR's custom printf behavior.
*/
#define EZTR_CC_BOX_BREAK_DELAYED_ARGW "\x1b%w"
/**
* @brief Keep Text on Screen for xxxx Before Closing
*
* The next two bytes determine the length of the delay.
*
* Player can move around while text is displayed.
*
*/
#define EZTR_CC_FADE "\x1c"
/**
* @brief Keep Text on Screen for xxxx Before Closing
*
* The next two bytes determine the length of the delay.
* This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling.
*
* See \ref prinf_functions for more information on EZTR's custom printf behavior.
*
* Player can move around while text is displayed.
*
*/
#define EZTR_CC_FADE_ARGW "\x1c%w"
/**
* @brief Delay for xxxx Before Ending Conversation
*
* The next two bytes determine the length of the delay.
*
*/
#define EZTR_CC_FADE_SKIPPABLE "\x1d"
/**
* @brief Delay for xxxx Before Ending Conversation
*
* The next two bytes determine the length of the delay.
* This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling.
*
* See \ref prinf_functions for more information on EZTR's custom printf behavior.
*/
#define EZTR_CC_FADE_SKIPPABLE_ARGW "\x1d%w"
/**
* @brief Play Sound Effect xxxx
*
* The next two bytes will be the ID of the sound effect. The ID values are the same as the ones used with `Audio_PlaySfx`.
*
*/
#define EZTR_CC_SFX "\x1e"
/**
* @brief Play Sound Effect xxxx
*
* The next two bytes will be the ID of the sound effect. The ID values are the same as the ones used with `Audio_PlaySfx`.
* This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling.
*
* See \ref prinf_functions for more information on EZTR's custom printf behavior.
*/
#define EZTR_CC_SFX_ARGW "\x1e%w"
/**
* @brief Delay for xxxx Before Resuming Text Flow
*
* The next two bytes determine the length of the delay.
*
*/
#define EZTR_CC_DELAY "\x1f"
/**
* @brief Delay for xxxx Before Resuming Text Flow
*
* The next two bytes determine the length of the delay.
* This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling.
*
* See \ref prinf_functions for more information on EZTR's custom printf behavior.
*/
#define EZTR_CC_DELAY_ARGW "\x1f%w"
/**
* @brief Displays the A Button icon
*/
#define EZTR_CC_BTN_A "\xb0"
/**
* @brief Displays the B button icon
*/
#define EZTR_CC_BTN_B "\xb1"
/**
* @brief Displays the C buttons icon
*/