Browse Source

added support for multi_lingual strings

Philipp Auer 8 years ago
parent
commit
b94357c04c
6 changed files with 100 additions and 6 deletions
  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 View File

6
 ARS     := armips
6
 ARS     := armips
7
 MAKE    := make
7
 MAKE    := make
8
 NM      := arm-none-eabi-nm
8
 NM      := arm-none-eabi-nm
9
+LAN		:= de
10
+STRAGB	:= string2agb
9
 
11
 
10
 export PATH := $(realpath ../tools):$(PATH)
12
 export PATH := $(realpath ../tools):$(PATH)
11
 
13
 
17
 BLDPATH   := object
19
 BLDPATH   := object
18
 OUTPATH	  := build
20
 OUTPATH	  := build
19
 SOURCEDIR := src
21
 SOURCEDIR := src
22
+STRINGDIR := string
20
 
23
 
21
 MAIN_OBJ  := $(BLDPATH)/linked.o
24
 MAIN_OBJ  := $(BLDPATH)/linked.o
22
 SPRITES   := $(BLDPATH)/pkmn_sprites.o
25
 SPRITES   := $(BLDPATH)/pkmn_sprites.o
37
 C_SRC       := $(call rwildcard,src/,*.c)
40
 C_SRC       := $(call rwildcard,src/,*.c)
38
 DATA_SRC_PP := $(call rwildcard,data/,*.S)
41
 DATA_SRC_PP := $(call rwildcard,data/,*.S)
39
 DATA_SRC    := $(call rwildcard,data/,*.s)
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
 ASM_OBJ_PP  := $(ASM_SRC_PP:%.S=$(BLDPATH)/%.o)
47
 ASM_OBJ_PP  := $(ASM_SRC_PP:%.S=$(BLDPATH)/%.o)
42
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
48
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
43
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
49
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
46
 ALL_OBJ     := $(C_OBJ) $(ASM_OBJ_PP) $(ASM_OBJ) $(DATA_OBJ_PP) $(DATA_OBJ)
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
 $(BLDPATH)/%.o: %.c $(ASSETS)
60
 $(BLDPATH)/%.o: %.c $(ASSETS)
50
 	$(shell mkdir -p $(dir $@))
61
 	$(shell mkdir -p $(dir $@))
51
 	$(CC) $(CFLAGS) -c $< -o $@
62
 	$(CC) $(CFLAGS) -c $< -o $@
63
 .PHONY: rom
74
 .PHONY: rom
64
 rom: main.asm $(MAIN_OBJ)
75
 rom: main.asm $(MAIN_OBJ)
65
 	$(ARS) $<
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
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
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
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
82
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
72
 
83
 
73
 .PHONY: clean
84
 .PHONY: clean

+ 2
- 0
string/.gitignore View File

1
+*.s
2
+*.S

+ 1
- 0
string/de/more_string.txt View File

1
+label=Text

+ 1
- 0
string/de/some_string.txt View File

1
+first_string=Hello darkness my old friend!

+ 81
- 0
string/table.tbl View File

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 View File

1
-test_symbol=Test123
2
-test_symbol2=Test1234