Refectoring: Add is_[12]byte_message() helper functions

This commit is contained in:
kichikuou
2020-12-20 14:44:08 +09:00
parent 33a0595016
commit 067e1e23bd
8 changed files with 23 additions and 19 deletions
+2 -4
View File
@@ -278,8 +278,7 @@ void NACT::execute()
cmd_z();
break;
default:
if(cmd == 0x20 || (0xa1 <= cmd && cmd <= 0xdd)) {
// message (1 byte)
if(is_1byte_message(cmd)) {
char string[3];
string[0] = cmd;
string[1] = '\0';
@@ -313,8 +312,7 @@ void NACT::execute()
string[2] = '\0';
}
output_console(string);
} else if((0x81 <= cmd && cmd <= 0x9f) || 0xe0 <= cmd) {
// message (2 bytes)
} else if(is_2byte_message(cmd)) {
char string[3];
string[0] = cmd;
string[1] = getd();