Additional Music Slots

From NSMBW Modding Database
Jump to navigation Jump to search

This article describes how to add additional music slots to the source of Newer Super Mario Bros. Wii.

For prerequisites, please see Setting Up and Compiling the Newer Sources. You must know how to compile Newer.


music.cpp

In your Kamek\src folder, locate the file music.cpp and open it with a text editor.

In line 21, there is a function that declares each variable of a list to be constants. Constants cannot be altered by the program.

const char* SongNameList [] = {}

The technical lingo aside, this is where the list of songs is generated for the game.

If we carefully check out the structure of this list then we'll notice the following:

  • Each entry is written on a new line.
  • The entry on the first line has Song ID 100 later in-game.
  • The last possible song ID is 199.
  • To skip a song ID, an empty new line needs to be added.
  • The original game uses song IDs 1-27 (0 = "None").

It is therefore recommended to add new entries starting with song ID 160 to prevent interfering with Newer's songs.

The Original Code

const char* SongNameList [] = {
	"AIRSHIP",          // ID 100
	"BOSS_TOWER",       // ID 101
	"MENU",
	"UNDERWATER",
	"ATHLETIC",
	"CASTLE",
	"MAIN",
	"MOUNTAIN",
	"TOWER",
	"UNDERGROUND",
	"DESERT",
	"FIRE",
	"FOREST",
	"FREEZEFLAME",
	"JAPAN",
	"PUMPKIN",
	"SEWER",
	"SPACE",
	"BOWSER",
	"BONUS",
	"AMBUSH",
	"BRIDGE_DRUMS",
	"SNOW2",
	"MINIMEGA",
	"CLIFFS",
	"AUTUMN",
	"CRYSTALCAVES",
	"GHOST_HOUSE",
	"GRAVEYARD",
	"JUNGLE",
	"TROPICAL",
	"SKY_CITY",
	"SNOW",
	"STAR_HAVEN",
	"SINGALONG",
	"FACTORY",
	"TANK",
	"TRAIN",
	"YOSHIHOUSE",
	"FACTORYB",
	"CAVERN",
	"SAND",
	"SHYGUY",
	"MINIGAME",
	"BONUS_AREA",
	"CHALLENGE",
	"BOWSER_CASTLE",        // ID 146
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"BOSS_CASTLE",          // ID 156
	"BOSS_AIRSHIP",         // ID 157
	NULL
};

Modified for Additional Songs

const char* SongNameList [] = {
	"AIRSHIP",          // ID 100
	"BOSS_TOWER",       // ID 101
	"MENU",
	"UNDERWATER",
	"ATHLETIC",
	"CASTLE",
	"MAIN",
	"MOUNTAIN",
	"TOWER",
	"UNDERGROUND",
	"DESERT",
	"FIRE",
	"FOREST",
	"FREEZEFLAME",
	"JAPAN",
	"PUMPKIN",
	"SEWER",
	"SPACE",
	"BOWSER",
	"BONUS",
	"AMBUSH",
	"BRIDGE_DRUMS",
	"SNOW2",
	"MINIMEGA",
	"CLIFFS",
	"AUTUMN",
	"CRYSTALCAVES",
	"GHOST_HOUSE",
	"GRAVEYARD",
	"JUNGLE",
	"TROPICAL",
	"SKY_CITY",
	"SNOW",
	"STAR_HAVEN",
	"SINGALONG",
	"FACTORY",
	"TANK",
	"TRAIN",
	"YOSHIHOUSE",
	"FACTORYB",
	"CAVERN",
	"SAND",
	"SHYGUY",
	"MINIGAME",
	"BONUS_AREA",
	"CHALLENGE",
	"BOWSER_CASTLE",    // ID 146
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"BOSS_CASTLE",      // ID 156
	"BOSS_AIRSHIP",     // ID 157
	"",
	"",
	"SONG_160",         // ID 160
	"SONG_161",
	"SONG_162",
	"SONG_163",
	"SONG_164",
	"SONG_165",
	"SONG_166",
	"SONG_167",
	"SONG_168",
	"SONG_169",
	"SONG_170",
	"SONG_171",
	"SONG_172",
	"SONG_173",
	"SONG_174",
	"SONG_175",
	"SONG_176",
	"SONG_177",
	"SONG_178",
	"SONG_179",
	"SONG_180",
	"SONG_181",
	"SONG_182",
	"SONG_183",
	"SONG_184",
	"SONG_185",
	"SONG_186",
	"SONG_187",
	"SONG_188",
	"SONG_189",
	"SONG_190",
	"SONG_191",
	"SONG_192",
	"SONG_193",
	"SONG_194",
	"SONG_195",
	"SONG_196",
	"SONG_197",
	"SONG_198",
	"SONG_199",         // ID 199
	NULL
};

Additional Steps

  • If any of the new song IDs are used in a zone, then the equivalent .brstm or .er file needs to be present inside \Sound\new\ in the Newer file system. See Custom Music.
  • The text file for Reggie (Next) holding all the music entries needs to be updated so that all new entries are available. This is done in the file music.txt inside the folder

\Reggie\reggiedata\music.txt \\ For NSMBW; don't edit this file
\Reggie\reggiedata\patches\NewerSMBW\music.txt \\ Or your personal game patch

Setting the song ID to the respective number without changing music.txt works as well. It's just more convenient having the correct song names shown inside Reggie.

A modified music.txt file
0:None
1:Overworld
2:Underground
3:Underwater
4:Mushrooms/Athletic
5:Ghost House
6:Pyramids
7:Snow
8:Lava
9:Tower
10:Castle
11:Airship
12:Bonus Area
13:Drum Rolls
14:Tower Boss
15:Castle Boss
16:Toad House
17:Airship Boss
18:Forest
19:Enemy Ambush
20:Beach
21:Lava Cave
22:Peach's Castle
23:Credits Jazz
24:Airship Drums
25:Bowser
26:Mega Bowser
27:Epilogue
100:Airship
101:Tower Boss
102:Menu
103:Underwater
104:Mushrooms/Athletic
105:Castle
106:Main
107:Mountain
108:Tower
109:Underground
110:Desert
111:Fire
112:Forest
113:Freezeflame
114:Japan
115:Pumpkin
116:Sewer
117:Space
118:Bowser
119:Bonus
120:Ambush
121:Bridge Drums
122:Snow
123:Mini-Mega
124:Cliffs
125:Autumn
126:Crystal Caves
127:Ghost House
128:Graveyard
129:Jungle
130:Tropical
131:Sky City
132:Snow (2)
133:Star Haven
134:Singalong
135:Factory
136:Tank
137:Train
138:Yoshi House
139:Factory (2)
140:Cavern
141:Sand
142:Shy Guy
143:Minigame
144:Bonus Area
145:Challenge
146:Bowser's Castle
156:Castle Boss
157:Airship Boss
160:SONG_160
161:SONG_161
162:SONG_162
163:SONG_163
164:SONG_164
165:SONG_165
166:SONG_166
167:SONG_167
168:SONG_168
169:SONG_169
170:SONG_170
171:SONG_171
172:SONG_172
173:SONG_173
174:SONG_174
175:SONG_175
176:SONG_176
177:SONG_177
178:SONG_178
179:SONG_179
180:SONG_180
181:SONG_181
182:SONG_182
183:SONG_183
184:SONG_184
185:SONG_185
186:SONG_186
187:SONG_187
188:SONG_188
189:SONG_189
190:SONG_190
191:SONG_191
192:SONG_192
193:SONG_193
194:SONG_194
195:SONG_195
196:SONG_196
197:SONG_197
198:SONG_198
199:SONG_199