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,3 +1,6 @@
1 1
 [submodule "sots-private"]
2 2
 	path = sots-private
3 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

@@ -0,0 +1 @@
1
+Subproject commit a5e46479febfe3d780ac3111ebbb9401940983b5

+ 10
- 3
main.asm View File

@@ -5,7 +5,12 @@
5 5
 //exclude for now
6 6
 //.include "patches/split_physical_special.asm"
7 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 14
 .include "patches/special.asm"
10 15
 .include "patches/moves.asm"
11 16
 .include "patches/music.asm"
@@ -54,14 +59,16 @@
54 59
 
55 60
 .include "patches/game_engine/quick_hacks.asm"
56 61
 
62
+.include "battle_engine/patches/menutest.s"
63
+
57 64
 .org 0x0815F9B8
58 65
     .word 0x08069ED5 // fix nop1 for now...
59 66
 
60 67
 .org 0x083522F4
61
-    .word mapheader_alabastia
68
+    //.word mapheader_alabastia
62 69
 
63 70
 .org 0x0834ECC0
64
-    .word mapfooter_alabastia
71
+    //.word mapfooter_alabastia
65 72
 
66 73
 .org 0x09000000
67 74
 .importobj "object/linked.o"

+ 6
- 1
makefile View File

@@ -23,6 +23,7 @@ SOURCEDIR := src
23 23
 STRINGDIR := string
24 24
 
25 25
 MAIN_OBJ  := $(BLDPATH)/linked.o
26
+B_ENGINE  := battle_engine/build/linked.o
26 27
 SPRITES   := $(BLDPATH)/pkmn_sprites.o
27 28
 ICONS_AR  := $(BLDPATH)/pkmn_icons.a
28 29
 DYN_OVER  := built/dynamic_overworld.o
@@ -78,11 +79,15 @@ rom: main.asm $(MAIN_OBJ)
78 79
 		sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
79 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 83
 	$(MAKE) -f assets.makefile
83 84
 	$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
84 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 91
 .PHONY: clean
87 92
 clean:
88 93
 	rm -f  $(OUTPATH)/__symbols.sym $(OUTPATH)/pkmn_sots.gba

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

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