Browse Source

tileset animations begin

SBird1337 6 years ago
parent
commit
3d9e712488
5 changed files with 16 additions and 9 deletions
  1. 1
    1
      battle_engine
  2. 1
    1
      g3headers
  3. 4
    3
      makefile
  4. 1
    1
      sots-private
  5. 9
    3
      src/overworld/tileset_animation/main_animator.c

+ 1
- 1
battle_engine

1
-Subproject commit 991e2793854c10885382ad325c55ad42a0585f61
1
+Subproject commit 6d4c025273b357e9f820516bc27f385ca13c3d5b

+ 1
- 1
g3headers

1
-Subproject commit 1c9d6f8cdaaf7482b2f03b8e90d911303c251375
1
+Subproject commit 8d64b390cbaf2e1fc9a09fbf0edb339847954332

+ 4
- 3
makefile View File

18
 PYSETS	:= $(PYTHON_BIN) ../tools/v_tools/pyset2s.py
18
 PYSETS	:= $(PYTHON_BIN) ../tools/v_tools/pyset2s.py
19
 
19
 
20
 export PATH := $(realpath ../tools):$(PATH)
20
 export PATH := $(realpath ../tools):$(PATH)
21
+export GCC_COLORS := error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:quote=01:fixit-insert=32:fixit-delete=31:diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32
21
 
22
 
22
 PAGB_MAIN := g3headers
23
 PAGB_MAIN := g3headers
23
 PAGB_INCLUDE := $(PAGB_MAIN)/build/include
24
 PAGB_INCLUDE := $(PAGB_MAIN)/build/include
29
 
30
 
30
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0 -DLAN_DE
31
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0 -DLAN_DE
31
 ASFLAGS   := -mthumb
32
 ASFLAGS   := -mthumb
32
-CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fdiagnostics-show-option -mlong-calls -march=armv4t -Og -std=c11 -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color $(DEFINES)
33
+CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fdiagnostics-show-option -mlong-calls -march=armv4t -Og -std=c11 -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color=always $(DEFINES)
33
 GRITFLAGS := -ftc -fa
34
 GRITFLAGS := -ftc -fa
34
 LDFLAGS   := -z muldefs
35
 LDFLAGS   := -z muldefs
35
 BLDPATH   := object
36
 BLDPATH   := object
142
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
143
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
143
 	@echo "*** REMOVING INTERMEDIATE FILES ***"
144
 	@echo "*** REMOVING INTERMEDIATE FILES ***"
144
 	
145
 	
145
-$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $()#$(B_ENGINE)
146
+$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) #$(B_ENGINE)
146
 	$(MAKE) -f assets.makefile
147
 	$(MAKE) -f assets.makefile
147
 	@echo -e "\e[1;32mLinking ELF binary $@\e[0m"
148
 	@echo -e "\e[1;32mLinking ELF binary $@\e[0m"
148
 	@echo "INPUT($^)" > $(TMP_LD)
149
 	@echo "INPUT($^)" > $(TMP_LD)
155
 
156
 
156
 .PHONY: $(B_ENGINE)
157
 .PHONY: $(B_ENGINE)
157
 $(B_ENGINE):
158
 $(B_ENGINE):
158
-	$(MAKE) -C battle_engine build/linked.o
159
+	$(MAKE) -C battle_engine build/linked.o PAGB_INCLUDE=../$(PAGB_MAIN)/build
159
 
160
 
160
 .PHONY: cleansrcdatascript
161
 .PHONY: cleansrcdatascript
161
 cleansrcdatascript:
162
 cleansrcdatascript:

+ 1
- 1
sots-private

1
-Subproject commit dfea70a8db81df4268df3a91cdf0d8619c2b2afb
1
+Subproject commit b6e8c0cbbc187ba843d7d08e56bb59baf4209ff4

+ 9
- 3
src/overworld/tileset_animation/main_animator.c View File

1
 #include <pokeagb/pokeagb.h>
1
 #include <pokeagb/pokeagb.h>
2
 #include <tileset_animation/smoke.h>
2
 #include <tileset_animation/smoke.h>
3
-
3
+#include <tileset_animation/water_stone.h>
4
+#include <tileset_animation/flowers_mag.h>
5
+#include <tileset_animation/flowers_ora.h>
4
 struct TilesetAnimation {
6
 struct TilesetAnimation {
5
     u16 tile_start;
7
     u16 tile_start;
6
     u16 frame_length;
8
     u16 frame_length;
10
 };
12
 };
11
 
13
 
12
 const struct TilesetAnimation hesperia_second_animations[] = {
14
 const struct TilesetAnimation hesperia_second_animations[] = {
13
-    {.tile_start = 0x114, .frame_length = 7, .tile_length = 4, .frame_count = 5, .image = smokeTiles},
15
+    {.tile_start = 0x10C, .frame_length = 14, .tile_length = 4, .frame_count = 10, .image = flowers_magTiles},
16
+    {.tile_start = 0x110, .frame_length = 14, .tile_length = 4, .frame_count = 15, .image = flowers_oraTiles},
17
+    {.tile_start = 0x114, .frame_length = 7, .tile_length = 4, .frame_count = 8, .image = smokeTiles},
18
+    {.tile_start = 0x13C, .frame_length = 7, .tile_length = 4, .frame_count = 4, .image = water_stoneTiles},
14
     {.tile_start = 0, .frame_length = 0, .tile_length = 0, .frame_count = 0, .image = (void *)0xFFFFFFFF},
19
     {.tile_start = 0, .frame_length = 0, .tile_length = 0, .frame_count = 0, .image = (void *)0xFFFFFFFF},
15
 };
20
 };
16
 
21
 
22
         u16 max_frame = anim[current_animation].frame_length * anim[current_animation].frame_count;
27
         u16 max_frame = anim[current_animation].frame_length * anim[current_animation].frame_count;
23
         u16 used_frame = current_frame % max_frame;
28
         u16 used_frame = current_frame % max_frame;
24
         used_frame /= anim[current_animation].frame_length;
29
         used_frame /= anim[current_animation].frame_length;
30
+        dprintf("using tile %d.\n",used_frame);
25
         memcpy(current_vram, anim[current_animation].image + (0x20 * anim[current_animation].tile_length * used_frame),
31
         memcpy(current_vram, anim[current_animation].image + (0x20 * anim[current_animation].tile_length * used_frame),
26
                anim[current_animation].tile_length * 0x20);
32
                anim[current_animation].tile_length * 0x20);
27
         current_animation++;
33
         current_animation++;
45
 
51
 
46
 void main_second_animator_init(void) {
52
 void main_second_animator_init(void) {
47
     blockset_two_current_frame = 0;
53
     blockset_two_current_frame = 0;
48
-    blockset_two_max_frame = 0x100;
54
+    blockset_two_max_frame = 0x3C0;
49
     blockset_two_animator = main_second_animator;
55
     blockset_two_animator = main_second_animator;
50
 }
56
 }