浏览代码

added support for multi_lingual strings

Philipp Auer 8 年前
父节点
当前提交
b94357c04c
共有 6 个文件被更改,包括 100 次插入6 次删除
  1. 15
    4
      makefile
  2. 2
    0
      string/.gitignore
  3. 1
    0
      string/de/more_string.txt
  4. 1
    0
      string/de/some_string.txt
  5. 81
    0
      string/table.tbl
  6. 0
    2
      string/test.txt

+ 15
- 4
makefile 查看文件

@@ -6,6 +6,8 @@ CC      := arm-none-eabi-gcc
6 6
 ARS     := armips
7 7
 MAKE    := make
8 8
 NM      := arm-none-eabi-nm
9
+LAN		:= de
10
+STRAGB	:= string2agb
9 11
 
10 12
 export PATH := $(realpath ../tools):$(PATH)
11 13
 
@@ -17,6 +19,7 @@ LDFLAGS   := -z muldefs
17 19
 BLDPATH   := object
18 20
 OUTPATH	  := build
19 21
 SOURCEDIR := src
22
+STRINGDIR := string
20 23
 
21 24
 MAIN_OBJ  := $(BLDPATH)/linked.o
22 25
 SPRITES   := $(BLDPATH)/pkmn_sprites.o
@@ -37,7 +40,10 @@ ASM_SRC     := $(call rwildcard,src/,*.s)
37 40
 C_SRC       := $(call rwildcard,src/,*.c)
38 41
 DATA_SRC_PP := $(call rwildcard,data/,*.S)
39 42
 DATA_SRC    := $(call rwildcard,data/,*.s)
43
+STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
44
+STRING_SRC	:= $(STRING:%.txt=%.S)
40 45
 
46
+STRING_OBJ	:= $(STRING_SRC:%.S=$(BLDPATH)/%.o)
41 47
 ASM_OBJ_PP  := $(ASM_SRC_PP:%.S=$(BLDPATH)/%.o)
42 48
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
43 49
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
@@ -46,6 +52,11 @@ DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
46 52
 ALL_OBJ     := $(C_OBJ) $(ASM_OBJ_PP) $(ASM_OBJ) $(DATA_OBJ_PP) $(DATA_OBJ)
47 53
 
48 54
 
55
+
56
+$(STRINGDIR)/%.S: $(STRINGDIR)/%.txt
57
+	@echo hello
58
+	$(STRAGB) -o $@ -i $< -t string/table.tbl -e 0xFF
59
+
49 60
 $(BLDPATH)/%.o: %.c $(ASSETS)
50 61
 	$(shell mkdir -p $(dir $@))
51 62
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -63,11 +74,11 @@ all: rom
63 74
 .PHONY: rom
64 75
 rom: main.asm $(MAIN_OBJ)
65 76
 	$(ARS) $<
66
-	$(NM) $(BLDPATH)/linked.o -n -g --defined-only | \
67
-		sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
77
+	#$(NM) $(BLDPATH)/linked.o -n -g --defined-only | \
78
+	#	sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
68 79
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
69
-
70
-$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(DYN_OVER) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR)
80
+	
81
+$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(DYN_OVER) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $(STRING_OBJ)
71 82
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
72 83
 
73 84
 .PHONY: clean

+ 2
- 0
string/.gitignore 查看文件

@@ -0,0 +1,2 @@
1
+*.s
2
+*.S

+ 1
- 0
string/de/more_string.txt 查看文件

@@ -0,0 +1 @@
1
+label=Text

+ 1
- 0
string/de/some_string.txt 查看文件

@@ -0,0 +1 @@
1
+first_string=Hello darkness my old friend!

+ 81
- 0
string/table.tbl 查看文件

@@ -0,0 +1,81 @@
1
+ =0x00
2
+0=0xA1
3
+1=0xA2
4
+2=0xA3
5
+3=0xA4
6
+4=0xA5
7
+5=0xA6
8
+6=0xA7
9
+7=0xA8
10
+8=0xA9
11
+9=0xAA
12
+!=0xAB
13
+?=0xAC
14
+.=0xAD
15
+-=0xAE
16
+\.=0xAF
17
+é=0xB1
18
+,=0xB8
19
+\k=0xB9
20
+/=0xBA
21
+A=0xBB
22
+B=0xBC
23
+C=0xBD
24
+D=0xBE
25
+E=0xBF
26
+F=0xC0
27
+G=0xC1
28
+H=0xC2
29
+I=0xC3
30
+J=0xC4
31
+K=0xC5
32
+L=0xC6
33
+M=0xC7
34
+N=0xC8
35
+O=0xC9
36
+P=0xCA
37
+Q=0xCB
38
+R=0xCC
39
+S=0xCD
40
+T=0xCE
41
+U=0xCF
42
+V=0xD0
43
+W=0xD1
44
+X=0xD2
45
+Y=0xD3
46
+Z=0xD4
47
+a=0xD5
48
+b=0xD6
49
+c=0xD7
50
+d=0xD8
51
+e=0xD9
52
+f=0xDA
53
+g=0xDB
54
+h=0xDC
55
+i=0xDD
56
+j=0xDE
57
+k=0xDF
58
+l=0xE0
59
+m=0xE1
60
+n=0xE2
61
+o=0xE3
62
+p=0xE4
63
+q=0xE5
64
+r=0xE6
65
+s=0xE7
66
+t=0xE8
67
+u=0xE9
68
+v=0xEA
69
+w=0xEB
70
+x=0xEC
71
+y=0xED
72
+z=0xEE
73
+Ä=0xF1
74
+Ö=0xF2
75
+Ü=0xF3
76
+ä=0xF4
77
+ö=0xF5
78
+ü=0xF6
79
+\p=0xFD
80
+\n=0xFE
81
+\x=0xFF

+ 0
- 2
string/test.txt 查看文件

@@ -1,2 +0,0 @@
1
-test_symbol=Test123
2
-test_symbol2=Test1234