Browse Source

move trainers to more reasonable c file

SBird1337 6 years ago
parent
commit
bba37a6ca4
5 changed files with 17 additions and 8 deletions
  1. 1
    0
      .gitignore
  2. 2
    2
      data/trainer/trainer_pkmn_data.s
  3. 1
    1
      g3headers
  4. 12
    4
      makefile
  5. 1
    1
      sots-private

+ 1
- 0
.gitignore View File

4
 *.ogg
4
 *.ogg
5
 *.a
5
 *.a
6
 *.i
6
 *.i
7
+*.ci
7
 nbproject/private/tools/
8
 nbproject/private/tools/
8
 .vscode/*
9
 .vscode/*
9
 todo/
10
 todo/

+ 2
- 2
data/trainer/trainer_pkmn_data.s View File

1
-#include <constants/trainer.h>
1
+/*#include <constants/trainer.h>
2
 
2
 
3
 .align 2
3
 .align 2
4
 .text
4
 .text
172
 .hword 50 
172
 .hword 50 
173
 .hword 6 
173
 .hword 6 
174
 .hword PKMN_BISASAM 
174
 .hword PKMN_BISASAM 
175
-.hword ITEM_SINELBEERE
175
+.hword ITEM_SINELBEERE*/

+ 1
- 1
g3headers

1
-Subproject commit 3e36531d290bd97e7b1208526e54c8acdfe376d3
1
+Subproject commit 083c36df58968b714fdec0b76c6d7df0208d708f

+ 12
- 4
makefile View File

42
 MAPTS	  := $(MAPROOT)/tileset
42
 MAPTS	  := $(MAPROOT)/tileset
43
 MAP_PROJ	:= $(MAPROOT)/sots.json
43
 MAP_PROJ	:= $(MAPROOT)/sots.json
44
 SCRIPTROOT := $(MAPROOT)/script
44
 SCRIPTROOT := $(MAPROOT)/script
45
+PDATAROOT := sots-private/data
45
 
46
 
46
 MAIN_OBJ  := $(BLDPATH)/linked.o
47
 MAIN_OBJ  := $(BLDPATH)/linked.o
47
 B_ENGINE  := battle_engine/build/linked.o
48
 B_ENGINE  := battle_engine/build/linked.o
73
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
74
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
74
 STRING_SRC	:= $(STRING:%.txt=%.s)
75
 STRING_SRC	:= $(STRING:%.txt=%.s)
75
 SCRIPT_SRC	:= $(call rwildcard,$(SCRIPTROOT)/,*.s)
76
 SCRIPT_SRC	:= $(call rwildcard,$(SCRIPTROOT)/,*.s)
77
+PDATA_SRC   := $(call rwildcard,$(PDATAROOT)/,*.c)
76
 
78
 
77
 MAP_PROJ_S	:= $(MAP_PROJ:%.json=%.s)
79
 MAP_PROJ_S	:= $(MAP_PROJ:%.json=%.s)
78
 MAP_PROJ_O	:= $(MAP_PROJ:%.json=$(BLDPATH)/%.o)
80
 MAP_PROJ_O	:= $(MAP_PROJ:%.json=$(BLDPATH)/%.o)
91
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
93
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
92
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
94
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
93
 SCRIPT_OBJ	:= $(SCRIPT_SRC:%.s=$(BLDPATH)/%.o)
95
 SCRIPT_OBJ	:= $(SCRIPT_SRC:%.s=$(BLDPATH)/%.o)
94
-ALL_OBJ     := $(GEN_OBJ) $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(STRING_OBJ) $(SCRIPT_OBJ) $(MAP_PROJ_O) $(MAP_FILES_O) $(TS_FILES_O) $(TS_GEN_O)
96
+PDATA_OBJ   := $(PDATA_SRC:%.c=$(BLDPATH)/%.o)
97
+ALL_OBJ     := $(GEN_OBJ) $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(STRING_OBJ) $(SCRIPT_OBJ) $(MAP_PROJ_O) $(MAP_FILES_O) $(TS_FILES_O) $(TS_GEN_O) $(PDATA_OBJ)
95
 
98
 
96
 $(MAPMAPS)/%.s: $(MAPMAPS)/%.pmh
99
 $(MAPMAPS)/%.s: $(MAPMAPS)/%.pmh
97
 	@printf "\e[1;33mGenerating map\e[0m $<\n"
100
 	@printf "\e[1;33mGenerating map\e[0m $<\n"
101
 	@printf "\e[1;33mGenerating tileset\e[0m $<\n"
104
 	@printf "\e[1;33mGenerating tileset\e[0m $<\n"
102
 	$(PYSETS) -o $@ $<
105
 	$(PYSETS) -o $@ $<
103
 
106
 
104
-$(STRINGDIR)/%.s: $(STRINGDIR)/%.txt
105
-	@printf "\e[1;36mGenerating strings\e[0m $<\n"
106
-	$(STRAGB) -o $@ -i $< -t string/table.tbl -e 0xFF
107
+$(BLDPATH)/sots-private/data/%.o: $(PDATAROOT)/%.c
108
+	@printf "\e[1;31mCompiling\e[0m $<\n"
109
+	$(shell mkdir -p $(dir $@))
110
+	$(CC) $(CFLAGS) -E -x c $< -o $(PDATAROOT)/$*.i
111
+	$(PREPROC) $(PDATAROOT)/$*.i $(CHARMAP) > $(PDATAROOT)/$*.ci
112
+	$(CC) $(CFLAGS) -c -x c $(PDATAROOT)/$*.ci -o $@
113
+	@rm -f $(PDATAROOT)/$*.ci  $(PDATAROOT)/$*.i
114
+	
107
 
115
 
108
 $(BLDPATH)/%.o: %.c $(ASSETS) $(PAGB_INCLUDE)/pokeagb/pokeagb.h
116
 $(BLDPATH)/%.o: %.c $(ASSETS) $(PAGB_INCLUDE)/pokeagb/pokeagb.h
109
 	@printf "\e[1;31mCompiling\e[0m $<\n"
117
 	@printf "\e[1;31mCompiling\e[0m $<\n"

+ 1
- 1
sots-private

1
-Subproject commit 5b270e614e3c0d2eda30f62bfe4818c579b3d55d
1
+Subproject commit d3593ad524f9044fe89eb686faa65eed2e24a379