Bläddra i källkod

clean up some old code, fix warnings

SBird1337 6 år sedan
förälder
incheckning
dc169f1442

+ 3
- 3
icons.makefile Visa fil

@@ -17,13 +17,13 @@ clean:
17 17
 	@echo -e "TRYING TO CLEAN ICONS FROM WRONG MAKEFILE"
18 18
 
19 19
 #$(ICON_AR): $(OBJ_FILES)
20
-#	@echo -e "\e[1;32mCreating archive $@\e[0m"
20
+#	@echo "\033[1;32mCreating archive $@\033[0m"
21 21
 #	$(AR) rcs $@ $^
22 22
 
23 23
 #$(GFX_BUILD_DIR)/icons/%.o: $(GFX_BUILD_DIR)/icons/%.s
24
-#	@echo -e "\e[32mAssembling $<\e[0m"
24
+#	@echo "\033[32mAssembling $<\033[0m"
25 25
 #	$(AS) -o $@ $<
26 26
 
27 27
 #$(GFX_BUILD_DIR)/icons/%.s: $(I_ASSET_ROOT)/pkmn_icons/%.png
28
-#	@echo -e "\e[34mProcessing image $<\e[0m"
28
+#	@echo  "\033[34mProcessing image $<\033[0m"
29 29
 #	$(GRIT) $< -fts -fh! -g -gB 4 -gt -gz! -m! -p! -s icon_$(notdir $(basename $<)) -o $@

+ 1
- 1
makefile Visa fil

@@ -30,7 +30,7 @@ CHARMAP := charmap.txt
30 30
 
31 31
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0 -DLAN_DE
32 32
 ASFLAGS   := -mthumb
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
+CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fdiagnostics-show-option -mlong-calls -march=armv4t -Og -std=c11 -Werror -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color=always $(DEFINES)
34 34
 GRITFLAGS := -ftc -fa
35 35
 LDFLAGS   := -z muldefs
36 36
 BLDPATH   := object

+ 6
- 0
src/battle_engine/battle_help.c Visa fil

