summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h6
-rw-r--r--include/battle_anim.h4
-rw-r--r--include/berry_blender.h10
-rw-r--r--include/constants/daycare.h2
-rw-r--r--include/constants/pokemon.h3
-rw-r--r--include/constants/songs.h1075
-rw-r--r--include/gba/m4a_internal.h92
-rw-r--r--include/global.h1
-rw-r--r--include/global.tv.h82
-rw-r--r--include/graphics.h16
-rw-r--r--include/item_menu.h2
-rw-r--r--include/item_menu_icons.h2
-rw-r--r--include/link.h104
-rw-r--r--include/link_rfu.h32
-rw-r--r--include/menu.h8
-rw-r--r--include/pokeball.h8
-rw-r--r--include/pokeblock.h13
-rw-r--r--include/strings.h5
18 files changed, 760 insertions, 705 deletions
diff --git a/include/battle.h b/include/battle.h
index 78e7b809a..0ebc9fe01 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -523,14 +523,14 @@ struct BattleAnimationInfo
u8 field_7;
u8 ballThrowCaseId;
u8 field_9_x1:1;
- u8 field_9_x2:1;
+ u8 wildMonInvisible:1;
u8 field_9_x1C:3;
u8 field_9_x20:1;
u8 field_9_x40:1;
u8 field_9_x80:1;
- u8 field_A;
+ u8 numBallParticles;
u8 field_B;
- s16 field_C;
+ s16 ballSubpx;
u8 field_E;
u8 field_F;
};
diff --git a/include/battle_anim.h b/include/battle_anim.h
index 18727cc73..096d533e2 100644
--- a/include/battle_anim.h
+++ b/include/battle_anim.h
@@ -207,8 +207,8 @@ void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId);
// battle_anim_ground.c
void AnimTask_HorizontalShake(u8 taskId);
-// battle_anim_special.c
-void sub_8172EF0(u8 battler, struct Pokemon *mon);
+// battle_anim_throw.c
+void TryShinyAnimation(u8 battler, struct Pokemon *mon);
u8 ItemIdToBallId(u16 itemId);
u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId);
diff --git a/include/berry_blender.h b/include/berry_blender.h
index e8f7bb83d..66d839389 100644
--- a/include/berry_blender.h
+++ b/include/berry_blender.h
@@ -1,6 +1,16 @@
#ifndef GUARD_BERRY_BLENDER_H
#define GUARD_BERRY_BLENDER_H
+// Indices into gSendCmd / gRecvCmds
+#define BLENDER_COMM_INPUT_STATE 0
+#define BLENDER_COMM_RESP 1
+#define BLENDER_COMM_SCORE 2
+#define BLENDER_COMM_STOP_TYPE 2 // re-used
+#define BLENDER_COMM_PLAYER_ID 3
+#define BLENDER_COMM_UNUSED 4
+#define BLENDER_COMM_PROGRESS_BAR 5
+#define BLENDER_COMM_ARROW_POS 6
+
extern u8 gInGameOpponentsNo;
void DoBerryBlending(void);
diff --git a/include/constants/daycare.h b/include/constants/daycare.h
index 103f920f2..adb62fab5 100644
--- a/include/constants/daycare.h
+++ b/include/constants/daycare.h
@@ -22,6 +22,6 @@
// Array buffers
#define EGG_MOVES_ARRAY_COUNT 10
-#define EGG_LVL_UP_MOVES_ARRAY_COUNT 50
+#define EGG_LVL_UP_MOVES_ARRAY_COUNT (MAX_LEVEL_UP_MOVES > 50 ? MAX_LEVEL_UP_MOVES : 50)
#endif //GUARD_DAYCARE_CONSTANTS_H
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index 286726838..52eabe71b 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -204,6 +204,8 @@
#define LEVEL_UP_MOVE_LV 0xFE00
#define LEVEL_UP_END 0xFFFF
+#define MAX_LEVEL_UP_MOVES 20
+
#define MON_MALE 0x00
#define MON_FEMALE 0xFE
#define MON_GENDERLESS 0xFF
@@ -230,6 +232,7 @@
#define STATUS_PRIMARY_POKERUS 6
#define STATUS_PRIMARY_FAINTED 7
+#define MAX_PER_STAT_EVS 255
#define MAX_TOTAL_EVS 510
#define EV_ITEM_RAISE_LIMIT 100
diff --git a/include/constants/songs.h b/include/constants/songs.h
index b44c9f7a8..a78ee6faf 100644
--- a/include/constants/songs.h
+++ b/include/constants/songs.h
@@ -1,543 +1,548 @@
#ifndef GUARD_CONSTANTS_SONGS_H
#define GUARD_CONSTANTS_SONGS_H
-#define MUS_DUMMY 0
-#define SE_KAIFUKU 1 // Healing Item
-#define SE_PC_LOGIN 2 // PC Logon
-#define SE_PC_OFF 3 // PC Shutdown
-#define SE_PC_ON 4 // PC Startup
-#define SE_SELECT 5 // Cursor Selection
-#define SE_WIN_OPEN 6 // Start Menu
-#define SE_WALL_HIT 7 // Wall Bump
-#define SE_DOOR 8 // Opening Door
-#define SE_KAIDAN 9 // Stairs
-#define SE_DANSA 10 // Ledge
-#define SE_JITENSYA 11 // Bicycle Bell
-#define SE_KOUKA_L 12 // Not Very Effective
-#define SE_KOUKA_M 13 // Normal Effectiveness
-#define SE_KOUKA_H 14 // Super Effective
-#define SE_BOWA2 15 // Pokémon Withdrawal
-#define SE_POKE_DEAD 16 // Pokémon Fainted
-#define SE_NIGERU 17 // Flee from Wild Battle
-#define SE_JIDO_DOA 18 // Pokémon Center Door
-#define SE_NAMINORI 19 // Briney's Ship
-#define SE_BAN 20 // Bang
-#define SE_PIN 21 // Exclamation Bubble
-#define SE_BOO 22 // Contest Jam
-#define SE_BOWA 23 // Giving Poké Ball to Nurse, Poké Ball Wiggle
-#define SE_JYUNI 24 // Places in Contest Appearing
-#define SE_A 25 // Bard A
-#define SE_I 26 // Bard I
-#define SE_U 27 // Bard U
-#define SE_E 28 // Bard E
-#define SE_O 29 // Bard O
-#define SE_N 30 // Bard N
-#define SE_SEIKAI 31 // Success
-#define SE_HAZURE 32 // Failure
-#define SE_EXP 33 // Exp. Bar
-#define SE_JITE_PYOKO 34 // Bunny Hop
-#define SE_MU_PACHI 35
-#define SE_TK_KASYA 36 // Mossdeep Gym/Trick House Switch
-#define SE_FU_ZAKU 37
-#define SE_FU_ZAKU2 38
-#define SE_FU_ZUZUZU 39 // Lavaridge Gym Warp
-#define SE_RU_GASHIN 40 // Sootopolis Gym - Stairs Appear
-#define SE_RU_GASYAN 41 // Sootopolis Gym - Ice Breaking
-#define SE_RU_BARI 42 // Sootopolis Gym - Walking on Ice
-#define SE_RU_HYUU 43 // Falling Down
-#define SE_KI_GASYAN 44
-#define SE_TK_WARPIN 45 // Warp In
-#define SE_TK_WARPOUT 46 // Warp Out
-#define SE_TU_SAA 47 // Repel
-#define SE_HI_TURUN 48 // Moving Obstacle in Fortree Gym
-#define SE_TRACK_MOVE 49 // Moving Truck
-#define SE_TRACK_STOP 50 // Moving Truck Stop
-#define SE_TRACK_HAIKI 51 // Moving Truck Unload
-#define SE_TRACK_DOOR 52 // Moving Truck Door
-#define SE_MOTER 53
-#define SE_CARD 54
-#define SE_SAVE 55 // Save
-#define SE_KON 56 // Poké Ball Bounce 1
-#define SE_KON2 57 // Poké Ball Bounce 2
-#define SE_KON3 58 // Poké Ball Bounce 3
-#define SE_KON4 59 // Poké Ball Bounce 4
-#define SE_SUIKOMU 60 // Poké Ball Trade
-#define SE_NAGERU 61 // Poké Ball Throw
-#define SE_TOY_C 62 // Note C
-#define SE_TOY_D 63 // Note D
-#define SE_TOY_E 64 // Note E
-#define SE_TOY_F 65 // Note F
-#define SE_TOY_G 66 // Note G
-#define SE_TOY_A 67 // Note A
-#define SE_TOY_B 68 // Note B
-#define SE_TOY_C1 69 // Note High C
-#define SE_MIZU 70 // Puddle
-#define SE_HASHI 71 // Boardwalk
-#define SE_DAUGI 72 // Slots Credits
-#define SE_PINPON 73 // Ding-dong!
-#define SE_FUUSEN1 74 // Red Balloon
-#define SE_FUUSEN2 75 // Blue Balloon
-#define SE_FUUSEN3 76 // Yellow Balloon
-#define SE_TOY_KABE 77 // Breakable Door
-#define SE_TOY_DANGO 78 // Mud Ball
-#define SE_DOKU 79 // Overworld Poison Damage
-#define SE_ESUKA 80 // Escalator
-#define SE_T_AME 81 // Rain
-#define SE_T_AME_E 82 // Rain Stop
-#define SE_T_OOAME 83 // Heavy Rain
-#define SE_T_OOAME_E 84 // Heavy Rain Stop
-#define SE_T_KOAME 85 // Light Rain
-#define SE_T_KOAME_E 86 // Light Rain Stop
-#define SE_T_KAMI 87 // Thunder
-#define SE_T_KAMI2 88 // Thunder 2
-#define SE_ELEBETA 89 // Elevator
-#define SE_HINSI 90 // Low Health
-#define SE_EXPMAX 91 // Exp. Max
-#define SE_TAMAKORO 92 // Roulette Ball
-#define SE_TAMAKORO_E 93 // Roulette Ball 2
-#define SE_BASABASA 94
-#define SE_REGI 95 // Cash Register
-#define SE_C_GAJI 96 // Contest Hearts
-#define SE_C_MAKU_U 97 // Contest Curtain rise
-#define SE_C_MAKU_D 98 // Contest Curtain fall
-#define SE_C_PASI 99
-#define SE_C_SYU 100
-#define SE_C_PIKON 101 // Pokémon Appears in Contest
-#define SE_REAPOKE 102 // Shiny Pokémon
-#define SE_OP_BASYU 103 // Opening Movie -> Title Screen whoosh
-#define SE_BT_START 104 // Battle Mugshot whoosh
-#define SE_DENDOU 105 // Audience Cheering
-#define SE_JIHANKI 106 // Vending Machine
-#define SE_TAMA 107 // Orb Used
-#define SE_Z_SCROLL 108 // Pokédex Scrolling
-#define SE_Z_PAGE 109 // Pokédex Page
-#define SE_PN_ON 110 // PokéNav On
-#define SE_PN_OFF 111 // PokéNav Off
-#define SE_Z_SEARCH 112 // Pokédex Search
-#define SE_TAMAGO 113 // Egg hatch
-#define SE_TB_START 114 // Battle - Poké Ball Tray slide in
-#define SE_TB_KON 115 // Battle - Poké Ball Tray ball sound
-#define SE_TB_KARA 116 // Battle - Poké Ball Tray slide out
-#define SE_BIDORO 117
-#define SE_W085 118 // Thunderbolt
-#define SE_W085B 119 // Thunderbolt 2
-#define SE_W231 120 // Harden
-#define SE_W171 121 // Nightmare
-#define SE_W233 122 // Vital Throw
-#define SE_W233B 123 // Vital Throw 2
-#define SE_W145 124 // Bubble
-#define SE_W145B 125 // Bubble 2
-#define SE_W145C 126 // Bubble 3
-#define SE_W240 127 // Rain Dance
-#define SE_W015 128 // Cut
-#define SE_W081 129 // String Shot
-#define SE_W081B 130 // String Shot 2
-#define SE_W088 131 // Rock Throw
-#define SE_W016 132 // Gust
-#define SE_W016B 133 // Gust 2
-#define SE_W003 134 // DoubleSlap
-#define SE_W104 135 // Double Team
-#define SE_W013 136 // Razor Wind
-#define SE_W196 137 // Icy Wind
-#define SE_W086 138 // Thunder Wave
-#define SE_W004 139 // Comet Punch
-#define SE_W025 140 // Mega Kick
-#define SE_W025B 141 // Mega Kick 2
-#define SE_W152 142 // Crabhammer
-#define SE_W026 143 // Jump Kick
-#define SE_W172 144 // Flame Wheel
-#define SE_W172B 145 // Flame Wheel 2
-#define SE_W053 146 // Flamethrower
-#define SE_W007 147 // Fire Punch
-#define SE_W092 148 // Toxic
-#define SE_W221 149 // Sacred Fire
-#define SE_W221B 150 // Sacred Fire 2
-#define SE_W052 151 // Ember
-#define SE_W036 152 // Take Down
-#define SE_W059 153 // Blizzard
-#define SE_W059B 154 // Blizzard 2
-#define SE_W010 155 // Scratch
-#define SE_W011 156 // Vicegrip
-#define SE_W017 157 // Wing Attack
-#define SE_W019 158 // Fly
-#define SE_W028 159 // Sand-Attack
-#define SE_W013B 160 // Razor Wind 2
-#define SE_W044 161 // Bite
-#define SE_W029 162 // Headbutt
-#define SE_W057 163 // Surf
-#define SE_W056 164 // Hydro Pump
-#define SE_W250 165 // Whirlpool
-#define SE_W030 166 // Horn Attack
-#define SE_W039 167 // Tail Whip
-#define SE_W054 168 // Mist
-#define SE_W077 169 // PoisonPowder
-#define SE_W020 170 // Bind
-#define SE_W082 171 // Dragon Rage
-#define SE_W047 172 // Sing
-#define SE_W195 173 // Perish Song
-#define SE_W006 174 // Pay Day
-#define SE_W091 175 // Dig
-#define SE_W146 176 // Dizzy Punch
-#define SE_W120 177 // Self-Destruct
-#define SE_W153 178 // Explosion
-#define SE_W071B 179 // Absorb 2
-#define SE_W071 180 // Absorb
-#define SE_W103 181 // Screech
-#define SE_W062 182 // BubbleBeam
-#define SE_W062B 183 // BubbleBeam 2
-#define SE_W048 184 // Supersonic
-#define SE_W187 185 // Belly Drum
-#define SE_W118 186 // Metronome
-#define SE_W155 187 // Bonemerang
-#define SE_W122 188 // Lick
-#define SE_W060 189 // Psybeam
-#define SE_W185 190 // Faint Attack
-#define SE_W014 191 // Swords Dance
-#define SE_W043 192 // Leer
-#define SE_W207 193 // Swagger
-#define SE_W207B 194 // Swagger 2
-#define SE_W215 195 // Heal Bell
-#define SE_W109 196 // Confuse Ray
-#define SE_W173 197 // Snore
-#define SE_W280 198 // Brick Break
-#define SE_W202 199 // Giga Drain
-#define SE_W060B 200 // Psybeam 2
-#define SE_W076 201 // SolarBeam
-#define SE_W080 202 // Petal Dance
-#define SE_W100 203 // Teleport
-#define SE_W107 204 // Minimize
-#define SE_W166 205 // Sketch
-#define SE_W129 206 // Swift
-#define SE_W115 207 // Reflect
-#define SE_W112 208 // Barrier
-#define SE_W197 209 // Detect
-#define SE_W199 210 // Lock-On
-#define SE_W236 211 // Moonlight
-#define SE_W204 212 // Charm
-#define SE_W268 213 // Charge
-#define SE_W070 214 // Strength
-#define SE_W063 215 // Hyper Beam
-#define SE_W127 216 // Waterfall
-#define SE_W179 217 // Reversal
-#define SE_W151 218 // Acid Armor
-#define SE_W201 219 // Sandstorm
-#define SE_W161 220 // Tri-Attack
-#define SE_W161B 221 // Tri-Attack 2
-#define SE_W227 222 // Encore
-#define SE_W227B 223 // Encore 2
-#define SE_W226 224 // Baton Pass
-#define SE_W208 225 // Milk Drink
-#define SE_W213 226 // Attract
-#define SE_W213B 227 // Attract 2
-#define SE_W234 228 // Morning Sun
-#define SE_W260 229 // Flatter
-#define SE_W328 230 // Sand Tomb
-#define SE_W320 231 // GrassWhistle
-#define SE_W255 232 // Spit Up
-#define SE_W291 233 // Dive
-#define SE_W089 234 // Earthquake
-#define SE_W239 235 // Twister
-#define SE_W230 236 // Sweet Scent
-#define SE_W281 237 // Yawn
-#define SE_W327 238 // Sky Uppercut
-#define SE_W287 239 // Stat Increased
-#define SE_W257 240 // Heat Wave
-#define SE_W253 241 // Uproar
-#define SE_W258 242 // Hail
-#define SE_W322 243 // Cosmic Power
-#define SE_W298 244 // Teeter Dance
-#define SE_W287B 245 // Stat Decreased
-#define SE_W114 246 // Haze
-#define SE_W063B 247 // Hyper Beam 2
-// FRLG SFX below
-#define SE_RG_W_DOOR 248 // Door
-#define SE_RG_CARD1 249 // Trainer Card 1
-#define SE_RG_CARD2 250 // Trainer Card 2
-#define SE_RG_CARD3 251 // Trainer Card 3
-#define SE_RG_BAG1 252 // Bag Scroll
-#define SE_RG_BAG2 253 // Bag Pocket Change
-#define SE_RG_GETTING 254
-#define SE_RG_SHOP 255 // Cash Register
-#define SE_RG_KITEKI 256 // S.S. Anne Horn
-#define SE_RG_HELP_OP 257 // Help Menu Open
-#define SE_RG_HELP_CL 258 // Help Menu Close
-#define SE_RG_HELP_NG 259 // Help Menu Error
-#define SE_RG_DEOMOV 260 // Deoxys Moves
-#define SE_RG_EXCELLENT 261
-#define SE_RG_NAWAMISS 262
-// end FRLG SFX
-#define SE_TOREEYE 263 // Trainer's Eye Call
-#define SE_TOREOFF 264 // Trainer's Eye Hang Up
-#define SE_HANTEI1 265 // Battle Arena Time's Up 1
-#define SE_HANTEI2 266 // Battle Arena Time's Up 2
-#define SE_CURTAIN 267 // Battle Pike Curtain Open
-#define SE_CURTAIN1 268 // Battle Pike Curtain Close
-#define SE_USSOKI 269 // Sudowoodo
+// Original JP names listed on right, along with any additional notes
-#define MUS_TETSUJI 350 // Littleroot Town Test 'TETSUJI'
-#define MUS_FIELD13 351 // GSC - Route 38
-#define MUS_KACHI22 352 // Wild Pokémon Defeated
-#define MUS_KACHI2 353 // Wild Pokémon Defeated with Intro
-#define MUS_KACHI3 354 // Gym Leader Defeated
-#define MUS_KACHI5 355 // Victory! Elite Four
-#define MUS_PCC 356 // Crystal - Pokémon Communication Center
-#define MUS_NIBI 357 // GSC - Viridian/Saffron/Pewter/etc
-#define MUS_SUIKUN 358 // Crystal - Battle! Legendary Beasts
-#define MUS_DOORO1 359 // Route 101
-#define MUS_DOORO_X1 360 // Route 110
-#define MUS_DOORO_X3 361 // Route 120
-#define MUS_MACHI_S2 362 // Petalburg City
-#define MUS_MACHI_S4 363 // Oldale/Lavaridge Town
-#define MUS_GIM 364 // Gym
-#define MUS_NAMINORI 365 // Surfing
-#define MUS_DAN01 366 // Caves and Darkness
-#define MUS_FANFA1 367 // Level Up!
-#define MUS_ME_ASA 368 // Pokémon Healed
-#define MUS_ME_BACHI 369 // Obtained a Badge!
-#define MUS_FANFA4 370 // Obtained an Item!
-#define MUS_FANFA5 371 // Your Pokémon Just Evolved!
-#define MUS_ME_WAZA 372 // Obtained a TM/HM!
-#define MUS_BIJYUTU 373 // Lilycove Museum
-#define MUS_DOORO_X4 374 // Route 122/Intro
-#define MUS_FUNE_KAN 375 // Slateport Museum
-#define MUS_ME_SHINKA 376 // Evolution Intro
-#define MUS_SHINKA 377 // Evolution
-#define MUS_ME_WASURE 378 // Move Deleted/Messed Up Appeal
-#define MUS_SYOUJOEYE 379 // Encounter! Tuber
-#define MUS_BOYEYE 380 // Encounter! Boy
-#define MUS_DAN02 381 // Abandoned Ship/Southern Island
-#define MUS_MACHI_S3 382 // Fortree City/Pacifidlog Town
-#define MUS_ODAMAKI 383 // Professor Birch's Lab
-#define MUS_B_TOWER 384 // Battle Tower (RS)
-#define MUS_SWIMEYE 385 // Encounter! Swimmer
-#define MUS_DAN03 386 // Meteor Falls/Cave of Origin
-#define MUS_ME_KINOMI 387 // Obtained a Berry!
-#define MUS_ME_TAMA 388 // Awakening the Super-Ancient Pokémon
-#define MUS_ME_B_BIG 389 // Slots Jackpot!
-#define MUS_ME_B_SMALL 390 // Slots Victory!
-#define MUS_ME_ZANNEN 391 // Too bad!
-#define MUS_BD_TIME 392 // Roulette!
-#define MUS_TEST1 393 // Contest Test 1
-#define MUS_TEST2 394 // Contest Test 2
-#define MUS_TEST3 395 // Contest Test 3
-#define MUS_TEST4 396 // Contest Test 4
-#define MUS_TEST 397 // Encounter! Gentleman
-#define MUS_GOMACHI0 398 // Verdanturf Town
-#define MUS_GOTOWN 399 // Rustboro/Mauville/Mossdeep City
-#define MUS_POKECEN 400 // Pokémon Center
-#define MUS_NEXTROAD 401 // Route 104
-#define MUS_GRANROAD 402 // Route 119
-#define MUS_CYCLING 403 // Cycling
-#define MUS_FRIENDLY 404 // Pokémart
-#define MUS_MISHIRO 405 // Littleroot Town
-#define MUS_TOZAN 406 // Sky Pillar
-#define MUS_GIRLEYE 407 // Encounter! Girl
-#define MUS_MINAMO 408 // Lilycove City
-#define MUS_ASHROAD 409 // Route 111
-#define MUS_EVENT0 410 // Help me!
-#define MUS_DEEPDEEP 411 // Underwater
-#define MUS_KACHI1 412 // Victory! Trainer
-#define MUS_TITLE3 413 // Title Screen
-#define MUS_DEMO1 414 // Opening Movie
-#define MUS_GIRL_SUP 415 // Encounter! May
-#define MUS_HAGESHII 416 // Encounter! Biker
-#define MUS_KAKKOII 417 // Encounter! Electric Trainer
-#define MUS_KAZANBAI 418 // Route 113
-#define MUS_AQA_0 419 // Encounter! Team Aqua
-#define MUS_TSURETEK 420 // Follow Me!
-#define MUS_BOY_SUP 421 // Encounter! Brendan
-#define MUS_RAINBOW 422 // Ever Grande City
-#define MUS_AYASII 423 // Encounter! Psychic
-#define MUS_KACHI4 424 // Victory! Aqua/Magma Grunt
-#define MUS_ROPEWAY 425 // Cable Car
-#define MUS_CASINO 426 // Game Corner
-#define MUS_HIGHTOWN 427 // Dewford Town
-#define MUS_SAFARI 428 // Safari Zone
-#define MUS_C_ROAD 429 // Victory Road
-#define MUS_AJITO 430 // Aqua/Magma Hideout
-#define MUS_M_BOAT 431 // Sailing
-#define MUS_M_DUNGON 432 // Mt. Pyre (Inside)
-#define MUS_FINECITY 433 // Slateport City
-#define MUS_MACHUPI 434 // Mt. Pyre (Outside)
-#define MUS_P_SCHOOL 435 // Pokémon Trainer's School
-#define MUS_DENDOU 436 // You're the Champion!
-#define MUS_TONEKUSA 437 // Fallarbor Town
-#define MUS_MABOROSI 438 // Sealed Chamber
-#define MUS_CON_FAN 439 // Obtained a Contest Ribbon!
-#define MUS_CONTEST0 440 // Pokémon Contest
-#define MUS_MGM0 441 // Encounter! Team Magma
-#define MUS_T_BATTLE 442 // Opening Battle
-#define MUS_OOAME 443 // The Flood
-#define MUS_HIDERI 444 // The Drought
-#define MUS_RUNECITY 445 // Sootopolis City
-#define MUS_CON_K 446 // Contest/Berry Blending Results
-#define MUS_EIKOU_R 447 // Hall of Fame
-#define MUS_KARAKURI 448 // Trick House
-#define MUS_HUTAGO 449 // Encounter! Kid
-#define MUS_SITENNOU 450 // Encounter! Elite Four
-#define MUS_YAMA_EYE 451 // Encounter! Hiker
-#define MUS_CONLOBBY 452 // Contest Lobby
-#define MUS_INTER_V 453 // Encounter! Gabby and Ty
-#define MUS_DAIGO 454 // Encounter! Wallace
-#define MUS_THANKFOR 455 // Credits
-#define MUS_END 456 // The End
-#define MUS_B_FRONTIER 457 // Battle Frontier
-#define MUS_B_ARENA 458 // Battle Arena
-#define MUS_ME_POINTGET 459 // Obtained Battle Points!
-#define MUS_ME_TORE_EYE 460 // Registered Trainer!
-#define MUS_PYRAMID 461 // Battle Pyramid
-#define MUS_PYRAMID_TOP 462 // Top of the Battle Pyramid
-#define MUS_B_PALACE 463 // Battle Palace
-#define MUS_REKKUU_KOURIN 464 // Rayquaza Enters
-#define MUS_SATTOWER 465 // Battle Tower (Emerald)
-#define MUS_ME_SYMBOLGET 466 // Obtained a Frontier Symbol!
-#define MUS_B_DOME 467 // Battle Dome
-#define MUS_B_TUBE 468 // Battle Pike
-#define MUS_B_FACTORY 469 // Battle Factory
-#define MUS_VS_REKKU 470 // Battle! Legendary Pokémon
-#define MUS_VS_FRONT 471 // Battle! Frontier Brain
-#define MUS_VS_MEW 472 // Battle! Mew
-#define MUS_B_DOME1 473 // Battle Dome Lobby
-#define MUS_BATTLE27 474 // Battle! Wild Pokémon
-#define MUS_BATTLE31 475 // Battle! Team Aqua/Magma
-#define MUS_BATTLE20 476 // Battle! Trainer
-#define MUS_BATTLE32 477 // Battle! Gym Leader
-#define MUS_BATTLE33 478 // Battle! Champion
-#define MUS_BATTLE36 479 // Battle! Regi Trio
-#define MUS_BATTLE34 480 // Battle! Legendary Pokémon (dupe)
-#define MUS_BATTLE35 481 // Battle! Rival
-#define MUS_BATTLE38 482 // Battle! Elite Four
-#define MUS_BATTLE30 483 // Battle! Archie/Maxie
-// FRLG Music Below
-#define MUS_RG_ANNAI 484 // Follow Me!
-#define MUS_RG_SLOT 485 // Game Corner
-#define MUS_RG_AJITO 486 // Rocket Hideout
-#define MUS_RG_GYM 487 // Gym
-#define MUS_RG_PURIN 488 // Jigglypuff's Song
-#define MUS_RG_DEMO 489 // Opening Movie
-#define MUS_RG_TITLE 490 // Title Screen
-#define MUS_RG_GUREN 491 // Cinnabar Island
-#define MUS_RG_SHION 492 // Lavender Town
-#define MUS_RG_KAIHUKU 493 // RBY Pokémon Center Healing
-#define MUS_RG_CYCLING 494 // Cycling
-#define MUS_RG_ROCKET 495 // Encounter! Team Rocket
-#define MUS_RG_SHOUJO 496 // Encounter! Girl
-#define MUS_RG_SHOUNEN 497 // Encounter! Boy
-#define MUS_RG_DENDOU 498 // You're the Champion!
-#define MUS_RG_T_MORI 499 // Viridian Forest
-#define MUS_RG_OTSUKIMI 500 // Mt. Moon
-#define MUS_RG_POKEYASHI 501 // Pokémon Mansion
-#define MUS_RG_ENDING 502 // Credits
-#define MUS_RG_LOAD01 503 // Route 1
-#define MUS_RG_OPENING 504 // Route 24/Intro
-#define MUS_RG_LOAD02 505 // Route 3
-#define MUS_RG_LOAD03 506 // Route 11
-#define MUS_RG_CHAMP_R 507 // Victory Road/Indigo Plateau
-#define MUS_RG_VS_GYM 508 // Battle! Gym Leader/Elite Four
-#define MUS_RG_VS_TORE 509 // Battle! Trainer
-#define MUS_RG_VS_YASEI 510 // Battle! Wild Pokémon
-#define MUS_RG_VS_LAST 511 // Battle! Champion
-#define MUS_RG_MASARA 512 // Pallet Town
-#define MUS_RG_KENKYU 513 // Professor Oak's Lab
-#define MUS_RG_OHKIDO 514 // Professor Oak's Theme
-#define MUS_RG_POKECEN 515 // Pokémon Center
-#define MUS_RG_SANTOAN 516 // S.S. Anne
-#define MUS_RG_NAMINORI 517 // Surfing
-#define MUS_RG_P_TOWER 518 // Pokémon Tower
-#define MUS_RG_SHIRUHU 519 // Silph Co.
-#define MUS_RG_HANADA 520 // Cerulean/Fuschia City
-#define MUS_RG_TAMAMUSI 521 // Celadon City
-#define MUS_RG_WIN_TRE 522 // Victory! Trainer
-#define MUS_RG_WIN_YASEI 523 // Victory! Wild Pokémon
-#define MUS_RG_WIN_GYM 524 // Victory! Gym Leader
-#define MUS_RG_KUCHIBA 525 // Vermillion City
-#define MUS_RG_NIBI 526 // Viridian/Saffron/Pewter City
-#define MUS_RG_RIVAL1 527 // Encounter! Rival
-#define MUS_RG_RIVAL2 528 // Rival's Exit
-#define MUS_RG_FAN2 529 // Fanfare 2
-#define MUS_RG_FAN5 530 // Obtained a Starter!
-#define MUS_RG_FAN6 531 // Pokémon Caught! (Used in Emerald)
-#define MUS_ME_RG_PHOTO 532 // Trainer Photo
-#define MUS_RG_TITLEROG 533 // Game Freak
-#define MUS_RG_GET_YASEI 534 // Pokémon Caught Victory Theme
-#define MUS_RG_SOUSA 535 // Starting Tutorial
-#define MUS_RG_SEKAIKAN 536 // Starting Tutorial 2
-#define MUS_RG_SEIBETU 537 // Starting Tutorial 3
-#define MUS_RG_JUMP 538 // Pokemon Jump Minigame
-#define MUS_RG_UNION 539 // Union Room
-#define MUS_RG_NETWORK 540 // Network Center
-#define MUS_RG_OKURIMONO 541 // Mystery Gift
-#define MUS_RG_KINOMIKUI 542 // Dodrio Berry Picking
-#define MUS_RG_NANADUNGEON 543 // Sevii Caves/Altering Cave (Mt. Moon)
-#define MUS_RG_OSHIE_TV 544 // Follow Me!
-#define MUS_RG_NANASHIMA 545 // Sevii Islands Routes (Lake of Rage)
-#define MUS_RG_NANAISEKI 546 // Sevii Forests (Viridian Forest)
-#define MUS_RG_NANA123 547 // Sevii Islands 1-3 (Viridian/Saffron/Pewter)
-#define MUS_RG_NANA45 548 // Sevii Islands 4-5 (Azalea Town)
-#define MUS_RG_NANA67 549 // Sevii Islands 6-7 (Violet City)
-#define MUS_RG_POKEFUE 550 // Poké Flute
-#define MUS_RG_VS_DEO 551 // Battle! Deoxys
-#define MUS_RG_VS_MYU2 552 // Battle! Mewtwo
-#define MUS_RG_VS_DEN 553 // Battle! Legendary Birds
-#define MUS_RG_EXEYE 554 // Encounter! Gym Leader
-#define MUS_RG_DEOEYE 555 // Encounter! Deoxys
-#define MUS_RG_T_TOWER 556 // Trainer Tower (Gym)
-#define MUS_RG_SLOWMASARA 557 // Pallet Town (Hall of Fame remix)
-#define MUS_RG_TVNOIZE 558 // Teachy TV
-#define PH_TRAP_BLEND 559
-#define PH_TRAP_HELD 560
-#define PH_TRAP_SOLO 561
-#define PH_FACE_BLEND 562
-#define PH_FACE_HELD 563
-#define PH_FACE_SOLO 564
-#define PH_CLOTH_BLEND 565
-#define PH_CLOTH_HELD 566
-#define PH_CLOTH_SOLO 567
-#define PH_DRESS_BLEND 568
-#define PH_DRESS_HELD 569
-#define PH_DRESS_SOLO 570
-#define PH_FLEECE_BLEND 571
-#define PH_FLEECE_HELD 572
-#define PH_FLEECE_SOLO 573
-#define PH_KIT_BLEND 574
-#define PH_KIT_HELD 575
-#define PH_KIT_SOLO 576
-#define PH_PRICE_BLEND 577
-#define PH_PRICE_HELD 578
-#define PH_PRICE_SOLO 579
-#define PH_LOT_BLEND 580
-#define PH_LOT_HELD 581
-#define PH_LOT_SOLO 582
-#define PH_GOAT_BLEND 583
-#define PH_GOAT_HELD 584
-#define PH_GOAT_SOLO 585
-#define PH_THOUGHT_BLEND 586
-#define PH_THOUGHT_HELD 587
-#define PH_THOUGHT_SOLO 588
-#define PH_CHOICE_BLEND 589
-#define PH_CHOICE_HELD 590
-#define PH_CHOICE_SOLO 591
-#define PH_MOUTH_BLEND 592
-#define PH_MOUTH_HELD 593
-#define PH_MOUTH_SOLO 594
-#define PH_FOOT_BLEND 595
-#define PH_FOOT_HELD 596
-#define PH_FOOT_SOLO 597
-#define PH_GOOSE_BLEND 598
-#define PH_GOOSE_HELD 599
-#define PH_GOOSE_SOLO 600
-#define PH_STRUT_BLEND 601
-#define PH_STRUT_HELD 602
-#define PH_STRUT_SOLO 603
-#define PH_CURE_BLEND 604
-#define PH_CURE_HELD 605
-#define PH_CURE_SOLO 606
-#define PH_NURSE_BLEND 607
-#define PH_NURSE_HELD 608
-#define PH_NURSE_SOLO 609
+#define MUS_DUMMY 0 // MUS_DUMMY
+#define SE_USE_ITEM 1 // SE_KAIFUKU
+#define SE_PC_LOGIN 2 // SE_PC_LOGIN
+#define SE_PC_OFF 3 // SE_PC_OFF
+#define SE_PC_ON 4 // SE_PC_ON
+#define SE_SELECT 5 // SE_SELECT
+#define SE_WIN_OPEN 6 // SE_WIN_OPEN
+#define SE_WALL_HIT 7 // SE_WALL_HIT
+#define SE_DOOR 8 // SE_DOOR
+#define SE_EXIT 9 // SE_KAIDAN
+#define SE_LEDGE 10 // SE_DANSA
+#define SE_BIKE_BELL 11 // SE_JITENSYA
+#define SE_NOT_EFFECTIVE 12 // SE_KOUKA_L
+#define SE_EFFECTIVE 13 // SE_KOUKA_M
+#define SE_SUPER_EFFECTIVE 14 // SE_KOUKA_H
+#define SE_BALL_OPEN 15 // SE_BOWA2
+#define SE_FAINT 16 // SE_POKE_DEAD
+#define SE_FLEE 17 // SE_NIGERU
+#define SE_SLIDING_DOOR 18 // SE_JIDO_DOA
+#define SE_SHIP 19 // SE_NAMINORI
+#define SE_BANG 20 // SE_BAN
+#define SE_PIN 21 // SE_PIN (General "good", commonly for "!")
+#define SE_BOO 22 // SE_BOO (General "bad")
+#define SE_BALL 23 // SE_BOWA (Giving Poké Ball to nurse, Poké Ball shake, etc)
+#define SE_CONTEST_PLACE 24 // SE_JYUNI
+#define SE_A 25 // SE_A (Bard sounds)
+#define SE_I 26 // SE_I
+#define SE_U 27 // SE_U
+#define SE_E 28 // SE_E
+#define SE_O 29 // SE_O
+#define SE_N 30 // SE_N
+#define SE_SUCCESS 31 // SE_SEIKAI
+#define SE_FAILURE 32 // SE_HAZURE
+#define SE_EXP 33 // SE_EXP
+#define SE_BIKE_HOP 34 // SE_JITE_PYOKO
+#define SE_SWITCH 35 // SE_MU_PACHI
+#define SE_CLICK 36 // SE_TK_KASYA
+#define SE_FU_ZAKU 37 // SE_FU_ZAKU (Unknown purpose, unused)
+#define SE_CONTEST_CONDITION_LOSE 38 // SE_FU_ZAKU2
+#define SE_LAVARIDGE_FALL_WARP 39 // SE_FU_ZUZUZU
+#define SE_ICE_STAIRS 40 // SE_RU_GASHIN
+#define SE_ICE_BREAK 41 // SE_RU_GASYAN
+#define SE_ICE_CRACK 42 // SE_RU_BARI
+#define SE_FALL 43 // SE_RU_HYUU
+#define SE_UNLOCK 44 // SE_KI_GASYAN
+#define SE_WARP_IN 45 // SE_TK_WARPIN
+#define SE_WARP_OUT 46 // SE_TK_WARPOUT
+#define SE_REPEL 47 // SE_TU_SAA
+#define SE_ROTATING_GATE 48 // SE_HI_TURUN
+#define SE_TRUCK_MOVE 49 // SE_TRACK_MOVE
+#define SE_TRUCK_STOP 50 // SE_TRACK_STOP
+#define SE_TRUCK_UNLOAD 51 // SE_TRACK_HAIKI
+#define SE_TRUCK_DOOR 52 // SE_TRACK_DOOR
+#define SE_BERRY_BLENDER 53 // SE_MOTER
+#define SE_CARD 54 // SE_CARD (Unused, different from the RS card SE)
+#define SE_SAVE 55 // SE_SAVE
+#define SE_BALL_BOUNCE_1 56 // SE_KON
+#define SE_BALL_BOUNCE_2 57 // SE_KON2
+#define SE_BALL_BOUNCE_3 58 // SE_KON3
+#define SE_BALL_BOUNCE_4 59 // SE_KON4
+#define SE_BALL_TRADE 60 // SE_SUIKOMU
+#define SE_BALL_THROW 61 // SE_NAGERU
+#define SE_NOTE_C 62 // SE_TOY_C
+#define SE_NOTE_D 63 // SE_TOY_D
+#define SE_NOTE_E 64 // SE_TOY_E
+#define SE_NOTE_F 65 // SE_TOY_F
+#define SE_NOTE_G 66 // SE_TOY_G
+#define SE_NOTE_A 67 // SE_TOY_A
+#define SE_NOTE_B 68 // SE_TOY_B
+#define SE_NOTE_C_HIGH 69 // SE_TOY_C1
+#define SE_PUDDLE 70 // SE_MIZU
+#define SE_BRIDGE_WALK 71 // SE_HASHI
+#define SE_ITEMFINDER 72 // SE_DAUGI
+#define SE_DING_DONG 73 // SE_PINPON
+#define SE_BALLOON_RED 74 // SE_FUUSEN1
+#define SE_BALLOON_BLUE 75 // SE_FUUSEN2
+#define SE_BALLOON_YELLOW 76 // SE_FUUSEN3
+#define SE_BREAKABLE_DOOR 77 // SE_TOY_KABE
+#define SE_MUD_BALL 78 // SE_TOY_DANGO
+#define SE_FIELD_POISON 79 // SE_DOKU
+#define SE_ESCALATOR 80 // SE_ESUKA
+#define SE_THUNDERSTORM 81 // SE_T_AME
+#define SE_THUNDERSTORM_STOP 82 // SE_T_AME_E
+#define SE_DOWNPOUR 83 // SE_T_OOAME
+#define SE_DOWNPOUR_STOP 84 // SE_T_OOAME_E
+#define SE_RAIN 85 // SE_T_KOAME
+#define SE_RAIN_STOP 86 // SE_T_KOAME_E
+#define SE_THUNDER 87 // SE_T_KAMI
+#define SE_THUNDER2 88 // SE_T_KAMI2
+#define SE_ELEVATOR 89 // SE_ELEBETA
+#define SE_LOW_HEALTH 90 // SE_HINSI
+#define SE_EXP_MAX 91 // SE_EXPMAX
+#define SE_ROULETTE_BALL 92 // SE_TAMAKORO
+#define SE_ROULETTE_BALL2 93 // SE_TAMAKORO_E
+#define SE_TAILLOW_WING_FLAP 94 // SE_BASABASA
+#define SE_SHOP 95 // SE_REGI
+#define SE_CONTEST_HEART 96 // SE_C_GAJI
+#define SE_CONTEST_CURTAIN_RISE 97 // SE_C_MAKU_U
+#define SE_CONTEST_CURTAIN_FALL 98 // SE_C_MAKU_D
+#define SE_CONTEST_ICON_CHANGE 99 // SE_C_PASI
+#define SE_CONTEST_ICON_CLEAR 100 // SE_C_SYU
+#define SE_CONTEST_MONS_TURN 101 // SE_C_PIKON
+#define SE_SHINY 102 // SE_REAPOKE
+#define SE_INTRO_BLAST 103 // SE_OP_BASYU
+#define SE_MUGSHOT 104 // SE_BT_START
+#define SE_APPLAUSE 105 // SE_DENDOU
+#define SE_VEND 106 // SE_JIHANKI
+#define SE_ORB 107 // SE_TAMA
+#define SE_DEX_SCROLL 108 // SE_Z_SCROLL
+#define SE_DEX_PAGE 109 // SE_Z_PAGE
+#define SE_POKENAV_ON 110 // SE_PN_ON
+#define SE_POKENAV_OFF 111 // SE_PN_OFF
+#define SE_DEX_SEARCH 112 // SE_Z_SEARCH
+#define SE_EGG_HATCH 113 // SE_TAMAGO
+#define SE_BALL_TRAY_ENTER 114 // SE_TB_START
+#define SE_BALL_TRAY_BALL 115 // SE_TB_KON
+#define SE_BALL_TRAY_EXIT 116 // SE_TB_KARA
+#define SE_GLASS_FLUTE 117 // SE_BIDORO
+// Move SFX
+#define SE_M_THUNDERBOLT 118 // SE_W085
+#define SE_M_THUNDERBOLT2 119 // SE_W085B
+#define SE_M_HARDEN 120 // SE_W231
+#define SE_M_NIGHTMARE 121 // SE_W171
+#define SE_M_VITAL_THROW 122 // SE_W233
+#define SE_M_VITAL_THROW2 123 // SE_W233B
+#define SE_M_BUBBLE 124 // SE_W145
+#define SE_M_BUBBLE2 125 // SE_W145B
+#define SE_M_BUBBLE3 126 // SE_W145C
+#define SE_M_RAIN_DANCE 127 // SE_W240
+#define SE_M_CUT 128 // SE_W015
+#define SE_M_STRING_SHOT 129 // SE_W081
+#define SE_M_STRING_SHOT2 130 // SE_W081B
+#define SE_M_ROCK_THROW 131 // SE_W088
+#define SE_M_GUST 132 // SE_W016
+#define SE_M_GUST2 133 // SE_W016B
+#define SE_M_DOUBLE_SLAP 134 // SE_W003
+#define SE_M_DOUBLE_TEAM 135 // SE_W104
+#define SE_M_RAZOR_WIND 136 // SE_W013
+#define SE_M_ICY_WIND 137 // SE_W196
+#define SE_M_THUNDER_WAVE 138 // SE_W086
+#define SE_M_COMET_PUNCH 139 // SE_W004
+#define SE_M_MEGA_KICK 140 // SE_W025
+#define SE_M_MEGA_KICK2 141 // SE_W025B
+#define SE_M_CRABHAMMER 142 // SE_W152
+#define SE_M_JUMP_KICK 143 // SE_W026
+#define SE_M_FLAME_WHEEL 144 // SE_W172
+#define SE_M_FLAME_WHEEL2 145 // SE_W172B
+#define SE_M_FLAMETHROWER 146 // SE_W053
+#define SE_M_FIRE_PUNCH 147 // SE_W007
+#define SE_M_TOXIC 148 // SE_W092
+#define SE_M_SACRED_FIRE 149 // SE_W221
+#define SE_M_SACRED_FIRE2 150 // SE_W221B
+#define SE_M_EMBER 151 // SE_W052
+#define SE_M_TAKE_DOWN 152 // SE_W036
+#define SE_M_BLIZZARD 153 // SE_W059
+#define SE_M_BLIZZARD2 154 // SE_W059B
+#define SE_M_SCRATCH 155 // SE_W010
+#define SE_M_VICEGRIP 156 // SE_W011
+#define SE_M_WING_ATTACK 157 // SE_W017
+#define SE_M_FLY 158 // SE_W019
+#define SE_M_SAND_ATTACK 159 // SE_W028
+#define SE_M_RAZOR_WIND2 160 // SE_W013B
+#define SE_M_BITE 161 // SE_W044
+#define SE_M_HEADBUTT 162 // SE_W029
+#define SE_M_SURF 163 // SE_W057
+#define SE_M_HYDRO_PUMP 164 // SE_W056
+#define SE_M_WHIRLPOOL 165 // SE_W250
+#define SE_M_HORN_ATTACK 166 // SE_W030
+#define SE_M_TAIL_WHIP 167 // SE_W039
+#define SE_M_MIST 168 // SE_W054
+#define SE_M_POISON_POWDER 169 // SE_W077
+#define SE_M_BIND 170 // SE_W020
+#define SE_M_DRAGON_RAGE 171 // SE_W082
+#define SE_M_SING 172 // SE_W047
+#define SE_M_PERISH_SONG 173 // SE_W195
+#define SE_M_PAY_DAY 174 // SE_W006
+#define SE_M_DIG 175 // SE_W091
+#define SE_M_DIZZY_PUNCH 176 // SE_W146
+#define SE_M_SELF_DESTRUCT 177 // SE_W120
+#define SE_M_EXPLOSION 178 // SE_W153
+#define SE_M_ABSORB_2 179 // SE_W071B
+#define SE_M_ABSORB 180 // SE_W071
+#define SE_M_SCREECH 181 // SE_W103
+#define SE_M_BUBBLE_BEAM 182 // SE_W062
+#define SE_M_BUBBLE_BEAM2 183 // SE_W062B
+#define SE_M_SUPERSONIC 184 // SE_W048
+#define SE_M_BELLY_DRUM 185 // SE_W187
+#define SE_M_METRONOME 186 // SE_W118
+#define SE_M_BONEMERANG 187 // SE_W155
+#define SE_M_LICK 188 // SE_W122
+#define SE_M_PSYBEAM 189 // SE_W060
+#define SE_M_FAINT_ATTACK 190 // SE_W185
+#define SE_M_SWORDS_DANCE 191 // SE_W014
+#define SE_M_LEER 192 // SE_W043
+#define SE_M_SWAGGER 193 // SE_W207
+#define SE_M_SWAGGER2 194 // SE_W207B
+#define SE_M_HEAL_BELL 195 // SE_W215
+#define SE_M_CONFUSE_RAY 196 // SE_W109
+#define SE_M_SNORE 197 // SE_W173
+#define SE_M_BRICK_BREAK 198 // SE_W280
+#define SE_M_GIGA_DRAIN 199 // SE_W202
+#define SE_M_PSYBEAM2 200 // SE_W060B
+#define SE_M_SOLAR_BEAM 201 // SE_W076
+#define SE_M_PETAL_DANCE 202 // SE_W080
+#define SE_M_TELEPORT 203 // SE_W100
+#define SE_M_MINIMIZE 204 // SE_W107
+#define SE_M_SKETCH 205 // SE_W166
+#define SE_M_SWIFT 206 // SE_W129
+#define SE_M_REFLECT 207 // SE_W115
+#define SE_M_BARRIER 208 // SE_W112
+#define SE_M_DETECT 209 // SE_W197
+#define SE_M_LOCK_ON 210 // SE_W199
+#define SE_M_MOONLIGHT 211 // SE_W236
+#define SE_M_CHARM 212 // SE_W204
+#define SE_M_CHARGE 213 // SE_W268
+#define SE_M_STRENGTH 214 // SE_W070
+#define SE_M_HYPER_BEAM 215 // SE_W063
+#define SE_M_WATERFALL 216 // SE_W127
+#define SE_M_REVERSAL 217 // SE_W179
+#define SE_M_ACID_ARMOR 218 // SE_W151
+#define SE_M_SANDSTORM 219 // SE_W201
+#define SE_M_TRI_ATTACK 220 // SE_W161
+#define SE_M_TRI_ATTACK2 221 // SE_W161B
+#define SE_M_ENCORE 222 // SE_W227
+#define SE_M_ENCORE2 223 // SE_W227B
+#define SE_M_BATON_PASS 224 // SE_W226
+#define SE_M_MILK_DRINK 225 // SE_W208
+#define SE_M_ATTRACT 226 // SE_W213
+#define SE_M_ATTRACT2 227 // SE_W213B
+#define SE_M_MORNING_SUN 228 // SE_W234
+#define SE_M_FLATTER 229 // SE_W260
+#define SE_M_SAND_TOMB 230 // SE_W328
+#define SE_M_GRASSWHISTLE 231 // SE_W320
+#define SE_M_SPIT_UP 232 // SE_W255
+#define SE_M_DIVE 233 // SE_W291
+#define SE_M_EARTHQUAKE 234 // SE_W089
+#define SE_M_TWISTER 235 // SE_W239
+#define SE_M_SWEET_SCENT 236 // SE_W230
+#define SE_M_YAWN 237 // SE_W281
+#define SE_M_SKY_UPPERCUT 238 // SE_W327
+#define SE_M_STAT_INCREASE 239 // SE_W287
+#define SE_M_HEAT_WAVE 240 // SE_W257
+#define SE_M_UPROAR 241 // SE_W253
+#define SE_M_HAIL 242 // SE_W258
+#define SE_M_COSMIC_POWER 243 // SE_W322
+#define SE_M_TEETER_DANCE 244 // SE_W298
+#define SE_M_STAT_DECREASE 245 // SE_W287B
+#define SE_M_HAZE 246 // SE_W114
+#define SE_M_HYPER_BEAM2 247 // SE_W063B
+// FRLG SFX
+#define SE_RG_DOOR 248 // SE_RG_W_DOOR
+#define SE_RG_CARD_FLIP 249 // SE_RG_CARD1
+#define SE_RG_CARD_FLIPPING 250 // SE_RG_CARD2
+#define SE_RG_CARD_OPEN 251 // SE_RG_CARD3
+#define SE_RG_BAG_CURSOR 252 // SE_RG_BAG1
+#define SE_RG_BAG_POCKET 253 // SE_RG_BAG2
+#define SE_RG_BALL_CLICK 254 // SE_RG_GETTING
+#define SE_RG_SHOP 255 // SE_RG_SHOP
+#define SE_RG_SS_ANNE_HORN 256 // SE_RG_KITEKI
+#define SE_RG_HELP_OPEN 257 // SE_RG_HELP_OP
+#define SE_RG_HELP_CLOSE 258 // SE_RG_HELP_CL
+#define SE_RG_HELP_ERROR 259 // SE_RG_HELP_NG
+#define SE_RG_DEOXYS_MOVE 260 // SE_RG_DEOMOV
+#define SE_RG_POKE_JUMP_SUCCESS 261 // SE_RG_EXCELLENT
+#define SE_RG_POKE_JUMP_FAILURE 262 // SE_RG_NAWAMISS
+// New Emerald SFX
+#define SE_POKENAV_CALL 263 // SE_TOREEYE
+#define SE_POKENAV_HANG_UP 264 // SE_TOREOFF
+#define SE_ARENA_TIMEUP1 265 // SE_HANTEI1
+#define SE_ARENA_TIMEUP2 266 // SE_HANTEI2
+#define SE_PIKE_CURTAIN_CLOSE 267 // SE_CURTAIN
+#define SE_PIKE_CURTAIN_OPEN 268 // SE_CURTAIN1
+#define SE_SUDOWOODO_SHAKE 269 // SE_USSOKI
-#define MUS_ROUTE_118 0x7FFF // map is split into 2 music sections. controlled by GetCurrLocationDefaultMusic().
+// Music
+#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI
+#define MUS_GSC_ROUTE38 351 // MUS_FIELD13
+#define MUS_CAUGHT 352 // MUS_KACHI22
+#define MUS_VICTORY_WILD 353 // MUS_KACHI2
+#define MUS_VICTORY_GYM_LEADER 354 // MUS_KACHI3
+#define MUS_VICTORY_LEAGUE 355 // MUS_KACHI5
+#define MUS_C_COMM_CENTER 356 // MUS_PCC
+#define MUS_GSC_PEWTER 357 // MUS_NIBI
+#define MUS_C_VS_LEGEND_BEAST 358 // MUS_SUIKUN
+#define MUS_ROUTE101 359 // MUS_DOORO1
+#define MUS_ROUTE110 360 // MUS_DOORO_X1
+#define MUS_ROUTE120 361 // MUS_DOORO_X3
+#define MUS_PETALBURG 362 // MUS_MACHI_S2
+#define MUS_OLDALE 363 // MUS_MACHI_S4
+#define MUS_GYM 364 // MUS_GIM
+#define MUS_SURF 365 // MUS_NAMINORI
+#define MUS_PETALBURG_WOODS 366 // MUS_DAN01
+#define MUS_LEVEL_UP 367 // MUS_FANFA1
+#define MUS_HEAL 368 // MUS_ME_ASA
+#define MUS_OBTAIN_BADGE 369 // MUS_ME_BACHI
+#define MUS_OBTAIN_ITEM 370 // MUS_FANFA4
+#define MUS_EVOLVED 371 // MUS_FANFA5
+#define MUS_OBTAIN_TMHM 372 // MUS_ME_WAZA
+#define MUS_LILYCOVE_MUSEUM 373 // MUS_BIJYUTU
+#define MUS_ROUTE122 374 // MUS_DOORO_X4
+#define MUS_OCEANIC_MUSEUM 375 // MUS_FUNE_KAN
+#define MUS_EVOLUTION_INTRO 376 // MUS_ME_SHINKA
+#define MUS_EVOLUTION 377 // MUS_SHINKA
+#define MUS_MOVE_DELETED 378 // MUS_ME_WASURE
+#define MUS_ENCOUNTER_GIRL 379 // MUS_SYOUJOEYE
+#define MUS_ENCOUNTER_MALE 380 // MUS_BOYEYE
+#define MUS_ABANDONED_SHIP 381 // MUS_DAN02
+#define MUS_FORTREE 382 // MUS_MACHI_S3
+#define MUS_BIRCH_LAB 383 // MUS_ODAMAKI
+#define MUS_B_TOWER_RS 384 // MUS_B_TOWER
+#define MUS_ENCOUNTER_SWIMMER 385 // MUS_SWIMEYE
+#define MUS_CAVE_OF_ORIGIN 386 // MUS_DAN03
+#define MUS_OBTAIN_BERRY 387 // MUS_ME_KINOMI
+#define MUS_AWAKEN_LEGEND 388 // MUS_ME_TAMA
+#define MUS_SLOTS_JACKPOT 389 // MUS_ME_B_BIG
+#define MUS_SLOTS_WIN 390 // MUS_ME_B_SMALL
+#define MUS_TOO_BAD 391 // MUS_ME_ZANNEN
+#define MUS_ROULETTE 392 // MUS_BD_TIME
+#define MUS_LINK_CONTEST_P1 393 // MUS_TEST1
+#define MUS_LINK_CONTEST_P2 394 // MUS_TEST2
+#define MUS_LINK_CONTEST_P3 395 // MUS_TEST3
+#define MUS_LINK_CONTEST_P4 396 // MUS_TEST4
+#define MUS_ENCOUNTER_RICH 397 // MUS_TEST
+#define MUS_VERDANTURF 398 // MUS_GOMACHI0
+#define MUS_RUSTBORO 399 // MUS_GOTOWN
+#define MUS_POKE_CENTER 400 // MUS_POKECEN
+#define MUS_ROUTE104 401 // MUS_NEXTROAD
+#define MUS_ROUTE119 402 // MUS_GRANROAD
+#define MUS_CYCLING 403 // MUS_CYCLING
+#define MUS_POKE_MART 404 // MUS_FRIENDLY
+#define MUS_LITTLEROOT 405 // MUS_MISHIRO
+#define MUS_MT_CHIMNEY 406 // MUS_TOZAN
+#define MUS_ENCOUNTER_FEMALE 407 // MUS_GIRLEYE
+#define MUS_LILYCOVE 408 // MUS_MINAMO
+#define MUS_ROUTE111 409 // MUS_ASHROAD
+#define MUS_HELP 410 // MUS_EVENT0
+#define MUS_UNDERWATER 411 // MUS_DEEPDEEP
+#define MUS_VICTORY_TRAINER 412 // MUS_KACHI1
+#define MUS_TITLE 413 // MUS_TITLE3
+#define MUS_INTRO 414 // MUS_DEMO1
+#define MUS_ENCOUNTER_MAY 415 // MUS_GIRL_SUP
+#define MUS_ENCOUNTER_INTENSE 416 // MUS_HAGESHII
+#define MUS_ENCOUNTER_COOL 417 // MUS_KAKKOII
+#define MUS_ROUTE113 418 // MUS_KAZANBAI
+#define MUS_ENCOUNTER_AQUA 419 // MUS_AQA_0
+#define MUS_FOLLOW_ME 420 // MUS_TSURETEK
+#define MUS_ENCOUNTER_BRENDAN 421 // MUS_BOY_SUP
+#define MUS_EVER_GRANDE 422 // MUS_RAINBOW
+#define MUS_ENCOUNTER_SUSPICIOUS 423 // MUS_AYASII
+#define MUS_VICTORY_AQUA_MAGMA 424 // MUS_KACHI4
+#define MUS_CABLE_CAR 425 // MUS_ROPEWAY
+#define MUS_GAME_CORNER 426 // MUS_CASINO
+#define MUS_DEWFORD 427 // MUS_HIGHTOWN
+#define MUS_SAFARI_ZONE 428 // MUS_SAFARI
+#define MUS_VICTORY_ROAD 429 // MUS_C_ROAD
+#define MUS_AQUA_MAGMA_HIDEOUT 430 // MUS_AJITO
+#define MUS_SAILING 431 // MUS_M_BOAT
+#define MUS_MT_PYRE 432 // MUS_M_DUNGON
+#define MUS_SLATEPORT 433 // MUS_FINECITY
+#define MUS_MT_PYRE_EXTERIOR 434 // MUS_MACHUPI
+#define MUS_SCHOOL 435 // MUS_P_SCHOOL
+#define MUS_HALL_OF_FAME 436 // MUS_DENDOU
+#define MUS_FALLARBOR 437 // MUS_TONEKUSA
+#define MUS_SEALED_CHAMBER 438 // MUS_MABOROSI
+#define MUS_CONTEST_WINNER 439 // MUS_CON_FAN
+#define MUS_CONTEST 440 // MUS_CONTEST0
+#define MUS_ENCOUNTER_MAGMA 441 // MUS_MGM0
+#define MUS_INTRO_BATTLE 442 // MUS_T_BATTLE
+#define MUS_ABNORMAL_WEATHER 443 // MUS_OOAME (Replaces MUS_WEATHER_KYOGRE from R/S)
+#define MUS_WEATHER_GROUDON 444 // MUS_HIDERI (Unused, from R/S)
+#define MUS_SOOTOPOLIS 445 // MUS_RUNECITY
+#define MUS_CONTEST_RESULTS 446 // MUS_CON_K
+#define MUS_HALL_OF_FAME_ROOM 447 // MUS_EIKOU_R
+#define MUS_TRICK_HOUSE 448 // MUS_KARAKURI
+#define MUS_ENCOUNTER_TWINS 449 // MUS_HUTAGO
+#define MUS_ENCOUNTER_ELITE_FOUR 450 // MUS_SITENNOU
+#define MUS_ENCOUNTER_HIKER 451 // MUS_YAMA_EYE
+#define MUS_CONTEST_LOBBY 452 // MUS_CONLOBBY
+#define MUS_ENCOUNTER_INTERVIEWER 453 // MUS_INTER_V
+#define MUS_ENCOUNTER_CHAMPION 454 // MUS_DAIGO
+#define MUS_CREDITS 455 // MUS_THANKFOR
+#define MUS_END 456 // MUS_END
+#define MUS_B_FRONTIER 457 // MUS_B_FRONTIER
+#define MUS_B_ARENA 458 // MUS_B_ARENA
+#define MUS_OBTAIN_B_POINTS 459 // MUS_ME_POINTGET
+#define MUS_REGISTER_MATCH_CALL 460 // MUS_ME_TORE_EYE
+#define MUS_B_PYRAMID 461 // MUS_PYRAMID
+#define MUS_B_PYRAMID_TOP 462 // MUS_PYRAMID_TOP
+#define MUS_B_PALACE 463 // MUS_B_PALACE
+#define MUS_RAYQUAZA_APPEARS 464 // MUS_REKKUU_KOURIN
+#define MUS_B_TOWER 465 // MUS_SATTOWER
+#define MUS_OBTAIN_SYMBOL 466 // MUS_ME_SYMBOLGET
+#define MUS_B_DOME 467 // MUS_B_DOME
+#define MUS_B_PIKE 468 // MUS_B_TUBE
+#define MUS_B_FACTORY 469 // MUS_B_FACTORY
+#define MUS_VS_RAYQUAZA 470 // MUS_VS_REKKU (Identical to MUS_VS_KYOGRE_GROUDON)
+#define MUS_VS_FRONTIER_BRAIN 471 // MUS_VS_FRONT
+#define MUS_VS_MEW 472 // MUS_VS_MEW
+#define MUS_B_DOME_LOBBY 473 // MUS_B_DOME1
+#define MUS_VS_WILD 474 // MUS_BATTLE27
+#define MUS_VS_AQUA_MAGMA 475 // MUS_BATTLE31
+#define MUS_VS_TRAINER 476 // MUS_BATTLE20
+#define MUS_VS_GYM_LEADER 477 // MUS_BATTLE32
+#define MUS_VS_CHAMPION 478 // MUS_BATTLE33
+#define MUS_VS_REGI 479 // MUS_BATTLE36
+#define MUS_VS_KYOGRE_GROUDON 480 // MUS_BATTLE34
+#define MUS_VS_RIVAL 481 // MUS_BATTLE35
+#define MUS_VS_ELITE_FOUR 482 // MUS_BATTLE38
+#define MUS_VS_AQUA_MAGMA_LEADER 483 // MUS_BATTLE30
+// FRLG Music
+#define MUS_RG_FOLLOW_ME 484 // MUS_RG_ANNAI
+#define MUS_RG_GAME_CORNER 485 // MUS_RG_SLOT
+#define MUS_RG_ROCKET_HIDEOUT 486 // MUS_RG_AJITO
+#define MUS_RG_GYM 487 // MUS_RG_GYM
+#define MUS_RG_JIGGLYPUFF 488 // MUS_RG_PURIN
+#define MUS_RG_INTRO_FIGHT 489 // MUS_RG_DEMO
+#define MUS_RG_TITLE 490 // MUS_RG_TITLE
+#define MUS_RG_CINNABAR 491 // MUS_RG_GUREN
+#define MUS_RG_LAVENDER 492 // MUS_RG_SHION
+#define MUS_RG_HEAL 493 // MUS_RG_KAIHUKU
+#define MUS_RG_CYCLING 494 // MUS_RG_CYCLING
+#define MUS_RG_ENCOUNTER_ROCKET 495 // MUS_RG_ROCKET
+#define MUS_RG_ENCOUNTER_GIRL 496 // MUS_RG_SHOUJO
+#define MUS_RG_ENCOUNTER_BOY 497 // MUS_RG_SHOUNEN
+#define MUS_RG_HALL_OF_FAME 498 // MUS_RG_DENDOU
+#define MUS_RG_VIRIDIAN_FOREST 499 // MUS_RG_T_MORI
+#define MUS_RG_MT_MOON 500 // MUS_RG_OTSUKIMI
+#define MUS_RG_POKE_MANSION 501 // MUS_RG_POKEYASHI
+#define MUS_RG_CREDITS 502 // MUS_RG_ENDING
+#define MUS_RG_ROUTE1 503 // MUS_RG_LOAD01
+#define MUS_RG_ROUTE24 504 // MUS_RG_OPENING
+#define MUS_RG_ROUTE3 505 // MUS_RG_LOAD02
+#define MUS_RG_ROUTE11 506 // MUS_RG_LOAD03
+#define MUS_RG_VICTORY_ROAD 507 // MUS_RG_CHAMP_R
+#define MUS_RG_VS_GYM_LEADER 508 // MUS_RG_VS_GYM
+#define MUS_RG_VS_TRAINER 509 // MUS_RG_VS_TORE
+#define MUS_RG_VS_WILD 510 // MUS_RG_VS_YASEI
+#define MUS_RG_VS_CHAMPION 511 // MUS_RG_VS_LAST
+#define MUS_RG_PALLET 512 // MUS_RG_MASARA
+#define MUS_RG_OAK_LAB 513 // MUS_RG_KENKYU
+#define MUS_RG_OAK 514 // MUS_RG_OHKIDO
+#define MUS_RG_POKE_CENTER 515 // MUS_RG_POKECEN
+#define MUS_RG_SS_ANNE 516 // MUS_RG_SANTOAN
+#define MUS_RG_SURF 517 // MUS_RG_NAMINORI
+#define MUS_RG_POKE_TOWER 518 // MUS_RG_P_TOWER
+#define MUS_RG_SILPH 519 // MUS_RG_SHIRUHU
+#define MUS_RG_FUCHSIA 520 // MUS_RG_HANADA
+#define MUS_RG_CELADON 521 // MUS_RG_TAMAMUSI
+#define MUS_RG_VICTORY_TRAINER 522 // MUS_RG_WIN_TRE (Identical to MUS_VICTORY_TRAINER)
+#define MUS_RG_VICTORY_WILD 523 // MUS_RG_WIN_YASEI (Identical to MUS_VICTORY_WILD)
+#define MUS_RG_VICTORY_GYM_LEADER 524 // MUS_RG_WIN_GYM (Identical to MUS_VICTORY_GYM_LEADER)
+#define MUS_RG_VERMILLION 525 // MUS_RG_KUCHIBA
+#define MUS_RG_PEWTER 526 // MUS_RG_NIBI
+#define MUS_RG_ENCOUNTER_RIVAL 527 // MUS_RG_RIVAL1
+#define MUS_RG_RIVAL_EXIT 528 // MUS_RG_RIVAL2
+#define MUS_RG_DEX_RATING 529 // MUS_RG_FAN2
+#define MUS_RG_OBTAIN_KEY_ITEM 530 // MUS_RG_FAN5
+#define MUS_RG_CAUGHT_INTRO 531 // MUS_RG_FAN6
+#define MUS_RG_PHOTO 532 // MUS_ME_RG_PHOTO
+#define MUS_RG_GAME_FREAK 533 // MUS_RG_TITLEROG
+#define MUS_RG_CAUGHT 534 // MUS_RG_GET_YASEI
+#define MUS_RG_NEW_GAME_INSTRUCT 535 // MUS_RG_SOUSA
+#define MUS_RG_NEW_GAME_INTRO 536 // MUS_RG_SEKAIKAN
+#define MUS_RG_NEW_GAME_EXIT 537 // MUS_RG_SEIBETU
+#define MUS_RG_POKE_JUMP 538 // MUS_RG_JUMP
+#define MUS_RG_UNION_ROOM 539 // MUS_RG_UNION
+#define MUS_RG_NET_CENTER 540 // MUS_RG_NETWORK
+#define MUS_RG_MYSTERY_GIFT 541 // MUS_RG_OKURIMONO
+#define MUS_RG_BERRY_PICK 542 // MUS_RG_KINOMIKUI
+#define MUS_RG_SEVII_CAVE 543 // MUS_RG_NANADUNGEON (Identical to MUS_RG_MT_MOON)
+#define MUS_RG_TEACHY_TV_SHOW 544 // MUS_RG_OSHIE_TV (Identical to MUS_RG_FOLLOW_ME)
+#define MUS_RG_SEVII_ROUTE 545 // MUS_RG_NANASHIMA
+#define MUS_RG_SEVII_DUNGEON 546 // MUS_RG_NANAISEKI (Identical to MUS_RG_VIRIDIAN_FOREST)
+#define MUS_RG_SEVII_123 547 // MUS_RG_NANA123 (Identical to MUS_RG_PEWTER)
+#define MUS_RG_SEVII_45 548 // MUS_RG_NANA45
+#define MUS_RG_SEVII_67 549 // MUS_RG_NANA67
+#define MUS_RG_POKE_FLUTE 550 // MUS_RG_POKEFUE
+#define MUS_RG_VS_DEOXYS 551 // MUS_RG_VS_DEO
+#define MUS_RG_VS_MEWTWO 552 // MUS_RG_VS_MYU2
+#define MUS_RG_VS_LEGEND 553 // MUS_RG_VS_DEN
+#define MUS_RG_ENCOUNTER_GYM_LEADER 554 // MUS_RG_EXEYE
+#define MUS_RG_ENCOUNTER_DEOXYS 555 // MUS_RG_DEOEYE
+#define MUS_RG_TRAINER_TOWER 556 // MUS_RG_T_TOWER
+#define MUS_RG_SLOW_PALLET 557 // MUS_RG_SLOWMASARA
+#define MUS_RG_TEACHY_TV_MENU 558 // MUS_RG_TVNOIZE
-#define MUS_NONE 0xFFFF
+#define PH_TRAP_BLEND 559
+#define PH_TRAP_HELD 560
+#define PH_TRAP_SOLO 561
+#define PH_FACE_BLEND 562
+#define PH_FACE_HELD 563
+#define PH_FACE_SOLO 564
+#define PH_CLOTH_BLEND 565
+#define PH_CLOTH_HELD 566
+#define PH_CLOTH_SOLO 567
+#define PH_DRESS_BLEND 568
+#define PH_DRESS_HELD 569
+#define PH_DRESS_SOLO 570
+#define PH_FLEECE_BLEND 571
+#define PH_FLEECE_HELD 572
+#define PH_FLEECE_SOLO 573
+#define PH_KIT_BLEND 574
+#define PH_KIT_HELD 575
+#define PH_KIT_SOLO 576
+#define PH_PRICE_BLEND 577
+#define PH_PRICE_HELD 578
+#define PH_PRICE_SOLO 579
+#define PH_LOT_BLEND 580
+#define PH_LOT_HELD 581
+#define PH_LOT_SOLO 582
+#define PH_GOAT_BLEND 583
+#define PH_GOAT_HELD 584
+#define PH_GOAT_SOLO 585
+#define PH_THOUGHT_BLEND 586
+#define PH_THOUGHT_HELD 587
+#define PH_THOUGHT_SOLO 588
+#define PH_CHOICE_BLEND 589
+#define PH_CHOICE_HELD 590
+#define PH_CHOICE_SOLO 591
+#define PH_MOUTH_BLEND 592
+#define PH_MOUTH_HELD 593
+#define PH_MOUTH_SOLO 594
+#define PH_FOOT_BLEND 595
+#define PH_FOOT_HELD 596
+#define PH_FOOT_SOLO 597
+#define PH_GOOSE_BLEND 598
+#define PH_GOOSE_HELD 599
+#define PH_GOOSE_SOLO 600
+#define PH_STRUT_BLEND 601
+#define PH_STRUT_HELD 602
+#define PH_STRUT_SOLO 603
+#define PH_CURE_BLEND 604
+#define PH_CURE_HELD 605
+#define PH_CURE_SOLO 606
+#define PH_NURSE_BLEND 607
+#define PH_NURSE_HELD 608
+#define PH_NURSE_SOLO 609
+
+#define MUS_ROUTE118 0x7FFF // Map is split into 2 music sections. controlled by GetCurrLocationDefaultMusic().
+
+#define MUS_NONE 0xFFFF
#endif // GUARD_CONSTANTS_SONGS_H
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index e2836c6f6..bdff1b865 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -140,55 +140,13 @@ struct SoundChannel
struct WaveData *wav;
u32 cp;
struct MusicPlayerTrack *track;
- u32 pp;
- u32 np;
- u32 d4;
+ void *pp;
+ void *np;
+ void *d4;
u16 xpi;
u16 xpc;
};
-#define MAX_DIRECTSOUND_CHANNELS 12
-
-#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer
-
-struct SoundInfo
-{
- // This field is normally equal to ID_NUMBER but it is set to other
- // values during sensitive operations for locking purposes.
- // This field should be volatile but isn't. This could potentially cause
- // race conditions.
- u32 ident;
-
- vu8 pcmDmaCounter;
-
- // Direct Sound
- u8 reverb;
- u8 maxChans;
- u8 masterVolume;
- u8 freq;
-
- u8 mode;
- u8 c15;
- u8 pcmDmaPeriod; // number of V-blanks per PCM DMA
- u8 maxLines;
- u8 gap[3];
- s32 pcmSamplesPerVBlank;
- s32 pcmFreq;
- s32 divFreq;
- struct CgbChannel *cgbChans;
- u32 func;
- u32 intp;
- void (*CgbSound)(void);
- void (*CgbOscOff)(u8);
- u32 (*MidiKeyToCgbFreq)(u8, u8, u8);
- u32 MPlayJumpTable;
- u32 plynote;
- u32 ExtVolPit;
- u8 gap2[16];
- struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS];
- s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2];
-};
-
struct SongHeader
{
u8 trackCount;
@@ -312,7 +270,7 @@ struct MusicPlayerInfo
struct MusicPlayerTrack *tracks;
struct ToneData *tone;
u32 ident;
- u32 func;
+ void (*func)();
u32 intp;
};
@@ -334,7 +292,47 @@ struct Song
extern const struct MusicPlayer gMPlayTable[];
extern const struct Song gSongTable[];
+#define MAX_DIRECTSOUND_CHANNELS 12
+
+#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer
+
+struct SoundInfo
+{
+ // This field is normally equal to ID_NUMBER but it is set to other
+ // values during sensitive operations for locking purposes.
+ // This field should be volatile but isn't. This could potentially cause
+ // race conditions.
+ u32 ident;
+
+ vu8 pcmDmaCounter;
+
+ // Direct Sound
+ u8 reverb;
+ u8 maxChans;
+ u8 masterVolume;
+ u8 freq;
+ u8 mode;
+ u8 c15;
+ u8 pcmDmaPeriod; // number of V-blanks per PCM DMA
+ u8 maxLines;
+ u8 gap[3];
+ s32 pcmSamplesPerVBlank;
+ s32 pcmFreq;
+ s32 divFreq;
+ struct CgbChannel *cgbChans;
+ void (*func)();
+ u32 intp;
+ void (*CgbSound)();
+ void (*CgbOscOff)(u8);
+ u32 (*MidiKeyToCgbFreq)(u8, u8, u8);
+ void (**MPlayJumpTable)();
+ void (*plynote)(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *);
+ void (*ExtVolPit)(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
+ u32 gap2[4];
+ struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS];
+ s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2];
+};
extern u8 gMPlayMemAccArea[];
@@ -448,7 +446,7 @@ void ply_tune(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_port(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_xcmd(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_endtie(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
-void ply_note(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
+void ply_note(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *);
// extended sound command handler functions
void ply_xxx(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
diff --git a/include/global.h b/include/global.h
index 7de8d1eb3..08988eac7 100644
--- a/include/global.h
+++ b/include/global.h
@@ -102,6 +102,7 @@
#define TEST_BUTTON(field, button) ({(field) & (button);})
#define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button)
#define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button)
+#define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button)
#define JOY_REPEAT(button) TEST_BUTTON(gMain.newAndRepeatedKeys, button)
#define S16TOPOSFLOAT(val) \
diff --git a/include/global.tv.h b/include/global.tv.h
index b211052e0..8e1a898b6 100644
--- a/include/global.tv.h
+++ b/include/global.tv.h
@@ -32,7 +32,7 @@ typedef union // size = 0x24
/*0x01*/ bool8 active;
/*0x02*/ u16 species;
/*0x04*/ u16 words[6];
- /*0x10*/ u8 playerName[8];
+ /*0x10*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x18*/ u8 language;
} fanclubLetter;
@@ -42,7 +42,7 @@ typedef union // size = 0x24
/*0x01*/ bool8 active;
/*0x02*/ u16 var02;
/*0x04*/ u16 words[6];
- /*0x10*/ u8 playerName[8];
+ /*0x10*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x18*/ u8 language;
} recentHappenings;
@@ -53,11 +53,11 @@ typedef union // size = 0x24
/*0x02*/ u16 species;
/*0x04*/ u8 friendshipHighNybble:4;
/*0x04*/ u8 questionAsked:4;
- /*0x05*/ u8 playerName[8];
+ /*0x05*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x0D*/ u8 language;
/*0x0E*/ u8 pokemonNameLanguage;
/*0x0F*/ u8 filler_0F[1];
- /*0x10*/ u8 nickname[8];
+ /*0x10*/ u8 nickname[PLAYER_NAME_LENGTH + 1];
/*0x18*/ u16 words18[2];
/*0x1C*/ u16 words[4];
} fanclubOpinions;
@@ -78,7 +78,7 @@ typedef union // size = 0x24
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 species;
- /*0x04*/ u8 pokemonName[11];
+ /*0x04*/ u8 pokemonName[POKEMON_NAME_LENGTH + 1];
/*0x0F*/ u8 trainerName[11];
/*0x1A*/ u8 random;
/*0x1B*/ u8 random2;
@@ -93,12 +93,12 @@ typedef union // size = 0x24
/*0x01*/ bool8 active;
/*0x02*/ u16 species;
/*0x04*/ u16 words[2];
- /*0x08*/ u8 pokemonNickname[11];
+ /*0x08*/ u8 pokemonNickname[POKEMON_NAME_LENGTH + 1];
/*0x13*/ u8 contestCategory:3;
/*0x13*/ u8 contestRank:2;
/*0x13*/ u8 contestResult:2;
/*0x14*/ u16 move;
- /*0x16*/ u8 playerName[8];
+ /*0x16*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x1E*/ u8 language;
/*0x1F*/ u8 pokemonNameLanguage;
} bravoTrainer;
@@ -107,7 +107,7 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
- /*0x02*/ u8 trainerName[8];
+ /*0x02*/ u8 trainerName[PLAYER_NAME_LENGTH + 1];
/*0x0A*/ u16 species;
/*0x0C*/ u8 pokemonName[8];
/*0x14*/ u16 defeatedSpecies;
@@ -125,14 +125,14 @@ typedef union // size = 0x24
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 losingSpecies;
- /*0x04*/ u8 losingTrainerName[8];
+ /*0x04*/ u8 losingTrainerName[PLAYER_NAME_LENGTH + 1];
/*0x0C*/ u8 loserAppealFlag;
/*0x0D*/ u8 round1Placing;
/*0x0e*/ u8 round2Placing;
/*0x0f*/ u8 winnerAppealFlag;
/*0x10*/ u16 move;
/*0x12*/ u16 winningSpecies;
- /*0x14*/ u8 winningTrainerName[8];
+ /*0x14*/ u8 winningTrainerName[PLAYER_NAME_LENGTH + 1];
/*0x1C*/ u8 category;
/*0x1D*/ u8 winningTrainerLanguage;
/*0x1E*/ u8 losingTrainerLanguage;
@@ -144,9 +144,9 @@ typedef union // size = 0x24
/*0x01*/ bool8 active;
/*0x02*/ u8 sheen;
/*0x03*/ u8 flavor:3;
- /*0x03*/ u8 unk_03_3:2;
- /*0x04*/ u8 worstBlenderName[8];
- /*0x0C*/ u8 playerName[8];
+ /*0x03*/ u8 color:2;
+ /*0x04*/ u8 worstBlenderName[PLAYER_NAME_LENGTH + 1];
+ /*0x0C*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x14*/ u8 language;
/*0x15*/ u8 worstBlenderLanguage;
} threeCheers;
@@ -156,8 +156,8 @@ typedef union // size = 0x24
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 speciesOpponent;
- /*0x04*/ u8 playerName[8];
- /*0x0C*/ u8 linkOpponentName[8];
+ /*0x04*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
+ /*0x0C*/ u8 linkOpponentName[PLAYER_NAME_LENGTH + 1];
/*0x14*/ u16 move;
/*0x16*/ u16 speciesPlayer;
/*0x18*/ u8 battleType;
@@ -169,10 +169,10 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
- /*0x02*/ u8 playerName[8];
+ /*0x02*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x0a*/ u8 idLo;
/*0x0b*/ u8 idHi;
- /*0x0c*/ u8 idolName[8];
+ /*0x0c*/ u8 idolName[PLAYER_NAME_LENGTH + 1];
/*0x14*/ u16 words[1];
/*0x16*/ u8 score;
/*0x17*/ u8 language;
@@ -183,9 +183,9 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
- /*0x02*/ u8 playerName[8];
+ /*0x02*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x0a*/ u8 contestCategory;
- /*0x0b*/ u8 nickname[11];
+ /*0x0b*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x16*/ u8 pokeblockState;
/*0x17*/ u8 language;
/*0x18*/ u8 pokemonNameLanguage;
@@ -198,11 +198,11 @@ typedef union // size = 0x24
/*0x01*/ bool8 active;
/*0x02*/ u8 language;
/*0x03*/ u8 language2;
- /*0x04*/ u8 nickname[11];
+ /*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x0F*/ u8 ball;
/*0x10*/ u16 species;
/*0x12*/ u8 nBallsUsed;
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} pokemonToday;
// TVSHOW_SMART_SHOPPER
@@ -215,7 +215,7 @@ typedef union // size = 0x24
/*0x06*/ u16 itemIds[3];
/*0x0C*/ u16 itemAmounts[3];
/*0x12*/ u8 shopLocation;
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} smartshopperShow;
// TVSHOW_POKEMON_TODAY_FAILED
@@ -229,7 +229,7 @@ typedef union // size = 0x24
/*0x10*/ u8 nBallsUsed;
/*0x11*/ u8 outcome;
/*0x12*/ u8 location;
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} pokemonTodayFailed;
// TVSHOW_FISHING_ADVICE
@@ -241,7 +241,7 @@ typedef union // size = 0x24
/*0x04*/ u16 species;
/*0x06*/ u8 language;
/*0x07*/ u8 pad07[12];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} pokemonAngler;
// TVSHOW_WORLD_OF_MASTERS
@@ -255,7 +255,7 @@ typedef union // size = 0x24
/*0x0a*/ u8 location;
/*0x0b*/ u8 language;
/*0x0c*/ u8 pad0c[7];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} worldOfMasters;
// TVSHOW_TODAYS_RIVAL_TRAINER
@@ -271,7 +271,7 @@ typedef union // size = 0x24
/*0x0a*/ u16 mapLayoutId;
/*0x0c*/ u8 language;
/*0x0d*/ u8 filler_0d[6];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} rivalTrainer;
// TVSHOW_TREND_WATCHER
@@ -283,7 +283,7 @@ typedef union // size = 0x24
/*0x08*/ u8 gender;
/*0x09*/ u8 language;
/*0x0a*/ u8 filler_0a[9];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} trendWatcher;
// TVSHOW_TREASURE_INVESTIGATORS
@@ -295,7 +295,7 @@ typedef union // size = 0x24
/*0x05*/ u8 language;
/*0x06*/ u16 mapLayoutId;
/*0x08*/ u8 filler_08[11];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} treasureInvestigators;
// TVSHOW_FIND_THAT_GAMER
@@ -308,7 +308,7 @@ typedef union // size = 0x24
/*0x06*/ u8 filler_06[2];
/*0x08*/ u8 language;
/*0x09*/ u8 filler_09[10];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} findThatGamer;
// TVSHOW_BREAKING_NEWS
@@ -324,7 +324,7 @@ typedef union // size = 0x24
/*0x0c*/ u16 lastUsedMove;
/*0x0e*/ u8 language;
/*0x0f*/ u8 filler_0f[4];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} breakingNews;
// TVSHOW_SECRET_BASE_VISIT
@@ -338,7 +338,7 @@ typedef union // size = 0x24
/*0x0a*/ u16 move;
/*0x0c*/ u8 language;
/*0x0d*/ u8 filler_0d[6];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} secretBaseVisit;
// TVSHOW_LOTTO_WINNER
@@ -349,7 +349,7 @@ typedef union // size = 0x24
/*0x04*/ u8 whichPrize;
/*0x05*/ u8 language;
/*0x06*/ u8 filler_06[13];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} lottoWinner;
// TVSHOW_BATTLE_SEMINAR
@@ -364,7 +364,7 @@ typedef union // size = 0x24
/*0x10*/ u8 nOtherMoves;
/*0x11*/ u8 language;
/*0x12*/ u8 filler_12[1];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} battleSeminar;
// TVSHOW_TRAINER_FAN_CLUB
@@ -375,7 +375,7 @@ typedef union // size = 0x24
/*0x04*/ u16 words[2];
/*0x08*/ u8 language;
/*0x09*/ u8 filler_09[10];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} trainerFanClub;
// TVSHOW_CUTIES
@@ -384,11 +384,11 @@ typedef union // size = 0x24
/*0x01*/ bool8 active;
/*0x02*/ u8 nRibbons;
/*0x03*/ u8 selectedRibbon;
- /*0x04*/ u8 nickname[11];
+ /*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x0f*/ u8 language;
/*0x10*/ u8 pokemonNameLanguage;
/*0x11*/ u8 filler_12[2];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} cuties;
// TVSHOW_FRONTIER
@@ -403,7 +403,7 @@ typedef union // size = 0x24
/*0x0c*/ u8 language;
/*0x0d*/ u8 facility;
/*0x0e*/ u8 filler_0e[5];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} frontier;
// TVSHOW_NUMBER_ONE
@@ -414,7 +414,7 @@ typedef union // size = 0x24
/*0x04*/ u8 actionIdx;
/*0x05*/ u8 language;
/*0x06*/ u8 filler_06[13];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} numberOne;
// TVSHOW_SECRET_BASE_SECRETS
@@ -422,11 +422,11 @@ typedef union // size = 0x24
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 stepsInBase;
- /*0x04*/ u8 baseOwnersName[8];
+ /*0x04*/ u8 baseOwnersName[PLAYER_NAME_LENGTH + 1];
/*0x0c*/ u32 flags;
/*0x10*/ u16 item;
/*0x12*/ u8 savedState;
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x1b*/ u8 language;
/*0x1c*/ u8 baseOwnersNameLanguage;
} secretBaseSecrets;
@@ -439,7 +439,7 @@ typedef union // size = 0x24
/*0x03*/ u8 nPkblkUsed;
/*0x04*/ u8 language;
/*0x05*/ u8 filler_05[14];
- /*0x13*/ u8 playerName[8];
+ /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} safariFanClub;
// Mass Outbreak
diff --git a/include/graphics.h b/include/graphics.h
index 4c98bee47..d9189622a 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -4812,16 +4812,16 @@ extern const u16 gUsePokeblockGraph_Pal[];
extern const u16 gUsePokeblockNatureWin_Pal[];
// Berry blender
-extern const u32 gBerryBlenderArrowTiles[];
-extern const u32 gBerryBlenderStartTiles[];
-extern const u32 gBerryBlenderMarubatsuTiles[];
-extern const u32 gBerryBlenderParticlesTiles[];
-extern const u32 gBerryBlenderCountdownNumbersTiles[];
+extern const u32 gBerryBlenderPlayerArrow_Gfx[];
+extern const u32 gBerryBlenderStart_Gfx[];
+extern const u32 gBerryBlenderScoreSymbols_Gfx[];
+extern const u32 gBerryBlenderParticles_Gfx[];
+extern const u32 gBerryBlenderCountdownNumbers_Gfx[];
extern const u16 gBerryBlenderMiscPalette[];
extern const u16 gBerryBlenderArrowPalette[];
-extern const u32 sBlenderCenterGfx[];
-extern const u32 gUnknown_08D91DB8[];
-extern const u32 gUnknown_08D927EC[];
+extern const u32 gBerryBlenderCenter_Gfx[];
+extern const u32 gBerryBlenderOuter_Gfx[];
+extern const u32 gBerryBlenderOuter_Tilemap[];
// Slot Machine
extern const u32 gSlotMachineDigitalDisplay_Gfx[];
diff --git a/include/item_menu.h b/include/item_menu.h
index edfb986f7..a99272b0c 100644
--- a/include/item_menu.h
+++ b/include/item_menu.h
@@ -93,7 +93,7 @@ void CB2_GoToSellMenu(void);
void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)());
void DoWallyTutorialBagMenu(void);
void ResetBagScrollPositions(void);
-void ChooseBerrySetCallback(void (*callback)(void));
+void ChooseBerryForMachine(void (*exitCallback)(void));
void CB2_ChooseBerry(void);
void Task_FadeAndCloseBagMenu(u8 taskId);
void BagMenu_YesNo(u8, u8, const struct YesNoFuncTable*);
diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h
index 75e9100d2..e061149fc 100644
--- a/include/item_menu_icons.h
+++ b/include/item_menu_icons.h
@@ -19,7 +19,7 @@ void sub_80D4FC8(u8 arg0);
void sub_80D4FEC(u8 arg0);
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y);
void FreeBerryTagSpritePalette(void);
-u8 LoadSpinningBerryPicGfx(u8 berryId, u8 x, u8 y, bool8 startAffine);
+u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine);
u8 CreateBerryFlavorCircleSprite(s16 x);
#define TAG_BAG_GFX 100
diff --git a/include/link.h b/include/link.h
index de10bb8dc..086bf787b 100644
--- a/include/link.h
+++ b/include/link.h
@@ -48,52 +48,60 @@
#define EXTRACT_LINK_ERRORS(status) \
(((status) & LINK_STAT_ERRORS) >> LINK_STAT_ERRORS_SHIFT)
-#define LINKCMD_SEND_LINK_TYPE 0x2222
-#define LINKCMD_READY_EXIT_STANDBY 0x2FFE
-#define LINKCMD_SEND_HELD_KEYS 0x4444
-#define LINKCMD_0x5555 0x5555
-#define LINKCMD_0x5566 0x5566
-#define LINKCMD_READY_CLOSE_LINK 0x5FFF
-#define LINKCMD_0x6666 0x6666
-#define LINKCMD_0x7777 0x7777
-#define LINKCMD_CONT_BLOCK 0x8888
-#define LINKCMD_0xAAAA 0xAAAA
-#define LINKCMD_0xAAAB 0xAAAB
-#define LINKCMD_READY_TO_TRADE 0xAABB
-#define LINKCMD_READY_FINISH_TRADE 0xABCD
-#define LINKCMD_INIT_BLOCK 0xBBBB
-#define LINKCMD_READY_CANCEL_TRADE 0xBBCC
-#define LINKCMD_SEND_HELD_KEYS_2 0xCAFE
-#define LINKCMD_SEND_BLOCK_REQ 0xCCCC
-#define LINKCMD_START_TRADE 0xCCDD
-#define LINKCMD_CONFIRM_FINISH_TRADE 0xDCBA
-#define LINKCMD_SET_MONS_TO_TRADE 0xDDDD
-#define LINKCMD_0xDDEE 0xDDEE
-#define LINKCMD_REQUEST_CANCEL 0xEEAA
-#define LINKCMD_CANCEL_TRADE 0xEEBB
-#define LINKCMD_0xEECC 0xEECC
-
-#define LINKTYPE_TRADE 0x1111
-#define LINKTYPE_TRADE_CONNECTING 0x1122
-#define LINKTYPE_TRADE_SETUP 0x1133
-#define LINKTYPE_TRADE_DISCONNECTED 0x1144
-#define LINKTYPE_BATTLE 0x2211
-#define LINKTYPE_0x2222 0x2222 // unused battle?
-#define LINKTYPE_SINGLE_BATTLE 0x2233
-#define LINKTYPE_DOUBLE_BATTLE 0x2244
-#define LINKTYPE_MULTI_BATTLE 0x2255
-#define LINKTYPE_BATTLE_TOWER_50 0x2266
-#define LINKTYPE_BATTLE_TOWER_OPEN 0x2277
-#define LINKTYPE_BATTLE_TOWER 0x2288
-#define LINKTYPE_RECORD_MIX_BEFORE 0x3311
-#define LINKTYPE_RECORD_MIX_AFTER 0x3322
-#define LINKTYPE_BERRY_BLENDER_SETUP 0x4411
-#define LINKTYPE_BERRY_BLENDER 0x4422
-#define LINKTYPE_MYSTERY_EVENT 0x5501
-#define LINKTYPE_0x5502 0x5502 // unused?
-#define LINKTYPE_EREADER 0x5503
-#define LINKTYPE_CONTEST_GMODE 0x6601
-#define LINKTYPE_CONTEST_EMODE 0x6602
+#define LINKCMD_BLENDER_STOP 0x1111
+#define LINKCMD_SEND_LINK_TYPE 0x2222
+#define LINKCMD_BLENDER_SCORE_MISS 0x2345
+#define LINKCMD_READY_EXIT_STANDBY 0x2FFE
+#define LINKCMD_SEND_PACKET 0x2FFF
+#define LINKCMD_BLENDER_SEND_KEYS 0x4444
+#define LINKCMD_BLENDER_SCORE_BEST 0x4523
+#define LINKCMD_BLENDER_SCORE_GOOD 0x5432
+#define LINKCMD_0x5555 0x5555
+#define LINKCMD_0x5566 0x5566
+#define LINKCMD_READY_CLOSE_LINK 0x5FFF
+#define LINKCMD_0x6666 0x6666
+#define LINKCMD_0x7777 0x7777
+#define LINKCMD_BLENDER_PLAY_AGAIN 0x7779
+#define LINKCMD_0x7FFF 0x7FFF
+#define LINKCMD_CONT_BLOCK 0x8888
+#define LINKCMD_BLENDER_NO_BERRIES 0x9999
+#define LINKCMD_BLENDER_NO_PBLOCK_SPACE 0xAAAA
+#define LINKCMD_0xAAAB 0xAAAB
+#define LINKCMD_READY_TO_TRADE 0xAABB
+#define LINKCMD_READY_FINISH_TRADE 0xABCD
+#define LINKCMD_INIT_BLOCK 0xBBBB
+#define LINKCMD_READY_CANCEL_TRADE 0xBBCC
+#define LINKCMD_SEND_HELD_KEYS 0xCAFE
+#define LINKCMD_SEND_BLOCK_REQ 0xCCCC
+#define LINKCMD_START_TRADE 0xCCDD
+#define LINKCMD_CONFIRM_FINISH_TRADE 0xDCBA
+#define LINKCMD_SET_MONS_TO_TRADE 0xDDDD
+#define LINKCMD_0xDDEE 0xDDEE
+#define LINKCMD_REQUEST_CANCEL 0xEEAA
+#define LINKCMD_CANCEL_TRADE 0xEEBB
+#define LINKCMD_0xEECC 0xEECC
+
+#define LINKTYPE_TRADE 0x1111
+#define LINKTYPE_TRADE_CONNECTING 0x1122
+#define LINKTYPE_TRADE_SETUP 0x1133
+#define LINKTYPE_TRADE_DISCONNECTED 0x1144
+#define LINKTYPE_BATTLE 0x2211
+#define LINKTYPE_0x2222 0x2222 // unused battle?
+#define LINKTYPE_SINGLE_BATTLE 0x2233
+#define LINKTYPE_DOUBLE_BATTLE 0x2244
+#define LINKTYPE_MULTI_BATTLE 0x2255
+#define LINKTYPE_BATTLE_TOWER_50 0x2266
+#define LINKTYPE_BATTLE_TOWER_OPEN 0x2277
+#define LINKTYPE_BATTLE_TOWER 0x2288
+#define LINKTYPE_RECORD_MIX_BEFORE 0x3311
+#define LINKTYPE_RECORD_MIX_AFTER 0x3322
+#define LINKTYPE_BERRY_BLENDER_SETUP 0x4411
+#define LINKTYPE_BERRY_BLENDER 0x4422
+#define LINKTYPE_MYSTERY_EVENT 0x5501
+#define LINKTYPE_0x5502 0x5502 // unused?
+#define LINKTYPE_EREADER 0x5503
+#define LINKTYPE_CONTEST_GMODE 0x6601
+#define LINKTYPE_CONTEST_EMODE 0x6602
struct LinkStatus
{
@@ -230,7 +238,7 @@ extern u16 gSendCmd[CMD_LENGTH];
extern struct LinkPlayer gLinkPlayers[5];
extern u16 word_3002910[];
extern bool8 gReceivedRemoteLinkPlayers;
-extern u32 gUnknown_020223C0;
+extern u32 gBerryBlenderKeySendAttempts;
extern bool8 gLinkVSyncDisabled;
extern u32 gLinkStatus;
@@ -280,7 +288,7 @@ u8 IsLinkMaster(void);
void SetCloseLinkCallback(void);
bool8 HandleLinkConnection(void);
void SetLinkDebugValues(u32 seed, u32 flags);
-void sub_800A418(void);
+void SetBerryBlenderLinkCallback(void);
void SetSuppressLinkErrorMessage(bool8 flag);
void sub_800B524(struct LinkPlayer *linkPlayer);
u8 GetSioMultiSI(void);
diff --git a/include/link_rfu.h b/include/link_rfu.h
index 4d00039eb..9476da6b7 100644
--- a/include/link_rfu.h
+++ b/include/link_rfu.h
@@ -5,18 +5,18 @@
#include "link.h"
#include "AgbRfu_LinkManager.h"
-#define RFU_COMMAND_0x4400 0x4400
-#define RFU_COMMAND_0x8800 0x8800
-#define RFU_COMMAND_0x8900 0x8900
-#define RFU_COMMAND_SEND_BLOCK_REQ 0xA100
-#define RFU_COMMAND_0x7700 0x7700
-#define RFU_COMMAND_0x7800 0x7800
-#define RFU_COMMAND_READY_EXIT_STANDBY 0x6600
-#define RFU_COMMAND_READY_CLOSE_LINK 0x5F00
-#define RFU_COMMAND_0x2F00 0x2F00
-#define RFU_COMMAND_0xBE00 0xBE00
-#define RFU_COMMAND_0xEE00 0xEE00
-#define RFU_COMMAND_0xED00 0xED00
+#define RFUCMD_SEND_PACKET 0x2F00
+#define RFUCMD_BLENDER_SEND_KEYS 0x4400
+#define RFUCMD_READY_CLOSE_LINK 0x5F00
+#define RFUCMD_READY_EXIT_STANDBY 0x6600
+#define RFUCMD_0x7700 0x7700
+#define RFUCMD_0x7800 0x7800
+#define RFUCMD_0x8800 0x8800
+#define RFUCMD_0x8900 0x8900
+#define RFUCMD_SEND_BLOCK_REQ 0xA100
+#define RFUCMD_SEND_HELD_KEYS 0xBE00
+#define RFUCMD_0xED00 0xED00
+#define RFUCMD_0xEE00 0xEE00
#define RFU_SERIAL_7F7D 0x7F7D
@@ -29,6 +29,8 @@
#define BACKUP_QUEUE_NUM_SLOTS 2
#define BACKUP_QUEUE_SLOT_LENGTH 14
+#define RFU_PACKET_SIZE 6
+
#define RFU_STATUS_OK 0
#define RFU_STATUS_FATAL_ERROR 1
#define RFU_STATUS_CONNECTION_ERROR 2
@@ -140,7 +142,7 @@ struct GFRfuManager
/* 0x0ef */ bool8 isShuttingDown;
/* 0x0f0 */ u8 linkLossRecoveryState;
/* 0x0f1 */ u8 status;
- /* 0x0f2 */ u16 unk_f2[6];
+ /* 0x0f2 */ u16 packet[RFU_PACKET_SIZE];
/* 0x0fe */ u16 resendExitStandbyTimer;
/* 0x100 */ u16 unk_100;
/* 0x102 */ u8 unk_102;
@@ -197,7 +199,7 @@ void Rfu_SetBlockReceivedFlag(u8 who);
void Rfu_ResetBlockReceivedFlag(u8 who);
bool32 IsSendingKeysToRfu(void);
void StartSendingKeysToRfu(void);
-void sub_800F850(void);
+void Rfu_SetBerryBlenderLinkCallback(void);
u8 Rfu_GetBlockReceivedStatus(void);
bool32 Rfu_InitBlockSend(const u8 *src, size_t size);
void ClearLinkRfuCallback(void);
@@ -250,7 +252,7 @@ void SetTradeBoardRegisteredMonInfo(u32 type, u32 species, u32 level);
void InitializeRfuLinkManager_EnterUnionRoom(void);
void sub_8012188(const u8 *name, struct GFtgtGname *structPtr, u8 a2);
bool32 IsUnionRoomListenTaskActive(void);
-void sub_800FE50(void *a0);
+void Rfu_SendPacket(void *data);
bool32 PlayerHasMetTrainerBefore(u16 id, u8 *name);
void sub_8011DE0(u32 arg0);
u8 sub_801100C(s32 a0);
diff --git a/include/menu.h b/include/menu.h
index a57b3718f..1bd800742 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -8,6 +8,12 @@
#define MENU_NOTHING_CHOSEN -2
#define MENU_B_PRESSED -1
+#define MENU_CURSOR_DELTA_NONE 0
+#define MENU_CURSOR_DELTA_UP -1
+#define MENU_CURSOR_DELTA_DOWN 1
+#define MENU_CURSOR_DELTA_LEFT -1
+#define MENU_CURSOR_DELTA_RIGHT 1
+
enum
{
SAVE_MENU_NAME,
@@ -77,7 +83,7 @@ void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
-u8 sub_8199134(s8, s8);
+u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY);
u8 GetStartMenuWindowId(void);
void ListMenuLoadStdPalAt(u8, u8);
u8 Menu_MoveCursor(s8 cursorDelta);
diff --git a/include/pokeball.h b/include/pokeball.h
index 12b9b1eff..1cdb08f94 100644
--- a/include/pokeball.h
+++ b/include/pokeball.h
@@ -18,6 +18,14 @@ enum
POKEBALL_COUNT
};
+enum {
+ BALL_AFFINE_ANIM_0,
+ BALL_ROTATE_RIGHT,
+ BALL_ROTATE_LEFT,
+ BALL_AFFINE_ANIM_3,
+ BALL_AFFINE_ANIM_4
+};
+
extern const struct SpriteTemplate gBallSpriteTemplates[];
#define POKEBALL_PLAYER_SENDOUT 0xFF
diff --git a/include/pokeblock.h b/include/pokeblock.h
index 0d413a810..c82e99d8f 100644
--- a/include/pokeblock.h
+++ b/include/pokeblock.h
@@ -9,12 +9,21 @@
enum
{
- PBLOCK_CLR_BLACK,
+ PBLOCK_CLR_NONE,
PBLOCK_CLR_RED,
PBLOCK_CLR_BLUE,
PBLOCK_CLR_PINK,
PBLOCK_CLR_GREEN,
- PBLOCK_CLR_YELLOW
+ PBLOCK_CLR_YELLOW,
+ PBLOCK_CLR_PURPLE,
+ PBLOCK_CLR_INDIGO,
+ PBLOCK_CLR_BROWN,
+ PBLOCK_CLR_LITE_BLUE,
+ PBLOCK_CLR_OLIVE,
+ PBLOCK_CLR_GRAY,
+ PBLOCK_CLR_BLACK,
+ PBLOCK_CLR_WHITE,
+ PBLOCK_CLR_GOLD,
};
enum
diff --git a/include/strings.h b/include/strings.h
index 1f2920140..7018f9e0d 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -2983,4 +2983,9 @@ extern const u8 gText_Smartness[];
extern const u8 gText_Cuteness[];
extern const u8 gText_Beauty3[];
+// Berry Blender
+extern const u8 gText_SavingDontTurnOff2[];
+extern const u8 gText_BlenderMaxSpeedRecord[];
+extern const u8 gText_234Players[];
+
#endif // GUARD_STRINGS_H