Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
utils.c
Go to the documentation of this file.
1
#include "
dx/utils.h
"
2
3
u8
dx_ascii_char_to_msg
(u8 in) {
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
}
15
16
u8*
dx_string_to_msg
(u8* msg,
const
u8* str) {
17
while
(*str) {
18
*msg++ =
dx_ascii_char_to_msg
(*str++);
19
}
20
21
*msg =
MSG_CHAR_READ_END
;
22
return
msg;
23
}
MSG_CHAR_READ_SPACE
@ MSG_CHAR_READ_SPACE
Definition
enums.h:6050
MSG_CHAR_NOTE
@ MSG_CHAR_NOTE
Definition
enums.h:5856
MSG_CHAR_READ_ENDL
@ MSG_CHAR_READ_ENDL
Definition
enums.h:6043
MSG_CHAR_READ_END
@ MSG_CHAR_READ_END
Definition
enums.h:6056
dx_ascii_char_to_msg
u8 dx_ascii_char_to_msg(u8 in)
Definition
utils.c:3
dx_string_to_msg
u8 * dx_string_to_msg(u8 *msg, const u8 *str)
Definition
utils.c:16
utils.h
src
dx
utils.c
Generated by
1.10.0