Parcourir la source

fixed some wild pokemon

Philipp Auer il y a 7 ans
Parent
révision
a28bafe0bd

+ 1822
- 954
data/overworld/wild_pokemon_data.S
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 2
- 0
src/include/types.h Voir le fichier

@@ -14,6 +14,8 @@ typedef     signed long long int    s64;
14 14
 typedef     float                   f32;
15 15
 typedef     double                  f64;
16 16
 
17
+#define NULL 0x00000000
18
+
17 19
 #include <stddef.h>
18 20
 #include <stdbool.h>
19 21
 

+ 3
- 11
src/player_interaction/on_step.S Voir le fichier

@@ -36,12 +36,11 @@ on_step:
36 36
 	bl check_block_role
37 37
 	lsl r0, #0x18
38 38
 	lsr r0, #0x18
39
-	ldr r1, behavior_walk_table
39
+	ldr r1, =behavior_walk_table
40 40
 	lsl r0, #2
41 41
 	add r0, r1
42 42
 	ldr r0, [r0]
43 43
 	mov r2, #0
44
-	sub r2, #1
45 44
 	cmp r0, r2
46 45
 	beq check_walking_script
47 46
 	
@@ -56,7 +55,7 @@ check_walking_script:
56 55
 	cmp r0, #0
57 56
 	beq return_false
58 57
 	sub r0, #1
59
-	ldr r1, script_walk_table
58
+	ldr r1, =script_walk_table
60 59
 	lsl r0, #2
61 60
 	add r0, r1
62 61
 	ldr r0, [r0]
@@ -101,11 +100,4 @@ read_flag:
101 100
 	
102 101
 execute_script:
103 102
 	ldr r3, =0x08069AE4|1
104
-	bx r3
105
-
106
-.align 2
107
-behavior_walk_table:
108
-	.word 0x09700B20
109
-
110
-script_walk_table:
111
-	.word 0x09700F20
103
+	bx r3

+ 109
- 0
src/player_interaction/player_interaction.c Voir le fichier

@@ -0,0 +1,109 @@
1
+/****************************************************************************
2
+ * Copyright (C) 2015-2017 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
23
+ /**
24
+ * @file player_interaction.c
25
+ * @author Sturmvogel
26
+ * @date 21 may 2017
27
+ * @brief define tables for walking and behavior scripts
28
+ */
29
+
30
+#include <types.h>
31
+
32
+void* script_walk_table[] =
33
+{
34
+    (void*)NULL
35
+};
36
+
37
+void* behavior_walk_table[] =
38
+{
39
+    (void*)NULL,
40
+    (void*)NULL,
41
+    (void*)NULL,
42
+    (void*)NULL,
43
+    (void*)NULL,
44
+    (void*)NULL,
45
+    (void*)NULL,
46
+    (void*)NULL,
47
+    (void*)NULL,
48
+    (void*)NULL,
49
+    (void*)NULL,
50
+    (void*)NULL,
51
+    (void*)NULL,
52
+    (void*)NULL,
53
+    (void*)NULL,
54
+    (void*)NULL,
55
+    (void*)NULL,
56
+    (void*)NULL,
57
+    (void*)NULL,
58
+    (void*)NULL,
59
+    (void*)NULL,
60
+    (void*)NULL,
61
+    (void*)NULL,
62
+    (void*)NULL,
63
+    (void*)NULL,
64
+    (void*)NULL,
65
+    (void*)NULL,
66
+    (void*)NULL,
67
+    (void*)NULL,
68
+    (void*)NULL,
69
+    (void*)NULL,
70
+    (void*)NULL,
71
+    (void*)NULL,
72
+    (void*)NULL,
73
+    (void*)NULL,
74
+    (void*)NULL,
75
+    (void*)NULL,
76
+    (void*)NULL,
77
+    (void*)NULL,
78
+    (void*)NULL,
79
+    (void*)NULL,
80
+    (void*)NULL,
81
+    (void*)NULL,
82
+    (void*)NULL,
83
+    (void*)NULL,
84
+    (void*)NULL,
85
+    (void*)NULL,
86
+    (void*)NULL,
87
+    (void*)NULL,
88
+    (void*)NULL,
89
+    (void*)NULL,
90
+    (void*)NULL,
91
+    (void*)NULL,
92
+    (void*)NULL,
93
+    (void*)NULL,
94
+    (void*)NULL,
95
+    (void*)NULL,
96
+    (void*)NULL,
97
+    (void*)NULL,
98
+    (void*)NULL,
99
+    (void*)NULL,
100
+    (void*)0x0891B807,
101
+    (void*)0x0891B807
102
+};
103
+
104
+//TODO implement actual functtions
105
+
106
+void* pi_dummy(bool darg)
107
+{
108
+    return darg ? behavior_walk_table[0] : script_walk_table[0];
109
+}

+ 2
- 2
src/specials/check_tileset.c Voir le fichier

@@ -37,8 +37,8 @@ void sp_check_tileset(void)
37 37
     u16 x;
38 38
     u16 y;
39 39
     player_get_pos_to(&x, &y);
40
-    dprintf("reading from %d %d\n", x,y);
40
+    dprintf("sp_check_tileset: reading from %d %d\n", x,y);
41 41
     u16 block_id = current_map_block_id_at(x,y);
42
-    dprintf("block id: %d\n", block_id);
42
+    dprintf("sp_check_tileset: block id: %d\n", block_id);
43 43
     var_set(0x800D, current_map_block_id_at(x,y));
44 44
 }