Skip to content

Commit 3d4b5f9

Browse files
committed
Supporting English language in Japanese DLC loader
1 parent d8908ca commit 3d4b5f9

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

examples/LinkCard_demo/#loader/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ PATH_LIB_GCC = $(DEVKITPRO)/devkitARM/lib/gcc/arm-none-eabi/$(GCC_VER)/thumb
1515
ifeq ($(JAP),1)
1616
NAME = ローダー
1717
REGION = 2
18-
CFLAGS_EXTRA = -DLANGUAGE_JAP
18+
CFLAGS_EXTRA = -DREGION_JAP
19+
ifeq ($(ENG),1)
20+
CFLAGS_EXTRA += -DLANGUAGE_ENG
21+
endif
1922
else
2023
NAME = DLC Loader
2124
REGION = 1

examples/LinkCard_demo/#loader/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ This loader scans cards with the **e-Reader** (or in Japan, the **e-Reader+**) a
1515
``` bash
1616
# verify tool paths in the `Makefile`!
1717
make clean
18-
make # USA
19-
make JAP=1 # JAP
18+
make # USA region, English language
19+
make JAP=1 # JAP region, Japanese language
20+
make JAP=1 ENG=1 # JAP region, English language
2021
# ^ check that NAME = ローダー and `Makefile` is encoded in Shift JIS
2122
```
2223

examples/LinkCard_demo/#loader/localize.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ const data = {
66
"MSG_TRANSFERRING": "転送中",
77
"MSG_CARD_SENT": "カード送信済み",
88
"MSG_ERROR": "エラー",
9-
"MSG_PRESS_A_TRY_AGAIN": "エーを押して再試行",
109
"MSG_PRESS_B_CANCEL": "ビーを押してキャンセル"
1110
};
1211

12+
/*
13+
const data = {
14+
"MSG_WAITING_GAME": "WAITING FOR GAME",
15+
"MSG_SCAN_CARD": "PLEASE SCAN YOUR CARD",
16+
"MSG_TRANSFERRING": "TRANSFERRING",
17+
"MSG_CARD_SENT": "CARD SENT",
18+
"MSG_ERROR": "ERROR",
19+
"MSG_PRESS_B_CANCEL": "PRESS B TO CANCEL"
20+
};
21+
*/
22+
1323
for (const key in data) {
1424
const str = data[key];
1525
const buf = iconv.encode(str, 'Shift_JIS');

examples/LinkCard_demo/#loader/src/main.c

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,47 @@
33
#include "link.h"
44
#include "protocol.h"
55

6+
#ifdef REGION_JAP
67
// Japanese strings are encoded as Shift-JIS byte arrays.
7-
8-
#ifdef LANGUAGE_JAP
9-
/* "ゲームを待っています" */
8+
#ifdef LANGUAGE_ENG
9+
const u8 MSG_WAITING_GAME[] = {
10+
0x82, 0x76, 0x82, 0x60, 0x82, 0x68, 0x82, 0x73, 0x82, 0x68, 0x82,
11+
0x6d, 0x82, 0x66, 0x81, 0x40, 0x82, 0x65, 0x82, 0x6e, 0x82, 0x71,
12+
0x81, 0x40, 0x82, 0x66, 0x82, 0x60, 0x82, 0x6c, 0x82, 0x64, 0x00};
13+
const u8 MSG_SCAN_CARD[] = {
14+
0x82, 0x6f, 0x82, 0x6b, 0x82, 0x64, 0x82, 0x60, 0x82, 0x72, 0x82,
15+
0x64, 0x81, 0x40, 0x82, 0x72, 0x82, 0x62, 0x82, 0x60, 0x82, 0x6d,
16+
0x81, 0x40, 0x82, 0x78, 0x82, 0x6e, 0x82, 0x74, 0x82, 0x71, 0x81,
17+
0x40, 0x82, 0x62, 0x82, 0x60, 0x82, 0x71, 0x82, 0x63, 0x00};
18+
const u8 MSG_TRANSFERRING[] = {0x82, 0x73, 0x82, 0x71, 0x82, 0x60, 0x82,
19+
0x6d, 0x82, 0x72, 0x82, 0x65, 0x82, 0x64,
20+
0x82, 0x71, 0x82, 0x71, 0x82, 0x68, 0x82,
21+
0x6d, 0x82, 0x66, 0x00};
22+
const u8 MSG_CARD_SENT[] = {0x82, 0x62, 0x82, 0x60, 0x82, 0x71, 0x82,
23+
0x63, 0x81, 0x40, 0x82, 0x72, 0x82, 0x64,
24+
0x82, 0x6d, 0x82, 0x73, 0x00};
25+
const u8 MSG_ERROR[] = {0x82, 0x64, 0x82, 0x71, 0x82, 0x71,
26+
0x82, 0x6e, 0x82, 0x71, 0x00};
27+
const u8 MSG_PRESS_B_CANCEL[] = {
28+
0x82, 0x6f, 0x82, 0x71, 0x82, 0x64, 0x82, 0x72, 0x82, 0x72, 0x81, 0x40,
29+
0x82, 0x61, 0x81, 0x40, 0x82, 0x73, 0x82, 0x6e, 0x81, 0x40, 0x82, 0x62,
30+
0x82, 0x60, 0x82, 0x6d, 0x82, 0x62, 0x82, 0x64, 0x82, 0x6b, 0x00};
31+
#else
1032
const u8 MSG_WAITING_GAME[] = {0x83, 0x51, 0x81, 0x5b, 0x83, 0x80, 0x82,
1133
0xf0, 0x91, 0xd2, 0x82, 0xc1, 0x82, 0xc4,
1234
0x82, 0xa2, 0x82, 0xdc, 0x82, 0xb7, 0x00};
13-
14-
/* "カードをスキャンしてください" */
1535
const u8 MSG_SCAN_CARD[] = {0x83, 0x4a, 0x81, 0x5b, 0x83, 0x68, 0x82, 0xf0,
1636
0x83, 0x58, 0x83, 0x4c, 0x83, 0x83, 0x83, 0x93,
1737
0x82, 0xb5, 0x82, 0xc4, 0x82, 0xad, 0x82, 0xbe,
1838
0x82, 0xb3, 0x82, 0xa2, 0x00};
19-
20-
/* "転送中" */
2139
const u8 MSG_TRANSFERRING[] = {0x93, 0x5d, 0x91, 0x97, 0x92, 0x86, 0x00};
22-
23-
/* "カード送信済み" */
2440
const u8 MSG_CARD_SENT[] = {0x83, 0x4a, 0x81, 0x5b, 0x83, 0x68, 0x91, 0x97,
2541
0x90, 0x4d, 0x8d, 0xcf, 0x82, 0xdd, 0x00};
26-
27-
/* "エラー" */
2842
const u8 MSG_ERROR[] = {0x83, 0x47, 0x83, 0x89, 0x81, 0x5b, 0x00};
29-
30-
/* "ビーを押してキャンセル" */
3143
const u8 MSG_PRESS_B_CANCEL[] = {0x83, 0x72, 0x81, 0x5b, 0x82, 0xf0, 0x89, 0x9f,
3244
0x82, 0xb5, 0x82, 0xc4, 0x83, 0x4c, 0x83, 0x83,
3345
0x83, 0x93, 0x83, 0x5a, 0x83, 0x8b, 0x00};
46+
#endif
3447
#else
3548
const char* MSG_WAITING_GAME = "Waiting for game...";
3649
const char* MSG_SCAN_CARD = "Scan a card!";

0 commit comments

Comments
 (0)