@@ -68,6 +68,9 @@ u8 type_effectiveness_table[TYPE_FAIRY - 0x4][TYPE_FAIRY - 0x4] = {
68 68
 /* === IMPLEMENTATIONS === */
69 69
 u16 battle_damage_type_effectiveness_update(u8 attacking_type, u8 defending_type, u8 atk_bank, u8 def_bank,
70 70
                                             u16 chained_effect, u8 airstatus) {
71
+
72
+    (void)airstatus; //TODO
73
+
71 74
     u8 effect, atype = attacking_type, dtype = defending_type;
72 75
     if (!chained_effect || atype == TYPE_EGG || dtype == TYPE_EGG)
73 76
         return chained_effect;
@@ -124,6 +127,9 @@ u16 battle_apply_type_effectiveness(u16 chained_effect, u8 move_type, u8 target_
124 127
 
125 128
 u16 battle_type_effectiveness_calc(u16 move, u8 move_type, u8 atk_bank, u8 def_bank,
126 129
                                    u8 effects_handling_and_recording) {
130
+    (void)move;
131
+    (void)effects_handling_and_recording;
132
+    
127 133
     u16 chained_effect = 64;
128 134
     // TODO: double_type moves
129 135
     // TODO: get air status

+ 1
- 1
src/include/types.h Visa fil

@@ -19,6 +19,6 @@ typedef     double                  f64;
19 19
 #include <stddef.h>
20 20
 #include <stdbool.h>
21 21
 
22
-#define rgb5(r,g,b)                 (u16)( r | ( g << 5) | ( b << 10) )
22
+//#define rgb5(r,g,b)                 (u16)( r | ( g << 5) | ( b << 10) )
23 23
 
24 24
 #endif

+ 40
- 35
src/interface/textbox_mugshots.c Visa fil

@@ -29,13 +29,8 @@
29 29
  */
30 30
 
31 31
 /* === INCLUDES === */
32
-#include <objects.h>
33
-#include <callback.h>
32
+#include <pokeagb/pokeagb.h>
34 33
 #include <config/core.h>
35
-#include <lcd.h>
36
-#include <debug.h>
37
-#include <game_engine.h>
38
-#include <memory.h>
39 34
 
40 35
 /* === PROTOTYPES === */
41 36
 
@@ -43,7 +38,7 @@
43 38
  * @brief null callback
44 39
  * @param self object
45 40
  */
46
-void mug_cb_null(struct obj_entity *self);
41
+void mug_cb_null(struct Object *self);
47 42
 
48 43
 /**
49 44
  * @brief called when tb is opened to create mugshot
@@ -58,24 +53,33 @@ void mug_delete();
58 53
 
59 54
 /* === STRUCTURES === */
60 55
 
61
-typedef struct mug_mugshot {
56
+typedef struct Mugshot {
62 57
     void *gfx;
63 58
     void *pal;
64
-} mug_mugshot;
59
+} Mugshot;
65 60
 
66 61
 /* === STATIC GLOBALS === */
67 62
 
68
-extern mug_mugshot mugshots[0xFF];
63
+extern Mugshot mugshots[0xFF];
69 64
 
70 65
 u8 *temp_obj_id1 = (u8*) OBJ_1_TEMP;
71 66
 u8 *temp_obj_id2 = (u8*) OBJ_2_TEMP;
72 67
 
73
-struct obj_oam_attributes mug_sprite = {0, 0x8000, 0, 0};
74
-
75
-struct obj_template mugshot_1_template = {MUGSHOT_1_TAG, MUGSHOT_1_TAG, &mug_sprite, (struct obj_frame **) 0x08231CF0, 0, (struct obj_rotscale_frame **) 0x08231CFC, mug_cb_null};
76
-struct obj_template mugshot_2_template = {MUGSHOT_2_TAG, MUGSHOT_2_TAG, &mug_sprite, (struct obj_frame **) 0x08231CF0, 0, (struct obj_rotscale_frame **) 0x08231CFC, mug_cb_null};
68
+struct OamData mug_sprite = {.size = 3};
77 69
 
70
+struct Template mugshot_1_template = {.tiles_tag = MUGSHOT_1_TAG,
71
+                                      .pal_tag = MUGSHOT_1_TAG, 
72
+                                      .oam = &mug_sprite, .graphics = NULL, 
73
+                                      .animation=SPRITE_NO_ANIMATION,
74
+                                      .rotscale = SPRITE_NO_ROTSCALE,
75
+                                      .callback=mug_cb_null};
78 76
 
77
+struct Template mugshot_2_template = {.tiles_tag = MUGSHOT_2_TAG,
78
+                                      .pal_tag = MUGSHOT_2_TAG, 
79
+                                      .oam = &mug_sprite, .graphics = NULL, 
80
+                                      .animation=SPRITE_NO_ANIMATION,
81
+                                      .rotscale = SPRITE_NO_ROTSCALE,
82
+                                      .callback=mug_cb_null};
79 83
 
80 84
 /* === IMPLEMENTATIONS === */
81 85
 
@@ -90,22 +94,22 @@ void mug_create_on_variable() {
90 94
         u16 *mug1_y = var_access(MUGSHOT_1_Y);
91 95
 
92 96
         mug_id_1--;
93
-        struct obj_resource gfx_mugshot_1 = {(mugshots[mug_id_1].gfx), 0x1C00, MUGSHOT_1_TAG};
94
-        struct obj_resource pal_mugshot_1 = {(mugshots[mug_id_1].pal), MUGSHOT_1_TAG};
97
+        struct SpriteTiles gfx_mugshot_1 = {(mugshots[mug_id_1].gfx), 0x1C00, MUGSHOT_1_TAG};
98
+        struct SpritePalette pal_mugshot_1 = {(mugshots[mug_id_1].pal), MUGSHOT_1_TAG};
95 99
 
96 100
 
97
-        obj_gpu_pal_alloc_tag_and_apply(&pal_mugshot_1);
98
-        obj_gpu_tile_decompress_alloc_tag_and_upload(&gfx_mugshot_1);
101
+        gpu_pal_obj_alloc_tag_and_apply(&pal_mugshot_1);
102
+        gpu_tile_obj_decompress_alloc_tag_and_upload(&gfx_mugshot_1);
99 103
 
100
-        *temp_obj_id1 = (u16) obj_template_instanciate_forward_search(&mugshot_1_template, 0, 100, 1);
104
+        *temp_obj_id1 = (u16) template_instanciate_forward_search(&mugshot_1_template, 0, 100, 1);
101 105
 
102 106
         if (h_flip)
103
-            objects[*temp_obj_id1].final_oam.attr1 |= 0x1000;
107
+            objects[*temp_obj_id1].final_oam.h_flip = true;
104 108
         if (v_flip)
105
-            objects[*temp_obj_id1].final_oam.attr1 |= 0x2000;
109
+            objects[*temp_obj_id1].final_oam.v_flip = true;
106 110
 
107
-        objects[*temp_obj_id1].x = *mug1_x;
108
-        objects[*temp_obj_id1].y = *mug1_y;
111
+        objects[*temp_obj_id1].pos1.x = *mug1_x;
112
+        objects[*temp_obj_id1].pos1.y = *mug1_y;
109 113
     }
110 114
     u16 *mug2_var = var_access(MUGHSOT_2_TABLE);
111 115
     u16 c_mug2_var = *mug2_var;
@@ -117,23 +121,23 @@ void mug_create_on_variable() {
117 121
         u16 *mug2_y = var_access(MUGSHOT_2_Y);
118 122
 
119 123
         mug_id_2--;
120
-        struct obj_resource gfx_mugshot_2 = {(mugshots[mug_id_2].gfx), 0x1C00, MUGSHOT_2_TAG};
121
-        struct obj_resource pal_mugshot_2 = {(mugshots[mug_id_2].pal), MUGSHOT_2_TAG};
124
+        struct SpriteTiles gfx_mugshot_2 = {(mugshots[mug_id_2].gfx), 0x1C00, MUGSHOT_2_TAG};
125
+        struct SpritePalette pal_mugshot_2 = {(mugshots[mug_id_2].pal), MUGSHOT_2_TAG};
122 126
 
123 127
 
124
-        obj_gpu_pal_alloc_tag_and_apply(&pal_mugshot_2);
125
-        obj_gpu_tile_decompress_alloc_tag_and_upload(&gfx_mugshot_2);
128
+        gpu_pal_obj_alloc_tag_and_apply(&pal_mugshot_2);
129
+        gpu_tile_obj_decompress_alloc_tag_and_upload(&gfx_mugshot_2);
126 130
 
127 131
         c_mug2_var = *mug2_var;
128
-        *temp_obj_id2 = (u16) obj_template_instanciate_forward_search(&mugshot_2_template, 0, 100, 1);
132
+        *temp_obj_id2 = (u16) template_instanciate_forward_search(&mugshot_2_template, 0, 100, 1);
129 133
 
130 134
         if (h_flip)
131
-            objects[*temp_obj_id2].final_oam.attr1 |= 0x1000;
135
+            objects[*temp_obj_id2].final_oam.h_flip = true;
132 136
         if (v_flip)
133
-            objects[*temp_obj_id2].final_oam.attr1 |= 0x2000;
137
+            objects[*temp_obj_id2].final_oam.v_flip = true;
134 138
 
135
-        objects[*temp_obj_id2].x = *mug2_x;
136
-        objects[*temp_obj_id2].y = *mug2_y;
139
+        objects[*temp_obj_id2].pos1.x = *mug2_x;
140
+        objects[*temp_obj_id2].pos1.y = *mug2_y;
137 141
     }
138 142
 }
139 143
 
@@ -143,7 +147,7 @@ void mug_delete() {
143 147
 
144 148
     if (*temp_obj_id1 != 0) {
145 149
         gpu_pal_free_by_tag(MUGSHOT_1_TAG);
146
-        obj_gpu_tile_free_by_tag(MUGSHOT_1_TAG);
150
+        gpu_tile_obj_free_by_tag(MUGSHOT_1_TAG);
147 151
 
148 152
         //*mug1_var = 0;
149 153
         //do reset mugshot var ; set it to old value instead
@@ -157,7 +161,7 @@ void mug_delete() {
157 161
     //return;
158 162
     if (*temp_obj_id2 != 0) {
159 163
         gpu_pal_free_by_tag(MUGSHOT_2_TAG);
160
-        obj_gpu_tile_free_by_tag(MUGSHOT_2_TAG);
164
+        gpu_tile_obj_free_by_tag(MUGSHOT_2_TAG);
161 165
 
162 166
         //*mug2_var = 0;
163 167
         //do reset mugshot var ; set it to old value instead
@@ -170,6 +174,7 @@ void mug_delete() {
170 174
 
171 175
 }
172 176
 
173
-void mug_cb_null(struct obj_entity *self) {
177
+void mug_cb_null(struct Object *self) {
178
+    (void)self;
174 179
     return;
175 180
 }

+ 2
- 2
src/specials/custom_specials.c Visa fil

@@ -31,7 +31,7 @@
31 31
 /* === INCLUDES === */
32 32
 
33 33
 #include "camera_move.h"
34
-#include "cutscene_meteor.h"
34
+//#include "cutscene_meteor.h"
35 35
 #include <config/core.h>
36 36
 #include <pokeagb/pokeagb.h>
37 37
 
@@ -81,7 +81,7 @@ extern pchar name_rival_female[5];
81 81
 /* === STATICS === */
82 82
 
83 83
 static special_func special_routines[10] = {
84
-    met_play,         cam_sp_move_camera, sp_init_script,  NULL, NULL,
84
+    NULL,         cam_sp_move_camera, sp_init_script,  NULL, NULL,
85 85
     sp_random_number, sp_check_tileset,   sp_batchmaptile, sp_crystal_fade, sp_set_rival,
86 86
 };
87 87
 

src/specials/cutscene_meteor.c → src/specials/cutscene_meteor.c.old Visa fil


src/specials/cutscene_meteor.h → src/specials/cutscene_meteor.h.old Visa fil