Browse Source

add battle_engine, not working atm

Philipp Auer 7 years ago
parent
commit
478ccdd0ba
5 changed files with 22 additions and 6 deletions
  1. 3
    0
      .gitmodules
  2. 1
    0
      battle_engine
  3. 10
    3
      main.asm
  4. 6
    1
      makefile
  5. 2
    2
      src/battle_engine/battle_m_flee_hook.S

+ 3
- 0
.gitmodules View File

1
 [submodule "sots-private"]
1
 [submodule "sots-private"]
2
 	path = sots-private
2
 	path = sots-private
3
 	url = ssh://sotshost:/home/sots/sots-private.git
3
 	url = ssh://sotshost:/home/sots/sots-private.git
4
+[submodule "battle_engine"]
5
+	path = battle_engine
6
+	url = https://github.com/EternalCode/battle_engine

+ 1
- 0
battle_engine

1
+Subproject commit a5e46479febfe3d780ac3111ebbb9401940983b5

+ 10
- 3
main.asm View File

5
 //exclude for now
5
 //exclude for now
6
 //.include "patches/split_physical_special.asm"
6
 //.include "patches/split_physical_special.asm"
7
 .include "patches/hooks.asm"
7
 .include "patches/hooks.asm"
8
-.include "patches/dynamic_overworld_hooks.asm"
8
+
9
+
10
+//no dynamic overworlds, sorry :T
11
+//.include "patches/dynamic_overworld_hooks.asm"
12
+
13
+
9
 .include "patches/special.asm"
14
 .include "patches/special.asm"
10
 .include "patches/moves.asm"
15
 .include "patches/moves.asm"
11
 .include "patches/music.asm"
16
 .include "patches/music.asm"
54
 
59
 
55
 .include "patches/game_engine/quick_hacks.asm"
60
 .include "patches/game_engine/quick_hacks.asm"
56
 
61
 
62
+.include "battle_engine/patches/menutest.s"
63
+
57
 .org 0x0815F9B8
64
 .org 0x0815F9B8
58
     .word 0x08069ED5 // fix nop1 for now...
65
     .word 0x08069ED5 // fix nop1 for now...
59
 
66
 
60
 .org 0x083522F4
67
 .org 0x083522F4
61
-    .word mapheader_alabastia
68
+    //.word mapheader_alabastia
62
 
69
 
63
 .org 0x0834ECC0
70
 .org 0x0834ECC0
64
-    .word mapfooter_alabastia
71
+    //.word mapfooter_alabastia
65
 
72
 
66
 .org 0x09000000
73
 .org 0x09000000
67
 .importobj "object/linked.o"
74
 .importobj "object/linked.o"

+ 6
- 1
makefile View File

23
 STRINGDIR := string
23
 STRINGDIR := string
24
 
24
 
25
 MAIN_OBJ  := $(BLDPATH)/linked.o
25
 MAIN_OBJ  := $(BLDPATH)/linked.o
26
+B_ENGINE  := battle_engine/build/linked.o
26
 SPRITES   := $(BLDPATH)/pkmn_sprites.o
27
 SPRITES   := $(BLDPATH)/pkmn_sprites.o
27
 ICONS_AR  := $(BLDPATH)/pkmn_icons.a
28
 ICONS_AR  := $(BLDPATH)/pkmn_icons.a
28
 DYN_OVER  := built/dynamic_overworld.o
29
 DYN_OVER  := built/dynamic_overworld.o
78
 		sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
79
 		sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
79
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
80
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
80
 	
81
 	
81
-$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $(STRING_OBJ) $(DYN_OVER)
82
+$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $(STRING_OBJ) $(B_ENGINE)#$(DYN_OVER) 
82
 	$(MAKE) -f assets.makefile
83
 	$(MAKE) -f assets.makefile
83
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
84
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
84
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym -o object/debug.o object/linked.o
85
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym -o object/debug.o object/linked.o
85
 
86
 
87
+.PHONY: $(B_ENGINE)
88
+$(B_ENGINE):
89
+	$(MAKE) -C $(dir $@)/.. build/linked.o
90
+
86
 .PHONY: clean
91
 .PHONY: clean
87
 clean:
92
 clean:
88
 	rm -f  $(OUTPATH)/__symbols.sym $(OUTPATH)/pkmn_sots.gba
93
 	rm -f  $(OUTPATH)/__symbols.sym $(OUTPATH)/pkmn_sots.gba

+ 2
- 2
src/battle_engine/battle_m_flee_hook.S View File

15
 cmp r0, #8
15
 cmp r0, #8
16
 bne no_trainer
16
 bne no_trainer
17
 ldr r0, =battle_buffer_b
17
 ldr r0, =battle_buffer_b
18
-ldr r4, =battle_active_side
18
+ldr r4, =battle_active_bank
19
 ldrb r1, [r4]
19
 ldrb r1, [r4]
20
 lsl r1, #9
20
 lsl r1, #9
21
 add r0, #1
21
 add r0, #1
31
 
31
 
32
 @only intercept the flee command though...
32
 @only intercept the flee command though...
33
 ldr r0, =battle_buffer_b
33
 ldr r0, =battle_buffer_b
34
-ldr r4, =battle_active_side
34
+ldr r4, =battle_active_bank
35
 ldrb r1, [r4]
35
 ldrb r1, [r4]
36
 lsl r1, #9
36
 lsl r1, #9
37
 add r0, #1
37
 add r0, #1