From 91cc1c2dd9d9c5ec8ca1ac54580f77376d2c0424 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Mon, 9 Jul 2012 22:45:35 -0500 Subject: Added a name table to the song hack --- src/music.cpp | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/music.cpp b/src/music.cpp index 6a92a23..669a775 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -15,6 +15,80 @@ struct Hijacker { }; + +const char* SongNameList [] = { + "AIRSHIP", + "BOSS", + "MENU", + "UNDERWATER", + "ATHLETIC", + "CASTLE", + "MAIN", + "MOUNTAIN", + "TOWER", + "UNDERGROUND", + "DESERT", + "FIRE", + "FOREST", + "FREEZEFLAME", + "JAPAN", + "PUMPKIN", + "SEWER", + "SPACE", + "BOWSER", + "", + "", + "", + "", + "", + "", + "AUTUMN", + "CRYSTALCAVES", + "GHOST_HOUSE", + "GRAVEYARD", + "JUNGLE", + "TROPICAL", + "SKY_CITY", + "SNOW", + "STAR_HAVEN", + "SINGALONG", + "FACTORY", + "TANK", + "TRAIN", + "YOSHIHOUSE", + "FACTORYB", + "", + "", + "", + "", + "", + "CHALLENGE", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "YOSHI ISLAND MAP", + "GOLDWOOD MAP", + "SEWER MAP", + "FULLMAP FRONT", + "FULLMAP REAR", + "MINIMEGA MAP", + "FF VOLCANO MAP", + "CRYSTAL CAVE MAP", + "SPACE MAP", + "SKY CITY MAP", + "KOOPA PLANET MAP", + "KOOPA CORE MAP", + NULL +}; + + + // Offsets are from the start of the INFO block, not the start of the brsar. // INFO begins at 0x212C0, so that has to be subtracted from absolute offsets // within the brsar. @@ -72,8 +146,10 @@ extern "C" u8 after_course_getMusicForZone(u8 realThemeID) { // write the stream's info HijackedStream *stream = &hj->stream[hj->currentStream]; - sprintf(BrsarInfoOffset(stream->stringOffset), "stream/theme%03d.brstm", realThemeID); - sprintf(BrsarInfoOffset(stream->stringOffsetFast), "stream/theme%03d_fast.brstm", realThemeID); + OSReport("%d", realThemeID); + OSReport("%s", SongNameList[realThemeID-99]); + sprintf(BrsarInfoOffset(stream->stringOffset), "new/%s.er", SongNameList[realThemeID-100]); + sprintf(BrsarInfoOffset(stream->stringOffsetFast), "new/%s_F.er", SongNameList[realThemeID-100]); // update filesizes FixFilesize(stream->stringOffset); -- cgit v1.2.3