Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
utils.c File Reference

Go to the source code of this file.

Functions

u8 dx_ascii_char_to_msg (u8 in)
 
u8 * dx_string_to_msg (u8 *msg, const u8 *str)
 

Function Documentation

◆ dx_ascii_char_to_msg()

u8 dx_ascii_char_to_msg ( u8 in)

Definition at line 3 of file utils.c.

3 {
4 switch (in) {
5 case '\0': return MSG_CHAR_READ_END;
6 case ' ': case '\t': return MSG_CHAR_READ_SPACE;
7 case '\n': return MSG_CHAR_READ_ENDL;
8 default:
9 if (in < 0x20) {
10 return MSG_CHAR_NOTE;
11 }
12 return in - 0x20;
13 }
14}
@ MSG_CHAR_READ_SPACE
Definition enums.h:6050
@ MSG_CHAR_NOTE
Definition enums.h:5856
@ MSG_CHAR_READ_ENDL
Definition enums.h:6043
@ MSG_CHAR_READ_END
Definition enums.h:6056

Referenced by dx_string_to_msg().

◆ dx_string_to_msg()

u8 * dx_string_to_msg ( u8 * msg,
const u8 * str )

Definition at line 16 of file utils.c.

16 {
17 while (*str) {
18 *msg++ = dx_ascii_char_to_msg(*str++);
19 }
20
21 *msg = MSG_CHAR_READ_END;
22 return msg;
23}
u8 dx_ascii_char_to_msg(u8 in)
Definition utils.c:3

Referenced by filemenu_draw_contents_file_info(), and filemenu_draw_contents_title().