瀏覽代碼

add sfx to pokedex

ipatix 6 年之前
父節點
當前提交
c6498b0258
共有 6 個文件被更改,包括 25 次插入34 次删除
  1. 1
    1
      g3headers
  2. 1
    1
      sots-private
  3. 0
    24
      src/include/sound.h
  4. 1
    1
      src/music/battle_music_lookup.c
  5. 7
    2
      src/pokedex/pokedex.c
  6. 15
    5
      src/pokedex/pokedex_region.c

+ 1
- 1
g3headers

@@ -1 +1 @@
1
-Subproject commit ef2af052b8e5436da9efb035e06ee091b8d53e69
1
+Subproject commit 97a084e3bbd1cfc31adf94c50a045c35e1044fa0

+ 1
- 1
sots-private

@@ -1 +1 @@
1
-Subproject commit 9591179a8d396b2343650dc1058a63b6288cea7b
1
+Subproject commit a62fe65e951ad5a563755d48d628f0607ab09d39

+ 0
- 24
src/include/sound.h 查看文件

@@ -36,30 +36,6 @@
36 36
 
37 37
 #include "types.h"
38 38
 
39
-typedef struct music_player_area music_player_area;
40
-typedef struct music_player_track music_player_track;
41
-typedef struct song_header song_header;
42
-
43
-typedef struct
44
-{
45
-    music_player_area *ma;
46
-    music_player_track *ta;
47
-    u32 tn;
48
-} m_play_table;
49
-
50
-typedef struct
51
-{
52
-    song_header *so;
53
-    u16 ms, me;
54
-} song_table;
55
-
56
-extern m_play_table mplay_table[];
57
-extern song_table _songtable[];
58
-void m4aSongNumStart(u16 songid);
59
-void MPlayStart_rev01(music_player_area *ma, song_header *so);
60
-void MPlayContinue(music_player_area *ma);
61
-void MPlayAllStop(void);
62
-
63 39
 // battle and map related stuff
64 40
 void current_map_music_set(u16);
65 41
 void current_map_music_set_to_zero(void);

+ 1
- 1
src/music/battle_music_lookup.c 查看文件

@@ -5,8 +5,8 @@
5 5
 #include <battle_common.h>
6 6
 #include <pokemon.h>
7 7
 #include <agb_debug.h>
8
-#include <sound.h>
9 8
 #include <config/core.h>
9
+#include <pokeagb/core/m4a.h>
10 10
 
11 11
 #define SONG_ID_SKIP_PLAY 0xFFFF
12 12
 

+ 7
- 2
src/pokedex/pokedex.c 查看文件

@@ -365,19 +365,22 @@ void pdex_try_advance(u8 reverse) {
365 365
     if (reverse) {
366 366
         if (pokedex_context->cursor_position_internal > 0) {
367 367
             pokedex_context->cursor_position_internal--;
368
+            m4aSongNumStart(600);
368 369
         } else if ((pokedex_context->cursor_position_top) > (pokedex_context->first_seen)) {
369 370
             pdex_fill_previous_slot();
370 371
             pokedex_context->cursor_position_top--;
371
-
372 372
             pdex_hardware_scroll(true);
373
+            m4aSongNumStart(600);
373 374
         }
374 375
     } else {
375 376
         if (pokedex_context->cursor_position_internal < 7) {
376 377
             pokedex_context->cursor_position_internal++;
378
+            m4aSongNumStart(600);
377 379
         } else if (pokedex_context->cursor_position_top < (PDEX_LAST_SHOWN - 7)) {
378 380
             pdex_fill_next_slot();
379 381
             pokedex_context->cursor_position_top++;
380 382
             pdex_hardware_scroll(false);
383
+            m4aSongNumStart(600);
381 384
         }
382 385
     }
383 386
 
@@ -432,9 +435,11 @@ void pdex_loop(u8 tid) {
432 435
         if(super.buttons_new & KEY_A)
433 436
         {
434 437
             pokedex_context->state = 15;
438
+            m4aSongNumStart(5);
435 439
         }
436 440
         if (super.buttons_new & KEY_B) {
437 441
             pokedex_context->state = 10;
442
+            m4aSongNumStart(601);
438 443
         }
439 444
         if ((super.buttons_new & KEY_DOWN) || (super.buttons_held & KEY_DOWN)) {
440 445
             pdex_try_advance(false);
@@ -502,4 +507,4 @@ void pdex_load(void) {
502 507
     pokedex_context->state = 0;
503 508
     task_add(pdex_loop, 0);
504 509
     set_callback2(pdex_cb_handler);
505
-}
510
+}

+ 15
- 5
src/pokedex/pokedex_region.c 查看文件

@@ -162,28 +162,38 @@ void region_loop(u8 tid) {
162 162
     case 3:
163 163
         switch (super.buttons_new) {
164 164
         case KEY_RIGHT:
165
-            if (pokedex_context->region_selected < 6)
165
+            if (pokedex_context->region_selected < 6) {
166 166
                 pokedex_context->region_selected++;
167
+                m4aSongNumStart(102);
168
+            }
167 169
             break;
168 170
         case KEY_DOWN:
169
-            if (pokedex_context->region_selected < 3)
171
+            if (pokedex_context->region_selected < 3) {
170 172
                 pokedex_context->region_selected += 3;
173
+                m4aSongNumStart(102);
174
+            }
171 175
             break;
172 176
         case KEY_LEFT:
173
-            if (pokedex_context->region_selected > 0)
177
+            if (pokedex_context->region_selected > 0) {
174 178
                 pokedex_context->region_selected--;
179
+                m4aSongNumStart(102);
180
+            }
175 181
             break;
176 182
         case KEY_UP:
177
-            if ((pokedex_context->region_selected > 2) && (pokedex_context->region_selected < 6))
183
+            if ((pokedex_context->region_selected > 2) && (pokedex_context->region_selected < 6)) {
178 184
                 pokedex_context->region_selected -= 3;
185
+                m4aSongNumStart(102);
186
+            }
179 187
             break;
180 188
         case KEY_A:
181 189
             fade_screen(0xFFFFFFFF, PDEX_FADEIN_SPD, 0, 16, 0x0000);
182 190
             pokedex_context->state = 10;
191
+            m4aSongNumStart(5);
183 192
             break;
184 193
         case KEY_B:
185 194
             fade_screen(0xFFFFFFFF, PDEX_FADEIN_SPD, 0, 16, 0x0000);
186 195
             pokedex_context->state = 11;
196
+            m4aSongNumStart(601);
187 197
         default:
188 198
             break;
189 199
         }
@@ -220,4 +230,4 @@ void region_select_load(void) {
220 230
     region_select_load_gfx();
221 231
     task_add(region_loop, 0);
222 232
     set_callback2(pdex_cb_handler);
223
-}
233
+}