diff options
author | jdflyer <jdflyer10@gmail.com> | 2021-09-01 17:14:01 -0700 |
---|---|---|
committer | jdflyer <jdflyer10@gmail.com> | 2021-09-01 17:14:01 -0700 |
commit | 0be90f78791ac10fe974a9ace31e99e598dda375 (patch) | |
tree | 438d7104720c946664859479a58a1a3f77176566 | |
parent | e0f7687c216ae63c7b3d9f4c76c5551cc1930fd2 (diff) |
Fix BGM Table
-rw-r--r-- | source/musicRando.cpp | 102 |
1 files changed, 53 insertions, 49 deletions
diff --git a/source/musicRando.cpp b/source/musicRando.cpp index bdb21b0..2006596 100644 --- a/source/musicRando.cpp +++ b/source/musicRando.cpp @@ -5,63 +5,61 @@ #include "tp/Z2SeqMgr.h" struct BGM { //Struct to store info about the source of BGM and the waves required to play correctly. Not using full Ids here to save memory - u8 id = 0x0; - u8 bgmwave_1 = 0x0; - u8 bgmwave_2 = 0x0; + u8 id; + u8 bgmwave_1; }; static const BGM bgmSource[] = { {0x0,0x19}, {0x1,0x19}, -{0x4,0xd}, -{0x5,0x3,0x4}, -{0x6,0x1,0x2}, -{0x9,0xa,0x40}, -{0xd,0xc}, -{0xe,0xc}, -{0xf}, -{0x10,0x1,0x2}, -{0x11,0x1,0x2}, +{0x4,0x0d}, +{0x5,0x03}, +{0x6,0x02}, +{0x9,0x0a}, +{0xd,0x0c}, +{0xe,0x0c}, +{0xf,0x00}, +{0x10,0x1}, +{0x11,0x2}, {0x16,0xe}, {0x17,0x5}, -{0x18,0x13,0x3c}, +{0x18,0x13}, {0x1a,0x11}, {0x1b,0xe}, -{0x1d,0x13,0x14}, +{0x1d,0x14}, {0x1e,0x7}, {0x1f,0x7}, -{0x20,0x15,0x40}, +{0x20,0x15}, {0x23,0xf}, -{0x24,0x8,0x9}, +{0x24,0x9}, {0x25,0x16}, -{0x26,0x10,0x18}, -{0x27,0x15,0x17}, -{0x29,0x10,0x18}, +{0x26,0x10}, +{0x27,0x17}, +{0x29,0x18}, {0x2c,0x8}, -{0x2d,0x1a,0x41}, -//{0x2e,0x40}, //Lost woods statue game (Currently doesn't work) -{0x2f,0xe,0x1c}, +{0x2d,0x1a}, +{0x2e,0x1b}, +{0x2f,0x1c}, {0x30,0x1e}, {0x31,0x1e}, {0x34,0x1f}, {0x35,0x20}, -{0x36,0xe,0x1c}, -{0x37,0x1d,0x40}, -{0x39,0x28,0x48}, +{0x37,0x1d}, +{0x39,0x48}, {0x3a,0x24}, {0x3b,0x25}, -{0x3c,0x26,0x40}, +{0x3c,0x26}, {0x3d,0x27}, {0x3e,0x28}, {0x3f,0x29}, -{0x40,0x11,0x12}, -{0x41,0x2a,0x1b}, +{0x40,0x11}, +{0x41,0x2a}, {0x42,0x2b}, -{0x47,0xe,0x2c}, +{0x47,0x2c}, {0x48,0x2c}, -{0x49}, -{0x4a,0x2d,0x3a}, -{0x4b,0x2d,0x3a}, +{0x49,0x00}, +{0x4a,0x2d}, +{0x4b,0x3a}, {0x4c,0x2e}, {0x4d,0x2e}, {0x50,0x2f}, @@ -69,40 +67,40 @@ static const BGM bgmSource[] = { {0x57,0x31}, {0x58,0x32}, {0x59,0x33}, -{0x5a,0x34}, //Lake hylia, but plays plums song; MUST FIGURE OUT +{0x5a,0x34}, //Lake hylia, but plays plums song {0x5e,0x35}, {0x5f,0x36}, {0x60,0x37}, -{0x61,0x26,0x3f}, +{0x61,0x3f}, {0x62,0x39}, {0x6b,0x3e}, -{0x6c,0x26,0x3f}, +{0x6c,0x3f}, {0x6d,0x40}, -{0x6e,0x24,0x57}, -{0x6f,0x26,0x3f}, +{0x6e,0x57}, +{0x6f,0x3f}, {0x70,0x44}, {0x77,0x45}, {0x78,0x46}, {0x7a,0x46}, -{0x85,0x28,0x48}, +{0x85,0x48}, {0x86,0x49}, {0x87,0x4a}, {0x88,0x4b}, -{0x8b,0x4c,0x1a}, -{0x8c,0x4c,0x1a}, -{0x8f,0x1e,0x27}, -{0x90,0x1e,0x27}, -{0x91,0x8,0x47}, -{0x94,0x4e,0x26}, -{0x95,0x4e,0x26}, -{0x96,0x1c,0xe}, //might not be right -{0x97,0x3d,0x1c}, +{0x8b,0x4c}, +{0x8c,0x4c}, +{0x8f,0x1e}, +{0x90,0x1e}, +{0x91,0x47}, +{0x94,0x4e}, +{0x95,0x4e}, +{0x96,0x3d}, +{0x97,0x3d}, {0x9a,0x8}, {0x9b,0x56}, {0x9e,0x19}, {0x9f,0x55}, {0xa5,0x57}, -{0xa8,0x58,0x29}, //Might not be right +{0xa8,0x58}, {0xa9,0x59} }; @@ -131,7 +129,11 @@ void sceneChangeHook(Z2SceneMgr* sceneMgr, JAISoundID BGMId,u8 SeWave1,u8 SeWave if (found) { JAISoundID new_id; new_id.id = bgmSource[index_of_id].id + 0x1000000; - sceneChange_trampoline(sceneMgr,new_id,SeWave1,SeWave2,bgmSource[index_of_id].bgmwave_1,bgmSource[index_of_id].bgmwave_2,DemoWave,param_7); + if(bgmSource[index_of_id].bgmwave_1==0) { + sceneChange_trampoline(sceneMgr,new_id,SeWave1,SeWave2,BgmWave1,BgmWave2,DemoWave,param_7); + }else{ + sceneChange_trampoline(sceneMgr,new_id,SeWave1,SeWave2,bgmSource[index_of_id].bgmwave_1,BgmWave2,DemoWave,param_7); + } }else{ sceneChange_trampoline(sceneMgr,BGMId,SeWave1,SeWave2,BgmWave1,BgmWave2,DemoWave,param_7); } @@ -159,11 +161,13 @@ namespace mod::musicrando { for (u8 j = 0; j<i; j++) { if (randomizedBGMs[j] == idGot){ valueExists = true; + break; } } if (valueExists == false){ randomizedBGMs[i] = bgmSource[random].id; gotUnique = true; + break; } } } |